ホーム › NetworkManagement.Dns › DNS_TSIG_DATAA
DNS_TSIG_DATAA
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| pNameAlgorithm | LPSTR | 8/4 | +0 | +0 | 署名に用いたアルゴリズム名を表すANSI文字列ポインタ。 |
| pAlgorithmPacket | BYTE* | 8/4 | +8 | +4 | ワイヤ形式のアルゴリズム名パケットを指すバイトポインタ。 |
| pSignature | BYTE* | 8/4 | +16 | +8 | MAC署名データのバイト列を指すポインタ。 |
| pOtherData | BYTE* | 8/4 | +24 | +12 | その他データのバイト列を指すポインタ。 |
| i64CreateTime | LONGLONG | 8 | +32 | +16 | 署名作成時刻をUNIX時刻(秒)の64ビット値で保持する。 |
| wFudgeTime | WORD | 2 | +40 | +24 | 時刻許容誤差を秒単位で示す。 |
| wOriginalXid | WORD | 2 | +42 | +26 | 元のメッセージのトランザクションIDを保持する。 |
| wError | WORD | 2 | +44 | +28 | TSIG処理の拡張エラーコードを示す。 |
| wSigLength | WORD | 2 | +46 | +30 | pSignatureが指す署名データのバイト長を示す。 |
| wOtherLength | WORD | 2 | +48 | +32 | pOtherDataが指すその他データのバイト長を示す。 |
| cAlgNameLength | BYTE | 1 | +50 | +34 | pAlgorithmPacketが指すアルゴリズム名パケットの長さを示す。 |
| bPacketPointers | BOOL | 4 | +52 | +36 | ポインタがワイヤ形式パケットを指すか否かを示す真偽値。 |
各言語での定義
#include <windows.h>
// DNS_TSIG_DATAA (x64 56 / x86 40 バイト)
typedef struct DNS_TSIG_DATAA {
LPSTR pNameAlgorithm;
BYTE* pAlgorithmPacket;
BYTE* pSignature;
BYTE* pOtherData;
LONGLONG i64CreateTime;
WORD wFudgeTime;
WORD wOriginalXid;
WORD wError;
WORD wSigLength;
WORD wOtherLength;
BYTE cAlgNameLength;
BOOL bPacketPointers;
} DNS_TSIG_DATAA;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DNS_TSIG_DATAA
{
public IntPtr pNameAlgorithm;
public IntPtr pAlgorithmPacket;
public IntPtr pSignature;
public IntPtr pOtherData;
public long i64CreateTime;
public ushort wFudgeTime;
public ushort wOriginalXid;
public ushort wError;
public ushort wSigLength;
public ushort wOtherLength;
public byte cAlgNameLength;
[MarshalAs(UnmanagedType.Bool)] public bool bPacketPointers;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DNS_TSIG_DATAA
Public pNameAlgorithm As IntPtr
Public pAlgorithmPacket As IntPtr
Public pSignature As IntPtr
Public pOtherData As IntPtr
Public i64CreateTime As Long
Public wFudgeTime As UShort
Public wOriginalXid As UShort
Public wError As UShort
Public wSigLength As UShort
Public wOtherLength As UShort
Public cAlgNameLength As Byte
<MarshalAs(UnmanagedType.Bool)> Public bPacketPointers As Boolean
End Structureimport ctypes
from ctypes import wintypes
class DNS_TSIG_DATAA(ctypes.Structure):
_fields_ = [
("pNameAlgorithm", ctypes.c_void_p),
("pAlgorithmPacket", ctypes.c_void_p),
("pSignature", ctypes.c_void_p),
("pOtherData", ctypes.c_void_p),
("i64CreateTime", ctypes.c_longlong),
("wFudgeTime", ctypes.c_ushort),
("wOriginalXid", ctypes.c_ushort),
("wError", ctypes.c_ushort),
("wSigLength", ctypes.c_ushort),
("wOtherLength", ctypes.c_ushort),
("cAlgNameLength", ctypes.c_ubyte),
("bPacketPointers", wintypes.BOOL),
]#[repr(C)]
pub struct DNS_TSIG_DATAA {
pub pNameAlgorithm: *mut core::ffi::c_void,
pub pAlgorithmPacket: *mut core::ffi::c_void,
pub pSignature: *mut core::ffi::c_void,
pub pOtherData: *mut core::ffi::c_void,
pub i64CreateTime: i64,
pub wFudgeTime: u16,
pub wOriginalXid: u16,
pub wError: u16,
pub wSigLength: u16,
pub wOtherLength: u16,
pub cAlgNameLength: u8,
pub bPacketPointers: i32,
}import "golang.org/x/sys/windows"
type DNS_TSIG_DATAA struct {
pNameAlgorithm uintptr
pAlgorithmPacket uintptr
pSignature uintptr
pOtherData uintptr
i64CreateTime int64
wFudgeTime uint16
wOriginalXid uint16
wError uint16
wSigLength uint16
wOtherLength uint16
cAlgNameLength byte
bPacketPointers int32
}type
DNS_TSIG_DATAA = record
pNameAlgorithm: Pointer;
pAlgorithmPacket: Pointer;
pSignature: Pointer;
pOtherData: Pointer;
i64CreateTime: Int64;
wFudgeTime: Word;
wOriginalXid: Word;
wError: Word;
wSigLength: Word;
wOtherLength: Word;
cAlgNameLength: Byte;
bPacketPointers: BOOL;
end;const DNS_TSIG_DATAA = extern struct {
pNameAlgorithm: ?*anyopaque,
pAlgorithmPacket: ?*anyopaque,
pSignature: ?*anyopaque,
pOtherData: ?*anyopaque,
i64CreateTime: i64,
wFudgeTime: u16,
wOriginalXid: u16,
wError: u16,
wSigLength: u16,
wOtherLength: u16,
cAlgNameLength: u8,
bPacketPointers: i32,
};type
DNS_TSIG_DATAA {.bycopy.} = object
pNameAlgorithm: pointer
pAlgorithmPacket: pointer
pSignature: pointer
pOtherData: pointer
i64CreateTime: int64
wFudgeTime: uint16
wOriginalXid: uint16
wError: uint16
wSigLength: uint16
wOtherLength: uint16
cAlgNameLength: uint8
bPacketPointers: int32struct DNS_TSIG_DATAA
{
void* pNameAlgorithm;
void* pAlgorithmPacket;
void* pSignature;
void* pOtherData;
long i64CreateTime;
ushort wFudgeTime;
ushort wOriginalXid;
ushort wError;
ushort wSigLength;
ushort wOtherLength;
ubyte cAlgNameLength;
int bPacketPointers;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; DNS_TSIG_DATAA サイズ: 40 バイト(x86)
dim st, 10 ; 4byte整数×10(構造体サイズ 40 / 4 切り上げ)
; pNameAlgorithm : LPSTR (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; pAlgorithmPacket : BYTE* (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; pSignature : BYTE* (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; pOtherData : BYTE* (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; i64CreateTime : LONGLONG (+16, 8byte) qpoke st,16,値 / qpeek(st,16) ※IronHSPのみ。3.7/3.8は lpoke st,16,下位 : lpoke st,20,上位
; wFudgeTime : WORD (+24, 2byte) wpoke st,24,値 / 値 = wpeek(st,24)
; wOriginalXid : WORD (+26, 2byte) wpoke st,26,値 / 値 = wpeek(st,26)
; wError : WORD (+28, 2byte) wpoke st,28,値 / 値 = wpeek(st,28)
; wSigLength : WORD (+30, 2byte) wpoke st,30,値 / 値 = wpeek(st,30)
; wOtherLength : WORD (+32, 2byte) wpoke st,32,値 / 値 = wpeek(st,32)
; cAlgNameLength : BYTE (+34, 1byte) poke st,34,値 / 値 = peek(st,34)
; bPacketPointers : BOOL (+36, 4byte) st.9 = 値 / 値 = st.9 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; DNS_TSIG_DATAA サイズ: 56 バイト(x64)
dim st, 14 ; 4byte整数×14(構造体サイズ 56 / 4 切り上げ)
; pNameAlgorithm : LPSTR (+0, 8byte) qpoke st,0,値 / qpeek(st,0) ※IronHSPのみ。3.7/3.8は lpoke st,0,下位 : lpoke st,4,上位
; pAlgorithmPacket : BYTE* (+8, 8byte) qpoke st,8,値 / qpeek(st,8) ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; pSignature : BYTE* (+16, 8byte) qpoke st,16,値 / qpeek(st,16) ※IronHSPのみ。3.7/3.8は lpoke st,16,下位 : lpoke st,20,上位
; pOtherData : BYTE* (+24, 8byte) qpoke st,24,値 / qpeek(st,24) ※IronHSPのみ。3.7/3.8は lpoke st,24,下位 : lpoke st,28,上位
; i64CreateTime : LONGLONG (+32, 8byte) qpoke st,32,値 / qpeek(st,32) ※IronHSPのみ。3.7/3.8は lpoke st,32,下位 : lpoke st,36,上位
; wFudgeTime : WORD (+40, 2byte) wpoke st,40,値 / 値 = wpeek(st,40)
; wOriginalXid : WORD (+42, 2byte) wpoke st,42,値 / 値 = wpeek(st,42)
; wError : WORD (+44, 2byte) wpoke st,44,値 / 値 = wpeek(st,44)
; wSigLength : WORD (+46, 2byte) wpoke st,46,値 / 値 = wpeek(st,46)
; wOtherLength : WORD (+48, 2byte) wpoke st,48,値 / 値 = wpeek(st,48)
; cAlgNameLength : BYTE (+50, 1byte) poke st,50,値 / 値 = peek(st,50)
; bPacketPointers : BOOL (+52, 4byte) st.13 = 値 / 値 = st.13 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global DNS_TSIG_DATAA
#field intptr pNameAlgorithm
#field intptr pAlgorithmPacket
#field intptr pSignature
#field intptr pOtherData
#field int64 i64CreateTime
#field short wFudgeTime
#field short wOriginalXid
#field short wError
#field short wSigLength
#field short wOtherLength
#field byte cAlgNameLength
#field bool bPacketPointers
#endstruct
stdim st, DNS_TSIG_DATAA ; NSTRUCT 変数を確保
st->i64CreateTime = 100
mes "i64CreateTime=" + st->i64CreateTime