This class provides several methods that can be used by elements that inherits from it in order to manage IP packets.
More...
#include <iphelper.hh>
This class provides several methods that can be used by elements that inherits from it in order to manage IP packets.
◆ packetTotalLength()
| uint16_t IPHelper::packetTotalLength |
( |
Packet * |
packet | ) |
const |
|
inline |
Return the length of the IP packet, obtained from the header.
- Parameters
-
- Returns
- The length of the given IP packet, obtained from the IP header
◆ getIPHeaderOffset()
| uint16_t IPHelper::getIPHeaderOffset |
( |
Packet * |
packet | ) |
const |
|
inline |
Return the offset in the packet at which the IP header starts.
- Parameters
-
- Returns
- The offset in the packet at which the IP header starts
◆ setPacketTotalLength()
| void IPHelper::setPacketTotalLength |
( |
WritablePacket * |
packet, |
|
|
unsigned |
length |
|
) |
| const |
|
inline |
Set the length of the IP packet in the header.
- Parameters
-
| packet | The IP packet |
| length | The new length of the given IP packet |
◆ getDestinationAddress()
| uint32_t IPHelper::getDestinationAddress |
( |
Packet * |
packet | ) |
const |
|
inline |
Return the IP destination address of the packet.
- Parameters
-
- Returns
- The IP destination address of the packet
◆ getSourceAddress()
| uint32_t IPHelper::getSourceAddress |
( |
Packet * |
packet | ) |
const |
|
inline |
Return the IP source address of the packet.
- Parameters
-
- Returns
- The IP source address of the packet
◆ computeIPChecksum()
Recompute the IP checksum of the packet and set it in the IP header.
- Parameters
-
◆ rewrite_ipport()
Rewrite the src or dst IP address and src or dst port of the packet.
The documentation for this class was generated from the following file: