libtins  4.0
Classes | Public Types | Public Member Functions | Static Public Attributes | List of all members
Tins::ICMPv6 Class Reference

Represents an ICMPv6 PDU. More...

#include <icmpv6.h>

Inheritance diagram for Tins::ICMPv6:
Tins::PDU

Classes

struct  addr_list_type
 
struct  dns_search_list_type
 
struct  handover_assist_info_type
 
struct  handover_key_reply_type
 
struct  handover_key_req_type
 
struct  ip_prefix_type
 
struct  lladdr_type
 The type used to store the link layer address option data. More...
 
struct  map_type
 
struct  mobile_node_id_type
 
struct  multicast_address_record
 
struct  naack_type
 The type used to store the neighbour advertisement acknowledgement option data. More...
 
struct  new_advert_interval_type
 
struct  prefix_info_type
 
struct  recursive_dns_type
 
struct  route_info_type
 
struct  rsa_sign_type
 
struct  shortcut_limit_type
 
struct  timestamp_type
 

Public Types

enum  Types {
  DEST_UNREACHABLE = 1, PACKET_TOOBIG = 2, TIME_EXCEEDED = 3, PARAM_PROBLEM = 4,
  ECHO_REQUEST = 128, ECHO_REPLY = 129, MGM_QUERY = 130, MGM_REPORT = 131,
  MGM_REDUCTION = 132, ROUTER_SOLICIT = 133, ROUTER_ADVERT = 134, NEIGHBOUR_SOLICIT = 135,
  NEIGHBOUR_ADVERT = 136, REDIRECT = 137, ROUTER_RENUMBER = 138, NI_QUERY = 139,
  NI_REPLY = 140, MLD2_REPORT = 143, DHAAD_REQUEST = 144, DHAAD_REPLY = 145,
  MOBILE_PREFIX_SOLICIT = 146, MOBILE_PREFIX_ADVERT = 147, CERT_PATH_SOLICIT = 148, CERT_PATH_ADVERT = 149,
  MULTICAST_ROUTER_ADVERT = 151, MULTICAST_ROUTER_SOLICIT = 152, MULTICAST_ROUTER_TERMINATE = 153, RPL_CONTROL_MSG = 155
}
 
enum  OptionTypes {
  SOURCE_ADDRESS = 1, TARGET_ADDRESS, PREFIX_INFO, REDIRECT_HEADER,
  MTU, NBMA_SHORT_LIMIT, ADVERT_INTERVAL, HOME_AGENT_INFO,
  S_ADDRESS_LIST, T_ADDRESS_LIST, CGA, RSA_SIGN,
  TIMESTAMP, NONCE, TRUST_ANCHOR, CERTIFICATE,
  IP_PREFIX, NEW_ROUTER_PREFIX, LINK_ADDRESS, NAACK,
  MAP = 23, ROUTE_INFO, RECURSIVE_DNS_SERV, RA_FLAGS_EXT,
  HANDOVER_KEY_REQ, HANDOVER_KEY_REPLY, HANDOVER_ASSIST_INFO, MOBILE_NODE_ID,
  DNS_SEARCH_LIST, PROXY_SIGNATURE, ADDRESS_REG, SIXLOWPAN_CONTEXT,
  AUTHORITATIVE_BORDER_ROUTER, CARD_REQUEST = 138, CARD_REPLY
}
 
typedef IPv6Address ipaddress_type
 
typedef HWAddress< 6 > hwaddress_type
 
typedef PDUOption< uint8_t, ICMPv6option
 
typedef std::vector< optionoptions_type
 
typedef std::vector< uint16_t > new_ha_info_type
 The type used to store the new home agent information option data.
 
typedef std::vector< uint8_t > nonce_type
 
typedef std::pair< uint16_t, uint32_t > mtu_type
 
typedef std::vector< multicast_address_recordmulticast_address_records_list
 
typedef std::vector< ipaddress_typesources_list
 
- Public Types inherited from Tins::PDU
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, DOT1Q, PPPOE, STP,
  PPI, IPSEC_AH, IPSEC_ESP, PKTAP,
  MPLS, UNKNOWN = 999, USER_DEFINED_PDU = 1000
}
 Enum which identifies each type of PDU. More...
 
typedef byte_array serialization_type
 

Public Member Functions

 ICMPv6 (Types tp=ECHO_REQUEST)
 Constructs an ICMPv6 object. More...
 
 ICMPv6 (const uint8_t *buffer, uint32_t total_sz)
 Constructs an ICMPv6 object from a buffer. More...
 
