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

RASIKEV2_PROJECTION_INFO

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

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

フィールド

フィールドサイズx64x86説明
dwIPv4NegotiationErrorDWORD4+0+0IPv4アドレスネゴシエーションのエラーコード。0なら正常。
ipv4AddressIN_ADDR8/4+8+4クライアントに割り当てられたIPv4アドレス。
ipv4ServerAddressIN_ADDR8/4+16+8サーバー側のIPv4アドレス。
dwIPv6NegotiationErrorDWORD4+24+12IPv6アドレスネゴシエーションのエラーコード。0なら正常。
ipv6AddressIN6_ADDR16+28+16クライアントに割り当てられたIPv6アドレス。
ipv6ServerAddressIN6_ADDR16+44+32サーバー側のIPv6アドレス。
dwPrefixLengthDWORD4+60+48IPv6アドレスのプレフィックス長(ビット数)。
dwAuthenticationProtocolDWORD4+64+52IKEv2接続で使用された認証プロトコル。
dwEapTypeIdDWORD4+68+56EAP使用時のEAPタイプ識別子。
dwFlagsRASIKEV_PROJECTION_INFO_FLAGS4+72+60IKEv2プロジェクション情報のフラグ(RASIKEV_PROJECTION_INFO_FLAGS)。
dwEncryptionMethodDWORD4+76+64トンネルで使用される暗号化方式。
numIPv4ServerAddressesDWORD4+80+68ipv4ServerAddressesが指す配列の要素数。
ipv4ServerAddressesIN_ADDR*8/4+88+72サーバーが提供する複数のIPv4アドレス配列へのポインタ。
numIPv6ServerAddressesDWORD4+96+76ipv6ServerAddressesが指す配列の要素数。
ipv6ServerAddressesIN6_ADDR*8/4+104+80サーバーが提供する複数のIPv6アドレス配列へのポインタ。

各言語での定義

#include <windows.h>

// IN_ADDR  (x64 8 / x86 4 バイト)
typedef struct IN_ADDR {
    _S_un_e__Union S_un;
} IN_ADDR;

// IN6_ADDR  (x64 16 / x86 16 バイト)
typedef struct IN6_ADDR {
    _u_e__Union u;
} IN6_ADDR;

