\hypertarget{structVrrpHeader}{
\section{VrrpHeader Struct Reference}
\label{structVrrpHeader}\index{VrrpHeader@{VrrpHeader}}
}


The VRRP header.  




{\ttfamily \#include $<$vrrp\_\-packet.hh$>$}

\subsection*{Public Types}
\begin{DoxyCompactItemize}
\item 
enum {\bfseries Versions} \{ {\bfseries VRRP\_\-VERSION} =  2
 \}
\item 
enum {\bfseries PktTypes} \{ {\bfseries VRRP\_\-TYPE\_\-ADVERTISEMENT} =  1
 \}
\item 
enum {\bfseries AuthTypes} \{ {\bfseries VRRP\_\-AUTH\_\-NONE} =  0
 \}
\end{DoxyCompactItemize}
\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
uint32\_\-t \hyperlink{structVrrpHeader_a95019cff8ce2aa3f711614b874dd1c3f}{finalize} ()
\begin{DoxyCompactList}\small\item\em Must be called when all fields have been manipulated. \item\end{DoxyCompactList}\item 
void \hyperlink{structVrrpHeader_a3fdc9cc04f502b546f026592a8369188}{add\_\-ip} (const \hyperlink{classIPv4}{IPv4} \&ip)
\begin{DoxyCompactList}\small\item\em Add an IP address of \hyperlink{protocolthe-p}{the} virtual router to \hyperlink{protocolthe-p}{the} advertisement. \item\end{DoxyCompactList}\item 
\hyperlink{classIPv4}{IPv4} \hyperlink{structVrrpHeader_ac4425bcde5dbc22122786ed0a0e19eb4}{ip} (unsigned index) const 
\begin{DoxyCompactList}\small\item\em Extract an IP address from \hyperlink{protocolthe-p}{the} advertisement. \item\end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Static Public Member Functions}
\begin{DoxyCompactItemize}
\item 
static \hyperlink{structVrrpHeader}{VrrpHeader} \& \hyperlink{structVrrpHeader_a17ce1423797a766fa110893bb1aae77d}{assign} (uint8\_\-t $\ast$data)
\begin{DoxyCompactList}\small\item\em Create a new VRRP packet. \item\end{DoxyCompactList}\item 
static const \hyperlink{structVrrpHeader}{VrrpHeader} \& \hyperlink{structVrrpHeader_afd039e1f049e0244243de5610b4a2065}{assign} (const PAYLOAD \&payload)
\begin{DoxyCompactList}\small\item\em Parse a VRRP packet. \item\end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Public Attributes}
\begin{DoxyCompactItemize}
\item 
\hypertarget{structVrrpHeader_a9fc9a332c316f780476833fc1768e3c1}{
uint8\_\-t {\bfseries vh\_\-v}:4}
\label{structVrrpHeader_a9fc9a332c316f780476833fc1768e3c1}

\item 
\hypertarget{structVrrpHeader_a9e5c461a6bcd42bf3f21287b31e1974b}{
uint8\_\-t {\bfseries vh\_\-type}:4}
\label{structVrrpHeader_a9e5c461a6bcd42bf3f21287b31e1974b}

\item 
\hypertarget{structVrrpHeader_abadf529272628ecec680b115d3f37081}{
uint8\_\-t {\bfseries vh\_\-vrid}}
\label{structVrrpHeader_abadf529272628ecec680b115d3f37081}

\item 
\hypertarget{structVrrpHeader_a35653f59f0cee3d91a97dce7ef0f6a06}{
uint8\_\-t {\bfseries vh\_\-priority}}
\label{structVrrpHeader_a35653f59f0cee3d91a97dce7ef0f6a06}

\item 
\hypertarget{structVrrpHeader_a018d60f09c02067a8419ce8a304c5c8a}{
uint8\_\-t {\bfseries vh\_\-ipcount}}
\label{structVrrpHeader_a018d60f09c02067a8419ce8a304c5c8a}

\item 
\hypertarget{structVrrpHeader_abd4f6aff33a015a8a29781eb0244b709}{
uint8\_\-t {\bfseries vh\_\-auth}}
\label{structVrrpHeader_abd4f6aff33a015a8a29781eb0244b709}

\item 
\hypertarget{structVrrpHeader_abb56ffe4d4bcb61ecdf2df6562a20c40}{
uint8\_\-t {\bfseries vh\_\-interval}}
\label{structVrrpHeader_abb56ffe4d4bcb61ecdf2df6562a20c40}

\item 
\hypertarget{structVrrpHeader_a50ed763722c7e3113acbca8c2d1b4f4d}{
uint16\_\-t {\bfseries vh\_\-sum}}
\label{structVrrpHeader_a50ed763722c7e3113acbca8c2d1b4f4d}

\item 
\hypertarget{structVrrpHeader_a3c9b5c1055753cd3adfacd1c2dbde9a4}{
struct in\_\-addr {\bfseries vh\_\-addr} \mbox{[}0\mbox{]}}
\label{structVrrpHeader_a3c9b5c1055753cd3adfacd1c2dbde9a4}

\end{DoxyCompactItemize}


\subsection{Detailed Description}
The VRRP header. 

