libbgp  0.6
A C++ BGP Library.
Public Member Functions | Public Attributes | List of all members
libbgp::Prefix Class Referenceabstract

Route/Prefix related utilities. More...

#include <prefix.h>

Inheritance diagram for libbgp::Prefix:
Inheritance graph
[legend]

Public Member Functions

virtual ssize_t parse (const uint8_t *buffer, size_t buf_sz)=0
 Parse a NLRI prefix from buffer. More...
 
virtual ssize_t write (uint8_t *buffer, size_t buf_sz) const =0
 Write a prefix to NLRI buffer. More...
 
virtual bool includes (const Prefix &other) const =0
 Test if another prefix is inside this prefix. More...
 
virtual bool operator== (const Prefix &other) const =0
 
virtual bool operator> (const Prefix &other) const =0
 
virtual bool operator< (const Prefix &other) const =0
 
virtual bool operator>= (const Prefix &other) const =0
 
virtual bool operator<= (const Prefix &other) const =0
 
virtual bool operator!= (const Prefix &other) const =0
 

Public Attributes

Afi afi
 

Detailed Description

Route/Prefix related utilities.

Definition at line 25 of file prefix.h.

Member Function Documentation

◆ includes()

virtual bool libbgp::Prefix::includes ( const Prefix other) const
pure virtual

Test if another prefix is inside this prefix.

Parameters
otherThe other prefix.
Returns
true The other prefix is in this prefix.
false The other prefix is not in this prefix.

Implemented in libbgp::Prefix6, and libbgp::Prefix4.

◆ parse()

virtual ssize_t libbgp::Prefix::parse ( const uint8_t *  buffer,
size_t  buf_sz 
)
pure virtual

Parse a NLRI prefix from buffer.

Parameters
bufferBuffer to parse from.
buf_szSize of the buffer.
Returns
ssize_t Bytes read.
Return values
-1Failed to parse prefix.
>=0Bytes read.

Implemented in libbgp::Prefix6, and libbgp::Prefix4.

◆ write()

virtual ssize_t libbgp::Prefix::write ( uint8_t *  buffer,
size_t  buf_sz 
) const
pure virtual

Write a prefix to NLRI buffer.

Parameters
bufferBuffer to write to.
buf_szSize of the buffer (max write size).
Returns
ssize_t Bytes written.
Return values
-1Failed to write.
>=0Bytes written.

Implemented in libbgp::Prefix6, and libbgp::Prefix4.


The documentation for this class was generated from the following file: