\hypertarget{classVrrp}{
\section{Vrrp Class Reference}
\label{classVrrp}\index{Vrrp@{Vrrp}}
}


VRRP protocol implementation.  




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

\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\hyperlink{classVrrp_a4bd9aa055a794cff87c4e74cabdf341b}{Vrrp} (\hyperlink{classVrrpVif}{VrrpVif} \&vif, \hyperlink{classEventLoop}{EventLoop} \&e, uint32\_\-t vrid)
\item 
void \hyperlink{classVrrp_a5455359e5e8f0f3adc0263f9215b5036}{set\_\-priority} (uint32\_\-t priority)
\begin{DoxyCompactList}\small\item\em Set \hyperlink{protocolthe-p}{the} priority of \hyperlink{protocolthe-p}{the} router. \item\end{DoxyCompactList}\item 
void \hyperlink{classVrrp_a96f0e4d2758baf79c401010ab2056ab1}{set\_\-interval} (uint32\_\-t interval)
\begin{DoxyCompactList}\small\item\em Set \hyperlink{protocolthe-p}{the} advertisement interval. \item\end{DoxyCompactList}\item 
void \hyperlink{classVrrp_a8a78ac045a45367c858e9e124217f0e8}{set\_\-preempt} (bool preempt)
\begin{DoxyCompactList}\small\item\em Set whether a high priority backup router should preempt backup routers with lower priority acting as masters. \item\end{DoxyCompactList}\item 
void \hyperlink{classVrrp_af59e58632615f1f73bc2ea72b98b71e0}{set\_\-disable} (bool disable)
\begin{DoxyCompactList}\small\item\em Stop or start this VRRP instance. \item\end{DoxyCompactList}\item 
void \hyperlink{classVrrp_adc40fe471516d71aa6b9460d655b2792}{add\_\-ip} (const \hyperlink{classIPv4}{IPv4} \&ip)
\begin{DoxyCompactList}\small\item\em Add an IP to \hyperlink{protocolthe-p}{the} virtual router. \item\end{DoxyCompactList}\item 
\hypertarget{classVrrp_aa846d30d6edb4fb04c0697f0206133da}{
void {\bfseries set\_\-prefix} (const \hyperlink{classIPv4}{IPv4} \&ip, uint32\_\-t prefix)}
\label{classVrrp_aa846d30d6edb4fb04c0697f0206133da}

\item 
void \hyperlink{classVrrp_a7bb2633b5e0d17ce7c022624181c6bfb}{delete\_\-ip} (const \hyperlink{classIPv4}{IPv4} \&ip)
\begin{DoxyCompactList}\small\item\em Delete an IP from \hyperlink{protocolthe-p}{the} virtual router. \item\end{DoxyCompactList}\item 
bool \hyperlink{classVrrp_aac1806f2b5fccd8dbc01c8273e245206}{running} () const 
\begin{DoxyCompactList}\small\item\em Check whether this instance is running. \item\end{DoxyCompactList}\item 
uint32\_\-t \hyperlink{classVrrp_adae212aafbefda971dc110a2dd43a69c}{priority} () const 
\begin{DoxyCompactList}\small\item\em Obtain \hyperlink{protocolthe-p}{the} priority of this router. \item\end{DoxyCompactList}\item 
\hypertarget{classVrrp_a85548a99246c8174c90e6a51db8af824}{
void \hyperlink{classVrrp_a85548a99246c8174c90e6a51db8af824}{start} ()}
\label{classVrrp_a85548a99246c8174c90e6a51db8af824}

\begin{DoxyCompactList}\small\item\em Start VRRP processing. \item\end{DoxyCompactList}\item 
\hypertarget{classVrrp_a596e337a6513132121c848bf367aef4b}{
void \hyperlink{classVrrp_a596e337a6513132121c848bf367aef4b}{stop} ()}
\label{classVrrp_a596e337a6513132121c848bf367aef4b}

\begin{DoxyCompactList}\small\item\em Stop \hyperlink{protocolthe-p}{the} protocol. \item\end{DoxyCompactList}\item 
void \hyperlink{classVrrp_a8720d4476750752626423eb107cd3d29}{recv} (const \hyperlink{classIPv4}{IPv4} \&from, const \hyperlink{structVrrpHeader}{VrrpHeader} \&vh)
\begin{DoxyCompactList}\small\item\em Check whether \hyperlink{protocolthe-p}{the} router owns all IPs configured for \hyperlink{protocolthe-p}{the} virtual router. \item\end{DoxyCompactList}\item 
void \hyperlink{classVrrp_a1583fe2a25a8968b2a2b00faa2d9640d}{get\_\-info} (string \&state, \hyperlink{classIPv4}{IPv4} \&master) const 
\begin{DoxyCompactList}\small\item\em Obtain an instance to \hyperlink{protocolthe-p}{the} ARP daemon. \item\end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Static Public Attributes}
\begin{DoxyCompactItemize}
\item 
\hypertarget{classVrrp_ae1b2a988a3f64e188f14bdf1846894d0}{
static const \hyperlink{classMac}{Mac} {\bfseries mcast\_\-mac} = \hyperlink{classMac}{Mac}(\char`\"{}01:00:5E:00:00:12\char`\"{})}
\label{classVrrp_ae1b2a988a3f64e188f14bdf1846894d0}

\end{DoxyCompactItemize}
\subsection*{Private Types}
\begin{DoxyCompactItemize}
\item 
enum {\bfseries State} \{ {\bfseries INITIALIZE} =  0, 
{\bfseries MASTER}, 
{\bfseries BACKUP}
 \}
\item 
enum \{ {\bfseries PRIORITY\_\-LEAVE} =  0, 
{\bfseries PRIORITY\_\-OWN} =  255
 \}
\item 
\hypertarget{classVrrp_a48927d60f85a1bced4725648ba2795b1}{
typedef set$<$ \hyperlink{classIPv4}{IPv4} $>$ {\bfseries IPS}}
\label{classVrrp_a48927d60f85a1bced4725648ba2795b1}

\end{DoxyCompactItemize}
\subsection*{Private Member Functions}
\begin{DoxyCompactItemize}
\item 
void \hyperlink{classVrrp_a1cbb35b24f2b940ee3199458188c990e}{setup\_\-intervals} ()
\begin{DoxyCompactList}\small\item\em Calculate advertisement intervals based on protocol parameters. \item\end{DoxyCompactList}\item 
void \hyperlink{classVrrp_a29c464fe4ecc684869b18dba82c2a2a1}{setup\_\-timers} (bool skew=false)
\begin{DoxyCompactList}\small\item\em Setup timers based on intervals. \item\end{DoxyCompactList}\item 
\hypertarget{classVrrp_ab10a58a78c319250bc0825c798aeb657}{
void \hyperlink{classVrrp_ab10a58a78c319250bc0825c798aeb657}{cancel\_\-timers} ()}
\label{classVrrp_ab10a58a78c319250bc0825c798aeb657}

\begin{DoxyCompactList}\small\item\em Stop all timers. \item\end{DoxyCompactList}\item 
\hypertarget{classVrrp_a1d0246e51bb1c0c74f569bf73dd36672}{
void \hyperlink{classVrrp_a1d0246e51bb1c0c74f569bf73dd36672}{send\_\-arps} ()}
\label{classVrrp_a1d0246e51bb1c0c74f569bf73dd36672}

\begin{DoxyCompactList}\small\item\em \hyperlink{structSend}{Send} gratuitous ARPs for all \hyperlink{protocolthe-p}{the} IP addresses of this virtual router. \item\end{DoxyCompactList}\item 
void \hyperlink{classVrrp_a1fa9055c0f15f0cbb3c892428d98edea}{send\_\-arp} (const \hyperlink{classIPv4}{IPv4} \&ip)
\begin{DoxyCompactList}\small\item\em \hyperlink{structSend}{Send} a gratitious ARP for a specific IP. \item\end{DoxyCompactList}\item 
void \hyperlink{classVrrp_ab83b07bb959aa0cda4ef50d5b29cf145}{send\_\-advertisement} (uint32\_\-t priority)
\begin{DoxyCompactList}\small\item\em \hyperlink{structSend}{Send} an advertisement with given priority. \item\end{DoxyCompactList}\item 
void \hyperlink{classVrrp_aa5f25087b43665417b564df45081c60f}{send\_\-advertisement} ()
\begin{DoxyCompactList}\small\item\em \hyperlink{structSend}{Send} a VRRP advertisement. \item\end{DoxyCompactList}\item 
\hypertarget{classVrrp_ae567543a8f9a75ea1acc85feb3f65fca}{
void \hyperlink{classVrrp_ae567543a8f9a75ea1acc85feb3f65fca}{become\_\-master} ()}
\label{classVrrp_ae567543a8f9a75ea1acc85feb3f65fca}

\begin{DoxyCompactList}\small\item\em Become \hyperlink{protocolthe-p}{the} master router. \item\end{DoxyCompactList}\item 
\hypertarget{classVrrp_a0ee59fc1a55228b87ea5b23bca800d96}{
void \hyperlink{classVrrp_a0ee59fc1a55228b87ea5b23bca800d96}{become\_\-backup} ()}
\label{classVrrp_a0ee59fc1a55228b87ea5b23bca800d96}

\begin{DoxyCompactList}\small\item\em Become a backup router. \item\end{DoxyCompactList}\item 
bool \hyperlink{classVrrp_af13f2813276ff40ad289803b45212c6a}{master\_\-down\_\-expiry} ()
\begin{DoxyCompactList}\small\item\em This is called when this router thinks \hyperlink{protocolthe-p}{the} master router is dead. \item\end{DoxyCompactList}\item 
bool \hyperlink{classVrrp_ae4fcecb56707f778bc72c947bb6579a7}{adver\_\-expiry} ()
\begin{DoxyCompactList}\small\item\em This is called when \hyperlink{protocolthe-p}{the} next advertisement should be sent. \item\end{DoxyCompactList}\item 
void \hyperlink{classVrrp_a2ade766ab4f2c40f7bea636f1d8a50a3}{recv\_\-adver\_\-master} (const \hyperlink{classIPv4}{IPv4} \&from, uint32\_\-t priority)
\begin{DoxyCompactList}\small\item\em Called when receiving an advertisement in \hyperlink{protocolthe-p}{the} master state. \item\end{DoxyCompactList}\item 
void \hyperlink{classVrrp_a304732e1f9cc5be8a5770b3e51a1c61c}{recv\_\-adver\_\-backup} (uint32\_\-t priority)
\begin{DoxyCompactList}\small\item\em Called when an advertisement is received in \hyperlink{protocolthe-p}{the} backup state. \item\end{DoxyCompactList}\item 
void \hyperlink{classVrrp_a90d78b2bc0a163e8cefd386661ae72ec}{prepare\_\-advertisement} (uint32\_\-t priority)
\begin{DoxyCompactList}\small\item\em Create \hyperlink{protocolthe-p}{the} advertisement packet. \item\end{DoxyCompactList}\item 
void \hyperlink{classVrrp_a6fd79cdbb6200c2d6a17f165ac3d4ce5}{recv\_\-advertisement} (const \hyperlink{classIPv4}{IPv4} \&from, uint32\_\-t priority)
\begin{DoxyCompactList}\small\item\em Notification of advertisement reception. \item\end{DoxyCompactList}\item 
bool \hyperlink{classVrrp_a1042a100b2d34a1ff64dd41bcf38a015}{check\_\-ips} (const \hyperlink{structVrrpHeader}{VrrpHeader} \&vh)
\begin{DoxyCompactList}\small\item\em Check whether \hyperlink{protocolthe-p}{the} IPs in \hyperlink{protocolthe-p}{the} VRRP packet match those configured. \item\end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Private Attributes}
\begin{DoxyCompactItemize}
\item 
\hypertarget{classVrrp_a139a2904ec23c8d42c7c89377fa0bb21}{
\hyperlink{classIPv4}{IPv4} {\bfseries \_\-last\_\-adv}}
\label{classVrrp_a139a2904ec23c8d42c7c89377fa0bb21}

\item 
\hypertarget{classVrrp_af6895f875b4502416bcba99dea2a5220}{
\hyperlink{classVrrpVif}{VrrpVif} \& {\bfseries \_\-vif}}
\label{classVrrp_af6895f875b4502416bcba99dea2a5220}

\item 
\hypertarget{classVrrp_ac55fe9f0e0477e190f4cc73998ef7713}{
uint32\_\-t {\bfseries \_\-vrid}}
\label{classVrrp_ac55fe9f0e0477e190f4cc73998ef7713}

\item 
\hypertarget{classVrrp_aea96310578549ebd90fd807f0c3f09f1}{
uint32\_\-t {\bfseries \_\-priority}}
\label{classVrrp_aea96310578549ebd90fd807f0c3f09f1}

\item 
\hypertarget{classVrrp_a8198de3be72b22c9642cd8b08fea6bd1}{
uint32\_\-t {\bfseries \_\-interval}}
\label{classVrrp_a8198de3be72b22c9642cd8b08fea6bd1}

\item 
\hypertarget{classVrrp_aa04611d1f2200376a21f858d858de274}{
double {\bfseries \_\-skew\_\-time}}
\label{classVrrp_aa04611d1f2200376a21f858d858de274}

\item 
\hypertarget{classVrrp_ab38e8d4f43524252441504b0ef0c327a}{
double {\bfseries \_\-master\_\-down\_\-interval}}
\label{classVrrp_ab38e8d4f43524252441504b0ef0c327a}

\item 
\hypertarget{classVrrp_ae1b204468a1089ef975698cd0b99790c}{
bool {\bfseries \_\-preempt}}
\label{classVrrp_ae1b204468a1089ef975698cd0b99790c}

\item 
\hypertarget{classVrrp_a0dc7d1b17936b12d5aab9d1b430c74aa}{
set$<$ \hyperlink{classIPv4}{IPv4} $>$ {\bfseries \_\-ips}}
\label{classVrrp_a0dc7d1b17936b12d5aab9d1b430c74aa}

\item 
\hypertarget{classVrrp_a9f6f0e7d23cae6a534552c62b9f7889b}{
map$<$ uint32\_\-t, uint32\_\-t $>$ {\bfseries \_\-prefixes}}
\label{classVrrp_a9f6f0e7d23cae6a534552c62b9f7889b}

\item 
\hypertarget{classVrrp_a714603ad0d34ab5aa87ed51b043ff342}{
State {\bfseries \_\-state}}
\label{classVrrp_a714603ad0d34ab5aa87ed51b043ff342}

\item 
\hypertarget{classVrrp_ad1f5dd4872a613de34e08d8cd85eb79a}{
\hyperlink{classXorpTimer}{XorpTimer} {\bfseries \_\-master\_\-down\_\-timer}}
\label{classVrrp_ad1f5dd4872a613de34e08d8cd85eb79a}

\item 
\hypertarget{classVrrp_a466654ffd9c272833058af5e40074729}{
\hyperlink{classXorpTimer}{XorpTimer} {\bfseries \_\-adver\_\-timer}}
\label{classVrrp_a466654ffd9c272833058af5e40074729}

\item 
\hypertarget{classVrrp_a34b3d0a4de85bca5bc264067a2864aac}{
bool {\bfseries \_\-disable}}
\label{classVrrp_a34b3d0a4de85bca5bc264067a2864aac}

\item 
\hypertarget{classVrrp_a0b07f7d893edddb49daa8843da34e9dc}{
\hyperlink{classVrrpPacket}{VrrpPacket} {\bfseries \_\-adv\_\-packet}}
\label{classVrrp_a0b07f7d893edddb49daa8843da34e9dc}

\item 
\hypertarget{classVrrp_a30500336d55b2e9d787f495b227b7e56}{
\hyperlink{classMac}{Mac} {\bfseries \_\-source\_\-mac}}
\label{classVrrp_a30500336d55b2e9d787f495b227b7e56}

\end{DoxyCompactItemize}


\subsection{Detailed Description}
VRRP protocol implementation. This class implements \hyperlink{protocolthe-p}{the} state machine of \hyperlink{protocolthe-p}{the} VRRP protocol. It receive events and responds to them. 

\subsection{Constructor \& Destructor Documentation}
\hypertarget{classVrrp_a4bd9aa055a794cff87c4e74cabdf341b}{
\index{Vrrp@{Vrrp}!Vrrp@{Vrrp}}
\index{Vrrp@{Vrrp}!Vrrp@{Vrrp}}
\subsubsection[{Vrrp}]{\setlength{\rightskip}{0pt plus 5cm}Vrrp::Vrrp (
\begin{DoxyParamCaption}
\item[{{\bf VrrpVif} \&}]{vif, }
\item[{{\bf EventLoop} \&}]{e, }
\item[{uint32\_\-t}]{vrid}
\end{DoxyParamCaption}
)}}
\label{classVrrp_a4bd9aa055a794cff87c4e74cabdf341b}

\begin{DoxyParams}{Parameters}
{\em vif} & \hyperlink{protocolthe-p}{the} VRRP interface on which this instance is running. \\
\hline
{\em e} & eventloop. \\
\hline
{\em vrid} & \hyperlink{protocolthe-p}{the} VRRP id of this instance. \\
\hline
\end{DoxyParams}


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


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


\begin{DoxyParams}{Parameters}
{\em ip} & IP address to add to \hyperlink{protocolthe-p}{the} virtual router. \\
\hline
\end{DoxyParams}
\hypertarget{classVrrp_ae4fcecb56707f778bc72c947bb6579a7}{
\index{Vrrp@{Vrrp}!adver\_\-expiry@{adver\_\-expiry}}
\index{adver\_\-expiry@{adver\_\-expiry}!Vrrp@{Vrrp}}
\subsubsection[{adver\_\-expiry}]{\setlength{\rightskip}{0pt plus 5cm}bool Vrrp::adver\_\-expiry (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}private\mbox{]}}}}
\label{classVrrp_ae4fcecb56707f778bc72c947bb6579a7}


This is called when \hyperlink{protocolthe-p}{the} next advertisement should be sent. 

\begin{DoxyReturn}{Returns}
whether to renew \hyperlink{protocolthe-p}{the} timer. 
\end{DoxyReturn}
\hypertarget{classVrrp_a1042a100b2d34a1ff64dd41bcf38a015}{
\index{Vrrp@{Vrrp}!check\_\-ips@{check\_\-ips}}
\index{check\_\-ips@{check\_\-ips}!Vrrp@{Vrrp}}
\subsubsection[{check\_\-ips}]{\setlength{\rightskip}{0pt plus 5cm}bool Vrrp::check\_\-ips (
\begin{DoxyParamCaption}
\item[{const {\bf VrrpHeader} \&}]{vh}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}private\mbox{]}}}}
\label{classVrrp_a1042a100b2d34a1ff64dd41bcf38a015}


Check whether \hyperlink{protocolthe-p}{the} IPs in \hyperlink{protocolthe-p}{the} VRRP packet match those configured. 

\begin{DoxyReturn}{Returns}
true on exact matches. 
\end{DoxyReturn}

\begin{DoxyParams}{Parameters}
{\em vh} & \hyperlink{protocolthe-p}{the} VRRP header. \\
\hline
\end{DoxyParams}
\hypertarget{classVrrp_a7bb2633b5e0d17ce7c022624181c6bfb}{
\index{Vrrp@{Vrrp}!delete\_\-ip@{delete\_\-ip}}
\index{delete\_\-ip@{delete\_\-ip}!Vrrp@{Vrrp}}
\subsubsection[{delete\_\-ip}]{\setlength{\rightskip}{0pt plus 5cm}void Vrrp::delete\_\-ip (
\begin{DoxyParamCaption}
\item[{const {\bf IPv4} \&}]{ip}
\end{DoxyParamCaption}
)}}
\label{classVrrp_a7bb2633b5e0d17ce7c022624181c6bfb}


Delete an IP from \hyperlink{protocolthe-p}{the} virtual router. 


\begin{DoxyParams}{Parameters}
{\em ip} & IP address to remove from \hyperlink{protocolthe-p}{the} virtual router. \\
\hline
\end{DoxyParams}
\hypertarget{classVrrp_a1583fe2a25a8968b2a2b00faa2d9640d}{
\index{Vrrp@{Vrrp}!get\_\-info@{get\_\-info}}
\index{get\_\-info@{get\_\-info}!Vrrp@{Vrrp}}
\subsubsection[{get\_\-info}]{\setlength{\rightskip}{0pt plus 5cm}void Vrrp::get\_\-info (
\begin{DoxyParamCaption}
\item[{string \&}]{state, }
\item[{{\bf IPv4} \&}]{master}
\end{DoxyParamCaption}
) const}}
\label{classVrrp_a1583fe2a25a8968b2a2b00faa2d9640d}


Obtain an instance to \hyperlink{protocolthe-p}{the} ARP daemon. 

\begin{DoxyReturn}{Returns}
an instance of \hyperlink{protocolthe-p}{the} ARP daemon. Returns information about \hyperlink{protocolthe-p}{the} state of \hyperlink{protocolthe-p}{the} protocol.
\end{DoxyReturn}

