\hypertarget{classAuthHandlerBase}{
\section{AuthHandlerBase Class Reference}
\label{classAuthHandlerBase}\index{AuthHandlerBase@{AuthHandlerBase}}
}


Base clase for OSPFv2 authentication mechanisms.  




{\ttfamily \#include $<$auth.hh$>$}

Inheritance diagram for AuthHandlerBase:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[height=1.352657cm]{classAuthHandlerBase}
\end{center}
\end{figure}
\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
virtual const char $\ast$ \hyperlink{classAuthHandlerBase_ae7de23c1ed8c11bf3a9214236777b081}{effective\_\-name} () const =0
\begin{DoxyCompactList}\small\item\em Get \hyperlink{protocolthe-p}{the} effective name of \hyperlink{protocolthe-p}{the} authentication scheme. \item\end{DoxyCompactList}\item 
\hypertarget{classAuthHandlerBase_a1803775a0fa6697b483502afaf2dbde8}{
virtual void \hyperlink{classAuthHandlerBase_a1803775a0fa6697b483502afaf2dbde8}{reset} ()=0}
\label{classAuthHandlerBase_a1803775a0fa6697b483502afaf2dbde8}

\begin{DoxyCompactList}\small\item\em Reset \hyperlink{protocolthe-p}{the} authentication state. \item\end{DoxyCompactList}\item 
virtual uint32\_\-t \hyperlink{classAuthHandlerBase_a89d17f816687f2b7edb940726ed5d7dc}{additional\_\-payload} () const =0
\begin{DoxyCompactList}\small\item\em Additional bytes that will be added to \hyperlink{protocolthe-p}{the} payload. \item\end{DoxyCompactList}\item 
virtual bool \hyperlink{classAuthHandlerBase_a8f24e1dbb92fc3f224e7e825248503ed}{authenticate\_\-inbound} (const vector$<$ uint8\_\-t $>$ \&packet, const \hyperlink{classIPv4}{IPv4} \&src\_\-addr, bool new\_\-peer)=0
\begin{DoxyCompactList}\small\item\em Inbound authentication method. \item\end{DoxyCompactList}\item 
virtual bool \hyperlink{classAuthHandlerBase_a6ec0ffeeff1824135bd1ee0d830eb416}{authenticate\_\-outbound} (vector$<$ uint8\_\-t $>$ \&packet)=0
\begin{DoxyCompactList}\small\item\em Outbound authentication method. \item\end{DoxyCompactList}\item 
\hypertarget{classAuthHandlerBase_a95d3c8d06b32d17b9e8c4d77a0a9eda7}{
const string \& \hyperlink{classAuthHandlerBase_a95d3c8d06b32d17b9e8c4d77a0a9eda7}{error} () const }
\label{classAuthHandlerBase_a95d3c8d06b32d17b9e8c4d77a0a9eda7}

\begin{DoxyCompactList}\small\item\em Get textual description of last error. \item\end{DoxyCompactList}\item 
\hypertarget{classAuthHandlerBase_a8c7bc3e969badb22777e25cde109860a}{
virtual \hyperlink{classAuthHandlerBase_a8c7bc3e969badb22777e25cde109860a}{$\sim$AuthHandlerBase} ()}
\label{classAuthHandlerBase_a8c7bc3e969badb22777e25cde109860a}

\begin{DoxyCompactList}\small\item\em Virtual destructor. \item\end{DoxyCompactList}\item 
\hypertarget{classAuthHandlerBase_ae7de23c1ed8c11bf3a9214236777b081}{
virtual const char $\ast$ \hyperlink{classAuthHandlerBase_ae7de23c1ed8c11bf3a9214236777b081}{effective\_\-name} () const =0}
\label{classAuthHandlerBase_ae7de23c1ed8c11bf3a9214236777b081}

\begin{DoxyCompactList}\small\item\em Get \hyperlink{protocolthe-p}{the} effective name of \hyperlink{protocolthe-p}{the} authentication scheme. \item\end{DoxyCompactList}\item 
\hypertarget{classAuthHandlerBase_a1803775a0fa6697b483502afaf2dbde8}{
virtual void \hyperlink{classAuthHandlerBase_a1803775a0fa6697b483502afaf2dbde8}{reset} ()=0}
\label{classAuthHandlerBase_a1803775a0fa6697b483502afaf2dbde8}

\begin{DoxyCompactList}\small\item\em Reset \hyperlink{protocolthe-p}{the} authentication state. \item\end{DoxyCompactList}\item 
virtual uint32\_\-t \hyperlink{classAuthHandlerBase_a0c5a74a5248a62e035b68f4754de6d5d}{head\_\-entries} () const =0
\begin{DoxyCompactList}\small\item\em Get number of routing entries used by authentication scheme at \hyperlink{protocolthe-p}{the} head of \hyperlink{protocolthe-p}{the} RIP packet. \item\end{DoxyCompactList}\item 
\hypertarget{classAuthHandlerBase_abdde180bc0d7163421e85541e3d47722}{
virtual uint32\_\-t \hyperlink{classAuthHandlerBase_abdde180bc0d7163421e85541e3d47722}{max\_\-routing\_\-entries} () const =0}
\label{classAuthHandlerBase_abdde180bc0d7163421e85541e3d47722}

\begin{DoxyCompactList}\small\item\em Get maximum number of non-\/authentication scheme use routing entries in a RIP packet. \item\end{DoxyCompactList}\item 
virtual bool \hyperlink{classAuthHandlerBase_a5ad3b25ba886a3b239a6cf6a37b01f48}{authenticate\_\-inbound} (const uint8\_\-t $\ast$packet, size\_\-t packet\_\-bytes, const uint8\_\-t $\ast$\&entries\_\-ptr, uint32\_\-t \&n\_\-entries, const \hyperlink{classIPv4}{IPv4} \&src\_\-addr, bool new\_\-peer)=0
\begin{DoxyCompactList}\small\item\em Inbound authentication method. \item\end{DoxyCompactList}\item 
virtual bool \hyperlink{classAuthHandlerBase_a376564db371c98aa424c948d001b0616}{authenticate\_\-outbound} (\hyperlink{classRipPacket}{RipPacket}$<$ \hyperlink{classIPv4}{IPv4} $>$ \&packet, list$<$ \hyperlink{classRipPacket}{RipPacket}$<$ \hyperlink{classIPv4}{IPv4} $>$ $\ast$ $>$ \&auth\_\-packets, size\_\-t \&n\_\-routes)=0
\begin{DoxyCompactList}\small\item\em Outbound authentication method. \item\end{DoxyCompactList}\item 
\hypertarget{classAuthHandlerBase_a94c30398b26cfdb3bf2bf14f8543f35f}{
const string \& \hyperlink{classAuthHandlerBase_a94c30398b26cfdb3bf2bf14f8543f35f}{error} () const }
\label{classAuthHandlerBase_a94c30398b26cfdb3bf2bf14f8543f35f}

\begin{DoxyCompactList}\small\item\em Get textual description of last error. \item\end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Protected Member Functions}
\begin{DoxyCompactItemize}
\item 
\hypertarget{classAuthHandlerBase_a63b807e412c93e419166f91e0a913a4e}{
void \hyperlink{classAuthHandlerBase_a63b807e412c93e419166f91e0a913a4e}{reset\_\-error} ()}
\label{classAuthHandlerBase_a63b807e412c93e419166f91e0a913a4e}

