ホーム › NetworkManagement.WiFi › DOT11_DEFAULT_WEP_OFFLOAD
DOT11_DEFAULT_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 | 確立済みオフロードを識別するハンドル。 |
| dwIndex | DWORD | 4 | +24 | +12 | 既定鍵テーブル内のインデックスを表す。 |
| dot11OffloadType | DOT11_OFFLOAD_TYPE | 4 | +28 | +16 | オフロードの種別を示す列挙値。 |
| dwAlgorithm | DWORD | 4 | +32 | +20 | 適用する暗号アルゴリズム識別子。 |
| uFlags | DWORD | 4 | +36 | +24 | オフロード動作を制御するフラグビットを表す。 |
| dot11KeyDirection | DOT11_KEY_DIRECTION | 4 | +40 | +28 | 鍵の適用方向(送信/受信)を示す列挙値。 |
| ucMacAddress | BYTE | 6 | +44 | +32 | 対象ピアの MAC アドレス(6バイト)。 |
| 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_DEFAULT_WEP_OFFLOAD (x64 224 / x86 208 バイト)
typedef struct DOT11_DEFAULT_WEP_OFFLOAD {
DWORD uReserved;
HANDLE hOffloadContext;
HANDLE hOffload;
DWORD dwIndex;
DOT11_OFFLOAD_TYPE dot11OffloadType;
DWORD dwAlgorithm;
DWORD uFlags;
DOT11_KEY_DIRECTION dot11KeyDirection;
BYTE ucMacAddress[6];
DWORD uNumOfRWsOnMe;
DOT11_IV48_COUNTER dot11IV48Counters[16];
WORD usDot11RWBitMaps[16];
WORD usKeyLength;
BYTE ucKey[1];
} DOT11_DEFAULT_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_DEFAULT_WEP_OFFLOAD
{
public uint uReserved;
public IntPtr hOffloadContext;
public IntPtr hOffload;
public uint dwIndex;
public int dot11OffloadType;
public uint dwAlgorithm;
public uint uFlags;
public int dot11KeyDirection;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 6)] public byte[] ucMacAddress;
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_DEFAULT_WEP_OFFLOAD
Public uReserved As UInteger
Public hOffloadContext As IntPtr
Public hOffload As IntPtr
Public dwIndex As UInteger
Public dot11OffloadType As Integer
Public dwAlgorithm As UInteger
Public uFlags As UInteger
Public dot11KeyDirection As Integer
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=6)> Public ucMacAddress() As Byte
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_DEFAULT_WEP_OFFLOAD(ctypes.Structure):
_fields_ = [
("uReserved", wintypes.DWORD),
("hOffloadContext", ctypes.c_void_p),
("hOffload", ctypes.c_void_p),
("dwIndex", wintypes.DWORD),
("dot11OffloadType", ctypes.c_int),
("dwAlgorithm", wintypes.DWORD),
("uFlags", wintypes.DWORD),
("dot11KeyDirection", ctypes.c_int),
("ucMacAddress", ctypes.c_ubyte * 6),
("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_DEFAULT_WEP_OFFLOAD {
pub uReserved: u32,
pub hOffloadContext: *mut core::ffi::c_void,
pub hOffload: *mut core::ffi::c_void,
pub dwIndex: u32,
pub dot11OffloadType: i32,
pub dwAlgorithm: u32,
pub uFlags: u32,
pub dot11KeyDirection: i32,
pub ucMacAddress: [u8; 6],
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_DEFAULT_WEP_OFFLOAD struct {
uReserved uint32
hOffloadContext uintptr
hOffload uintptr
dwIndex uint32
dot11OffloadType int32
dwAlgorithm uint32
uFlags uint32
dot11KeyDirection int32
ucMacAddress [6]byte
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_DEFAULT_WEP_OFFLOAD = record
uReserved: DWORD;
hOffloadContext: Pointer;
hOffload: Pointer;
dwIndex: DWORD;
dot11OffloadType: Integer;
dwAlgorithm: DWORD;
uFlags: DWORD;
dot11KeyDirection: Integer;
ucMacAddress: array[0..5] of Byte;
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_DEFAULT_WEP_OFFLOAD = extern struct {
uReserved: u32,
hOffloadContext: ?*anyopaque,
hOffload: ?*anyopaque,
dwIndex: u32,
dot11OffloadType: i32,
dwAlgorithm: u32,
uFlags: u32,
dot11KeyDirection: i32,
ucMacAddress: [6]u8,
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_DEFAULT_WEP_OFFLOAD {.bycopy.} = object
uReserved: uint32
hOffloadContext: pointer
hOffload: pointer
dwIndex: uint32
dot11OffloadType: int32
dwAlgorithm: uint32
uFlags: uint32
dot11KeyDirection: int32
ucMacAddress: array[6, uint8]
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_DEFAULT_WEP_OFFLOAD
{
uint uReserved;
void* hOffloadContext;
void* hOffload;
uint dwIndex;
int dot11OffloadType;
uint dwAlgorithm;
uint uFlags;
int dot11KeyDirection;
ubyte[6] ucMacAddress;
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_DEFAULT_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 も可)
; dwIndex : DWORD (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; dot11OffloadType : DOT11_OFFLOAD_TYPE (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; dwAlgorithm : DWORD (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; uFlags : DWORD (+24, 4byte) st.6 = 値 / 値 = st.6 (lpoke/lpeek も可)
; dot11KeyDirection : DOT11_KEY_DIRECTION (+28, 4byte) st.7 = 値 / 値 = st.7 (lpoke/lpeek も可)
; ucMacAddress : BYTE (+32, 6byte) varptr(st)+32 を基点に操作(6byte:入れ子/配列)
; 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_DEFAULT_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,上位
; dwIndex : DWORD (+24, 4byte) st.6 = 値 / 値 = st.6 (lpoke/lpeek も可)
; dot11OffloadType : DOT11_OFFLOAD_TYPE (+28, 4byte) st.7 = 値 / 値 = st.7 (lpoke/lpeek も可)
; dwAlgorithm : DWORD (+32, 4byte) st.8 = 値 / 値 = st.8 (lpoke/lpeek も可)
; uFlags : DWORD (+36, 4byte) st.9 = 値 / 値 = st.9 (lpoke/lpeek も可)
; dot11KeyDirection : DOT11_KEY_DIRECTION (+40, 4byte) st.10 = 値 / 値 = st.10 (lpoke/lpeek も可)
; ucMacAddress : BYTE (+44, 6byte) varptr(st)+44 を基点に操作(6byte:入れ子/配列)
; 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_DEFAULT_WEP_OFFLOAD
#field int uReserved
#field intptr hOffloadContext
#field intptr hOffload
#field int dwIndex
#field int dot11OffloadType
#field int dwAlgorithm
#field int uFlags
#field int dot11KeyDirection
#field byte ucMacAddress 6
#field int uNumOfRWsOnMe
#field DOT11_IV48_COUNTER dot11IV48Counters 16
#field short usDot11RWBitMaps 16
#field short usKeyLength
#field byte ucKey 1
#endstruct
stdim st, DOT11_DEFAULT_WEP_OFFLOAD ; NSTRUCT 変数を確保
st->uReserved = 100
mes "uReserved=" + st->uReserved