\begin{DoxyParams}{Parameters}
{\em state} & \hyperlink{protocolthe-p}{the} state of \hyperlink{protocolthe-p}{the} router (output parameter). \\
\hline
{\em master} & \hyperlink{protocolthe-p}{the} IP address of \hyperlink{protocolthe-p}{the} master (output parameter). \\
\hline
\end{DoxyParams}
\hypertarget{classVrrp_af13f2813276ff40ad289803b45212c6a}{
\index{Vrrp@{Vrrp}!master\_\-down\_\-expiry@{master\_\-down\_\-expiry}}
\index{master\_\-down\_\-expiry@{master\_\-down\_\-expiry}!Vrrp@{Vrrp}}
\subsubsection[{master\_\-down\_\-expiry}]{\setlength{\rightskip}{0pt plus 5cm}bool Vrrp::master\_\-down\_\-expiry (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}private\mbox{]}}}}
\label{classVrrp_af13f2813276ff40ad289803b45212c6a}


This is called when this router thinks \hyperlink{protocolthe-p}{the} master router is dead. 

That is, when \hyperlink{protocolthe-p}{the} timer waiting for an advertisement expires.

\begin{DoxyReturn}{Returns}
whether to reschedule \hyperlink{protocolthe-p}{the} timer. 
\end{DoxyReturn}
\hypertarget{classVrrp_a90d78b2bc0a163e8cefd386661ae72ec}{
\index{Vrrp@{Vrrp}!prepare\_\-advertisement@{prepare\_\-advertisement}}
\index{prepare\_\-advertisement@{prepare\_\-advertisement}!Vrrp@{Vrrp}}
\subsubsection[{prepare\_\-advertisement}]{\setlength{\rightskip}{0pt plus 5cm}void Vrrp::prepare\_\-advertisement (
\begin{DoxyParamCaption}
\item[{uint32\_\-t}]{priority}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}private\mbox{]}}}}
\label{classVrrp_a90d78b2bc0a163e8cefd386661ae72ec}