\subsection{Member Function Documentation}
\hypertarget{structVrrpHeader_a3fdc9cc04f502b546f026592a8369188}{
\index{VrrpHeader@{VrrpHeader}!add\_\-ip@{add\_\-ip}}
\index{add\_\-ip@{add\_\-ip}!VrrpHeader@{VrrpHeader}}
\subsubsection[{add\_\-ip}]{\setlength{\rightskip}{0pt plus 5cm}void VrrpHeader::add\_\-ip (
\begin{DoxyParamCaption}
\item[{const {\bf IPv4} \&}]{ip}
\end{DoxyParamCaption}
)}}
\label{structVrrpHeader_a3fdc9cc04f502b546f026592a8369188}


Add an IP address of \hyperlink{protocolthe-p}{the} virtual router to \hyperlink{protocolthe-p}{the} advertisement. 


\begin{DoxyParams}{Parameters}
{\em ip} & IP address to add to \hyperlink{protocolthe-p}{the} advertisement. \\
\hline
\end{DoxyParams}
\hypertarget{structVrrpHeader_a17ce1423797a766fa110893bb1aae77d}{
\index{VrrpHeader@{VrrpHeader}!assign@{assign}}
\index{assign@{assign}!VrrpHeader@{VrrpHeader}}
\subsubsection[{assign}]{\setlength{\rightskip}{0pt plus 5cm}{\bf VrrpHeader} \& VrrpHeader::assign (
\begin{DoxyParamCaption}
\item[{uint8\_\-t $\ast$}]{data}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}static\mbox{]}}}}
\label{structVrrpHeader_a17ce1423797a766fa110893bb1aae77d}


Create a new VRRP packet. 

Caller must allocate memory and assert size (VRRP\_\-MAX\_\-PACKET\_\-SIZE).

\begin{DoxyReturn}{Returns}
\hyperlink{protocolthe-p}{the} VRRP header. 
\end{DoxyReturn}

\begin{DoxyParams}{Parameters}
{\em data} & pointer where packet should be stored. \\
\hline
\end{DoxyParams}
\hypertarget{structVrrpHeader_afd039e1f049e0244243de5610b4a2065}{
\index{VrrpHeader@{VrrpHeader}!assign@{assign}}
\index{assign@{assign}!VrrpHeader@{VrrpHeader}}
\subsubsection[{assign}]{\setlength{\rightskip}{0pt plus 5cm}const {\bf VrrpHeader} \& VrrpHeader::assign (
\begin{DoxyParamCaption}
\item[{const PAYLOAD \&}]{payload}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}static\mbox{]}}}}
\label{structVrrpHeader_afd039e1f049e0244243de5610b4a2065}


Parse a VRRP packet. 

\begin{DoxyReturn}{Returns}
\hyperlink{protocolthe-p}{the} VRRP header. 
\end{DoxyReturn}

\begin{DoxyParams}{Parameters}
{\em payload} & The VRRP packet starting with \hyperlink{protocolthe-p}{the} VRRP header. \\
\hline
\end{DoxyParams}
\hypertarget{structVrrpHeader_a95019cff8ce2aa3f711614b874dd1c3f}{
\index{VrrpHeader@{VrrpHeader}!finalize@{finalize}}
\index{finalize@{finalize}!VrrpHeader@{VrrpHeader}}
\subsubsection[{finalize}]{\setlength{\rightskip}{0pt plus 5cm}uint32\_\-t VrrpHeader::finalize (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)}}
\label{structVrrpHeader_a95019cff8ce2aa3f711614b874dd1c3f}


Must be called when all fields have been manipulated. 

This will setup \hyperlink{protocolthe-p}{the} final bits of information (e.g., checksum) and \hyperlink{protocolthe-p}{the} packet will become ready to be sent.

\begin{DoxyReturn}{Returns}
\hyperlink{protocolthe-p}{the} length of \hyperlink{protocolthe-p}{the} packet. 
\end{DoxyReturn}
\hypertarget{structVrrpHeader_ac4425bcde5dbc22122786ed0a0e19eb4}{
\index{VrrpHeader@{VrrpHeader}!ip@{ip}}
\index{ip@{ip}!VrrpHeader@{VrrpHeader}}
\subsubsection[{ip}]{\setlength{\rightskip}{0pt plus 5cm}{\bf IPv4} VrrpHeader::ip (
\begin{DoxyParamCaption}
\item[{unsigned}]{index}
\end{DoxyParamCaption}
) const}}
\label{structVrrpHeader_ac4425bcde5dbc22122786ed0a0e19eb4}


Extract an IP address from \hyperlink{protocolthe-p}{the} advertisement. 

\begin{DoxyReturn}{Returns}
\hyperlink{protocolthe-p}{the} IP address at \hyperlink{protocolthe-p}{the} specified index. 
\end{DoxyReturn}

\begin{DoxyParams}{Parameters}
{\em index} & \hyperlink{protocolthe-p}{the} index of \hyperlink{protocolthe-p}{the} IP (0..vh\_\-ipcount). \\
\hline
\end{DoxyParams}


The documentation for this struct was generated from the following files:\begin{DoxyCompactItemize}
\item 
/home/greearb/git/xorp.ct.github/xorp/vrrp/vrrp\_\-packet.hh\item 
/home/greearb/git/xorp.ct.github/xorp/vrrp/vrrp\_\-packet.cc\end{DoxyCompactItemize}
