ホーム › Networking.WinSock › ATM_TD
ATM_TD
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| PeakCellRate_CLP0 | DWORD | 4 | +0 | +0 | CLP=0セルのピークセルレートをセル毎秒で示す。 |
| PeakCellRate_CLP01 | DWORD | 4 | +4 | +4 | CLP=0+1(全)セルのピークセルレートをセル毎秒で示す。 |
| SustainableCellRate_CLP0 | DWORD | 4 | +8 | +8 | CLP=0セルの持続セルレートをセル毎秒で示す。 |
| SustainableCellRate_CLP01 | DWORD | 4 | +12 | +12 | CLP=0+1セルの持続セルレートをセル毎秒で示す。 |
| MaxBurstSize_CLP0 | DWORD | 4 | +16 | +16 | CLP=0セルの最大バーストサイズをセル数で示す。 |
| MaxBurstSize_CLP01 | DWORD | 4 | +20 | +20 | CLP=0+1セルの最大バーストサイズをセル数で示す。 |
| Tagging | BOOL | 4 | +24 | +24 | CLPタギングを有効にするかを示すBOOL値。TRUEでタギング有効。 |
各言語での定義
#include <windows.h>
// ATM_TD (x64 28 / x86 28 バイト)
typedef struct ATM_TD {
DWORD PeakCellRate_CLP0;
DWORD PeakCellRate_CLP01;
DWORD SustainableCellRate_CLP0;
DWORD SustainableCellRate_CLP01;
DWORD MaxBurstSize_CLP0;
DWORD MaxBurstSize_CLP01;
BOOL Tagging;
} ATM_TD;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct ATM_TD
{
public uint PeakCellRate_CLP0;
public uint PeakCellRate_CLP01;
public uint SustainableCellRate_CLP0;
public uint SustainableCellRate_CLP01;
public uint MaxBurstSize_CLP0;
public uint MaxBurstSize_CLP01;
[MarshalAs(UnmanagedType.Bool)] public bool Tagging;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure ATM_TD
Public PeakCellRate_CLP0 As UInteger
Public PeakCellRate_CLP01 As UInteger
Public SustainableCellRate_CLP0 As UInteger
Public SustainableCellRate_CLP01 As UInteger
Public MaxBurstSize_CLP0 As UInteger
Public MaxBurstSize_CLP01 As UInteger
<MarshalAs(UnmanagedType.Bool)> Public Tagging As Boolean
End Structureimport ctypes
from ctypes import wintypes
class ATM_TD(ctypes.Structure):
_fields_ = [
("PeakCellRate_CLP0", wintypes.DWORD),
("PeakCellRate_CLP01", wintypes.DWORD),
("SustainableCellRate_CLP0", wintypes.DWORD),
("SustainableCellRate_CLP01", wintypes.DWORD),
("MaxBurstSize_CLP0", wintypes.DWORD),
("MaxBurstSize_CLP01", wintypes.DWORD),
("Tagging", wintypes.BOOL),
]#[repr(C)]
pub struct ATM_TD {
pub PeakCellRate_CLP0: u32,
pub PeakCellRate_CLP01: u32,
pub SustainableCellRate_CLP0: u32,
pub SustainableCellRate_CLP01: u32,
pub MaxBurstSize_CLP0: u32,
pub MaxBurstSize_CLP01: u32,
pub Tagging: i32,
}import "golang.org/x/sys/windows"
type ATM_TD struct {
PeakCellRate_CLP0 uint32
PeakCellRate_CLP01 uint32
SustainableCellRate_CLP0 uint32
SustainableCellRate_CLP01 uint32
MaxBurstSize_CLP0 uint32
MaxBurstSize_CLP01 uint32
Tagging int32
}type
ATM_TD = record
PeakCellRate_CLP0: DWORD;
PeakCellRate_CLP01: DWORD;
SustainableCellRate_CLP0: DWORD;
SustainableCellRate_CLP01: DWORD;
MaxBurstSize_CLP0: DWORD;
MaxBurstSize_CLP01: DWORD;
Tagging: BOOL;
end;const ATM_TD = extern struct {
PeakCellRate_CLP0: u32,
PeakCellRate_CLP01: u32,
SustainableCellRate_CLP0: u32,
SustainableCellRate_CLP01: u32,
MaxBurstSize_CLP0: u32,
MaxBurstSize_CLP01: u32,
Tagging: i32,
};type
ATM_TD {.bycopy.} = object
PeakCellRate_CLP0: uint32
PeakCellRate_CLP01: uint32
SustainableCellRate_CLP0: uint32
SustainableCellRate_CLP01: uint32
MaxBurstSize_CLP0: uint32
MaxBurstSize_CLP01: uint32
Tagging: int32struct ATM_TD
{
uint PeakCellRate_CLP0;
uint PeakCellRate_CLP01;
uint SustainableCellRate_CLP0;
uint SustainableCellRate_CLP01;
uint MaxBurstSize_CLP0;
uint MaxBurstSize_CLP01;
int Tagging;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; ATM_TD サイズ: 28 バイト(x64)
dim st, 7 ; 4byte整数×7(構造体サイズ 28 / 4 切り上げ)
; PeakCellRate_CLP0 : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; PeakCellRate_CLP01 : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; SustainableCellRate_CLP0 : DWORD (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; SustainableCellRate_CLP01 : DWORD (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; MaxBurstSize_CLP0 : DWORD (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; MaxBurstSize_CLP01 : DWORD (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; Tagging : BOOL (+24, 4byte) st.6 = 値 / 値 = st.6 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global ATM_TD
#field int PeakCellRate_CLP0
#field int PeakCellRate_CLP01
#field int SustainableCellRate_CLP0
#field int SustainableCellRate_CLP01
#field int MaxBurstSize_CLP0
#field int MaxBurstSize_CLP01
#field bool Tagging
#endstruct
stdim st, ATM_TD ; NSTRUCT 変数を確保
st->PeakCellRate_CLP0 = 100
mes "PeakCellRate_CLP0=" + st->PeakCellRate_CLP0