ホーム › NetworkManagement.NetworkPolicyServer › RADIUS_ATTRIBUTE
RADIUS_ATTRIBUTE
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| dwAttrType | DWORD | 4 | +0 | +0 | RADIUS属性の種別を示す属性タイプコード。 |
| fDataType | RADIUS_DATA_TYPE | 4 | +4 | +4 | 属性データの型を示すRADIUS_DATA_TYPE列挙値。 |
| cbDataLength | DWORD | 4 | +8 | +8 | 属性データのバイト長。 |
| Anonymous | _Anonymous_e__Union | 8/4 | +16 | +12 | 属性値そのものを格納する共用体。データ型に応じて整数値や文字列ポインタ等を保持する。 |
共用体: _Anonymous_e__Union x64 8B / x86 4B
| フィールド | 型 | サイズ | x64 | x86 |
|---|---|---|---|---|
| dwValue | DWORD | 4 | +0 | +0 |
| lpValue | BYTE* | 8/4 | +0 | +0 |
各言語での定義
#include <windows.h>
// RADIUS_ATTRIBUTE (x64 24 / x86 16 バイト)
typedef struct RADIUS_ATTRIBUTE {
DWORD dwAttrType;
RADIUS_DATA_TYPE fDataType;
DWORD cbDataLength;
_Anonymous_e__Union Anonymous;
} RADIUS_ATTRIBUTE;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct RADIUS_ATTRIBUTE
{
public uint dwAttrType;
public int fDataType;
public uint cbDataLength;
public _Anonymous_e__Union Anonymous;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure RADIUS_ATTRIBUTE
Public dwAttrType As UInteger
Public fDataType As Integer
Public cbDataLength As UInteger
Public Anonymous As _Anonymous_e__Union
End Structureimport ctypes
from ctypes import wintypes
class RADIUS_ATTRIBUTE(ctypes.Structure):
_fields_ = [
("dwAttrType", wintypes.DWORD),
("fDataType", ctypes.c_int),
("cbDataLength", wintypes.DWORD),
("Anonymous", _Anonymous_e__Union),
]#[repr(C)]
pub struct RADIUS_ATTRIBUTE {
pub dwAttrType: u32,
pub fDataType: i32,
pub cbDataLength: u32,
pub Anonymous: _Anonymous_e__Union,
}import "golang.org/x/sys/windows"
type RADIUS_ATTRIBUTE struct {
dwAttrType uint32
fDataType int32
cbDataLength uint32
Anonymous _Anonymous_e__Union
}type
RADIUS_ATTRIBUTE = record
dwAttrType: DWORD;
fDataType: Integer;
cbDataLength: DWORD;
Anonymous: _Anonymous_e__Union;
end;const RADIUS_ATTRIBUTE = extern struct {
dwAttrType: u32,
fDataType: i32,
cbDataLength: u32,
Anonymous: _Anonymous_e__Union,
};type
RADIUS_ATTRIBUTE {.bycopy.} = object
dwAttrType: uint32
fDataType: int32
cbDataLength: uint32
Anonymous: _Anonymous_e__Unionstruct RADIUS_ATTRIBUTE
{
uint dwAttrType;
int fDataType;
uint cbDataLength;
_Anonymous_e__Union Anonymous;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; RADIUS_ATTRIBUTE サイズ: 16 バイト(x86)
dim st, 4 ; 4byte整数×4(構造体サイズ 16 / 4 切り上げ)
; dwAttrType : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; fDataType : RADIUS_DATA_TYPE (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; cbDataLength : DWORD (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; Anonymous : _Anonymous_e__Union (+12, 4byte) varptr(st)+12 を基点に操作(4byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; RADIUS_ATTRIBUTE サイズ: 24 バイト(x64)
dim st, 6 ; 4byte整数×6(構造体サイズ 24 / 4 切り上げ)
; dwAttrType : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; fDataType : RADIUS_DATA_TYPE (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; cbDataLength : DWORD (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; Anonymous : _Anonymous_e__Union (+16, 8byte) varptr(st)+16 を基点に操作(8byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global RADIUS_ATTRIBUTE
#field int dwAttrType
#field int fDataType
#field int cbDataLength
#field byte Anonymous 8
#endstruct
stdim st, RADIUS_ATTRIBUTE ; NSTRUCT 変数を確保
st->dwAttrType = 100
mes "dwAttrType=" + st->dwAttrType
; ※union フィールドは byte 列で確保(NSTRUCT は union 非対応)。必要に応じ手動でアクセス。