ホーム › NetworkManagement.Dhcp › DHCP_MIB_INFO_V6
DHCP_MIB_INFO_V6
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| Solicits | DWORD | 4 | +0 | +0 | 受信したSOLICITメッセージの累計数を示す。 |
| Advertises | DWORD | 4 | +4 | +4 | 送信したADVERTISEメッセージの累計数を示す。 |
| Requests | DWORD | 4 | +8 | +8 | 受信したREQUESTメッセージの累計数を示す。 |
| Renews | DWORD | 4 | +12 | +12 | 受信したRENEWメッセージの累計数を示す。 |
| Rebinds | DWORD | 4 | +16 | +16 | 受信したREBINDメッセージの累計数を示す。 |
| Replies | DWORD | 4 | +20 | +20 | 送信したREPLYメッセージの累計数を示す。 |
| Confirms | DWORD | 4 | +24 | +24 | 受信したCONFIRMメッセージの累計数を示す。 |
| Declines | DWORD | 4 | +28 | +28 | 受信したDECLINEメッセージの累計数を示す。 |
| Releases | DWORD | 4 | +32 | +32 | 受信したRELEASEメッセージの累計数を示す。 |
| Informs | DWORD | 4 | +36 | +36 | 受信したINFORMATION-REQUESTメッセージの累計数を示す。 |
| ServerStartTime | DATE_TIME | 8 | +40 | +40 | DHCPv6サーバーが起動した日時を示す。 |
| Scopes | DWORD | 4 | +48 | +48 | ScopeInfo配列に含まれるスコープ数を示す。 |
| ScopeInfo | SCOPE_MIB_INFO_V6* | 8/4 | +56 | +52 | 各IPv6スコープのSCOPE_MIB_INFO_V6統計配列へのポインタ。 |
各言語での定義
#include <windows.h>
// DATE_TIME (x64 8 / x86 8 バイト)
typedef struct DATE_TIME {
DWORD dwLowDateTime;
DWORD dwHighDateTime;
} DATE_TIME;
// DHCP_MIB_INFO_V6 (x64 64 / x86 56 バイト)
typedef struct DHCP_MIB_INFO_V6 {
DWORD Solicits;
DWORD Advertises;
DWORD Requests;
DWORD Renews;
DWORD Rebinds;
DWORD Replies;
DWORD Confirms;
DWORD Declines;
DWORD Releases;
DWORD Informs;
DATE_TIME ServerStartTime;
DWORD Scopes;
SCOPE_MIB_INFO_V6* ScopeInfo;
} DHCP_MIB_INFO_V6;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DATE_TIME
{
public uint dwLowDateTime;
public uint dwHighDateTime;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DHCP_MIB_INFO_V6
{
public uint Solicits;
public uint Advertises;
public uint Requests;
public uint Renews;
public uint Rebinds;
public uint Replies;
public uint Confirms;
public uint Declines;
public uint Releases;
public uint Informs;
public DATE_TIME ServerStartTime;
public uint Scopes;
public IntPtr ScopeInfo;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DATE_TIME
Public dwLowDateTime As UInteger
Public dwHighDateTime As UInteger
End Structure
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DHCP_MIB_INFO_V6
Public Solicits As UInteger
Public Advertises As UInteger
Public Requests As UInteger
Public Renews As UInteger
Public Rebinds As UInteger
Public Replies As UInteger
Public Confirms As UInteger
Public Declines As UInteger
Public Releases As UInteger
Public Informs As UInteger
Public ServerStartTime As DATE_TIME
Public Scopes As UInteger
Public ScopeInfo As IntPtr
End Structureimport ctypes
from ctypes import wintypes
class DATE_TIME(ctypes.Structure):
_fields_ = [
("dwLowDateTime", wintypes.DWORD),
("dwHighDateTime", wintypes.DWORD),
]
class DHCP_MIB_INFO_V6(ctypes.Structure):
_fields_ = [
("Solicits", wintypes.DWORD),
("Advertises", wintypes.DWORD),
("Requests", wintypes.DWORD),
("Renews", wintypes.DWORD),
("Rebinds", wintypes.DWORD),
("Replies", wintypes.DWORD),
("Confirms", wintypes.DWORD),
("Declines", wintypes.DWORD),
("Releases", wintypes.DWORD),
("Informs", wintypes.DWORD),
("ServerStartTime", DATE_TIME),
("Scopes", wintypes.DWORD),
("ScopeInfo", ctypes.c_void_p),
]#[repr(C)]
pub struct DATE_TIME {
pub dwLowDateTime: u32,
pub dwHighDateTime: u32,
}
#[repr(C)]
pub struct DHCP_MIB_INFO_V6 {
pub Solicits: u32,
pub Advertises: u32,
pub Requests: u32,
pub Renews: u32,
pub Rebinds: u32,
pub Replies: u32,
pub Confirms: u32,
pub Declines: u32,
pub Releases: u32,
pub Informs: u32,
pub ServerStartTime: DATE_TIME,
pub Scopes: u32,
pub ScopeInfo: *mut core::ffi::c_void,
}import "golang.org/x/sys/windows"
type DATE_TIME struct {
dwLowDateTime uint32
dwHighDateTime uint32
}
type DHCP_MIB_INFO_V6 struct {
Solicits uint32
Advertises uint32
Requests uint32
Renews uint32
Rebinds uint32
Replies uint32
Confirms uint32
Declines uint32
Releases uint32
Informs uint32
ServerStartTime DATE_TIME
Scopes uint32
ScopeInfo uintptr
}type
DATE_TIME = record
dwLowDateTime: DWORD;
dwHighDateTime: DWORD;
end;
DHCP_MIB_INFO_V6 = record
Solicits: DWORD;
Advertises: DWORD;
Requests: DWORD;
Renews: DWORD;
Rebinds: DWORD;
Replies: DWORD;
Confirms: DWORD;
Declines: DWORD;
Releases: DWORD;
Informs: DWORD;
ServerStartTime: DATE_TIME;
Scopes: DWORD;
ScopeInfo: Pointer;
end;const DATE_TIME = extern struct {
dwLowDateTime: u32,
dwHighDateTime: u32,
};
const DHCP_MIB_INFO_V6 = extern struct {
Solicits: u32,
Advertises: u32,
Requests: u32,
Renews: u32,
Rebinds: u32,
Replies: u32,
Confirms: u32,
Declines: u32,
Releases: u32,
Informs: u32,
ServerStartTime: DATE_TIME,
Scopes: u32,
ScopeInfo: ?*anyopaque,
};type
DATE_TIME {.bycopy.} = object
dwLowDateTime: uint32
dwHighDateTime: uint32
DHCP_MIB_INFO_V6 {.bycopy.} = object
Solicits: uint32
Advertises: uint32
Requests: uint32
Renews: uint32
Rebinds: uint32
Replies: uint32
Confirms: uint32
Declines: uint32
Releases: uint32
Informs: uint32
ServerStartTime: DATE_TIME
Scopes: uint32
ScopeInfo: pointerstruct DATE_TIME
{
uint dwLowDateTime;
uint dwHighDateTime;
}
struct DHCP_MIB_INFO_V6
{
uint Solicits;
uint Advertises;
uint Requests;
uint Renews;
uint Rebinds;
uint Replies;
uint Confirms;
uint Declines;
uint Releases;
uint Informs;
DATE_TIME ServerStartTime;
uint Scopes;
void* ScopeInfo;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; DHCP_MIB_INFO_V6 サイズ: 56 バイト(x86)
dim st, 14 ; 4byte整数×14(構造体サイズ 56 / 4 切り上げ)
; Solicits : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; Advertises : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; Requests : DWORD (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; Renews : DWORD (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; Rebinds : DWORD (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; Replies : DWORD (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; Confirms : DWORD (+24, 4byte) st.6 = 値 / 値 = st.6 (lpoke/lpeek も可)
; Declines : DWORD (+28, 4byte) st.7 = 値 / 値 = st.7 (lpoke/lpeek も可)
; Releases : DWORD (+32, 4byte) st.8 = 値 / 値 = st.8 (lpoke/lpeek も可)
; Informs : DWORD (+36, 4byte) st.9 = 値 / 値 = st.9 (lpoke/lpeek も可)
; ServerStartTime : DATE_TIME (+40, 8byte) varptr(st)+40 を基点に操作(8byte:入れ子/配列)
; Scopes : DWORD (+48, 4byte) st.12 = 値 / 値 = st.12 (lpoke/lpeek も可)
; ScopeInfo : SCOPE_MIB_INFO_V6* (+52, 4byte) varptr(st)+52 を基点に操作(4byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; DHCP_MIB_INFO_V6 サイズ: 64 バイト(x64)
dim st, 16 ; 4byte整数×16(構造体サイズ 64 / 4 切り上げ)
; Solicits : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; Advertises : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; Requests : DWORD (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; Renews : DWORD (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; Rebinds : DWORD (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; Replies : DWORD (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; Confirms : DWORD (+24, 4byte) st.6 = 値 / 値 = st.6 (lpoke/lpeek も可)
; Declines : DWORD (+28, 4byte) st.7 = 値 / 値 = st.7 (lpoke/lpeek も可)
; Releases : DWORD (+32, 4byte) st.8 = 値 / 値 = st.8 (lpoke/lpeek も可)
; Informs : DWORD (+36, 4byte) st.9 = 値 / 値 = st.9 (lpoke/lpeek も可)
; ServerStartTime : DATE_TIME (+40, 8byte) varptr(st)+40 を基点に操作(8byte:入れ子/配列)
; Scopes : DWORD (+48, 4byte) st.12 = 値 / 値 = st.12 (lpoke/lpeek も可)
; ScopeInfo : SCOPE_MIB_INFO_V6* (+56, 8byte) varptr(st)+56 を基点に操作(8byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global DATE_TIME
#field int dwLowDateTime
#field int dwHighDateTime
#endstruct
#defstruct global DHCP_MIB_INFO_V6
#field int Solicits
#field int Advertises
#field int Requests
#field int Renews
#field int Rebinds
#field int Replies
#field int Confirms
#field int Declines
#field int Releases
#field int Informs
#field DATE_TIME ServerStartTime
#field int Scopes
#field intptr ScopeInfo
#endstruct
stdim st, DHCP_MIB_INFO_V6 ; NSTRUCT 変数を確保
st->Solicits = 100
mes "Solicits=" + st->Solicits