bmv2
Designing your own switch target with bmv2
|
Public Member Functions | |
void | packet_in (const Packet &packet) |
Signal that a packet was received by the switch. More... | |
void | packet_out (const Packet &packet) |
Signal that a packet was transmitted by the switch. More... | |
Signals significant packet event by publishing a message on a transport. This is meant to be used with the nanomsg PUB/SUB transport. Other processes can subscribe to the channel to monitor the activity of the switch (e.g. for logging). So far, we are mostly using this for the end-to-end testing of target switch implementations. Note that depending on the transport, some messages can be lost (the nanomsg PUB/SUB transport does not guarantee delivery to all subscribers, and message drops will happen if a subscriber is slower than the producer).
Most messages are generated by the bmv2 code, but the target is for now responsible of generated "packet in" and "packet out" messages (when a packet is received / transmitted). Obviously, this is optional and you do not have to do it if you are not interested in using the event logger.
void bm::EventLogger::packet_in | ( | const Packet & | packet | ) |
Signal that a packet was received by the switch.
void bm::EventLogger::packet_out | ( | const Packet & | packet | ) |
Signal that a packet was transmitted by the switch.