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

IPSEC_STATISTICS0

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

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

フィールド

フィールドサイズx64x86説明
aggregateSaStatisticsIPSEC_AGGREGATE_SA_STATISTICS028+0+0SA全体の集計統計を保持する構造体。
espDropPacketStatisticsIPSEC_ESP_DROP_PACKET_STATISTICS020+28+28ESP処理で破棄したパケットの統計。
ahDropPacketStatisticsIPSEC_AH_DROP_PACKET_STATISTICS016+48+48AH処理で破棄したパケットの統計。
aggregateDropPacketStatisticsIPSEC_AGGREGATE_DROP_PACKET_STATISTICS036+64+64破棄パケットの集計統計。
inboundTrafficStatisticsIPSEC_TRAFFIC_STATISTICS048+104+104受信トラフィックのバイト数統計。
outboundTrafficStatisticsIPSEC_TRAFFIC_STATISTICS048+152+152送信トラフィックのバイト数統計。

各言語での定義

#include <windows.h>

// IPSEC_AGGREGATE_SA_STATISTICS0  (x64 28 / x86 28 バイト)
typedef struct IPSEC_AGGREGATE_SA_STATISTICS0 {
    DWORD activeSas;
    DWORD pendingSaNegotiations;
    DWORD totalSasAdded;
    DWORD totalSasDeleted;
    DWORD successfulRekeys;
    DWORD activeTunnels;
    DWORD offloadedSas;
} IPSEC_AGGREGATE_SA_STATISTICS0;

// IPSEC_ESP_DROP_PACKET_STATISTICS0  (x64 20 / x86 20 バイト)
typedef struct IPSEC_ESP_DROP_PACKET_STATISTICS0 {
    DWORD invalidSpisOnInbound;
    DWORD decryptionFailuresOnInbound;
    DWORD authenticationFailuresOnInbound;
    DWORD replayCheckFailuresOnInbound;
    DWORD saNotInitializedOnInbound;
} IPSEC_ESP_DROP_PACKET_STATISTICS0;

// IPSEC_AH_DROP_PACKET_STATISTICS0  (x64 16 / x86 16 バイト)
typedef struct IPSEC_AH_DROP_PACKET_STATISTICS0 {
    DWORD invalidSpisOnInbound;
    DWORD authenticationFailuresOnInbound;
    DWORD replayCheckFailuresOnInbound;
    DWORD saNotInitializedOnInbound;
} IPSEC_AH_DROP_PACKET_STATISTICS0;

// IPSEC_AGGREGATE_DROP_PACKET_STATISTICS0  (x64 36 / x86 36 バイト)
typedef struct IPSEC_AGGREGATE_DROP_PACKET_STATISTICS0 {
    DWORD invalidSpisOnInbound;
    DWORD decryptionFailuresOnInbound;
    DWORD authenticationFailuresOnInbound;
    DWORD udpEspValidationFailuresOnInbound;
    DWORD replayCheckFailuresOnInbound;
    DWORD invalidClearTextInbound;
    DWORD saNotInitializedOnInbound;
    DWORD receiveOverIncorrectSaInbound;
    DWORD secureReceivesNotMatchingFilters;
} IPSEC_AGGREGATE_DROP_PACKET_STATISTICS0;

// IPSEC_TRAFFIC_STATISTICS0  (x64 48 / x86 48 バイト)
typedef struct IPSEC_TRAFFIC_STATISTICS0 {
    ULONGLONG encryptedByteCount;
    ULONGLONG authenticatedAHByteCount;
    ULONGLONG authenticatedESPByteCount;
    ULONGLONG transportByteCount;
    ULONGLONG tunnelByteCount;
    ULONGLONG offloadByteCount;
} IPSEC_TRAFFIC_STATISTICS0;

// IPSEC_STATISTICS0  (x64 200 / x86 200 バイト)
typedef struct IPSEC_STATISTICS0 {
    IPSEC_AGGREGATE_SA_STATISTICS0 aggregateSaStatistics;
    IPSEC_ESP_DROP_PACKET_STATISTICS0 espDropPacketStatistics;
    IPSEC_AH_DROP_PACKET_STATISTICS0 ahDropPacketStatistics;
    IPSEC_AGGREGATE_DROP_PACKET_STATISTICS0 aggregateDropPacketStatistics;
    IPSEC_TRAFFIC_STATISTICS0 inboundTrafficStatistics;
    IPSEC_TRAFFIC_STATISTICS0 outboundTrafficStatistics;
} IPSEC_STATISTICS0;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct IPSEC_AGGREGATE_SA_STATISTICS0
{
    public uint activeSas;
    public uint pendingSaNegotiations;
    public uint totalSasAdded;
    public uint totalSasDeleted;
    public uint successfulRekeys;
    public uint activeTunnels;
    public uint offloadedSas;
}

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct IPSEC_ESP_DROP_PACKET_STATISTICS0
{
    public uint invalidSpisOnInbound;
    public uint decryptionFailuresOnInbound;
    public uint authenticationFailuresOnInbound;
    public uint replayCheckFailuresOnInbound;
    public uint saNotInitializedOnInbound;
}

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct IPSEC_AH_DROP_PACKET_STATISTICS0
{
    public uint invalidSpisOnInbound;
    public uint authenticationFailuresOnInbound;
    public uint replayCheckFailuresOnInbound;
    public uint saNotInitializedOnInbound;
}

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct IPSEC_AGGREGATE_DROP_PACKET_STATISTICS0
{
    public uint invalidSpisOnInbound;
    public uint decryptionFailuresOnInbound;
    public uint authenticationFailuresOnInbound;
    public uint udpEspValidationFailuresOnInbound;
    public uint replayCheckFailuresOnInbound;
    public uint invalidClearTextInbound;
    public uint saNotInitializedOnInbound;
    public uint receiveOverIncorrectSaInbound;
    public uint secureReceivesNotMatchingFilters;
}

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct IPSEC_TRAFFIC_STATISTICS0
{
    public ulong encryptedByteCount;
    public ulong authenticatedAHByteCount;
    public ulong authenticatedESPByteCount;
    public ulong transportByteCount;
    public ulong tunnelByteCount;
    public ulong offloadByteCount;
}

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct IPSEC_STATISTICS0
{
    public IPSEC_AGGREGATE_SA_STATISTICS0 aggregateSaStatistics;
    public IPSEC_ESP_DROP_PACKET_STATISTICS0 espDropPacketStatistics;
    public IPSEC_AH_DROP_PACKET_STATISTICS0 ahDropPacketStatistics;
    public IPSEC_AGGREGATE_DROP_PACKET_STATISTICS0 aggregateDropPacketStatistics;
    public IPSEC_TRAFFIC_STATISTICS0 inboundTrafficStatistics;
    public IPSEC_TRAFFIC_STATISTICS0 outboundTrafficStatistics;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure IPSEC_AGGREGATE_SA_STATISTICS0
    Public activeSas As UInteger
    Public pendingSaNegotiations As UInteger
    Public totalSasAdded As UInteger
    Public totalSasDeleted As UInteger
    Public successfulRekeys As UInteger
    Public activeTunnels As UInteger
    Public offloadedSas As UInteger
End Structure

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure IPSEC_ESP_DROP_PACKET_STATISTICS0
    Public invalidSpisOnInbound As UInteger
    Public decryptionFailuresOnInbound As UInteger
    Public authenticationFailuresOnInbound As UInteger
    Public replayCheckFailuresOnInbound As UInteger
    Public saNotInitializedOnInbound As UInteger
End Structure

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure IPSEC_AH_DROP_PACKET_STATISTICS0
    Public invalidSpisOnInbound As UInteger
    Public authenticationFailuresOnInbound As UInteger
    Public replayCheckFailuresOnInbound As UInteger
    Public saNotInitializedOnInbound As UInteger
End Structure

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure IPSEC_AGGREGATE_DROP_PACKET_STATISTICS0
    Public invalidSpisOnInbound As UInteger
    Public decryptionFailuresOnInbound As UInteger
    Public authenticationFailuresOnInbound As UInteger
    Public udpEspValidationFailuresOnInbound As UInteger
    Public replayCheckFailuresOnInbound As UInteger
    Public invalidClearTextInbound As UInteger
    Public saNotInitializedOnInbound As UInteger
    Public receiveOverIncorrectSaInbound As UInteger
    Public secureReceivesNotMatchingFilters As UInteger
End Structure

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure IPSEC_TRAFFIC_STATISTICS0
    Public encryptedByteCount As ULong
    Public authenticatedAHByteCount As ULong
    Public authenticatedESPByteCount As ULong
    Public transportByteCount As ULong
    Public tunnelByteCount As ULong
    Public offloadByteCount As ULong
End Structure

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure IPSEC_STATISTICS0
    Public aggregateSaStatistics As IPSEC_AGGREGATE_SA_STATISTICS0
    Public espDropPacketStatistics As IPSEC_ESP_DROP_PACKET_STATISTICS0
    Public ahDropPacketStatistics As IPSEC_AH_DROP_PACKET_STATISTICS0
    Public aggregateDropPacketStatistics As IPSEC_AGGREGATE_DROP_PACKET_STATISTICS0
    Public inboundTrafficStatistics As IPSEC_TRAFFIC_STATISTICS0
    Public outboundTrafficStatistics As IPSEC_TRAFFIC_STATISTICS0
End Structure
import ctypes
from ctypes import wintypes

class IPSEC_AGGREGATE_SA_STATISTICS0(ctypes.Structure):
    _fields_ = [
        ("activeSas", wintypes.DWORD),
        ("pendingSaNegotiations", wintypes.DWORD),
        ("totalSasAdded", wintypes.DWORD),
        ("totalSasDeleted", wintypes.DWORD),
        ("successfulRekeys", wintypes.DWORD),
        ("activeTunnels", wintypes.DWORD),
        ("offloadedSas", wintypes.DWORD),
    ]

class IPSEC_ESP_DROP_PACKET_STATISTICS0(ctypes.Structure):
    _fields_ = [
        ("invalidSpisOnInbound", wintypes.DWORD),
        ("decryptionFailuresOnInbound", wintypes.DWORD),
        ("authenticationFailuresOnInbound", wintypes.DWORD),
        ("replayCheckFailuresOnInbound", wintypes.DWORD),
        ("saNotInitializedOnInbound", wintypes.DWORD),
    ]

class IPSEC_AH_DROP_PACKET_STATISTICS0(ctypes.Structure):
    _fields_ = [
        ("invalidSpisOnInbound", wintypes.DWORD),
        ("authenticationFailuresOnInbound", wintypes.DWORD),
        ("replayCheckFailuresOnInbound", wintypes.DWORD),
        ("saNotInitializedOnInbound", wintypes.DWORD),
    ]

class IPSEC_AGGREGATE_DROP_PACKET_STATISTICS0(ctypes.Structure):
    _fields_ = [
        ("invalidSpisOnInbound", wintypes.DWORD),
        ("decryptionFailuresOnInbound", wintypes.DWORD),
        ("authenticationFailuresOnInbound", wintypes.DWORD),
        ("udpEspValidationFailuresOnInbound", wintypes.DWORD),
        ("replayCheckFailuresOnInbound", wintypes.DWORD),
        ("invalidClearTextInbound", wintypes.DWORD),
        ("saNotInitializedOnInbound", wintypes.DWORD),
        ("receiveOverIncorrectSaInbound", wintypes.DWORD),
        ("secureReceivesNotMatchingFilters", wintypes.DWORD),
    ]

class IPSEC_TRAFFIC_STATISTICS0(ctypes.Structure):
    _fields_ = [
        ("encryptedByteCount", ctypes.c_ulonglong),
        ("authenticatedAHByteCount", ctypes.c_ulonglong),
        ("authenticatedESPByteCount", ctypes.c_ulonglong),
        ("transportByteCount", ctypes.c_ulonglong),
        ("tunnelByteCount", ctypes.c_ulonglong),
        ("offloadByteCount", ctypes.c_ulonglong),
    ]

class IPSEC_STATISTICS0(ctypes.Structure):
    _fields_ = [
        ("aggregateSaStatistics", IPSEC_AGGREGATE_SA_STATISTICS0),
        ("espDropPacketStatistics", IPSEC_ESP_DROP_PACKET_STATISTICS0),
        ("ahDropPacketStatistics", IPSEC_AH_DROP_PACKET_STATISTICS0),
        ("aggregateDropPacketStatistics", IPSEC_AGGREGATE_DROP_PACKET_STATISTICS0),
        ("inboundTrafficStatistics", IPSEC_TRAFFIC_STATISTICS0),
        ("outboundTrafficStatistics", IPSEC_TRAFFIC_STATISTICS0),
    ]
#[repr(C)]
pub struct IPSEC_AGGREGATE_SA_STATISTICS0 {
    pub activeSas: u32,
    pub pendingSaNegotiations: u32,
    pub totalSasAdded: u32,
    pub totalSasDeleted: u32,
    pub successfulRekeys: u32,
    pub activeTunnels: u32,
    pub offloadedSas: u32,
}

#[repr(C)]
pub struct IPSEC_ESP_DROP_PACKET_STATISTICS0 {
    pub invalidSpisOnInbound: u32,
    pub decryptionFailuresOnInbound: u32,
    pub authenticationFailuresOnInbound: u32,
    pub replayCheckFailuresOnInbound: u32,
    pub saNotInitializedOnInbound: u32,
}

#[repr(C)]
pub struct IPSEC_AH_DROP_PACKET_STATISTICS0 {
    pub invalidSpisOnInbound: u32,
    pub authenticationFailuresOnInbound: u32,
    pub replayCheckFailuresOnInbound: u32,
    pub saNotInitializedOnInbound: u32,
}

#[repr(C)]
pub struct IPSEC_AGGREGATE_DROP_PACKET_STATISTICS0 {
    pub invalidSpisOnInbound: u32,
    pub decryptionFailuresOnInbound: u32,
    pub authenticationFailuresOnInbound: u32,
    pub udpEspValidationFailuresOnInbound: u32,
    pub replayCheckFailuresOnInbound: u32,
    pub invalidClearTextInbound: u32,
    pub saNotInitializedOnInbound: u32,
    pub receiveOverIncorrectSaInbound: u32,
    pub secureReceivesNotMatchingFilters: u32,
}

#[repr(C)]
pub struct IPSEC_TRAFFIC_STATISTICS0 {
    pub encryptedByteCount: u64,
    pub authenticatedAHByteCount: u64,
    pub authenticatedESPByteCount: u64,
    pub transportByteCount: u64,
    pub tunnelByteCount: u64,
    pub offloadByteCount: u64,
}

#[repr(C)]
pub struct IPSEC_STATISTICS0 {
    pub aggregateSaStatistics: IPSEC_AGGREGATE_SA_STATISTICS0,
    pub espDropPacketStatistics: IPSEC_ESP_DROP_PACKET_STATISTICS0,
    pub ahDropPacketStatistics: IPSEC_AH_DROP_PACKET_STATISTICS0,
    pub aggregateDropPacketStatistics: IPSEC_AGGREGATE_DROP_PACKET_STATISTICS0,
    pub inboundTrafficStatistics: IPSEC_TRAFFIC_STATISTICS0,
    pub outboundTrafficStatistics: IPSEC_TRAFFIC_STATISTICS0,
}
import "golang.org/x/sys/windows"

type IPSEC_AGGREGATE_SA_STATISTICS0 struct {
	activeSas uint32
	pendingSaNegotiations uint32
	totalSasAdded uint32
	totalSasDeleted uint32
	successfulRekeys uint32
	activeTunnels uint32
	offloadedSas uint32
}

type IPSEC_ESP_DROP_PACKET_STATISTICS0 struct {
	invalidSpisOnInbound uint32
	decryptionFailuresOnInbound uint32
	authenticationFailuresOnInbound uint32
	replayCheckFailuresOnInbound uint32
	saNotInitializedOnInbound uint32
}

type IPSEC_AH_DROP_PACKET_STATISTICS0 struct {
	invalidSpisOnInbound uint32
	authenticationFailuresOnInbound uint32
	replayCheckFailuresOnInbound uint32
	saNotInitializedOnInbound uint32
}

type IPSEC_AGGREGATE_DROP_PACKET_STATISTICS0 struct {
	invalidSpisOnInbound uint32
	decryptionFailuresOnInbound uint32
	authenticationFailuresOnInbound uint32
	udpEspValidationFailuresOnInbound uint32
	replayCheckFailuresOnInbound uint32
	invalidClearTextInbound uint32
	saNotInitializedOnInbound uint32
	receiveOverIncorrectSaInbound uint32
	secureReceivesNotMatchingFilters uint32
}

type IPSEC_TRAFFIC_STATISTICS0 struct {
	encryptedByteCount uint64
	authenticatedAHByteCount uint64
	authenticatedESPByteCount uint64
	transportByteCount uint64
	tunnelByteCount uint64
	offloadByteCount uint64
}

type IPSEC_STATISTICS0 struct {
	aggregateSaStatistics IPSEC_AGGREGATE_SA_STATISTICS0
	espDropPacketStatistics IPSEC_ESP_DROP_PACKET_STATISTICS0
	ahDropPacketStatistics IPSEC_AH_DROP_PACKET_STATISTICS0
	aggregateDropPacketStatistics IPSEC_AGGREGATE_DROP_PACKET_STATISTICS0
	inboundTrafficStatistics IPSEC_TRAFFIC_STATISTICS0
	outboundTrafficStatistics IPSEC_TRAFFIC_STATISTICS0
}
type
  IPSEC_AGGREGATE_SA_STATISTICS0 = record
    activeSas: DWORD;
    pendingSaNegotiations: DWORD;
    totalSasAdded: DWORD;
    totalSasDeleted: DWORD;
    successfulRekeys: DWORD;
    activeTunnels: DWORD;
    offloadedSas: DWORD;
  end;

  IPSEC_ESP_DROP_PACKET_STATISTICS0 = record
    invalidSpisOnInbound: DWORD;
    decryptionFailuresOnInbound: DWORD;
    authenticationFailuresOnInbound: DWORD;
    replayCheckFailuresOnInbound: DWORD;
    saNotInitializedOnInbound: DWORD;
  end;

  IPSEC_AH_DROP_PACKET_STATISTICS0 = record
    invalidSpisOnInbound: DWORD;
    authenticationFailuresOnInbound: DWORD;
    replayCheckFailuresOnInbound: DWORD;
    saNotInitializedOnInbound: DWORD;
  end;

  IPSEC_AGGREGATE_DROP_PACKET_STATISTICS0 = record
    invalidSpisOnInbound: DWORD;
    decryptionFailuresOnInbound: DWORD;
    authenticationFailuresOnInbound: DWORD;
    udpEspValidationFailuresOnInbound: DWORD;
    replayCheckFailuresOnInbound: DWORD;
    invalidClearTextInbound: DWORD;
    saNotInitializedOnInbound: DWORD;
    receiveOverIncorrectSaInbound: DWORD;
    secureReceivesNotMatchingFilters: DWORD;
  end;

  IPSEC_TRAFFIC_STATISTICS0 = record
    encryptedByteCount: UInt64;
    authenticatedAHByteCount: UInt64;
    authenticatedESPByteCount: UInt64;
    transportByteCount: UInt64;
    tunnelByteCount: UInt64;
    offloadByteCount: UInt64;
  end;

  IPSEC_STATISTICS0 = record
    aggregateSaStatistics: IPSEC_AGGREGATE_SA_STATISTICS0;
    espDropPacketStatistics: IPSEC_ESP_DROP_PACKET_STATISTICS0;
    ahDropPacketStatistics: IPSEC_AH_DROP_PACKET_STATISTICS0;
    aggregateDropPacketStatistics: IPSEC_AGGREGATE_DROP_PACKET_STATISTICS0;
    inboundTrafficStatistics: IPSEC_TRAFFIC_STATISTICS0;
    outboundTrafficStatistics: IPSEC_TRAFFIC_STATISTICS0;
  end;
const IPSEC_AGGREGATE_SA_STATISTICS0 = extern struct {
    activeSas: u32,
    pendingSaNegotiations: u32,
    totalSasAdded: u32,
    totalSasDeleted: u32,
    successfulRekeys: u32,
    activeTunnels: u32,
    offloadedSas: u32,
};

const IPSEC_ESP_DROP_PACKET_STATISTICS0 = extern struct {
    invalidSpisOnInbound: u32,
    decryptionFailuresOnInbound: u32,
    authenticationFailuresOnInbound: u32,
    replayCheckFailuresOnInbound: u32,
    saNotInitializedOnInbound: u32,
};

const IPSEC_AH_DROP_PACKET_STATISTICS0 = extern struct {
    invalidSpisOnInbound: u32,
    authenticationFailuresOnInbound: u32,
    replayCheckFailuresOnInbound: u32,
    saNotInitializedOnInbound: u32,
};

const IPSEC_AGGREGATE_DROP_PACKET_STATISTICS0 = extern struct {
    invalidSpisOnInbound: u32,
    decryptionFailuresOnInbound: u32,
    authenticationFailuresOnInbound: u32,
    udpEspValidationFailuresOnInbound: u32,
    replayCheckFailuresOnInbound: u32,
    invalidClearTextInbound: u32,
    saNotInitializedOnInbound: u32,
    receiveOverIncorrectSaInbound: u32,
    secureReceivesNotMatchingFilters: u32,
};

const IPSEC_TRAFFIC_STATISTICS0 = extern struct {
    encryptedByteCount: u64,
    authenticatedAHByteCount: u64,
    authenticatedESPByteCount: u64,
    transportByteCount: u64,
    tunnelByteCount: u64,
    offloadByteCount: u64,
};

const IPSEC_STATISTICS0 = extern struct {
    aggregateSaStatistics: IPSEC_AGGREGATE_SA_STATISTICS0,
    espDropPacketStatistics: IPSEC_ESP_DROP_PACKET_STATISTICS0,
    ahDropPacketStatistics: IPSEC_AH_DROP_PACKET_STATISTICS0,
    aggregateDropPacketStatistics: IPSEC_AGGREGATE_DROP_PACKET_STATISTICS0,
    inboundTrafficStatistics: IPSEC_TRAFFIC_STATISTICS0,
    outboundTrafficStatistics: IPSEC_TRAFFIC_STATISTICS0,
};
type
  IPSEC_AGGREGATE_SA_STATISTICS0 {.bycopy.} = object
    activeSas: uint32
    pendingSaNegotiations: uint32
    totalSasAdded: uint32
    totalSasDeleted: uint32
    successfulRekeys: uint32
    activeTunnels: uint32
    offloadedSas: uint32

  IPSEC_ESP_DROP_PACKET_STATISTICS0 {.bycopy.} = object
    invalidSpisOnInbound: uint32
    decryptionFailuresOnInbound: uint32
    authenticationFailuresOnInbound: uint32
    replayCheckFailuresOnInbound: uint32
    saNotInitializedOnInbound: uint32

  IPSEC_AH_DROP_PACKET_STATISTICS0 {.bycopy.} = object
    invalidSpisOnInbound: uint32
    authenticationFailuresOnInbound: uint32
    replayCheckFailuresOnInbound: uint32
    saNotInitializedOnInbound: uint32

  IPSEC_AGGREGATE_DROP_PACKET_STATISTICS0 {.bycopy.} = object
    invalidSpisOnInbound: uint32
    decryptionFailuresOnInbound: uint32
    authenticationFailuresOnInbound: uint32
    udpEspValidationFailuresOnInbound: uint32
    replayCheckFailuresOnInbound: uint32
    invalidClearTextInbound: uint32
    saNotInitializedOnInbound: uint32
    receiveOverIncorrectSaInbound: uint32
    secureReceivesNotMatchingFilters: uint32

  IPSEC_TRAFFIC_STATISTICS0 {.bycopy.} = object
    encryptedByteCount: uint64
    authenticatedAHByteCount: uint64
    authenticatedESPByteCount: uint64
    transportByteCount: uint64
    tunnelByteCount: uint64
    offloadByteCount: uint64

  IPSEC_STATISTICS0 {.bycopy.} = object
    aggregateSaStatistics: IPSEC_AGGREGATE_SA_STATISTICS0
    espDropPacketStatistics: IPSEC_ESP_DROP_PACKET_STATISTICS0
    ahDropPacketStatistics: IPSEC_AH_DROP_PACKET_STATISTICS0
    aggregateDropPacketStatistics: IPSEC_AGGREGATE_DROP_PACKET_STATISTICS0
    inboundTrafficStatistics: IPSEC_TRAFFIC_STATISTICS0
    outboundTrafficStatistics: IPSEC_TRAFFIC_STATISTICS0
struct IPSEC_AGGREGATE_SA_STATISTICS0
{
    uint activeSas;
    uint pendingSaNegotiations;
    uint totalSasAdded;
    uint totalSasDeleted;
    uint successfulRekeys;
    uint activeTunnels;
    uint offloadedSas;
}

struct IPSEC_ESP_DROP_PACKET_STATISTICS0
{
    uint invalidSpisOnInbound;
    uint decryptionFailuresOnInbound;
    uint authenticationFailuresOnInbound;
    uint replayCheckFailuresOnInbound;
    uint saNotInitializedOnInbound;
}

struct IPSEC_AH_DROP_PACKET_STATISTICS0
{
    uint invalidSpisOnInbound;
    uint authenticationFailuresOnInbound;
    uint replayCheckFailuresOnInbound;
    uint saNotInitializedOnInbound;
}

struct IPSEC_AGGREGATE_DROP_PACKET_STATISTICS0
{
    uint invalidSpisOnInbound;
    uint decryptionFailuresOnInbound;
    uint authenticationFailuresOnInbound;
    uint udpEspValidationFailuresOnInbound;
    uint replayCheckFailuresOnInbound;
    uint invalidClearTextInbound;
    uint saNotInitializedOnInbound;
    uint receiveOverIncorrectSaInbound;
    uint secureReceivesNotMatchingFilters;
}

struct IPSEC_TRAFFIC_STATISTICS0
{
    ulong encryptedByteCount;
    ulong authenticatedAHByteCount;
    ulong authenticatedESPByteCount;
    ulong transportByteCount;
    ulong tunnelByteCount;
    ulong offloadByteCount;
}

struct IPSEC_STATISTICS0
{
    IPSEC_AGGREGATE_SA_STATISTICS0 aggregateSaStatistics;
    IPSEC_ESP_DROP_PACKET_STATISTICS0 espDropPacketStatistics;
    IPSEC_AH_DROP_PACKET_STATISTICS0 ahDropPacketStatistics;
    IPSEC_AGGREGATE_DROP_PACKET_STATISTICS0 aggregateDropPacketStatistics;
    IPSEC_TRAFFIC_STATISTICS0 inboundTrafficStatistics;
    IPSEC_TRAFFIC_STATISTICS0 outboundTrafficStatistics;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; IPSEC_STATISTICS0 サイズ: 200 バイト(x64)
dim st, 50    ; 4byte整数×50(構造体サイズ 200 / 4 切り上げ)
; aggregateSaStatistics : IPSEC_AGGREGATE_SA_STATISTICS0 (+0, 28byte)  varptr(st)+0 を基点に操作(28byte:入れ子/配列)
; espDropPacketStatistics : IPSEC_ESP_DROP_PACKET_STATISTICS0 (+28, 20byte)  varptr(st)+28 を基点に操作(20byte:入れ子/配列)
; ahDropPacketStatistics : IPSEC_AH_DROP_PACKET_STATISTICS0 (+48, 16byte)  varptr(st)+48 を基点に操作(16byte:入れ子/配列)
; aggregateDropPacketStatistics : IPSEC_AGGREGATE_DROP_PACKET_STATISTICS0 (+64, 36byte)  varptr(st)+64 を基点に操作(36byte:入れ子/配列)
; inboundTrafficStatistics : IPSEC_TRAFFIC_STATISTICS0 (+104, 48byte)  varptr(st)+104 を基点に操作(48byte:入れ子/配列)
; outboundTrafficStatistics : IPSEC_TRAFFIC_STATISTICS0 (+152, 48byte)  varptr(st)+152 を基点に操作(48byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global IPSEC_AGGREGATE_SA_STATISTICS0
    #field int activeSas
    #field int pendingSaNegotiations
    #field int totalSasAdded
    #field int totalSasDeleted
    #field int successfulRekeys
    #field int activeTunnels
    #field int offloadedSas
#endstruct

#defstruct global IPSEC_ESP_DROP_PACKET_STATISTICS0
    #field int invalidSpisOnInbound
    #field int decryptionFailuresOnInbound
    #field int authenticationFailuresOnInbound
    #field int replayCheckFailuresOnInbound
    #field int saNotInitializedOnInbound
#endstruct

#defstruct global IPSEC_AH_DROP_PACKET_STATISTICS0
    #field int invalidSpisOnInbound
    #field int authenticationFailuresOnInbound
    #field int replayCheckFailuresOnInbound
    #field int saNotInitializedOnInbound
#endstruct

#defstruct global IPSEC_AGGREGATE_DROP_PACKET_STATISTICS0
    #field int invalidSpisOnInbound
    #field int decryptionFailuresOnInbound
    #field int authenticationFailuresOnInbound
    #field int udpEspValidationFailuresOnInbound
    #field int replayCheckFailuresOnInbound
    #field int invalidClearTextInbound
    #field int saNotInitializedOnInbound
    #field int receiveOverIncorrectSaInbound
    #field int secureReceivesNotMatchingFilters
#endstruct

#defstruct global IPSEC_TRAFFIC_STATISTICS0
    #field int64 encryptedByteCount
    #field int64 authenticatedAHByteCount
    #field int64 authenticatedESPByteCount
    #field int64 transportByteCount
    #field int64 tunnelByteCount
    #field int64 offloadByteCount
#endstruct

#defstruct global IPSEC_STATISTICS0
    #field IPSEC_AGGREGATE_SA_STATISTICS0 aggregateSaStatistics
    #field IPSEC_ESP_DROP_PACKET_STATISTICS0 espDropPacketStatistics
    #field IPSEC_AH_DROP_PACKET_STATISTICS0 ahDropPacketStatistics
    #field IPSEC_AGGREGATE_DROP_PACKET_STATISTICS0 aggregateDropPacketStatistics
    #field IPSEC_TRAFFIC_STATISTICS0 inboundTrafficStatistics
    #field IPSEC_TRAFFIC_STATISTICS0 outboundTrafficStatistics
#endstruct

stdim st, IPSEC_STATISTICS0        ; NSTRUCT 変数を確保