senf::UDPPacketParser Struct Reference

Parse a UDP packet. More...

#include <senf/Packets/DefaultBundle/UDPPacket.hh>

Inheritance diagram for senf::UDPPacketParser:
Inheritance graph
[legend]

List of all members.


Detailed Description

Parse a UDP packet.

Parser implementing the UDP header. The fields implemented are:

UDPPacket.png
See also:
UDPPacketType
RFC 768

Definition at line 45 of file UDPPacket.hh.


Public Types

typedef senf::UInt16Parser  source_t
typedef senf::UInt16Parser  destination_t
typedef senf::UInt16Parser  length_t
typedef senf::UInt16Parser  checksum_t

Public Member Functions

senf::UInt16Parser  source () const
senf::UInt16Parser  destination () const
senf::UInt16Parser  length () const
senf::UInt16Parser  checksum () const
boost::uint16_t  calcChecksum () const
  calculate (pseudo-)header checksum
bool  validateChecksum () const
  validate header checksum

Member Typedef Documentation

typedef senf::UInt16Parser senf::UDPPacketParser::
checksum_t

Definition at line 52 of file UDPPacket.hh.

typedef senf::UInt16Parser senf::UDPPacketParser::
destination_t

Definition at line 50 of file UDPPacket.hh.

typedef senf::UInt16Parser senf::UDPPacketParser::
length_t

Definition at line 51 of file UDPPacket.hh.

typedef senf::UInt16Parser senf::UDPPacketParser::
source_t

Definition at line 49 of file UDPPacket.hh.


Member Function Documentation

boost::uint16_t senf::UDPPacketParser::
calcChecksum ()

calculate (pseudo-)header checksum

calculate and return the checksum of the (pseudo-)header

See also:
senf::IpChecksum
Fix:
What about a hop-by-hop routing option? Which destination is used in IPv4 ?
Fix:
May there be another header between the IPv4 header and UDP? if so, we need to hack the correct protocol number here ...
Todo:
Implement routing header support

Definition at line 45 of file UDPPacket.cc.

senf::UInt16Parser senf::UDPPacketParser::
checksum ()

senf::UInt16Parser senf::UDPPacketParser::
destination ()

senf::UInt16Parser senf::UDPPacketParser::
length ()

senf::UInt16Parser senf::UDPPacketParser::
source ()

bool senf::UDPPacketParser::
validateChecksum ()

validate header checksum

return true if the checksum field is equal to the calculated checksum

Definition at line 59 of file UDPPacket.hh.


The documentation for this struct was generated from the following files: