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

IKEV2_PROJECTION_INFO2

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

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

フィールド

フィールドサイズx64x86説明
dwIPv4NegotiationErrorDWORD4+0+0IPv4ネゴシエーションのエラーコード。0なら正常。
wszAddressWCHAR32+4+4ローカルに割り当てられたIPv4アドレス(ワイド文字列)。
wszRemoteAddressWCHAR32+36+36リモートのIPv4アドレス(ワイド文字列)。
IPv4SubInterfaceIndexULONGLONG8+72+72IPv4サブインターフェイスのインデックス(64ビット)。
dwIPv6NegotiationErrorDWORD4+80+80IPv6ネゴシエーションのエラーコード。0なら正常。
bInterfaceIdentifierBYTE8+84+84ローカルのIPv6インターフェイス識別子(8バイト)。
bRemoteInterfaceIdentifierBYTE8+92+92リモートのIPv6インターフェイス識別子(8バイト)。
bPrefixBYTE8+100+100割り当てられたIPv6プレフィックス(8バイト)。
dwPrefixLengthDWORD4+108+108IPv6プレフィックスの長さ(ビット数)。
IPv6SubInterfaceIndexULONGLONG8+112+112IPv6サブインターフェイスのインデックス(64ビット)。
dwOptionsDWORD4+120+120IKEv2接続のオプションフラグ。
dwAuthenticationProtocolDWORD4+124+124使用された認証プロトコル。
dwEapTypeIdDWORD4+128+128EAPタイプ識別子。
dwEmbeddedEAPTypeIdDWORD4+132+132EAPでラップされた内部EAPタイプ識別子。
dwCompressionAlgorithmDWORD4+136+136使用された圧縮アルゴリズム。
dwEncryptionMethodDWORD4+140+140トンネルで使用される暗号化方式。

各言語での定義

#include <windows.h>

// IKEV2_PROJECTION_INFO2  (x64 144 / x86 144 バイト)
typedef struct IKEV2_PROJECTION_INFO2 {
    DWORD dwIPv4NegotiationError;
    WCHAR wszAddress[16];
    WCHAR wszRemoteAddress[16];
    ULONGLONG IPv4SubInterfaceIndex;
    DWORD dwIPv6NegotiationError;
    BYTE bInterfaceIdentifier[8];
    BYTE bRemoteInterfaceIdentifier[8];
    BYTE bPrefix[8];
    DWORD dwPrefixLength;
    ULONGLONG IPv6SubInterfaceIndex;
    DWORD dwOptions;
    DWORD dwAuthenticationProtocol;
    DWORD dwEapTypeId;
    DWORD dwEmbeddedEAPTypeId;
    DWORD dwCompressionAlgorithm;
    DWORD dwEncryptionMethod;
} IKEV2_PROJECTION_INFO2;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct IKEV2_PROJECTION_INFO2
{
    public uint dwIPv4NegotiationError;
    [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 16)] public string wszAddress;
    [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 16)] public string wszRemoteAddress;
    public ulong IPv4SubInterfaceIndex;
    public uint dwIPv6NegotiationError;
    [MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)] public byte[] bInterfaceIdentifier;
    [MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)] public byte[] bRemoteInterfaceIdentifier;
    [MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)] public byte[] bPrefix;
    public uint dwPrefixLength;
    public ulong IPv6SubInterfaceIndex;
    public uint dwOptions;
    public uint dwAuthenticationProtocol;
    public uint dwEapTypeId;
    public uint dwEmbeddedEAPTypeId;
    public uint dwCompressionAlgorithm;
    public uint dwEncryptionMethod;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure IKEV2_PROJECTION_INFO2
    Public dwIPv4NegotiationError As UInteger
    <MarshalAs(UnmanagedType.ByValTStr, SizeConst:=16)> Public wszAddress As String
    <MarshalAs(UnmanagedType.ByValTStr, SizeConst:=16)> Public wszRemoteAddress As String
    Public IPv4SubInterfaceIndex As ULong
    Public dwIPv6NegotiationError As UInteger
    <MarshalAs(UnmanagedType.ByValArray, SizeConst:=8)> Public bInterfaceIdentifier() As Byte
    <MarshalAs(UnmanagedType.ByValArray, SizeConst:=8)> Public bRemoteInterfaceIdentifier() As Byte
    <MarshalAs(UnmanagedType.ByValArray, SizeConst:=8)> Public bPrefix() As Byte
    Public dwPrefixLength As UInteger
    Public IPv6SubInterfaceIndex As ULong
    Public dwOptions As UInteger
    Public dwAuthenticationProtocol As UInteger
    Public dwEapTypeId As UInteger
    Public dwEmbeddedEAPTypeId As UInteger
    Public dwCompressionAlgorithm As UInteger
    Public dwEncryptionMethod As UInteger