\begin{DoxyCompactList}\small\item\em Reset textual description of last error. \item\end{DoxyCompactList}\item 
\hypertarget{classAuthHandlerBase_a53cfe8032bf62b9a1e65653ad721c37c}{
void \hyperlink{classAuthHandlerBase_a53cfe8032bf62b9a1e65653ad721c37c}{set\_\-error} (const string \&error\_\-msg)}
\label{classAuthHandlerBase_a53cfe8032bf62b9a1e65653ad721c37c}

\begin{DoxyCompactList}\small\item\em Set textual description of latest error. \item\end{DoxyCompactList}\item 
\hypertarget{classAuthHandlerBase_a63b807e412c93e419166f91e0a913a4e}{
void \hyperlink{classAuthHandlerBase_a63b807e412c93e419166f91e0a913a4e}{reset\_\-error} ()}
\label{classAuthHandlerBase_a63b807e412c93e419166f91e0a913a4e}

\begin{DoxyCompactList}\small\item\em Reset textual description of last error. \item\end{DoxyCompactList}\item 
\hypertarget{classAuthHandlerBase_a65dd233ac5a2a2118abd7c2a868f6c5a}{
void \hyperlink{classAuthHandlerBase_a65dd233ac5a2a2118abd7c2a868f6c5a}{set\_\-error} (const string \&err)}
\label{classAuthHandlerBase_a65dd233ac5a2a2118abd7c2a868f6c5a}

