Win32 API 日本語リファレンス
ホームNetworkManagement.Rras › ROUTER_CUSTOM_IKEv2_POLICY0

ROUTER_CUSTOM_IKEv2_POLICY0

構造体
サイズx64: 24 バイト / x86: 24 バイト

サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。

フィールド

フィールドサイズx64x86説明
dwIntegrityMethodDWORD4+0+0IKEv2 メイン モード SA のネゴシエーション時にネゴシエートされる整合性アルゴリズムを指定する値です。このメンバーに指定できる値は IKEEXT_INTEGRITY_TYPE で定義されています。
dwEncryptionMethodDWORD4+4+4IKEv2 メイン モード SA のネゴシエーション時にネゴシエートされる暗号化アルゴリズムを指定する値です。このメンバーに指定できる値は IKEEXT_CIPHER_TYPE で定義されています。
dwCipherTransformConstantDWORD4+8+8IKEv2 クイック モード SA のネゴシエーション時にネゴシエートされる暗号化アルゴリズムを指定する値です。このメンバーに指定できる値は IPSEC_CIPHER_TYPE で定義されています。
dwAuthTransformConstantDWORD4+12+12IKEv2 クイック モード SA のネゴシエーション時にネゴシエートされるハッシュ アルゴリズムを指定する値です。このメンバーに指定できる値は IPSEC_AUTH_TYPE で定義されています。
dwPfsGroupDWORD4+16+16クイック モードの PFS (Perfect Forward Secrecy) に使用する Diffie Hellman アルゴリズムを指定する値です。このメンバーに指定できる値は IPSEC_PFS_GROUP で定義されています。
dwDhGroupDWORD4+20+20MM SA のネゴシエーション時に、インターネット キー交換 (IKE) の鍵生成に使用される Diffie Hellman グループの種類を指定する値です。このメンバーに指定できる値は IKEEXT_DH_GROUP で定義されています。

公式ドキュメント

IKEv2 のメイン モードおよびクイック モードのポリシー構成を格納します。

ROUTER_CUSTOM_IKEv2_POLICY0 構造体をコード内で直接使用しないでください。代わりに ROUTER_CUSTOM_IKEv2_POLICY を使用することで、コードがコンパイルされるオペレーティング システムに基づいた適切なバージョンが使用されます。

出典・ライセンス: 上記「公式ドキュメント」の内容は Microsoft の Win32 API ドキュメント(MicrosoftDocs/sdk-api)を日本語に翻訳・改変したものです。© Microsoft Corporation. CC BY 4.0 で提供。
Microsoft 公式リファレンス: 英語 (en-us) · 日本語 (ja-jp) · 原文ソース (GitHub)

各言語での定義

#include <windows.h>

// ROUTER_CUSTOM_IKEv2_POLICY0  (x64 24 / x86 24 バイト)
typedef struct ROUTER_CUSTOM_IKEv2_POLICY0 {
    DWORD dwIntegrityMethod;
    DWORD dwEncryptionMethod;
    DWORD dwCipherTransformConstant;
    DWORD dwAuthTransformConstant;
    DWORD dwPfsGroup;
    DWORD dwDhGroup;
} ROUTER_CUSTOM_IKEv2_POLICY0;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct ROUTER_CUSTOM_IKEv2_POLICY0
{
    public uint dwIntegrityMethod;
    public uint dwEncryptionMethod;
    public uint dwCipherTransformConstant;
    public uint dwAuthTransformConstant;
    public uint dwPfsGroup;
    public uint dwDhGroup;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure ROUTER_CUSTOM_IKEv2_POLICY0
    Public dwIntegrityMethod As UInteger
    Public dwEncryptionMethod As UInteger
    Public dwCipherTransformConstant As UInteger
    Public dwAuthTransformConstant As UInteger
    Public dwPfsGroup As UInteger
    Public dwDhGroup As UInteger
End Structure
import ctypes
from ctypes import wintypes

class ROUTER_CUSTOM_IKEv2_POLICY0(ctypes.Structure):
    _fields_ = [
        ("dwIntegrityMethod", wintypes.DWORD),
        ("dwEncryptionMethod", wintypes.DWORD),
        ("dwCipherTransformConstant", wintypes.DWORD),
        ("dwAuthTransformConstant", wintypes.DWORD),
        ("dwPfsGroup", wintypes.DWORD),
        ("dwDhGroup", wintypes.DWORD),
    ]
#[repr(C)]
pub struct ROUTER_CUSTOM_IKEv2_POLICY0 {
    pub dwIntegrityMethod: u32,
    pub dwEncryptionMethod: u32,
    pub dwCipherTransformConstant: u32,
    pub dwAuthTransformConstant: u32,
    pub dwPfsGroup: u32,
    pub dwDhGroup: u32,
}
import "golang.org/x/sys/windows"

type ROUTER_CUSTOM_IKEv2_POLICY0 struct {
	dwIntegrityMethod uint32
	dwEncryptionMethod uint32
	dwCipherTransformConstant uint32
	dwAuthTransformConstant uint32
	dwPfsGroup uint32
	dwDhGroup uint32
}
type
  ROUTER_CUSTOM_IKEv2_POLICY0 = record
    dwIntegrityMethod: DWORD;
    dwEncryptionMethod: DWORD;
    dwCipherTransformConstant: DWORD;
    dwAuthTransformConstant: DWORD;
    dwPfsGroup: DWORD;
    dwDhGroup: DWORD;
  end;
const ROUTER_CUSTOM_IKEv2_POLICY0 = extern struct {
    dwIntegrityMethod: u32,
    dwEncryptionMethod: u32,
    dwCipherTransformConstant: u32,
    dwAuthTransformConstant: u32,
    dwPfsGroup: u32,
    dwDhGroup: u32,
};
type
  ROUTER_CUSTOM_IKEv2_POLICY0 {.bycopy.} = object
    dwIntegrityMethod: uint32
    dwEncryptionMethod: uint32
    dwCipherTransformConstant: uint32
    dwAuthTransformConstant: uint32
    dwPfsGroup: uint32
    dwDhGroup: uint32
struct ROUTER_CUSTOM_IKEv2_POLICY0
{
    uint dwIntegrityMethod;
    uint dwEncryptionMethod;
    uint dwCipherTransformConstant;
    uint dwAuthTransformConstant;
    uint dwPfsGroup;
    uint dwDhGroup;
}

HSP用 定義

HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; ROUTER_CUSTOM_IKEv2_POLICY0 サイズ: 24 バイト(x64)
dim st, 6    ; 4byte整数×6(構造体サイズ 24 / 4 切り上げ)
; dwIntegrityMethod : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; dwEncryptionMethod : DWORD (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; dwCipherTransformConstant : DWORD (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; dwAuthTransformConstant : DWORD (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; dwPfsGroup : DWORD (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; dwDhGroup : DWORD (+20, 4byte)  st.5 = 値  /  値 = st.5   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global ROUTER_CUSTOM_IKEv2_POLICY0
    #field int dwIntegrityMethod
    #field int dwEncryptionMethod
    #field int dwCipherTransformConstant
    #field int dwAuthTransformConstant
    #field int dwPfsGroup
    #field int dwDhGroup
#endstruct

stdim st, ROUTER_CUSTOM_IKEv2_POLICY0        ; NSTRUCT 変数を確保
st->dwIntegrityMethod = 100
mes "dwIntegrityMethod=" + st->dwIntegrityMethod