ホーム › NetworkManagement.Dhcp › DHCPV6PrefixLeaseInformation
DHCPV6PrefixLeaseInformation
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| nPrefixes | DWORD | 4 | +0 | +0 | プレフィックスの数です。 | ||||||||||
| prefixArray | DHCPV6Prefix* | 8/4 | +8 | +4 | サーバーに要求した、またはサーバーから返されたプレフィックスを格納する DHCPV6Prefix 構造体のリストへのポインターです。 | ||||||||||
| iaid | DWORD | 4 | +16 | +8 | プレフィックス操作の Identity Association 識別子です。 | ||||||||||
| T1 | LONGLONG | 8 | +24 | +16 | プレフィックスの更新時間 (秒単位) です。 | ||||||||||
| T2 | LONGLONG | 8 | +32 | +24 | プレフィックスの再バインド時間 (秒単位) です。 | ||||||||||
| MaxLeaseExpirationTime | LONGLONG | 8 | +40 | +32 | この構造体に含まれるすべてのプレフィックスリースの最大リース有効期限です。 | ||||||||||
| LastRenewalTime | LONGLONG | 8 | +48 | +40 | プレフィックスの最後の更新が行われた時刻です。 | ||||||||||
| status | StatusCode | 4 | +56 | +48 | IAPD に対してサーバーから返されるステータスコードです。プレフィックス委任のシナリオでは、DHCP サーバーから次のコードが返される場合があります。
| ||||||||||
| ServerId | BYTE* | 8/4 | +64 | +52 | プレフィックスの受信元となったサーバーの DUID です。このデータは以降の更新で使用されます。 | ||||||||||
| ServerIdLen | DWORD | 4 | +72 | +56 | 上記の DUID データの長さです。 |
公式ドキュメント
DHCPV6PrefixLeaseInformation 構造体には、プレフィックスリースに関する情報が格納されます。
解説(Remarks)
プレフィックス委任のシナリオでは、リース有効期間の値 (特定のステータスコード、T1、T2、MaxLeaseExpirationTime、LastRenewalTime) の検証は、データを利用するアプリケーションではなく、呼び出し元の API によって行われます。アプリケーション側ではこれらの値を異なる意味で解釈する可能性があるためです。
出典・ライセンス: 上記「公式ドキュメント」の内容は Microsoft の Win32 API ドキュメント(MicrosoftDocs/sdk-api)を日本語に翻訳・改変したものです。© Microsoft Corporation. CC BY 4.0 で提供。
Microsoft 公式リファレンス: 英語 (en-us) · 日本語 (ja-jp) · 原文ソース (GitHub)
Microsoft 公式リファレンス: 英語 (en-us) · 日本語 (ja-jp) · 原文ソース (GitHub)
各言語での定義
#include <windows.h>
// DHCPV6PrefixLeaseInformation (x64 80 / x86 64 バイト)
typedef struct DHCPV6PrefixLeaseInformation {
DWORD nPrefixes;
DHCPV6Prefix* prefixArray;
DWORD iaid;
LONGLONG T1;
LONGLONG T2;
LONGLONG MaxLeaseExpirationTime;
LONGLONG LastRenewalTime;
StatusCode status;
BYTE* ServerId;
DWORD ServerIdLen;
} DHCPV6PrefixLeaseInformation;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DHCPV6PrefixLeaseInformation
{
public uint nPrefixes;
public IntPtr prefixArray;
public uint iaid;
public long T1;
public long T2;
public long MaxLeaseExpirationTime;
public long LastRenewalTime;
public int status;
public IntPtr ServerId;
public uint ServerIdLen;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DHCPV6PrefixLeaseInformation
Public nPrefixes As UInteger
Public prefixArray As IntPtr
Public iaid As UInteger
Public T1 As Long
Public T2 As Long
Public MaxLeaseExpirationTime As Long
Public LastRenewalTime As Long
Public status As Integer
Public ServerId As IntPtr
Public ServerIdLen As UInteger
End Structureimport ctypes
from ctypes import wintypes
class DHCPV6PrefixLeaseInformation(ctypes.Structure):
_fields_ = [
("nPrefixes", wintypes.DWORD),
("prefixArray", ctypes.c_void_p),
("iaid", wintypes.DWORD),
("T1", ctypes.c_longlong),
("T2", ctypes.c_longlong),
("MaxLeaseExpirationTime", ctypes.c_longlong),
("LastRenewalTime", ctypes.c_longlong),
("status", ctypes.c_int),
("ServerId", ctypes.c_void_p),
("ServerIdLen", wintypes.DWORD),
]#[repr(C)]
pub struct DHCPV6PrefixLeaseInformation {
pub nPrefixes: u32,
pub prefixArray: *mut core::ffi::c_void,
pub iaid: u32,
pub T1: i64,
pub T2: i64,
pub MaxLeaseExpirationTime: i64,
pub LastRenewalTime: i64,
pub status: i32,
pub ServerId: *mut core::ffi::c_void,
pub ServerIdLen: u32,
}import "golang.org/x/sys/windows"
type DHCPV6PrefixLeaseInformation struct {
nPrefixes uint32
prefixArray uintptr
iaid uint32
T1 int64
T2 int64
MaxLeaseExpirationTime int64
LastRenewalTime int64
status int32
ServerId uintptr
ServerIdLen uint32
}type
DHCPV6PrefixLeaseInformation = record
nPrefixes: DWORD;
prefixArray: Pointer;
iaid: DWORD;
T1: Int64;
T2: Int64;
MaxLeaseExpirationTime: Int64;
LastRenewalTime: Int64;
status: Integer;
ServerId: Pointer;
ServerIdLen: DWORD;
end;const DHCPV6PrefixLeaseInformation = extern struct {
nPrefixes: u32,
prefixArray: ?*anyopaque,
iaid: u32,
T1: i64,
T2: i64,
MaxLeaseExpirationTime: i64,
LastRenewalTime: i64,
status: i32,
ServerId: ?*anyopaque,
ServerIdLen: u32,
};type
DHCPV6PrefixLeaseInformation {.bycopy.} = object
nPrefixes: uint32
prefixArray: pointer
iaid: uint32
T1: int64
T2: int64
MaxLeaseExpirationTime: int64
LastRenewalTime: int64
status: int32
ServerId: pointer
ServerIdLen: uint32struct DHCPV6PrefixLeaseInformation
{
uint nPrefixes;
void* prefixArray;
uint iaid;
long T1;
long T2;
long MaxLeaseExpirationTime;
long LastRenewalTime;
int status;
void* ServerId;
uint ServerIdLen;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; DHCPV6PrefixLeaseInformation サイズ: 64 バイト(x86)
dim st, 16 ; 4byte整数×16(構造体サイズ 64 / 4 切り上げ)
; nPrefixes : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; prefixArray : DHCPV6Prefix* (+4, 4byte) varptr(st)+4 を基点に操作(4byte:入れ子/配列)
; iaid : DWORD (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; T1 : LONGLONG (+16, 8byte) qpoke st,16,値 / qpeek(st,16) ※IronHSPのみ。3.7/3.8は lpoke st,16,下位 : lpoke st,20,上位
; T2 : LONGLONG (+24, 8byte) qpoke st,24,値 / qpeek(st,24) ※IronHSPのみ。3.7/3.8は lpoke st,24,下位 : lpoke st,28,上位
; MaxLeaseExpirationTime : LONGLONG (+32, 8byte) qpoke st,32,値 / qpeek(st,32) ※IronHSPのみ。3.7/3.8は lpoke st,32,下位 : lpoke st,36,上位
; LastRenewalTime : LONGLONG (+40, 8byte) qpoke st,40,値 / qpeek(st,40) ※IronHSPのみ。3.7/3.8は lpoke st,40,下位 : lpoke st,44,上位
; status : StatusCode (+48, 4byte) st.12 = 値 / 値 = st.12 (lpoke/lpeek も可)
; ServerId : BYTE* (+52, 4byte) st.13 = 値 / 値 = st.13 (lpoke/lpeek も可)
; ServerIdLen : DWORD (+56, 4byte) st.14 = 値 / 値 = st.14 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; DHCPV6PrefixLeaseInformation サイズ: 80 バイト(x64)
dim st, 20 ; 4byte整数×20(構造体サイズ 80 / 4 切り上げ)
; nPrefixes : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; prefixArray : DHCPV6Prefix* (+8, 8byte) varptr(st)+8 を基点に操作(8byte:入れ子/配列)
; iaid : DWORD (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; T1 : LONGLONG (+24, 8byte) qpoke st,24,値 / qpeek(st,24) ※IronHSPのみ。3.7/3.8は lpoke st,24,下位 : lpoke st,28,上位
; T2 : LONGLONG (+32, 8byte) qpoke st,32,値 / qpeek(st,32) ※IronHSPのみ。3.7/3.8は lpoke st,32,下位 : lpoke st,36,上位
; MaxLeaseExpirationTime : LONGLONG (+40, 8byte) qpoke st,40,値 / qpeek(st,40) ※IronHSPのみ。3.7/3.8は lpoke st,40,下位 : lpoke st,44,上位
; LastRenewalTime : LONGLONG (+48, 8byte) qpoke st,48,値 / qpeek(st,48) ※IronHSPのみ。3.7/3.8は lpoke st,48,下位 : lpoke st,52,上位
; status : StatusCode (+56, 4byte) st.14 = 値 / 値 = st.14 (lpoke/lpeek も可)
; ServerId : BYTE* (+64, 8byte) qpoke st,64,値 / qpeek(st,64) ※IronHSPのみ。3.7/3.8は lpoke st,64,下位 : lpoke st,68,上位
; ServerIdLen : DWORD (+72, 4byte) st.18 = 値 / 値 = st.18 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global DHCPV6PrefixLeaseInformation
#field int nPrefixes
#field intptr prefixArray
#field int iaid
#field int64 T1
#field int64 T2
#field int64 MaxLeaseExpirationTime
#field int64 LastRenewalTime
#field int status
#field intptr ServerId
#field int ServerIdLen
#endstruct
stdim st, DHCPV6PrefixLeaseInformation ; NSTRUCT 変数を確保
st->nPrefixes = 100
mes "nPrefixes=" + st->nPrefixes