ホーム › NetworkManagement.IpHelper › MIB_FL_VIRTUAL_INTERFACE_TABLE
MIB_FL_VIRTUAL_INTERFACE_TABLE
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| NumEntries | DWORD | 4 | +0 | +0 | Table配列に格納された仮想インタフェースエントリの数を示す。 |
| Table | MIB_FL_VIRTUAL_INTERFACE_ROW | 192 | +8 | +8 | 仮想インタフェース行(MIB_FL_VIRTUAL_INTERFACE_ROW)の可変長配列である。 |
各言語での定義
#include <windows.h>
// NET_LUID_LH (x64 8 / x86 8 バイト)
typedef struct NET_LUID_LH {
ULONGLONG Value;
_Info_e__Struct Info;
} NET_LUID_LH;
// MIB_FL_VIRTUAL_INTERFACE_ROW (x64 192 / x86 192 バイト)
typedef struct MIB_FL_VIRTUAL_INTERFACE_ROW {
ADDRESS_FAMILY Family;
NET_LUID_LH IfLuid;
DWORD VirtualIfId;
GUID CompartmentGuid;
NET_FL_ISOLATION_MODE IsolationMode;
NET_FL_VIRTUAL_INTERFACE_ORIGIN Origin;
NET_LUID_LH VirtualIfLuid;
DWORD VirtualIfIndex;
BOOLEAN AllowLocalNd;
DWORD AttachedFlsnpiClients;
DWORD FlsnpiClientConfigErrors;
ULONGLONG FlsnpiClientInjectErrors;
ULONGLONG FlsnpiClientCloneErrors;
ULONGLONG InFlsnpiIndicatedPackets;
ULONGLONG InFlsnpiClientReturnedPackets;
ULONGLONG InFlsnpiClientSilentlyDroppedPackets;
ULONGLONG InFlsnpiClientDroppedPackets;
ULONGLONG InFlsnpiClientInjectedPackets;
ULONGLONG InFlsnpiClientClonedPackets;
ULONGLONG OutFlsnpiIndicatedPackets;
ULONGLONG OutFlsnpiClientReturnedPackets;
ULONGLONG OutFlsnpiClientDroppedPackets;
ULONGLONG OutFlsnpiClientSilentlyDroppedPackets;
ULONGLONG OutFlsnpiClientInjectedPackets;
ULONGLONG OutFlsnpiClientClonedPackets;
ULONGLONG OutFlsnpiClientClonedPacketsForNbSplit;
} MIB_FL_VIRTUAL_INTERFACE_ROW;
// MIB_FL_VIRTUAL_INTERFACE_TABLE (x64 200 / x86 200 バイト)
typedef struct MIB_FL_VIRTUAL_INTERFACE_TABLE {
DWORD NumEntries;
MIB_FL_VIRTUAL_INTERFACE_ROW Table[1];
} MIB_FL_VIRTUAL_INTERFACE_TABLE;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct NET_LUID_LH
{
public ulong Value;
public _Info_e__Struct Info;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct MIB_FL_VIRTUAL_INTERFACE_ROW
{
public ushort Family;
public NET_LUID_LH IfLuid;
public uint VirtualIfId;
public Guid CompartmentGuid;
public int IsolationMode;
public int Origin;
public NET_LUID_LH VirtualIfLuid;
public uint VirtualIfIndex;
[MarshalAs(UnmanagedType.U1)] public bool AllowLocalNd;
public uint AttachedFlsnpiClients;
public uint FlsnpiClientConfigErrors;
public ulong FlsnpiClientInjectErrors;
public ulong FlsnpiClientCloneErrors;
public ulong InFlsnpiIndicatedPackets;
public ulong InFlsnpiClientReturnedPackets;
public ulong InFlsnpiClientSilentlyDroppedPackets;
public ulong InFlsnpiClientDroppedPackets;
public ulong InFlsnpiClientInjectedPackets;
public ulong InFlsnpiClientClonedPackets;
public ulong OutFlsnpiIndicatedPackets;
public ulong OutFlsnpiClientReturnedPackets;
public ulong OutFlsnpiClientDroppedPackets;
public ulong OutFlsnpiClientSilentlyDroppedPackets;
public ulong OutFlsnpiClientInjectedPackets;
public ulong OutFlsnpiClientClonedPackets;
public ulong OutFlsnpiClientClonedPacketsForNbSplit;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct MIB_FL_VIRTUAL_INTERFACE_TABLE
{
public uint NumEntries;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 1)] public MIB_FL_VIRTUAL_INTERFACE_ROW[] Table;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure NET_LUID_LH
Public Value As ULong
Public Info As _Info_e__Struct
End Structure
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure MIB_FL_VIRTUAL_INTERFACE_ROW
Public Family As UShort
Public IfLuid As NET_LUID_LH
Public VirtualIfId As UInteger
Public CompartmentGuid As Guid
Public IsolationMode As Integer
Public Origin As Integer
Public VirtualIfLuid As NET_LUID_LH
Public VirtualIfIndex As UInteger
<MarshalAs(UnmanagedType.U1)> Public AllowLocalNd As Boolean
Public AttachedFlsnpiClients As UInteger
Public FlsnpiClientConfigErrors As UInteger
Public FlsnpiClientInjectErrors As ULong
Public FlsnpiClientCloneErrors As ULong
Public InFlsnpiIndicatedPackets As ULong
Public InFlsnpiClientReturnedPackets As ULong
Public InFlsnpiClientSilentlyDroppedPackets As ULong
Public InFlsnpiClientDroppedPackets As ULong
Public InFlsnpiClientInjectedPackets As ULong
Public InFlsnpiClientClonedPackets As ULong
Public OutFlsnpiIndicatedPackets As ULong
Public OutFlsnpiClientReturnedPackets As ULong
Public OutFlsnpiClientDroppedPackets As ULong
Public OutFlsnpiClientSilentlyDroppedPackets As ULong
Public OutFlsnpiClientInjectedPackets As ULong
Public OutFlsnpiClientClonedPackets As ULong
Public OutFlsnpiClientClonedPacketsForNbSplit As ULong
End Structure
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure MIB_FL_VIRTUAL_INTERFACE_TABLE
Public NumEntries As UInteger
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=1)> Public Table() As MIB_FL_VIRTUAL_INTERFACE_ROW
End Structureimport ctypes
from ctypes import wintypes
class NET_LUID_LH(ctypes.Structure):
_fields_ = [
("Value", ctypes.c_ulonglong),
("Info", _Info_e__Struct),
]
class MIB_FL_VIRTUAL_INTERFACE_ROW(ctypes.Structure):
_fields_ = [
("Family", ctypes.c_ushort),
("IfLuid", NET_LUID_LH),
("VirtualIfId", wintypes.DWORD),
("CompartmentGuid", GUID),
("IsolationMode", ctypes.c_int),
("Origin", ctypes.c_int),
("VirtualIfLuid", NET_LUID_LH),
("VirtualIfIndex", wintypes.DWORD),
("AllowLocalNd", ctypes.c_byte),
("AttachedFlsnpiClients", wintypes.DWORD),
("FlsnpiClientConfigErrors", wintypes.DWORD),
("FlsnpiClientInjectErrors", ctypes.c_ulonglong),
("FlsnpiClientCloneErrors", ctypes.c_ulonglong),
("InFlsnpiIndicatedPackets", ctypes.c_ulonglong),
("InFlsnpiClientReturnedPackets", ctypes.c_ulonglong),
("InFlsnpiClientSilentlyDroppedPackets", ctypes.c_ulonglong),
("InFlsnpiClientDroppedPackets", ctypes.c_ulonglong),
("InFlsnpiClientInjectedPackets", ctypes.c_ulonglong),
("InFlsnpiClientClonedPackets", ctypes.c_ulonglong),
("OutFlsnpiIndicatedPackets", ctypes.c_ulonglong),
("OutFlsnpiClientReturnedPackets", ctypes.c_ulonglong),
("OutFlsnpiClientDroppedPackets", ctypes.c_ulonglong),
("OutFlsnpiClientSilentlyDroppedPackets", ctypes.c_ulonglong),
("OutFlsnpiClientInjectedPackets", ctypes.c_ulonglong),
("OutFlsnpiClientClonedPackets", ctypes.c_ulonglong),
("OutFlsnpiClientClonedPacketsForNbSplit", ctypes.c_ulonglong),
]
class MIB_FL_VIRTUAL_INTERFACE_TABLE(ctypes.Structure):
_fields_ = [
("NumEntries", wintypes.DWORD),
("Table", MIB_FL_VIRTUAL_INTERFACE_ROW * 1),
]#[repr(C)]
pub struct NET_LUID_LH {
pub Value: u64,
pub Info: _Info_e__Struct,
}
#[repr(C)]
pub struct MIB_FL_VIRTUAL_INTERFACE_ROW {
pub Family: u16,
pub IfLuid: NET_LUID_LH,
pub VirtualIfId: u32,
pub CompartmentGuid: GUID,
pub IsolationMode: i32,
pub Origin: i32,
pub VirtualIfLuid: NET_LUID_LH,
pub VirtualIfIndex: u32,
pub AllowLocalNd: u8,
pub AttachedFlsnpiClients: u32,
pub FlsnpiClientConfigErrors: u32,
pub FlsnpiClientInjectErrors: u64,
pub FlsnpiClientCloneErrors: u64,
pub InFlsnpiIndicatedPackets: u64,
pub InFlsnpiClientReturnedPackets: u64,
pub InFlsnpiClientSilentlyDroppedPackets: u64,
pub InFlsnpiClientDroppedPackets: u64,
pub InFlsnpiClientInjectedPackets: u64,
pub InFlsnpiClientClonedPackets: u64,
pub OutFlsnpiIndicatedPackets: u64,
pub OutFlsnpiClientReturnedPackets: u64,
pub OutFlsnpiClientDroppedPackets: u64,
pub OutFlsnpiClientSilentlyDroppedPackets: u64,
pub OutFlsnpiClientInjectedPackets: u64,
pub OutFlsnpiClientClonedPackets: u64,
pub OutFlsnpiClientClonedPacketsForNbSplit: u64,
}
#[repr(C)]
pub struct MIB_FL_VIRTUAL_INTERFACE_TABLE {
pub NumEntries: u32,
pub Table: [MIB_FL_VIRTUAL_INTERFACE_ROW; 1],
}import "golang.org/x/sys/windows"
type NET_LUID_LH struct {
Value uint64
Info _Info_e__Struct
}
type MIB_FL_VIRTUAL_INTERFACE_ROW struct {
Family uint16
IfLuid NET_LUID_LH
VirtualIfId uint32
CompartmentGuid windows.GUID
IsolationMode int32
Origin int32
VirtualIfLuid NET_LUID_LH
VirtualIfIndex uint32
AllowLocalNd byte
AttachedFlsnpiClients uint32
FlsnpiClientConfigErrors uint32
FlsnpiClientInjectErrors uint64
FlsnpiClientCloneErrors uint64
InFlsnpiIndicatedPackets uint64
InFlsnpiClientReturnedPackets uint64
InFlsnpiClientSilentlyDroppedPackets uint64
InFlsnpiClientDroppedPackets uint64
InFlsnpiClientInjectedPackets uint64
InFlsnpiClientClonedPackets uint64
OutFlsnpiIndicatedPackets uint64
OutFlsnpiClientReturnedPackets uint64
OutFlsnpiClientDroppedPackets uint64
OutFlsnpiClientSilentlyDroppedPackets uint64
OutFlsnpiClientInjectedPackets uint64
OutFlsnpiClientClonedPackets uint64
OutFlsnpiClientClonedPacketsForNbSplit uint64
}
type MIB_FL_VIRTUAL_INTERFACE_TABLE struct {
NumEntries uint32
Table [1]MIB_FL_VIRTUAL_INTERFACE_ROW
}type
NET_LUID_LH = record
Value: UInt64;
Info: _Info_e__Struct;
end;
MIB_FL_VIRTUAL_INTERFACE_ROW = record
Family: Word;
IfLuid: NET_LUID_LH;
VirtualIfId: DWORD;
CompartmentGuid: TGUID;
IsolationMode: Integer;
Origin: Integer;
VirtualIfLuid: NET_LUID_LH;
VirtualIfIndex: DWORD;
AllowLocalNd: ByteBool;
AttachedFlsnpiClients: DWORD;
FlsnpiClientConfigErrors: DWORD;
FlsnpiClientInjectErrors: UInt64;
FlsnpiClientCloneErrors: UInt64;
InFlsnpiIndicatedPackets: UInt64;
InFlsnpiClientReturnedPackets: UInt64;
InFlsnpiClientSilentlyDroppedPackets: UInt64;
InFlsnpiClientDroppedPackets: UInt64;
InFlsnpiClientInjectedPackets: UInt64;
InFlsnpiClientClonedPackets: UInt64;
OutFlsnpiIndicatedPackets: UInt64;
OutFlsnpiClientReturnedPackets: UInt64;
OutFlsnpiClientDroppedPackets: UInt64;
OutFlsnpiClientSilentlyDroppedPackets: UInt64;
OutFlsnpiClientInjectedPackets: UInt64;
OutFlsnpiClientClonedPackets: UInt64;
OutFlsnpiClientClonedPacketsForNbSplit: UInt64;
end;
MIB_FL_VIRTUAL_INTERFACE_TABLE = record
NumEntries: DWORD;
Table: array[0..0] of MIB_FL_VIRTUAL_INTERFACE_ROW;
end;const NET_LUID_LH = extern struct {
Value: u64,
Info: _Info_e__Struct,
};
const MIB_FL_VIRTUAL_INTERFACE_ROW = extern struct {
Family: u16,
IfLuid: NET_LUID_LH,
VirtualIfId: u32,
CompartmentGuid: GUID,
IsolationMode: i32,
Origin: i32,
VirtualIfLuid: NET_LUID_LH,
VirtualIfIndex: u32,
AllowLocalNd: u8,
AttachedFlsnpiClients: u32,
FlsnpiClientConfigErrors: u32,
FlsnpiClientInjectErrors: u64,
FlsnpiClientCloneErrors: u64,
InFlsnpiIndicatedPackets: u64,
InFlsnpiClientReturnedPackets: u64,
InFlsnpiClientSilentlyDroppedPackets: u64,
InFlsnpiClientDroppedPackets: u64,
InFlsnpiClientInjectedPackets: u64,
InFlsnpiClientClonedPackets: u64,
OutFlsnpiIndicatedPackets: u64,
OutFlsnpiClientReturnedPackets: u64,
OutFlsnpiClientDroppedPackets: u64,
OutFlsnpiClientSilentlyDroppedPackets: u64,
OutFlsnpiClientInjectedPackets: u64,
OutFlsnpiClientClonedPackets: u64,
OutFlsnpiClientClonedPacketsForNbSplit: u64,
};
const MIB_FL_VIRTUAL_INTERFACE_TABLE = extern struct {
NumEntries: u32,
Table: [1]MIB_FL_VIRTUAL_INTERFACE_ROW,
};type
NET_LUID_LH {.bycopy.} = object
Value: uint64
Info: _Info_e__Struct
MIB_FL_VIRTUAL_INTERFACE_ROW {.bycopy.} = object
Family: uint16
IfLuid: NET_LUID_LH
VirtualIfId: uint32
CompartmentGuid: GUID
IsolationMode: int32
Origin: int32
VirtualIfLuid: NET_LUID_LH
VirtualIfIndex: uint32
AllowLocalNd: uint8
AttachedFlsnpiClients: uint32
FlsnpiClientConfigErrors: uint32
FlsnpiClientInjectErrors: uint64
FlsnpiClientCloneErrors: uint64
InFlsnpiIndicatedPackets: uint64
InFlsnpiClientReturnedPackets: uint64
InFlsnpiClientSilentlyDroppedPackets: uint64
InFlsnpiClientDroppedPackets: uint64
InFlsnpiClientInjectedPackets: uint64
InFlsnpiClientClonedPackets: uint64
OutFlsnpiIndicatedPackets: uint64
OutFlsnpiClientReturnedPackets: uint64
OutFlsnpiClientDroppedPackets: uint64
OutFlsnpiClientSilentlyDroppedPackets: uint64
OutFlsnpiClientInjectedPackets: uint64
OutFlsnpiClientClonedPackets: uint64
OutFlsnpiClientClonedPacketsForNbSplit: uint64
MIB_FL_VIRTUAL_INTERFACE_TABLE {.bycopy.} = object
NumEntries: uint32
Table: array[1, MIB_FL_VIRTUAL_INTERFACE_ROW]struct NET_LUID_LH
{
ulong Value;
_Info_e__Struct Info;
}
struct MIB_FL_VIRTUAL_INTERFACE_ROW
{
ushort Family;
NET_LUID_LH IfLuid;
uint VirtualIfId;
GUID CompartmentGuid;
int IsolationMode;
int Origin;
NET_LUID_LH VirtualIfLuid;
uint VirtualIfIndex;
ubyte AllowLocalNd;
uint AttachedFlsnpiClients;
uint FlsnpiClientConfigErrors;
ulong FlsnpiClientInjectErrors;
ulong FlsnpiClientCloneErrors;
ulong InFlsnpiIndicatedPackets;
ulong InFlsnpiClientReturnedPackets;
ulong InFlsnpiClientSilentlyDroppedPackets;
ulong InFlsnpiClientDroppedPackets;
ulong InFlsnpiClientInjectedPackets;
ulong InFlsnpiClientClonedPackets;
ulong OutFlsnpiIndicatedPackets;
ulong OutFlsnpiClientReturnedPackets;
ulong OutFlsnpiClientDroppedPackets;
ulong OutFlsnpiClientSilentlyDroppedPackets;
ulong OutFlsnpiClientInjectedPackets;
ulong OutFlsnpiClientClonedPackets;
ulong OutFlsnpiClientClonedPacketsForNbSplit;
}
struct MIB_FL_VIRTUAL_INTERFACE_TABLE
{
uint NumEntries;
MIB_FL_VIRTUAL_INTERFACE_ROW[1] Table;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; MIB_FL_VIRTUAL_INTERFACE_TABLE サイズ: 200 バイト(x64)
dim st, 50 ; 4byte整数×50(構造体サイズ 200 / 4 切り上げ)
; NumEntries : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; Table : MIB_FL_VIRTUAL_INTERFACE_ROW (+8, 192byte) varptr(st)+8 を基点に操作(192byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global GUID, pack=1
#field int Data1
#field short Data2
#field short Data3
#field byte Data4 8
#endstruct
#defstruct global MIB_FL_VIRTUAL_INTERFACE_ROW
#field short Family
#field byte IfLuid 8
#field int VirtualIfId
#field GUID CompartmentGuid
#field int IsolationMode
#field int Origin
#field byte VirtualIfLuid 8
#field int VirtualIfIndex
#field bool1 AllowLocalNd
#field int AttachedFlsnpiClients
#field int FlsnpiClientConfigErrors
#field int64 FlsnpiClientInjectErrors
#field int64 FlsnpiClientCloneErrors
#field int64 InFlsnpiIndicatedPackets
#field int64 InFlsnpiClientReturnedPackets
#field int64 InFlsnpiClientSilentlyDroppedPackets
#field int64 InFlsnpiClientDroppedPackets
#field int64 InFlsnpiClientInjectedPackets
#field int64 InFlsnpiClientClonedPackets
#field int64 OutFlsnpiIndicatedPackets
#field int64 OutFlsnpiClientReturnedPackets
#field int64 OutFlsnpiClientDroppedPackets
#field int64 OutFlsnpiClientSilentlyDroppedPackets
#field int64 OutFlsnpiClientInjectedPackets
#field int64 OutFlsnpiClientClonedPackets
#field int64 OutFlsnpiClientClonedPacketsForNbSplit
#endstruct
#defstruct global MIB_FL_VIRTUAL_INTERFACE_TABLE
#field int NumEntries
#field MIB_FL_VIRTUAL_INTERFACE_ROW Table 1
#endstruct
stdim st, MIB_FL_VIRTUAL_INTERFACE_TABLE ; NSTRUCT 変数を確保
st->NumEntries = 100
mes "NumEntries=" + st->NumEntries