\doxysection{rtrlib/lib/ipv4\+\_\+private.h File Reference}
\hypertarget{ipv4__private_8h}{}\label{ipv4__private_8h}\index{rtrlib/lib/ipv4\_private.h@{rtrlib/lib/ipv4\_private.h}}
{\ttfamily \#include "{}ipv4.\+h"{}}\newline
{\ttfamily \#include "{}rtrlib/lib/convert\+\_\+byte\+\_\+order\+\_\+private.\+h"{}}\newline
{\ttfamily \#include $<$inttypes.\+h$>$}\newline
{\ttfamily \#include $<$stdbool.\+h$>$}\newline
\doxysubsubsection*{Functions}
\begin{DoxyCompactItemize}
\item 
struct \mbox{\hyperlink{structlrtr__ipv4__addr}{lrtr\+\_\+ipv4\+\_\+addr}} \mbox{\hyperlink{ipv4__private_8h_a405222aa90f1719f7f6050219254446f}{lrtr\+\_\+ipv4\+\_\+get\+\_\+bits}} (const struct \mbox{\hyperlink{structlrtr__ipv4__addr}{lrtr\+\_\+ipv4\+\_\+addr}} \texorpdfstring{$\ast$}{*}val, const uint8\+\_\+t from, const uint8\+\_\+t number)
\begin{DoxyCompactList}\small\item\em Extracts number bits from the passed ipv4\+\_\+addr,. \end{DoxyCompactList}\item 
int \mbox{\hyperlink{ipv4__private_8h_a3e4883f79caa3d1d8509527c0a295958}{lrtr\+\_\+ipv4\+\_\+str\+\_\+to\+\_\+addr}} (const char \texorpdfstring{$\ast$}{*}str, struct \mbox{\hyperlink{structlrtr__ipv4__addr}{lrtr\+\_\+ipv4\+\_\+addr}} \texorpdfstring{$\ast$}{*}ip)
\begin{DoxyCompactList}\small\item\em Converts ab IPv4 address from string to ipv4\+\_\+addr struct. \end{DoxyCompactList}\item 
int \mbox{\hyperlink{ipv4__private_8h_a281a258f8fa06f168219231ec943a044}{lrtr\+\_\+ipv4\+\_\+addr\+\_\+to\+\_\+str}} (const struct \mbox{\hyperlink{structlrtr__ipv4__addr}{lrtr\+\_\+ipv4\+\_\+addr}} \texorpdfstring{$\ast$}{*}ip, char \texorpdfstring{$\ast$}{*}str, const unsigned int \mbox{\hyperlink{rtr__pdus_8h_a96bbf959016e4411c9e6b9812a8be60a}{len}})
\begin{DoxyCompactList}\small\item\em Converts an ipv4\+\_\+addr struct to its string representation. \end{DoxyCompactList}\item 
bool \mbox{\hyperlink{ipv4__private_8h_a85c1fded062f1f9e949b959a9e93f008}{lrtr\+\_\+ipv4\+\_\+addr\+\_\+equal}} (const struct \mbox{\hyperlink{structlrtr__ipv4__addr}{lrtr\+\_\+ipv4\+\_\+addr}} \texorpdfstring{$\ast$}{*}a, const struct \mbox{\hyperlink{structlrtr__ipv4__addr}{lrtr\+\_\+ipv4\+\_\+addr}} \texorpdfstring{$\ast$}{*}b)
\begin{DoxyCompactList}\small\item\em Compares two ipv4\+\_\+addr structs. \end{DoxyCompactList}\item 
void \mbox{\hyperlink{group__util__h_ga91aaafa31a937931b6db6cb2c480ae6e}{lrtr\+\_\+ipv4\+\_\+addr\+\_\+convert\+\_\+byte\+\_\+order}} (const uint32\+\_\+t src, uint32\+\_\+t \texorpdfstring{$\ast$}{*}dest, const enum \mbox{\hyperlink{convert__byte__order__private_8h_ac7f9e54856274b72079ec96ab0e18fa1}{target\+\_\+byte\+\_\+order}} tbo)
\begin{DoxyCompactList}\small\item\em \mbox{[}\{ \end{DoxyCompactList}\end{DoxyCompactItemize}


\doxysubsection{Function Documentation}
\Hypertarget{ipv4__private_8h_a85c1fded062f1f9e949b959a9e93f008}\label{ipv4__private_8h_a85c1fded062f1f9e949b959a9e93f008} 
\index{ipv4\_private.h@{ipv4\_private.h}!lrtr\_ipv4\_addr\_equal@{lrtr\_ipv4\_addr\_equal}}
\index{lrtr\_ipv4\_addr\_equal@{lrtr\_ipv4\_addr\_equal}!ipv4\_private.h@{ipv4\_private.h}}
\doxysubsubsection{\texorpdfstring{lrtr\_ipv4\_addr\_equal()}{lrtr\_ipv4\_addr\_equal()}}
{\footnotesize\ttfamily bool lrtr\+\_\+ipv4\+\_\+addr\+\_\+equal (\begin{DoxyParamCaption}\item[{const struct \mbox{\hyperlink{structlrtr__ipv4__addr}{lrtr\+\_\+ipv4\+\_\+addr}} \texorpdfstring{$\ast$}{*}}]{a,  }\item[{const struct \mbox{\hyperlink{structlrtr__ipv4__addr}{lrtr\+\_\+ipv4\+\_\+addr}} \texorpdfstring{$\ast$}{*}}]{b }\end{DoxyParamCaption})}



Compares two ipv4\+\_\+addr structs. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em a} & ipv4\+\_\+addr \\
\hline
\mbox{\texttt{ in}}  & {\em b} & ipv4\+\_\+addr\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
true if a == b 

false if a != b 
\end{DoxyReturn}
\Hypertarget{ipv4__private_8h_a281a258f8fa06f168219231ec943a044}\label{ipv4__private_8h_a281a258f8fa06f168219231ec943a044} 
\index{ipv4\_private.h@{ipv4\_private.h}!lrtr\_ipv4\_addr\_to\_str@{lrtr\_ipv4\_addr\_to\_str}}
\index{lrtr\_ipv4\_addr\_to\_str@{lrtr\_ipv4\_addr\_to\_str}!ipv4\_private.h@{ipv4\_private.h}}
\doxysubsubsection{\texorpdfstring{lrtr\_ipv4\_addr\_to\_str()}{lrtr\_ipv4\_addr\_to\_str()}}
{\footnotesize\ttfamily int lrtr\+\_\+ipv4\+\_\+addr\+\_\+to\+\_\+str (\begin{DoxyParamCaption}\item[{const struct \mbox{\hyperlink{structlrtr__ipv4__addr}{lrtr\+\_\+ipv4\+\_\+addr}} \texorpdfstring{$\ast$}{*}}]{ip,  }\item[{char \texorpdfstring{$\ast$}{*}}]{str,  }\item[{const unsigned int}]{len }\end{DoxyParamCaption})}



Converts an ipv4\+\_\+addr struct to its string representation. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em ip} & ipv4\+\_\+addr \\
\hline
\mbox{\texttt{ out}}  & {\em str} & Pointer to a string buffer, of at least INET\+\_\+\+ADDRSTRLEN. \\
\hline
\mbox{\texttt{ in}}  & {\em length} & of \texorpdfstring{$\ast$}{*}str\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
0 on success 

-\/1 on error 
\end{DoxyReturn}
\Hypertarget{ipv4__private_8h_a405222aa90f1719f7f6050219254446f}\label{ipv4__private_8h_a405222aa90f1719f7f6050219254446f} 
\index{ipv4\_private.h@{ipv4\_private.h}!lrtr\_ipv4\_get\_bits@{lrtr\_ipv4\_get\_bits}}
\index{lrtr\_ipv4\_get\_bits@{lrtr\_ipv4\_get\_bits}!ipv4\_private.h@{ipv4\_private.h}}
\doxysubsubsection{\texorpdfstring{lrtr\_ipv4\_get\_bits()}{lrtr\_ipv4\_get\_bits()}}
{\footnotesize\ttfamily struct \mbox{\hyperlink{structlrtr__ipv4__addr}{lrtr\+\_\+ipv4\+\_\+addr}} lrtr\+\_\+ipv4\+\_\+get\+\_\+bits (\begin{DoxyParamCaption}\item[{const struct \mbox{\hyperlink{structlrtr__ipv4__addr}{lrtr\+\_\+ipv4\+\_\+addr}} \texorpdfstring{$\ast$}{*}}]{val,  }\item[{const uint8\+\_\+t}]{from,  }\item[{const uint8\+\_\+t}]{number }\end{DoxyParamCaption})}



Extracts number bits from the passed ipv4\+\_\+addr,. 

Starting at bit number from. The bit with the highest significance is bit 0. All bits that aren\textquotesingle{}t in the specified range will be 0.


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em val} & ipv4\+\_\+addr \\
\hline
\mbox{\texttt{ in}}  & {\em from} & Position of the first bit that is extracted. \\
\hline
\mbox{\texttt{ in}}  & {\em number} & How many bits will be extracted.\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
An ipv4\+\_\+addr, with all bits not in the specified range set to 0. 
\end{DoxyReturn}
\Hypertarget{ipv4__private_8h_a3e4883f79caa3d1d8509527c0a295958}\label{ipv4__private_8h_a3e4883f79caa3d1d8509527c0a295958} 
\index{ipv4\_private.h@{ipv4\_private.h}!lrtr\_ipv4\_str\_to\_addr@{lrtr\_ipv4\_str\_to\_addr}}
\index{lrtr\_ipv4\_str\_to\_addr@{lrtr\_ipv4\_str\_to\_addr}!ipv4\_private.h@{ipv4\_private.h}}
\doxysubsubsection{\texorpdfstring{lrtr\_ipv4\_str\_to\_addr()}{lrtr\_ipv4\_str\_to\_addr()}}
{\footnotesize\ttfamily int lrtr\+\_\+ipv4\+\_\+str\+\_\+to\+\_\+addr (\begin{DoxyParamCaption}\item[{const char \texorpdfstring{$\ast$}{*}}]{str,  }\item[{struct \mbox{\hyperlink{structlrtr__ipv4__addr}{lrtr\+\_\+ipv4\+\_\+addr}} \texorpdfstring{$\ast$}{*}}]{ip }\end{DoxyParamCaption})}



Converts ab IPv4 address from string to ipv4\+\_\+addr struct. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em str} & Pointer to a string buffer. \\
\hline
\mbox{\texttt{ out}}  & {\em ip} & ipv4\+\_\+addr\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
0 on success 

-\/1 on error 
\end{DoxyReturn}