Types type () const
 Getter for the type field. More...
 
uint8_t code () const
 Getter for the code field. More...
 
uint16_t checksum () const
 Getter for the cksum field. More...
 
uint16_t identifier () const
 Getter for the identifier field. More...
 
uint16_t sequence () const
 Getter for the sequence field. More...
 
small_uint< 1 > override () const
 Getter for the override field. More...
 
small_uint< 1 > solicited () const
 Getter for the solicited field. More...
 
small_uint< 1 > router () const
 Getter for the router field. More...
 
uint8_t hop_limit () const
 Getter for the hop limit field. More...
 
uint16_t maximum_response_code () const
 Getter for the maximum response code field. More...
 
small_uint< 2 > router_pref () const
 Getter for the router_pref field. More...
 
small_uint< 1 > home_agent () const
 Getter for the home_agent field. More...
 
small_uint< 1 > other () const
 Getter for the other field. More...
 
small_uint< 1 > managed () const
 Getter for the managed field. More...
 
uint16_t router_lifetime () const
 Getter for the router_lifetime field. More...
 
uint32_t reachable_time () const
 Getter for the reachable_time field. More...
 
uint32_t retransmit_timer () const
 Getter for the retransmit_timer field. More...
 
const ipaddress_typetarget_addr () const
 Getter for the target address field. More...
 
const ipaddress_typedest_addr () const
 Getter for the destination address field. More...
 
const ipaddress_typemulticast_addr () const
 Getter for the multicast address field. More...
 
const options_typeoptions () const
 Getter for the ICMPv6 options. More...
 
uint8_t length () const
 Getter for the length field. More...
 
const multicast_address_records_list & multicast_address_records () const
 Getter for the multicast address records field.
 
const sources_list & sources () const
 Getter for the multicast address records field. More...
 
small_uint< 1 > supress () const
 Getter for the Suppress Router-Side Processing field. More...
 
small_uint< 3 > qrv () const
 Getter for the Querier's Robustnes Variable field. More...
 
uint8_t qqic () const
 Getter for the Querier's Query Interval Code field. More...
 
void type (Types new_type)
 Setter for the type field. More...
 
void code (uint8_t new_code)
 Setter for the code field. More...
 
void checksum (uint16_t new_cksum)
 Setter for the cksum field. More...
 
void identifier (uint16_t new_identifier)
 Setter for the identifier field. More...
 
void sequence (uint16_t new_sequence)
 Setter for the sequence field. More...
 
void override (small_uint< 1 > new_override)
 Setter for the override field. More...
 
void solicited (small_uint< 1 > new_solicited)
 Setter for the solicited field. More...
 
void router (small_uint< 1 > new_router)
 Setter for the router field. More...
 
void hop_limit (uint8_t new_hop_limit)
 Setter for the hop_limit field. More...
 
void maximum_response_code (uint16_t maximum_response_code)
 Setter for the maximum response code field. More...
 
void router_pref (small_uint< 2 > new_router_pref)
 Setter for the router_pref field. More...
 
void home_agent (small_uint< 1 > new_home_agent)
 Setter for the home_agent field. More...
 
void other (small_uint< 1 > new_other)
 Setter for the other field. More...
 
void managed (small_uint< 1 > new_managed)
 Setter for the managed field. More...
 
void router_lifetime (uint16_t new_router_lifetime)
 Setter for the router_lifetime field. More...
 
void target_addr (const ipaddress_type &new_target_addr)
 Setter for the target address field. More...
 
void dest_addr (const ipaddress_type &new_dest_addr)
 Setter for the destination address field. More...
 
void multicast_addr (const ipaddress_type &new_multicast_addr)
 Setter for the multicast address field. More...
 
void reachable_time (uint32_t new_reachable_time)
 Setter for the reachable_time field. More...
 
void retransmit_timer (uint32_t new_retrans_timer)
 Setter for the retransmit_timer field. More...
 
void multicast_address_records (const multicast_address_records_list &records)
 Setter for the multicast address records field. More...
 
void sources (const sources_list &new_sources)
 Setter for the sources field. More...
 
void supress (small_uint< 1 > value)
 Setter for the supress field. More...
 
void qrv (small_uint< 3 > value)
 Setter for the Querier's Robustness Variable field. More...
 
void qqic (uint8_t value)
 Setter for the Querier's Query Interval Code field. More...
 
PDUType pdu_type () const
 Getter for the PDU's type. More...
 
bool has_target_addr () const
 Checks whether this ICMPv6 object has a target_addr field. More...
 
bool has_dest_addr () const
 Checks whether this ICMPv6 object has a target_addr field. More...
 
void add_option (const option &option)
 Adds an ICMPv6 option. More...
 
void add_option (option &&option)
 Adds an ICMPv6 option. More...
 
bool remove_option (OptionTypes type)
 Removes an ICMPv6 option. More...
 
uint32_t header_size () const
 Returns the header size. More...
 
uint32_t trailer_size () const
 Returns the trailer size. More...
 
const ICMPExtensionsStructureextensions () const
 Getter for the extensions field. More...
 
ICMPExtensionsStructureextensions ()
 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...
 
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 optionsearch_option (OptionTypes type) const
 Searchs for an option that matchs the given flag. More...
 
ICMPv6clone () const
 
void use_mldv2 (bool value)
 Indicates whether to use MLDv2. More...
 
void source_link_layer_addr (const hwaddress_type &addr)
 Setter for the source link layer address option. More...
 
void target_link_layer_addr (const hwaddress_type &addr)
 Setter for the target link layer address option. More...
 
void prefix_info (prefix_info_type info)
 Setter for the prefix information option. More...
 
void redirect_header (const byte_array &data)
 Setter for the redirect header option. More...
 
void mtu (const mtu_type &value)
 Setter for the MTU option. More...
 
void shortcut_limit (const shortcut_limit_type &value)
 Setter for the shortcut limit option. More...
 
void new_advert_interval (const new_advert_interval_type &value)
 Setter for the new advertisement interval option. More...
 
void new_home_agent_info (const new_ha_info_type &value)
 Setter for the new home agent information option. More...
 
void source_addr_list (const addr_list_type &value)
 Setter for the new source address list option. More...
 
void target_addr_list (const addr_list_type &value)
 Setter for the new target address list option. More...
 
void rsa_signature (const rsa_sign_type &value)
 Setter for the new RSA signature option. More...
 
void timestamp (const timestamp_type &value)
 Setter for the new timestamp option. More...
 
void nonce (const nonce_type &value)
 Setter for the new nonce option. More...
 
void ip_prefix (const ip_prefix_type &value)
 Setter for the new IP address/prefix option. More...
 
void link_layer_addr (lladdr_type value)
 Setter for the new link layer address option. More...
 
void naack (const naack_type &value)
 Setter for the neighbour advertisement acknowledgement option. More...
 
void map (const map_type &value)
 Setter for the map option. More...
 
void route_info (const route_info_type &value)
 Setter for the route information option. More...
 
void recursive_dns_servers (const recursive_dns_type &value)
 Setter for the recursive DNS servers option. More...
 
void handover_key_request (const handover_key_req_type &value)
 Setter for the handover key request option. More...
 
void handover_key_reply (const handover_key_reply_type &value)
 Setter for the handover key reply option. More...
 
void handover_assist_info (const handover_assist_info_type &value)
 Setter for the handover assist info option. More...
 
void mobile_node_identifier (const mobile_node_id_type &value)
 Setter for the mobile node identifier option. More...
 
void dns_search_list (const dns_search_list_type &value)
 Setter for the DNS search list option. More...
 
hwaddress_type source_link_layer_addr () const
 Getter for the source link layer address option. More...
 
hwaddress_type target_link_layer_addr () const
 Getter for the target link layer address option. More...
 
prefix_info_type prefix_info () const
 Getter for the prefix information option. More...
 
byte_array redirect_header () const
 Getter for the redirect header option. More...
 
mtu_type mtu () const
 Getter for the MTU option. More...
 
shortcut_limit_type shortcut_limit () const
 Getter for the shortcut limit option. More...
 
new_advert_interval_type new_advert_interval () const
 Getter for the new advertisement interval option. More...
 
new_ha_info_type new_home_agent_info () const
 Getter for the new home agent information option. More...
 
addr_list_type source_addr_list () const
 Getter for the source address list option. More...
 
addr_list_type target_addr_list () const
 Getter for the target address list option. More...
 
rsa_sign_type rsa_signature () const
 Getter for the RSA signature option. More...
 
timestamp_type timestamp () const
 Getter for the timestamp option. More...
 
nonce_type nonce () const
 Getter for the nonce option. More...
 
ip_prefix_type ip_prefix () const
 Getter for the IP address/prefix option. More...
 
lladdr_type link_layer_addr () const
 Getter for the link layer address option. More...
 
naack_type naack () const
 Getter for the neighbour advertisement acknowledgement option. More...
 
