EtherRaw
Public Member Functions
PacketUDP Class Reference

Support for UDP Packet Headers. More...

#include <EtherRaw.h>

List of all members.

Public Member Functions

uint16_t sourcePort () const
uint16_t destPort () const
uint16_t length () const
uint16_t checksum () const
uint8_t * payload ()
uint16_t payload_length ()
size_t printTo (Print &p) const

Detailed Description

Support for UDP Packet Headers.

This class allows easy access to the contents of a UDP Packet in on-the-wire format.


Member Function Documentation

uint16_t PacketUDP::checksum ( ) const

Access the UDP checksum

Returns:
the checksum in native byte order.

Referenced by printTo().

uint16_t PacketUDP::destPort ( ) const

Access the destination port number

Returns:
The destination port number in native byte order.

Referenced by printTo().

uint16_t PacketUDP::length ( ) const

Access the packet length.

Returns:
The total packet length (including header and payload) in native byte order.

Referenced by payload_length(), and printTo().

uint8_t * PacketUDP::payload ( )

Access the packet payload

Returns:
A pointer to the TCP packet payload data
uint16_t PacketUDP::payload_length ( )

Access thepayload length

Returns:
the payload length in native byte order.

References length().

size_t PacketUDP::printTo ( Print &  p) const

Print. Prints an ASCII formatted version of the header to a Printable such as Serial.

Returns:
The number of characters printed

References checksum(), destPort(), length(), and sourcePort().

uint16_t PacketUDP::sourcePort ( ) const

Access the source port number

Returns:
The source port number in native byte order.

Referenced by printTo().


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