ホーム › NetworkManagement.WindowsFilteringPlatform › IPSEC_TUNNEL_ENDPOINTS2
IPSEC_TUNNEL_ENDPOINTS2
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| ipVersion | FWP_IP_VERSION | 4 | +0 | +0 | トンネルエンドポイントのIPバージョンを示す列挙値。 |
| Anonymous1 | _Anonymous1_e__Union | 16 | +4 | +4 | ローカル側トンネルエンドポイントアドレスを保持する無名共用体。 |
| Anonymous2 | _Anonymous2_e__Union | 16 | +20 | +20 | リモート側トンネルエンドポイントアドレスを保持する無名共用体。 |
| localIfLuid | ULONGLONG | 8 | +40 | +40 | ローカルインターフェースのLUID(64ビット識別子)。 |
| remoteFqdn | LPWSTR | 8/4 | +48 | +48 | リモートエンドポイントのFQDN(ワイド文字列)へのポインター。NULL可。 |
| numAddresses | DWORD | 4 | +56 | +52 | remoteAddresses配列の要素数。 |
| remoteAddresses | IPSEC_TUNNEL_ENDPOINT0* | 8/4 | +64 | +56 | リモートエンドポイントアドレスの配列へのポインター。 |
共用体: _Anonymous1_e__Union x64 16B / x86 16B
| フィールド | 型 | サイズ | x64 | x86 |
|---|---|---|---|---|
| localV4Address | DWORD | 4 | +0 | +0 |
| localV6Address | BYTE | 16 | +0 | +0 |
共用体: _Anonymous2_e__Union x64 16B / x86 16B
| フィールド | 型 | サイズ | x64 | x86 |
|---|---|---|---|---|
| remoteV4Address | DWORD | 4 | +0 | +0 |
| remoteV6Address | BYTE | 16 | +0 | +0 |
各言語での定義
#include <windows.h>
// IPSEC_TUNNEL_ENDPOINTS2 (x64 72 / x86 64 バイト)
typedef struct IPSEC_TUNNEL_ENDPOINTS2 {
FWP_IP_VERSION ipVersion;
_Anonymous1_e__Union Anonymous1;
_Anonymous2_e__Union Anonymous2;
ULONGLONG localIfLuid;
LPWSTR remoteFqdn;
DWORD numAddresses;
IPSEC_TUNNEL_ENDPOINT0* remoteAddresses;
} IPSEC_TUNNEL_ENDPOINTS2;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct IPSEC_TUNNEL_ENDPOINTS2
{
public int ipVersion;
public _Anonymous1_e__Union Anonymous1;
public _Anonymous2_e__Union Anonymous2;
public ulong localIfLuid;
public IntPtr remoteFqdn;
public uint numAddresses;
public IntPtr remoteAddresses;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure IPSEC_TUNNEL_ENDPOINTS2
Public ipVersion As Integer
Public Anonymous1 As _Anonymous1_e__Union
Public Anonymous2 As _Anonymous2_e__Union
Public localIfLuid As ULong
Public remoteFqdn As IntPtr
Public numAddresses As UInteger
Public remoteAddresses As IntPtr
End Structureimport ctypes
from ctypes import wintypes
class IPSEC_TUNNEL_ENDPOINTS2(ctypes.Structure):
_fields_ = [
("ipVersion", ctypes.c_int),
("Anonymous1", _Anonymous1_e__Union),
("Anonymous2", _Anonymous2_e__Union),
("localIfLuid", ctypes.c_ulonglong),
("remoteFqdn", ctypes.c_void_p),
("numAddresses", wintypes.DWORD),
("remoteAddresses", ctypes.c_void_p),
]#[repr(C)]
pub struct IPSEC_TUNNEL_ENDPOINTS2 {
pub ipVersion: i32,
pub Anonymous1: _Anonymous1_e__Union,
pub Anonymous2: _Anonymous2_e__Union,
pub localIfLuid: u64,
pub remoteFqdn: *mut core::ffi::c_void,
pub numAddresses: u32,
pub remoteAddresses: *mut core::ffi::c_void,
}import "golang.org/x/sys/windows"
type IPSEC_TUNNEL_ENDPOINTS2 struct {
ipVersion int32
Anonymous1 _Anonymous1_e__Union
Anonymous2 _Anonymous2_e__Union
localIfLuid uint64
remoteFqdn uintptr
numAddresses uint32
remoteAddresses uintptr
}type
IPSEC_TUNNEL_ENDPOINTS2 = record
ipVersion: Integer;
Anonymous1: _Anonymous1_e__Union;
Anonymous2: _Anonymous2_e__Union;
localIfLuid: UInt64;
remoteFqdn: Pointer;
numAddresses: DWORD;
remoteAddresses: Pointer;
end;const IPSEC_TUNNEL_ENDPOINTS2 = extern struct {
ipVersion: i32,
Anonymous1: _Anonymous1_e__Union,
Anonymous2: _Anonymous2_e__Union,
localIfLuid: u64,
remoteFqdn: ?*anyopaque,
numAddresses: u32,
remoteAddresses: ?*anyopaque,
};type
IPSEC_TUNNEL_ENDPOINTS2 {.bycopy.} = object
ipVersion: int32
Anonymous1: _Anonymous1_e__Union
Anonymous2: _Anonymous2_e__Union
localIfLuid: uint64
remoteFqdn: pointer
numAddresses: uint32
remoteAddresses: pointerstruct IPSEC_TUNNEL_ENDPOINTS2
{
int ipVersion;
_Anonymous1_e__Union Anonymous1;
_Anonymous2_e__Union Anonymous2;
ulong localIfLuid;
void* remoteFqdn;
uint numAddresses;
void* remoteAddresses;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; IPSEC_TUNNEL_ENDPOINTS2 サイズ: 64 バイト(x86)
dim st, 16 ; 4byte整数×16(構造体サイズ 64 / 4 切り上げ)
; ipVersion : FWP_IP_VERSION (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; Anonymous1 : _Anonymous1_e__Union (+4, 16byte) varptr(st)+4 を基点に操作(16byte:入れ子/配列)
; Anonymous2 : _Anonymous2_e__Union (+20, 16byte) varptr(st)+20 を基点に操作(16byte:入れ子/配列)
; localIfLuid : ULONGLONG (+40, 8byte) qpoke st,40,値 / qpeek(st,40) ※IronHSPのみ。3.7/3.8は lpoke st,40,下位 : lpoke st,44,上位
; remoteFqdn : LPWSTR (+48, 4byte) st.12 = 値 / 値 = st.12 (lpoke/lpeek も可)
; numAddresses : DWORD (+52, 4byte) st.13 = 値 / 値 = st.13 (lpoke/lpeek も可)
; remoteAddresses : IPSEC_TUNNEL_ENDPOINT0* (+56, 4byte) varptr(st)+56 を基点に操作(4byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; IPSEC_TUNNEL_ENDPOINTS2 サイズ: 72 バイト(x64)
dim st, 18 ; 4byte整数×18(構造体サイズ 72 / 4 切り上げ)
; ipVersion : FWP_IP_VERSION (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; Anonymous1 : _Anonymous1_e__Union (+4, 16byte) varptr(st)+4 を基点に操作(16byte:入れ子/配列)
; Anonymous2 : _Anonymous2_e__Union (+20, 16byte) varptr(st)+20 を基点に操作(16byte:入れ子/配列)
; localIfLuid : ULONGLONG (+40, 8byte) qpoke st,40,値 / qpeek(st,40) ※IronHSPのみ。3.7/3.8は lpoke st,40,下位 : lpoke st,44,上位
; remoteFqdn : LPWSTR (+48, 8byte) qpoke st,48,値 / qpeek(st,48) ※IronHSPのみ。3.7/3.8は lpoke st,48,下位 : lpoke st,52,上位
; numAddresses : DWORD (+56, 4byte) st.14 = 値 / 値 = st.14 (lpoke/lpeek も可)
; remoteAddresses : IPSEC_TUNNEL_ENDPOINT0* (+64, 8byte) varptr(st)+64 を基点に操作(8byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global IPSEC_TUNNEL_ENDPOINTS2
#field int ipVersion
#field byte Anonymous1 16
#field byte Anonymous2 16
#field int64 localIfLuid
#field intptr remoteFqdn
#field int numAddresses
#field intptr remoteAddresses
#endstruct
stdim st, IPSEC_TUNNEL_ENDPOINTS2 ; NSTRUCT 変数を確保
st->ipVersion = 100
mes "ipVersion=" + st->ipVersion
; ※union フィールドは byte 列で確保(NSTRUCT は union 非対応)。必要に応じ手動でアクセス。