xorp

HelloPacket Class Reference

Hello packet. More...

#include <packet.hh>

Inheritance diagram for HelloPacket:
Packet

List of all members.

Public Member Functions

 HelloPacket (OspfTypes::Version version)
OspfTypes::Type get_type () const
 It is the responsibilty of the derived type to return this information.
Packetdecode (uint8_t *ptr, size_t len) const throw (InvalidPacket)
 Decode the packet.
bool encode (vector< uint8_t > &pkt)
 Encode the packet.
void set_network_mask (uint32_t network_mask)
uint32_t get_network_mask () const
void set_interface_id (uint32_t interface_id)
uint32_t get_interface_id () const
void set_hello_interval (uint16_t hello_interval)
uint16_t get_hello_interval () const
void set_options (uint32_t options)
uint32_t get_options () const
void set_router_priority (uint8_t router_priority)
uint8_t get_router_priority () const
void set_router_dead_interval (uint32_t router_dead_interval)
uint32_t get_router_dead_interval () const
void set_designated_router (OspfTypes::RouterID dr)
OspfTypes::RouterID get_designated_router () const
void set_backup_designated_router (OspfTypes::RouterID bdr)
OspfTypes::RouterID get_backup_designated_router () const
list< OspfTypes::RouterID > & get_neighbours ()
string str () const
 Generate a printable representation of the packet.

Static Public Attributes

static const size_t MINIMUM_LENGTH = 20
static const size_t DESIGNATED_ROUTER_OFFSET = 12
static const size_t BACKUP_DESIGNATED_ROUTER_OFFSET = 16
static const size_t NETWORK_MASK_OFFSET = 0
static const size_t HELLO_INTERVAL_V2_OFFSET = 4
static const size_t OPTIONS_V2_OFFSET = 6
static const size_t ROUTER_PRIORITY_V2_OFFSET = 7
static const size_t ROUTER_DEAD_INTERVAL_V2_OFFSET = 8
static const size_t INTERFACE_ID_OFFSET = 0
static const size_t ROUTER_PRIORITY_V3_OFFSET = 4
static const size_t OPTIONS_V3_OFFSET = 4
static const size_t HELLO_INTERVAL_V3_OFFSET = 8
static const size_t ROUTER_DEAD_INTERVAL_V3_OFFSET = 10

Private Attributes

uint32_t _network_mask
uint32_t _interface_id
uint16_t _hello_interval
uint32_t _options
uint8_t _router_priority
uint32_t _router_dead_interval
OspfTypes::RouterID _dr
OspfTypes::RouterID _bdr
list< OspfTypes::RouterID_neighbours

Detailed Description

Hello packet.


Member Function Documentation

Packet * HelloPacket::decode ( uint8_t *  ptr,
size_t  len 
) const throw (InvalidPacket) [virtual]

Decode the packet.

The returned packet must be free'd.

Implements Packet.

bool HelloPacket::encode ( vector< uint8_t > &  pkt)

Encode the packet.

Parameters:
pktvector into which the packet should be placed.
Returns:
true if the encoding succeeded.

Reimplemented from Packet.

OspfTypes::Type HelloPacket::get_type ( ) const [inline, virtual]

It is the responsibilty of the derived type to return this information.

Returns:
The type this packet represents.

Implements Packet.


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