|
1. Add a macro to obtain Packet’s encapsulation information (the returned data is an immutable reference to Packet)
* get_innermost_special_encapsulation!()
* get_outermost_special_encapsulation!()
Example: let icmp_encapsulation : Option<&Encapsulation> = get_innermost_special_encapsulation!(&Packet, ICMP);
Example: let l4_encapsulation : Option<&Encapsulation> = get_innermost_special_encapsulation!(&Packet, TCP | UDP);
2. Clean up the Clone/Copy Trait of PacketDecode to avoid memory copies caused by improper use by users.
|