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

INTERFACE_HARDWARE_TIMESTAMP_CAPABILITIES

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

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

フィールド

フィールドサイズx64x86説明
PtpV2OverUdpIPv4EventMessageReceiveBOOLEAN1+0+0TRUE は、パケットの受信時に、NIC が IPv4 UDP パケットに含まれる PTP バージョン 2 のイベント メッセージをハードウェアで認識でき、そのパケットを受信した時刻に対応するタイムスタンプをハードウェアで生成できることを示します。FALSE の値は、ハードウェアがこの機能に対応していないことを示します。
PtpV2OverUdpIPv4AllMessageReceiveBOOLEAN1+1+1TRUE は、パケットの受信時に、NIC が IPv4 UDP パケットに含まれる任意の PTP バージョン 2 メッセージ (PTP イベント メッセージだけに限りません) をハードウェアで認識でき、そのパケットを受信した時刻に対応するタイムスタンプをハードウェアで生成できることを示します。FALSE の値は、ハードウェアがこの機能に対応していないことを示します。
PtpV2OverUdpIPv4EventMessageTransmitBOOLEAN1+2+2TRUE は、パケットの送信時に、NIC が IPv4 UDP パケットに含まれる PTP バージョン 2 のイベント メッセージをハードウェアで認識でき、そのパケットを送信した時刻に対応するタイムスタンプをハードウェアで生成できることを示します。FALSE の値は、ハードウェアがこの機能に対応していないことを示します。
PtpV2OverUdpIPv4AllMessageTransmitBOOLEAN1+3+3TRUE は、パケットの送信時に、NIC が IPv4 UDP パケットに含まれる任意の PTP バージョン 2 メッセージ (PTP イベント メッセージだけに限りません) をハードウェアで認識でき、そのパケットを送信した時刻に対応するタイムスタンプをハードウェアで生成できることを示します。FALSE の値は、ハードウェアがこの機能に対応していないことを示します。
PtpV2OverUdpIPv6EventMessageReceiveBOOLEAN1+4+4PtpV2OverUdpIPv4EventMsgReceiveHw と同じですが、IPv6 に適用される点が異なります。
PtpV2OverUdpIPv6AllMessageReceiveBOOLEAN1+5+5PtpV2OverUdpIPv4AllMsgReceiveHw と同じですが、IPv6 に適用される点が異なります。
PtpV2OverUdpIPv6EventMessageTransmitBOOLEAN1+6+6PtpV2OverUdpIPv4EventMsgTransmitHw と同じですが、IPv6 に適用される点が異なります。
PtpV2OverUdpIPv6AllMessageTransmitBOOLEAN1+7+7PtpV2OverUdpIPv4AllMsgTransmitHw と同じですが、IPv6 に適用される点が異なります。
AllReceiveBOOLEAN1+8+8TRUE は、NIC が受信したすべてのパケット (つまり PTP に限らないパケット) に対してハードウェア タイムスタンプを生成できることを示します。FALSE の値は、ハードウェアがこの機能に対応していないことを示します。
AllTransmitBOOLEAN1+9+9TRUE は、NIC が送信したすべてのパケット (つまり PTP に限らないパケット) に対してハードウェア タイムスタンプを生成できることを示します。FALSE の値は、ハードウェアがこの機能に対応していないことを示します。
TaggedTransmitBOOLEAN1+10+10TRUE は、アプリケーションから指示された場合に、NIC が送信対象の任意の特定のパケットについてハードウェア タイムスタンプを生成できることを示します。FALSE の値は、ハードウェアがこの機能に対応していないことを示します。 Windows ソケットを使用して UDP パケットを送信するときにタイムスタンプを要求する方法については、TIMESTAMPING_CONFIG (および TIMESTAMPING_FLAG_TX) を参照してください。

公式ドキュメント

ネットワーク インターフェイス カード (NIC) のハードウェアが持つタイムスタンプ機能を記述します。

詳細情報とコード例については、パケットのタイムスタンプを参照してください。

解説(Remarks)

INTERFACE_HARDWARE_TIMESTAMP_CAPABILITIES 構造体のすべてのメンバーは、ハードウェア タイムスタンプの機能を表します。ハードウェア タイムスタンプは、NIC のハードウェア クロックを使用して生成されます。

