EtherRaw
|
Support for IP PAcket Headers. More...
#include <EtherRaw.h>
Public Types | |
enum | IPProto { IPPROTO_IP = 0, IPPROTO_HOPOPTS = 0, IPPROTO_ICMP = 1, IPPROTO_IGMP = 2, IPPROTO_IPIP = 4, IPPROTO_TCP = 6, IPPROTO_EGP = 8, IPPROTO_PUP = 12, IPPROTO_UDP = 17, IPPROTO_IDP = 22, IPPROTO_TP = 29, IPPROTO_DCCP = 33, IPPROTO_IPV6 = 41, IPPROTO_ROUTING = 43, IPPROTO_FRAGMENT = 44, IPPROTO_RSVP = 46, IPPROTO_GRE = 47, IPPROTO_ESP = 50, IPPROTO_AH = 51, IPPROTO_ICMPV6 = 58, IPPROTO_NONE = 59, IPPROTO_DSTOPTS = 60, IPPROTO_MTP = 92, IPPROTO_ENCAP = 98, IPPROTO_PIM = 103, IPPROTO_COMP = 108, IPPROTO_SCTP = 132, IPPROTO_UDPLITE = 136, IPPROTO_RAW = 255, IPPROTO_MAX } |
Definitions of protocol number for protocol() More... |
Public Member Functions | |
uint8_t | version () const |
uint8_t | headerlen () const |
uint8_t | service () const |
uint8_t | precedence () const |
uint16_t | length () const |
uint16_t | id () const |
uint8_t | flags () const |
uint16_t | offset () const |
uint8_t | ttl () const |
uint8_t | protocol () const |
const IPv4Address & | source () const |
const IPv4Address & | dest () const |
uint16_t | checksum () const |
uint8_t * | payload () |
size_t | printTo (Print &p) const |
Support for IP PAcket Headers.
This class allows easy access to the contents of an IP Packet Header in on-the-wire format.
enum PacketIPv4::IPProto |
Definitions of protocol number for protocol()
uint16_t PacketIPv4::checksum | ( | ) | const |
Access the packet checksum return the checksum in native byte order.
Referenced by printTo().
const IPv4Address & PacketIPv4::dest | ( | ) | const |
Access the destination IP address
uint8_t PacketIPv4::flags | ( | ) | const |
Access the packet flags
uint8_t PacketIPv4::headerlen | ( | ) | const |
uint16_t PacketIPv4::id | ( | ) | const |
Access the packet ID.
uint16_t PacketIPv4::length | ( | ) | const |
Access the packet length
Referenced by printTo().
uint16_t PacketIPv4::offset | ( | ) | const |
Access the packet fragment offset
uint8_t * PacketIPv4::payload | ( | ) |
uint8_t PacketIPv4::precedence | ( | ) | const |
Access the packet precendence.
size_t PacketIPv4::printTo | ( | Print & | p | ) | const |
Print. Prints an ASCII formatted version of the header to a Printable such as Serial.
References checksum(), length(), protocol(), service(), and ttl().
uint8_t PacketIPv4::protocol | ( | ) | const |
uint8_t PacketIPv4::service | ( | ) | const |
Access the service type (also called TOS).
Referenced by printTo().
const IPv4Address & PacketIPv4::source | ( | ) | const |
Access the source IP address
uint8_t PacketIPv4::ttl | ( | ) | const |
uint8_t PacketIPv4::version | ( | ) | const |
Access the packet header version.