typedef void (*ethernet_link_snoop_t)(lang_void *user_data, conf_object_t *clock, const frags_t *packet, eth_frame_crc_status_t crc_status);
SIM_INTERFACE(ethernet_vlan_snoop) { conf_object_t *(*attach)( conf_object_t *NOTNULL link, conf_object_t *clock, ethernet_link_snoop_t snoop_fun, lang_void *user_data, uint16 vlan_id, bool is_vlan_trunk); }; #define ETHERNET_VLAN_SNOOP_INTERFACE "ethernet_vlan_snoop"
This interface is implemented by Ethernet VLAN switch link objects. It is used to attach snoop functions to the link. The snoop function will receive all traffic going over the link, either on a single VLAN, or on all of them.
This interface should only be used for inspection, and never as part of the actual simulation. The snoop functions must not affect the simulation in any way.
The clock parameter tells the link on which clock to post the events that call the snoop function. The snoop function will be called at the delivery time of the network packet, which means that it will be called at the same time as any Ethernet devices attached to the same clock that receives packets from the same link.
Snooped frames with a matching CRC will contain the correct frame check sequence.
The user_data parameter is passed to the snoop function every time it is called.
The vlan_id indicates on which VLAN the snoop function should be attached (as its native VLAN).
The is_vlan_trunk flag indicates whether the snoop function should also receive the traffic on all other VLANs, tagged with an 802.1Q tag.
attach | Global Context |