Win32 API 日本語リファレンス
ホームNetworking.WinSock › ATM_BLLI

ATM_BLLI

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

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

フィールド

フィールドサイズx64x86説明
Layer2ProtocolDWORD4+0+0レイヤー 2 プロトコルを識別します。B-LLI 情報要素の User information layer 2 protocol フィールドに対応します。SAP_FIELD_ABSENT はこのフィールドが使用されないことを示し、SAP_FIELD_ANY はワイルドカードを意味します。
Layer2UserSpecifiedProtocolDWORD4+4+4ユーザー指定のレイヤー 2 プロトコルを識別します。Layer2Protocol パラメーターが BLLI_L2_USER_SPECIFIED に設定されている場合にのみ使用されます。有効な値の範囲は 0 ~ 127 です。B-LLI 情報要素の User specified layer 2 protocol information フィールドに対応します。
Layer3ProtocolDWORD4+8+8レイヤー 3 プロトコルを識別します。B-LLI 情報要素の User information layer 3 protocol フィールドに対応します。SAP_FIELD_ABSENT はこのフィールドが使用されないことを示し、SAP_FIELD_ANY はワイルドカードを意味します。
Layer3UserSpecifiedProtocolDWORD4+12+12ユーザー指定のレイヤー 3 プロトコルを識別します。Layer3Protocol パラメーターが BLLI_L3_USER_SPECIFIED に設定されている場合にのみ使用されます。有効な値の範囲は 0 ~ 127 です。B-LLI 情報要素の User specified layer 3 protocol information フィールドに対応します。
Layer3IPIDWORD4+16+16レイヤー 3 の Initial Protocol Identifier を識別します。Layer3Protocol パラメーターが BLLI_L3_ISO_TR9577 に設定されている場合にのみ使用されます。B-LLI 情報要素の ISO/IEC TR 9577 Initial Protocol Identifier フィールドに対応します。
SnapIDBYTE5+20+20802.1 SNAP 識別子を識別します。Layer3Protocol パラメーターが BLLI_L3_ISO_TR9577 に設定され、かつ Layer3IPI が IEEE 802.1 SNAP 識別子を示す BLLI_L3_IPI_SNAP に設定されている場合にのみ使用されます。B-LLI 情報要素の OUI フィールドおよび PID フィールドに対応します。

公式ドキュメント

ATM_BLLI 構造体は、関連付けられた ATM ソケットの B-LLI 情報を識別するために使用されます。

解説(Remarks)

次に、 ATM_BLLI 構造体に関連付けられているマニフェスト定数を示します。

#include <windows.h>

/* 
 *  values used for Layer2Protocol in struct B-LLI
 */
#define BLLI_L2_ISO_1745           0x01   /* Basic mode ISO 1745    */
#define BLLI_L2_Q921               0x02   /* CCITT Rec. Q.921       */
#define BLLI_L2_X25L               0x06   /* CCITT Rec. X.25, link layer              */
#define BLLI_L2_X25M               0x07   /* CCITT Rec. X.25, multilink               */
#define BLLI_L2_ELAPB              0x08   /* Extended LAPB; for half duplex operation */
#define BLLI_L2_HDLC_NRM           0x09   /* HDLC NRM (ISO 4335)                      */
#define BLLI_L2_HDLC_ABM           0x0A   /* HDLC ABM (ISO 4335)                      */
#define BLLI_L2_HDLC_ARM           0x0B   /* HDLC ARM (ISO 4335)                      */
#define BLLI_L2_LLC                0x0C   /* LAN logical link control (ISO 8802/2)    */
#define BLLI_L2_X75                0x0D   /* CCITT Rec. X.75, single link procedure   */
#define BLLI_L2_Q922               0x0E   /* CCITT Rec. Q.922                         */
#define BLLI_L2_USER_SPECIFIED     0x10   /* User Specified                           */
#define BLLI_L2_ISO_7776           0x11   /* ISO 7776 DTE-DTE operation               */

/* 
 *  values used for Layer3Protocol in struct B-LLI
 */
#define BLLI_L3_X25                0x06   /* CCITT Rec. X.25, packet layer            */
#define BLLI_L3_ISO_8208           0x07   /* ISO/IEC 8208 (X.25 packet layer for DTE  */
#define BLLI_L3_X223               0x08   /* X.223/ISO 8878                           */
#define BLLI_L3_SIO_8473           0x09   /* ISO/IEC 8473 (OSI connectionless)        */
#define BLLI_L3_T70                0x0A   /* CCITT Rec. T.70 min. network layer       */
#define BLLI_L3_ISO_TR9577         0x0B   /* ISO/IEC TR 9577 Network Layer Protocol ID*/
#define BLLI_L3_USER_SPECIFIED     0x10   /* User Specified                           */

/* 
 *  values used for Layer3IPI in struct B-LLI
 */
#define BLLI_L3_IPI_SNAP           0x80   /* IEEE 802.1 SNAP identifier               */
#define BLLI_L3_IPI_IP             0xCC   /* Internet Protocol (IP) identifier        */
出典・ライセンス: 上記「公式ドキュメント」の内容は Microsoft の Win32 API ドキュメント(MicrosoftDocs/sdk-api)を日本語に翻訳・改変したものです。© Microsoft Corporation. CC BY 4.0 で提供。
Microsoft 公式リファレンス: 英語 (en-us) · 日本語 (ja-jp) · 原文ソース (GitHub)

各言語での定義

#include <windows.h>

// ATM_BLLI  (x64 28 / x86 28 バイト)
typedef struct ATM_BLLI {
    DWORD Layer2Protocol;
    DWORD Layer2UserSpecifiedProtocol;
    DWORD Layer3Protocol;
    DWORD Layer3UserSpecifiedProtocol;
    DWORD Layer3IPI;
    BYTE SnapID[5];
} ATM_BLLI;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct ATM_BLLI
{
    public uint Layer2Protocol;
    public uint Layer2UserSpecifiedProtocol;
    public uint Layer3Protocol;
    public uint Layer3UserSpecifiedProtocol;
    public uint Layer3IPI;
    [MarshalAs(UnmanagedType.ByValArray, SizeConst = 5)] public byte[] SnapID;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure ATM_BLLI
    Public Layer2Protocol As UInteger
    Public Layer2UserSpecifiedProtocol As UInteger
    Public Layer3Protocol As UInteger
    Public Layer3UserSpecifiedProtocol As UInteger
    Public Layer3IPI As UInteger
    <MarshalAs(UnmanagedType.ByValArray, SizeConst:=5)> Public SnapID() As Byte
End Structure
import ctypes
from ctypes import wintypes

class ATM_BLLI(ctypes.Structure):
    _fields_ = [
        ("Layer2Protocol", wintypes.DWORD),
        ("Layer2UserSpecifiedProtocol", wintypes.DWORD),
        ("Layer3Protocol", wintypes.DWORD),
        ("Layer3UserSpecifiedProtocol", wintypes.DWORD),
        ("Layer3IPI", wintypes.DWORD),
        ("SnapID", ctypes.c_ubyte * 5),
    ]
#[repr(C)]
pub struct ATM_BLLI {
    pub Layer2Protocol: u32,
    pub Layer2UserSpecifiedProtocol: u32,
    pub Layer3Protocol: u32,
    pub Layer3UserSpecifiedProtocol: u32,
    pub Layer3IPI: u32,
    pub SnapID: [u8; 5],
}
import "golang.org/x/sys/windows"

type ATM_BLLI struct {
	Layer2Protocol uint32
	Layer2UserSpecifiedProtocol uint32
	Layer3Protocol uint32
	Layer3UserSpecifiedProtocol uint32
	Layer3IPI uint32
	SnapID [5]byte
}
type
  ATM_BLLI = record
    Layer2Protocol: DWORD;
    Layer2UserSpecifiedProtocol: DWORD;
    Layer3Protocol: DWORD;
    Layer3UserSpecifiedProtocol: DWORD;
    Layer3IPI: DWORD;
    SnapID: array[0..4] of Byte;
  end;
const ATM_BLLI = extern struct {
    Layer2Protocol: u32,
    Layer2UserSpecifiedProtocol: u32,
    Layer3Protocol: u32,
    Layer3UserSpecifiedProtocol: u32,
    Layer3IPI: u32,
    SnapID: [5]u8,
};
type
  ATM_BLLI {.bycopy.} = object
    Layer2Protocol: uint32
    Layer2UserSpecifiedProtocol: uint32
    Layer3Protocol: uint32
    Layer3UserSpecifiedProtocol: uint32
    Layer3IPI: uint32
    SnapID: array[5, uint8]
struct ATM_BLLI
{
    uint Layer2Protocol;
    uint Layer2UserSpecifiedProtocol;
    uint Layer3Protocol;
    uint Layer3UserSpecifiedProtocol;
    uint Layer3IPI;
    ubyte[5] SnapID;
}

HSP用 定義

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

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

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