ホーム › NetworkManagement.WiFi › DOT11_WEP_OFFLOAD
DOT11_WEP_OFFLOAD
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| uReserved | DWORD | 4 | +0 | +0 | 予約フィールド。ゼロを設定する。 |
| hOffloadContext | HANDLE | 8/4 | +8 | +4 | オフロードコンテキストを識別するハンドル。 |
| hOffload | HANDLE | 8/4 | +16 | +8 | 確立済みオフロードを識別するハンドル。 |
| dot11OffloadType | DOT11_OFFLOAD_TYPE | 4 | +24 | +12 | オフロードの種別を示す列挙値。 |
| dwAlgorithm | DWORD | 4 | +28 | +16 | 適用する暗号アルゴリズム識別子。 |
| bRowIsOutbound | BOOLEAN | 1 | +32 | +20 | この行が送信方向か示すフラグ。FALSEで受信方向。 |
| bUseDefault | BOOLEAN | 1 | +33 | +21 | 既定鍵を使用するか示すフラグ。 |
| uFlags | DWORD | 4 | +36 | +24 | オフロード動作を制御するフラグビットを表す。 |
| ucMacAddress | BYTE | 6 | +40 | +28 | 対象ピアの MAC アドレス(6バイト)。 |
| uNumOfRWsOnPeer | DWORD | 4 | +48 | +36 | ピア側のリプレイウィンドウ数を表す。 |
| uNumOfRWsOnMe | DWORD | 4 | +52 | +40 | 自局側のリプレイウィンドウ数を表す。 |
| dot11IV48Counters | DOT11_IV48_COUNTER | 128 | +56 | +44 | リプレイ検出用の48ビット IV カウンタ配列。 |
| usDot11RWBitMaps | WORD | 32 | +184 | +172 | 各リプレイウィンドウのビットマップ配列。 |
| usKeyLength | WORD | 2 | +216 | +204 | ucKey が保持する鍵のバイト長を表す。 |
| ucKey | BYTE | 1 | +218 | +206 | 暗号鍵データを格納するバイト配列。可変長。 |
各言語での定義
#include <windows.h>
// DOT11_IV48_COUNTER (x64 8 / x86 8 バイト)
typedef struct DOT11_IV48_COUNTER {
DWORD uIV32Counter;
WORD usIV16Counter;
} DOT11_IV48_COUNTER;
// DOT11_WEP_OFFLOAD (x64 224 / x86 208 バイト)
typedef struct DOT11_WEP_OFFLOAD {
DWORD uReserved;
HANDLE hOffloadContext;
HANDLE hOffload;
DOT11_OFFLOAD_TYPE dot11OffloadType;
DWORD dwAlgorithm;
BOOLEAN bRowIsOutbound;
BOOLEAN bUseDefault;
DWORD uFlags;
BYTE ucMacAddress[6];
DWORD uNumOfRWsOnPeer;
DWORD uNumOfRWsOnMe;
DOT11_IV48_COUNTER dot11IV48Counters[16];
WORD usDot11RWBitMaps[16];
WORD usKeyLength;
BYTE ucKey[1];
} DOT11_WEP_OFFLOAD;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DOT11_IV48_COUNTER
{
public uint uIV32Counter;
public ushort usIV16Counter;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DOT11_WEP_OFFLOAD
{
public uint uReserved;
public IntPtr hOffloadContext;
public IntPtr hOffload;
public int dot11OffloadType;
public uint dwAlgorithm;
[MarshalAs(UnmanagedType.U1)] public bool bRowIsOutbound;
[MarshalAs(UnmanagedType.U1)] public bool bUseDefault;
public uint uFlags;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 6)] public byte[] ucMacAddress;
public uint uNumOfRWsOnPeer;
public uint uNumOfRWsOnMe;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)] public DOT11_IV48_COUNTER[] dot11IV48Counters;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)] public ushort[] usDot11RWBitMaps;
public ushort usKeyLength;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 1)] public byte[] ucKey;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DOT11_IV48_COUNTER
Public uIV32Counter As UInteger
Public usIV16Counter As UShort
End Structure
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DOT11_WEP_OFFLOAD
Public uReserved As UInteger
Public hOffloadContext As IntPtr
Public hOffload As IntPtr
Public dot11OffloadType As Integer
Public dwAlgorithm As UInteger
<MarshalAs(UnmanagedType.U1)> Public bRowIsOutbound As Boolean
<MarshalAs(UnmanagedType.U1)> Public bUseDefault As Boolean
Public uFlags As UInteger
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=6)> Public ucMacAddress() As Byte
Public uNumOfRWsOnPeer As UInteger
Public uNumOfRWsOnMe As UInteger
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=16)> Public dot11IV48Counters() As DOT11_IV48_COUNTER
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=16)> Public usDot11RWBitMaps() As UShort
Public usKeyLength As UShort
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=1)> Public ucKey() As Byte
End Structureimport ctypes
from ctypes import wintypes
class DOT11_IV48_COUNTER(ctypes.Structure):
_fields_ = [
("uIV32Counter", wintypes.DWORD),
("usIV16Counter", ctypes.c_ushort),
]
class DOT11_WEP_OFFLOAD(ctypes.Structure):
_fields_ = [
("uReserved", wintypes.DWORD),
("hOffloadContext", ctypes.c_void_p),
("hOffload", ctypes.c_void_p),
("dot11OffloadType", ctypes.c_int),
("dwAlgorithm", wintypes.DWORD),
("bRowIsOutbound", ctypes.c_byte),
("bUseDefault", ctypes.c_byte),
("uFlags", wintypes.DWORD),
("ucMacAddress", ctypes.c_ubyte * 6),
("uNumOfRWsOnPeer", wintypes.DWORD),
("uNumOfRWsOnMe", wintypes.DWORD),
("dot11IV48Counters", DOT11_IV48_COUNTER * 16),
("usDot11RWBitMaps", ctypes.c_ushort * 16),
("usKeyLength", ctypes.c_ushort),
("ucKey", ctypes.c_ubyte * 1),
]#[repr(C)]
pub struct DOT11_IV48_COUNTER {
pub uIV32Counter: u32,
pub usIV16Counter: u16,
}
#[repr(C)]
pub struct DOT11_WEP_OFFLOAD {
pub uReserved: u32,
pub hOffloadContext: *mut core::ffi::c_void,
pub hOffload: *mut core::ffi::c_void,
pub dot11OffloadType: i32,
pub dwAlgorithm: u32,
pub bRowIsOutbound: u8,
pub bUseDefault: u8,
pub uFlags: u32,
pub ucMacAddress: [u8; 6],
pub uNumOfRWsOnPeer: u32,
pub uNumOfRWsOnMe: u32,
pub dot11IV48Counters: [DOT11_IV48_COUNTER; 16],
pub usDot11RWBitMaps: [u16; 16],
pub usKeyLength: u16,
pub ucKey: [u8; 1],
}import "golang.org/x/sys/windows"
type DOT11_IV48_COUNTER struct {
uIV32Counter uint32
usIV16Counter uint16
}
type DOT11_WEP_OFFLOAD struct {
uReserved uint32
hOffloadContext uintptr
hOffload uintptr
dot11OffloadType int32
dwAlgorithm uint32
bRowIsOutbound byte
bUseDefault byte
uFlags uint32
ucMacAddress [6]byte
uNumOfRWsOnPeer uint32
uNumOfRWsOnMe uint32
dot11IV48Counters [16]DOT11_IV48_COUNTER
usDot11RWBitMaps [16]uint16
usKeyLength uint16
ucKey [1]byte
}type
DOT11_IV48_COUNTER = record
uIV32Counter: DWORD;
usIV16Counter: Word;
end;
DOT11_WEP_OFFLOAD = record
uReserved: DWORD;
hOffloadContext: Pointer;
hOffload: Pointer;
dot11OffloadType: Integer;
dwAlgorithm: DWORD;
bRowIsOutbound: ByteBool;
bUseDefault: ByteBool;
uFlags: DWORD;
ucMacAddress: array[0..5] of Byte;
uNumOfRWsOnPeer: DWORD;
uNumOfRWsOnMe: DWORD;
dot11IV48Counters: array[0..15] of DOT11_IV48_COUNTER;
usDot11RWBitMaps: array[0..15] of Word;
usKeyLength: Word;
ucKey: array[0..0] of Byte;
end;const DOT11_IV48_COUNTER = extern struct {
uIV32Counter: u32,
usIV16Counter: u16,
};
const DOT11_WEP_OFFLOAD = extern struct {
uReserved: u32,
hOffloadContext: ?*anyopaque,
hOffload: ?*anyopaque,
dot11OffloadType: i32,
dwAlgorithm: u32,
bRowIsOutbound: u8,
bUseDefault: u8,
uFlags: u32,
ucMacAddress: [6]u8,
uNumOfRWsOnPeer: u32,
uNumOfRWsOnMe: u32,
dot11IV48Counters: [16]DOT11_IV48_COUNTER,
usDot11RWBitMaps: [16]u16,
usKeyLength: u16,
ucKey: [1]u8,
};type
DOT11_IV48_COUNTER {.bycopy.} = object
uIV32Counter: uint32
usIV16Counter: uint16
DOT11_WEP_OFFLOAD {.bycopy.} = object
uReserved: uint32
hOffloadContext: pointer
hOffload: pointer
dot11OffloadType: int32
dwAlgorithm: uint32
bRowIsOutbound: uint8
bUseDefault: uint8
uFlags: uint32
ucMacAddress: array[6, uint8]
uNumOfRWsOnPeer: uint32
uNumOfRWsOnMe: uint32
dot11IV48Counters: array[16, DOT11_IV48_COUNTER]
usDot11RWBitMaps: array[16, uint16]
usKeyLength: uint16
ucKey: array[1, uint8]struct DOT11_IV48_COUNTER
{
uint uIV32Counter;
ushort usIV16Counter;
}
struct DOT11_WEP_OFFLOAD
{
uint uReserved;
void* hOffloadContext;
void* hOffload;
int dot11OffloadType;
uint dwAlgorithm;
ubyte bRowIsOutbound;
ubyte bUseDefault;
uint uFlags;
ubyte[6] ucMacAddress;
uint uNumOfRWsOnPeer;
uint uNumOfRWsOnMe;
DOT11_IV48_COUNTER[16] dot11IV48Counters;
ushort[16] usDot11RWBitMaps;
ushort usKeyLength;
ubyte[1] ucKey;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; DOT11_WEP_OFFLOAD サイズ: 208 バイト(x86)
dim st, 52 ; 4byte整数×52(構造体サイズ 208 / 4 切り上げ)
; uReserved : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; hOffloadContext : HANDLE (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; hOffload : HANDLE (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; dot11OffloadType : DOT11_OFFLOAD_TYPE (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; dwAlgorithm : DWORD (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; bRowIsOutbound : BOOLEAN (+20, 1byte) poke st,20,値 / 値 = peek(st,20)
; bUseDefault : BOOLEAN (+21, 1byte) poke st,21,値 / 値 = peek(st,21)
; uFlags : DWORD (+24, 4byte) st.6 = 値 / 値 = st.6 (lpoke/lpeek も可)
; ucMacAddress : BYTE (+28, 6byte) varptr(st)+28 を基点に操作(6byte:入れ子/配列)
; uNumOfRWsOnPeer : DWORD (+36, 4byte) st.9 = 値 / 値 = st.9 (lpoke/lpeek も可)
; uNumOfRWsOnMe : DWORD (+40, 4byte) st.10 = 値 / 値 = st.10 (lpoke/lpeek も可)
; dot11IV48Counters : DOT11_IV48_COUNTER (+44, 128byte) varptr(st)+44 を基点に操作(128byte:入れ子/配列)
; usDot11RWBitMaps : WORD (+172, 32byte) varptr(st)+172 を基点に操作(32byte:入れ子/配列)
; usKeyLength : WORD (+204, 2byte) wpoke st,204,値 / 値 = wpeek(st,204)
; ucKey : BYTE (+206, 1byte) varptr(st)+206 を基点に操作(1byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; DOT11_WEP_OFFLOAD サイズ: 224 バイト(x64)
dim st, 56 ; 4byte整数×56(構造体サイズ 224 / 4 切り上げ)
; uReserved : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; hOffloadContext : HANDLE (+8, 8byte) qpoke st,8,値 / qpeek(st,8) ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; hOffload : HANDLE (+16, 8byte) qpoke st,16,値 / qpeek(st,16) ※IronHSPのみ。3.7/3.8は lpoke st,16,下位 : lpoke st,20,上位
; dot11OffloadType : DOT11_OFFLOAD_TYPE (+24, 4byte) st.6 = 値 / 値 = st.6 (lpoke/lpeek も可)
; dwAlgorithm : DWORD (+28, 4byte) st.7 = 値 / 値 = st.7 (lpoke/lpeek も可)
; bRowIsOutbound : BOOLEAN (+32, 1byte) poke st,32,値 / 値 = peek(st,32)
; bUseDefault : BOOLEAN (+33, 1byte) poke st,33,値 / 値 = peek(st,33)
; uFlags : DWORD (+36, 4byte) st.9 = 値 / 値 = st.9 (lpoke/lpeek も可)
; ucMacAddress : BYTE (+40, 6byte) varptr(st)+40 を基点に操作(6byte:入れ子/配列)
; uNumOfRWsOnPeer : DWORD (+48, 4byte) st.12 = 値 / 値 = st.12 (lpoke/lpeek も可)
; uNumOfRWsOnMe : DWORD (+52, 4byte) st.13 = 値 / 値 = st.13 (lpoke/lpeek も可)
; dot11IV48Counters : DOT11_IV48_COUNTER (+56, 128byte) varptr(st)+56 を基点に操作(128byte:入れ子/配列)
; usDot11RWBitMaps : WORD (+184, 32byte) varptr(st)+184 を基点に操作(32byte:入れ子/配列)
; usKeyLength : WORD (+216, 2byte) wpoke st,216,値 / 値 = wpeek(st,216)
; ucKey : BYTE (+218, 1byte) varptr(st)+218 を基点に操作(1byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global DOT11_IV48_COUNTER
#field int uIV32Counter
#field short usIV16Counter
#endstruct
#defstruct global DOT11_WEP_OFFLOAD
#field int uReserved
#field intptr hOffloadContext
#field intptr hOffload
#field int dot11OffloadType
#field int dwAlgorithm
#field bool1 bRowIsOutbound
#field bool1 bUseDefault
#field int uFlags
#field byte ucMacAddress 6
#field int uNumOfRWsOnPeer
#field int uNumOfRWsOnMe
#field DOT11_IV48_COUNTER dot11IV48Counters 16
#field short usDot11RWBitMaps 16
#field short usKeyLength
#field byte ucKey 1
#endstruct
stdim st, DOT11_WEP_OFFLOAD ; NSTRUCT 変数を確保
st->uReserved = 100
mes "uReserved=" + st->uReserved