Representation of the IPv4 header.
More...
#include <headers.hpp>
Representation of the IPv4 header.
Definition at line 65 of file headers.hpp.
◆ addrToStr()
static std::string Headers::IPv4::addrToStr |
( |
uint32_t |
addr | ) |
|
|
inlinestatic |
◆ calcChecksum()
void Headers::IPv4::calcChecksum |
( |
| ) |
|
|
inline |
Fill out the header checksum for this packet.
Definition at line 169 of file headers.hpp.
◆ flags()
uint16_t Headers::IPv4::flags |
( |
| ) |
const |
|
inline |
◆ fragmentation()
uint16_t Headers::IPv4::fragmentation |
( |
| ) |
const |
|
inline |
◆ getDstAddr()
std::string Headers::IPv4::getDstAddr |
( |
| ) |
|
|
inline |
◆ getDstIP()
uint32_t Headers::IPv4::getDstIP |
( |
| ) |
const |
|
inline |
Get the destination IP.
- Returns
- Destination IP in host byte order
Definition at line 144 of file headers.hpp.
◆ getLength()
uint16_t Headers::IPv4::getLength |
( |
| ) |
|
|
inline |
◆ getPayload()
void* Headers::IPv4::getPayload |
( |
| ) |
|
|
inline |
Get the SDU.
- Returns
- Pointer to the payload
Definition at line 149 of file headers.hpp.
◆ getPayloadLength()
uint16_t Headers::IPv4::getPayloadLength |
( |
| ) |
const |
|
inline |
Get the length of the L3-SDU.
- Returns
- The length of the payload (host byte order)
Definition at line 98 of file headers.hpp.
◆ getSrcAddr()
std::string Headers::IPv4::getSrcAddr |
( |
| ) |
|
|
inline |
◆ getSrcIP()
uint32_t Headers::IPv4::getSrcIP |
( |
| ) |
const |
|
inline |
Get the source IP.
- Returns
- Source IP in host byte order
Definition at line 139 of file headers.hpp.
◆ ihl()
uint8_t Headers::IPv4::ihl |
( |
| ) |
const |
|
inline |
◆ setDstIP()
void Headers::IPv4::setDstIP |
( |
uint32_t |
ip | ) |
|
|
inline |
Set the destination ip.
- Parameters
-
ip | Destination IP in host byte order |
Definition at line 134 of file headers.hpp.
◆ setIHL()
void Headers::IPv4::setIHL |
( |
uint8_t |
len | ) |
|
|
inline |
Sets the IP header length.
- Parameters
-
len | length as it will appear in the header |
Definition at line 81 of file headers.hpp.
◆ setLength()
void Headers::IPv4::setLength |
( |
uint16_t |
len | ) |
|
|
inline |
◆ setPayloadLength()
void Headers::IPv4::setPayloadLength |
( |
uint16_t |
len | ) |
|
|
inline |
Set the length of the L3-SDU.
- Parameters
-
len | of the L3-SDU (IP payload length) |
Definition at line 93 of file headers.hpp.
◆ setProtoICMP()
void Headers::IPv4::setProtoICMP |
( |
| ) |
|
|
inline |
◆ setProtoTCP()
void Headers::IPv4::setProtoTCP |
( |
| ) |
|
|
inline |
◆ setProtoUDP()
void Headers::IPv4::setProtoUDP |
( |
| ) |
|
|
inline |
◆ setSrcIP()
void Headers::IPv4::setSrcIP |
( |
uint32_t |
ip | ) |
|
|
inline |
Set the source ip.
- Parameters
-
ip | Source IP in host byte order |
Definition at line 129 of file headers.hpp.
◆ setVersion()
void Headers::IPv4::setVersion |
( |
| ) |
|
|
inline |
Set the version field to 4.
Definition at line 73 of file headers.hpp.
◆ version()
uint8_t Headers::IPv4::version |
( |
| ) |
const |
|
inline |
◆ checksum
uint16_t Headers::IPv4::checksum |
◆ dstIP
uint32_t Headers::IPv4::dstIP |
◆ flags_fragmentation
uint16_t Headers::IPv4::flags_fragmentation |
flags and fragmentation offset
Definition at line 101 of file headers.hpp.
◆ id
uint16_t Headers::IPv4::id |
◆ proto
uint8_t Headers::IPv4::proto |
◆ PROTO_ICMP
constexpr uint8_t Headers::IPv4::PROTO_ICMP = 1 |
|
static |
◆ PROTO_TCP
constexpr uint8_t Headers::IPv4::PROTO_TCP = 6 |
|
static |
◆ PROTO_UDP
constexpr uint8_t Headers::IPv4::PROTO_UDP = 17 |
|
static |
◆ srcIP
uint32_t Headers::IPv4::srcIP |
◆ tos
uint8_t Headers::IPv4::tos |
◆ total_length
uint16_t Headers::IPv4::total_length |
◆ ttl
uint8_t Headers::IPv4::ttl |
◆ version_ihl
uint8_t Headers::IPv4::version_ihl |
The documentation for this struct was generated from the following file: