ホーム › NetworkManagement.Rras › RASPPPLCPA
RASPPPLCPA
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| dwSize | DWORD | 4 | +0 | +0 | この構造体のバイト単位のサイズ。 |
| fBundled | BOOL | 4 | +4 | +4 | TRUEなら接続が複数リンクに束ねられていることを示す。 |
| dwError | DWORD | 4 | +8 | +8 | LCPネゴシエーション中のエラーコード。0なら正常。 |
| dwAuthenticationProtocol | DWORD | 4 | +12 | +12 | クライアントが使用した認証プロトコル(RASLCPAP_*)。 |
| dwAuthenticationData | DWORD | 4 | +16 | +16 | 使用された認証データの種別(RASLCPAD_*)。 |
| dwEapTypeId | DWORD | 4 | +20 | +20 | EAP使用時のEAPタイプ識別子。 |
| dwServerAuthenticationProtocol | DWORD | 4 | +24 | +24 | サーバーが使用した認証プロトコル。 |
| dwServerAuthenticationData | DWORD | 4 | +28 | +28 | サーバー側の認証データ種別。 |
| dwServerEapTypeId | DWORD | 4 | +32 | +32 | サーバー側のEAPタイプ識別子。 |
| fMultilink | BOOL | 4 | +36 | +36 | TRUEならマルチリンクPPPがネゴシエートされたことを示す。 |
| dwTerminateReason | DWORD | 4 | +40 | +40 | クライアント側の接続終了理由コード。 |
| dwServerTerminateReason | DWORD | 4 | +44 | +44 | サーバー側の接続終了理由コード。 |
| szReplyMessage | CHAR | 1024 | +48 | +48 | 認証時にサーバーから返されたメッセージ(ANSI文字列)。 |
| dwOptions | DWORD | 4 | +1072 | +1072 | クライアントのLCPオプションフラグ(RASLCPO_*)。 |
| dwServerOptions | DWORD | 4 | +1076 | +1076 | サーバーのLCPオプションフラグ。 |
各言語での定義
#include <windows.h>
// RASPPPLCPA (x64 1080 / x86 1080 バイト)
typedef struct RASPPPLCPA {
DWORD dwSize;
BOOL fBundled;
DWORD dwError;
DWORD dwAuthenticationProtocol;
DWORD dwAuthenticationData;
DWORD dwEapTypeId;
DWORD dwServerAuthenticationProtocol;
DWORD dwServerAuthenticationData;
DWORD dwServerEapTypeId;
BOOL fMultilink;
DWORD dwTerminateReason;
DWORD dwServerTerminateReason;
CHAR szReplyMessage[1024];
DWORD dwOptions;
DWORD dwServerOptions;
} RASPPPLCPA;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct RASPPPLCPA
{
public uint dwSize;
[MarshalAs(UnmanagedType.Bool)] public bool fBundled;
public uint dwError;
public uint dwAuthenticationProtocol;
public uint dwAuthenticationData;
public uint dwEapTypeId;
public uint dwServerAuthenticationProtocol;
public uint dwServerAuthenticationData;
public uint dwServerEapTypeId;
[MarshalAs(UnmanagedType.Bool)] public bool fMultilink;
public uint dwTerminateReason;
public uint dwServerTerminateReason;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 1024)] public sbyte[] szReplyMessage;
public uint dwOptions;
public uint dwServerOptions;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure RASPPPLCPA
Public dwSize As UInteger
<MarshalAs(UnmanagedType.Bool)> Public fBundled As Boolean
Public dwError As UInteger
Public dwAuthenticationProtocol As UInteger
Public dwAuthenticationData As UInteger
Public dwEapTypeId As UInteger
Public dwServerAuthenticationProtocol As UInteger
Public dwServerAuthenticationData As UInteger
Public dwServerEapTypeId As UInteger
<MarshalAs(UnmanagedType.Bool)> Public fMultilink As Boolean
Public dwTerminateReason As UInteger
Public dwServerTerminateReason As UInteger
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=1024)> Public szReplyMessage() As SByte
Public dwOptions As UInteger
Public dwServerOptions As UInteger
End Structureimport ctypes
from ctypes import wintypes
class RASPPPLCPA(ctypes.Structure):
_fields_ = [
("dwSize", wintypes.DWORD),
("fBundled", wintypes.BOOL),
("dwError", wintypes.DWORD),
("dwAuthenticationProtocol", wintypes.DWORD),
("dwAuthenticationData", wintypes.DWORD),
("dwEapTypeId", wintypes.DWORD),
("dwServerAuthenticationProtocol", wintypes.DWORD),
("dwServerAuthenticationData", wintypes.DWORD),
("dwServerEapTypeId", wintypes.DWORD),
("fMultilink", wintypes.BOOL),
("dwTerminateReason", wintypes.DWORD),
("dwServerTerminateReason", wintypes.DWORD),
("szReplyMessage", ctypes.c_byte * 1024),
("dwOptions", wintypes.DWORD),
("dwServerOptions", wintypes.DWORD),
]#[repr(C)]
pub struct RASPPPLCPA {
pub dwSize: u32,
pub fBundled: i32,
pub dwError: u32,
pub dwAuthenticationProtocol: u32,
pub dwAuthenticationData: u32,
pub dwEapTypeId: u32,
pub dwServerAuthenticationProtocol: u32,
pub dwServerAuthenticationData: u32,
pub dwServerEapTypeId: u32,
pub fMultilink: i32,
pub dwTerminateReason: u32,
pub dwServerTerminateReason: u32,
pub szReplyMessage: [i8; 1024],
pub dwOptions: u32,
pub dwServerOptions: u32,
}import "golang.org/x/sys/windows"
type RASPPPLCPA struct {
dwSize uint32
fBundled int32
dwError uint32
dwAuthenticationProtocol uint32
dwAuthenticationData uint32
dwEapTypeId uint32
dwServerAuthenticationProtocol uint32
dwServerAuthenticationData uint32
dwServerEapTypeId uint32
fMultilink int32
dwTerminateReason uint32
dwServerTerminateReason uint32
szReplyMessage [1024]int8
dwOptions uint32
dwServerOptions uint32
}type
RASPPPLCPA = record
dwSize: DWORD;
fBundled: BOOL;
dwError: DWORD;
dwAuthenticationProtocol: DWORD;
dwAuthenticationData: DWORD;
dwEapTypeId: DWORD;
dwServerAuthenticationProtocol: DWORD;
dwServerAuthenticationData: DWORD;
dwServerEapTypeId: DWORD;
fMultilink: BOOL;
dwTerminateReason: DWORD;
dwServerTerminateReason: DWORD;
szReplyMessage: array[0..1023] of Shortint;
dwOptions: DWORD;
dwServerOptions: DWORD;
end;const RASPPPLCPA = extern struct {
dwSize: u32,
fBundled: i32,
dwError: u32,
dwAuthenticationProtocol: u32,
dwAuthenticationData: u32,
dwEapTypeId: u32,
dwServerAuthenticationProtocol: u32,
dwServerAuthenticationData: u32,
dwServerEapTypeId: u32,
fMultilink: i32,
dwTerminateReason: u32,
dwServerTerminateReason: u32,
szReplyMessage: [1024]i8,
dwOptions: u32,
dwServerOptions: u32,
};type
RASPPPLCPA {.bycopy.} = object
dwSize: uint32
fBundled: int32
dwError: uint32
dwAuthenticationProtocol: uint32
dwAuthenticationData: uint32
dwEapTypeId: uint32
dwServerAuthenticationProtocol: uint32
dwServerAuthenticationData: uint32
dwServerEapTypeId: uint32
fMultilink: int32
dwTerminateReason: uint32
dwServerTerminateReason: uint32
szReplyMessage: array[1024, int8]
dwOptions: uint32
dwServerOptions: uint32struct RASPPPLCPA
{
uint dwSize;
int fBundled;
uint dwError;
uint dwAuthenticationProtocol;
uint dwAuthenticationData;
uint dwEapTypeId;
uint dwServerAuthenticationProtocol;
uint dwServerAuthenticationData;
uint dwServerEapTypeId;
int fMultilink;
uint dwTerminateReason;
uint dwServerTerminateReason;
byte[1024] szReplyMessage;
uint dwOptions;
uint dwServerOptions;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; RASPPPLCPA サイズ: 1080 バイト(x64)
dim st, 270 ; 4byte整数×270(構造体サイズ 1080 / 4 切り上げ)
; dwSize : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; fBundled : BOOL (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; dwError : DWORD (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; dwAuthenticationProtocol : DWORD (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; dwAuthenticationData : DWORD (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; dwEapTypeId : DWORD (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; dwServerAuthenticationProtocol : DWORD (+24, 4byte) st.6 = 値 / 値 = st.6 (lpoke/lpeek も可)
; dwServerAuthenticationData : DWORD (+28, 4byte) st.7 = 値 / 値 = st.7 (lpoke/lpeek も可)
; dwServerEapTypeId : DWORD (+32, 4byte) st.8 = 値 / 値 = st.8 (lpoke/lpeek も可)
; fMultilink : BOOL (+36, 4byte) st.9 = 値 / 値 = st.9 (lpoke/lpeek も可)
; dwTerminateReason : DWORD (+40, 4byte) st.10 = 値 / 値 = st.10 (lpoke/lpeek も可)
; dwServerTerminateReason : DWORD (+44, 4byte) st.11 = 値 / 値 = st.11 (lpoke/lpeek も可)
; szReplyMessage : CHAR (+48, 1024byte) varptr(st)+48 を基点に操作(1024byte:入れ子/配列)
; dwOptions : DWORD (+1072, 4byte) st.268 = 値 / 値 = st.268 (lpoke/lpeek も可)
; dwServerOptions : DWORD (+1076, 4byte) st.269 = 値 / 値 = st.269 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global RASPPPLCPA
#field int dwSize
#field bool fBundled
#field int dwError
#field int dwAuthenticationProtocol
#field int dwAuthenticationData
#field int dwEapTypeId
#field int dwServerAuthenticationProtocol
#field int dwServerAuthenticationData
#field int dwServerEapTypeId
#field bool fMultilink
#field int dwTerminateReason
#field int dwServerTerminateReason
#field byte szReplyMessage 1024
#field int dwOptions
#field int dwServerOptions
#endstruct
stdim st, RASPPPLCPA ; NSTRUCT 変数を確保
st->dwSize = 100
mes "dwSize=" + st->dwSize