EtherRaw
Public Types | Public Member Functions
PacketTCP Class Reference

Support for TCP Packet Headers. More...

#include <EtherRaw.h>

List of all members.

Public Types

enum  TCPCode {
  URG = 0x20, ACK = 0x10, PSH = 0x08, RST = 0x04,
  SYN = 0x02, FIN = 0x01
}
 Masks for code bits returned by code()

Public Member Functions

uint16_t sourcePort () const
uint16_t destPort () const
uint32_t sequence () const
uint32_t acknowledgement () const
uint8_t headerlen () const
uint8_t code () const
uint16_t window () const
uint16_t checksum () const
uint16_t urgent () const
uint8_t * payload ()
size_t printTo (Print &p) const

Detailed Description

Support for TCP Packet Headers.

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


Member Function Documentation

uint32_t PacketTCP::acknowledgement ( ) const

Access the TCP acknowledgement number

Returns:
The TCP acknowledgement number in native byte order.

Referenced by printTo().

uint16_t PacketTCP::checksum ( ) const

Access the TCP checksum

Returns:
the checksum in native byte order.

Referenced by printTo().

uint8_t PacketTCP::code ( ) const

Access the packet code bits

Returns:
the code bits a mask of TCPCode
uint16_t PacketTCP::destPort ( ) const

Access the destination port number

Returns:
The destination port number in native byte order.

Referenced by printTo().

uint8_t PacketTCP::headerlen ( ) const

Access the header length

Returns:
The header length in 32bit words

Referenced by payload().

uint8_t * PacketTCP::payload ( )

Access the packet payload

Returns:
A pointer to the TCP packet payload data

References headerlen().

size_t PacketTCP::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 acknowledgement(), checksum(), destPort(), sequence(), sourcePort(), urgent(), and window().

uint32_t PacketTCP::sequence ( ) const

Access the TCP sequence number

Returns:
The TCP sequence number in native byte order.

Referenced by printTo().

uint16_t PacketTCP::sourcePort ( ) const

Access the source port number

Returns:
The source port number in native byte order.

Referenced by printTo().

uint16_t PacketTCP::urgent ( ) const

Access the TCP urgent pointer

Returns:
the urgent pointer in native byte order.

Referenced by printTo().

uint16_t PacketTCP::window ( ) const

Access the TCP window

Returns:
the window in native byte order.

Referenced by printTo().


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