\begin{DoxyCompactList}\small\item\em Set textual description of latest error. \item\end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Private Attributes}
\begin{DoxyCompactItemize}
\item 
\hypertarget{classAuthHandlerBase_a8d9acd8a3ca02e5393ca24d86b7502b6}{
string {\bfseries \_\-error}}
\label{classAuthHandlerBase_a8d9acd8a3ca02e5393ca24d86b7502b6}

\item 
\hypertarget{classAuthHandlerBase_aeb7348efc1bbe5ee9342824915e0eb60}{
string {\bfseries \_\-err}}
\label{classAuthHandlerBase_aeb7348efc1bbe5ee9342824915e0eb60}

\end{DoxyCompactItemize}


\subsection{Detailed Description}
Base clase for OSPFv2 authentication mechanisms. Base clase for RIPv2 authentication mechanisms.

The \hyperlink{classAuthHandlerBase}{AuthHandlerBase} class defines \hyperlink{protocolthe-p}{the} interfaces for OSPFv2 authentication handlers. Handlers are responsible for authenticating inbound datagrams and adding authentication data to outbound datagrams.

Error during authentication set an error buffer that clients may query using \hyperlink{protocolthe-p}{the} \hyperlink{classAuthHandlerBase_a95d3c8d06b32d17b9e8c4d77a0a9eda7}{error()} method.

The \hyperlink{classAuthHandlerBase}{AuthHandlerBase} class defines \hyperlink{protocolthe-p}{the} interfaces for RIPv2 authentication handlers. Handlers are responsible for authenticating inbound datagrams and adding authentication data to outbound datagrams.

Error during authentication set an error buffer that clients may query using \hyperlink{protocolthe-p}{the} \hyperlink{classAuthHandlerBase_a95d3c8d06b32d17b9e8c4d77a0a9eda7}{error()} method. 

\subsection{Member Function Documentation}
\hypertarget{classAuthHandlerBase_a89d17f816687f2b7edb940726ed5d7dc}{
\index{AuthHandlerBase@{AuthHandlerBase}!additional\_\-payload@{additional\_\-payload}}
\index{additional\_\-payload@{additional\_\-payload}!AuthHandlerBase@{AuthHandlerBase}}
\subsubsection[{additional\_\-payload}]{\setlength{\rightskip}{0pt plus 5cm}virtual uint32\_\-t AuthHandlerBase::additional\_\-payload (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
) const\hspace{0.3cm}{\ttfamily  \mbox{[}pure virtual\mbox{]}}}}
\label{classAuthHandlerBase_a89d17f816687f2b7edb940726ed5d7dc}


Additional bytes that will be added to \hyperlink{protocolthe-p}{the} payload. 

\begin{DoxyReturn}{Returns}
\hyperlink{protocolthe-p}{the} number of additional bytes that need to be added to \hyperlink{protocolthe-p}{the} payload. 
\end{DoxyReturn}


Implemented in \hyperlink{classNullAuthHandler_a1045f45204822f1a9cc860732dc75374}{NullAuthHandler}, \hyperlink{classPlaintextAuthHandler_a4b56e88864f7303578a38dfdfb0afb64}{PlaintextAuthHandler}, and \hyperlink{classMD5AuthHandler_a656f27cadafbccb51b2dd3321ea88c84}{MD5AuthHandler}.

