Parse an IPv4 packet. More...
#include <senf/Packets/DefaultBundle/IPv4Packet.hh>
Public Types | |
typedef UInt16Parser | length_t |
typedef UInt16Parser | identifier_t |
typedef UInt8Parser | ttl_t |
typedef UInt8Parser | protocol_t |
typedef UInt16Parser | checksum_t |
typedef INet4AddressParser | source_t |
typedef INet4AddressParser | destination_t |
Public Types inherited from senf::PacketParserBase | |
typedef detail::packet::iterator | data_iterator |
Raw data iterator type. More... | |
typedef detail::packet::size_type | size_type |
Unsigned integral type. More... | |
typedef detail::packet::difference_type | difference_type |
Signed integral type. More... | |
typedef detail::packet::byte | byte |
Unsigned 8bit value, the raw value type. More... | |
typedef PacketData * | state_type |
Type of the 'state' parameter. More... | |
typedef PacketParserBase | parser_base_type |
Base type of the next parser. More... | |
Public Member Functions | |
senf::UIntFieldParser<?,?+4 > | version () const |
senf::UIntFieldParser<?,?+4 > | ihl () const |
senf::UIntFieldParser<?,?+6 > | dscp () const |
senf::UIntFieldParser<?,?+2 > | ecn () const |
UInt16Parser | length () const |
UInt16Parser | identifier () const |
senf::FlagParser<?> | df () const |
senf::FlagParser<?> | mf () const |
senf::UIntFieldParser<?,?+13 > | frag () const |
UInt8Parser | ttl () const |
UInt8Parser | protocol () const |
UInt16Parser | checksum () const |
INet4AddressParser | source () const |
INet4AddressParser | destination () const |
void | init () |
boost::uint16_t | calcChecksum () const |
calculate header checksum More... | |
bool | validateChecksum () const |
validate header checksum More... | |
Public Member Functions inherited from senf::PacketParserBase | |
data_iterator | i () const |
Return beginning of data to parse. More... | |
data_iterator | i (size_type offset) const |
Return iterator offset bytes from the start. More... | |
state_type | state () const |
Return state of this parser. More... | |
PacketData & | data () const |
Access the packets raw data container. More... | |
void | init () const |
Default implementation. More... | |
Protected Member Functions | |
senf::FlagParser<?> | reserved () const |
Protected Member Functions inherited from senf::PacketParserBase | |
ParserProtector | protect () const |
PacketParserBase (data_iterator i, state_type s) | |
Standard constructor. More... | |
PacketParserBase (data_iterator i, state_type s, size_type size) | |
Size checking constructor. More... | |
bool | check (size_type size) const |
Check size of data container. More... | |
void | validate (size_type size) const |
Validate size of data container. More... | |
template<class Parser > | |
Parser | parse (data_iterator i) const |
Create sub-parser. More... | |
template<class Parser , class Arg > | |
Parser | parse (Arg const &arg, data_iterator i) const |
Create sub-parser. More... | |
template<class Parser > | |
Parser | parse (size_type n) const |
Create sub-parser. More... | |
template<class Parser , class Arg > | |
Parser | parse (Arg const &arg, size_type n) const |
Create sub-parser. More... | |
void | defaultInit () const |
Default implementation. More... | |
Packet | packet () const |
Get packet this parser is parsing from. More... | |
void | resize (size_type oldSize, size_type newSize) |
Resize data container. More... | |
Parse an IPv4 packet.
Parser implementing the IPv4 header.
Definition at line 52 of file IPv4Packet.hh.
Definition at line 73 of file IPv4Packet.hh.
Definition at line 75 of file IPv4Packet.hh.
Definition at line 64 of file IPv4Packet.hh.
Definition at line 63 of file IPv4Packet.hh.
Definition at line 72 of file IPv4Packet.hh.
Definition at line 74 of file IPv4Packet.hh.
Definition at line 71 of file IPv4Packet.hh.
boost::uint16_t senf::IPv4PacketParser::calcChecksum | ( | ) | const |
calculate header checksum
calculate and return the checksum of the header
Definition at line 37 of file IPv4Packet.cc.
UInt16Parser senf::IPv4PacketParser::checksum | ( | ) | const |
INet4AddressParser senf::IPv4PacketParser::destination | ( | ) | const |
senf::FlagParser<?> senf::IPv4PacketParser::df | ( | ) | const |
senf::UIntFieldParser<?,?+ 6 > senf::IPv4PacketParser::dscp | ( | ) | const |
senf::UIntFieldParser<?,?+ 2 > senf::IPv4PacketParser::ecn | ( | ) | const |
senf::UIntFieldParser<?,?+ 13 > senf::IPv4PacketParser::frag | ( | ) | const |
UInt16Parser senf::IPv4PacketParser::identifier | ( | ) | const |
senf::UIntFieldParser<?,?+ 4 > senf::IPv4PacketParser::ihl | ( | ) | const |
|
inline |
Definition at line 79 of file IPv4Packet.hh.
UInt16Parser senf::IPv4PacketParser::length | ( | ) | const |
senf::FlagParser<?> senf::IPv4PacketParser::mf | ( | ) | const |
UInt8Parser senf::IPv4PacketParser::protocol | ( | ) | const |
|
protected |
INet4AddressParser senf::IPv4PacketParser::source | ( | ) | const |
UInt8Parser senf::IPv4PacketParser::ttl | ( | ) | const |
|
inline |
validate header checksum
return true
if the checksum field is equal to the calculated checksum
Definition at line 89 of file IPv4Packet.hh.
senf::UIntFieldParser<?,?+ 4 > senf::IPv4PacketParser::version | ( | ) | const |