This class represents a parsed packet. It contains the raw data (
RawPacket
instance), and a linked list of layers, each layer is a parsed protocol that this packet contains. The layers linked list is ordered where the first layer is the lowest in the packet (currently it's always Ethernet protocol as PcapPlusPlus supports only Ethernet packets), the next layer will be L2.5 or L3 (e.g VLAN, IPv4, IPv6, etc.), and so on. etc.), etc. The last layer in the linked list will be the highest in the packet. For example: for a standard HTTP request packet the layer will look like this:
EthLayer
->
IPv4Layer
->
TcpLayer
->
HttpRequestLayer
Packet
instance isn't read only. The user can add or remove layers, update current layer, etc.
A constructor for creating a new packet. Very useful when creating packets. When using this constructor an empty raw buffer is allocated (with the size of maxPacketLen) and a new
RawPacket
is created