\hypertarget{classAuthHandlerBase_a8f24e1dbb92fc3f224e7e825248503ed}{
\index{AuthHandlerBase@{AuthHandlerBase}!authenticate\_\-inbound@{authenticate\_\-inbound}}
\index{authenticate\_\-inbound@{authenticate\_\-inbound}!AuthHandlerBase@{AuthHandlerBase}}
\subsubsection[{authenticate\_\-inbound}]{\setlength{\rightskip}{0pt plus 5cm}virtual bool AuthHandlerBase::authenticate\_\-inbound (
\begin{DoxyParamCaption}
\item[{const vector$<$ uint8\_\-t $>$ \&}]{packet, }
\item[{const {\bf IPv4} \&}]{src\_\-addr, }
\item[{bool}]{new\_\-peer}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}pure virtual\mbox{]}}}}
\label{classAuthHandlerBase_a8f24e1dbb92fc3f224e7e825248503ed}


Inbound authentication method. 


\begin{DoxyParams}{Parameters}
{\em packet} & \hyperlink{protocolthe-p}{the} packet to verify. \\
\hline
{\em src\_\-addr} & \hyperlink{protocolthe-p}{the} source address of \hyperlink{protocolthe-p}{the} packet. \\
\hline
{\em new\_\-peer} & true if this is a new peer. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
true if packet passes authentication checks, false otherwise. 
\end{DoxyReturn}


Implemented in \hyperlink{classNullAuthHandler_aa409d377f101414efc421202c44e2c08}{NullAuthHandler}, \hyperlink{classPlaintextAuthHandler_add54cc2acd24f8259f29420ccaf39039}{PlaintextAuthHandler}, and \hyperlink{classMD5AuthHandler_a54106bbd34108d1b3d69761b0a0b7c9d}{MD5AuthHandler}.

\hypertarget{classAuthHandlerBase_a5ad3b25ba886a3b239a6cf6a37b01f48}{
\index{AuthHandlerBase@{AuthHandlerBase}!authenticate\_\-inbound@{authenticate\_\-inbound}}
\index{authenticate\_\-inbound@{authenticate\_\-inbound}!AuthHandlerBase@{AuthHandlerBase}}
\subsubsection[{authenticate\_\-inbound}]{\setlength{\rightskip}{0pt plus 5cm}virtual bool AuthHandlerBase::authenticate\_\-inbound (
\begin{DoxyParamCaption}
\item[{const uint8\_\-t $\ast$}]{packet, }
\item[{size\_\-t}]{packet\_\-bytes, }
\item[{const uint8\_\-t $\ast$\&}]{entries\_\-ptr, }
\item[{uint32\_\-t \&}]{n\_\-entries, }
\item[{const {\bf IPv4} \&}]{src\_\-addr, }
\item[{bool}]{new\_\-peer}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}pure virtual\mbox{]}}}}
\label{classAuthHandlerBase_a5ad3b25ba886a3b239a6cf6a37b01f48}


Inbound authentication method. 


\begin{DoxyParams}{Parameters}
{\em packet} & pointer to first byte of RIP packet. \\
\hline
{\em packet\_\-bytes} & number of bytes in RIP packet. \\
\hline
{\em entries\_\-ptr} & output variable set to point to first entry in packet. Set to NULL if there are no entries, or on authentication failure. \\
\hline
{\em n\_\-entries} & number of entries in \hyperlink{protocolthe-p}{the} packet. \\
\hline
{\em src\_\-addr} & \hyperlink{protocolthe-p}{the} source address of \hyperlink{protocolthe-p}{the} packet. \\
\hline
{\em new\_\-peer} & true if this is a new peer.\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
true if packet passes authentication checks, false otherwise. 
\end{DoxyReturn}


