ホーム › NetworkManagement.IpHelper › MIB_TCPSTATS_LH
MIB_TCPSTATS_LH
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| Anonymous | _Anonymous_e__Union | 4 | +0 | +0 | RTOアルゴリズム種別を保持する匿名共用体で、dwRtoAlgorithm等としてアクセスする。 |
| dwRtoMin | DWORD | 4 | +4 | +4 | TCP再送タイムアウトの最小許容値をミリ秒単位で示す。 |
| dwRtoMax | DWORD | 4 | +8 | +8 | TCP再送タイムアウトの最大許容値をミリ秒単位で示す。 |
| dwMaxConn | DWORD | 4 | +12 | +12 | 同時に保持可能なTCP接続の最大数を示す。-1は可変上限を意味する。 |
| dwActiveOpens | DWORD | 4 | +16 | +16 | アクティブオープン(自発的なSYN送信)を行った回数の累計である。 |
| dwPassiveOpens | DWORD | 4 | +20 | +20 | パッシブオープン(LISTEN状態への遷移)を行った回数の累計である。 |
| dwAttemptFails | DWORD | 4 | +24 | +24 | 接続試行が失敗した回数の累計である。 |
| dwEstabResets | DWORD | 4 | +28 | +28 | 確立済み接続がリセットされた回数の累計である。 |
| dwCurrEstab | DWORD | 4 | +32 | +32 | 現在ESTABLISHEDまたはCLOSE-WAIT状態にある接続数を示す。 |
| dwInSegs | DWORD | 4 | +36 | +36 | 受信したTCPセグメントの総数(誤り含む)である。 |
| dwOutSegs | DWORD | 4 | +40 | +40 | 送信したTCPセグメントの総数(再送除く)である。 |
| dwRetransSegs | DWORD | 4 | +44 | +44 | 再送されたTCPセグメントの総数である。 |
| dwInErrs | DWORD | 4 | +48 | +48 | 誤りにより受信側で破棄されたセグメント数である。 |
| dwOutRsts | DWORD | 4 | +52 | +52 | RSTフラグ付きで送信されたセグメント数である。 |
| dwNumConns | DWORD | 4 | +56 | +56 | システム生成以来に存在した接続の累計数である。 |
共用体: _Anonymous_e__Union x64 4B / x86 4B
| フィールド | 型 | サイズ | x64 | x86 |
|---|---|---|---|---|
| dwRtoAlgorithm | DWORD | 4 | +0 | +0 |
| RtoAlgorithm | TCP_RTO_ALGORITHM | 4 | +0 | +0 |
各言語での定義
#include <windows.h>
// MIB_TCPSTATS_LH (x64 60 / x86 60 バイト)
typedef struct MIB_TCPSTATS_LH {
_Anonymous_e__Union Anonymous;
DWORD dwRtoMin;
DWORD dwRtoMax;
DWORD dwMaxConn;
DWORD dwActiveOpens;
DWORD dwPassiveOpens;
DWORD dwAttemptFails;
DWORD dwEstabResets;
DWORD dwCurrEstab;
DWORD dwInSegs;
DWORD dwOutSegs;
DWORD dwRetransSegs;
DWORD dwInErrs;
DWORD dwOutRsts;
DWORD dwNumConns;
} MIB_TCPSTATS_LH;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct MIB_TCPSTATS_LH
{
public _Anonymous_e__Union Anonymous;
public uint dwRtoMin;
public uint dwRtoMax;
public uint dwMaxConn;
public uint dwActiveOpens;
public uint dwPassiveOpens;
public uint dwAttemptFails;
public uint dwEstabResets;
public uint dwCurrEstab;
public uint dwInSegs;
public uint dwOutSegs;
public uint dwRetransSegs;
public uint dwInErrs;
public uint dwOutRsts;
public uint dwNumConns;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure MIB_TCPSTATS_LH
Public Anonymous As _Anonymous_e__Union
Public dwRtoMin As UInteger
Public dwRtoMax As UInteger
Public dwMaxConn As UInteger
Public dwActiveOpens As UInteger
Public dwPassiveOpens As UInteger
Public dwAttemptFails As UInteger
Public dwEstabResets As UInteger
Public dwCurrEstab As UInteger
Public dwInSegs As UInteger
Public dwOutSegs As UInteger
Public dwRetransSegs As UInteger
Public dwInErrs As UInteger
Public dwOutRsts As UInteger
Public dwNumConns As UInteger
End Structureimport ctypes
from ctypes import wintypes
class MIB_TCPSTATS_LH(ctypes.Structure):
_fields_ = [
("Anonymous", _Anonymous_e__Union),
("dwRtoMin", wintypes.DWORD),
("dwRtoMax", wintypes.DWORD),
("dwMaxConn", wintypes.DWORD),
("dwActiveOpens", wintypes.DWORD),
("dwPassiveOpens", wintypes.DWORD),
("dwAttemptFails", wintypes.DWORD),
("dwEstabResets", wintypes.DWORD),
("dwCurrEstab", wintypes.DWORD),
("dwInSegs", wintypes.DWORD),
("dwOutSegs", wintypes.DWORD),
("dwRetransSegs", wintypes.DWORD),
("dwInErrs", wintypes.DWORD),
("dwOutRsts", wintypes.DWORD),
("dwNumConns", wintypes.DWORD),
]#[repr(C)]
pub struct MIB_TCPSTATS_LH {
pub Anonymous: _Anonymous_e__Union,
pub dwRtoMin: u32,
pub dwRtoMax: u32,
pub dwMaxConn: u32,
pub dwActiveOpens: u32,
pub dwPassiveOpens: u32,
pub dwAttemptFails: u32,
pub dwEstabResets: u32,
pub dwCurrEstab: u32,
pub dwInSegs: u32,
pub dwOutSegs: u32,
pub dwRetransSegs: u32,
pub dwInErrs: u32,
pub dwOutRsts: u32,
pub dwNumConns: u32,
}import "golang.org/x/sys/windows"
type MIB_TCPSTATS_LH struct {
Anonymous _Anonymous_e__Union
dwRtoMin uint32
dwRtoMax uint32
dwMaxConn uint32
dwActiveOpens uint32
dwPassiveOpens uint32
dwAttemptFails uint32
dwEstabResets uint32
dwCurrEstab uint32
dwInSegs uint32
dwOutSegs uint32
dwRetransSegs uint32
dwInErrs uint32
dwOutRsts uint32
dwNumConns uint32
}type
MIB_TCPSTATS_LH = record
Anonymous: _Anonymous_e__Union;
dwRtoMin: DWORD;
dwRtoMax: DWORD;
dwMaxConn: DWORD;
dwActiveOpens: DWORD;
dwPassiveOpens: DWORD;
dwAttemptFails: DWORD;
dwEstabResets: DWORD;
dwCurrEstab: DWORD;
dwInSegs: DWORD;
dwOutSegs: DWORD;
dwRetransSegs: DWORD;
dwInErrs: DWORD;
dwOutRsts: DWORD;
dwNumConns: DWORD;
end;const MIB_TCPSTATS_LH = extern struct {
Anonymous: _Anonymous_e__Union,
dwRtoMin: u32,
dwRtoMax: u32,
dwMaxConn: u32,
dwActiveOpens: u32,
dwPassiveOpens: u32,
dwAttemptFails: u32,
dwEstabResets: u32,
dwCurrEstab: u32,
dwInSegs: u32,
dwOutSegs: u32,
dwRetransSegs: u32,
dwInErrs: u32,
dwOutRsts: u32,
dwNumConns: u32,
};type
MIB_TCPSTATS_LH {.bycopy.} = object
Anonymous: _Anonymous_e__Union
dwRtoMin: uint32
dwRtoMax: uint32
dwMaxConn: uint32
dwActiveOpens: uint32
dwPassiveOpens: uint32
dwAttemptFails: uint32
dwEstabResets: uint32
dwCurrEstab: uint32
dwInSegs: uint32
dwOutSegs: uint32
dwRetransSegs: uint32
dwInErrs: uint32
dwOutRsts: uint32
dwNumConns: uint32struct MIB_TCPSTATS_LH
{
_Anonymous_e__Union Anonymous;
uint dwRtoMin;
uint dwRtoMax;
uint dwMaxConn;
uint dwActiveOpens;
uint dwPassiveOpens;
uint dwAttemptFails;
uint dwEstabResets;
uint dwCurrEstab;
uint dwInSegs;
uint dwOutSegs;
uint dwRetransSegs;
uint dwInErrs;
uint dwOutRsts;
uint dwNumConns;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; MIB_TCPSTATS_LH サイズ: 60 バイト(x64)
dim st, 15 ; 4byte整数×15(構造体サイズ 60 / 4 切り上げ)
; Anonymous : _Anonymous_e__Union (+0, 4byte) varptr(st)+0 を基点に操作(4byte:入れ子/配列)
; dwRtoMin : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; dwRtoMax : DWORD (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; dwMaxConn : DWORD (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; dwActiveOpens : DWORD (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; dwPassiveOpens : DWORD (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; dwAttemptFails : DWORD (+24, 4byte) st.6 = 値 / 値 = st.6 (lpoke/lpeek も可)
; dwEstabResets : DWORD (+28, 4byte) st.7 = 値 / 値 = st.7 (lpoke/lpeek も可)
; dwCurrEstab : DWORD (+32, 4byte) st.8 = 値 / 値 = st.8 (lpoke/lpeek も可)
; dwInSegs : DWORD (+36, 4byte) st.9 = 値 / 値 = st.9 (lpoke/lpeek も可)
; dwOutSegs : DWORD (+40, 4byte) st.10 = 値 / 値 = st.10 (lpoke/lpeek も可)
; dwRetransSegs : DWORD (+44, 4byte) st.11 = 値 / 値 = st.11 (lpoke/lpeek も可)
; dwInErrs : DWORD (+48, 4byte) st.12 = 値 / 値 = st.12 (lpoke/lpeek も可)
; dwOutRsts : DWORD (+52, 4byte) st.13 = 値 / 値 = st.13 (lpoke/lpeek も可)
; dwNumConns : DWORD (+56, 4byte) st.14 = 値 / 値 = st.14 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global MIB_TCPSTATS_LH
#field byte Anonymous 4
#field int dwRtoMin
#field int dwRtoMax
#field int dwMaxConn
#field int dwActiveOpens
#field int dwPassiveOpens
#field int dwAttemptFails
#field int dwEstabResets
#field int dwCurrEstab
#field int dwInSegs
#field int dwOutSegs
#field int dwRetransSegs
#field int dwInErrs
#field int dwOutRsts
#field int dwNumConns
#endstruct
stdim st, MIB_TCPSTATS_LH ; NSTRUCT 変数を確保
st->dwRtoMin = 100
mes "dwRtoMin=" + st->dwRtoMin
; ※union フィールドは byte 列で確保(NSTRUCT は union 非対応)。必要に応じ手動でアクセス。