ハードウェア タイムスタンプとソフトウェア タイムスタンプの両方を同時に有効にすることはサポートされていません。

出典・ライセンス: 上記「公式ドキュメント」の内容は Microsoft の Win32 API ドキュメント(MicrosoftDocs/sdk-api)を日本語に翻訳・改変したものです。© Microsoft Corporation. CC BY 4.0 で提供。
Microsoft 公式リファレンス: 英語 (en-us) · 日本語 (ja-jp) · 原文ソース (GitHub)

各言語での定義

#include <windows.h>

// INTERFACE_HARDWARE_TIMESTAMP_CAPABILITIES  (x64 11 / x86 11 バイト)
typedef struct INTERFACE_HARDWARE_TIMESTAMP_CAPABILITIES {
    BOOLEAN PtpV2OverUdpIPv4EventMessageReceive;
    BOOLEAN PtpV2OverUdpIPv4AllMessageReceive;
    BOOLEAN PtpV2OverUdpIPv4EventMessageTransmit;
    BOOLEAN PtpV2OverUdpIPv4AllMessageTransmit;
    BOOLEAN PtpV2OverUdpIPv6EventMessageReceive;
    BOOLEAN PtpV2OverUdpIPv6AllMessageReceive;
    BOOLEAN PtpV2OverUdpIPv6EventMessageTransmit;
    BOOLEAN PtpV2OverUdpIPv6AllMessageTransmit;
    BOOLEAN AllReceive;
    BOOLEAN AllTransmit;
    BOOLEAN TaggedTransmit;
} INTERFACE_HARDWARE_TIMESTAMP_CAPABILITIES;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct INTERFACE_HARDWARE_TIMESTAMP_CAPABILITIES
{
    [MarshalAs(UnmanagedType.U1)] public bool PtpV2OverUdpIPv4EventMessageReceive;
    [MarshalAs(UnmanagedType.U1)] public bool PtpV2OverUdpIPv4AllMessageReceive;
    [MarshalAs(UnmanagedType.U1)] public bool PtpV2OverUdpIPv4EventMessageTransmit;
    [MarshalAs(UnmanagedType.U1)] public bool PtpV2OverUdpIPv4AllMessageTransmit;
    [MarshalAs(UnmanagedType.U1)] public bool PtpV2OverUdpIPv6EventMessageReceive;
    [MarshalAs(UnmanagedType.U1)] public bool PtpV2OverUdpIPv6AllMessageReceive;
    [MarshalAs(UnmanagedType.U1)] public bool PtpV2OverUdpIPv6EventMessageTransmit;
    [MarshalAs(UnmanagedType.U1)] public bool PtpV2OverUdpIPv6AllMessageTransmit;
    [MarshalAs(UnmanagedType.U1)] public bool AllReceive;
    [MarshalAs(UnmanagedType.U1)] public bool AllTransmit;
    [MarshalAs(UnmanagedType.U1)] public bool TaggedTransmit;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure INTERFACE_HARDWARE_TIMESTAMP_CAPABILITIES
    <MarshalAs(UnmanagedType.U1)> Public PtpV2OverUdpIPv4EventMessageReceive As Boolean
    <MarshalAs(UnmanagedType.U1)> Public PtpV2OverUdpIPv4AllMessageReceive As Boolean
    <MarshalAs(UnmanagedType.U1)> Public PtpV2OverUdpIPv4EventMessageTransmit As Boolean
    <MarshalAs(UnmanagedType.U1)> Public PtpV2OverUdpIPv4AllMessageTransmit As Boolean
    <MarshalAs(UnmanagedType.U1)> Public PtpV2OverUdpIPv6EventMessageReceive As Boolean
    <MarshalAs(UnmanagedType.U1)> Public PtpV2OverUdpIPv6AllMessageReceive As Boolean
    <MarshalAs(UnmanagedType.U1)> Public PtpV2OverUdpIPv6EventMessageTransmit As Boolean
    <MarshalAs(UnmanagedType.U1)> Public PtpV2OverUdpIPv6AllMessageTransmit As Boolean
    <MarshalAs(UnmanagedType.U1)> Public AllReceive As Boolean
    <MarshalAs(UnmanagedType.U1)> Public AllTransmit As Boolean
    <MarshalAs(UnmanagedType.U1)> Public TaggedTransmit As Boolean
End Structure
import ctypes
from ctypes import wintypes

class INTERFACE_HARDWARE_TIMESTAMP_CAPABILITIES(ctypes.Structure):
    _fields_ = [
        ("PtpV2OverUdpIPv4EventMessageReceive", ctypes.c_byte),
        ("PtpV2OverUdpIPv4AllMessageReceive", ctypes.c_byte),
        ("PtpV2OverUdpIPv4EventMessageTransmit", ctypes.c_byte),
        ("PtpV2OverUdpIPv4AllMessageTransmit", ctypes.c_byte),
        ("PtpV2OverUdpIPv6EventMessageReceive", ctypes.c_byte),
        ("PtpV2OverUdpIPv6AllMessageReceive", ctypes.c_byte),
        ("PtpV2OverUdpIPv6EventMessageTransmit", ctypes.c_byte),
        ("PtpV2OverUdpIPv6AllMessageTransmit", ctypes.c_byte),
        ("AllReceive", ctypes.c_byte),
        ("AllTransmit", ctypes.c_byte),
        ("TaggedTransmit", ctypes.c_byte),
    ]
#[repr(C)]
pub struct INTERFACE_HARDWARE_TIMESTAMP_CAPABILITIES {
    pub PtpV2OverUdpIPv4EventMessageReceive: u8,
    pub PtpV2OverUdpIPv4AllMessageReceive: u8,
    pub PtpV2OverUdpIPv4EventMessageTransmit: u8,
    pub PtpV2OverUdpIPv4AllMessageTransmit: u8,
    pub PtpV2OverUdpIPv6EventMessageReceive: u8,
    pub PtpV2OverUdpIPv6AllMessageReceive: u8,
    pub PtpV2OverUdpIPv6EventMessageTransmit: u8,
    pub PtpV2OverUdpIPv6AllMessageTransmit: u8,
    pub AllReceive: u8,
    pub AllTransmit: u8,
    pub TaggedTransmit: u8,
}
import "golang.org/x/sys/windows"

type INTERFACE_HARDWARE_TIMESTAMP_CAPABILITIES struct {
	PtpV2OverUdpIPv4EventMessageReceive byte
	PtpV2OverUdpIPv4AllMessageReceive byte
	PtpV2OverUdpIPv4EventMessageTransmit byte
	PtpV2OverUdpIPv4AllMessageTransmit byte
	PtpV2OverUdpIPv6EventMessageReceive byte
	PtpV2OverUdpIPv6AllMessageReceive byte
	PtpV2OverUdpIPv6EventMessageTransmit byte
	PtpV2OverUdpIPv6AllMessageTransmit byte
	AllReceive byte
	AllTransmit byte
	TaggedTransmit byte
}
type
  INTERFACE_HARDWARE_TIMESTAMP_CAPABILITIES = record
    PtpV2OverUdpIPv4EventMessageReceive: ByteBool;
    PtpV2OverUdpIPv4AllMessageReceive: ByteBool;
    PtpV2OverUdpIPv4EventMessageTransmit: ByteBool;
    PtpV2OverUdpIPv4AllMessageTransmit: ByteBool;
    PtpV2OverUdpIPv6EventMessageReceive: ByteBool;
    PtpV2OverUdpIPv6AllMessageReceive: ByteBool;
    PtpV2OverUdpIPv6EventMessageTransmit: ByteBool;
    PtpV2OverUdpIPv6AllMessageTransmit: ByteBool;
    AllReceive: ByteBool;
    AllTransmit: ByteBool;
    TaggedTransmit: ByteBool;
  end;
const INTERFACE_HARDWARE_TIMESTAMP_CAPABILITIES = extern struct {
    PtpV2OverUdpIPv4EventMessageReceive: u8,
    PtpV2OverUdpIPv4AllMessageReceive: u8,
    PtpV2OverUdpIPv4EventMessageTransmit: u8,
    PtpV2OverUdpIPv4AllMessageTransmit: u8,
    PtpV2OverUdpIPv6EventMessageReceive: u8,
    PtpV2OverUdpIPv6AllMessageReceive: u8,
    PtpV2OverUdpIPv6EventMessageTransmit: u8,
    PtpV2OverUdpIPv6AllMessageTransmit: u8,
    AllReceive: u8,
    AllTransmit: u8,
    TaggedTransmit: u8,
};
type
  INTERFACE_HARDWARE_TIMESTAMP_CAPABILITIES {.bycopy.} = object
    PtpV2OverUdpIPv4EventMessageReceive: uint8
    PtpV2OverUdpIPv4AllMessageReceive: uint8
    PtpV2OverUdpIPv4EventMessageTransmit: uint8
    PtpV2OverUdpIPv4AllMessageTransmit: uint8
    PtpV2OverUdpIPv6EventMessageReceive: uint8
    PtpV2OverUdpIPv6AllMessageReceive: uint8
    PtpV2OverUdpIPv6EventMessageTransmit: uint8
    PtpV2OverUdpIPv6AllMessageTransmit: uint8
    AllReceive: uint8
    AllTransmit: uint8
    TaggedTransmit: uint8
struct INTERFACE_HARDWARE_TIMESTAMP_CAPABILITIES
{
    ubyte PtpV2OverUdpIPv4EventMessageReceive;
    ubyte PtpV2OverUdpIPv4AllMessageReceive;
    ubyte PtpV2OverUdpIPv4EventMessageTransmit;
    ubyte PtpV2OverUdpIPv4AllMessageTransmit;
    ubyte PtpV2OverUdpIPv6EventMessageReceive;
    ubyte PtpV2OverUdpIPv6AllMessageReceive;
    ubyte PtpV2OverUdpIPv6EventMessageTransmit;
    ubyte PtpV2OverUdpIPv6AllMessageTransmit;
    ubyte AllReceive;
    ubyte AllTransmit;
    ubyte TaggedTransmit;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; INTERFACE_HARDWARE_TIMESTAMP_CAPABILITIES サイズ: 11 バイト(x64)
dim st, 3    ; 4byte整数×3(構造体サイズ 11 / 4 切り上げ)
; PtpV2OverUdpIPv4EventMessageReceive : BOOLEAN (+0, 1byte)  poke st,0,値  /  値 = peek(st,0)
; PtpV2OverUdpIPv4AllMessageReceive : BOOLEAN (+1, 1byte)  poke st,1,値  /  値 = peek(st,1)
; PtpV2OverUdpIPv4EventMessageTransmit : BOOLEAN (+2, 1byte)  poke st,2,値  /  値 = peek(st,2)
; PtpV2OverUdpIPv4AllMessageTransmit : BOOLEAN (+3, 1byte)  poke st,3,値  /  値 = peek(st,3)
; PtpV2OverUdpIPv6EventMessageReceive : BOOLEAN (+4, 1byte)  poke st,4,値  /  値 = peek(st,4)
; PtpV2OverUdpIPv6AllMessageReceive : BOOLEAN (+5, 1byte)  poke st,5,値  /  値 = peek(st,5)
; PtpV2OverUdpIPv6EventMessageTransmit : BOOLEAN (+6, 1byte)  poke st,6,値  /  値 = peek(st,6)
; PtpV2OverUdpIPv6AllMessageTransmit : BOOLEAN (+7, 1byte)  poke st,7,値  /  値 = peek(st,7)
; AllReceive : BOOLEAN (+8, 1byte)  poke st,8,値  /  値 = peek(st,8)
; AllTransmit : BOOLEAN (+9, 1byte)  poke st,9,値  /  値 = peek(st,9)
; TaggedTransmit : BOOLEAN (+10, 1byte)  poke st,10,値  /  値 = peek(st,10)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global INTERFACE_HARDWARE_TIMESTAMP_CAPABILITIES
    #field bool1 PtpV2OverUdpIPv4EventMessageReceive
    #field bool1 PtpV2OverUdpIPv4AllMessageReceive
    #field bool1 PtpV2OverUdpIPv4EventMessageTransmit
    #field bool1 PtpV2OverUdpIPv4AllMessageTransmit
    #field bool1 PtpV2OverUdpIPv6EventMessageReceive
    #field bool1 PtpV2OverUdpIPv6AllMessageReceive
    #field bool1 PtpV2OverUdpIPv6EventMessageTransmit
    #field bool1 PtpV2OverUdpIPv6AllMessageTransmit
    #field bool1 AllReceive
    #field bool1 AllTransmit
    #field bool1 TaggedTransmit
#endstruct

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