11 #ifndef BGP_OPEN_MSG_H_ 12 #define BGP_OPEN_MSG_H_ 43 bool setAsn(uint32_t my_asn);
51 bool addCapability(std::shared_ptr<BgpCapability> capability);
53 ssize_t
doPrint(
size_t indent, uint8_t **to,
size_t *buf_sz)
const;
55 ssize_t
parse(
const uint8_t *from,
size_t msg_sz);
57 ssize_t
write(uint8_t *to,
size_t buf_sz)
const;
61 const std::vector<std::shared_ptr<BgpCapability>>&
getCapabilities()
const;
63 std::vector<std::shared_ptr<BgpCapability>> capabilities;
68 #endif // BGP_OPEN_MSG_H_ ssize_t parse(const uint8_t *from, size_t msg_sz)
Parse a BGP open message body.
bool setAsn(uint32_t my_asn)
Set ASN.
The BgpOpenMessage class.
BgpOpenMessage(BgpLogHandler *logger, bool use_4b_asn)
Construct a new Bgp Open Message:: Bgp Open Message object.
const std::vector< std::shared_ptr< BgpCapability > > & getCapabilities() const
Get capabilities list.
The BgpMessage base class.
ssize_t write(uint8_t *to, size_t buf_sz) const
Serialize a BGP message body.
bool hasCapability(uint8_t code) const
Check if open message has a capability.
ssize_t doPrint(size_t indent, uint8_t **to, size_t *buf_sz) const
Print implementation.
uint32_t getAsn() const
Get ASN.
bool addCapability(std::shared_ptr< BgpCapability > capability)
Add a capability.