Create \hyperlink{protocolthe-p}{the} advertisement packet. 


\begin{DoxyParams}{Parameters}
{\em priority} & \hyperlink{protocolthe-p}{the} priority to be announced in \hyperlink{protocolthe-p}{the} advertisement. \\
\hline
\end{DoxyParams}
\hypertarget{classVrrp_adae212aafbefda971dc110a2dd43a69c}{
\index{Vrrp@{Vrrp}!priority@{priority}}
\index{priority@{priority}!Vrrp@{Vrrp}}
\subsubsection[{priority}]{\setlength{\rightskip}{0pt plus 5cm}uint32\_\-t Vrrp::priority (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
) const}}
\label{classVrrp_adae212aafbefda971dc110a2dd43a69c}


Obtain \hyperlink{protocolthe-p}{the} priority of this router. 

\begin{DoxyReturn}{Returns}
priority of router. 
\end{DoxyReturn}
\hypertarget{classVrrp_a8720d4476750752626423eb107cd3d29}{
\index{Vrrp@{Vrrp}!recv@{recv}}
\index{recv@{recv}!Vrrp@{Vrrp}}
\subsubsection[{recv}]{\setlength{\rightskip}{0pt plus 5cm}void Vrrp::recv (
\begin{DoxyParamCaption}
\item[{const {\bf IPv4} \&}]{from, }
\item[{const {\bf VrrpHeader} \&}]{vh}
\end{DoxyParamCaption}
)}}
\label{classVrrp_a8720d4476750752626423eb107cd3d29}


Check whether \hyperlink{protocolthe-p}{the} router owns all IPs configured for \hyperlink{protocolthe-p}{the} virtual router. 

This must be called after updating IP addresses. Must be called when a VRRP packet is received.


\begin{DoxyParams}{Parameters}
{\em from} & IP address sending \hyperlink{protocolthe-p}{the} packet. \\
\hline
{\em vh} & \hyperlink{protocolthe-p}{the} VRRP packet received, starting from \hyperlink{protocolthe-p}{the} VRRP header. \\
\hline
\end{DoxyParams}
\hypertarget{classVrrp_a304732e1f9cc5be8a5770b3e51a1c61c}{
\index{Vrrp@{Vrrp}!recv\_\-adver\_\-backup@{recv\_\-adver\_\-backup}}
\index{recv\_\-adver\_\-backup@{recv\_\-adver\_\-backup}!Vrrp@{Vrrp}}
\subsubsection[{recv\_\-adver\_\-backup}]{\setlength{\rightskip}{0pt plus 5cm}void Vrrp::recv\_\-adver\_\-backup (
\begin{DoxyParamCaption}
\item[{uint32\_\-t}]{priority}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}private\mbox{]}}}}
\label{classVrrp_a304732e1f9cc5be8a5770b3e51a1c61c}


Called when an advertisement is received in \hyperlink{protocolthe-p}{the} backup state. 


\begin{DoxyParams}{Parameters}
{\em priority} & \hyperlink{protocolthe-p}{the} priority within \hyperlink{protocolthe-p}{the} VRRP advertisement. \\
\hline
\end{DoxyParams}
\hypertarget{classVrrp_a2ade766ab4f2c40f7bea636f1d8a50a3}{
\index{Vrrp@{Vrrp}!recv\_\-adver\_\-master@{recv\_\-adver\_\-master}}
\index{recv\_\-adver\_\-master@{recv\_\-adver\_\-master}!Vrrp@{Vrrp}}
\subsubsection[{recv\_\-adver\_\-master}]{\setlength{\rightskip}{0pt plus 5cm}void Vrrp::recv\_\-adver\_\-master (
\begin{DoxyParamCaption}
\item[{const {\bf IPv4} \&}]{from, }
\item[{uint32\_\-t}]{priority}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}private\mbox{]}}}}
\label{classVrrp_a2ade766ab4f2c40f7bea636f1d8a50a3}


Called when receiving an advertisement in \hyperlink{protocolthe-p}{the} master state. 