End Structure
import ctypes
from ctypes import wintypes

class IKEV2_PROJECTION_INFO2(ctypes.Structure):
    _fields_ = [
        ("dwIPv4NegotiationError", wintypes.DWORD),
        ("wszAddress", ctypes.c_wchar * 16),
        ("wszRemoteAddress", ctypes.c_wchar * 16),
        ("IPv4SubInterfaceIndex", ctypes.c_ulonglong),
        ("dwIPv6NegotiationError", wintypes.DWORD),
        ("bInterfaceIdentifier", ctypes.c_ubyte * 8),
        ("bRemoteInterfaceIdentifier", ctypes.c_ubyte * 8),
        ("bPrefix", ctypes.c_ubyte * 8),
        ("dwPrefixLength", wintypes.DWORD),
        ("IPv6SubInterfaceIndex", ctypes.c_ulonglong),
        ("dwOptions", wintypes.DWORD),
        ("dwAuthenticationProtocol", wintypes.DWORD),
        ("dwEapTypeId", wintypes.DWORD),
        ("dwEmbeddedEAPTypeId", wintypes.DWORD),
        ("dwCompressionAlgorithm", wintypes.DWORD),
        ("dwEncryptionMethod", wintypes.DWORD),
    ]
#[repr(C)]
pub struct IKEV2_PROJECTION_INFO2 {
    pub dwIPv4NegotiationError: u32,
    pub wszAddress: [u16; 16],
    pub wszRemoteAddress: [u16; 16],
    pub IPv4SubInterfaceIndex: u64,
    pub dwIPv6NegotiationError: u32,
    pub bInterfaceIdentifier: [u8; 8],
    pub bRemoteInterfaceIdentifier: [u8; 8],
    pub bPrefix: [u8; 8],
    pub dwPrefixLength: u32,
    pub IPv6SubInterfaceIndex: u64,
    pub dwOptions: u32,
    pub dwAuthenticationProtocol: u32,
    pub dwEapTypeId: u32,
    pub dwEmbeddedEAPTypeId: u32,
    pub dwCompressionAlgorithm: u32,
    pub dwEncryptionMethod: u32,
}
import "golang.org/x/sys/windows"

type IKEV2_PROJECTION_INFO2 struct {
	dwIPv4NegotiationError uint32
	wszAddress [16]uint16
	wszRemoteAddress [16]uint16
	IPv4SubInterfaceIndex uint64
	dwIPv6NegotiationError uint32
	bInterfaceIdentifier [8]byte
	bRemoteInterfaceIdentifier [8]byte
	bPrefix [8]byte
	dwPrefixLength uint32
	IPv6SubInterfaceIndex uint64
	dwOptions uint32
	dwAuthenticationProtocol uint32
	dwEapTypeId uint32
	dwEmbeddedEAPTypeId uint32
	dwCompressionAlgorithm uint32
	dwEncryptionMethod uint32
}
type
  IKEV2_PROJECTION_INFO2 = record
    dwIPv4NegotiationError: DWORD;
    wszAddress: array[0..15] of WideChar;
    wszRemoteAddress: array[0..15] of WideChar;
    IPv4SubInterfaceIndex: UInt64;
    dwIPv6NegotiationError: DWORD;
    bInterfaceIdentifier: array[0..7] of Byte;
    bRemoteInterfaceIdentifier: array[0..7] of Byte;
    bPrefix: array[0..7] of Byte;
    dwPrefixLength: DWORD;
    IPv6SubInterfaceIndex: UInt64;
    dwOptions: DWORD;
    dwAuthenticationProtocol: DWORD;
    dwEapTypeId: DWORD;
    dwEmbeddedEAPTypeId: DWORD;
    dwCompressionAlgorithm: DWORD;
    dwEncryptionMethod: DWORD;
  end;
const IKEV2_PROJECTION_INFO2 = extern struct {
    dwIPv4NegotiationError: u32,
    wszAddress: [16]u16,
    wszRemoteAddress: [16]u16,
    IPv4SubInterfaceIndex: u64,
    dwIPv6NegotiationError: u32,
    bInterfaceIdentifier: [8]u8,
    bRemoteInterfaceIdentifier: [8]u8,
    bPrefix: [8]u8,
    dwPrefixLength: u32,
    IPv6SubInterfaceIndex: u64,
    dwOptions: u32,
    dwAuthenticationProtocol: u32,
    dwEapTypeId: u32,
    dwEmbeddedEAPTypeId: u32,
    dwCompressionAlgorithm: u32,
    dwEncryptionMethod: u32,
};
type
  IKEV2_PROJECTION_INFO2 {.bycopy.} = object
    dwIPv4NegotiationError: uint32
    wszAddress: array[16, uint16]
    wszRemoteAddress: array[16, uint16]
    IPv4SubInterfaceIndex: uint64
    dwIPv6NegotiationError: uint32
    bInterfaceIdentifier: array[8, uint8]
    bRemoteInterfaceIdentifier: array[8, uint8]
    bPrefix: array[8, uint8]
    dwPrefixLength: uint32
    IPv6SubInterfaceIndex: uint64
    dwOptions: uint32
    dwAuthenticationProtocol: uint32
    dwEapTypeId: uint32
    dwEmbeddedEAPTypeId: uint32
    dwCompressionAlgorithm: uint32
    dwEncryptionMethod: uint32
