ホーム › NetworkManagement.Ndis › NDIS_WLAN_BSSID_EX
NDIS_WLAN_BSSID_EX
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| Length | DWORD | 4 | +0 | +0 | 本構造体の長さ(バイト)。可変IE長を含む。 |
| MacAddress | BYTE | 6 | +4 | +4 | アクセスポイントのMACアドレス(BSSID、6バイト)。 |
| Reserved | BYTE | 2 | +10 | +10 | 予約フィールド(2バイト)。アライメント用。 |
| Ssid | NDIS_802_11_SSID | 36 | +12 | +12 | 対象ネットワークのSSID。 |
| Privacy | DWORD | 4 | +48 | +48 | 暗号化が必要か否かを示す。0で不要。 |
| Rssi | INT | 4 | +52 | +52 | 受信信号強度(dBm)。値が大きいほど強い。 |
| NetworkTypeInUse | NDIS_802_11_NETWORK_TYPE | 4 | +56 | +56 | 使用中のネットワーク種別。 |
| Configuration | NDIS_802_11_CONFIGURATION | 32 | +60 | +60 | 周波数や間隔などの構成パラメータ。 |
| InfrastructureMode | NDIS_802_11_NETWORK_INFRASTRUCTURE | 4 | +92 | +92 | インフラストラクチャ/アドホックの動作モード。 |
| SupportedRates | BYTE | 16 | +96 | +96 | サポートする伝送レートの配列(各値は0.5Mbps単位)。 |
| IELength | DWORD | 4 | +112 | +112 | IEsに格納された情報要素(IE)の長さ(バイト)。 |
| IEs | BYTE | 1 | +116 | +116 | 固定IEと可変IEを格納する可変長領域の先頭バイト。 |
各言語での定義
#include <windows.h>
// NDIS_802_11_SSID (x64 36 / x86 36 バイト)
typedef struct NDIS_802_11_SSID {
DWORD SsidLength;
BYTE Ssid[32];
} NDIS_802_11_SSID;
// NDIS_802_11_CONFIGURATION_FH (x64 16 / x86 16 バイト)
typedef struct NDIS_802_11_CONFIGURATION_FH {
DWORD Length;
DWORD HopPattern;
DWORD HopSet;
DWORD DwellTime;
} NDIS_802_11_CONFIGURATION_FH;
// NDIS_802_11_CONFIGURATION (x64 32 / x86 32 バイト)
typedef struct NDIS_802_11_CONFIGURATION {
DWORD Length;
DWORD BeaconPeriod;
DWORD ATIMWindow;
DWORD DSConfig;
NDIS_802_11_CONFIGURATION_FH FHConfig;
} NDIS_802_11_CONFIGURATION;
// NDIS_WLAN_BSSID_EX (x64 120 / x86 120 バイト)
typedef struct NDIS_WLAN_BSSID_EX {
DWORD Length;
BYTE MacAddress[6];
BYTE Reserved[2];
NDIS_802_11_SSID Ssid;
DWORD Privacy;
INT Rssi;
NDIS_802_11_NETWORK_TYPE NetworkTypeInUse;
NDIS_802_11_CONFIGURATION Configuration;
NDIS_802_11_NETWORK_INFRASTRUCTURE InfrastructureMode;
BYTE SupportedRates[16];
DWORD IELength;
BYTE IEs[1];
} NDIS_WLAN_BSSID_EX;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct NDIS_802_11_SSID
{
public uint SsidLength;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)] public byte[] Ssid;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct NDIS_802_11_CONFIGURATION_FH
{
public uint Length;
public uint HopPattern;
public uint HopSet;
public uint DwellTime;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct NDIS_802_11_CONFIGURATION
{
public uint Length;
public uint BeaconPeriod;
public uint ATIMWindow;
public uint DSConfig;
public NDIS_802_11_CONFIGURATION_FH FHConfig;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct NDIS_WLAN_BSSID_EX
{
public uint Length;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 6)] public byte[] MacAddress;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 2)] public byte[] Reserved;
public NDIS_802_11_SSID Ssid;
public uint Privacy;
public int Rssi;
public int NetworkTypeInUse;
public NDIS_802_11_CONFIGURATION Configuration;
public int InfrastructureMode;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)] public byte[] SupportedRates;
public uint IELength;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 1)] public byte[] IEs;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure NDIS_802_11_SSID
Public SsidLength As UInteger
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=32)> Public Ssid() As Byte
End Structure
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure NDIS_802_11_CONFIGURATION_FH
Public Length As UInteger
Public HopPattern As UInteger
Public HopSet As UInteger
Public DwellTime As UInteger
End Structure
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure NDIS_802_11_CONFIGURATION
Public Length As UInteger
Public BeaconPeriod As UInteger
Public ATIMWindow As UInteger
Public DSConfig As UInteger
Public FHConfig As NDIS_802_11_CONFIGURATION_FH
End Structure
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure NDIS_WLAN_BSSID_EX
Public Length As UInteger
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=6)> Public MacAddress() As Byte
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=2)> Public Reserved() As Byte
Public Ssid As NDIS_802_11_SSID
Public Privacy As UInteger
Public Rssi As Integer
Public NetworkTypeInUse As Integer
Public Configuration As NDIS_802_11_CONFIGURATION
Public InfrastructureMode As Integer
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=16)> Public SupportedRates() As Byte
Public IELength As UInteger
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=1)> Public IEs() As Byte
End Structureimport ctypes
from ctypes import wintypes
class NDIS_802_11_SSID(ctypes.Structure):
_fields_ = [
("SsidLength", wintypes.DWORD),
("Ssid", ctypes.c_ubyte * 32),
]
class NDIS_802_11_CONFIGURATION_FH(ctypes.Structure):
_fields_ = [
("Length", wintypes.DWORD),
("HopPattern", wintypes.DWORD),
("HopSet", wintypes.DWORD),
("DwellTime", wintypes.DWORD),
]
class NDIS_802_11_CONFIGURATION(ctypes.Structure):
_fields_ = [
("Length", wintypes.DWORD),
("BeaconPeriod", wintypes.DWORD),
("ATIMWindow", wintypes.DWORD),
("DSConfig", wintypes.DWORD),
("FHConfig", NDIS_802_11_CONFIGURATION_FH),
]
class NDIS_WLAN_BSSID_EX(ctypes.Structure):
_fields_ = [
("Length", wintypes.DWORD),
("MacAddress", ctypes.c_ubyte * 6),
("Reserved", ctypes.c_ubyte * 2),
("Ssid", NDIS_802_11_SSID),
("Privacy", wintypes.DWORD),
("Rssi", ctypes.c_int),
("NetworkTypeInUse", ctypes.c_int),
("Configuration", NDIS_802_11_CONFIGURATION),
("InfrastructureMode", ctypes.c_int),
("SupportedRates", ctypes.c_ubyte * 16),
("IELength", wintypes.DWORD),
("IEs", ctypes.c_ubyte * 1),
]#[repr(C)]
pub struct NDIS_802_11_SSID {
pub SsidLength: u32,
pub Ssid: [u8; 32],
}
#[repr(C)]
pub struct NDIS_802_11_CONFIGURATION_FH {
pub Length: u32,
pub HopPattern: u32,
pub HopSet: u32,
pub DwellTime: u32,
}
#[repr(C)]
pub struct NDIS_802_11_CONFIGURATION {
pub Length: u32,
pub BeaconPeriod: u32,
pub ATIMWindow: u32,
pub DSConfig: u32,
pub FHConfig: NDIS_802_11_CONFIGURATION_FH,
}
#[repr(C)]
pub struct NDIS_WLAN_BSSID_EX {
pub Length: u32,
pub MacAddress: [u8; 6],
pub Reserved: [u8; 2],
pub Ssid: NDIS_802_11_SSID,
pub Privacy: u32,
pub Rssi: i32,
pub NetworkTypeInUse: i32,
pub Configuration: NDIS_802_11_CONFIGURATION,
pub InfrastructureMode: i32,
pub SupportedRates: [u8; 16],
pub IELength: u32,
pub IEs: [u8; 1],
}import "golang.org/x/sys/windows"
type NDIS_802_11_SSID struct {
SsidLength uint32
Ssid [32]byte
}
type NDIS_802_11_CONFIGURATION_FH struct {
Length uint32
HopPattern uint32
HopSet uint32
DwellTime uint32
}
type NDIS_802_11_CONFIGURATION struct {
Length uint32
BeaconPeriod uint32
ATIMWindow uint32
DSConfig uint32
FHConfig NDIS_802_11_CONFIGURATION_FH
}
type NDIS_WLAN_BSSID_EX struct {
Length uint32
MacAddress [6]byte
Reserved [2]byte
Ssid NDIS_802_11_SSID
Privacy uint32
Rssi int32
NetworkTypeInUse int32
Configuration NDIS_802_11_CONFIGURATION
InfrastructureMode int32
SupportedRates [16]byte
IELength uint32
IEs [1]byte
}type
NDIS_802_11_SSID = record
SsidLength: DWORD;
Ssid: array[0..31] of Byte;
end;
NDIS_802_11_CONFIGURATION_FH = record
Length: DWORD;
HopPattern: DWORD;
HopSet: DWORD;
DwellTime: DWORD;
end;
NDIS_802_11_CONFIGURATION = record
Length: DWORD;
BeaconPeriod: DWORD;
ATIMWindow: DWORD;
DSConfig: DWORD;
FHConfig: NDIS_802_11_CONFIGURATION_FH;
end;
NDIS_WLAN_BSSID_EX = record
Length: DWORD;
MacAddress: array[0..5] of Byte;
Reserved: array[0..1] of Byte;
Ssid: NDIS_802_11_SSID;
Privacy: DWORD;
Rssi: Integer;
NetworkTypeInUse: Integer;
Configuration: NDIS_802_11_CONFIGURATION;
InfrastructureMode: Integer;
SupportedRates: array[0..15] of Byte;
IELength: DWORD;
IEs: array[0..0] of Byte;
end;const NDIS_802_11_SSID = extern struct {
SsidLength: u32,
Ssid: [32]u8,
};
const NDIS_802_11_CONFIGURATION_FH = extern struct {
Length: u32,
HopPattern: u32,
HopSet: u32,
DwellTime: u32,
};
const NDIS_802_11_CONFIGURATION = extern struct {
Length: u32,
BeaconPeriod: u32,
ATIMWindow: u32,
DSConfig: u32,
FHConfig: NDIS_802_11_CONFIGURATION_FH,
};
const NDIS_WLAN_BSSID_EX = extern struct {
Length: u32,
MacAddress: [6]u8,
Reserved: [2]u8,
Ssid: NDIS_802_11_SSID,
Privacy: u32,
Rssi: i32,
NetworkTypeInUse: i32,
Configuration: NDIS_802_11_CONFIGURATION,
InfrastructureMode: i32,
SupportedRates: [16]u8,
IELength: u32,
IEs: [1]u8,
};type
NDIS_802_11_SSID {.bycopy.} = object
SsidLength: uint32
Ssid: array[32, uint8]
NDIS_802_11_CONFIGURATION_FH {.bycopy.} = object
Length: uint32
HopPattern: uint32
HopSet: uint32
DwellTime: uint32
NDIS_802_11_CONFIGURATION {.bycopy.} = object
Length: uint32
BeaconPeriod: uint32
ATIMWindow: uint32
DSConfig: uint32
FHConfig: NDIS_802_11_CONFIGURATION_FH
NDIS_WLAN_BSSID_EX {.bycopy.} = object
Length: uint32
MacAddress: array[6, uint8]
Reserved: array[2, uint8]
Ssid: NDIS_802_11_SSID
Privacy: uint32
Rssi: int32
NetworkTypeInUse: int32
Configuration: NDIS_802_11_CONFIGURATION
InfrastructureMode: int32
SupportedRates: array[16, uint8]
IELength: uint32
IEs: array[1, uint8]struct NDIS_802_11_SSID
{
uint SsidLength;
ubyte[32] Ssid;
}
struct NDIS_802_11_CONFIGURATION_FH
{
uint Length;
uint HopPattern;
uint HopSet;
uint DwellTime;
}
struct NDIS_802_11_CONFIGURATION
{
uint Length;
uint BeaconPeriod;
uint ATIMWindow;
uint DSConfig;
NDIS_802_11_CONFIGURATION_FH FHConfig;
}
struct NDIS_WLAN_BSSID_EX
{
uint Length;
ubyte[6] MacAddress;
ubyte[2] Reserved;
NDIS_802_11_SSID Ssid;
uint Privacy;
int Rssi;
int NetworkTypeInUse;
NDIS_802_11_CONFIGURATION Configuration;
int InfrastructureMode;
ubyte[16] SupportedRates;
uint IELength;
ubyte[1] IEs;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; NDIS_WLAN_BSSID_EX サイズ: 120 バイト(x64)
dim st, 30 ; 4byte整数×30(構造体サイズ 120 / 4 切り上げ)
; Length : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; MacAddress : BYTE (+4, 6byte) varptr(st)+4 を基点に操作(6byte:入れ子/配列)
; Reserved : BYTE (+10, 2byte) varptr(st)+10 を基点に操作(2byte:入れ子/配列)
; Ssid : NDIS_802_11_SSID (+12, 36byte) varptr(st)+12 を基点に操作(36byte:入れ子/配列)
; Privacy : DWORD (+48, 4byte) st.12 = 値 / 値 = st.12 (lpoke/lpeek も可)
; Rssi : INT (+52, 4byte) st.13 = 値 / 値 = st.13 (lpoke/lpeek も可)
; NetworkTypeInUse : NDIS_802_11_NETWORK_TYPE (+56, 4byte) st.14 = 値 / 値 = st.14 (lpoke/lpeek も可)
; Configuration : NDIS_802_11_CONFIGURATION (+60, 32byte) varptr(st)+60 を基点に操作(32byte:入れ子/配列)
; InfrastructureMode : NDIS_802_11_NETWORK_INFRASTRUCTURE (+92, 4byte) st.23 = 値 / 値 = st.23 (lpoke/lpeek も可)
; SupportedRates : BYTE (+96, 16byte) varptr(st)+96 を基点に操作(16byte:入れ子/配列)
; IELength : DWORD (+112, 4byte) st.28 = 値 / 値 = st.28 (lpoke/lpeek も可)
; IEs : BYTE (+116, 1byte) varptr(st)+116 を基点に操作(1byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global NDIS_802_11_SSID
#field int SsidLength
#field byte Ssid 32
#endstruct
#defstruct global NDIS_802_11_CONFIGURATION_FH
#field int Length
#field int HopPattern
#field int HopSet
#field int DwellTime
#endstruct
#defstruct global NDIS_802_11_CONFIGURATION
#field int Length
#field int BeaconPeriod
#field int ATIMWindow
#field int DSConfig
#field NDIS_802_11_CONFIGURATION_FH FHConfig
#endstruct
#defstruct global NDIS_WLAN_BSSID_EX
#field int Length
#field byte MacAddress 6
#field byte Reserved 2
#field NDIS_802_11_SSID Ssid
#field int Privacy
#field int Rssi
#field int NetworkTypeInUse
#field NDIS_802_11_CONFIGURATION Configuration
#field int InfrastructureMode
#field byte SupportedRates 16
#field int IELength
#field byte IEs 1
#endstruct
stdim st, NDIS_WLAN_BSSID_EX ; NSTRUCT 変数を確保
st->Length = 100
mes "Length=" + st->Length