Implemented in \hyperlink{classNullAuthHandler_a03fe6cfb42e50979515189fa4d77c60a}{NullAuthHandler}, \hyperlink{classPlaintextAuthHandler_ad89fb17246de4c3d7f53202a4f46cd26}{PlaintextAuthHandler}, and \hyperlink{classMD5AuthHandler_a7d17fb9c85789cb6d8777d4d6f707e23}{MD5AuthHandler}.

\hypertarget{classAuthHandlerBase_a6ec0ffeeff1824135bd1ee0d830eb416}{
\index{AuthHandlerBase@{AuthHandlerBase}!authenticate\_\-outbound@{authenticate\_\-outbound}}
\index{authenticate\_\-outbound@{authenticate\_\-outbound}!AuthHandlerBase@{AuthHandlerBase}}
\subsubsection[{authenticate\_\-outbound}]{\setlength{\rightskip}{0pt plus 5cm}virtual bool AuthHandlerBase::authenticate\_\-outbound (
\begin{DoxyParamCaption}
\item[{vector$<$ uint8\_\-t $>$ \&}]{packet}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}pure virtual\mbox{]}}}}
\label{classAuthHandlerBase_a6ec0ffeeff1824135bd1ee0d830eb416}


Outbound authentication method. 


\begin{DoxyParams}{Parameters}
{\em packet} & \hyperlink{protocolthe-p}{the} packet to authenticate. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
true if packet was successfully authenticated, false when no valid keys are present. 
\end{DoxyReturn}


Implemented in \hyperlink{classNullAuthHandler_a7ba2febb05186118d378bc713787e6de}{NullAuthHandler}, \hyperlink{classPlaintextAuthHandler_ac45ad4e9733c929f294f33b64a172531}{PlaintextAuthHandler}, and \hyperlink{classMD5AuthHandler_aacb15778b6eb0bfb20dcef4643dc7a6e}{MD5AuthHandler}.

\hypertarget{classAuthHandlerBase_a376564db371c98aa424c948d001b0616}{
\index{AuthHandlerBase@{AuthHandlerBase}!authenticate\_\-outbound@{authenticate\_\-outbound}}
\index{authenticate\_\-outbound@{authenticate\_\-outbound}!AuthHandlerBase@{AuthHandlerBase}}
\subsubsection[{authenticate\_\-outbound}]{\setlength{\rightskip}{0pt plus 5cm}virtual bool AuthHandlerBase::authenticate\_\-outbound (
\begin{DoxyParamCaption}
\item[{{\bf RipPacket}$<$ {\bf IPv4} $>$ \&}]{packet, }
\item[{list$<$ {\bf RipPacket}$<$ {\bf IPv4} $>$ $\ast$ $>$ \&}]{auth\_\-packets, }
\item[{size\_\-t \&}]{n\_\-routes}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}pure virtual\mbox{]}}}}
\label{classAuthHandlerBase_a376564db371c98aa424c948d001b0616}


Outbound authentication method. 

Create a list of authenticated packets (one for each valid authentication key). Note that \hyperlink{protocolthe-p}{the} original packet is also modified and authenticated with \hyperlink{protocolthe-p}{the} first valid key.


\begin{DoxyParams}{Parameters}
{\em packet} & \hyperlink{protocolthe-p}{the} RIP packet to authenticate. \\
\hline
{\em auth\_\-packets} & a return-\/by-\/reference list with \hyperlink{protocolthe-p}{the} authenticated RIP packets (one for each valid authentication key). \\
\hline
{\em n\_\-routes} & \hyperlink{protocolthe-p}{the} return-\/by-\/reference number of routes in \hyperlink{protocolthe-p}{the} packet. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
true if packet was successfully authenticated, false when no valid keys are present. 
\end{DoxyReturn}


Implemented in \hyperlink{classNullAuthHandler_af3920219435f2d8468afddd06cfe0e0c}{NullAuthHandler}, \hyperlink{classPlaintextAuthHandler_ad23ac4a80fe276136439ad5b54a2e6bd}{PlaintextAuthHandler}, and \hyperlink{classMD5AuthHandler_a4ca6f4bcc4999b652f94cb9c19d94a97}{MD5AuthHandler}.

