Win32 API 日本語リファレンス
ホームNetworkManagement.IpHelper › TCP_ESTATS_DATA_ROD_v0

TCP_ESTATS_DATA_ROD_v0

構造体
サイズx64: 96 バイト / x86: 96 バイト

サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。

フィールド

フィールドサイズx64x86説明
DataBytesOutULONGLONG8+0+0送信したデータバイト数の累計である。
DataSegsOutULONGLONG8+8+8データを含めて送信したセグメント数の累計である。
DataBytesInULONGLONG8+16+16受信したデータバイト数の累計である。
DataSegsInULONGLONG8+24+24データを含めて受信したセグメント数の累計である。
SegsOutULONGLONG8+32+32送信したセグメント総数の累計である。
SegsInULONGLONG8+40+40受信したセグメント総数の累計である。
SoftErrorsDWORD4+48+48発生したソフトエラー(回復可能なエラー)の数である。
SoftErrorReasonDWORD4+52+52最後に発生したソフトエラーの理由を示すビットマスクである。
SndUnaDWORD4+56+56未確認送信データの最も古いシーケンス番号(SND.UNA)である。
SndNxtDWORD4+60+60次に送信するシーケンス番号(SND.NXT)である。
SndMaxDWORD4+64+64送信済みの最大シーケンス番号(SND.MAX)である。
ThruBytesAckedULONGLONG8+72+72ACKされたデータバイト数(スループット計測用)の累計である。
RcvNxtDWORD4+80+80次に受信を期待するシーケンス番号(RCV.NXT)である。
ThruBytesReceivedULONGLONG8+88+88受信されたデータバイト数(スループット計測用)の累計である。

各言語での定義

#include <windows.h>

