IKEEXT_POLICY0
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| softExpirationTime | DWORD | 4 | +0 | +0 | 使用されないパラメーターです。常に 0 を設定してください。 |
| numAuthenticationMethods | DWORD | 4 | +4 | +4 | 認証方式の数。 |
| authenticationMethods | IKEEXT_AUTHENTICATION_METHOD0* | 8/4 | +8 | +8 | 受け入れ可能な認証方式の配列。 詳細については IKEEXT_AUTHENTICATION_METHOD0 を参照してください。 |
| initiatorImpersonationType | IKEEXT_AUTHENTICATION_IMPERSONATION_TYPE | 4 | +16 | +12 | 偽装 (impersonation) の種類。AuthIP にのみ適用されます。 詳細については IKEEXT_AUTHENTICATION_IMPERSONATION_TYPE を参照してください。 |
| numIkeProposals | DWORD | 4 | +20 | +16 | メインモードプロポーザルの数。 |
| ikeProposals | IKEEXT_PROPOSAL0* | 8/4 | +24 | +20 | メインモードプロポーザルの配列。 詳細については IKEEXT_PROPOSAL0 を参照してください。 |
| flags | IKEEXT_POLICY_FLAG | 4 | +32 | +24 | 次の値の組み合わせです。 |
| maxDynamicFilters | DWORD | 4 | +36 | +28 | このポリシーを使用してネゴシエートされる SA に対して、リモート IP アドレスごと、かつトランスポート層ごとに追加できる動的 IPsec フィルターの最大数。 動的フィルターの追加を無効にするには、これを 0 に設定します。動的フィルターは、イニシエーターが提案した QM トラフィックがレスポンダーのトラフィック構成のサブセットである場合に、レスポンダー側で IKE/AuthIP によって追加されます。 |
公式ドキュメント
IKEEXT_POLICY0 構造体は、IKE/AuthIP のメインモードネゴシエーションポリシーを格納するために使用されます。 IKEEXT_POLICY1 が利用できます。Windows 8 では IKEEXT_POLICY2 が利用できます。
Microsoft 公式リファレンス: 英語 (en-us) · 日本語 (ja-jp) · 原文ソース (GitHub)
各言語での定義
#include <windows.h>
// IKEEXT_POLICY0 (x64 40 / x86 32 バイト)
typedef struct IKEEXT_POLICY0 {
DWORD softExpirationTime;
DWORD numAuthenticationMethods;
IKEEXT_AUTHENTICATION_METHOD0* authenticationMethods;
IKEEXT_AUTHENTICATION_IMPERSONATION_TYPE initiatorImpersonationType;
DWORD numIkeProposals;
IKEEXT_PROPOSAL0* ikeProposals;
IKEEXT_POLICY_FLAG flags;
DWORD maxDynamicFilters;
} IKEEXT_POLICY0;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct IKEEXT_POLICY0
{
public uint softExpirationTime;
public uint numAuthenticationMethods;
public IntPtr authenticationMethods;
public int initiatorImpersonationType;
public uint numIkeProposals;
public IntPtr ikeProposals;
public uint flags;
public uint maxDynamicFilters;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure IKEEXT_POLICY0
Public softExpirationTime As UInteger
Public numAuthenticationMethods As UInteger
Public authenticationMethods As IntPtr
Public initiatorImpersonationType As Integer
Public numIkeProposals As UInteger
Public ikeProposals As IntPtr
Public flags As UInteger
Public maxDynamicFilters As UInteger
End Structureimport ctypes
from ctypes import wintypes
class IKEEXT_POLICY0(ctypes.Structure):
_fields_ = [
("softExpirationTime", wintypes.DWORD),
("numAuthenticationMethods", wintypes.DWORD),
("authenticationMethods", ctypes.c_void_p),
("initiatorImpersonationType", ctypes.c_int),
("numIkeProposals", wintypes.DWORD),
("ikeProposals", ctypes.c_void_p),
("flags", wintypes.DWORD),
("maxDynamicFilters", wintypes.DWORD),
]#[repr(C)]
pub struct IKEEXT_POLICY0 {
pub softExpirationTime: u32,
pub numAuthenticationMethods: u32,
pub authenticationMethods: *mut core::ffi::c_void,
pub initiatorImpersonationType: i32,
pub numIkeProposals: u32,
pub ikeProposals: *mut core::ffi::c_void,
pub flags: u32,
pub maxDynamicFilters: u32,
}import "golang.org/x/sys/windows"
type IKEEXT_POLICY0 struct {
softExpirationTime uint32
numAuthenticationMethods uint32
authenticationMethods uintptr
initiatorImpersonationType int32
numIkeProposals uint32
ikeProposals uintptr
flags uint32
maxDynamicFilters uint32
}type
IKEEXT_POLICY0 = record
softExpirationTime: DWORD;
numAuthenticationMethods: DWORD;
authenticationMethods: Pointer;
initiatorImpersonationType: Integer;
numIkeProposals: DWORD;
ikeProposals: Pointer;
flags: DWORD;
maxDynamicFilters: DWORD;
end;const IKEEXT_POLICY0 = extern struct {
softExpirationTime: u32,
numAuthenticationMethods: u32,
authenticationMethods: ?*anyopaque,
initiatorImpersonationType: i32,
numIkeProposals: u32,
ikeProposals: ?*anyopaque,
flags: u32,
maxDynamicFilters: u32,
};type
IKEEXT_POLICY0 {.bycopy.} = object
softExpirationTime: uint32
numAuthenticationMethods: uint32
authenticationMethods: pointer
initiatorImpersonationType: int32
numIkeProposals: uint32
ikeProposals: pointer
flags: uint32
maxDynamicFilters: uint32struct IKEEXT_POLICY0
{
uint softExpirationTime;
uint numAuthenticationMethods;
void* authenticationMethods;
int initiatorImpersonationType;
uint numIkeProposals;
void* ikeProposals;
uint flags;
uint maxDynamicFilters;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; IKEEXT_POLICY0 サイズ: 32 バイト(x86)
dim st, 8 ; 4byte整数×8(構造体サイズ 32 / 4 切り上げ)
; softExpirationTime : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; numAuthenticationMethods : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; authenticationMethods : IKEEXT_AUTHENTICATION_METHOD0* (+8, 4byte) varptr(st)+8 を基点に操作(4byte:入れ子/配列)
; initiatorImpersonationType : IKEEXT_AUTHENTICATION_IMPERSONATION_TYPE (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; numIkeProposals : DWORD (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; ikeProposals : IKEEXT_PROPOSAL0* (+20, 4byte) varptr(st)+20 を基点に操作(4byte:入れ子/配列)
; flags : IKEEXT_POLICY_FLAG (+24, 4byte) st.6 = 値 / 値 = st.6 (lpoke/lpeek も可)
; maxDynamicFilters : DWORD (+28, 4byte) st.7 = 値 / 値 = st.7 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; IKEEXT_POLICY0 サイズ: 40 バイト(x64)
dim st, 10 ; 4byte整数×10(構造体サイズ 40 / 4 切り上げ)
; softExpirationTime : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; numAuthenticationMethods : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; authenticationMethods : IKEEXT_AUTHENTICATION_METHOD0* (+8, 8byte) varptr(st)+8 を基点に操作(8byte:入れ子/配列)
; initiatorImpersonationType : IKEEXT_AUTHENTICATION_IMPERSONATION_TYPE (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; numIkeProposals : DWORD (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; ikeProposals : IKEEXT_PROPOSAL0* (+24, 8byte) varptr(st)+24 を基点に操作(8byte:入れ子/配列)
; flags : IKEEXT_POLICY_FLAG (+32, 4byte) st.8 = 値 / 値 = st.8 (lpoke/lpeek も可)
; maxDynamicFilters : DWORD (+36, 4byte) st.9 = 値 / 値 = st.9 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global IKEEXT_POLICY0
#field int softExpirationTime
#field int numAuthenticationMethods
#field intptr authenticationMethods
#field int initiatorImpersonationType
#field int numIkeProposals
#field intptr ikeProposals
#field int flags
#field int maxDynamicFilters
#endstruct
stdim st, IKEEXT_POLICY0 ; NSTRUCT 変数を確保
st->softExpirationTime = 100
mes "softExpirationTime=" + st->softExpirationTime