\doxysection{rtr\+\_\+private.\+h}
\hypertarget{rtr__private_8h_source}{}\label{rtr__private_8h_source}\index{rtrlib/rtr/rtr\_private.h@{rtrlib/rtr/rtr\_private.h}}
\mbox{\hyperlink{rtr__private_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{00010\ \textcolor{preprocessor}{\#ifndef\ RTR\_PRIVATE\_H}}
\DoxyCodeLine{00011\ \textcolor{preprocessor}{\#define\ RTR\_PRIVATE\_H}}
\DoxyCodeLine{00012\ \textcolor{preprocessor}{\#include\ "{}\mbox{\hyperlink{rtr_8h}{rtrlib/rtr/rtr.h}}"{}}}
\DoxyCodeLine{00013\ }
\DoxyCodeLine{00014\ \textcolor{preprocessor}{\#include\ <pthread.h>}}
\DoxyCodeLine{00015\ \textcolor{preprocessor}{\#include\ <stdbool.h>}}
\DoxyCodeLine{00016\ \textcolor{preprocessor}{\#include\ <stdint.h>}}
\DoxyCodeLine{00017\ }
\DoxyCodeLine{00018\ \textcolor{preprocessor}{\#define\ RTR\_DBG(fmt,\ ...)\ lrtr\_dbg("{}RTR\ Socket:\ "{}\ fmt,\ \#\#\_\_VA\_ARGS\_\_)}}
\DoxyCodeLine{00019\ \textcolor{preprocessor}{\#define\ RTR\_DBG1(a)\ lrtr\_dbg("{}RTR\ Socket:\ "{}\ a)}}
\DoxyCodeLine{00020\ }
\DoxyCodeLine{00021\ \textcolor{keyword}{static}\ \textcolor{keyword}{const}\ uint32\_t\ \mbox{\hyperlink{rtr__private_8h_a778c7b8c4396b437a12951074bc7eac2}{RTR\_EXPIRATION\_MIN}}\ =\ 600;\ \textcolor{comment}{//\ ten\ minutes}}
\DoxyCodeLine{00022\ \textcolor{keyword}{static}\ \textcolor{keyword}{const}\ uint32\_t\ \mbox{\hyperlink{rtr__private_8h_a7f5453d26314046ae5a1e32c49d4ffdb}{RTR\_EXPIRATION\_MAX}}\ =\ 172800;\ \textcolor{comment}{//\ two\ days}}
\DoxyCodeLine{00023\ \textcolor{keyword}{static}\ \textcolor{keyword}{const}\ uint32\_t\ \mbox{\hyperlink{rtr__private_8h_a28efb09585b2e5b4b26a821dd9294d13}{RTR\_EXPIRATION\_DEFAULT}}\ =\ 7200;\ \textcolor{comment}{//\ two\ hours}}
\DoxyCodeLine{00024\ }
\DoxyCodeLine{00025\ \textcolor{keyword}{static}\ \textcolor{keyword}{const}\ uint32\_t\ \mbox{\hyperlink{rtr__private_8h_a71c5bcffa379ef6d51acea92ae5dff64}{RTR\_REFRESH\_MIN}}\ =\ 1;\ \textcolor{comment}{//\ one\ second}}
\DoxyCodeLine{00026\ \textcolor{keyword}{static}\ \textcolor{keyword}{const}\ uint32\_t\ \mbox{\hyperlink{rtr__private_8h_a5346e705ddb0da80b37672adce66584b}{RTR\_REFRESH\_MAX}}\ =\ 86400;\ \textcolor{comment}{//\ one\ day}}
\DoxyCodeLine{00027\ \textcolor{keyword}{static}\ \textcolor{keyword}{const}\ uint32\_t\ \mbox{\hyperlink{rtr__private_8h_a13d891470add9a31d86b0348ad26a121}{RTR\_REFRESH\_DEFAULT}}\ =\ 3600;\ \textcolor{comment}{//\ one\ hour}}
\DoxyCodeLine{00028\ }
\DoxyCodeLine{00029\ \textcolor{keyword}{static}\ \textcolor{keyword}{const}\ uint32\_t\ \mbox{\hyperlink{rtr__private_8h_a5ce85959255a85dde9ca795ac1df074b}{RTR\_RETRY\_MIN}}\ =\ 1;\ \textcolor{comment}{//\ one\ second}}
\DoxyCodeLine{00030\ \textcolor{keyword}{static}\ \textcolor{keyword}{const}\ uint32\_t\ \mbox{\hyperlink{rtr__private_8h_ac738445cdc25b60281e80e335a99e565}{RTR\_RETRY\_MAX}}\ =\ 7200;\ \textcolor{comment}{//\ two\ hours}}
\DoxyCodeLine{00031\ \textcolor{keyword}{static}\ \textcolor{keyword}{const}\ uint32\_t\ \mbox{\hyperlink{rtr__private_8h_af8836c1d92b112f4aa6ee97d53fb47d7}{RTR\_RETRY\_DEFAULT}}\ =\ 600;\ \textcolor{comment}{//\ ten\ minutes}}
\DoxyCodeLine{00032\ }
\DoxyCodeLine{00033\ \textcolor{keyword}{static}\ \textcolor{keyword}{const}\ uint8\_t\ \mbox{\hyperlink{rtr__private_8h_a5d5cdd9fb3edc2e51d082110445497c4}{RTR\_PROTOCOL\_VERSION\_0}}\ =\ 0;}
\DoxyCodeLine{00034\ \textcolor{keyword}{static}\ \textcolor{keyword}{const}\ uint8\_t\ \mbox{\hyperlink{rtr__private_8h_a772ccba015a48a4c07c3f36f9c236490}{RTR\_PROTOCOL\_VERSION\_1}}\ =\ 1;}
\DoxyCodeLine{00035\ \textcolor{keyword}{static}\ \textcolor{keyword}{const}\ uint8\_t\ \mbox{\hyperlink{rtr__private_8h_a5133ce1dcf4bab19b33c32a3bc737bff}{RTR\_PROTOCOL\_VERSION\_2}}\ =\ 2;}
\DoxyCodeLine{00036\ }
\DoxyCodeLine{00037\ \textcolor{keyword}{static}\ \textcolor{keyword}{const}\ uint8\_t\ \mbox{\hyperlink{rtr__private_8h_aec31e11fb565c2b1ef56d54bc38fd869}{RTR\_PROTOCOL\_MIN\_SUPPORTED\_VERSION}};\ \textcolor{comment}{//\ =\ 0}}
\DoxyCodeLine{00038\ }
\DoxyCodeLine{00039\ \textcolor{keyword}{static}\ \textcolor{keyword}{const}\ uint8\_t\ \mbox{\hyperlink{rtr__private_8h_a6c0a71c5ba3c12a90bdf12450d06bcd7}{RTR\_PROTOCOL\_MAX\_SUPPORTED\_VERSION}}\ =\ 2;}
\DoxyCodeLine{00040\ }
\DoxyCodeLine{00041\ \textcolor{keyword}{enum}\ \mbox{\hyperlink{rtr__private_8h_ae1d75b575dbc8bfa66c7ef80576a131a}{rtr\_interval\_range}}\ \{\ \mbox{\hyperlink{rtr__private_8h_ae1d75b575dbc8bfa66c7ef80576a131aafbf98c8d3be5a66249695790f3f7e722}{RTR\_BELOW\_INTERVAL\_RANGE}}\ =\ -\/1,\ \mbox{\hyperlink{rtr__private_8h_ae1d75b575dbc8bfa66c7ef80576a131aaec9a3d1f3fe678b5a7e2dbcf051914cf}{RTR\_INSIDE\_INTERVAL\_RANGE}}\ =\ 0,\ \mbox{\hyperlink{rtr__private_8h_ae1d75b575dbc8bfa66c7ef80576a131aa6c5ac3470349cd494e81f4337fa20818}{RTR\_ABOVE\_INTERVAL\_RANGE}}\ =\ 1\ \};}
\DoxyCodeLine{00042\ }
\DoxyCodeLine{00043\ \textcolor{keyword}{enum}\ \mbox{\hyperlink{rtr__private_8h_a9d8fb3ecb1800546e470bf348b90b9ad}{rtr\_interval\_type}}\ \{\ \mbox{\hyperlink{rtr__private_8h_a9d8fb3ecb1800546e470bf348b90b9ada3bbc7ebb2f1615371bce9f270ed6320e}{RTR\_INTERVAL\_TYPE\_EXPIRATION}},\ \mbox{\hyperlink{rtr__private_8h_a9d8fb3ecb1800546e470bf348b90b9ada016787e9e2bae86ac9420535bdf8855b}{RTR\_INTERVAL\_TYPE\_REFRESH}},\ \mbox{\hyperlink{rtr__private_8h_a9d8fb3ecb1800546e470bf348b90b9adaa74da0be5872cbaca0bc1053f3235789}{RTR\_INTERVAL\_TYPE\_RETRY}}\ \};}
\DoxyCodeLine{00044\ }
\DoxyCodeLine{00070\ \textcolor{keywordtype}{int}\ \mbox{\hyperlink{rtr__private_8h_a641b8f130228ca6453e2deeb665eea66}{rtr\_init}}(\textcolor{keyword}{struct}\ \mbox{\hyperlink{structrtr__socket}{rtr\_socket}}\ *\mbox{\hyperlink{structrtr__socket}{rtr\_socket}},\ \textcolor{keyword}{struct}\ \mbox{\hyperlink{structtr__socket}{tr\_socket}}\ *\mbox{\hyperlink{structtr__socket}{tr\_socket}},\ \textcolor{keyword}{struct}\ \mbox{\hyperlink{structpfx__table}{pfx\_table}}\ *\mbox{\hyperlink{structpfx__table}{pfx\_table}},}
\DoxyCodeLine{00071\ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keyword}{struct}\ \mbox{\hyperlink{structspki__table}{spki\_table}}\ *\mbox{\hyperlink{structspki__table}{spki\_table}},\ \textcolor{keyword}{struct}\ \mbox{\hyperlink{structaspa__table}{aspa\_table}}\ *\mbox{\hyperlink{structaspa__table}{aspa\_table}},\ \textcolor{keyword}{const}\ \textcolor{keywordtype}{unsigned}\ \textcolor{keywordtype}{int}\ refresh\_interval,}
\DoxyCodeLine{00072\ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ \textcolor{keywordtype}{unsigned}\ \textcolor{keywordtype}{int}\ expire\_interval,\ \textcolor{keyword}{const}\ \textcolor{keywordtype}{unsigned}\ \textcolor{keywordtype}{int}\ retry\_interval,\ \textcolor{keyword}{enum}\ \mbox{\hyperlink{group__mod__rtr__h_ga31b1bb66cb95ac21f7108440e7506b38}{rtr\_interval\_mode}}\ iv\_mode,}
\DoxyCodeLine{00073\ \ \ \ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{group__mod__rtr__h_ga71ec6263b63ee7fa9d1758b43a67dad8}{rtr\_connection\_state\_fp}}\ fp,\ \textcolor{keywordtype}{void}\ *fp\_data\_config,\ \textcolor{keywordtype}{void}\ *fp\_data\_group);}
\DoxyCodeLine{00074\ }
\DoxyCodeLine{00082\ \textcolor{keywordtype}{int}\ \mbox{\hyperlink{rtr__private_8h_a1652e6992c66e2a12e308d0014037ed0}{rtr\_start}}(\textcolor{keyword}{struct}\ \mbox{\hyperlink{structrtr__socket}{rtr\_socket}}\ *\mbox{\hyperlink{structrtr__socket}{rtr\_socket}});}
\DoxyCodeLine{00083\ }
\DoxyCodeLine{00088\ \textcolor{keywordtype}{void}\ \mbox{\hyperlink{rtr__private_8h_abb793e94184f164171b683fcc43337f5}{rtr\_stop}}(\textcolor{keyword}{struct}\ \mbox{\hyperlink{structrtr__socket}{rtr\_socket}}\ *\mbox{\hyperlink{structrtr__socket}{rtr\_socket}});}
\DoxyCodeLine{00089\ }
\DoxyCodeLine{00090\ \textcolor{preprocessor}{\#endif}}

\end{DoxyCode}
