ホーム › NetworkManagement.WiFi › DOT11_BSS_ENTRY
DOT11_BSS_ENTRY
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| uPhyId | DWORD | 4 | +0 | +0 | この BSS を検出した PHY の識別子を表す。 |
| PhySpecificInfo | DOT11_BSS_ENTRY_PHY_SPECIFIC_INFO | 12 | +4 | +4 | PHY 種別固有の情報を保持する共用体。 |
| dot11BSSID | BYTE | 6 | +16 | +16 | 対象 BSS の BSSID(MACアドレス)。 |
| dot11BSSType | DOT11_BSS_TYPE | 4 | +24 | +24 | BSS の種別(インフラ/アドホック)を示す。 |
| lRSSI | INT | 4 | +28 | +28 | 受信信号強度 RSSI を表す(dBm)。 |
| uLinkQuality | DWORD | 4 | +32 | +32 | リンク品質を0~100で表す。 |
| bInRegDomain | BOOLEAN | 1 | +36 | +36 | 規制ドメイン内のチャネルか示すフラグ。 |
| usBeaconPeriod | WORD | 2 | +38 | +38 | ビーコン送信間隔をTU単位で表す。 |
| ullTimestamp | ULONGLONG | 8 | +40 | +40 | BSS のタイムスタンプ値を表す。 |
| ullHostTimestamp | ULONGLONG | 8 | +48 | +48 | ビーコン受信時のホスト側タイムスタンプを表す。 |
| usCapabilityInformation | WORD | 2 | +56 | +56 | BSS の能力情報フィールドを表す。 |
| uBufferLength | DWORD | 4 | +60 | +60 | ucBuffer のバイト長を表す。 |
| ucBuffer | BYTE | 1 | +64 | +64 | ビーコン/プローブ応答の情報要素を格納する可変長バッファ。 |
各言語での定義
#include <windows.h>
// DOT11_BSS_ENTRY_PHY_SPECIFIC_INFO (x64 12 / x86 12 バイト)
typedef struct DOT11_BSS_ENTRY_PHY_SPECIFIC_INFO {
DWORD uChCenterFrequency;
_FHSS_e__Struct FHSS;
} DOT11_BSS_ENTRY_PHY_SPECIFIC_INFO;
// DOT11_BSS_ENTRY (x64 72 / x86 72 バイト)
typedef struct DOT11_BSS_ENTRY {
DWORD uPhyId;
DOT11_BSS_ENTRY_PHY_SPECIFIC_INFO PhySpecificInfo;
BYTE dot11BSSID[6];
DOT11_BSS_TYPE dot11BSSType;
INT lRSSI;
DWORD uLinkQuality;
BOOLEAN bInRegDomain;
WORD usBeaconPeriod;
ULONGLONG ullTimestamp;
ULONGLONG ullHostTimestamp;
WORD usCapabilityInformation;
DWORD uBufferLength;
BYTE ucBuffer[1];
} DOT11_BSS_ENTRY;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DOT11_BSS_ENTRY_PHY_SPECIFIC_INFO
{
public uint uChCenterFrequency;
public _FHSS_e__Struct FHSS;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DOT11_BSS_ENTRY
{
public uint uPhyId;
public DOT11_BSS_ENTRY_PHY_SPECIFIC_INFO PhySpecificInfo;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 6)] public byte[] dot11BSSID;
public int dot11BSSType;
public int lRSSI;
public uint uLinkQuality;
[MarshalAs(UnmanagedType.U1)] public bool bInRegDomain;
public ushort usBeaconPeriod;
public ulong ullTimestamp;
public ulong ullHostTimestamp;
public ushort usCapabilityInformation;
public uint uBufferLength;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 1)] public byte[] ucBuffer;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DOT11_BSS_ENTRY_PHY_SPECIFIC_INFO
Public uChCenterFrequency As UInteger
Public FHSS As _FHSS_e__Struct
End Structure
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DOT11_BSS_ENTRY
Public uPhyId As UInteger
Public PhySpecificInfo As DOT11_BSS_ENTRY_PHY_SPECIFIC_INFO
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=6)> Public dot11BSSID() As Byte
Public dot11BSSType As Integer
Public lRSSI As Integer
Public uLinkQuality As UInteger
<MarshalAs(UnmanagedType.U1)> Public bInRegDomain As Boolean
Public usBeaconPeriod As UShort
Public ullTimestamp As ULong
Public ullHostTimestamp As ULong
Public usCapabilityInformation As UShort
Public uBufferLength As UInteger
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=1)> Public ucBuffer() As Byte
End Structureimport ctypes
from ctypes import wintypes
class DOT11_BSS_ENTRY_PHY_SPECIFIC_INFO(ctypes.Structure):
_fields_ = [
("uChCenterFrequency", wintypes.DWORD),
("FHSS", _FHSS_e__Struct),
]
class DOT11_BSS_ENTRY(ctypes.Structure):
_fields_ = [
("uPhyId", wintypes.DWORD),
("PhySpecificInfo", DOT11_BSS_ENTRY_PHY_SPECIFIC_INFO),
("dot11BSSID", ctypes.c_ubyte * 6),
("dot11BSSType", ctypes.c_int),
("lRSSI", ctypes.c_int),
("uLinkQuality", wintypes.DWORD),
("bInRegDomain", ctypes.c_byte),
("usBeaconPeriod", ctypes.c_ushort),
("ullTimestamp", ctypes.c_ulonglong),
("ullHostTimestamp", ctypes.c_ulonglong),
("usCapabilityInformation", ctypes.c_ushort),
("uBufferLength", wintypes.DWORD),
("ucBuffer", ctypes.c_ubyte * 1),
]#[repr(C)]
pub struct DOT11_BSS_ENTRY_PHY_SPECIFIC_INFO {
pub uChCenterFrequency: u32,
pub FHSS: _FHSS_e__Struct,
}
#[repr(C)]
pub struct DOT11_BSS_ENTRY {
pub uPhyId: u32,
pub PhySpecificInfo: DOT11_BSS_ENTRY_PHY_SPECIFIC_INFO,
pub dot11BSSID: [u8; 6],
pub dot11BSSType: i32,
pub lRSSI: i32,
pub uLinkQuality: u32,
pub bInRegDomain: u8,
pub usBeaconPeriod: u16,
pub ullTimestamp: u64,
pub ullHostTimestamp: u64,
pub usCapabilityInformation: u16,
pub uBufferLength: u32,
pub ucBuffer: [u8; 1],
}import "golang.org/x/sys/windows"
type DOT11_BSS_ENTRY_PHY_SPECIFIC_INFO struct {
uChCenterFrequency uint32
FHSS _FHSS_e__Struct
}
type DOT11_BSS_ENTRY struct {
uPhyId uint32
PhySpecificInfo DOT11_BSS_ENTRY_PHY_SPECIFIC_INFO
dot11BSSID [6]byte
dot11BSSType int32
lRSSI int32
uLinkQuality uint32
bInRegDomain byte
usBeaconPeriod uint16
ullTimestamp uint64
ullHostTimestamp uint64
usCapabilityInformation uint16
uBufferLength uint32
ucBuffer [1]byte
}type
DOT11_BSS_ENTRY_PHY_SPECIFIC_INFO = record
uChCenterFrequency: DWORD;
FHSS: _FHSS_e__Struct;
end;
DOT11_BSS_ENTRY = record
uPhyId: DWORD;
PhySpecificInfo: DOT11_BSS_ENTRY_PHY_SPECIFIC_INFO;
dot11BSSID: array[0..5] of Byte;
dot11BSSType: Integer;
lRSSI: Integer;
uLinkQuality: DWORD;
bInRegDomain: ByteBool;
usBeaconPeriod: Word;
ullTimestamp: UInt64;
ullHostTimestamp: UInt64;
usCapabilityInformation: Word;
uBufferLength: DWORD;
ucBuffer: array[0..0] of Byte;
end;const DOT11_BSS_ENTRY_PHY_SPECIFIC_INFO = extern struct {
uChCenterFrequency: u32,
FHSS: _FHSS_e__Struct,
};
const DOT11_BSS_ENTRY = extern struct {
uPhyId: u32,
PhySpecificInfo: DOT11_BSS_ENTRY_PHY_SPECIFIC_INFO,
dot11BSSID: [6]u8,
dot11BSSType: i32,
lRSSI: i32,
uLinkQuality: u32,
bInRegDomain: u8,
usBeaconPeriod: u16,
ullTimestamp: u64,
ullHostTimestamp: u64,
usCapabilityInformation: u16,
uBufferLength: u32,
ucBuffer: [1]u8,
};type
DOT11_BSS_ENTRY_PHY_SPECIFIC_INFO {.bycopy.} = object
uChCenterFrequency: uint32
FHSS: _FHSS_e__Struct
DOT11_BSS_ENTRY {.bycopy.} = object
uPhyId: uint32
PhySpecificInfo: DOT11_BSS_ENTRY_PHY_SPECIFIC_INFO
dot11BSSID: array[6, uint8]
dot11BSSType: int32
lRSSI: int32
uLinkQuality: uint32
bInRegDomain: uint8
usBeaconPeriod: uint16
ullTimestamp: uint64
ullHostTimestamp: uint64
usCapabilityInformation: uint16
uBufferLength: uint32
ucBuffer: array[1, uint8]struct DOT11_BSS_ENTRY_PHY_SPECIFIC_INFO
{
uint uChCenterFrequency;
_FHSS_e__Struct FHSS;
}
struct DOT11_BSS_ENTRY
{
uint uPhyId;
DOT11_BSS_ENTRY_PHY_SPECIFIC_INFO PhySpecificInfo;
ubyte[6] dot11BSSID;
int dot11BSSType;
int lRSSI;
uint uLinkQuality;
ubyte bInRegDomain;
ushort usBeaconPeriod;
ulong ullTimestamp;
ulong ullHostTimestamp;
ushort usCapabilityInformation;
uint uBufferLength;
ubyte[1] ucBuffer;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; DOT11_BSS_ENTRY サイズ: 72 バイト(x64)
dim st, 18 ; 4byte整数×18(構造体サイズ 72 / 4 切り上げ)
; uPhyId : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; PhySpecificInfo : DOT11_BSS_ENTRY_PHY_SPECIFIC_INFO (+4, 12byte) varptr(st)+4 を基点に操作(12byte:入れ子/配列)
; dot11BSSID : BYTE (+16, 6byte) varptr(st)+16 を基点に操作(6byte:入れ子/配列)
; dot11BSSType : DOT11_BSS_TYPE (+24, 4byte) st.6 = 値 / 値 = st.6 (lpoke/lpeek も可)
; lRSSI : INT (+28, 4byte) st.7 = 値 / 値 = st.7 (lpoke/lpeek も可)
; uLinkQuality : DWORD (+32, 4byte) st.8 = 値 / 値 = st.8 (lpoke/lpeek も可)
; bInRegDomain : BOOLEAN (+36, 1byte) poke st,36,値 / 値 = peek(st,36)
; usBeaconPeriod : WORD (+38, 2byte) wpoke st,38,値 / 値 = wpeek(st,38)
; ullTimestamp : ULONGLONG (+40, 8byte) qpoke st,40,値 / qpeek(st,40) ※IronHSPのみ。3.7/3.8は lpoke st,40,下位 : lpoke st,44,上位
; ullHostTimestamp : ULONGLONG (+48, 8byte) qpoke st,48,値 / qpeek(st,48) ※IronHSPのみ。3.7/3.8は lpoke st,48,下位 : lpoke st,52,上位
; usCapabilityInformation : WORD (+56, 2byte) wpoke st,56,値 / 値 = wpeek(st,56)
; uBufferLength : DWORD (+60, 4byte) st.15 = 値 / 値 = st.15 (lpoke/lpeek も可)
; ucBuffer : BYTE (+64, 1byte) varptr(st)+64 を基点に操作(1byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global DOT11_BSS_ENTRY
#field int uPhyId
#field byte PhySpecificInfo 12
#field byte dot11BSSID 6
#field int dot11BSSType
#field int lRSSI
#field int uLinkQuality
#field bool1 bInRegDomain
#field short usBeaconPeriod
#field int64 ullTimestamp
#field int64 ullHostTimestamp
#field short usCapabilityInformation
#field int uBufferLength
#field byte ucBuffer 1
#endstruct
stdim st, DOT11_BSS_ENTRY ; NSTRUCT 変数を確保
st->uPhyId = 100
mes "uPhyId=" + st->uPhyId
; ※union フィールドは byte 列で確保(NSTRUCT は union 非対応)。必要に応じ手動でアクセス。