// RASIKEV2_PROJECTION_INFO  (x64 112 / x86 84 バイト)
typedef struct RASIKEV2_PROJECTION_INFO {
    DWORD dwIPv4NegotiationError;
    IN_ADDR ipv4Address;
    IN_ADDR ipv4ServerAddress;
    DWORD dwIPv6NegotiationError;
    IN6_ADDR ipv6Address;
    IN6_ADDR ipv6ServerAddress;
    DWORD dwPrefixLength;
    DWORD dwAuthenticationProtocol;
    DWORD dwEapTypeId;
    RASIKEV_PROJECTION_INFO_FLAGS dwFlags;
    DWORD dwEncryptionMethod;
    DWORD numIPv4ServerAddresses;
    IN_ADDR* ipv4ServerAddresses;
    DWORD numIPv6ServerAddresses;
    IN6_ADDR* ipv6ServerAddresses;
} RASIKEV2_PROJECTION_INFO;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct IN_ADDR
{
    public _S_un_e__Union S_un;
}

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct IN6_ADDR
{
    public _u_e__Union u;
}

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct RASIKEV2_PROJECTION_INFO
{
    public uint dwIPv4NegotiationError;
    public IN_ADDR ipv4Address;
    public IN_ADDR ipv4ServerAddress;
    public uint dwIPv6NegotiationError;
    public IN6_ADDR ipv6Address;
    public IN6_ADDR ipv6ServerAddress;
    public uint dwPrefixLength;
    public uint dwAuthenticationProtocol;
    public uint dwEapTypeId;
    public uint dwFlags;
    public uint dwEncryptionMethod;
    public uint numIPv4ServerAddresses;
    public IntPtr ipv4ServerAddresses;
    public uint numIPv6ServerAddresses;
    public IntPtr ipv6ServerAddresses;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure IN_ADDR
    Public S_un As _S_un_e__Union
End Structure

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure IN6_ADDR
    Public u As _u_e__Union
End Structure

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure RASIKEV2_PROJECTION_INFO
    Public dwIPv4NegotiationError As UInteger
    Public ipv4Address As IN_ADDR
    Public ipv4ServerAddress As IN_ADDR
    Public dwIPv6NegotiationError As UInteger
    Public ipv6Address As IN6_ADDR
    Public ipv6ServerAddress As IN6_ADDR
    Public dwPrefixLength As UInteger
    Public dwAuthenticationProtocol As UInteger
    Public dwEapTypeId As UInteger
    Public dwFlags As UInteger
    Public dwEncryptionMethod As UInteger
    Public numIPv4ServerAddresses As UInteger
    Public ipv4ServerAddresses As IntPtr
    Public numIPv6ServerAddresses As UInteger
    Public ipv6ServerAddresses As IntPtr
End Structure
import ctypes
from ctypes import wintypes

class IN_ADDR(ctypes.Structure):
    _fields_ = [
        ("S_un", _S_un_e__Union),
    ]

class IN6_ADDR(ctypes.Structure):
    _fields_ = [
        ("u", _u_e__Union),
    ]

class RASIKEV2_PROJECTION_INFO(ctypes.Structure):
    _fields_ = [
        ("dwIPv4NegotiationError", wintypes.DWORD),
        ("ipv4Address", IN_ADDR),
        ("ipv4ServerAddress", IN_ADDR),
        ("dwIPv6NegotiationError", wintypes.DWORD),
        ("ipv6Address", IN6_ADDR),
        ("ipv6ServerAddress", IN6_ADDR),
        ("dwPrefixLength", wintypes.DWORD),
        ("dwAuthenticationProtocol", wintypes.DWORD),
        ("dwEapTypeId", wintypes.DWORD),
        ("dwFlags", wintypes.DWORD),
        ("dwEncryptionMethod", wintypes.DWORD),
        ("numIPv4ServerAddresses", wintypes.DWORD),
        ("ipv4ServerAddresses", ctypes.c_void_p),
        ("numIPv6ServerAddresses", wintypes.DWORD),
        ("ipv6ServerAddresses", ctypes.c_void_p),
    ]
#[repr(C)]
pub struct IN_ADDR {
    pub S_un: _S_un_e__Union,
}

#[repr(C)]
pub struct IN6_ADDR {
    pub u: _u_e__Union,
}

#[repr(C)]
pub struct RASIKEV2_PROJECTION_INFO {
    pub dwIPv4NegotiationError: u32,
    pub ipv4Address: IN_ADDR,
    pub ipv4ServerAddress: IN_ADDR,
    pub dwIPv6NegotiationError: u32,
    pub ipv6Address: IN6_ADDR,
    pub ipv6ServerAddress: IN6_ADDR,
    pub dwPrefixLength: u32,
    pub dwAuthenticationProtocol: u32,
    pub dwEapTypeId: u32,
    pub dwFlags: u32,
    pub dwEncryptionMethod: u32,
    pub numIPv4ServerAddresses: u32,
    pub ipv4ServerAddresses: *mut core::ffi::c_void,
    pub numIPv6ServerAddresses: u32,
    pub ipv6ServerAddresses: *mut core::ffi::c_void,
}
import "golang.org/x/sys/windows"

type IN_ADDR struct {
	S_un _S_un_e__Union
}

type IN6_ADDR struct {
	u _u_e__Union
}

type RASIKEV2_PROJECTION_INFO struct {
	dwIPv4NegotiationError uint32
	ipv4Address IN_ADDR
	ipv4ServerAddress IN_ADDR
	dwIPv6NegotiationError uint32
	ipv6Address IN6_ADDR
	ipv6ServerAddress IN6_ADDR
	dwPrefixLength uint32
	dwAuthenticationProtocol uint32
	dwEapTypeId uint32
	dwFlags uint32
	dwEncryptionMethod uint32
	numIPv4ServerAddresses uint32
	ipv4ServerAddresses uintptr
	numIPv6ServerAddresses uint32
	ipv6ServerAddresses uintptr
}
type
  IN_ADDR = record
    S_un: _S_un_e__Union;
  end;

  IN6_ADDR = record
    u: _u_e__Union;
  end;

  RASIKEV2_PROJECTION_INFO = record
    dwIPv4NegotiationError: DWORD;
    ipv4Address: IN_ADDR;
    ipv4ServerAddress: IN_ADDR;
    dwIPv6NegotiationError: DWORD;
    ipv6Address: IN6_ADDR;
    ipv6ServerAddress: IN6_ADDR;
    dwPrefixLength: DWORD;
    dwAuthenticationProtocol: DWORD;
    dwEapTypeId: DWORD;
    dwFlags: DWORD;
    dwEncryptionMethod: DWORD;
    numIPv4ServerAddresses: DWORD;
    ipv4ServerAddresses: Pointer;
    numIPv6ServerAddresses: DWORD;
    ipv6ServerAddresses: Pointer;
  end;
const IN_ADDR = extern struct {
    S_un: _S_un_e__Union,
};

const IN6_ADDR = extern struct {
    u: _u_e__Union,
};

const RASIKEV2_PROJECTION_INFO = extern struct {
    dwIPv4NegotiationError: u32,
    ipv4Address: IN_ADDR,
    ipv4ServerAddress: IN_ADDR,
    dwIPv6NegotiationError: u32,
    ipv6Address: IN6_ADDR,
    ipv6ServerAddress: IN6_ADDR,
    dwPrefixLength: u32,
    dwAuthenticationProtocol: u32,
    dwEapTypeId: u32,
    dwFlags: u32,
    dwEncryptionMethod: u32,
    numIPv4ServerAddresses: u32,
    ipv4ServerAddresses: ?*anyopaque,
    numIPv6ServerAddresses: u32,
    ipv6ServerAddresses: ?*anyopaque,
};
type
  IN_ADDR {.bycopy.} = object
    S_un: _S_un_e__Union

  IN6_ADDR {.bycopy.} = object
    u: _u_e__Union

  RASIKEV2_PROJECTION_INFO {.bycopy.} = object
    dwIPv4NegotiationError: uint32
    ipv4Address: IN_ADDR
    ipv4ServerAddress: IN_ADDR
    dwIPv6NegotiationError: uint32
    ipv6Address: IN6_ADDR
    ipv6ServerAddress: IN6_ADDR
    dwPrefixLength: uint32
    dwAuthenticationProtocol: uint32
    dwEapTypeId: uint32
    dwFlags: uint32
    dwEncryptionMethod: uint32
    numIPv4ServerAddresses: uint32
    ipv4ServerAddresses: pointer
    numIPv6ServerAddresses: uint32
    ipv6ServerAddresses: pointer
struct IN_ADDR
{
    _S_un_e__Union S_un;
}

struct IN6_ADDR
{
    _u_e__Union u;
}

struct RASIKEV2_PROJECTION_INFO
{
    uint dwIPv4NegotiationError;
    IN_ADDR ipv4Address;
    IN_ADDR ipv4ServerAddress;
    uint dwIPv6NegotiationError;
    IN6_ADDR ipv6Address;
    IN6_ADDR ipv6ServerAddress;
    uint dwPrefixLength;
    uint dwAuthenticationProtocol;
    uint dwEapTypeId;
    uint dwFlags;
    uint dwEncryptionMethod;
    uint numIPv4ServerAddresses;
    void* ipv4ServerAddresses;
    uint numIPv6ServerAddresses;
    void* ipv6ServerAddresses;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; RASIKEV2_PROJECTION_INFO サイズ: 84 バイト(x86)
dim st, 21    ; 4byte整数×21(構造体サイズ 84 / 4 切り上げ)
; dwIPv4NegotiationError : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; ipv4Address : IN_ADDR (+4, 4byte)  varptr(st)+4 を基点に操作(4byte:入れ子/配列)
; ipv4ServerAddress : IN_ADDR (+8, 4byte)  varptr(st)+8 を基点に操作(4byte:入れ子/配列)
; dwIPv6NegotiationError : DWORD (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; ipv6Address : IN6_ADDR (+16, 16byte)  varptr(st)+16 を基点に操作(16byte:入れ子/配列)
; ipv6ServerAddress : IN6_ADDR (+32, 16byte)  varptr(st)+32 を基点に操作(16byte:入れ子/配列)
; dwPrefixLength : DWORD (+48, 4byte)  st.12 = 値  /  値 = st.12   (lpoke/lpeek も可)
; dwAuthenticationProtocol : DWORD (+52, 4byte)  st.13 = 値  /  値 = st.13   (lpoke/lpeek も可)
; dwEapTypeId : DWORD (+56, 4byte)  st.14 = 値  /  値 = st.14   (lpoke/lpeek も可)
; dwFlags : RASIKEV_PROJECTION_INFO_FLAGS (+60, 4byte)  st.15 = 値  /  値 = st.15   (lpoke/lpeek も可)
; dwEncryptionMethod : DWORD (+64, 4byte)  st.16 = 値  /  値 = st.16   (lpoke/lpeek も可)
; numIPv4ServerAddresses : DWORD (+68, 4byte)  st.17 = 値  /  値 = st.17   (lpoke/lpeek も可)
; ipv4ServerAddresses : IN_ADDR* (+72, 4byte)  varptr(st)+72 を基点に操作(4byte:入れ子/配列)
; numIPv6ServerAddresses : DWORD (+76, 4byte)  st.19 = 値  /  値 = st.19   (lpoke/lpeek も可)
; ipv6ServerAddresses : IN6_ADDR* (+80, 4byte)  varptr(st)+80 を基点に操作(4byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; RASIKEV2_PROJECTION_INFO サイズ: 112 バイト(x64)
dim st, 28    ; 4byte整数×28(構造体サイズ 112 / 4 切り上げ)
; dwIPv4NegotiationError : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; ipv4Address : IN_ADDR (+8, 8byte)  varptr(st)+8 を基点に操作(8byte:入れ子/配列)
; ipv4ServerAddress : IN_ADDR (+16, 8byte)  varptr(st)+16 を基点に操作(8byte:入れ子/配列)
; dwIPv6NegotiationError : DWORD (+24, 4byte)  st.6 = 値  /  値 = st.6   (lpoke/lpeek も可)
; ipv6Address : IN6_ADDR (+28, 16byte)  varptr(st)+28 を基点に操作(16byte:入れ子/配列)
; ipv6ServerAddress : IN6_ADDR (+44, 16byte)  varptr(st)+44 を基点に操作(16byte:入れ子/配列)
; dwPrefixLength : DWORD (+60, 4byte)  st.15 = 値  /  値 = st.15   (lpoke/lpeek も可)
; dwAuthenticationProtocol : DWORD (+64, 4byte)  st.16 = 値  /  値 = st.16   (lpoke/lpeek も可)
; dwEapTypeId : DWORD (+68, 4byte)  st.17 = 値  /  値 = st.17   (lpoke/lpeek も可)
; dwFlags : RASIKEV_PROJECTION_INFO_FLAGS (+72, 4byte)  st.18 = 値  /  値 = st.18   (lpoke/lpeek も可)
; dwEncryptionMethod : DWORD (+76, 4byte)  st.19 = 値  /  値 = st.19   (lpoke/lpeek も可)
; numIPv4ServerAddresses : DWORD (+80, 4byte)  st.20 = 値  /  値 = st.20   (lpoke/lpeek も可)
; ipv4ServerAddresses : IN_ADDR* (+88, 8byte)  varptr(st)+88 を基点に操作(8byte:入れ子/配列)
; numIPv6ServerAddresses : DWORD (+96, 4byte)  st.24 = 値  /  値 = st.24   (lpoke/lpeek も可)
; ipv6ServerAddresses : IN6_ADDR* (+104, 8byte)  varptr(st)+104 を基点に操作(8byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global IN_ADDR
    #field byte S_un 8
#endstruct

#defstruct global IN6_ADDR
    #field byte u 16
#endstruct

#defstruct global RASIKEV2_PROJECTION_INFO
    #field int dwIPv4NegotiationError
    #field IN_ADDR ipv4Address
    #field IN_ADDR ipv4ServerAddress
    #field int dwIPv6NegotiationError
    #field IN6_ADDR ipv6Address
    #field IN6_ADDR ipv6ServerAddress
    #field int dwPrefixLength
    #field int dwAuthenticationProtocol
    #field int dwEapTypeId
    #field int dwFlags
    #field int dwEncryptionMethod
    #field int numIPv4ServerAddresses
    #field intptr ipv4ServerAddresses
    #field int numIPv6ServerAddresses
    #field intptr ipv6ServerAddresses
#endstruct

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