11 #ifndef BGP_PATH_ATTR_H 12 #define BGP_PATH_ATTR_H 87 ssize_t
doPrint(
size_t indent, uint8_t **to,
size_t *buf_sz)
const;
102 virtual ssize_t
parse(
const uint8_t *from,
size_t msg_sz);
113 virtual ssize_t
write(uint8_t *to,
size_t buf_sz)
const;
115 virtual ssize_t
length()
const;
143 ssize_t
printFlags(
size_t indent, uint8_t **to,
size_t *buf_sz)
const;
147 ssize_t
writeHeader(uint8_t *buffer,
size_t buffer_sz)
const;
181 ssize_t
parse(
const uint8_t *buffer,
size_t length);
182 ssize_t
write(uint8_t *buffer,
size_t buffer_sz)
const;
183 ssize_t
doPrint(
size_t indent, uint8_t **to,
size_t *buf_sz)
const;
215 size_t getCount()
const;
216 bool prepend(uint32_t asn);
249 bool prepend(uint32_t asn);
251 ssize_t
parse(
const uint8_t *buffer,
size_t length);
252 ssize_t
write(uint8_t *buffer,
size_t buffer_sz)
const;
253 ssize_t
doPrint(
size_t indent, uint8_t **to,
size_t *buf_sz)
const;
257 void addSeg(uint32_t asn);
275 ssize_t
parse(
const uint8_t *buffer,
size_t length);
276 ssize_t
write(uint8_t *buffer,
size_t buffer_sz)
const;
277 ssize_t
doPrint(
size_t indent, uint8_t **to,
size_t *buf_sz)
const;
296 ssize_t
parse(
const uint8_t *buffer,
size_t length);
297 ssize_t
write(uint8_t *buffer,
size_t buffer_sz)
const;
298 ssize_t
doPrint(
size_t indent, uint8_t **to,
size_t *buf_sz)
const;
317 ssize_t
parse(
const uint8_t *buffer,
size_t length);
318 ssize_t
write(uint8_t *buffer,
size_t buffer_sz)
const;
319 ssize_t
doPrint(
size_t indent, uint8_t **to,
size_t *buf_sz)
const;
332 ssize_t
parse(
const uint8_t *buffer,
size_t length);
333 ssize_t
write(uint8_t *buffer,
size_t buffer_sz)
const;
334 ssize_t
doPrint(
size_t indent, uint8_t **to,
size_t *buf_sz)
const;
366 ssize_t
parse(
const uint8_t *buffer,
size_t length);
367 ssize_t
write(uint8_t *buffer,
size_t buffer_sz)
const;
368 ssize_t
doPrint(
size_t indent, uint8_t **to,
size_t *buf_sz)
const;
386 bool prepend(uint32_t asn);
389 ssize_t
parse(
const uint8_t *buffer,
size_t length);
390 ssize_t
write(uint8_t *buffer,
size_t buffer_sz)
const;
391 ssize_t
doPrint(
size_t indent, uint8_t **to,
size_t *buf_sz)
const;
394 void addSeg(uint32_t asn);
418 ssize_t
parse(
const uint8_t *buffer,
size_t length);
419 ssize_t
write(uint8_t *buffer,
size_t buffer_sz)
const;
420 ssize_t
doPrint(
size_t indent, uint8_t **to,
size_t *buf_sz)
const;
439 ssize_t
parse(
const uint8_t *buffer,
size_t length);
440 ssize_t
write(uint8_t *buffer,
size_t buffer_sz)
const;
441 ssize_t
doPrint(
size_t indent, uint8_t **to,
size_t *buf_sz)
const;
452 static int16_t GetAfiFromBuffer(
const uint8_t *buffer,
size_t length);
467 ssize_t
parseHeader(
const uint8_t *buffer,
size_t length);
478 uint8_t nexthop_global[16];
479 uint8_t nexthop_linklocal[16];
480 std::vector<Prefix6> nlri;
483 ssize_t
parse(
const uint8_t *buffer,
size_t length);
484 ssize_t
write(uint8_t *buffer,
size_t buffer_sz)
const;
485 ssize_t
doPrint(
size_t indent, uint8_t **to,
size_t *buf_sz)
const;
500 ssize_t
parse(
const uint8_t *buffer,
size_t length);
501 ssize_t
write(uint8_t *buffer,
size_t buffer_sz)
const;
502 ssize_t
doPrint(
size_t indent, uint8_t **to,
size_t *buf_sz)
const;
505 const uint8_t *getNexthop()
const;
506 const uint8_t *getNlri()
const;
508 size_t getNexthopLength()
const;
509 size_t getNlriLength()
const;
525 std::vector<Prefix6> withdrawn_routes;
528 ssize_t
parse(
const uint8_t *buffer,
size_t length);
529 ssize_t
write(uint8_t *buffer,
size_t buffer_sz)
const;
530 ssize_t
doPrint(
size_t indent, uint8_t **to,
size_t *buf_sz)
const;
545 ssize_t
parse(
const uint8_t *buffer,
size_t length);
546 ssize_t
write(uint8_t *buffer,
size_t buffer_sz)
const;
547 ssize_t
doPrint(
size_t indent, uint8_t **to,
size_t *buf_sz)
const;
550 const uint8_t *getWithdrawnRoutes()
const;
551 size_t getWithdrawnRoutesLength()
const;
553 uint8_t *withdrawn_routes;
554 size_t withdrawn_routes_len;
558 #endif // BGP_PATH_ATTR_H ssize_t printFlags(size_t indent, uint8_t **to, size_t *buf_sz) const
Utility function to print flags for attribute.
Atomic aggregate attribute.
ssize_t doPrint(size_t indent, uint8_t **to, size_t *buf_sz) const
Print implementation.
bool partial
Attribute flag: partial.
ssize_t writeHeader(uint8_t *buffer, size_t buffer_sz) const
Write attribute header to buffer. (Flag, Type)
std::vector< uint32_t > value
The segment value.
virtual ssize_t length() const
Get size in bytes required to serialize the object.
BgpPathAttrib(BgpLogHandler *logger)
Construct a new Bgp Path Attrib:: Bgp Path Attrib object.
MP-BGP ReachNlri IPv6 NLRI class.
bool is_4b
Is ASNs in the attribute four octets?
MP-BGP UnreachNlri container for unknow AFI/SAFI.
bool optional
Attribute flag: Optional.
virtual ssize_t parse(const uint8_t *from, size_t msg_sz)
Deserialize a BGP update message path attribute.
bool is_4b
Is ASNs in the attribute four octets?
ssize_t parseHeader(const uint8_t *buffer, size_t length)
Utility function to parse attribute header. (Flag, type, length)
uint16_t afi
Address Family Identifier.
The serializable base class.
uint16_t value_len
Attribute length. Length field is only used in deserialization for parseHeader() to pass length field...
AS4_AGGREGATOR attribute.
bool transitive
Attribute flag: Transitive.
uint32_t local_pref
Local Pref.
std::vector< BgpAsPathSegment > as_paths
The AS Path segments.
std::vector< BgpAsPathSegment > as4_paths
The AS4_PATH segments.
BgpPathAttribType
BGP attribute type codes.
uint32_t aggregator_asn4
Aggregator ASN.
uint32_t aggregator_asn
Aggregator ASN.
BgpAsPathSegmentType
AS_PATH segment types.
uint8_t type
Segment type.
bool extended
Attribute flag: extended.
virtual BgpPathAttrib * clone() const
Clone the attribute.
MP-BGP Reach/Unreach NLRI base class.
IPv6 Route/Prefix related utilities.
An AS_PATH or AS4_PATH segment.
uint32_t aggregator
Aggregator in network byte order.
Multi Exit Discriminator attribute.
virtual ssize_t write(uint8_t *to, size_t buf_sz) const
Serialize a BGP update message path attribute.
uint32_t aggregator
Aggregator in network byte order.
BgpPathAttribOrigins
BGP origin path attribute values.
uint32_t next_hop
The nexthop in network byte order.
uint8_t safi
Subsequent Address Family Identifier.
uint8_t type_code
Attribute type code.
MP-BGP ReachNlri container for unknow AFI/SAFI.
bool is_4b
Is ASNs in this segment four octets?
static uint8_t GetTypeFromBuffer(const uint8_t *buffer, size_t buffer_sz)
Get type of attribute from buffer.
MP-BGP UnreachNlri IPv6 class.
virtual ~BgpPathAttrib()
Destroy the Bgp Path Attrib:: Bgp Path Attrib object.