ホーム › Networking.WinSock › IPX_ADDRESS_DATA
IPX_ADDRESS_DATA
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| adapternum | INT | 4 | +0 | +0 | 対象のIPXアダプタ番号である。 |
| netnum | BYTE | 4 | +4 | +4 | IPXネットワーク番号(4バイト)である。 |
| nodenum | BYTE | 6 | +8 | +8 | IPXノード番号(6バイトのMAC相当)である。 |
| wan | BOOLEAN | 1 | +14 | +14 | WAN回線経由かどうかを示す真偽値である。 |
| status | BOOLEAN | 1 | +15 | +15 | 回線が接続状態かどうかを示す真偽値である。 |
| maxpkt | INT | 4 | +16 | +16 | 送信可能な最大パケットサイズである。 |
| linkspeed | DWORD | 4 | +20 | +20 | リンク速度を100バイト/秒単位で示す。 |
各言語での定義
#include <windows.h>
// IPX_ADDRESS_DATA (x64 24 / x86 24 バイト)
typedef struct IPX_ADDRESS_DATA {
INT adapternum;
BYTE netnum[4];
BYTE nodenum[6];
BOOLEAN wan;
BOOLEAN status;
INT maxpkt;
DWORD linkspeed;
} IPX_ADDRESS_DATA;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct IPX_ADDRESS_DATA
{
public int adapternum;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)] public byte[] netnum;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 6)] public byte[] nodenum;
[MarshalAs(UnmanagedType.U1)] public bool wan;
[MarshalAs(UnmanagedType.U1)] public bool status;
public int maxpkt;
public uint linkspeed;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure IPX_ADDRESS_DATA
Public adapternum As Integer
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=4)> Public netnum() As Byte
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=6)> Public nodenum() As Byte
<MarshalAs(UnmanagedType.U1)> Public wan As Boolean
<MarshalAs(UnmanagedType.U1)> Public status As Boolean
Public maxpkt As Integer
Public linkspeed As UInteger
End Structureimport ctypes
from ctypes import wintypes
class IPX_ADDRESS_DATA(ctypes.Structure):
_fields_ = [
("adapternum", ctypes.c_int),
("netnum", ctypes.c_ubyte * 4),
("nodenum", ctypes.c_ubyte * 6),
("wan", ctypes.c_byte),
("status", ctypes.c_byte),
("maxpkt", ctypes.c_int),
("linkspeed", wintypes.DWORD),
]#[repr(C)]
pub struct IPX_ADDRESS_DATA {
pub adapternum: i32,
pub netnum: [u8; 4],
pub nodenum: [u8; 6],
pub wan: u8,
pub status: u8,
pub maxpkt: i32,
pub linkspeed: u32,
}import "golang.org/x/sys/windows"
type IPX_ADDRESS_DATA struct {
adapternum int32
netnum [4]byte
nodenum [6]byte
wan byte
status byte
maxpkt int32
linkspeed uint32
}type
IPX_ADDRESS_DATA = record
adapternum: Integer;
netnum: array[0..3] of Byte;
nodenum: array[0..5] of Byte;
wan: ByteBool;
status: ByteBool;
maxpkt: Integer;
linkspeed: DWORD;
end;const IPX_ADDRESS_DATA = extern struct {
adapternum: i32,
netnum: [4]u8,
nodenum: [6]u8,
wan: u8,
status: u8,
maxpkt: i32,
linkspeed: u32,
};type
IPX_ADDRESS_DATA {.bycopy.} = object
adapternum: int32
netnum: array[4, uint8]
nodenum: array[6, uint8]
wan: uint8
status: uint8
maxpkt: int32
linkspeed: uint32struct IPX_ADDRESS_DATA
{
int adapternum;
ubyte[4] netnum;
ubyte[6] nodenum;
ubyte wan;
ubyte status;
int maxpkt;
uint linkspeed;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; IPX_ADDRESS_DATA サイズ: 24 バイト(x64)
dim st, 6 ; 4byte整数×6(構造体サイズ 24 / 4 切り上げ)
; adapternum : INT (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; netnum : BYTE (+4, 4byte) varptr(st)+4 を基点に操作(4byte:入れ子/配列)
; nodenum : BYTE (+8, 6byte) varptr(st)+8 を基点に操作(6byte:入れ子/配列)
; wan : BOOLEAN (+14, 1byte) poke st,14,値 / 値 = peek(st,14)
; status : BOOLEAN (+15, 1byte) poke st,15,値 / 値 = peek(st,15)
; maxpkt : INT (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; linkspeed : DWORD (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global IPX_ADDRESS_DATA
#field int adapternum
#field byte netnum 4
#field byte nodenum 6
#field bool1 wan
#field bool1 status
#field int maxpkt
#field int linkspeed
#endstruct
stdim st, IPX_ADDRESS_DATA ; NSTRUCT 変数を確保
st->adapternum = 100
mes "adapternum=" + st->adapternum