PcapPlusPlus
20.08
|
#include <BgpLayer.h>
Classes | |
struct | bgp_common_header |
Public Types | |
enum | BgpMessageType { Open = 1, Update = 2, Notification = 3, Keepalive = 4, RouteRefresh = 5 } |
Public Member Functions | |
virtual BgpMessageType | getBgpMessageType () const =0 |
std::string | getMessageTypeAsString () const |
size_t | getHeaderLen () const |
void | parseNextLayer () |
std::string | toString () const |
OsiModelLayer | getOsiModelLayer () const |
void | computeCalculateFields () |
Public Member Functions inherited from pcpp::Layer | |
virtual | ~Layer () |
Layer * | getNextLayer () const |
Layer * | getPrevLayer () const |
ProtocolType | getProtocol () const |
uint8_t * | getData () const |
size_t | getDataLen () const |
uint8_t * | getLayerPayload () const |
size_t | getLayerPayloadSize () const |
bool | isAllocatedToPacket () const |
void | copyData (uint8_t *toArr) const |
uint8_t * | getDataPtr (size_t offset=0) const |
Static Public Member Functions | |
static bool | isBgpPort (uint16_t portSrc, uint16_t portDst) |
static BgpLayer * | parseBgpLayer (uint8_t *data, size_t dataLen, Layer *prevLayer, Packet *packet) |
Represents Border Gateway Protocol (BGP) v4 protocol layer. This is an abstract class that cannot be instanciated, and contains functionality which is common to all BGP message types.
|
virtual |
Calculates the basic BGP fields:
Implements pcpp::Layer.
|
pure virtual |
Implemented in pcpp::BgpRouteRefreshMessageLayer, pcpp::BgpKeepaliveMessageLayer, pcpp::BgpNotificationMessageLayer, pcpp::BgpUpdateMessageLayer, and pcpp::BgpOpenMessageLayer.
|
virtual |
Implements pcpp::Layer.
std::string pcpp::BgpLayer::getMessageTypeAsString | ( | ) | const |
|
inlinevirtual |
Implements pcpp::Layer.
|
inlinestatic |
A static method that checks whether a source or dest port match those associated with the BGP protocol
[in] | portSrc | Source port number to check |
[in] | portDst | Dest port number to check |
|
static |
A method that creates a BGP layer from packet raw data
[in] | data | A pointer to the raw data |
[in] | dataLen | Size of the data in bytes |
[in] | prevLayer | A pointer to the previous layer |
[in] | packet | A pointer to the Packet instance where layer will be stored |
|
virtual |
Multiple BGP messages can reside in a single packet, and the only layer that can come after a BGP message is another BGP message. This method checks for remaining data and parses it as another BGP layer
Implements pcpp::Layer.
|
virtual |
Implements pcpp::Layer.