PcapPlusPlus  22.11
pcpp::BgpKeepaliveMessageLayer Class Reference

#include <BgpLayer.h>

Inheritance diagram for pcpp::BgpKeepaliveMessageLayer:
pcpp::BgpLayer pcpp::Layer pcpp::IDataContainer

Public Types

typedef bgp_common_header bgp_keepalive_message
 
- Public Types inherited from pcpp::BgpLayer
enum  BgpMessageType {
  Open = 1, Update = 2, Notification = 3, Keepalive = 4,
  RouteRefresh = 5
}
 

Public Member Functions

 BgpKeepaliveMessageLayer (uint8_t *data, size_t dataLen, Layer *prevLayer, Packet *packet)
 
 BgpKeepaliveMessageLayer ()
 
bgp_keepalive_messagegetKeepaliveHeader () const
 
BgpMessageType getBgpMessageType () const
 
- Public Member Functions inherited from pcpp::BgpLayer
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 ()
 
LayergetNextLayer () const
 
LayergetPrevLayer () 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
 

Additional Inherited Members

- Static Public Member Functions inherited from pcpp::BgpLayer
static bool isBgpPort (uint16_t portSrc, uint16_t portDst)
 
static BgpLayerparseBgpLayer (uint8_t *data, size_t dataLen, Layer *prevLayer, Packet *packet)
 

Detailed Description

Represents a BGP v4 KEEPALIVE message

Member Typedef Documentation

◆ bgp_keepalive_message

Constructor & Destructor Documentation

◆ BgpKeepaliveMessageLayer() [1/2]

pcpp::BgpKeepaliveMessageLayer::BgpKeepaliveMessageLayer ( uint8_t *  data,
size_t  dataLen,
Layer prevLayer,
Packet packet 
)
inline

A constructor that creates the layer from an existing packet raw data

Parameters
[in]dataA pointer to the raw data
[in]dataLenSize of the data in bytes
[in]prevLayerA pointer to the previous layer
[in]packetA pointer to the Packet instance where layer will be stored in

◆ BgpKeepaliveMessageLayer() [2/2]

pcpp::BgpKeepaliveMessageLayer::BgpKeepaliveMessageLayer ( )

A c'tor that creates a new BGP KEEPALIVE message

Member Function Documentation

◆ getBgpMessageType()

BgpMessageType pcpp::BgpKeepaliveMessageLayer::getBgpMessageType ( ) const
inlinevirtual
Returns
BGP message type

Implements pcpp::BgpLayer.

◆ getKeepaliveHeader()

bgp_keepalive_message* pcpp::BgpKeepaliveMessageLayer::getKeepaliveHeader ( ) const
inline

Get a pointer to the KeepAlive message data. Notice this points directly to the data, so any change will modify the actual packet data

Returns
A pointer to a bgp_keepalive_message structure containing the data