ホーム › NetworkManagement.Rras › PPP_IPV6_CP_INFO
PPP_IPV6_CP_INFO
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| dwVersion | DWORD | 4 | +0 | +0 | 構造体のバージョン番号。 |
| dwSize | DWORD | 4 | +4 | +4 | この構造体のバイト単位のサイズ。 |
| dwError | DWORD | 4 | +8 | +8 | IPv6制御プロトコルのエラーコード。0なら正常。 |
| bInterfaceIdentifier | BYTE | 8 | +12 | +12 | ローカルのIPv6インターフェイス識別子(8バイト)。 |
| bRemoteInterfaceIdentifier | BYTE | 8 | +20 | +20 | リモートのIPv6インターフェイス識別子(8バイト)。 |
| dwOptions | DWORD | 4 | +28 | +28 | ローカルのIPv6CPオプションフラグ。 |
| dwRemoteOptions | DWORD | 4 | +32 | +32 | リモートのIPv6CPオプションフラグ。 |
| bPrefix | BYTE | 8 | +36 | +36 | 割り当てられたIPv6プレフィックス(8バイト)。 |
| dwPrefixLength | DWORD | 4 | +44 | +44 | IPv6プレフィックスの長さ(ビット数)。 |
各言語での定義
#include <windows.h>
// PPP_IPV6_CP_INFO (x64 48 / x86 48 バイト)
typedef struct PPP_IPV6_CP_INFO {
DWORD dwVersion;
DWORD dwSize;
DWORD dwError;
BYTE bInterfaceIdentifier[8];
BYTE bRemoteInterfaceIdentifier[8];
DWORD dwOptions;
DWORD dwRemoteOptions;
BYTE bPrefix[8];
DWORD dwPrefixLength;
} PPP_IPV6_CP_INFO;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct PPP_IPV6_CP_INFO
{
public uint dwVersion;
public uint dwSize;
public uint dwError;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)] public byte[] bInterfaceIdentifier;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)] public byte[] bRemoteInterfaceIdentifier;
public uint dwOptions;
public uint dwRemoteOptions;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)] public byte[] bPrefix;
public uint dwPrefixLength;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure PPP_IPV6_CP_INFO
Public dwVersion As UInteger
Public dwSize As UInteger
Public dwError As UInteger
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=8)> Public bInterfaceIdentifier() As Byte
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=8)> Public bRemoteInterfaceIdentifier() As Byte
Public dwOptions As UInteger
Public dwRemoteOptions As UInteger
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=8)> Public bPrefix() As Byte
Public dwPrefixLength As UInteger
End Structureimport ctypes
from ctypes import wintypes
class PPP_IPV6_CP_INFO(ctypes.Structure):
_fields_ = [
("dwVersion", wintypes.DWORD),
("dwSize", wintypes.DWORD),
("dwError", wintypes.DWORD),
("bInterfaceIdentifier", ctypes.c_ubyte * 8),
("bRemoteInterfaceIdentifier", ctypes.c_ubyte * 8),
("dwOptions", wintypes.DWORD),
("dwRemoteOptions", wintypes.DWORD),
("bPrefix", ctypes.c_ubyte * 8),
("dwPrefixLength", wintypes.DWORD),
]#[repr(C)]
pub struct PPP_IPV6_CP_INFO {
pub dwVersion: u32,
pub dwSize: u32,
pub dwError: u32,
pub bInterfaceIdentifier: [u8; 8],
pub bRemoteInterfaceIdentifier: [u8; 8],
pub dwOptions: u32,
pub dwRemoteOptions: u32,
pub bPrefix: [u8; 8],
pub dwPrefixLength: u32,
}import "golang.org/x/sys/windows"
type PPP_IPV6_CP_INFO struct {
dwVersion uint32
dwSize uint32
dwError uint32
bInterfaceIdentifier [8]byte
bRemoteInterfaceIdentifier [8]byte
dwOptions uint32
dwRemoteOptions uint32
bPrefix [8]byte
dwPrefixLength uint32
}type
PPP_IPV6_CP_INFO = record
dwVersion: DWORD;
dwSize: DWORD;
dwError: DWORD;
bInterfaceIdentifier: array[0..7] of Byte;
bRemoteInterfaceIdentifier: array[0..7] of Byte;
dwOptions: DWORD;
dwRemoteOptions: DWORD;
bPrefix: array[0..7] of Byte;
dwPrefixLength: DWORD;
end;const PPP_IPV6_CP_INFO = extern struct {
dwVersion: u32,
dwSize: u32,
dwError: u32,
bInterfaceIdentifier: [8]u8,
bRemoteInterfaceIdentifier: [8]u8,
dwOptions: u32,
dwRemoteOptions: u32,
bPrefix: [8]u8,
dwPrefixLength: u32,
};type
PPP_IPV6_CP_INFO {.bycopy.} = object
dwVersion: uint32
dwSize: uint32
dwError: uint32
bInterfaceIdentifier: array[8, uint8]
bRemoteInterfaceIdentifier: array[8, uint8]
dwOptions: uint32
dwRemoteOptions: uint32
bPrefix: array[8, uint8]
dwPrefixLength: uint32struct PPP_IPV6_CP_INFO
{
uint dwVersion;
uint dwSize;
uint dwError;
ubyte[8] bInterfaceIdentifier;
ubyte[8] bRemoteInterfaceIdentifier;
uint dwOptions;
uint dwRemoteOptions;
ubyte[8] bPrefix;
uint dwPrefixLength;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; PPP_IPV6_CP_INFO サイズ: 48 バイト(x64)
dim st, 12 ; 4byte整数×12(構造体サイズ 48 / 4 切り上げ)
; dwVersion : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; dwSize : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; dwError : DWORD (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; bInterfaceIdentifier : BYTE (+12, 8byte) varptr(st)+12 を基点に操作(8byte:入れ子/配列)
; bRemoteInterfaceIdentifier : BYTE (+20, 8byte) varptr(st)+20 を基点に操作(8byte:入れ子/配列)
; dwOptions : DWORD (+28, 4byte) st.7 = 値 / 値 = st.7 (lpoke/lpeek も可)
; dwRemoteOptions : DWORD (+32, 4byte) st.8 = 値 / 値 = st.8 (lpoke/lpeek も可)
; bPrefix : BYTE (+36, 8byte) varptr(st)+36 を基点に操作(8byte:入れ子/配列)
; dwPrefixLength : DWORD (+44, 4byte) st.11 = 値 / 値 = st.11 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global PPP_IPV6_CP_INFO
#field int dwVersion
#field int dwSize
#field int dwError
#field byte bInterfaceIdentifier 8
#field byte bRemoteInterfaceIdentifier 8
#field int dwOptions
#field int dwRemoteOptions
#field byte bPrefix 8
#field int dwPrefixLength
#endstruct
stdim st, PPP_IPV6_CP_INFO ; NSTRUCT 変数を確保
st->dwVersion = 100
mes "dwVersion=" + st->dwVersion