ホーム › NetworkManagement.IpHelper › MIBICMPSTATS
MIBICMPSTATS
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| dwMsgs | DWORD | 4 | +0 | +0 | 処理したICMPメッセージの総数を保持する。 |
| dwErrors | DWORD | 4 | +4 | +4 | ICMP固有エラーのメッセージ数を保持する。 |
| dwDestUnreachs | DWORD | 4 | +8 | +8 | 宛先到達不能(Destination Unreachable)メッセージ数を保持する。 |
| dwTimeExcds | DWORD | 4 | +12 | +12 | 時間超過(Time Exceeded)メッセージ数を保持する。 |
| dwParmProbs | DWORD | 4 | +16 | +16 | パラメータ異常(Parameter Problem)メッセージ数を保持する。 |
| dwSrcQuenchs | DWORD | 4 | +20 | +20 | 送信元抑制(Source Quench)メッセージ数を保持する。 |
| dwRedirects | DWORD | 4 | +24 | +24 | リダイレクトメッセージ数を保持する。 |
| dwEchos | DWORD | 4 | +28 | +28 | エコー要求(Echo Request)メッセージ数を保持する。 |
| dwEchoReps | DWORD | 4 | +32 | +32 | エコー応答(Echo Reply)メッセージ数を保持する。 |
| dwTimestamps | DWORD | 4 | +36 | +36 | タイムスタンプ要求メッセージ数を保持する。 |
| dwTimestampReps | DWORD | 4 | +40 | +40 | タイムスタンプ応答メッセージ数を保持する。 |
| dwAddrMasks | DWORD | 4 | +44 | +44 | アドレスマスク要求メッセージ数を保持する。 |
| dwAddrMaskReps | DWORD | 4 | +48 | +48 | アドレスマスク応答メッセージ数を保持する。 |
各言語での定義
#include <windows.h>
// MIBICMPSTATS (x64 52 / x86 52 バイト)
typedef struct MIBICMPSTATS {
DWORD dwMsgs;
DWORD dwErrors;
DWORD dwDestUnreachs;
DWORD dwTimeExcds;
DWORD dwParmProbs;
DWORD dwSrcQuenchs;
DWORD dwRedirects;
DWORD dwEchos;
DWORD dwEchoReps;
DWORD dwTimestamps;
DWORD dwTimestampReps;
DWORD dwAddrMasks;
DWORD dwAddrMaskReps;
} MIBICMPSTATS;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct MIBICMPSTATS
{
public uint dwMsgs;
public uint dwErrors;
public uint dwDestUnreachs;
public uint dwTimeExcds;
public uint dwParmProbs;
public uint dwSrcQuenchs;
public uint dwRedirects;
public uint dwEchos;
public uint dwEchoReps;
public uint dwTimestamps;
public uint dwTimestampReps;
public uint dwAddrMasks;
public uint dwAddrMaskReps;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure MIBICMPSTATS
Public dwMsgs As UInteger
Public dwErrors As UInteger
Public dwDestUnreachs As UInteger
Public dwTimeExcds As UInteger
Public dwParmProbs As UInteger
Public dwSrcQuenchs As UInteger
Public dwRedirects As UInteger
Public dwEchos As UInteger
Public dwEchoReps As UInteger
Public dwTimestamps As UInteger
Public dwTimestampReps As UInteger
Public dwAddrMasks As UInteger
Public dwAddrMaskReps As UInteger
End Structureimport ctypes
from ctypes import wintypes
class MIBICMPSTATS(ctypes.Structure):
_fields_ = [
("dwMsgs", wintypes.DWORD),
("dwErrors", wintypes.DWORD),
("dwDestUnreachs", wintypes.DWORD),
("dwTimeExcds", wintypes.DWORD),
("dwParmProbs", wintypes.DWORD),
("dwSrcQuenchs", wintypes.DWORD),
("dwRedirects", wintypes.DWORD),
("dwEchos", wintypes.DWORD),
("dwEchoReps", wintypes.DWORD),
("dwTimestamps", wintypes.DWORD),
("dwTimestampReps", wintypes.DWORD),
("dwAddrMasks", wintypes.DWORD),
("dwAddrMaskReps", wintypes.DWORD),
]#[repr(C)]
pub struct MIBICMPSTATS {
pub dwMsgs: u32,
pub dwErrors: u32,
pub dwDestUnreachs: u32,
pub dwTimeExcds: u32,
pub dwParmProbs: u32,
pub dwSrcQuenchs: u32,
pub dwRedirects: u32,
pub dwEchos: u32,
pub dwEchoReps: u32,
pub dwTimestamps: u32,
pub dwTimestampReps: u32,
pub dwAddrMasks: u32,
pub dwAddrMaskReps: u32,
}import "golang.org/x/sys/windows"
type MIBICMPSTATS struct {
dwMsgs uint32
dwErrors uint32
dwDestUnreachs uint32
dwTimeExcds uint32
dwParmProbs uint32
dwSrcQuenchs uint32
dwRedirects uint32
dwEchos uint32
dwEchoReps uint32
dwTimestamps uint32
dwTimestampReps uint32
dwAddrMasks uint32
dwAddrMaskReps uint32
}type
MIBICMPSTATS = record
dwMsgs: DWORD;
dwErrors: DWORD;
dwDestUnreachs: DWORD;
dwTimeExcds: DWORD;
dwParmProbs: DWORD;
dwSrcQuenchs: DWORD;
dwRedirects: DWORD;
dwEchos: DWORD;
dwEchoReps: DWORD;
dwTimestamps: DWORD;
dwTimestampReps: DWORD;
dwAddrMasks: DWORD;
dwAddrMaskReps: DWORD;
end;const MIBICMPSTATS = extern struct {
dwMsgs: u32,
dwErrors: u32,
dwDestUnreachs: u32,
dwTimeExcds: u32,
dwParmProbs: u32,
dwSrcQuenchs: u32,
dwRedirects: u32,
dwEchos: u32,
dwEchoReps: u32,
dwTimestamps: u32,
dwTimestampReps: u32,
dwAddrMasks: u32,
dwAddrMaskReps: u32,
};type
MIBICMPSTATS {.bycopy.} = object
dwMsgs: uint32
dwErrors: uint32
dwDestUnreachs: uint32
dwTimeExcds: uint32
dwParmProbs: uint32
dwSrcQuenchs: uint32
dwRedirects: uint32
dwEchos: uint32
dwEchoReps: uint32
dwTimestamps: uint32
dwTimestampReps: uint32
dwAddrMasks: uint32
dwAddrMaskReps: uint32struct MIBICMPSTATS
{
uint dwMsgs;
uint dwErrors;
uint dwDestUnreachs;
uint dwTimeExcds;
uint dwParmProbs;
uint dwSrcQuenchs;
uint dwRedirects;
uint dwEchos;
uint dwEchoReps;
uint dwTimestamps;
uint dwTimestampReps;
uint dwAddrMasks;
uint dwAddrMaskReps;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; MIBICMPSTATS サイズ: 52 バイト(x64)
dim st, 13 ; 4byte整数×13(構造体サイズ 52 / 4 切り上げ)
; dwMsgs : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; dwErrors : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; dwDestUnreachs : DWORD (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; dwTimeExcds : DWORD (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; dwParmProbs : DWORD (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; dwSrcQuenchs : DWORD (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; dwRedirects : DWORD (+24, 4byte) st.6 = 値 / 値 = st.6 (lpoke/lpeek も可)
; dwEchos : DWORD (+28, 4byte) st.7 = 値 / 値 = st.7 (lpoke/lpeek も可)
; dwEchoReps : DWORD (+32, 4byte) st.8 = 値 / 値 = st.8 (lpoke/lpeek も可)
; dwTimestamps : DWORD (+36, 4byte) st.9 = 値 / 値 = st.9 (lpoke/lpeek も可)
; dwTimestampReps : DWORD (+40, 4byte) st.10 = 値 / 値 = st.10 (lpoke/lpeek も可)
; dwAddrMasks : DWORD (+44, 4byte) st.11 = 値 / 値 = st.11 (lpoke/lpeek も可)
; dwAddrMaskReps : DWORD (+48, 4byte) st.12 = 値 / 値 = st.12 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global MIBICMPSTATS
#field int dwMsgs
#field int dwErrors
#field int dwDestUnreachs
#field int dwTimeExcds
#field int dwParmProbs
#field int dwSrcQuenchs
#field int dwRedirects
#field int dwEchos
#field int dwEchoReps
#field int dwTimestamps
#field int dwTimestampReps
#field int dwAddrMasks
#field int dwAddrMaskReps
#endstruct
stdim st, MIBICMPSTATS ; NSTRUCT 変数を確保
st->dwMsgs = 100
mes "dwMsgs=" + st->dwMsgs