ホーム › NetworkManagement.WiFi › DOT11_PEER_INFO
DOT11_PEER_INFO
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| MacAddress | BYTE | 6 | +0 | +0 | ピアのMACアドレス(6バイト)。 |
| usCapabilityInformation | WORD | 2 | +6 | +6 | ピアの能力情報フィールド(802.11 Capabilityビット)。 |
| AuthAlgo | DOT11_AUTH_ALGORITHM | 4 | +8 | +8 | ピアとの間で使用される認証アルゴリズム。 |
| UnicastCipherAlgo | DOT11_CIPHER_ALGORITHM | 4 | +12 | +12 | ユニキャスト通信に使用される暗号アルゴリズム。 |
| MulticastCipherAlgo | DOT11_CIPHER_ALGORITHM | 4 | +16 | +16 | マルチキャスト通信に使用される暗号アルゴリズム。 |
| bWpsEnabled | BOOLEAN | 1 | +20 | +20 | WPSが有効かを示す真偽値。 |
| usListenInterval | WORD | 2 | +22 | +22 | ピアのリッスンインターバル(ビーコン周期単位)。 |
| ucSupportedRates | BYTE | 255 | +24 | +24 | ピアがサポートするレートの配列。 |
| usAssociationID | WORD | 2 | +280 | +280 | アソシエーションID(AID)。 |
| AssociationState | DOT11_ASSOCIATION_STATE | 4 | +284 | +284 | ピアのアソシエーション状態。 |
| PowerMode | DOT11_POWER_MODE | 4 | +288 | +288 | ピアの電源管理モード。 |
| liAssociationUpTime | LONGLONG | 8 | +296 | +296 | アソシエーション確立からの経過時間。 |
| Statistics | DOT11_PEER_STATISTICS | 48 | +304 | +304 | ピアに関する送受信・復号の統計情報。 |
各言語での定義
#include <windows.h>
// DOT11_PEER_STATISTICS (x64 48 / x86 48 バイト)
typedef struct DOT11_PEER_STATISTICS {
ULONGLONG ullDecryptSuccessCount;
ULONGLONG ullDecryptFailureCount;
ULONGLONG ullTxPacketSuccessCount;
ULONGLONG ullTxPacketFailureCount;
ULONGLONG ullRxPacketSuccessCount;
ULONGLONG ullRxPacketFailureCount;
} DOT11_PEER_STATISTICS;
// DOT11_PEER_INFO (x64 352 / x86 352 バイト)
typedef struct DOT11_PEER_INFO {
BYTE MacAddress[6];
WORD usCapabilityInformation;
DOT11_AUTH_ALGORITHM AuthAlgo;
DOT11_CIPHER_ALGORITHM UnicastCipherAlgo;
DOT11_CIPHER_ALGORITHM MulticastCipherAlgo;
BOOLEAN bWpsEnabled;
WORD usListenInterval;
BYTE ucSupportedRates[255];
WORD usAssociationID;
DOT11_ASSOCIATION_STATE AssociationState;
DOT11_POWER_MODE PowerMode;
LONGLONG liAssociationUpTime;
DOT11_PEER_STATISTICS Statistics;
} DOT11_PEER_INFO;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DOT11_PEER_STATISTICS
{
public ulong ullDecryptSuccessCount;
public ulong ullDecryptFailureCount;
public ulong ullTxPacketSuccessCount;
public ulong ullTxPacketFailureCount;
public ulong ullRxPacketSuccessCount;
public ulong ullRxPacketFailureCount;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DOT11_PEER_INFO
{
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 6)] public byte[] MacAddress;
public ushort usCapabilityInformation;
public int AuthAlgo;
public int UnicastCipherAlgo;
public int MulticastCipherAlgo;
[MarshalAs(UnmanagedType.U1)] public bool bWpsEnabled;
public ushort usListenInterval;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 255)] public byte[] ucSupportedRates;
public ushort usAssociationID;
public int AssociationState;
public int PowerMode;
public long liAssociationUpTime;
public DOT11_PEER_STATISTICS Statistics;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DOT11_PEER_STATISTICS
Public ullDecryptSuccessCount As ULong
Public ullDecryptFailureCount As ULong
Public ullTxPacketSuccessCount As ULong
Public ullTxPacketFailureCount As ULong
Public ullRxPacketSuccessCount As ULong
Public ullRxPacketFailureCount As ULong
End Structure
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DOT11_PEER_INFO
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=6)> Public MacAddress() As Byte
Public usCapabilityInformation As UShort
Public AuthAlgo As Integer
Public UnicastCipherAlgo As Integer
Public MulticastCipherAlgo As Integer
<MarshalAs(UnmanagedType.U1)> Public bWpsEnabled As Boolean
Public usListenInterval As UShort
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=255)> Public ucSupportedRates() As Byte
Public usAssociationID As UShort
Public AssociationState As Integer
Public PowerMode As Integer
Public liAssociationUpTime As Long
Public Statistics As DOT11_PEER_STATISTICS
End Structureimport ctypes
from ctypes import wintypes
class DOT11_PEER_STATISTICS(ctypes.Structure):
_fields_ = [
("ullDecryptSuccessCount", ctypes.c_ulonglong),
("ullDecryptFailureCount", ctypes.c_ulonglong),
("ullTxPacketSuccessCount", ctypes.c_ulonglong),
("ullTxPacketFailureCount", ctypes.c_ulonglong),
("ullRxPacketSuccessCount", ctypes.c_ulonglong),
("ullRxPacketFailureCount", ctypes.c_ulonglong),
]
class DOT11_PEER_INFO(ctypes.Structure):
_fields_ = [
("MacAddress", ctypes.c_ubyte * 6),
("usCapabilityInformation", ctypes.c_ushort),
("AuthAlgo", ctypes.c_int),
("UnicastCipherAlgo", ctypes.c_int),
("MulticastCipherAlgo", ctypes.c_int),
("bWpsEnabled", ctypes.c_byte),
("usListenInterval", ctypes.c_ushort),
("ucSupportedRates", ctypes.c_ubyte * 255),
("usAssociationID", ctypes.c_ushort),
("AssociationState", ctypes.c_int),
("PowerMode", ctypes.c_int),
("liAssociationUpTime", ctypes.c_longlong),
("Statistics", DOT11_PEER_STATISTICS),
]#[repr(C)]
pub struct DOT11_PEER_STATISTICS {
pub ullDecryptSuccessCount: u64,
pub ullDecryptFailureCount: u64,
pub ullTxPacketSuccessCount: u64,
pub ullTxPacketFailureCount: u64,
pub ullRxPacketSuccessCount: u64,
pub ullRxPacketFailureCount: u64,
}
#[repr(C)]
pub struct DOT11_PEER_INFO {
pub MacAddress: [u8; 6],
pub usCapabilityInformation: u16,
pub AuthAlgo: i32,
pub UnicastCipherAlgo: i32,
pub MulticastCipherAlgo: i32,
pub bWpsEnabled: u8,
pub usListenInterval: u16,
pub ucSupportedRates: [u8; 255],
pub usAssociationID: u16,
pub AssociationState: i32,
pub PowerMode: i32,
pub liAssociationUpTime: i64,
pub Statistics: DOT11_PEER_STATISTICS,
}import "golang.org/x/sys/windows"
type DOT11_PEER_STATISTICS struct {
ullDecryptSuccessCount uint64
ullDecryptFailureCount uint64
ullTxPacketSuccessCount uint64
ullTxPacketFailureCount uint64
ullRxPacketSuccessCount uint64
ullRxPacketFailureCount uint64
}
type DOT11_PEER_INFO struct {
MacAddress [6]byte
usCapabilityInformation uint16
AuthAlgo int32
UnicastCipherAlgo int32
MulticastCipherAlgo int32
bWpsEnabled byte
usListenInterval uint16
ucSupportedRates [255]byte
usAssociationID uint16
AssociationState int32
PowerMode int32
liAssociationUpTime int64
Statistics DOT11_PEER_STATISTICS
}type
DOT11_PEER_STATISTICS = record
ullDecryptSuccessCount: UInt64;
ullDecryptFailureCount: UInt64;
ullTxPacketSuccessCount: UInt64;
ullTxPacketFailureCount: UInt64;
ullRxPacketSuccessCount: UInt64;
ullRxPacketFailureCount: UInt64;
end;
DOT11_PEER_INFO = record
MacAddress: array[0..5] of Byte;
usCapabilityInformation: Word;
AuthAlgo: Integer;
UnicastCipherAlgo: Integer;
MulticastCipherAlgo: Integer;
bWpsEnabled: ByteBool;
usListenInterval: Word;
ucSupportedRates: array[0..254] of Byte;
usAssociationID: Word;
AssociationState: Integer;
PowerMode: Integer;
liAssociationUpTime: Int64;
Statistics: DOT11_PEER_STATISTICS;
end;const DOT11_PEER_STATISTICS = extern struct {
ullDecryptSuccessCount: u64,
ullDecryptFailureCount: u64,
ullTxPacketSuccessCount: u64,
ullTxPacketFailureCount: u64,
ullRxPacketSuccessCount: u64,
ullRxPacketFailureCount: u64,
};
const DOT11_PEER_INFO = extern struct {
MacAddress: [6]u8,
usCapabilityInformation: u16,
AuthAlgo: i32,
UnicastCipherAlgo: i32,
MulticastCipherAlgo: i32,
bWpsEnabled: u8,
usListenInterval: u16,
ucSupportedRates: [255]u8,
usAssociationID: u16,
AssociationState: i32,
PowerMode: i32,
liAssociationUpTime: i64,
Statistics: DOT11_PEER_STATISTICS,
};type
DOT11_PEER_STATISTICS {.bycopy.} = object
ullDecryptSuccessCount: uint64
ullDecryptFailureCount: uint64
ullTxPacketSuccessCount: uint64
ullTxPacketFailureCount: uint64
ullRxPacketSuccessCount: uint64
ullRxPacketFailureCount: uint64
DOT11_PEER_INFO {.bycopy.} = object
MacAddress: array[6, uint8]
usCapabilityInformation: uint16
AuthAlgo: int32
UnicastCipherAlgo: int32
MulticastCipherAlgo: int32
bWpsEnabled: uint8
usListenInterval: uint16
ucSupportedRates: array[255, uint8]
usAssociationID: uint16
AssociationState: int32
PowerMode: int32
liAssociationUpTime: int64
Statistics: DOT11_PEER_STATISTICSstruct DOT11_PEER_STATISTICS
{
ulong ullDecryptSuccessCount;
ulong ullDecryptFailureCount;
ulong ullTxPacketSuccessCount;
ulong ullTxPacketFailureCount;
ulong ullRxPacketSuccessCount;
ulong ullRxPacketFailureCount;
}
struct DOT11_PEER_INFO
{
ubyte[6] MacAddress;
ushort usCapabilityInformation;
int AuthAlgo;
int UnicastCipherAlgo;
int MulticastCipherAlgo;
ubyte bWpsEnabled;
ushort usListenInterval;
ubyte[255] ucSupportedRates;
ushort usAssociationID;
int AssociationState;
int PowerMode;
long liAssociationUpTime;
DOT11_PEER_STATISTICS Statistics;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; DOT11_PEER_INFO サイズ: 352 バイト(x64)
dim st, 88 ; 4byte整数×88(構造体サイズ 352 / 4 切り上げ)
; MacAddress : BYTE (+0, 6byte) varptr(st)+0 を基点に操作(6byte:入れ子/配列)
; usCapabilityInformation : WORD (+6, 2byte) wpoke st,6,値 / 値 = wpeek(st,6)
; AuthAlgo : DOT11_AUTH_ALGORITHM (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; UnicastCipherAlgo : DOT11_CIPHER_ALGORITHM (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; MulticastCipherAlgo : DOT11_CIPHER_ALGORITHM (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; bWpsEnabled : BOOLEAN (+20, 1byte) poke st,20,値 / 値 = peek(st,20)
; usListenInterval : WORD (+22, 2byte) wpoke st,22,値 / 値 = wpeek(st,22)
; ucSupportedRates : BYTE (+24, 255byte) varptr(st)+24 を基点に操作(255byte:入れ子/配列)
; usAssociationID : WORD (+280, 2byte) wpoke st,280,値 / 値 = wpeek(st,280)
; AssociationState : DOT11_ASSOCIATION_STATE (+284, 4byte) st.71 = 値 / 値 = st.71 (lpoke/lpeek も可)
; PowerMode : DOT11_POWER_MODE (+288, 4byte) st.72 = 値 / 値 = st.72 (lpoke/lpeek も可)
; liAssociationUpTime : LONGLONG (+296, 8byte) qpoke st,296,値 / qpeek(st,296) ※IronHSPのみ。3.7/3.8は lpoke st,296,下位 : lpoke st,300,上位
; Statistics : DOT11_PEER_STATISTICS (+304, 48byte) varptr(st)+304 を基点に操作(48byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global DOT11_PEER_STATISTICS
#field int64 ullDecryptSuccessCount
#field int64 ullDecryptFailureCount
#field int64 ullTxPacketSuccessCount
#field int64 ullTxPacketFailureCount
#field int64 ullRxPacketSuccessCount
#field int64 ullRxPacketFailureCount
#endstruct
#defstruct global DOT11_PEER_INFO
#field byte MacAddress 6
#field short usCapabilityInformation
#field int AuthAlgo
#field int UnicastCipherAlgo
#field int MulticastCipherAlgo
#field bool1 bWpsEnabled
#field short usListenInterval
#field byte ucSupportedRates 255
#field short usAssociationID
#field int AssociationState
#field int PowerMode
#field int64 liAssociationUpTime
#field DOT11_PEER_STATISTICS Statistics
#endstruct
stdim st, DOT11_PEER_INFO ; NSTRUCT 変数を確保
st->usCapabilityInformation = 100
mes "usCapabilityInformation=" + st->usCapabilityInformation