struct IKEV2_PROJECTION_INFO2
{
    uint dwIPv4NegotiationError;
    wchar[16] wszAddress;
    wchar[16] wszRemoteAddress;
    ulong IPv4SubInterfaceIndex;
    uint dwIPv6NegotiationError;
    ubyte[8] bInterfaceIdentifier;
    ubyte[8] bRemoteInterfaceIdentifier;
    ubyte[8] bPrefix;
    uint dwPrefixLength;
    ulong IPv6SubInterfaceIndex;
    uint dwOptions;
    uint dwAuthenticationProtocol;
    uint dwEapTypeId;
    uint dwEmbeddedEAPTypeId;
    uint dwCompressionAlgorithm;
    uint dwEncryptionMethod;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; IKEV2_PROJECTION_INFO2 サイズ: 144 バイト(x64)
dim st, 36    ; 4byte整数×36(構造体サイズ 144 / 4 切り上げ)
; dwIPv4NegotiationError : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; wszAddress : WCHAR (+4, 32byte)  varptr(st)+4 を基点に操作(32byte:入れ子/配列)
; wszRemoteAddress : WCHAR (+36, 32byte)  varptr(st)+36 を基点に操作(32byte:入れ子/配列)
; IPv4SubInterfaceIndex : ULONGLONG (+72, 8byte)  qpoke st,72,値 / qpeek(st,72)  ※IronHSPのみ。3.7/3.8は lpoke st,72,下位 : lpoke st,76,上位
; dwIPv6NegotiationError : DWORD (+80, 4byte)  st.20 = 値  /  値 = st.20   (lpoke/lpeek も可)
; bInterfaceIdentifier : BYTE (+84, 8byte)  varptr(st)+84 を基点に操作(8byte:入れ子/配列)
; bRemoteInterfaceIdentifier : BYTE (+92, 8byte)  varptr(st)+92 を基点に操作(8byte:入れ子/配列)
; bPrefix : BYTE (+100, 8byte)  varptr(st)+100 を基点に操作(8byte:入れ子/配列)
; dwPrefixLength : DWORD (+108, 4byte)  st.27 = 値  /  値 = st.27   (lpoke/lpeek も可)
; IPv6SubInterfaceIndex : ULONGLONG (+112, 8byte)  qpoke st,112,値 / qpeek(st,112)  ※IronHSPのみ。3.7/3.8は lpoke st,112,下位 : lpoke st,116,上位
; dwOptions : DWORD (+120, 4byte)  st.30 = 値  /  値 = st.30   (lpoke/lpeek も可)
; dwAuthenticationProtocol : DWORD (+124, 4byte)  st.31 = 値  /  値 = st.31   (lpoke/lpeek も可)
; dwEapTypeId : DWORD (+128, 4byte)  st.32 = 値  /  値 = st.32   (lpoke/lpeek も可)
; dwEmbeddedEAPTypeId : DWORD (+132, 4byte)  st.33 = 値  /  値 = st.33   (lpoke/lpeek も可)
; dwCompressionAlgorithm : DWORD (+136, 4byte)  st.34 = 値  /  値 = st.34   (lpoke/lpeek も可)
; dwEncryptionMethod : DWORD (+140, 4byte)  st.35 = 値  /  値 = st.35   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global IKEV2_PROJECTION_INFO2
    #field int dwIPv4NegotiationError
    #field wchar wszAddress 16
    #field wchar wszRemoteAddress 16
    #field int64 IPv4SubInterfaceIndex
    #field int dwIPv6NegotiationError
    #field byte bInterfaceIdentifier 8
    #field byte bRemoteInterfaceIdentifier 8
    #field byte bPrefix 8
    #field int dwPrefixLength
    #field int64 IPv6SubInterfaceIndex
    #field int dwOptions
    #field int dwAuthenticationProtocol
    #field int dwEapTypeId
    #field int dwEmbeddedEAPTypeId
    #field int dwCompressionAlgorithm
    #field int dwEncryptionMethod
#endstruct

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