\begin{DoxyParams}{Parameters}
{\em from} & \hyperlink{protocolthe-p}{the} IP that sent \hyperlink{protocolthe-p}{the} advertisement. \\
\hline
{\em priority} & \hyperlink{protocolthe-p}{the} priority in \hyperlink{protocolthe-p}{the} VRRP advertisement. \\
\hline
\end{DoxyParams}
\hypertarget{classVrrp_a6fd79cdbb6200c2d6a17f165ac3d4ce5}{
\index{Vrrp@{Vrrp}!recv\_\-advertisement@{recv\_\-advertisement}}
\index{recv\_\-advertisement@{recv\_\-advertisement}!Vrrp@{Vrrp}}
\subsubsection[{recv\_\-advertisement}]{\setlength{\rightskip}{0pt plus 5cm}void Vrrp::recv\_\-advertisement (
\begin{DoxyParamCaption}
\item[{const {\bf IPv4} \&}]{from, }
\item[{uint32\_\-t}]{priority}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}private\mbox{]}}}}
\label{classVrrp_a6fd79cdbb6200c2d6a17f165ac3d4ce5}


Notification of advertisement reception. 


\begin{DoxyParams}{Parameters}
{\em from} & IP address of sender. \\
\hline
{\em priority} & \hyperlink{protocolthe-p}{the} priority in \hyperlink{protocolthe-p}{the} VRRP header. \\
\hline
\end{DoxyParams}
\hypertarget{classVrrp_aac1806f2b5fccd8dbc01c8273e245206}{
\index{Vrrp@{Vrrp}!running@{running}}
\index{running@{running}!Vrrp@{Vrrp}}
\subsubsection[{running}]{\setlength{\rightskip}{0pt plus 5cm}bool Vrrp::running (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
) const}}
\label{classVrrp_aac1806f2b5fccd8dbc01c8273e245206}


Check whether this instance is running. 

\begin{DoxyReturn}{Returns}
whether this VRRP instance is running. 
\end{DoxyReturn}
\hypertarget{classVrrp_ab83b07bb959aa0cda4ef50d5b29cf145}{
\index{Vrrp@{Vrrp}!send\_\-advertisement@{send\_\-advertisement}}
\index{send\_\-advertisement@{send\_\-advertisement}!Vrrp@{Vrrp}}
\subsubsection[{send\_\-advertisement}]{\setlength{\rightskip}{0pt plus 5cm}void Vrrp::send\_\-advertisement (
\begin{DoxyParamCaption}
\item[{uint32\_\-t}]{priority}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}private\mbox{]}}}}
\label{classVrrp_ab83b07bb959aa0cda4ef50d5b29cf145}


\hyperlink{structSend}{Send} an advertisement with given priority. 


\begin{DoxyParams}{Parameters}
{\em priority} & of \hyperlink{protocolthe-p}{the} advertisement. \\
\hline
\end{DoxyParams}
\hypertarget{classVrrp_aa5f25087b43665417b564df45081c60f}{
\index{Vrrp@{Vrrp}!send\_\-advertisement@{send\_\-advertisement}}
\index{send\_\-advertisement@{send\_\-advertisement}!Vrrp@{Vrrp}}
\subsubsection[{send\_\-advertisement}]{\setlength{\rightskip}{0pt plus 5cm}void Vrrp::send\_\-advertisement (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}private\mbox{]}}}}
\label{classVrrp_aa5f25087b43665417b564df45081c60f}


\hyperlink{structSend}{Send} a VRRP advertisement. 

The parameters are taken from member variables. \hypertarget{classVrrp_a1fa9055c0f15f0cbb3c892428d98edea}{
\index{Vrrp@{Vrrp}!send\_\-arp@{send\_\-arp}}
\index{send\_\-arp@{send\_\-arp}!Vrrp@{Vrrp}}
\subsubsection[{send\_\-arp}]{\setlength{\rightskip}{0pt plus 5cm}void Vrrp::send\_\-arp (
\begin{DoxyParamCaption}
\item[{const {\bf IPv4} \&}]{ip}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}private\mbox{]}}}}
\label{classVrrp_a1fa9055c0f15f0cbb3c892428d98edea}


\hyperlink{structSend}{Send} a gratitious ARP for a specific IP. 


\begin{DoxyParams}{Parameters}
{\em ip} & \hyperlink{protocolthe-p}{the} IP address to send \hyperlink{protocolthe-p}{the} ARP for. \\
\hline
\end{DoxyParams}
\hypertarget{classVrrp_af59e58632615f1f73bc2ea72b98b71e0}{
\index{Vrrp@{Vrrp}!set\_\-disable@{set\_\-disable}}
\index{set\_\-disable@{set\_\-disable}!Vrrp@{Vrrp}}
\subsubsection[{set\_\-disable}]{\setlength{\rightskip}{0pt plus 5cm}void Vrrp::set\_\-disable (
\begin{DoxyParamCaption}
\item[{bool}]{disable}
\end{DoxyParamCaption}
)}}
\label{classVrrp_af59e58632615f1f73bc2ea72b98b71e0}


