xorp

VrrpPacket Class Reference

A VRRP packet including the IP header. More...

#include <vrrp_packet.hh>

List of all members.

Public Member Functions

void set_source (const IPv4 &ip)
 Set the source IP address in the IP header.
void set_vrid (uint8_t vrid)
 Set the virtual router ID in the VRRP header.
void set_priority (uint8_t priority)
 Set the priority in the VRRP header.
void set_interval (uint8_t interval)
 Set the advertisement interval in VRRP's header.
void clear_ips ()
 Remove all IPs from the VRRP advertisement.
void add_ip (const IPv4 &ip)
 Add an IP to the VRRP header.
void finalize ()
 Must be called when all fields are set.
const PAYLOAD & data () const
 Get the packet data.
uint32_t size () const
 Get the packet size.
void set_size (uint32_t size)
 Set the packet size.
template<class T >
void set_ips (const T &ips)
 Set multiple IPs from a container into the VRRP header.

Static Public Attributes

static const IPv4 mcast_group = IPv4("224.0.0.18")

Private Attributes

PAYLOAD _data
IpHeader4Writer _ip
VrrpHeader_vrrp

Detailed Description

A VRRP packet including the IP header.


Member Function Documentation

void VrrpPacket::add_ip ( const IPv4 ip)

Add an IP to the VRRP header.

Parameters:
ipIP to add to the virtual router in the VRRP header.
const PAYLOAD & VrrpPacket::data ( ) const

Get the packet data.

Returns:
the packet data (IP and VRRP).
void VrrpPacket::finalize ( )

Must be called when all fields are set.

This method will finalize any remaining fields such as checksums.

void VrrpPacket::set_interval ( uint8_t  interval)

Set the advertisement interval in VRRP's header.

Parameters:
intervalthe advertisement interval in VRRP's header.
template<class T >
void VrrpPacket::set_ips ( const T &  ips) [inline]

Set multiple IPs from a container into the VRRP header.

Parameters:
ipscollection of IP addresses to add to the VRRP header.
void VrrpPacket::set_priority ( uint8_t  priority)

Set the priority in the VRRP header.

Parameters:
prioritythe router priority in the VRRP header.
void VrrpPacket::set_size ( uint32_t  size)

Set the packet size.

Parameters:
packetsize.
void VrrpPacket::set_source ( const IPv4 ip)

Set the source IP address in the IP header.

Parameters:
ipsource IP address in IP header.
void VrrpPacket::set_vrid ( uint8_t  vrid)

Set the virtual router ID in the VRRP header.

Parameters:
vridthe virtual router ID in the VRRP header.
uint32_t VrrpPacket::size ( ) const

Get the packet size.

Returns:
packet size.

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