\doxysection{rtrlib/aspa/aspa\+\_\+array/aspa\+\_\+array.h File Reference}
\hypertarget{aspa__array_8h}{}\label{aspa__array_8h}\index{rtrlib/aspa/aspa\_array/aspa\_array.h@{rtrlib/aspa/aspa\_array/aspa\_array.h}}
{\ttfamily \#include "{}../aspa.\+h"{}}\newline
{\ttfamily \#include $<$stdbool.\+h$>$}\newline
{\ttfamily \#include $<$stdint.\+h$>$}\newline
{\ttfamily \#include $<$stdlib.\+h$>$}\newline
{\ttfamily \#include $<$string.\+h$>$}\newline
\doxysubsubsection*{Data Structures}
\begin{DoxyCompactItemize}
\item 
struct \mbox{\hyperlink{structaspa__array}{aspa\+\_\+array}}
\begin{DoxyCompactList}\small\item\em Struct which is similar in function to std\+::vector from C++. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsubsection*{Functions}
\begin{DoxyCompactItemize}
\item 
enum \mbox{\hyperlink{group__mod__aspa__h_ga18e5d060687b3cdf30d418b2a9639e6b}{aspa\+\_\+status}} \mbox{\hyperlink{aspa__array_8h_a50a106912f721fd5bac2e73afc578615}{aspa\+\_\+array\+\_\+create}} (struct \mbox{\hyperlink{structaspa__array}{aspa\+\_\+array}} \texorpdfstring{$\ast$}{*}\texorpdfstring{$\ast$}{*}array\+\_\+ptr)
\begin{DoxyCompactList}\small\item\em Creates an vector object. \end{DoxyCompactList}\item 
void \mbox{\hyperlink{aspa__array_8h_a957138636c3f6cf544b88b1462b6b51e}{aspa\+\_\+array\+\_\+free}} (struct \mbox{\hyperlink{structaspa__array}{aspa\+\_\+array}} \texorpdfstring{$\ast$}{*}array, bool free\+\_\+provider\+\_\+arrays)
\begin{DoxyCompactList}\small\item\em Deletes the given ASPA array. \end{DoxyCompactList}\item 
enum \mbox{\hyperlink{group__mod__aspa__h_ga18e5d060687b3cdf30d418b2a9639e6b}{aspa\+\_\+status}} \mbox{\hyperlink{aspa__array_8h_abf0f685f8aa018a017518c63a24e7546}{aspa\+\_\+array\+\_\+insert}} (struct \mbox{\hyperlink{structaspa__array}{aspa\+\_\+array}} \texorpdfstring{$\ast$}{*}array, size\+\_\+t index, struct \mbox{\hyperlink{structaspa__record}{aspa\+\_\+record}} \texorpdfstring{$\ast$}{*}record, bool copy\+\_\+providers)
\begin{DoxyCompactList}\small\item\em Inserts a given ASPA record into the array, preserving its order. \end{DoxyCompactList}\item 
enum \mbox{\hyperlink{group__mod__aspa__h_ga18e5d060687b3cdf30d418b2a9639e6b}{aspa\+\_\+status}} \mbox{\hyperlink{aspa__array_8h_a6bac0bd0c93c1f489b63476cc6ea10cf}{aspa\+\_\+array\+\_\+append}} (struct \mbox{\hyperlink{structaspa__array}{aspa\+\_\+array}} \texorpdfstring{$\ast$}{*}array, struct \mbox{\hyperlink{structaspa__record}{aspa\+\_\+record}} \texorpdfstring{$\ast$}{*}record, bool copy\+\_\+providers)
\begin{DoxyCompactList}\small\item\em Appends a given ASPA record to the array. \end{DoxyCompactList}\item 
enum \mbox{\hyperlink{group__mod__aspa__h_ga18e5d060687b3cdf30d418b2a9639e6b}{aspa\+\_\+status}} \mbox{\hyperlink{aspa__array_8h_a84310fd7e6e9e0c8b4514b3f71597b90}{aspa\+\_\+array\+\_\+remove}} (struct \mbox{\hyperlink{structaspa__array}{aspa\+\_\+array}} \texorpdfstring{$\ast$}{*}array, size\+\_\+t index, bool free\+\_\+providers)
\begin{DoxyCompactList}\small\item\em Removes the record at the given index from the array. \end{DoxyCompactList}\item 
struct \mbox{\hyperlink{structaspa__record}{aspa\+\_\+record}} \texorpdfstring{$\ast$}{*} \mbox{\hyperlink{aspa__array_8h_a955d5d08bf6cdc78c0cfc2ccb5fd5221}{aspa\+\_\+array\+\_\+get\+\_\+record}} (struct \mbox{\hyperlink{structaspa__array}{aspa\+\_\+array}} \texorpdfstring{$\ast$}{*}array, size\+\_\+t index)
\begin{DoxyCompactList}\small\item\em Returns a reference to the record at the given index. \end{DoxyCompactList}\item 
struct \mbox{\hyperlink{structaspa__record}{aspa\+\_\+record}} \texorpdfstring{$\ast$}{*} \mbox{\hyperlink{aspa__array_8h_a373cd0b0a9d7e540eac302dae2d74697}{aspa\+\_\+array\+\_\+search}} (struct \mbox{\hyperlink{structaspa__array}{aspa\+\_\+array}} \texorpdfstring{$\ast$}{*}array, uint32\+\_\+t customer\+\_\+asn)
\begin{DoxyCompactList}\small\item\em Searches the given ASPA array for a record matching its customer ASN. \end{DoxyCompactList}\item 
enum \mbox{\hyperlink{group__mod__aspa__h_ga18e5d060687b3cdf30d418b2a9639e6b}{aspa\+\_\+status}} \mbox{\hyperlink{aspa__array_8h_ae9c61e1f652d2c44ab2427d294fddd13}{aspa\+\_\+array\+\_\+reserve}} (struct \mbox{\hyperlink{structaspa__array}{aspa\+\_\+array}} \texorpdfstring{$\ast$}{*}array, size\+\_\+t size)
\begin{DoxyCompactList}\small\item\em Reserves some space in the array. \end{DoxyCompactList}\end{DoxyCompactItemize}


\doxysubsection{Function Documentation}
\Hypertarget{aspa__array_8h_a6bac0bd0c93c1f489b63476cc6ea10cf}\label{aspa__array_8h_a6bac0bd0c93c1f489b63476cc6ea10cf} 
\index{aspa\_array.h@{aspa\_array.h}!aspa\_array\_append@{aspa\_array\_append}}
\index{aspa\_array\_append@{aspa\_array\_append}!aspa\_array.h@{aspa\_array.h}}
\doxysubsubsection{\texorpdfstring{aspa\_array\_append()}{aspa\_array\_append()}}
{\footnotesize\ttfamily enum \mbox{\hyperlink{group__mod__aspa__h_ga18e5d060687b3cdf30d418b2a9639e6b}{aspa\+\_\+status}} aspa\+\_\+array\+\_\+append (\begin{DoxyParamCaption}\item[{struct \mbox{\hyperlink{structaspa__array}{aspa\+\_\+array}} \texorpdfstring{$\ast$}{*}}]{array,  }\item[{struct \mbox{\hyperlink{structaspa__record}{aspa\+\_\+record}} \texorpdfstring{$\ast$}{*}}]{record,  }\item[{bool}]{copy\+\_\+providers }\end{DoxyParamCaption})}



Appends a given ASPA record to the array. 


\begin{DoxyParams}{Parameters}
{\em array} & The ASPA array that will hold the new record. \\
\hline
{\em record} & The record that will be appended to the array. \\
\hline
{\em copy\+\_\+providers} & A boolean value indicating whether the array should copy the record\textquotesingle{}s providers before appending the record. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
{\ttfamily ASPA\+\_\+\+SUCCESS} if the operation succeeds, {\ttfamily ASPA\+\_\+\+ERROR} if it fails. 
\end{DoxyReturn}
\Hypertarget{aspa__array_8h_a50a106912f721fd5bac2e73afc578615}\label{aspa__array_8h_a50a106912f721fd5bac2e73afc578615} 
\index{aspa\_array.h@{aspa\_array.h}!aspa\_array\_create@{aspa\_array\_create}}
\index{aspa\_array\_create@{aspa\_array\_create}!aspa\_array.h@{aspa\_array.h}}
\doxysubsubsection{\texorpdfstring{aspa\_array\_create()}{aspa\_array\_create()}}
{\footnotesize\ttfamily enum \mbox{\hyperlink{group__mod__aspa__h_ga18e5d060687b3cdf30d418b2a9639e6b}{aspa\+\_\+status}} aspa\+\_\+array\+\_\+create (\begin{DoxyParamCaption}\item[{struct \mbox{\hyperlink{structaspa__array}{aspa\+\_\+array}} \texorpdfstring{$\ast$}{*}\texorpdfstring{$\ast$}{*}}]{array\+\_\+ptr }\end{DoxyParamCaption})}



Creates an vector object. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in,out}}  & {\em array\+\_\+ptr} & Pointer to a variable that will hold a reference to the newly created array. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
{\ttfamily ASPA\+\_\+\+SUCCESS} if the operation succeeds, {\ttfamily ASPA\+\_\+\+ERROR} if it fails. 
\end{DoxyReturn}
\Hypertarget{aspa__array_8h_a957138636c3f6cf544b88b1462b6b51e}\label{aspa__array_8h_a957138636c3f6cf544b88b1462b6b51e} 
\index{aspa\_array.h@{aspa\_array.h}!aspa\_array\_free@{aspa\_array\_free}}
\index{aspa\_array\_free@{aspa\_array\_free}!aspa\_array.h@{aspa\_array.h}}
\doxysubsubsection{\texorpdfstring{aspa\_array\_free()}{aspa\_array\_free()}}
{\footnotesize\ttfamily void aspa\+\_\+array\+\_\+free (\begin{DoxyParamCaption}\item[{struct \mbox{\hyperlink{structaspa__array}{aspa\+\_\+array}} \texorpdfstring{$\ast$}{*}}]{array,  }\item[{bool}]{free\+\_\+provider\+\_\+arrays }\end{DoxyParamCaption})}



Deletes the given ASPA array. 


\begin{DoxyParams}{Parameters}
{\em array} & ASPA array which will be deleted \\
\hline
{\em free\+\_\+provider\+\_\+arrays} & A boolean value determining whether each record\textquotesingle{}s provider array should be deallocated. \\
\hline
\end{DoxyParams}
\Hypertarget{aspa__array_8h_a955d5d08bf6cdc78c0cfc2ccb5fd5221}\label{aspa__array_8h_a955d5d08bf6cdc78c0cfc2ccb5fd5221} 
\index{aspa\_array.h@{aspa\_array.h}!aspa\_array\_get\_record@{aspa\_array\_get\_record}}
\index{aspa\_array\_get\_record@{aspa\_array\_get\_record}!aspa\_array.h@{aspa\_array.h}}
\doxysubsubsection{\texorpdfstring{aspa\_array\_get\_record()}{aspa\_array\_get\_record()}}
{\footnotesize\ttfamily struct \mbox{\hyperlink{structaspa__record}{aspa\+\_\+record}} \texorpdfstring{$\ast$}{*} aspa\+\_\+array\+\_\+get\+\_\+record (\begin{DoxyParamCaption}\item[{struct \mbox{\hyperlink{structaspa__array}{aspa\+\_\+array}} \texorpdfstring{$\ast$}{*}}]{array,  }\item[{size\+\_\+t}]{index }\end{DoxyParamCaption})}



Returns a reference to the record at the given index. 


\begin{DoxyParams}{Parameters}
{\em array} & ASPA array \\
\hline
{\em index} & The index in the ASPA array. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
A reference to the {\ttfamily \doxylink{structaspa__record}{aspa\+\_\+record}} if found, {\ttfamily NULL} otherwise. 
\end{DoxyReturn}
\Hypertarget{aspa__array_8h_abf0f685f8aa018a017518c63a24e7546}\label{aspa__array_8h_abf0f685f8aa018a017518c63a24e7546} 
\index{aspa\_array.h@{aspa\_array.h}!aspa\_array\_insert@{aspa\_array\_insert}}
\index{aspa\_array\_insert@{aspa\_array\_insert}!aspa\_array.h@{aspa\_array.h}}
\doxysubsubsection{\texorpdfstring{aspa\_array\_insert()}{aspa\_array\_insert()}}
{\footnotesize\ttfamily enum \mbox{\hyperlink{group__mod__aspa__h_ga18e5d060687b3cdf30d418b2a9639e6b}{aspa\+\_\+status}} aspa\+\_\+array\+\_\+insert (\begin{DoxyParamCaption}\item[{struct \mbox{\hyperlink{structaspa__array}{aspa\+\_\+array}} \texorpdfstring{$\ast$}{*}}]{array,  }\item[{size\+\_\+t}]{index,  }\item[{struct \mbox{\hyperlink{structaspa__record}{aspa\+\_\+record}} \texorpdfstring{$\ast$}{*}}]{record,  }\item[{bool}]{copy\+\_\+providers }\end{DoxyParamCaption})}



Inserts a given ASPA record into the array, preserving its order. 


\begin{DoxyParams}{Parameters}
{\em array} & The ASPA array that will hold the new record. \\
\hline
{\em index} & The index at which the new record will be stored. \\
\hline
{\em record} & The new record. \\
\hline
{\em copy\+\_\+providers} & A boolean value indicating whether the array should copy the record\textquotesingle{}s providers before inserting the record. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
{\ttfamily ASPA\+\_\+\+SUCCESS} if the operation succeeds, {\ttfamily ASPA\+\_\+\+ERROR} if it fails. 
\end{DoxyReturn}
\Hypertarget{aspa__array_8h_a84310fd7e6e9e0c8b4514b3f71597b90}\label{aspa__array_8h_a84310fd7e6e9e0c8b4514b3f71597b90} 
\index{aspa\_array.h@{aspa\_array.h}!aspa\_array\_remove@{aspa\_array\_remove}}
\index{aspa\_array\_remove@{aspa\_array\_remove}!aspa\_array.h@{aspa\_array.h}}
\doxysubsubsection{\texorpdfstring{aspa\_array\_remove()}{aspa\_array\_remove()}}
{\footnotesize\ttfamily enum \mbox{\hyperlink{group__mod__aspa__h_ga18e5d060687b3cdf30d418b2a9639e6b}{aspa\+\_\+status}} aspa\+\_\+array\+\_\+remove (\begin{DoxyParamCaption}\item[{struct \mbox{\hyperlink{structaspa__array}{aspa\+\_\+array}} \texorpdfstring{$\ast$}{*}}]{array,  }\item[{size\+\_\+t}]{index,  }\item[{bool}]{free\+\_\+providers }\end{DoxyParamCaption})}



Removes the record at the given index from the array. 


\begin{DoxyParams}{Parameters}
{\em array} & The array to remove the record from. \\
\hline
{\em index} & The record\textquotesingle{}s index. \\
\hline
{\em free\+\_\+providers} & A boolean value determining whether to free the existing record\textquotesingle{}s provider array. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
{\ttfamily ASPA\+\_\+\+SUCCESS} if the operation succeeds, {\ttfamily ASPA\+\_\+\+RECORD\+\_\+\+NOT\+\_\+\+FOUND} if the record\textquotesingle{}s index doesn\textquotesingle{}t exist, {\ttfamily ASPA\+\_\+\+ERROR} otherwise. 
\end{DoxyReturn}
\Hypertarget{aspa__array_8h_ae9c61e1f652d2c44ab2427d294fddd13}\label{aspa__array_8h_ae9c61e1f652d2c44ab2427d294fddd13} 
\index{aspa\_array.h@{aspa\_array.h}!aspa\_array\_reserve@{aspa\_array\_reserve}}
\index{aspa\_array\_reserve@{aspa\_array\_reserve}!aspa\_array.h@{aspa\_array.h}}
\doxysubsubsection{\texorpdfstring{aspa\_array\_reserve()}{aspa\_array\_reserve()}}
{\footnotesize\ttfamily enum \mbox{\hyperlink{group__mod__aspa__h_ga18e5d060687b3cdf30d418b2a9639e6b}{aspa\+\_\+status}} aspa\+\_\+array\+\_\+reserve (\begin{DoxyParamCaption}\item[{struct \mbox{\hyperlink{structaspa__array}{aspa\+\_\+array}} \texorpdfstring{$\ast$}{*}}]{array,  }\item[{size\+\_\+t}]{size }\end{DoxyParamCaption})}



Reserves some space in the array. 


\begin{DoxyParams}{Parameters}
{\em array} & The array to remove the record from. \\
\hline
{\em size} & the number of object that should definetly fit into the array \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
{\ttfamily ASPA\+\_\+\+SUCCESS} if the operation succeeds {\ttfamily ASPA\+\_\+\+ERROR} otherwise. 
\end{DoxyReturn}
\Hypertarget{aspa__array_8h_a373cd0b0a9d7e540eac302dae2d74697}\label{aspa__array_8h_a373cd0b0a9d7e540eac302dae2d74697} 
\index{aspa\_array.h@{aspa\_array.h}!aspa\_array\_search@{aspa\_array\_search}}
\index{aspa\_array\_search@{aspa\_array\_search}!aspa\_array.h@{aspa\_array.h}}
\doxysubsubsection{\texorpdfstring{aspa\_array\_search()}{aspa\_array\_search()}}
{\footnotesize\ttfamily struct \mbox{\hyperlink{structaspa__record}{aspa\+\_\+record}} \texorpdfstring{$\ast$}{*} aspa\+\_\+array\+\_\+search (\begin{DoxyParamCaption}\item[{struct \mbox{\hyperlink{structaspa__array}{aspa\+\_\+array}} \texorpdfstring{$\ast$}{*}}]{array,  }\item[{uint32\+\_\+t}]{customer\+\_\+asn }\end{DoxyParamCaption})}



Searches the given ASPA array for a record matching its customer ASN. 


\begin{DoxyParams}{Parameters}
{\em array} & The array to search. \\
\hline
{\em customer\+\_\+asn} & Customer ASN \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
A reference to the {\ttfamily \doxylink{structaspa__record}{aspa\+\_\+record}} if found, {\ttfamily NULL} otherwise. 
\end{DoxyReturn}
