\doxysection{pfx.\+h}
\hypertarget{pfx_8h_source}{}\label{pfx_8h_source}\index{rtrlib/pfx/pfx.h@{rtrlib/pfx/pfx.h}}
\mbox{\hyperlink{pfx_8h}{Go to the documentation of this file.}}
\begin{DoxyCode}{0}
\DoxyCodeLine{00001\ \textcolor{comment}{/*}}
\DoxyCodeLine{00002\ \textcolor{comment}{\ *\ This\ file\ is\ part\ of\ RTRlib.}}
\DoxyCodeLine{00003\ \textcolor{comment}{\ *}}
\DoxyCodeLine{00004\ \textcolor{comment}{\ *\ This\ file\ is\ subject\ to\ the\ terms\ and\ conditions\ of\ the\ MIT\ license.}}
\DoxyCodeLine{00005\ \textcolor{comment}{\ *\ See\ the\ file\ LICENSE\ in\ the\ top\ level\ directory\ for\ more\ details.}}
\DoxyCodeLine{00006\ \textcolor{comment}{\ *}}
\DoxyCodeLine{00007\ \textcolor{comment}{\ *\ Website:\ http://rtrlib.realmv6.org/}}
\DoxyCodeLine{00008\ \textcolor{comment}{\ */}}
\DoxyCodeLine{00009\ }
\DoxyCodeLine{00018\ \textcolor{preprocessor}{\#ifndef\ RTR\_PFX\_H}}
\DoxyCodeLine{00019\ \textcolor{preprocessor}{\#define\ RTR\_PFX\_H}}
\DoxyCodeLine{00020\ }
\DoxyCodeLine{00021\ \textcolor{preprocessor}{\#include\ "{}\mbox{\hyperlink{ip_8h}{rtrlib/lib/ip.h}}"{}}}
\DoxyCodeLine{00022\ \textcolor{preprocessor}{\#include\ "{}\mbox{\hyperlink{trie-pfx_8h}{rtrlib/pfx/trie/trie-\/pfx.h}}"{}}}
\DoxyCodeLine{00023\ }
\DoxyCodeLine{00024\ \textcolor{preprocessor}{\#include\ <inttypes.h>}}
\DoxyCodeLine{00025\ }
\DoxyCodeLine{00029\ \textcolor{keyword}{enum}\ \mbox{\hyperlink{group__mod__pfx__h_gacb1f5563c9a0bcfb6a7be631a0e8f15a}{pfx\_rtvals}}\ \{}
\DoxyCodeLine{00031\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{group__mod__pfx__h_ggacb1f5563c9a0bcfb6a7be631a0e8f15aa390c4d5cd921fb06fd7548f6099c6800}{PFX\_SUCCESS}}\ =\ 0,}
\DoxyCodeLine{00032\ }
\DoxyCodeLine{00034\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{group__mod__pfx__h_ggacb1f5563c9a0bcfb6a7be631a0e8f15aa22e5a2c063ffe08b1a02f650703631a0}{PFX\_ERROR}}\ =\ -\/1,}
\DoxyCodeLine{00035\ }
\DoxyCodeLine{00037\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{group__mod__pfx__h_ggacb1f5563c9a0bcfb6a7be631a0e8f15aa575f72a26ad782aac4720c8a25d763c1}{PFX\_DUPLICATE\_RECORD}}\ =\ -\/2,}
\DoxyCodeLine{00038\ }
\DoxyCodeLine{00040\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{group__mod__pfx__h_ggacb1f5563c9a0bcfb6a7be631a0e8f15aaf8b6a635062ca6ca493836c2f4d1fa03}{PFX\_RECORD\_NOT\_FOUND}}\ =\ -\/3}
\DoxyCodeLine{00041\ \};}
\DoxyCodeLine{00042\ }
\DoxyCodeLine{00046\ \textcolor{keyword}{enum}\ \mbox{\hyperlink{group__mod__pfx__h_ga9f87b27f024a9db70884c3981e030aa0}{pfxv\_state}}\ \{}
\DoxyCodeLine{00048\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{group__mod__pfx__h_gga9f87b27f024a9db70884c3981e030aa0a822b53f311ed40e3f91c44f6ac2c6c92}{BGP\_PFXV\_STATE\_VALID}},}
\DoxyCodeLine{00049\ }
\DoxyCodeLine{00051\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{group__mod__pfx__h_gga9f87b27f024a9db70884c3981e030aa0af4c75701949d919bae43e92f5e656342}{BGP\_PFXV\_STATE\_NOT\_FOUND}},}
\DoxyCodeLine{00052\ }
\DoxyCodeLine{00056\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{group__mod__pfx__h_gga9f87b27f024a9db70884c3981e030aa0aae9350d7596c31ff7a04d7a4c34a0459}{BGP\_PFXV\_STATE\_INVALID}}}
\DoxyCodeLine{00057\ \};}
\DoxyCodeLine{00058\ }
\DoxyCodeLine{00065\ \textcolor{keyword}{typedef}\ void\ (*\mbox{\hyperlink{group__mod__pfx__h_ga48478a61dc1cd09f646631b1691ff707}{pfx\_for\_each\_fp}})(\textcolor{keyword}{const}\ \textcolor{keyword}{struct\ }\mbox{\hyperlink{structpfx__record}{pfx\_record}}\ *\mbox{\hyperlink{structpfx__record}{pfx\_record}},\ \textcolor{keywordtype}{void}\ *data);}
\DoxyCodeLine{00066\ }
\DoxyCodeLine{00072\ \textcolor{keywordtype}{void}\ \mbox{\hyperlink{group__mod__pfx__h_ga1c2751808568eef03338a9905a0735ff}{pfx\_table\_init}}(\textcolor{keyword}{struct}\ \mbox{\hyperlink{structpfx__table}{pfx\_table}}\ *\mbox{\hyperlink{structpfx__table}{pfx\_table}},\ \mbox{\hyperlink{group__mod__trie__pfx__h_gafcc9cb0377b569f364b373c82d5d2d3c}{pfx\_update\_fp}}\ update\_fp);}
\DoxyCodeLine{00073\ }
\DoxyCodeLine{00078\ \textcolor{keywordtype}{void}\ \mbox{\hyperlink{group__mod__pfx__h_gaf31f339bbca6180da436a43d0bd17d10}{pfx\_table\_free}}(\textcolor{keyword}{struct}\ \mbox{\hyperlink{structpfx__table}{pfx\_table}}\ *\mbox{\hyperlink{structpfx__table}{pfx\_table}});}
\DoxyCodeLine{00079\ }
\DoxyCodeLine{00088\ \textcolor{keywordtype}{int}\ \mbox{\hyperlink{group__mod__pfx__h_gaae469c2eac68b697dfa4128e1c2ff792}{pfx\_table\_add}}(\textcolor{keyword}{struct}\ \mbox{\hyperlink{structpfx__table}{pfx\_table}}\ *\mbox{\hyperlink{structpfx__table}{pfx\_table}},\ \textcolor{keyword}{const}\ \textcolor{keyword}{struct}\ \mbox{\hyperlink{structpfx__record}{pfx\_record}}\ *\mbox{\hyperlink{structpfx__record}{pfx\_record}});}
\DoxyCodeLine{00089\ }
\DoxyCodeLine{00098\ \textcolor{keywordtype}{int}\ \mbox{\hyperlink{group__mod__pfx__h_ga2f03e320b7d228e7861413b8007e8648}{pfx\_table\_remove}}(\textcolor{keyword}{struct}\ \mbox{\hyperlink{structpfx__table}{pfx\_table}}\ *\mbox{\hyperlink{structpfx__table}{pfx\_table}},\ \textcolor{keyword}{const}\ \textcolor{keyword}{struct}\ \mbox{\hyperlink{structpfx__record}{pfx\_record}}\ *\mbox{\hyperlink{structpfx__record}{pfx\_record}});}
\DoxyCodeLine{00099\ }
\DoxyCodeLine{00107\ \textcolor{keywordtype}{int}\ \mbox{\hyperlink{group__mod__pfx__h_gabcdf5278a027b9e6e1051eb1ecfac782}{pfx\_table\_src\_remove}}(\textcolor{keyword}{struct}\ \mbox{\hyperlink{structpfx__table}{pfx\_table}}\ *\mbox{\hyperlink{structpfx__table}{pfx\_table}},\ \textcolor{keyword}{const}\ \textcolor{keyword}{struct}\ \mbox{\hyperlink{structrtr__socket}{rtr\_socket}}\ *\mbox{\hyperlink{structpfx__record_a1e88420bbb68ab651b3c17dfc1975ec3}{socket}});}
\DoxyCodeLine{00108\ }
\DoxyCodeLine{00119\ \textcolor{keywordtype}{int}\ \mbox{\hyperlink{group__mod__pfx__h_ga24a6236cd78f9708c089793c02eb693f}{pfx\_table\_validate}}(\textcolor{keyword}{struct}\ \mbox{\hyperlink{structpfx__table}{pfx\_table}}\ *\mbox{\hyperlink{structpfx__table}{pfx\_table}},\ \textcolor{keyword}{const}\ uint32\_t\ \mbox{\hyperlink{rtr__pdus_8h_af54a4e57359d5c0dc5935878531a9e58}{asn}},\ \textcolor{keyword}{const}\ \textcolor{keyword}{struct}\ \mbox{\hyperlink{structlrtr__ip__addr}{lrtr\_ip\_addr}}\ *\mbox{\hyperlink{structpfx__record_a30ba39c89dadffbade2247a9776a68b6}{prefix}},}
\DoxyCodeLine{00120\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ uint8\_t\ mask\_len,\ \textcolor{keyword}{enum}\ \mbox{\hyperlink{group__mod__pfx__h_ga9f87b27f024a9db70884c3981e030aa0}{pfxv\_state}}\ *result);}
\DoxyCodeLine{00121\ }
\DoxyCodeLine{00135\ \textcolor{keywordtype}{int}\ \mbox{\hyperlink{group__mod__pfx__h_gadc7e5454793c8c69724a72a14ffe0f3b}{pfx\_table\_validate\_r}}(\textcolor{keyword}{struct}\ \mbox{\hyperlink{structpfx__table}{pfx\_table}}\ *\mbox{\hyperlink{structpfx__table}{pfx\_table}},\ \textcolor{keyword}{struct}\ \mbox{\hyperlink{structpfx__record}{pfx\_record}}\ **reason,\ \textcolor{keywordtype}{unsigned}\ \textcolor{keywordtype}{int}\ *reason\_len,}
\DoxyCodeLine{00136\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ uint32\_t\ \mbox{\hyperlink{rtr__pdus_8h_af54a4e57359d5c0dc5935878531a9e58}{asn}},\ \textcolor{keyword}{const}\ \textcolor{keyword}{struct}\ \mbox{\hyperlink{structlrtr__ip__addr}{lrtr\_ip\_addr}}\ *\mbox{\hyperlink{structpfx__record_a30ba39c89dadffbade2247a9776a68b6}{prefix}},\ \textcolor{keyword}{const}\ uint8\_t\ mask\_len,}
\DoxyCodeLine{00137\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keyword}{enum}\ \mbox{\hyperlink{group__mod__pfx__h_ga9f87b27f024a9db70884c3981e030aa0}{pfxv\_state}}\ *result);}
\DoxyCodeLine{00138\ }
\DoxyCodeLine{00147\ \textcolor{keywordtype}{void}\ \mbox{\hyperlink{group__mod__pfx__h_gac22895fe1d7d1de65003de76399be48d}{pfx\_table\_for\_each\_ipv4\_record}}(\textcolor{keyword}{struct}\ \mbox{\hyperlink{structpfx__table}{pfx\_table}}\ *\mbox{\hyperlink{structpfx__table}{pfx\_table}},\ \mbox{\hyperlink{group__mod__pfx__h_ga48478a61dc1cd09f646631b1691ff707}{pfx\_for\_each\_fp}}\ fp,\ \textcolor{keywordtype}{void}\ *data);}
\DoxyCodeLine{00148\ }
\DoxyCodeLine{00157\ \textcolor{keywordtype}{void}\ \mbox{\hyperlink{group__mod__pfx__h_ga06d1f95df3a8952bced60588d52bc51e}{pfx\_table\_for\_each\_ipv6\_record}}(\textcolor{keyword}{struct}\ \mbox{\hyperlink{structpfx__table}{pfx\_table}}\ *\mbox{\hyperlink{structpfx__table}{pfx\_table}},\ \mbox{\hyperlink{group__mod__pfx__h_ga48478a61dc1cd09f646631b1691ff707}{pfx\_for\_each\_fp}}\ fp,\ \textcolor{keywordtype}{void}\ *data);}
\DoxyCodeLine{00158\ }
\DoxyCodeLine{00159\ \textcolor{preprocessor}{\#endif}}

\end{DoxyCode}
