|
enum | Flags {
ECHO_REPLY = 0
, DEST_UNREACHABLE = 3
, SOURCE_QUENCH = 4
, REDIRECT = 5
,
ECHO_REQUEST = 8
, TIME_EXCEEDED = 11
, PARAM_PROBLEM = 12
, TIMESTAMP_REQUEST = 13
,
TIMESTAMP_REPLY = 14
, INFO_REQUEST = 15
, INFO_REPLY = 16
, ADDRESS_MASK_REQUEST = 17
,
ADDRESS_MASK_REPLY = 18
, EXTENDED_ECHO_REQUEST = 42
, EXTENDED_ECHO_REPLY = 43
} |
| ICMP flags.
|
|
typedef IPv4Address | address_type |
|
enum | endian_type { BE
, LE
} |
|
enum | PDUType {
RAW
, ETHERNET_II
, IEEE802_3
, DOT3 = IEEE802_3
,
RADIOTAP
, DOT11
, DOT11_ACK
, DOT11_ASSOC_REQ
,
DOT11_ASSOC_RESP
, DOT11_AUTH
, DOT11_BEACON
, DOT11_BLOCK_ACK
,
DOT11_BLOCK_ACK_REQ
, DOT11_CF_END
, DOT11_DATA
, DOT11_CONTROL
,
DOT11_DEAUTH
, DOT11_DIASSOC
, DOT11_END_CF_ACK
, DOT11_MANAGEMENT
,
DOT11_PROBE_REQ
, DOT11_PROBE_RESP
, DOT11_PS_POLL
, DOT11_REASSOC_REQ
,
DOT11_REASSOC_RESP
, DOT11_RTS
, DOT11_QOS_DATA
, LLC
,
SNAP
, IP
, ARP
, TCP
,
UDP
, ICMP
, BOOTP
, DHCP
,
EAPOL
, RC4EAPOL
, RSNEAPOL
, DNS
,
LOOPBACK
, IPv6
, ICMPv6
, SLL
,
DHCPv6
, DOT1AD
, DOT1Q
, PPPOE
,
STP
, PPI
, IPSEC_AH
, IPSEC_ESP
,
PKTAP
, MPLS
, DOT11_CONTROL_TA
, UNKNOWN = 999
,
USER_DEFINED_PDU = 1000
} |
| Enum which identifies each type of PDU. More...
|
|
typedef byte_array | serialization_type |
|
|
| ICMP (Flags flag=ECHO_REQUEST) |
| Creates an instance of ICMP. More...
|
|
| ICMP (const uint8_t *buffer, uint32_t total_sz) |
| Constructs an ICMP object from a buffer. More...
|
|
void | code (uint8_t new_code) |
| Sets the code field. More...
|
|
void | type (Flags type) |
| Sets the type field. More...
|
|
void | id (uint16_t new_id) |
| Setter for the id field. More...
|
|
void | sequence (uint16_t new_seq) |
| Setter for the sequence field. More...
|
|
void | gateway (address_type new_gw) |
| Setter for the gateway field. More...
|
|
void | mtu (uint16_t new_mtu) |
| Setter for the mtu field. More...
|
|
void | pointer (uint8_t new_pointer) |
| Setter for the pointer field. More...
|
|
void | original_timestamp (uint32_t new_timestamp) |
| Setter for the original timestamp field. More...
|
|
void | receive_timestamp (uint32_t new_timestamp) |
| Setter for the receive timestamp field. More...
|
|
void | transmit_timestamp (uint32_t new_timestamp) |
| Setter for the transmit timestamp field. More...
|
|
void | address_mask (address_type new_mask) |
| Setter for the address mask field. More...
|
|
void | set_echo_request (uint16_t id, uint16_t seq) |
| Sets echo request flag for this PDU. More...
|
|
void | set_echo_reply (uint16_t id, uint16_t seq) |
| Sets echo reply flag for this PDU. More...
|
|
void | set_info_request (uint16_t id, uint16_t seq) |
| Sets information request flag for this PDU. More...
|
|
void | set_info_reply (uint16_t id, uint16_t seq) |
| Sets information reply flag for this PDU. More...
|
|
void | set_dest_unreachable () |
| Sets destination unreachable for this PDU.
|
|
void | set_time_exceeded (bool ttl_exceeded=true) |
| Sets time exceeded flag for this PDU. More...
|
|
void | set_param_problem (bool set_pointer=false, uint8_t bad_octet=0) |
| Sets parameter problem flag for this PDU. More...
|
|
void | set_source_quench () |
| Sets source quench flag for this PDU.
|
|
void | set_redirect (uint8_t icode, address_type address) |
| Sets redirect flag for this PDU. More...
|
|
Flags | type () const |
| Getter for the ICMP type flag. More...
|
|
uint8_t | code () const |
| Getter for the ICMP code flag. More...
|
|
uint16_t | checksum () const |
| Getter for the checksum field. More...
|
|
uint16_t | id () const |
| Getter for the echo id. More...
|
|
uint16_t | sequence () const |
| Getter for the echo sequence number. More...
|
|
address_type | gateway () const |
| Getter for the gateway field. More...
|
|
uint8_t | pointer () const |
| Getter for the pointer field. More...
|
|
uint8_t | length () const |
| Getter for the length field. More...
|
|
uint16_t | mtu () const |
| Getter for the mtu field. More...
|
|
uint32_t | original_timestamp () const |
| Getter for the original timestamp field. More...
|
|
uint32_t | receive_timestamp () const |
| Getter for the receive timestamp field. More...
|
|
uint32_t | transmit_timestamp () const |
| Getter for the transmit timestamp field. More...
|
|
address_type | address_mask () const |
| Getter for the address mask field. More...
|
|
uint32_t | header_size () const |
| Returns the header size. More...
|
|
uint32_t | trailer_size () const |
| Returns the trailer size. More...
|
|
bool | matches_response (const uint8_t *ptr, uint32_t total_sz) const |
| Check whether ptr points to a valid response for this PDU. More...
|
|
const ICMPExtensionsStructure & | extensions () const |
| Getter for the extensions field. More...
|
|
ICMPExtensionsStructure & | extensions () |
| Getter for the extensions field. More...
|
|
bool | has_extensions () const |
| Indicates whether this object contains ICMP extensions.
|
|
void | use_length_field (bool value) |
| Sets whether the length field will be set for packets that use it. More...
|
|
PDUType | pdu_type () const |
| Getter for the PDU's type. More...
|
|
ICMP * | clone () const |
|
| PDU () |
| Default constructor.
|
|
| PDU (PDU &&rhs) TINS_NOEXCEPT |
| Move constructor. More...
|
|
PDU & | operator= (PDU &&rhs) TINS_NOEXCEPT |
| Move assignment operator. More...
|
|
virtual | ~PDU () |
| PDU destructor. More...
|
|
uint32_t | size () const |
| The whole chain of PDU's size, including this one. More...
|
|
virtual uint32_t | advertised_size () const |
| The whole chain of PDU's advertised size, including this one. More...
|
|
PDU * | inner_pdu () const |
| Getter for the inner PDU. More...
|
|
PDU * | parent_pdu () const |
|
PDU * | release_inner_pdu () |
| Releases the inner PDU. More...
|
|
void | inner_pdu (PDU *next_pdu) |
| Sets the child PDU. More...
|
|
void | inner_pdu (const PDU &next_pdu) |
| Sets the child PDU. More...
|
|
serialization_type | serialize () |
| Serializes the whole chain of PDU's, including this one. More...
|
|
template<typename T > |
T * | find_pdu (PDUType type=T::pdu_flag) |
| Finds and returns the first PDU that matches the given flag. More...
|
|
template<typename T > |
const T * | find_pdu (PDUType type=T::pdu_flag) const |
| Finds and returns the first PDU that matches the given flag. More...
|
|
template<typename T > |
T & | rfind_pdu (PDUType type=T::pdu_flag) |
| Finds and returns the first PDU that matches the given flag. More...
|
|
template<typename T > |
const T & | rfind_pdu (PDUType type=T::pdu_flag) const |
| Finds and returns the first PDU that matches the given flag. More...
|
|
virtual void | send (PacketSender &sender, const NetworkInterface &iface) |
| Send the stack of PDUs through a PacketSender. More...
|
|
virtual PDU * | recv_response (PacketSender &sender, const NetworkInterface &iface) |
| Receives a matching response for this packet. More...
|
|
virtual bool | matches_flag (PDUType flag) const |
| Check whether this PDU matches the specified flag. More...
|
|
Class that represents an ICMP PDU.
ICMP is the representation of the ICMP PDU. Instances of this class must be sent over a level 3 PDU, this will otherwise fail.