map_type map () const
 Getter for the map option. More...
 
route_info_type route_info () const
 Getter for the route information option. More...
 
recursive_dns_type recursive_dns_servers () const
 Getter for the recursive dns servers option. More...
 
handover_key_req_type handover_key_request () const
 Getter for the handover key request option. More...
 
handover_key_reply_type handover_key_reply () const
 Getter for the handover key reply option. More...
 
handover_assist_info_type handover_assist_info () const
 Getter for the handover key reply option. More...
 
mobile_node_id_type mobile_node_identifier () const
 Getter for the mobile node identifier option. More...
 
dns_search_list_type dns_search_list () const
 Getter for the mobile node identifier option. More...
 
- Public Member Functions inherited from Tins::PDU
 PDU ()
 Default constructor.
 
 PDU (PDU &&rhs) TINS_NOEXCEPT
 Move constructor. More...
 
PDUoperator= (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...
 
PDUinner_pdu () const
 Getter for the inner PDU. More...
 
PDUparent_pdu () const
 
PDUrelease_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 PDUrecv_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...
 

Static Public Attributes

static const PDU::PDUType pdu_flag = PDU::ICMPv6
 This PDU's flag.
 
- Static Public Attributes inherited from Tins::PDU
static const endian_type endianness = BE
 

Additional Inherited Members

- Protected Member Functions inherited from Tins::PDU
 PDU (const PDU &other)
 Copy constructor.
 
PDUoperator= (const PDU &other)
 Copy assignment operator.
 
void copy_inner_pdu (const PDU &pdu)
 Copy other PDU's inner PDU(if any). More...
 
virtual void prepare_for_serialize ()
 Prepares this PDU for serialization. More...
 
void serialize (uint8_t *buffer, uint32_t total_sz)
 Serializes this PDU and propagates this action to child PDUs. More...
 

Detailed Description

Represents an ICMPv6 PDU.

Member Typedef Documentation

The type used to store addresses.

The type used to store addresses.

typedef std::pair<uint16_t, uint32_t> Tins::ICMPv6::mtu_type

The type used to store the MTU option.

typedef std::vector<uint8_t> Tins::ICMPv6::nonce_type

The type used to store the nonce option data.

The type used to represent ICMPv6 options.

typedef std::vector<option> Tins::ICMPv6::options_type

The type used to store options.

Member Enumeration Documentation

The types of ICMPv6 options.

The types of ICMPv6 messages

Constructor & Destructor Documentation

Tins::ICMPv6::ICMPv6 ( Types  tp = ECHO_REQUEST)

Constructs an ICMPv6 object.

The type of the constructed object will be an echo request, unless you provide another one in the tp parameter.

Parameters
tpThe message type of this ICMPv6 object.
Tins::ICMPv6::ICMPv6 ( const uint8_t *  buffer,
uint32_t  total_sz 
)

Constructs an ICMPv6 object from a buffer.

If there is not enough size for an ICMPv6 header, a malformed_packet exception is thrown.

Any extra data is stored in a RawPDU.

Parameters
bufferThe buffer from which this PDU will be constructed.
total_szThe total size of the buffer.

Member Function Documentation

void Tins::ICMPv6::add_option ( const option option)

Adds an ICMPv6 option.

The option is added after the last option in the option fields.

Parameters
optionThe option to be added
void Tins::ICMPv6::add_option ( option &&  option)
inline

Adds an ICMPv6 option.

The option is move-constructed.

Parameters
optionThe option to be added.
uint16_t Tins::ICMPv6::checksum ( ) const
inline

Getter for the cksum field.

Returns
The stored cksum field value.
void Tins::ICMPv6::checksum ( uint16_t  new_cksum)

Setter for the cksum field.

Parameters
new_cksumThe new cksum field value.
ICMPv6* Tins::ICMPv6::clone ( ) const
inlinevirtual
See also
PDU::clone

Implements Tins::PDU.

uint8_t Tins::ICMPv6::code ( ) const
inline

Getter for the code field.

Returns
The stored code field value.
void Tins::ICMPv6::code ( uint8_t  new_code)

Setter for the code field.

Parameters
new_codeThe new code field value.
const ipaddress_type& Tins::ICMPv6::dest_addr ( ) const
inline

Getter for the destination address field.

Returns
The stored destination address field value.
void Tins::ICMPv6::dest_addr ( const ipaddress_type new_dest_addr)

Setter for the destination address field.

Parameters
new_dest_addrThe new destination address field value.
void Tins::ICMPv6::dns_search_list ( const dns_search_list_type value)

Setter for the DNS search list option.

Parameters
valueThe new DNS search list option data.
ICMPv6::dns_search_list_type Tins::ICMPv6::dns_search_list ( ) const

Getter for the mobile node identifier option.

This method will throw an option_not_found exception if the option is not found.

const ICMPExtensionsStructure& Tins::ICMPv6::extensions ( ) const
inline

Getter for the extensions field.

Returns
The extensions field
ICMPExtensionsStructure& Tins::ICMPv6::extensions ( )
inline

Getter for the extensions field.

Returns
The extensions field
void Tins::ICMPv6::handover_assist_info ( const handover_assist_info_type value)

Setter for the handover assist info option.

Parameters
valueThe new handover assist info option data.
ICMPv6::handover_assist_info_type Tins::ICMPv6::handover_assist_info ( ) const

Getter for the handover key reply option.

This method will throw an option_not_found exception if the option is not found.

void Tins::ICMPv6::handover_key_reply ( const handover_key_reply_type value)

Setter for the handover key reply option.

Parameters
valueThe new handover key reply option data.
ICMPv6::handover_key_reply_type Tins::ICMPv6::handover_key_reply ( ) const

Getter for the handover key reply option.

This method will throw an option_not_found exception if the option is not found.

void Tins::ICMPv6::handover_key_request ( const handover_key_req_type value)

Setter for the handover key request option.

Parameters
valueThe new handover key request option data.
ICMPv6::handover_key_req_type Tins::ICMPv6::handover_key_request ( ) const

Getter for the handover key request option.

This method will throw an option_not_found exception if the option is not found.

bool Tins::ICMPv6::has_dest_addr ( ) const
inline

Checks whether this ICMPv6 object has a target_addr field.

This depends on the type field.

bool Tins::ICMPv6::has_target_addr ( ) const
inline

Checks whether this ICMPv6 object has a target_addr field.

This depends on the type field.

uint32_t Tins::ICMPv6::header_size ( ) const
virtual

Returns the header size.

This method overrides PDU::header_size. This size includes the payload and options size.

See also
PDU::header_size

Implements Tins::PDU.

small_uint<1> Tins::ICMPv6::home_agent ( ) const
inline

Getter for the home_agent field.

Returns
The stored home_agent field value.
void Tins::ICMPv6::home_agent ( small_uint< 1 >  new_home_agent)

Setter for the home_agent field.

Parameters
new_home_agentThe new home_agent field value.
uint8_t Tins::ICMPv6::hop_limit ( ) const
inline

Getter for the hop limit field.

Returns
The stored hop limit field value.
void Tins::ICMPv6::hop_limit ( uint8_t  new_hop_limit)

Setter for the hop_limit field.

Parameters
new_hop_limitThe new hop_limit field value.
uint16_t Tins::ICMPv6::identifier ( ) const
inline

Getter for the identifier field.

Returns
The stored identifier field value.
void Tins::ICMPv6::identifier ( uint16_t  new_identifier)

Setter for the identifier field.

Parameters
new_identifierThe new identifier field value.
void Tins::ICMPv6::ip_prefix ( const ip_prefix_type value)

Setter for the new IP address/prefix option.

Parameters
valueThe new IP address/prefix option data.
ICMPv6::ip_prefix_type Tins::ICMPv6::ip_prefix ( ) const

Getter for the IP address/prefix option.

This method will throw an option_not_found exception if the option is not found.

uint8_t Tins::ICMPv6::length ( ) const
inline

Getter for the length field.

Returns
Returns the length field value.
void Tins::ICMPv6::link_layer_addr ( lladdr_type  value)

Setter for the new link layer address option.

Parameters
valueThe new link layer address option data.
ICMPv6::lladdr_type Tins::ICMPv6::link_layer_addr ( ) const

Getter for the link layer address option.

This method will throw an option_not_found exception if the option is not found.

small_uint<1> Tins::ICMPv6::managed ( ) const
inline

Getter for the managed field.

Returns
The stored managed field value.
void Tins::ICMPv6::managed ( small_uint< 1 >  new_managed)

Setter for the managed field.

Parameters
new_managedThe new managed field value.
void Tins::ICMPv6::map ( const map_type value)

Setter for the map option.

Parameters
valueThe new map option data.
ICMPv6::map_type Tins::ICMPv6::map ( ) const

Getter for the map option.

This method will throw an option_not_found exception if the option is not found.

bool Tins::ICMPv6::matches_response ( const uint8_t *  ptr,
uint32_t  total_sz 
) const
virtual

Check whether ptr points to a valid response for this PDU.

See also
PDU::matches_response
Parameters
ptrThe pointer to the buffer.
total_szThe size of the buffer.

Reimplemented from Tins::PDU.

uint16_t Tins::ICMPv6::maximum_response_code ( ) const
inline

Getter for the maximum response code field.

Returns
The stored maximum response code field value.
void Tins::ICMPv6::maximum_response_code ( uint16_t  maximum_response_code)

Setter for the maximum response code field.

Parameters
new_hop_limitThe new maximum response code field value.
void Tins::ICMPv6::mobile_node_identifier ( const mobile_node_id_type value)

Setter for the mobile node identifier option.

Parameters
valueThe new mobile node identifier option data.
ICMPv6::mobile_node_id_type Tins::ICMPv6::mobile_node_identifier ( ) const

Getter for the mobile node identifier option.

This method will throw an option_not_found exception if the option is not found.

void Tins::ICMPv6::mtu ( const mtu_type value)

Setter for the MTU option.

Parameters
valueThe MTU option data.
ICMPv6::mtu_type Tins::ICMPv6::mtu ( ) const

Getter for the MTU option.

This method will throw an option_not_found exception if the option is not found.

const ipaddress_type& Tins::ICMPv6::multicast_addr ( ) const
inline

Getter for the multicast address field.

Note that this field is only valid for Multicast Listener Query Message packets

Returns
The stored multicast address field value.
void Tins::ICMPv6::multicast_addr ( const ipaddress_type new_multicast_addr)

Setter for the multicast address field.

Note that this field is only valid if the type is MGM_QUERY

Parameters
new_multicast_addrThe new multicast address field value.
void Tins::ICMPv6::multicast_address_records ( const multicast_address_records_list &  records)

Setter for the multicast address records field.

This field is only valid if the type of this PDU is MLD2_REPORT

void Tins::ICMPv6::naack ( const naack_type value)

Setter for the neighbour advertisement acknowledgement option.

Parameters
valueThe new naack option data.
ICMPv6::naack_type Tins::ICMPv6::naack ( ) const

Getter for the neighbour advertisement acknowledgement option.

This method will throw an option_not_found exception if the option is not found.

void Tins::ICMPv6::new_advert_interval ( const new_advert_interval_type value)

Setter for the new advertisement interval option.

Parameters
valueThe new advertisement interval option data.
ICMPv6::new_advert_interval_type Tins::ICMPv6::new_advert_interval ( ) const

Getter for the new advertisement interval option.

This method will throw an option_not_found exception if the option is not found.

void Tins::ICMPv6::new_home_agent_info ( const new_ha_info_type value)

Setter for the new home agent information option.

Parameters
valueThe new home agent information option data.
ICMPv6::new_ha_info_type Tins::ICMPv6::new_home_agent_info ( ) const

Getter for the new home agent information option.

This method will throw an option_not_found exception if the option is not found.

void Tins::ICMPv6::nonce ( const nonce_type value)

Setter for the new nonce option.

Parameters
valueThe new nonce option data.
ICMPv6::nonce_type Tins::ICMPv6::nonce ( ) const

Getter for the nonce option.

This method will throw an option_not_found exception if the option is not found.

const options_type& Tins::ICMPv6::options ( ) const
inline

Getter for the ICMPv6 options.

Returns
The stored options.
small_uint<1> Tins::ICMPv6::other ( ) const
inline

Getter for the other field.

Returns
The stored other field value.
void Tins::ICMPv6::other ( small_uint< 1 >  new_other)

Setter for the other field.

Parameters
new_otherThe new other field value.
small_uint<1> Tins::ICMPv6::override ( ) const
inline

Getter for the override field.

Returns
The stored override field value.
void Tins::ICMPv6::override ( small_uint< 1 >  new_override)

Setter for the override field.

Parameters
new_overrideThe new override field value.
PDUType Tins::ICMPv6::pdu_type ( ) const
inlinevirtual

Getter for the PDU's type.

See also
PDU::pdu_type

Implements Tins::PDU.

void Tins::ICMPv6::prefix_info ( prefix_info_type  info)

Setter for the prefix information option.

Parameters
infoThe prefix information.
ICMPv6::prefix_info_type Tins::ICMPv6::prefix_info ( ) const

Getter for the prefix information option.

This method will throw an option_not_found exception if the option is not found.

uint8_t Tins::ICMPv6::qqic ( ) const
inline

Getter for the Querier's Query Interval Code field.

Note that this field is only valid for Multicast Listener Query Message packets

void Tins::ICMPv6::qqic ( uint8_t  value)

Setter for the Querier's Query Interval Code field.

This field is only valid if the type of this PDU is MGM_QUERY

small_uint<3> Tins::ICMPv6::qrv ( ) const
inline

Getter for the Querier's Robustnes Variable field.

Note that this field is only valid for Multicast Listener Query Message packets

void Tins::ICMPv6::qrv ( small_uint< 3 >  value)

Setter for the Querier's Robustness Variable field.

This field is only valid if the type of this PDU is MGM_QUERY

uint32_t Tins::ICMPv6::reachable_time ( ) const
inline

Getter for the reachable_time field.

Returns
The stored reachable_time field value.
void Tins::ICMPv6::reachable_time ( uint32_t  new_reachable_time)

Setter for the reachable_time field.

Parameters
new_reachable_timeThe new reachable_time field value.
void Tins::ICMPv6::recursive_dns_servers ( const recursive_dns_type value)

Setter for the recursive DNS servers option.

Parameters
valueThe new recursive DNS servers option data.
ICMPv6::recursive_dns_type Tins::ICMPv6::recursive_dns_servers ( ) const

Getter for the recursive dns servers option.

This method will throw an option_not_found exception if the option is not found.

void Tins::ICMPv6::redirect_header ( const byte_array data)

Setter for the redirect header option.

Parameters
dataThe redirect header option data.
byte_array Tins::ICMPv6::redirect_header ( ) const

Getter for the redirect header option.

This method will throw an option_not_found exception if the option is not found.

bool Tins::ICMPv6::remove_option ( OptionTypes  type)

Removes an ICMPv6 option.

If there are multiple options of the given type, only the first one will be removed.

Parameters
typeThe type of the option to be removed.
Returns
true if the option was removed, false otherwise.
uint32_t Tins::ICMPv6::retransmit_timer ( ) const
inline

Getter for the retransmit_timer field.

Returns
The stored retransmit_timer field value.
void Tins::ICMPv6::retransmit_timer ( uint32_t  new_retrans_timer)

Setter for the retransmit_timer field.

Parameters
new_retrans_timerThe new retrans_timer field value.
void Tins::ICMPv6::route_info ( const route_info_type value)

Setter for the route information option.

Parameters
valueThe new route information option data.
ICMPv6::route_info_type Tins::ICMPv6::route_info ( ) const

Getter for the route information option.

This method will throw an option_not_found exception if the option is not found.

small_uint<1> Tins::ICMPv6::router ( ) const
inline

Getter for the router field.

Returns
The stored router field value.
void Tins::ICMPv6::router ( small_uint< 1 >  new_router)

Setter for the router field.

Parameters
new_routerThe new router field value.
uint16_t Tins::ICMPv6::router_lifetime ( ) const
inline

Getter for the router_lifetime field.

Returns
The stored router_lifetime field value.
void Tins::ICMPv6::router_lifetime ( uint16_t  new_router_lifetime)

Setter for the router_lifetime field.

Parameters
new_router_lifetimeThe new router_lifetime field value.
small_uint<2> Tins::ICMPv6::router_pref ( ) const
inline

Getter for the router_pref field.

Returns
The stored router_pref field value.
void Tins::ICMPv6::router_pref ( small_uint< 2 >  new_router_pref)

Setter for the router_pref field.

Parameters
new_router_prefThe new router_pref field value.
void Tins::ICMPv6::rsa_signature ( const rsa_sign_type value)

Setter for the new RSA signature option.

Parameters
valueThe new RSA signature option data.
ICMPv6::rsa_sign_type Tins::ICMPv6::rsa_signature ( ) const

Getter for the RSA signature option.

This method will throw an option_not_found exception if the option is not found.

const ICMPv6::option * Tins::ICMPv6::search_option ( OptionTypes  type) const

Searchs for an option that matchs the given flag.

If the header is not found, a null pointer is returned. Deleting the returned pointer will result in undefined behaviour.

Parameters
typeThe option identifier to be searched.
uint16_t Tins::ICMPv6::sequence ( ) const
inline

Getter for the sequence field.

Returns
The stored sequence field value.
void Tins::ICMPv6::sequence ( uint16_t  new_sequence)

Setter for the sequence field.

Parameters
new_sequenceThe new sequence field value.
void Tins::ICMPv6::shortcut_limit ( const shortcut_limit_type value)

Setter for the shortcut limit option.

Parameters
valueThe shortcut limit option data.
ICMPv6::shortcut_limit_type Tins::ICMPv6::shortcut_limit ( ) const

Getter for the shortcut limit option.

This method will throw an option_not_found exception if the option is not found.

small_uint<1> Tins::ICMPv6::solicited ( ) const
inline

Getter for the solicited field.

Returns
The stored solicited field value.
void Tins::ICMPv6::solicited ( small_uint< 1 >  new_solicited)

Setter for the solicited field.

Parameters
new_solicitedThe new solicited field value.
void Tins::ICMPv6::source_addr_list ( const addr_list_type value)

Setter for the new source address list option.

Parameters
valueThe new source address list option data.
ICMPv6::addr_list_type Tins::ICMPv6::source_addr_list ( ) const

Getter for the source address list option.

This method will throw an option_not_found exception if the option is not found.

void Tins::ICMPv6::source_link_layer_addr ( const hwaddress_type addr)

Setter for the source link layer address option.

Parameters
addrThe source link layer address.
ICMPv6::hwaddress_type Tins::ICMPv6::source_link_layer_addr ( ) const

Getter for the source link layer address option.

This method will throw an option_not_found exception if the option is not found.

const sources_list& Tins::ICMPv6::sources ( ) const
inline

Getter for the multicast address records field.

Note that this field is only valid for Multicast Listener Query Message packets

void Tins::ICMPv6::sources ( const sources_list &  new_sources)

Setter for the sources field.

This field is only valid if the type of this PDU is MGM_QUERY

small_uint<1> Tins::ICMPv6::supress ( ) const
inline

Getter for the Suppress Router-Side Processing field.

Note that this field is only valid for Multicast Listener Query Message packets

void Tins::ICMPv6::supress ( small_uint< 1 >  value)

Setter for the supress field.

This field is only valid if the type of this PDU is MGM_QUERY

const ipaddress_type& Tins::ICMPv6::target_addr ( ) const
inline

Getter for the target address field.

Returns
The stored target address field value.
void Tins::ICMPv6::target_addr ( const ipaddress_type new_target_addr)

Setter for the target address field.

Parameters
new_target_addrThe new target address field value.
void Tins::ICMPv6::target_addr_list ( const addr_list_type value)

Setter for the new target address list option.

Parameters
valueThe new target address list option data.
ICMPv6::addr_list_type Tins::ICMPv6::target_addr_list ( ) const

Getter for the target address list option.

This method will throw an option_not_found exception if the option is not found.

void Tins::ICMPv6::target_link_layer_addr ( const hwaddress_type addr)

Setter for the target link layer address option.

Parameters
addrThe target link layer address.
ICMPv6::hwaddress_type Tins::ICMPv6::target_link_layer_addr ( ) const

Getter for the target link layer address option.

This method will throw an option_not_found exception if the option is not found.

void Tins::ICMPv6::timestamp ( const timestamp_type value)

Setter for the new timestamp option.

Parameters
valueThe new timestamp option data.
ICMPv6::timestamp_type Tins::ICMPv6::timestamp ( ) const

Getter for the timestamp option.

This method will throw an option_not_found exception if the option is not found.

uint32_t Tins::ICMPv6::trailer_size ( ) const
virtual

Returns the trailer size.

This method overrides PDU::trailer_size. This size will hold the extensions size

See also
PDU::header_size

Reimplemented from Tins::PDU.

Types Tins::ICMPv6::type ( ) const
inline

Getter for the type field.

Returns
The stored type field value.
void Tins::ICMPv6::type ( Types  new_type)

Setter for the type field.

Parameters
new_typeThe new type field value.
void Tins::ICMPv6::use_length_field ( bool  value)

Sets whether the length field will be set for packets that use it.

As defined in RFC 4884, some ICMP packet types can have a length field. This method controlers whether the length field is set or not.

Note that this only indicates that the packet should use this field. The actual value will be set during the packet's serialization.

Note that, in order to br RFC compliant, if the size of the encapsulated PDU is greater than 128, the length field will always be set, regardless of whether this method was called or not.

/param value true iff the length field should be set appropriately

void Tins::ICMPv6::use_mldv2 ( bool  value)

Indicates whether to use MLDv2.

If this is set to true, then MLDv2 will be used rather than MLDv1 when serializing Multicast Listener Discovery messages. By default, MLDv2 will be used.

Parameters
valueThe value to set

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