\hypertarget{classAuthHandlerBase_ae7de23c1ed8c11bf3a9214236777b081}{
\index{AuthHandlerBase@{AuthHandlerBase}!effective\_\-name@{effective\_\-name}}
\index{effective\_\-name@{effective\_\-name}!AuthHandlerBase@{AuthHandlerBase}}
\subsubsection[{effective\_\-name}]{\setlength{\rightskip}{0pt plus 5cm}virtual const char$\ast$ AuthHandlerBase::effective\_\-name (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
) const\hspace{0.3cm}{\ttfamily  \mbox{[}pure virtual\mbox{]}}}}
\label{classAuthHandlerBase_ae7de23c1ed8c11bf3a9214236777b081}


Get \hyperlink{protocolthe-p}{the} effective name of \hyperlink{protocolthe-p}{the} authentication scheme. 

\begin{DoxyReturn}{Returns}
\hyperlink{protocolthe-p}{the} name of \hyperlink{protocolthe-p}{the} authentication scheme. 
\end{DoxyReturn}


Implemented in \hyperlink{classNullAuthHandler_af93ec47858930eb5228f3fac505cd90d}{NullAuthHandler}, \hyperlink{classPlaintextAuthHandler_a4b2b5ebbbaf70dfbcdb9392f90464ab0}{PlaintextAuthHandler}, \hyperlink{classMD5AuthHandler_a751cd777bce4cea284f9288e9a740005}{MD5AuthHandler}, \hyperlink{classNullAuthHandler_acb228c798b0ec01e708a0c0fddc54738}{NullAuthHandler}, \hyperlink{classPlaintextAuthHandler_ac9e730c37b7993bbcf90eed33c2cae8e}{PlaintextAuthHandler}, and \hyperlink{classMD5AuthHandler_afbec76608a30b32044ee9e63b1e7e0c3}{MD5AuthHandler}.

\hypertarget{classAuthHandlerBase_a0c5a74a5248a62e035b68f4754de6d5d}{
\index{AuthHandlerBase@{AuthHandlerBase}!head\_\-entries@{head\_\-entries}}
\index{head\_\-entries@{head\_\-entries}!AuthHandlerBase@{AuthHandlerBase}}
\subsubsection[{head\_\-entries}]{\setlength{\rightskip}{0pt plus 5cm}virtual uint32\_\-t AuthHandlerBase::head\_\-entries (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
) const\hspace{0.3cm}{\ttfamily  \mbox{[}pure virtual\mbox{]}}}}
\label{classAuthHandlerBase_a0c5a74a5248a62e035b68f4754de6d5d}


Get number of routing entries used by authentication scheme at \hyperlink{protocolthe-p}{the} head of \hyperlink{protocolthe-p}{the} RIP packet. 

\begin{DoxyReturn}{Returns}
\hyperlink{protocolthe-p}{the} number of routing entries used by \hyperlink{protocolthe-p}{the} authentication scheme at \hyperlink{protocolthe-p}{the} head of \hyperlink{protocolthe-p}{the} RIP packet: 0 for unauthenticated packets, 1 otherwise. 
\end{DoxyReturn}


Implemented in \hyperlink{classNullAuthHandler_ab2f475ba39fddf79448c594a428ce610}{NullAuthHandler}, \hyperlink{classPlaintextAuthHandler_af37dc997b6f69cce4b8790ae21af5538}{PlaintextAuthHandler}, and \hyperlink{classMD5AuthHandler_ab73bb17463142357dd24673fda20e17f}{MD5AuthHandler}.



The documentation for this class was generated from the following files:\begin{DoxyCompactItemize}
\item 
/home/greearb/git/xorp.ct.github/xorp/ospf/auth.hh\item 
/home/greearb/git/xorp.ct.github/xorp/rip/auth.hh\item 
/home/greearb/git/xorp.ct.github/xorp/ospf/auth.cc\item 
/home/greearb/git/xorp.ct.github/xorp/rip/auth.cc\end{DoxyCompactItemize}
