38 virtual ssize_t
parse(
const uint8_t *buffer,
size_t buf_sz) = 0;
49 virtual ssize_t
write(uint8_t *buffer,
size_t buf_sz)
const = 0;
61 virtual bool operator== (
const Prefix &other)
const = 0;
65 virtual bool operator> (
const Prefix &other)
const = 0;
69 virtual bool operator< (
const Prefix &other)
const = 0;
71 virtual bool operator>= (
const Prefix &other)
const = 0;
72 virtual bool operator<= (
const Prefix &other)
const = 0;
73 virtual bool operator!= (
const Prefix &other)
const = 0;
80 #endif // BGP_PREFIX_H_ Afi
Address Family Identifiers.
virtual ssize_t write(uint8_t *buffer, size_t buf_sz) const =0
Write a prefix to NLRI buffer.
virtual bool includes(const Prefix &other) const =0
Test if another prefix is inside this prefix.
uint32_t cidr_to_mask(uint8_t cidr)
Convert netmask in CIDR notation to network bytes integer.
virtual ssize_t parse(const uint8_t *buffer, size_t buf_sz)=0
Parse a NLRI prefix from buffer.
Route/Prefix related utilities.