ホーム › NetworkManagement.IpHelper › MIB_PROXYARP
MIB_PROXYARP
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| dwAddress | DWORD | 4 | +0 | +0 | プロキシARPの対象となるIPv4アドレスである。 |
| dwMask | DWORD | 4 | +4 | +4 | 対象アドレスに適用するサブネットマスクである。 |
| dwIfIndex | DWORD | 4 | +8 | +8 | プロキシARPを実行するインタフェースのインデックスである。 |
各言語での定義
#include <windows.h>
// MIB_PROXYARP (x64 12 / x86 12 バイト)
typedef struct MIB_PROXYARP {
DWORD dwAddress;
DWORD dwMask;
DWORD dwIfIndex;
} MIB_PROXYARP;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct MIB_PROXYARP
{
public uint dwAddress;
public uint dwMask;
public uint dwIfIndex;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure MIB_PROXYARP
Public dwAddress As UInteger
Public dwMask As UInteger
Public dwIfIndex As UInteger
End Structureimport ctypes
from ctypes import wintypes
class MIB_PROXYARP(ctypes.Structure):
_fields_ = [
("dwAddress", wintypes.DWORD),
("dwMask", wintypes.DWORD),
("dwIfIndex", wintypes.DWORD),
]#[repr(C)]
pub struct MIB_PROXYARP {
pub dwAddress: u32,
pub dwMask: u32,
pub dwIfIndex: u32,
}import "golang.org/x/sys/windows"
type MIB_PROXYARP struct {
dwAddress uint32
dwMask uint32
dwIfIndex uint32
}type
MIB_PROXYARP = record
dwAddress: DWORD;
dwMask: DWORD;
dwIfIndex: DWORD;
end;const MIB_PROXYARP = extern struct {
dwAddress: u32,
dwMask: u32,
dwIfIndex: u32,
};type
MIB_PROXYARP {.bycopy.} = object
dwAddress: uint32
dwMask: uint32
dwIfIndex: uint32struct MIB_PROXYARP
{
uint dwAddress;
uint dwMask;
uint dwIfIndex;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; MIB_PROXYARP サイズ: 12 バイト(x64)
dim st, 3 ; 4byte整数×3(構造体サイズ 12 / 4 切り上げ)
; dwAddress : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; dwMask : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; dwIfIndex : DWORD (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global MIB_PROXYARP
#field int dwAddress
#field int dwMask
#field int dwIfIndex
#endstruct
stdim st, MIB_PROXYARP ; NSTRUCT 変数を確保
st->dwAddress = 100
mes "dwAddress=" + st->dwAddress