\doxysection{aspa.\+h}
\hypertarget{aspa_8h_source}{}\label{aspa_8h_source}\index{rtrlib/aspa/aspa.h@{rtrlib/aspa/aspa.h}}
\mbox{\hyperlink{aspa_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{00020\ \textcolor{preprocessor}{\#ifndef\ RTR\_ASPA\_H}}
\DoxyCodeLine{00021\ \textcolor{preprocessor}{\#define\ RTR\_ASPA\_H}}
\DoxyCodeLine{00022\ }
\DoxyCodeLine{00023\ \textcolor{preprocessor}{\#include\ "{}\mbox{\hyperlink{aspa__array_8h}{rtrlib/aspa/aspa\_array/aspa\_array.h}}"{}}}
\DoxyCodeLine{00024\ \textcolor{preprocessor}{\#include\ "{}\mbox{\hyperlink{alloc__utils__private_8h}{rtrlib/lib/alloc\_utils\_private.h}}"{}}}
\DoxyCodeLine{00025\ \textcolor{preprocessor}{\#include\ "{}\mbox{\hyperlink{rtr_8h}{rtrlib/rtr/rtr.h}}"{}}}
\DoxyCodeLine{00026\ }
\DoxyCodeLine{00027\ \textcolor{preprocessor}{\#include\ <stdint.h>}}
\DoxyCodeLine{00028\ \textcolor{preprocessor}{\#include\ <stdio.h>}}
\DoxyCodeLine{00029\ \textcolor{preprocessor}{\#include\ <stdlib.h>}}
\DoxyCodeLine{00030\ }
\DoxyCodeLine{00039\ \textcolor{keyword}{struct\ }\mbox{\hyperlink{structaspa__record}{aspa\_record}}\ \{}
\DoxyCodeLine{00040\ \ \ \ \ \ \ \ \ uint32\_t\ \mbox{\hyperlink{structaspa__record_ab322ade16ad4e478e0a6f99a2a594648}{customer\_asn}};}
\DoxyCodeLine{00041\ \ \ \ \ \ \ \ \ \textcolor{keywordtype}{size\_t}\ \mbox{\hyperlink{structaspa__record_a211c65d431f5e29bdd85241a5ba8b36e}{provider\_count}};}
\DoxyCodeLine{00042\ \ \ \ \ \ \ \ \ uint32\_t\ *\mbox{\hyperlink{structaspa__record_a22cccd1fe128aae69d24ef23f5b1ce3a}{provider\_asns}};}
\DoxyCodeLine{00043\ \};}
\DoxyCodeLine{00044\ }
\DoxyCodeLine{00045\ \textcolor{comment}{//\ MARK:\ -\/\ ASPA\ Table}}
\DoxyCodeLine{00046\ }
\DoxyCodeLine{00047\ \textcolor{keyword}{struct\ }\mbox{\hyperlink{structaspa__table}{aspa\_table}};}
\DoxyCodeLine{00048\ }
\DoxyCodeLine{00052\ \textcolor{keyword}{enum}\ \mbox{\hyperlink{rtr__pdus_8h_a99dd4ca7aa1a44d28c0d5c543ec466bd}{\_\_attribute\_\_}}((\_\_packed\_\_))\ aspa\_operation\_type\ \{}
\DoxyCodeLine{00054\ \ \ \ \ \ \ \ \ ASPA\_REMOVE\ =\ 0,}
\DoxyCodeLine{00055\ }
\DoxyCodeLine{00057\ \ \ \ \ \ \ \ \ ASPA\_ADD\ =\ 1}
\DoxyCodeLine{00058\ \};}
\DoxyCodeLine{00059\ }
\DoxyCodeLine{00069\ \textcolor{keyword}{typedef}\ void\ (*\mbox{\hyperlink{group__mod__aspa__h_ga73e1e2e74f1f37727efe950d85fe659e}{aspa\_update\_fp}})(\textcolor{keyword}{struct\ }\mbox{\hyperlink{structaspa__table}{aspa\_table}}\ *\mbox{\hyperlink{structaspa__table}{aspa\_table}},\ \textcolor{keyword}{const}\ \textcolor{keyword}{struct\ }\mbox{\hyperlink{structaspa__record}{aspa\_record}}\ record,}
\DoxyCodeLine{00070\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ const\ struct\ \mbox{\hyperlink{structrtr__socket}{rtr\_socket}}\ *\mbox{\hyperlink{structrtr__socket}{rtr\_socket}},\ \textcolor{keyword}{const}\ \textcolor{keyword}{enum}\ aspa\_operation\_type\ operation\_type);}
\DoxyCodeLine{00071\ }
\DoxyCodeLine{00083\ \textcolor{keyword}{struct\ }\mbox{\hyperlink{structaspa__table}{aspa\_table}}\ \{}
\DoxyCodeLine{00084\ \ \ \ \ \ \ \ \ pthread\_rwlock\_t\ \mbox{\hyperlink{structaspa__table_aaf4c45bc377f0a2bcb074341c4b281dd}{lock}};}
\DoxyCodeLine{00085\ \ \ \ \ \ \ \ \ pthread\_rwlock\_t\ \mbox{\hyperlink{structaspa__table_a66137c7a1599d4d7ca9934a9a289aa7f}{update\_lock}};}
\DoxyCodeLine{00086\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{group__mod__aspa__h_ga73e1e2e74f1f37727efe950d85fe659e}{aspa\_update\_fp}}\ \mbox{\hyperlink{structaspa__table_a6c9d3721c7edbacd4fb97e60721451aa}{update\_fp}};}
\DoxyCodeLine{00087\ \ \ \ \ \ \ \ \ \textcolor{keyword}{struct\ }\mbox{\hyperlink{structaspa__store__node}{aspa\_store\_node}}\ *\mbox{\hyperlink{structaspa__table_ab5cd69154fe44e1ac85a41db79e26e8a}{store}};}
\DoxyCodeLine{00088\ \};}
\DoxyCodeLine{00089\ }
\DoxyCodeLine{00093\ \textcolor{keyword}{enum}\ \mbox{\hyperlink{group__mod__aspa__h_ga18e5d060687b3cdf30d418b2a9639e6b}{aspa\_status}}\ \{}
\DoxyCodeLine{00095\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{group__mod__aspa__h_gga18e5d060687b3cdf30d418b2a9639e6ba333ca59c4b7fd9d978707b61f99fa3e1}{ASPA\_SUCCESS}}\ =\ 0,}
\DoxyCodeLine{00096\ }
\DoxyCodeLine{00098\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{group__mod__aspa__h_gga18e5d060687b3cdf30d418b2a9639e6ba94a14f32d253828c011673462409965d}{ASPA\_ERROR}}\ =\ -\/1,}
\DoxyCodeLine{00099\ }
\DoxyCodeLine{00101\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{group__mod__aspa__h_gga18e5d060687b3cdf30d418b2a9639e6ba63e715dc4046f8e70f41d74bd7e29104}{ASPA\_DUPLICATE\_RECORD}}\ =\ -\/2,}
\DoxyCodeLine{00102\ }
\DoxyCodeLine{00104\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{group__mod__aspa__h_gga18e5d060687b3cdf30d418b2a9639e6ba092af5098a5e3c65cc5bfd3d8d1dcc5d}{ASPA\_RECORD\_NOT\_FOUND}}\ =\ -\/3,}
\DoxyCodeLine{00105\ \};}
\DoxyCodeLine{00106\ }
\DoxyCodeLine{00113\ \textcolor{keywordtype}{void}\ \mbox{\hyperlink{group__mod__aspa__h_ga9f7ce0bb07be778240c2cfd681f56c78}{aspa\_table\_init}}(\textcolor{keyword}{struct}\ \mbox{\hyperlink{structaspa__table}{aspa\_table}}\ *\mbox{\hyperlink{structaspa__table}{aspa\_table}},\ \mbox{\hyperlink{group__mod__aspa__h_ga73e1e2e74f1f37727efe950d85fe659e}{aspa\_update\_fp}}\ update\_fp);}
\DoxyCodeLine{00114\ }
\DoxyCodeLine{00121\ \textcolor{keywordtype}{void}\ \mbox{\hyperlink{group__mod__aspa__h_ga0712bf1c04fdf206369c44c4a926ad67}{aspa\_table\_free}}(\textcolor{keyword}{struct}\ \mbox{\hyperlink{structaspa__table}{aspa\_table}}\ *\mbox{\hyperlink{structaspa__table}{aspa\_table}},\ \textcolor{keywordtype}{bool}\ notify);}
\DoxyCodeLine{00122\ }
\DoxyCodeLine{00132\ \textcolor{keyword}{enum}\ \mbox{\hyperlink{group__mod__aspa__h_ga18e5d060687b3cdf30d418b2a9639e6b}{aspa\_status}}\ \mbox{\hyperlink{group__mod__aspa__h_gaf9c530f15c3cba970deb12a58f33681f}{aspa\_table\_src\_remove}}(\textcolor{keyword}{struct}\ \mbox{\hyperlink{structaspa__table}{aspa\_table}}\ *\mbox{\hyperlink{structaspa__table}{aspa\_table}},\ \textcolor{keyword}{struct}\ \mbox{\hyperlink{structrtr__socket}{rtr\_socket}}\ *\mbox{\hyperlink{structrtr__socket}{rtr\_socket}},\ \textcolor{keywordtype}{bool}\ notify);}
\DoxyCodeLine{00133\ }
\DoxyCodeLine{00134\ \textcolor{comment}{//\ MARK:\ -\/\ AS\_PATH\ Verification}}
\DoxyCodeLine{00135\ }
\DoxyCodeLine{00136\ \textcolor{keyword}{enum}\ \mbox{\hyperlink{group__mod__aspa__h_gae93026f450bf1c059af8104165cb7fa3}{aspa\_direction}}\ \{\ \mbox{\hyperlink{group__mod__aspa__h_ggae93026f450bf1c059af8104165cb7fa3a2ce999f88416410f29548e8458c49e2d}{ASPA\_UPSTREAM}},\ \mbox{\hyperlink{group__mod__aspa__h_ggae93026f450bf1c059af8104165cb7fa3a1f6b0aaba561b06c1a8a81fe1c785854}{ASPA\_DOWNSTREAM}}\ \};}
\DoxyCodeLine{00137\ }
\DoxyCodeLine{00141\ \textcolor{keyword}{enum}\ \mbox{\hyperlink{group__mod__aspa__h_ga3747a87e681c0b05309c156130d3d040}{aspa\_verification\_result}}\ \{}
\DoxyCodeLine{00142\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{group__mod__aspa__h_gga3747a87e681c0b05309c156130d3d040af9979638c4d6a7fb89d761e37f91eeec}{ASPA\_AS\_PATH\_UNKNOWN}},}
\DoxyCodeLine{00143\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{group__mod__aspa__h_gga3747a87e681c0b05309c156130d3d040acee7897d6fea28cf74be0f8a39914e7a}{ASPA\_AS\_PATH\_INVALID}},}
\DoxyCodeLine{00144\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{group__mod__aspa__h_gga3747a87e681c0b05309c156130d3d040ae969bcd04b6b9a380ae0f6d1b8050ae5}{ASPA\_AS\_PATH\_VALID}},}
\DoxyCodeLine{00145\ \};}
\DoxyCodeLine{00146\ }
\DoxyCodeLine{00161\ \textcolor{keyword}{enum}\ \mbox{\hyperlink{group__mod__aspa__h_ga3747a87e681c0b05309c156130d3d040}{aspa\_verification\_result}}\ \mbox{\hyperlink{group__mod__aspa__h_gae8450471c894e69b4fec30e85fa3594f}{aspa\_verify\_as\_path}}(\textcolor{keyword}{struct}\ \mbox{\hyperlink{structaspa__table}{aspa\_table}}\ *\mbox{\hyperlink{structaspa__table}{aspa\_table}},\ uint32\_t\ as\_path[],\ \textcolor{keywordtype}{size\_t}\ \mbox{\hyperlink{rtr__pdus_8h_a96bbf959016e4411c9e6b9812a8be60a}{len}},}
\DoxyCodeLine{00162\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keyword}{enum}\ \mbox{\hyperlink{group__mod__aspa__h_gae93026f450bf1c059af8104165cb7fa3}{aspa\_direction}}\ direction);}
\DoxyCodeLine{00163\ }
\DoxyCodeLine{00169\ \textcolor{keywordtype}{size\_t}\ \mbox{\hyperlink{group__mod__aspa__h_ga9f95586274d22d5b829d30cc2f436f28}{aspa\_collapse\_as\_path}}(uint32\_t\ as\_path[],\ \textcolor{keywordtype}{size\_t}\ \mbox{\hyperlink{rtr__pdus_8h_a96bbf959016e4411c9e6b9812a8be60a}{len}});}
\DoxyCodeLine{00170\ }
\DoxyCodeLine{00171\ \textcolor{preprocessor}{\#endif\ }\textcolor{comment}{/*\ RTR\_ASPA\_H\ */}\textcolor{preprocessor}{}}

\end{DoxyCode}
