xorp

VrrpHeader Struct Reference

The VRRP header. More...

#include <vrrp_packet.hh>

List of all members.

Public Types

enum  Versions { VRRP_VERSION = 2 }
enum  PktTypes { VRRP_TYPE_ADVERTISEMENT = 1 }
enum  AuthTypes { VRRP_AUTH_NONE = 0 }

Public Member Functions

uint32_t finalize ()
 Must be called when all fields have been manipulated.
void add_ip (const IPv4 &ip)
 Add an IP address of the virtual router to the advertisement.
IPv4 ip (unsigned index) const
 Extract an IP address from the advertisement.

Static Public Member Functions

static VrrpHeaderassign (uint8_t *data)
 Create a new VRRP packet.
static const VrrpHeaderassign (const PAYLOAD &payload)
 Parse a VRRP packet.

Public Attributes

uint8_t vh_v:4
uint8_t vh_type:4
uint8_t vh_vrid
uint8_t vh_priority
uint8_t vh_ipcount
uint8_t vh_auth
uint8_t vh_interval
uint16_t vh_sum
struct in_addr vh_addr [0]

Detailed Description

The VRRP header.


Member Function Documentation

void VrrpHeader::add_ip ( const IPv4 ip)

Add an IP address of the virtual router to the advertisement.

Parameters:
ipIP address to add to the advertisement.
VrrpHeader & VrrpHeader::assign ( uint8_t *  data) [static]

Create a new VRRP packet.

Caller must allocate memory and assert size (VRRP_MAX_PACKET_SIZE).

Returns:
the VRRP header.
Parameters:
datapointer where packet should be stored.
const VrrpHeader & VrrpHeader::assign ( const PAYLOAD &  payload) [static]

Parse a VRRP packet.

Returns:
the VRRP header.
Parameters:
payloadThe VRRP packet starting with the VRRP header.
uint32_t VrrpHeader::finalize ( )

Must be called when all fields have been manipulated.

This will setup the final bits of information (e.g., checksum) and the packet will become ready to be sent.

Returns:
the length of the packet.
IPv4 VrrpHeader::ip ( unsigned  index) const

Extract an IP address from the advertisement.

Returns:
the IP address at the specified index.
Parameters:
indexthe index of the IP (0..vh_ipcount).

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