xorp

IpHeader4Writer Class Reference

Class for writing data to IPv4 packet header. More...

#include <packet.hh>

Inheritance diagram for IpHeader4Writer:
IpHeader4

List of all members.

Public Member Functions

 IpHeader4Writer (uint8_t *data)
uint8_t * data ()
 Get the buffer data.
void set_ip_vhl (uint8_t v)
 Methods to set various IP header fields.
void set_ip_tos (uint8_t v)
void set_ip_len (uint16_t v)
void set_ip_id (uint16_t v)
void set_ip_off (uint16_t v)
void set_ip_ttl (uint8_t v)
void set_ip_p (uint8_t v)
void set_ip_sum (uint16_t v)
void set_ip_src (const IPv4 &v)
void set_ip_dst (const IPv4 &v)
void compute_checksum ()
 A method to compute and set the IP checksum.
void set_ip_len_host (uint16_t v)
void set_ip_version (uint8_t v)
 Set the IP protocol version of the header.
void set_ip_header_len (uint8_t v)
 Set the IPv4 packet header size (including any header options).
void set_ip_fragment_offset (uint16_t v)
 Set the IPv4 fragment offset (excluding the fragment flags).
void set_ip_fragment_flags (uint16_t v)
 Set the IPv4 fragment flags.

Private Attributes

uint8_t * _data
uint8_t * _ip_vhl
uint8_t * _ip_tos
uint8_t * _ip_len
uint8_t * _ip_id
uint8_t * _ip_off
uint8_t * _ip_ttl
uint8_t * _ip_p
uint8_t * _ip_sum
uint8_t * _ip_src
uint8_t * _ip_dst

Detailed Description

Class for writing data to IPv4 packet header.


Member Function Documentation

uint8_t* IpHeader4Writer::data ( ) [inline]

Get the buffer data.

Returns:
the buffer data.
void IpHeader4Writer::set_ip_fragment_flags ( uint16_t  v) [inline]

Set the IPv4 fragment flags.

Parameters:
vthe IPv4 fragment flags.
void IpHeader4Writer::set_ip_fragment_offset ( uint16_t  v) [inline]

Set the IPv4 fragment offset (excluding the fragment flags).

Parameters:
vthe IPv4 fragment offset (excluding the fragment flags).
void IpHeader4Writer::set_ip_header_len ( uint8_t  v) [inline]

Set the IPv4 packet header size (including any header options).

Parameters:
vthe IPv4 packet header size (including any header options).
void IpHeader4Writer::set_ip_version ( uint8_t  v) [inline]

Set the IP protocol version of the header.

Parameters:
vthe IP protocol version of the header.

The documentation for this class was generated from the following files:
 All Classes Namespaces Functions Variables Typedefs Enumerations