\doxysection{rtrlib/pfx/pfx.h File Reference}
\hypertarget{pfx_8h}{}\label{pfx_8h}\index{rtrlib/pfx/pfx.h@{rtrlib/pfx/pfx.h}}
{\ttfamily \#include "{}rtrlib/lib/ip.\+h"{}}\newline
{\ttfamily \#include "{}rtrlib/pfx/trie/trie-\/pfx.\+h"{}}\newline
{\ttfamily \#include $<$inttypes.\+h$>$}\newline
\doxysubsubsection*{Typedefs}
\begin{DoxyCompactItemize}
\item 
typedef void(\texorpdfstring{$\ast$}{*} \mbox{\hyperlink{group__mod__pfx__h_ga48478a61dc1cd09f646631b1691ff707}{pfx\+\_\+for\+\_\+each\+\_\+fp}}) (const struct \mbox{\hyperlink{structpfx__record}{pfx\+\_\+record}} \texorpdfstring{$\ast$}{*}\mbox{\hyperlink{structpfx__record}{pfx\+\_\+record}}, void \texorpdfstring{$\ast$}{*}data)
\begin{DoxyCompactList}\small\item\em A function pointer that is called for each record in the \doxylink{structpfx__table}{pfx\+\_\+table}. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsubsection*{Enumerations}
\begin{DoxyCompactItemize}
\item 
enum \mbox{\hyperlink{group__mod__pfx__h_gacb1f5563c9a0bcfb6a7be631a0e8f15a}{pfx\+\_\+rtvals}} \{ \mbox{\hyperlink{group__mod__pfx__h_ggacb1f5563c9a0bcfb6a7be631a0e8f15aa390c4d5cd921fb06fd7548f6099c6800}{PFX\+\_\+\+SUCCESS}} = 0
, \mbox{\hyperlink{group__mod__pfx__h_ggacb1f5563c9a0bcfb6a7be631a0e8f15aa22e5a2c063ffe08b1a02f650703631a0}{PFX\+\_\+\+ERROR}} = -\/1
, \mbox{\hyperlink{group__mod__pfx__h_ggacb1f5563c9a0bcfb6a7be631a0e8f15aa575f72a26ad782aac4720c8a25d763c1}{PFX\+\_\+\+DUPLICATE\+\_\+\+RECORD}} = -\/2
, \mbox{\hyperlink{group__mod__pfx__h_ggacb1f5563c9a0bcfb6a7be631a0e8f15aaf8b6a635062ca6ca493836c2f4d1fa03}{PFX\+\_\+\+RECORD\+\_\+\+NOT\+\_\+\+FOUND}} = -\/3
 \}
\begin{DoxyCompactList}\small\item\em Possible return values for pfx\+\_\+ functions. \end{DoxyCompactList}\item 
enum \mbox{\hyperlink{group__mod__pfx__h_ga9f87b27f024a9db70884c3981e030aa0}{pfxv\+\_\+state}} \{ \mbox{\hyperlink{group__mod__pfx__h_gga9f87b27f024a9db70884c3981e030aa0a822b53f311ed40e3f91c44f6ac2c6c92}{BGP\+\_\+\+PFXV\+\_\+\+STATE\+\_\+\+VALID}}
, \mbox{\hyperlink{group__mod__pfx__h_gga9f87b27f024a9db70884c3981e030aa0af4c75701949d919bae43e92f5e656342}{BGP\+\_\+\+PFXV\+\_\+\+STATE\+\_\+\+NOT\+\_\+\+FOUND}}
, \mbox{\hyperlink{group__mod__pfx__h_gga9f87b27f024a9db70884c3981e030aa0aae9350d7596c31ff7a04d7a4c34a0459}{BGP\+\_\+\+PFXV\+\_\+\+STATE\+\_\+\+INVALID}}
 \}
\begin{DoxyCompactList}\small\item\em Validation states returned from pfx\+\_\+validate\+\_\+origin. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsubsection*{Functions}
\begin{DoxyCompactItemize}
\item 
void \mbox{\hyperlink{group__mod__pfx__h_ga1c2751808568eef03338a9905a0735ff}{pfx\+\_\+table\+\_\+init}} (struct \mbox{\hyperlink{structpfx__table}{pfx\+\_\+table}} \texorpdfstring{$\ast$}{*}\mbox{\hyperlink{structpfx__table}{pfx\+\_\+table}}, \mbox{\hyperlink{group__mod__trie__pfx__h_gafcc9cb0377b569f364b373c82d5d2d3c}{pfx\+\_\+update\+\_\+fp}} update\+\_\+fp)
\begin{DoxyCompactList}\small\item\em Initializes the \doxylink{structpfx__table}{pfx\+\_\+table} struct. \end{DoxyCompactList}\item 
void \mbox{\hyperlink{group__mod__pfx__h_gaf31f339bbca6180da436a43d0bd17d10}{pfx\+\_\+table\+\_\+free}} (struct \mbox{\hyperlink{structpfx__table}{pfx\+\_\+table}} \texorpdfstring{$\ast$}{*}\mbox{\hyperlink{structpfx__table}{pfx\+\_\+table}})
\begin{DoxyCompactList}\small\item\em Frees all memory associated with the \doxylink{structpfx__table}{pfx\+\_\+table}. \end{DoxyCompactList}\item 
int \mbox{\hyperlink{group__mod__pfx__h_gaae469c2eac68b697dfa4128e1c2ff792}{pfx\+\_\+table\+\_\+add}} (struct \mbox{\hyperlink{structpfx__table}{pfx\+\_\+table}} \texorpdfstring{$\ast$}{*}\mbox{\hyperlink{structpfx__table}{pfx\+\_\+table}}, const struct \mbox{\hyperlink{structpfx__record}{pfx\+\_\+record}} \texorpdfstring{$\ast$}{*}\mbox{\hyperlink{structpfx__record}{pfx\+\_\+record}})
\begin{DoxyCompactList}\small\item\em Adds a \doxylink{structpfx__record}{pfx\+\_\+record} to a \doxylink{structpfx__table}{pfx\+\_\+table}. \end{DoxyCompactList}\item 
int \mbox{\hyperlink{group__mod__pfx__h_ga2f03e320b7d228e7861413b8007e8648}{pfx\+\_\+table\+\_\+remove}} (struct \mbox{\hyperlink{structpfx__table}{pfx\+\_\+table}} \texorpdfstring{$\ast$}{*}\mbox{\hyperlink{structpfx__table}{pfx\+\_\+table}}, const struct \mbox{\hyperlink{structpfx__record}{pfx\+\_\+record}} \texorpdfstring{$\ast$}{*}\mbox{\hyperlink{structpfx__record}{pfx\+\_\+record}})
\begin{DoxyCompactList}\small\item\em Removes a \doxylink{structpfx__record}{pfx\+\_\+record} from a \doxylink{structpfx__table}{pfx\+\_\+table}. \end{DoxyCompactList}\item 
int \mbox{\hyperlink{group__mod__pfx__h_gabcdf5278a027b9e6e1051eb1ecfac782}{pfx\+\_\+table\+\_\+src\+\_\+remove}} (struct \mbox{\hyperlink{structpfx__table}{pfx\+\_\+table}} \texorpdfstring{$\ast$}{*}\mbox{\hyperlink{structpfx__table}{pfx\+\_\+table}}, const struct \mbox{\hyperlink{structrtr__socket}{rtr\+\_\+socket}} \texorpdfstring{$\ast$}{*}socket)
\begin{DoxyCompactList}\small\item\em Removes all entries in the \doxylink{structpfx__table}{pfx\+\_\+table} that match the passed socket\+\_\+id value from a \doxylink{structpfx__table}{pfx\+\_\+table}. \end{DoxyCompactList}\item 
int \mbox{\hyperlink{group__mod__pfx__h_ga24a6236cd78f9708c089793c02eb693f}{pfx\+\_\+table\+\_\+validate}} (struct \mbox{\hyperlink{structpfx__table}{pfx\+\_\+table}} \texorpdfstring{$\ast$}{*}\mbox{\hyperlink{structpfx__table}{pfx\+\_\+table}}, const uint32\+\_\+t \mbox{\hyperlink{rtr__pdus_8h_af54a4e57359d5c0dc5935878531a9e58}{asn}}, const struct \mbox{\hyperlink{structlrtr__ip__addr}{lrtr\+\_\+ip\+\_\+addr}} \texorpdfstring{$\ast$}{*}prefix, const uint8\+\_\+t mask\+\_\+len, enum \mbox{\hyperlink{group__mod__pfx__h_ga9f87b27f024a9db70884c3981e030aa0}{pfxv\+\_\+state}} \texorpdfstring{$\ast$}{*}result)
\begin{DoxyCompactList}\small\item\em Validates the origin of a BGP-\/\+Route. \end{DoxyCompactList}\item 
int \mbox{\hyperlink{group__mod__pfx__h_gadc7e5454793c8c69724a72a14ffe0f3b}{pfx\+\_\+table\+\_\+validate\+\_\+r}} (struct \mbox{\hyperlink{structpfx__table}{pfx\+\_\+table}} \texorpdfstring{$\ast$}{*}\mbox{\hyperlink{structpfx__table}{pfx\+\_\+table}}, struct \mbox{\hyperlink{structpfx__record}{pfx\+\_\+record}} \texorpdfstring{$\ast$}{*}\texorpdfstring{$\ast$}{*}reason, unsigned int \texorpdfstring{$\ast$}{*}reason\+\_\+len, const uint32\+\_\+t \mbox{\hyperlink{rtr__pdus_8h_af54a4e57359d5c0dc5935878531a9e58}{asn}}, const struct \mbox{\hyperlink{structlrtr__ip__addr}{lrtr\+\_\+ip\+\_\+addr}} \texorpdfstring{$\ast$}{*}prefix, const uint8\+\_\+t mask\+\_\+len, enum \mbox{\hyperlink{group__mod__pfx__h_ga9f87b27f024a9db70884c3981e030aa0}{pfxv\+\_\+state}} \texorpdfstring{$\ast$}{*}result)
\begin{DoxyCompactList}\small\item\em Validates the origin of a BGP-\/\+Route and returns a list of \doxylink{structpfx__record}{pfx\+\_\+record} that decided the result. \end{DoxyCompactList}\item 
void \mbox{\hyperlink{group__mod__pfx__h_gac22895fe1d7d1de65003de76399be48d}{pfx\+\_\+table\+\_\+for\+\_\+each\+\_\+ipv4\+\_\+record}} (struct \mbox{\hyperlink{structpfx__table}{pfx\+\_\+table}} \texorpdfstring{$\ast$}{*}\mbox{\hyperlink{structpfx__table}{pfx\+\_\+table}}, \mbox{\hyperlink{group__mod__pfx__h_ga48478a61dc1cd09f646631b1691ff707}{pfx\+\_\+for\+\_\+each\+\_\+fp}} fp, void \texorpdfstring{$\ast$}{*}data)
\begin{DoxyCompactList}\small\item\em Iterates over all IPv4 records in the \doxylink{structpfx__table}{pfx\+\_\+table}. \end{DoxyCompactList}\item 
void \mbox{\hyperlink{group__mod__pfx__h_ga06d1f95df3a8952bced60588d52bc51e}{pfx\+\_\+table\+\_\+for\+\_\+each\+\_\+ipv6\+\_\+record}} (struct \mbox{\hyperlink{structpfx__table}{pfx\+\_\+table}} \texorpdfstring{$\ast$}{*}\mbox{\hyperlink{structpfx__table}{pfx\+\_\+table}}, \mbox{\hyperlink{group__mod__pfx__h_ga48478a61dc1cd09f646631b1691ff707}{pfx\+\_\+for\+\_\+each\+\_\+fp}} fp, void \texorpdfstring{$\ast$}{*}data)
\begin{DoxyCompactList}\small\item\em Iterates over all IPv6 records in the \doxylink{structpfx__table}{pfx\+\_\+table}. \end{DoxyCompactList}\end{DoxyCompactItemize}
