ホーム › NetworkManagement.WiFi › DOT11_BSS_DESCRIPTION
DOT11_BSS_DESCRIPTION
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| uReserved | DWORD | 4 | +0 | +0 | 予約フィールド。ゼロを設定する。 |
| dot11BSSID | BYTE | 6 | +4 | +4 | 対象 BSS の BSSID(MACアドレス)。 |
| dot11BSSType | DOT11_BSS_TYPE | 4 | +12 | +12 | BSS の種別(インフラ/アドホック)を示す。 |
| usBeaconPeriod | WORD | 2 | +16 | +16 | ビーコン送信間隔をTU単位で表す。 |
| ullTimestamp | ULONGLONG | 8 | +24 | +24 | BSS のタイムスタンプ値を表す。 |
| usCapabilityInformation | WORD | 2 | +32 | +32 | BSS の能力情報フィールドを表す。 |
| uBufferLength | DWORD | 4 | +36 | +36 | ucBuffer のバイト長を表す。 |
| ucBuffer | BYTE | 1 | +40 | +40 | 情報要素などを格納する可変長バッファ。 |
各言語での定義
#include <windows.h>
// DOT11_BSS_DESCRIPTION (x64 48 / x86 48 バイト)
typedef struct DOT11_BSS_DESCRIPTION {
DWORD uReserved;
BYTE dot11BSSID[6];
DOT11_BSS_TYPE dot11BSSType;
WORD usBeaconPeriod;
ULONGLONG ullTimestamp;
WORD usCapabilityInformation;
DWORD uBufferLength;
BYTE ucBuffer[1];
} DOT11_BSS_DESCRIPTION;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DOT11_BSS_DESCRIPTION
{
public uint uReserved;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 6)] public byte[] dot11BSSID;
public int dot11BSSType;
public ushort usBeaconPeriod;
public ulong ullTimestamp;
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_DESCRIPTION
Public uReserved As UInteger
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=6)> Public dot11BSSID() As Byte
Public dot11BSSType As Integer
Public usBeaconPeriod As UShort
Public ullTimestamp 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_DESCRIPTION(ctypes.Structure):
_fields_ = [
("uReserved", wintypes.DWORD),
("dot11BSSID", ctypes.c_ubyte * 6),
("dot11BSSType", ctypes.c_int),
("usBeaconPeriod", ctypes.c_ushort),
("ullTimestamp", ctypes.c_ulonglong),
("usCapabilityInformation", ctypes.c_ushort),
("uBufferLength", wintypes.DWORD),
("ucBuffer", ctypes.c_ubyte * 1),
]#[repr(C)]
pub struct DOT11_BSS_DESCRIPTION {
pub uReserved: u32,
pub dot11BSSID: [u8; 6],
pub dot11BSSType: i32,
pub usBeaconPeriod: u16,
pub ullTimestamp: u64,
pub usCapabilityInformation: u16,
pub uBufferLength: u32,
pub ucBuffer: [u8; 1],
}import "golang.org/x/sys/windows"
type DOT11_BSS_DESCRIPTION struct {
uReserved uint32
dot11BSSID [6]byte
dot11BSSType int32
usBeaconPeriod uint16
ullTimestamp uint64
usCapabilityInformation uint16
uBufferLength uint32
ucBuffer [1]byte
}type
DOT11_BSS_DESCRIPTION = record
uReserved: DWORD;
dot11BSSID: array[0..5] of Byte;
dot11BSSType: Integer;
usBeaconPeriod: Word;
ullTimestamp: UInt64;
usCapabilityInformation: Word;
uBufferLength: DWORD;
ucBuffer: array[0..0] of Byte;
end;const DOT11_BSS_DESCRIPTION = extern struct {
uReserved: u32,
dot11BSSID: [6]u8,
dot11BSSType: i32,
usBeaconPeriod: u16,
ullTimestamp: u64,
usCapabilityInformation: u16,
uBufferLength: u32,
ucBuffer: [1]u8,
};type
DOT11_BSS_DESCRIPTION {.bycopy.} = object
uReserved: uint32
dot11BSSID: array[6, uint8]
dot11BSSType: int32
usBeaconPeriod: uint16
ullTimestamp: uint64
usCapabilityInformation: uint16
uBufferLength: uint32
ucBuffer: array[1, uint8]struct DOT11_BSS_DESCRIPTION
{
uint uReserved;
ubyte[6] dot11BSSID;
int dot11BSSType;
ushort usBeaconPeriod;
ulong ullTimestamp;
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_DESCRIPTION サイズ: 48 バイト(x64)
dim st, 12 ; 4byte整数×12(構造体サイズ 48 / 4 切り上げ)
; uReserved : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; dot11BSSID : BYTE (+4, 6byte) varptr(st)+4 を基点に操作(6byte:入れ子/配列)
; dot11BSSType : DOT11_BSS_TYPE (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; usBeaconPeriod : WORD (+16, 2byte) wpoke st,16,値 / 値 = wpeek(st,16)
; ullTimestamp : ULONGLONG (+24, 8byte) qpoke st,24,値 / qpeek(st,24) ※IronHSPのみ。3.7/3.8は lpoke st,24,下位 : lpoke st,28,上位
; usCapabilityInformation : WORD (+32, 2byte) wpoke st,32,値 / 値 = wpeek(st,32)
; uBufferLength : DWORD (+36, 4byte) st.9 = 値 / 値 = st.9 (lpoke/lpeek も可)
; ucBuffer : BYTE (+40, 1byte) varptr(st)+40 を基点に操作(1byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global DOT11_BSS_DESCRIPTION
#field int uReserved
#field byte dot11BSSID 6
#field int dot11BSSType
#field short usBeaconPeriod
#field int64 ullTimestamp
#field short usCapabilityInformation
#field int uBufferLength
#field byte ucBuffer 1
#endstruct
stdim st, DOT11_BSS_DESCRIPTION ; NSTRUCT 変数を確保
st->uReserved = 100
mes "uReserved=" + st->uReserved