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

MIB_IPMCAST_IF_ENTRY

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

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

フィールド

フィールドサイズx64x86説明
dwIfIndexDWORD4+0+0マルチキャスト対応インターフェースのインデックスを示す。
dwTtlDWORD4+4+4このインターフェースでのマルチキャストTTL閾値を示す。
dwProtocolDWORD4+8+8このインターフェースで動作するマルチキャストルーティングプロトコルを示す。
dwRateLimitDWORD4+12+12マルチキャストのレート制限値を示す。
ulInMcastOctetsDWORD4+16+16受信したマルチキャストオクテット(バイト)数を保持する。
ulOutMcastOctetsDWORD4+20+20送信したマルチキャストオクテット(バイト)数を保持する。

各言語での定義

#include <windows.h>

// MIB_IPMCAST_IF_ENTRY  (x64 24 / x86 24 バイト)
typedef struct MIB_IPMCAST_IF_ENTRY {
    DWORD dwIfIndex;
    DWORD dwTtl;
    DWORD dwProtocol;
    DWORD dwRateLimit;
    DWORD ulInMcastOctets;
    DWORD ulOutMcastOctets;
} MIB_IPMCAST_IF_ENTRY;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct MIB_IPMCAST_IF_ENTRY
{
    public uint dwIfIndex;
    public uint dwTtl;
    public uint dwProtocol;
    public uint dwRateLimit;
    public uint ulInMcastOctets;
    public uint ulOutMcastOctets;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure MIB_IPMCAST_IF_ENTRY
    Public dwIfIndex As UInteger
    Public dwTtl As UInteger
    Public dwProtocol As UInteger
    Public dwRateLimit As UInteger
    Public ulInMcastOctets As UInteger
    Public ulOutMcastOctets As UInteger
End Structure
import ctypes
from ctypes import wintypes

class MIB_IPMCAST_IF_ENTRY(ctypes.Structure):
    _fields_ = [
        ("dwIfIndex", wintypes.DWORD),
        ("dwTtl", wintypes.DWORD),
        ("dwProtocol", wintypes.DWORD),
        ("dwRateLimit", wintypes.DWORD),
        ("ulInMcastOctets", wintypes.DWORD),
        ("ulOutMcastOctets", wintypes.DWORD),
    ]
#[repr(C)]
pub struct MIB_IPMCAST_IF_ENTRY {
    pub dwIfIndex: u32,
    pub dwTtl: u32,
    pub dwProtocol: u32,
    pub dwRateLimit: u32,
    pub ulInMcastOctets: u32,
    pub ulOutMcastOctets: u32,
}
import "golang.org/x/sys/windows"

type MIB_IPMCAST_IF_ENTRY struct {
	dwIfIndex uint32
	dwTtl uint32
	dwProtocol uint32
	dwRateLimit uint32
	ulInMcastOctets uint32
	ulOutMcastOctets uint32
}
type
  MIB_IPMCAST_IF_ENTRY = record
    dwIfIndex: DWORD;
    dwTtl: DWORD;
    dwProtocol: DWORD;
    dwRateLimit: DWORD;
    ulInMcastOctets: DWORD;
    ulOutMcastOctets: DWORD;
  end;
const MIB_IPMCAST_IF_ENTRY = extern struct {
    dwIfIndex: u32,
    dwTtl: u32,
    dwProtocol: u32,
    dwRateLimit: u32,
    ulInMcastOctets: u32,
    ulOutMcastOctets: u32,
};
type
  MIB_IPMCAST_IF_ENTRY {.bycopy.} = object
    dwIfIndex: uint32
    dwTtl: uint32
    dwProtocol: uint32
    dwRateLimit: uint32
    ulInMcastOctets: uint32
    ulOutMcastOctets: uint32
struct MIB_IPMCAST_IF_ENTRY
{
    uint dwIfIndex;
    uint dwTtl;
    uint dwProtocol;
    uint dwRateLimit;
    uint ulInMcastOctets;
    uint ulOutMcastOctets;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; MIB_IPMCAST_IF_ENTRY サイズ: 24 バイト(x64)
dim st, 6    ; 4byte整数×6(構造体サイズ 24 / 4 切り上げ)
; dwIfIndex : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; dwTtl : DWORD (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; dwProtocol : DWORD (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; dwRateLimit : DWORD (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; ulInMcastOctets : DWORD (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; ulOutMcastOctets : DWORD (+20, 4byte)  st.5 = 値  /  値 = st.5   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global MIB_IPMCAST_IF_ENTRY
    #field int dwIfIndex
    #field int dwTtl
    #field int dwProtocol
    #field int dwRateLimit
    #field int ulInMcastOctets
    #field int ulOutMcastOctets
#endstruct

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