ホーム › NetworkManagement.Dns › DNS_NSEC3PARAM_DATA
DNS_NSEC3PARAM_DATA
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| chAlgorithm | BYTE | 1 | +0 | +0 | ハッシュ計算に用いるアルゴリズム識別番号を示す。SHA-1は値1。 |
| bFlags | BYTE | 1 | +1 | +1 | NSEC3PARAMのフラグ値を保持する。 |
| wIterations | WORD | 2 | +2 | +2 | ハッシュを反復適用する追加回数を示す。 |
| bSaltLength | BYTE | 1 | +4 | +4 | pbSaltのバイト長を示す。0の場合ソルトなし。 |
| bPad | BYTE | 3 | +5 | +5 | アラインメント調整用のパディング。値は通常0。 |
| pbSalt | BYTE | 1 | +8 | +8 | ハッシュ計算に付加するソルトのバイト列を保持する可変長配列の先頭。 |
各言語での定義
#include <windows.h>
// DNS_NSEC3PARAM_DATA (x64 10 / x86 10 バイト)
typedef struct DNS_NSEC3PARAM_DATA {
BYTE chAlgorithm;
BYTE bFlags;
WORD wIterations;
BYTE bSaltLength;
BYTE bPad[3];
BYTE pbSalt[1];
} DNS_NSEC3PARAM_DATA;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DNS_NSEC3PARAM_DATA
{
public byte chAlgorithm;
public byte bFlags;
public ushort wIterations;
public byte bSaltLength;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)] public byte[] bPad;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 1)] public byte[] pbSalt;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DNS_NSEC3PARAM_DATA
Public chAlgorithm As Byte
Public bFlags As Byte
Public wIterations As UShort
Public bSaltLength As Byte
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=3)> Public bPad() As Byte
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=1)> Public pbSalt() As Byte
End Structureimport ctypes
from ctypes import wintypes
class DNS_NSEC3PARAM_DATA(ctypes.Structure):
_fields_ = [
("chAlgorithm", ctypes.c_ubyte),
("bFlags", ctypes.c_ubyte),
("wIterations", ctypes.c_ushort),
("bSaltLength", ctypes.c_ubyte),
("bPad", ctypes.c_ubyte * 3),
("pbSalt", ctypes.c_ubyte * 1),
]#[repr(C)]
pub struct DNS_NSEC3PARAM_DATA {
pub chAlgorithm: u8,
pub bFlags: u8,
pub wIterations: u16,
pub bSaltLength: u8,
pub bPad: [u8; 3],
pub pbSalt: [u8; 1],
}import "golang.org/x/sys/windows"
type DNS_NSEC3PARAM_DATA struct {
chAlgorithm byte
bFlags byte
wIterations uint16
bSaltLength byte
bPad [3]byte
pbSalt [1]byte
}type
DNS_NSEC3PARAM_DATA = record
chAlgorithm: Byte;
bFlags: Byte;
wIterations: Word;
bSaltLength: Byte;
bPad: array[0..2] of Byte;
pbSalt: array[0..0] of Byte;
end;const DNS_NSEC3PARAM_DATA = extern struct {
chAlgorithm: u8,
bFlags: u8,
wIterations: u16,
bSaltLength: u8,
bPad: [3]u8,
pbSalt: [1]u8,
};type
DNS_NSEC3PARAM_DATA {.bycopy.} = object
chAlgorithm: uint8
bFlags: uint8
wIterations: uint16
bSaltLength: uint8
bPad: array[3, uint8]
pbSalt: array[1, uint8]struct DNS_NSEC3PARAM_DATA
{
ubyte chAlgorithm;
ubyte bFlags;
ushort wIterations;
ubyte bSaltLength;
ubyte[3] bPad;
ubyte[1] pbSalt;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; DNS_NSEC3PARAM_DATA サイズ: 10 バイト(x64)
dim st, 3 ; 4byte整数×3(構造体サイズ 10 / 4 切り上げ)
; chAlgorithm : BYTE (+0, 1byte) poke st,0,値 / 値 = peek(st,0)
; bFlags : BYTE (+1, 1byte) poke st,1,値 / 値 = peek(st,1)
; wIterations : WORD (+2, 2byte) wpoke st,2,値 / 値 = wpeek(st,2)
; bSaltLength : BYTE (+4, 1byte) poke st,4,値 / 値 = peek(st,4)
; bPad : BYTE (+5, 3byte) varptr(st)+5 を基点に操作(3byte:入れ子/配列)
; pbSalt : BYTE (+8, 1byte) varptr(st)+8 を基点に操作(1byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global DNS_NSEC3PARAM_DATA
#field byte chAlgorithm
#field byte bFlags
#field short wIterations
#field byte bSaltLength
#field byte bPad 3
#field byte pbSalt 1
#endstruct
stdim st, DNS_NSEC3PARAM_DATA ; NSTRUCT 変数を確保
st->chAlgorithm = 100
mes "chAlgorithm=" + st->chAlgorithm