Stop or start this VRRP instance. 


\begin{DoxyParams}{Parameters}
{\em disable} & stop this VRRP instance. \\
\hline
\end{DoxyParams}
\hypertarget{classVrrp_a96f0e4d2758baf79c401010ab2056ab1}{
\index{Vrrp@{Vrrp}!set\_\-interval@{set\_\-interval}}
\index{set\_\-interval@{set\_\-interval}!Vrrp@{Vrrp}}
\subsubsection[{set\_\-interval}]{\setlength{\rightskip}{0pt plus 5cm}void Vrrp::set\_\-interval (
\begin{DoxyParamCaption}
\item[{uint32\_\-t}]{interval}
\end{DoxyParamCaption}
)}}
\label{classVrrp_a96f0e4d2758baf79c401010ab2056ab1}


Set \hyperlink{protocolthe-p}{the} advertisement interval. 


\begin{DoxyParams}{Parameters}
{\em interval} & \hyperlink{protocolthe-p}{the} interval for sending advertisements. \\
\hline
\end{DoxyParams}
\hypertarget{classVrrp_a8a78ac045a45367c858e9e124217f0e8}{
\index{Vrrp@{Vrrp}!set\_\-preempt@{set\_\-preempt}}
\index{set\_\-preempt@{set\_\-preempt}!Vrrp@{Vrrp}}
\subsubsection[{set\_\-preempt}]{\setlength{\rightskip}{0pt plus 5cm}void Vrrp::set\_\-preempt (
\begin{DoxyParamCaption}
\item[{bool}]{preempt}
\end{DoxyParamCaption}
)}}
\label{classVrrp_a8a78ac045a45367c858e9e124217f0e8}


Set whether a high priority backup router should preempt backup routers with lower priority acting as masters. 


\begin{DoxyParams}{Parameters}
{\em preempt} & whether a high priority backup should preempt a low one. \\
\hline
\end{DoxyParams}
\hypertarget{classVrrp_a5455359e5e8f0f3adc0263f9215b5036}{
\index{Vrrp@{Vrrp}!set\_\-priority@{set\_\-priority}}
\index{set\_\-priority@{set\_\-priority}!Vrrp@{Vrrp}}
\subsubsection[{set\_\-priority}]{\setlength{\rightskip}{0pt plus 5cm}void Vrrp::set\_\-priority (
\begin{DoxyParamCaption}
\item[{uint32\_\-t}]{priority}
\end{DoxyParamCaption}
)}}
\label{classVrrp_a5455359e5e8f0f3adc0263f9215b5036}


Set \hyperlink{protocolthe-p}{the} priority of \hyperlink{protocolthe-p}{the} router. 


\begin{DoxyParams}{Parameters}
{\em priority} & \hyperlink{protocolthe-p}{the} priority of this router. \\
\hline
\end{DoxyParams}
\hypertarget{classVrrp_a1cbb35b24f2b940ee3199458188c990e}{
\index{Vrrp@{Vrrp}!setup\_\-intervals@{setup\_\-intervals}}
\index{setup\_\-intervals@{setup\_\-intervals}!Vrrp@{Vrrp}}
\subsubsection[{setup\_\-intervals}]{\setlength{\rightskip}{0pt plus 5cm}void Vrrp::setup\_\-intervals (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}private\mbox{]}}}}
\label{classVrrp_a1cbb35b24f2b940ee3199458188c990e}


Calculate advertisement intervals based on protocol parameters. 

This is called when any of these parameters (e.g., whether \hyperlink{protocolthe-p}{the} router owns \hyperlink{protocolthe-p}{the} IPs) change. \hypertarget{classVrrp_a29c464fe4ecc684869b18dba82c2a2a1}{
\index{Vrrp@{Vrrp}!setup\_\-timers@{setup\_\-timers}}
\index{setup\_\-timers@{setup\_\-timers}!Vrrp@{Vrrp}}
\subsubsection[{setup\_\-timers}]{\setlength{\rightskip}{0pt plus 5cm}void Vrrp::setup\_\-timers (
\begin{DoxyParamCaption}
\item[{bool}]{skew = {\ttfamily false}}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}private\mbox{]}}}}
\label{classVrrp_a29c464fe4ecc684869b18dba82c2a2a1}


Setup timers based on intervals. 

Must be called when intervals change.


\begin{DoxyParams}{Parameters}
{\em skew} & whether \hyperlink{protocolthe-p}{the} skew time should be added when setting \hyperlink{protocolthe-p}{the} timer. \\
\hline
\end{DoxyParams}


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