xorp

BGPPacket Class Reference

The main container for BGP messages (packets) which are sent back and forth. More...

#include <packet.hh>

Inheritance diagram for BGPPacket:
KeepAlivePacket NotificationPacket OpenPacket UpdatePacket

List of all members.

Public Types

enum  Status { GOOD_MESSAGE, ILLEGAL_MESSAGE_LENGTH, CONNECTION_CLOSED }
 

Status returned by message reader.


Public Member Functions

uint8_t type () const
virtual string str () const =0
virtual bool encode (uint8_t *buf, size_t &len, const BGPPeerData *peerdata) const =0

Static Public Attributes

static const size_t MARKER_SIZE = 16
static const size_t COMMON_HEADER_LEN
static const size_t MARKER_OFFSET = 0
static const size_t LENGTH_OFFSET = MARKER_SIZE
static const size_t TYPE_OFFSET = LENGTH_OFFSET + sizeof(uint16_t)
static const size_t MINPACKETSIZE = COMMON_HEADER_LEN
static const size_t MAXPACKETSIZE = 4096
static const size_t MINOPENPACKET = COMMON_HEADER_LEN + 10
static const size_t MINUPDATEPACKET = COMMON_HEADER_LEN + 2 + 2
static const size_t MINKEEPALIVEPACKET = COMMON_HEADER_LEN
static const size_t MINNOTIFICATIONPACKET = COMMON_HEADER_LEN + 2
static const uint8_t Marker [MARKER_SIZE]

Protected Member Functions

uint8_t * basic_encode (size_t len, uint8_t *buf) const
 BGPPacket (const BGPPacket &BGPPacket)

Protected Attributes

uint8_t _Type

Detailed Description

The main container for BGP messages (packets) which are sent back and forth.

This base class only contains the standard fields (length, type) leaving other information to be stored in the derived objects.


Member Data Documentation

const size_t BGPPacket::COMMON_HEADER_LEN [static]
Initial value:
 MARKER_SIZE
                + sizeof(uint16_t) + sizeof(uint8_t)
const uint8_t BGPPacket::Marker [static]
Initial value:
 {
    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
}

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