PcapPlusPlus  21.11
pcpp::BgpRouteRefreshMessageLayer Class Reference

#include <BgpLayer.h>

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

Classes

struct  bgp_route_refresh_message
 

Public Member Functions

 BgpRouteRefreshMessageLayer (uint8_t *data, size_t dataLen, Layer *prevLayer, Packet *packet)
 
 BgpRouteRefreshMessageLayer (uint16_t afi, uint8_t safi)
 
bgp_route_refresh_messagegetRouteRefreshHeader () 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

- Public Types inherited from pcpp::BgpLayer
enum  BgpMessageType {
  Open = 1, Update = 2, Notification = 3, Keepalive = 4,
  RouteRefresh = 5
}
 
- 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 ROUTE-REFRESH message

Constructor & Destructor Documentation

◆ BgpRouteRefreshMessageLayer() [1/2]

pcpp::BgpRouteRefreshMessageLayer::BgpRouteRefreshMessageLayer ( 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

◆ BgpRouteRefreshMessageLayer() [2/2]

pcpp::BgpRouteRefreshMessageLayer::BgpRouteRefreshMessageLayer ( uint16_t  afi,
uint8_t  safi 
)

A c'tor that creates a new BGP ROUTE-REFRESH message

Parameters
[in]afiThe Address Family Identifier (AFI) value to set in the message
[in]safiThe Subsequent Address Family Identifier (SAFI) value to set in the message

Member Function Documentation

◆ getBgpMessageType()

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

Implements pcpp::BgpLayer.

◆ getRouteRefreshHeader()

bgp_route_refresh_message* pcpp::BgpRouteRefreshMessageLayer::getRouteRefreshHeader ( ) const
inline

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

Returns
A pointer to a bgp_route_refresh_message structure containing the data