Click
Loading...
Searching...
No Matches
Public Member Functions | List of all members
IPElement Class Reference

This class provides several methods that can be used by elements that inherits from it in order to manage IP packets. More...

#include <ipelement.hh>

Public Member Functions

uint16_t packetTotalLength (Packet *packet) const
 Return the length of the IP packet, obtained from the header.
 
uint16_t getIPHeaderOffset (Packet *packet) const
 Return the offset in the packet at which the IP header starts.
 
void setPacketTotalLength (WritablePacket *packet, unsigned length) const
 Set the length of the IP packet in the header.
 
const uint32_t getDestinationAddress (Packet *packet) const
 Return the IP destination address of the packet.
 
const uint32_t getSourceAddress (Packet *packet) const
 Return the IP source address of the packet.
 
void computeIPChecksum (WritablePacket *packet) const
 Recompute the IP checksum of the packet and set it in the IP header.
 

Detailed Description

This class provides several methods that can be used by elements that inherits from it in order to manage IP packets.

Member Function Documentation

◆ packetTotalLength()

uint16_t IPElement::packetTotalLength ( Packet *  packet) const
inline

Return the length of the IP packet, obtained from the header.

Parameters
packetThe IP packet
Returns
The length of the given IP packet, obtained from the IP header

◆ getIPHeaderOffset()

uint16_t IPElement::getIPHeaderOffset ( Packet *  packet) const
inline

Return the offset in the packet at which the IP header starts.

Parameters
packetThe IP packet
Returns
The offset in the packet at which the IP header starts

◆ setPacketTotalLength()

void IPElement::setPacketTotalLength ( WritablePacket *  packet,
unsigned  length 
) const
inline

Set the length of the IP packet in the header.

Parameters
packetThe IP packet
lengthThe new length of the given IP packet

◆ getDestinationAddress()

const uint32_t IPElement::getDestinationAddress ( Packet *  packet) const
inline

Return the IP destination address of the packet.

Parameters
packetThe IP packet
Returns
The IP destination address of the packet

◆ getSourceAddress()

const uint32_t IPElement::getSourceAddress ( Packet *  packet) const
inline

Return the IP source address of the packet.

Parameters
packetThe IP packet
Returns
The IP source address of the packet

◆ computeIPChecksum()

void IPElement::computeIPChecksum ( WritablePacket *  packet) const
inline

Recompute the IP checksum of the packet and set it in the IP header.

Parameters
packetThe IP packet

The documentation for this class was generated from the following file: