次の方法で共有


Hyper-V 拡張可能スイッチ転送コンテキスト データ型

The NET_BUFFER_LIST structure for each packet that traverses the Hyper-V extensible switch data path contains out-of-band (OOB) data. このデータは、パケットの送信元の送信元ポートと、パケット配信用の 1 つ以上の宛先ポートを指定します。 この OOB データは、 拡張可能スイッチ転送コンテキストと呼ばれます。

The following data types have been declared to access the extensible switch forwarding context within a packet's NET_BUFFER_LIST structure:

NDIS_SWITCH_FORWARDING_DETAIL_NET_BUFFER_LIST_INFO
これは、パケットの転送特性を含む 64 ビット共用体です。 このデータには、パケットの送信元の送信元ポートとネットワーク アダプター接続の識別子が含まれます。 このデータには、宛先ポート アレイで使用できる未使用の要素の数も含まれます。

The extensible switch extension can access this data by using the NET_BUFFER_LIST_SWITCH_FORWARDING_DETAIL macro.

NDIS_SWITCH_FORWARDING_DESTINATION_ARRAY
この構造体は、パケットの宛先ポート配列を定義します。 Each element in this array is formatted as an NDIS_SWITCH_PORT_DESTINATION structure.

The NDIS_SWITCH_FORWARDING_DESTINATION_ARRAY structure contains members that specify the current number of the total number of elements as well as the number of used elements in the array.

The extensible switch extension can obtain this array by calling the GetNetBufferListDestinations function. If the driver adds or modifies elements in the array for a packet with multiple destination ports, it must call the UpdateNetBufferListDestinations function. この関数は、パケットの転送コンテキストで宛先ポート配列にこれらの変更をコミットします。

Note To commit changes to a packet with only one destination port, it is more efficient for the driver to call the AddNetBufferListDestination function.

NDIS_SWITCH_PORT_DESTINATION
この構造体は、パケットの宛先ポートを定義します。 For packets with a single destination port, there is only one NDIS_SWITCH_PORT_DESTINATION element in the destination port array. 複数の宛先ポートを持つパケットの場合、配列にはこれらの要素が 1 つ以上存在します。

After the extensible switch extension has called GetNetBufferListDestinations to obtain the packet's destination port array, it can access individual elements in the array by using the NDIS_SWITCH_PORT_DESTINATION_AT_ARRAY_INDEX macro.