// TCP_ESTATS_DATA_ROD_v0  (x64 96 / x86 96 バイト)
typedef struct TCP_ESTATS_DATA_ROD_v0 {
    ULONGLONG DataBytesOut;
    ULONGLONG DataSegsOut;
    ULONGLONG DataBytesIn;
    ULONGLONG DataSegsIn;
    ULONGLONG SegsOut;
    ULONGLONG SegsIn;
    DWORD SoftErrors;
    DWORD SoftErrorReason;
    DWORD SndUna;
    DWORD SndNxt;
    DWORD SndMax;
    ULONGLONG ThruBytesAcked;
    DWORD RcvNxt;
    ULONGLONG ThruBytesReceived;
} TCP_ESTATS_DATA_ROD_v0;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct TCP_ESTATS_DATA_ROD_v0
{
    public ulong DataBytesOut;
    public ulong DataSegsOut;
    public ulong DataBytesIn;
    public ulong DataSegsIn;
    public ulong SegsOut;
    public ulong SegsIn;
    public uint SoftErrors;
    public uint SoftErrorReason;
    public uint SndUna;
    public uint SndNxt;
    public uint SndMax;
    public ulong ThruBytesAcked;
    public uint RcvNxt;
    public ulong ThruBytesReceived;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure TCP_ESTATS_DATA_ROD_v0
    Public DataBytesOut As ULong
    Public DataSegsOut As ULong
    Public DataBytesIn As ULong
    Public DataSegsIn As ULong
    Public SegsOut As ULong
    Public SegsIn As ULong
    Public SoftErrors As UInteger
    Public SoftErrorReason As UInteger
    Public SndUna As UInteger
    Public SndNxt As UInteger
    Public SndMax As UInteger
    Public ThruBytesAcked As ULong
    Public RcvNxt As UInteger
    Public ThruBytesReceived As ULong
End Structure
import ctypes
from ctypes import wintypes

class TCP_ESTATS_DATA_ROD_v0(ctypes.Structure):
    _fields_ = [
        ("DataBytesOut", ctypes.c_ulonglong),
        ("DataSegsOut", ctypes.c_ulonglong),
        ("DataBytesIn", ctypes.c_ulonglong),
        ("DataSegsIn", ctypes.c_ulonglong),
        ("SegsOut", ctypes.c_ulonglong),
        ("SegsIn", ctypes.c_ulonglong),
        ("SoftErrors", wintypes.DWORD),
        ("SoftErrorReason", wintypes.DWORD),
        ("SndUna", wintypes.DWORD),
        ("SndNxt", wintypes.DWORD),
        ("SndMax", wintypes.DWORD),
        ("ThruBytesAcked", ctypes.c_ulonglong),
        ("RcvNxt", wintypes.DWORD),
        ("ThruBytesReceived", ctypes.c_ulonglong),
    ]
#[repr(C)]
pub struct TCP_ESTATS_DATA_ROD_v0 {
    pub DataBytesOut: u64,
    pub DataSegsOut: u64,
    pub DataBytesIn: u64,
    pub DataSegsIn: u64,
    pub SegsOut: u64,
    pub SegsIn: u64,
    pub SoftErrors: u32,
    pub SoftErrorReason: u32,
    pub SndUna: u32,
    pub SndNxt: u32,
    pub SndMax: u32,
    pub ThruBytesAcked: u64,
    pub RcvNxt: u32,
    pub ThruBytesReceived: u64,
}
import "golang.org/x/sys/windows"

type TCP_ESTATS_DATA_ROD_v0 struct {
	DataBytesOut uint64
	DataSegsOut uint64
	DataBytesIn uint64
	DataSegsIn uint64
	SegsOut uint64
	SegsIn uint64
	SoftErrors uint32
	SoftErrorReason uint32
	SndUna uint32
	SndNxt uint32
	SndMax uint32
	ThruBytesAcked uint64
	RcvNxt uint32
	ThruBytesReceived uint64
}
type
  TCP_ESTATS_DATA_ROD_v0 = record
    DataBytesOut: UInt64;
    DataSegsOut: UInt64;
    DataBytesIn: UInt64;
    DataSegsIn: UInt64;
    SegsOut: UInt64;
    SegsIn: UInt64;
    SoftErrors: DWORD;
    SoftErrorReason: DWORD;
    SndUna: DWORD;
    SndNxt: DWORD;
    SndMax: DWORD;
    ThruBytesAcked: UInt64;
    RcvNxt: DWORD;
    ThruBytesReceived: UInt64;
  end;
const TCP_ESTATS_DATA_ROD_v0 = extern struct {
    DataBytesOut: u64,
    DataSegsOut: u64,
    DataBytesIn: u64,
    DataSegsIn: u64,
    SegsOut: u64,
    SegsIn: u64,
    SoftErrors: u32,
    SoftErrorReason: u32,
    SndUna: u32,
    SndNxt: u32,
    SndMax: u32,
    ThruBytesAcked: u64,
    RcvNxt: u32,
    ThruBytesReceived: u64,
};
type
  TCP_ESTATS_DATA_ROD_v0 {.bycopy.} = object
    DataBytesOut: uint64
    DataSegsOut: uint64
    DataBytesIn: uint64
    DataSegsIn: uint64
    SegsOut: uint64
    SegsIn: uint64
    SoftErrors: uint32
    SoftErrorReason: uint32
    SndUna: uint32
    SndNxt: uint32
    SndMax: uint32
    ThruBytesAcked: uint64
    RcvNxt: uint32
    ThruBytesReceived: uint64
struct TCP_ESTATS_DATA_ROD_v0
{
    ulong DataBytesOut;
    ulong DataSegsOut;
    ulong DataBytesIn;
    ulong DataSegsIn;
    ulong SegsOut;
    ulong SegsIn;
    uint SoftErrors;
    uint SoftErrorReason;
    uint SndUna;
    uint SndNxt;
    uint SndMax;
    ulong ThruBytesAcked;
    uint RcvNxt;
    ulong ThruBytesReceived;
}

HSP用 定義

HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; TCP_ESTATS_DATA_ROD_v0 サイズ: 96 バイト(x64)
dim st, 24    ; 4byte整数×24(構造体サイズ 96 / 4 切り上げ)
; DataBytesOut : ULONGLONG (+0, 8byte)  qpoke st,0,値 / qpeek(st,0)  ※IronHSPのみ。3.7/3.8は lpoke st,0,下位 : lpoke st,4,上位
; DataSegsOut : ULONGLONG (+8, 8byte)  qpoke st,8,値 / qpeek(st,8)  ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; DataBytesIn : ULONGLONG (+16, 8byte)  qpoke st,16,値 / qpeek(st,16)  ※IronHSPのみ。3.7/3.8は lpoke st,16,下位 : lpoke st,20,上位
; DataSegsIn : ULONGLONG (+24, 8byte)  qpoke st,24,値 / qpeek(st,24)  ※IronHSPのみ。3.7/3.8は lpoke st,24,下位 : lpoke st,28,上位
; SegsOut : ULONGLONG (+32, 8byte)  qpoke st,32,値 / qpeek(st,32)  ※IronHSPのみ。3.7/3.8は lpoke st,32,下位 : lpoke st,36,上位
; SegsIn : ULONGLONG (+40, 8byte)  qpoke st,40,値 / qpeek(st,40)  ※IronHSPのみ。3.7/3.8は lpoke st,40,下位 : lpoke st,44,上位
; SoftErrors : DWORD (+48, 4byte)  st.12 = 値  /  値 = st.12   (lpoke/lpeek も可)
; SoftErrorReason : DWORD (+52, 4byte)  st.13 = 値  /  値 = st.13   (lpoke/lpeek も可)
; SndUna : DWORD (+56, 4byte)  st.14 = 値  /  値 = st.14   (lpoke/lpeek も可)
; SndNxt : DWORD (+60, 4byte)  st.15 = 値  /  値 = st.15   (lpoke/lpeek も可)
; SndMax : DWORD (+64, 4byte)  st.16 = 値  /  値 = st.16   (lpoke/lpeek も可)
; ThruBytesAcked : ULONGLONG (+72, 8byte)  qpoke st,72,値 / qpeek(st,72)  ※IronHSPのみ。3.7/3.8は lpoke st,72,下位 : lpoke st,76,上位
; RcvNxt : DWORD (+80, 4byte)  st.20 = 値  /  値 = st.20   (lpoke/lpeek も可)
; ThruBytesReceived : ULONGLONG (+88, 8byte)  qpoke st,88,値 / qpeek(st,88)  ※IronHSPのみ。3.7/3.8は lpoke st,88,下位 : lpoke st,92,上位
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global TCP_ESTATS_DATA_ROD_v0
    #field int64 DataBytesOut
    #field int64 DataSegsOut
    #field int64 DataBytesIn
    #field int64 DataSegsIn
    #field int64 SegsOut
    #field int64 SegsIn
    #field int SoftErrors
    #field int SoftErrorReason
    #field int SndUna
    #field int SndNxt
    #field int SndMax
    #field int64 ThruBytesAcked
    #field int RcvNxt
    #field int64 ThruBytesReceived
#endstruct

stdim st, TCP_ESTATS_DATA_ROD_v0        ; NSTRUCT 変数を確保
st->DataBytesOut = 100
mes "DataBytesOut=" + st->DataBytesOut