\hypertarget{classXrlPortManager}{
\section{XrlPortManager$<$ A $>$ Class Template Reference}
\label{classXrlPortManager}\index{XrlPortManager@{XrlPortManager}}
}


Class for managing RIP Ports and their transport systems.  




{\ttfamily \#include $<$xrl\_\-port\_\-manager.hh$>$}

Inheritance diagram for XrlPortManager$<$ A $>$:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[height=1.768421cm]{classXrlPortManager}
\end{center}
\end{figure}
\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\hypertarget{classXrlPortManager_a63440eada686d0e7225a5a2a32cebdbe}{
{\bfseries XrlPortManager} (\hyperlink{classSystem}{System}$<$ A $>$ \&system, \hyperlink{classXrlRouter}{XrlRouter} \&xr, \hyperlink{classIfMgrXrlMirror}{IfMgrXrlMirror} \&ifm)}
\label{classXrlPortManager_a63440eada686d0e7225a5a2a32cebdbe}

\item 
int \hyperlink{classXrlPortManager_aef92cc4c81bf885ca42b54f6278db6c5}{startup} ()
\begin{DoxyCompactList}\small\item\em Request start up of instance. \item\end{DoxyCompactList}\item 
int \hyperlink{classXrlPortManager_a34b9857945a6d35aa23620388e9c6683}{shutdown} ()
\begin{DoxyCompactList}\small\item\em Request shutdown of instance. \item\end{DoxyCompactList}\item 
bool \hyperlink{classXrlPortManager_a270e5d1bfd07e745a8edd0f900071651}{add\_\-rip\_\-address} (const string \&ifname, const string \&vifname, const A \&addr)
\begin{DoxyCompactList}\small\item\em Request \hyperlink{protocolthe-p}{the} addition of an address to run RIP on. \item\end{DoxyCompactList}\item 
bool \hyperlink{classXrlPortManager_a3c76eb473427e44b1bcf8e0c4840a52d}{remove\_\-rip\_\-address} (const string \&ifname, const string \&vifname, const A \&addr)
\begin{DoxyCompactList}\small\item\em Remove an address running RIP. \item\end{DoxyCompactList}\item 
bool \hyperlink{classXrlPortManager_a5945586dc842d4b44955ae9ccb54ad75}{deliver\_\-packet} (const string \&sockid, const string \&ifname, const string \&vifname, const A \&src\_\-addr, uint16\_\-t src\_\-port, const vector$<$ uint8\_\-t $>$ \&pdata)
\begin{DoxyCompactList}\small\item\em Deliver packet to RIP port associated with socket id that received \hyperlink{protocolthe-p}{the} packet. \item\end{DoxyCompactList}\item 
\hyperlink{classPort}{Port}$<$ A $>$ $\ast$ \hyperlink{classXrlPortManager_a7e87c9b58dda86b319693d922033da05}{find\_\-port} (const string \&ifname, const string \&vifname, const A \&addr)
\begin{DoxyCompactList}\small\item\em Find RIP port associated with interface, vif, address tuple. \item\end{DoxyCompactList}\item 
const \hyperlink{classPort}{Port}$<$ A $>$ $\ast$ \hyperlink{classXrlPortManager_a27f0c8c4781c7ff65668febaf81c92a8}{find\_\-port} (const string \&ifname, const string \&vifname, const A \&addr) const 
\begin{DoxyCompactList}\small\item\em Find RIP port associated with interface, vif, address tuple. \item\end{DoxyCompactList}\item 
bool \hyperlink{classXrlPortManager_ab8a7c25519230f702ca9d030789874a2}{underlying\_\-rip\_\-address\_\-up} (const string \&ifname, const string \&vifname, const A \&addr) const 
\begin{DoxyCompactList}\small\item\em Determine if rip address is up. \item\end{DoxyCompactList}\item 
bool \hyperlink{classXrlPortManager_ac01ab8753df8fc04da6ec085034d2cd9}{underlying\_\-rip\_\-address\_\-exists} (const string \&ifname, const string \&vifname, const A \&addr) const 
\begin{DoxyCompactList}\small\item\em Determine if rip address exists. \item\end{DoxyCompactList}\item 
\hypertarget{classXrlPortManager_ae8d26be77ade3126f86f457a4585b1e2}{
\hyperlink{structTrace}{Trace} \& {\bfseries packet\_\-trace} ()}
\label{classXrlPortManager_ae8d26be77ade3126f86f457a4585b1e2}

\end{DoxyCompactItemize}
\subsection*{Protected Member Functions}
\begin{DoxyCompactItemize}
\item 
\hypertarget{classXrlPortManager_a4192a763664249c27de66b794031bbfe}{
void {\bfseries tree\_\-complete} ()}
\label{classXrlPortManager_a4192a763664249c27de66b794031bbfe}

\item 
\hypertarget{classXrlPortManager_a86075feb7226a67cd8b1da7264bdd430}{
void {\bfseries updates\_\-made} ()}
\label{classXrlPortManager_a86075feb7226a67cd8b1da7264bdd430}

\item 
\hypertarget{classXrlPortManager_adef3a50f2f3d809e66176d3841a981f8}{
void {\bfseries status\_\-change} (\hyperlink{classServiceBase}{ServiceBase} $\ast$service, ServiceStatus old\_\-status, ServiceStatus new\_\-status)}
\label{classXrlPortManager_adef3a50f2f3d809e66176d3841a981f8}

\item 
\hypertarget{classXrlPortManager_ad8596978811e4b32c71856cd22ecdd63}{
void {\bfseries try\_\-start\_\-next\_\-io\_\-handler} ()}
\label{classXrlPortManager_ad8596978811e4b32c71856cd22ecdd63}

\end{DoxyCompactItemize}
\subsection*{Protected Attributes}
\begin{DoxyCompactItemize}
\item 
\hypertarget{classXrlPortManager_a8a9866f7e4656abb97e0620f42ba251d}{
\hyperlink{classXrlRouter}{XrlRouter} \& {\bfseries \_\-xr}}
\label{classXrlPortManager_a8a9866f7e4656abb97e0620f42ba251d}

\item 
\hypertarget{classXrlPortManager_a1719f957c35e91218f7afc498eac78f5}{
\hyperlink{classIfMgrXrlMirror}{IfMgrXrlMirror} \& {\bfseries \_\-ifm}}
\label{classXrlPortManager_a1719f957c35e91218f7afc498eac78f5}

\item 
\hypertarget{classXrlPortManager_a56038f80efcae906841f00d436d2da1b}{
map$<$ \hyperlink{classServiceBase}{ServiceBase} $\ast$, \hyperlink{classPort}{Port}$<$ A $>$ $\ast$ $>$ {\bfseries \_\-dead\_\-ports}}
\label{classXrlPortManager_a56038f80efcae906841f00d436d2da1b}

\end{DoxyCompactItemize}
\subsection*{Private Attributes}
\begin{DoxyCompactItemize}
\item 
\hypertarget{classXrlPortManager_a0aeb9362e021ca7eeff390b490676ad3}{
\hyperlink{structTrace}{Trace} {\bfseries \_\-trace}}
\label{classXrlPortManager_a0aeb9362e021ca7eeff390b490676ad3}

\end{DoxyCompactItemize}


\subsection{Detailed Description}
\subsubsection*{template$<$typename A$>$ class XrlPortManager$<$ A $>$}

Class for managing RIP Ports and their transport systems. The \hyperlink{classXrlPortManager}{XrlPortManager} class instantiates RIP \hyperlink{classPort}{Port} instances and their transport system. The methods add\_\-rip\_\-address and remove\_\-rip\_\-address cause \hyperlink{classPort}{Port} objects and \hyperlink{classXrlPortIO}{XrlPortIO} objects to be instantiated and destructed.

The deliver\_\-packet method forwards an arriving packet to \hyperlink{protocolthe-p}{the} appropriate \hyperlink{classXrlPortIO}{XrlPortIO} object. 

\subsection{Member Function Documentation}
\hypertarget{classXrlPortManager_a270e5d1bfd07e745a8edd0f900071651}{
\index{XrlPortManager@{XrlPortManager}!add\_\-rip\_\-address@{add\_\-rip\_\-address}}
\index{add\_\-rip\_\-address@{add\_\-rip\_\-address}!XrlPortManager@{XrlPortManager}}
\subsubsection[{add\_\-rip\_\-address}]{\setlength{\rightskip}{0pt plus 5cm}template$<$typename A$>$ bool {\bf XrlPortManager}$<$ A $>$::add\_\-rip\_\-address (
\begin{DoxyParamCaption}
\item[{const string \&}]{ifname, }
\item[{const string \&}]{vifname, }
\item[{const A \&}]{addr}
\end{DoxyParamCaption}
)}}
\label{classXrlPortManager_a270e5d1bfd07e745a8edd0f900071651}


Request \hyperlink{protocolthe-p}{the} addition of an address to run RIP on. 

If \hyperlink{protocolthe-p}{the} address is known to exist on \hyperlink{protocolthe-p}{the} specified interface and vif, a request is sent to \hyperlink{protocolthe-p}{the} FEA to create an appropriately bound RIP socket.


\begin{DoxyParams}{Parameters}
{\em interface} & to run RIP on. \\
\hline
{\em vif} & virtual interface to run RIP on. \\
\hline
{\em addr} & address to run RIP on.\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
true on success or if address is already running RIP, false on failure. 
\end{DoxyReturn}
\hypertarget{classXrlPortManager_a5945586dc842d4b44955ae9ccb54ad75}{
\index{XrlPortManager@{XrlPortManager}!deliver\_\-packet@{deliver\_\-packet}}
\index{deliver\_\-packet@{deliver\_\-packet}!XrlPortManager@{XrlPortManager}}
\subsubsection[{deliver\_\-packet}]{\setlength{\rightskip}{0pt plus 5cm}template$<$typename A$>$ bool {\bf XrlPortManager}$<$ A $>$::deliver\_\-packet (
\begin{DoxyParamCaption}
\item[{const string \&}]{sockid, }
\item[{const string \&}]{ifname, }
\item[{const string \&}]{vifname, }
\item[{const A \&}]{src\_\-addr, }
\item[{uint16\_\-t}]{src\_\-port, }
\item[{const vector$<$ uint8\_\-t $>$ \&}]{pdata}
\end{DoxyParamCaption}
)}}
\label{classXrlPortManager_a5945586dc842d4b44955ae9ccb54ad75}


Deliver packet to RIP port associated with socket id that received \hyperlink{protocolthe-p}{the} packet. 


\begin{DoxyParams}{Parameters}
{\em sockid} & unique socket identifier. \\
\hline
{\em ifname} & \hyperlink{protocolthe-p}{the} interface name \hyperlink{protocolthe-p}{the} packet arrived on, if known. If unknown, then it is an empty string. \\
\hline
{\em vifname} & \hyperlink{protocolthe-p}{the} vif name \hyperlink{protocolthe-p}{the} packet arrived on, if known. If unknown, then it is an empty string. \\
\hline
{\em src\_\-addr} & source address of packet. \\
\hline
{\em src\_\-port} & source port of packet. \\
\hline
{\em pdata} & packet data.\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
true if packet delivered, false if \hyperlink{protocolthe-p}{the} owner of \hyperlink{protocolthe-p}{the} sockid can not be found. 
\end{DoxyReturn}
\hypertarget{classXrlPortManager_a7e87c9b58dda86b319693d922033da05}{
\index{XrlPortManager@{XrlPortManager}!find\_\-port@{find\_\-port}}
\index{find\_\-port@{find\_\-port}!XrlPortManager@{XrlPortManager}}
\subsubsection[{find\_\-port}]{\setlength{\rightskip}{0pt plus 5cm}template$<$typename A$>$ {\bf Port}$<$ A $>$ $\ast$ {\bf XrlPortManager}$<$ A $>$::find\_\-port (
\begin{DoxyParamCaption}
\item[{const string \&}]{ifname, }
\item[{const string \&}]{vifname, }
\item[{const A \&}]{addr}
\end{DoxyParamCaption}
)}}
\label{classXrlPortManager_a7e87c9b58dda86b319693d922033da05}


Find RIP port associated with interface, vif, address tuple. 

\begin{DoxyReturn}{Returns}
pointer to port on success, 0 if port could not be found. 
\end{DoxyReturn}
\hypertarget{classXrlPortManager_a27f0c8c4781c7ff65668febaf81c92a8}{
\index{XrlPortManager@{XrlPortManager}!find\_\-port@{find\_\-port}}
\index{find\_\-port@{find\_\-port}!XrlPortManager@{XrlPortManager}}
\subsubsection[{find\_\-port}]{\setlength{\rightskip}{0pt plus 5cm}template$<$typename A$>$ const {\bf Port}$<$ A $>$ $\ast$ {\bf XrlPortManager}$<$ A $>$::find\_\-port (
\begin{DoxyParamCaption}
\item[{const string \&}]{ifname, }
\item[{const string \&}]{vifname, }
\item[{const A \&}]{addr}
\end{DoxyParamCaption}
) const}}
\label{classXrlPortManager_a27f0c8c4781c7ff65668febaf81c92a8}


Find RIP port associated with interface, vif, address tuple. 

\begin{DoxyReturn}{Returns}
pointer to port on success, 0 if port could not be found. 
\end{DoxyReturn}
\hypertarget{classXrlPortManager_a3c76eb473427e44b1bcf8e0c4840a52d}{
\index{XrlPortManager@{XrlPortManager}!remove\_\-rip\_\-address@{remove\_\-rip\_\-address}}
\index{remove\_\-rip\_\-address@{remove\_\-rip\_\-address}!XrlPortManager@{XrlPortManager}}
\subsubsection[{remove\_\-rip\_\-address}]{\setlength{\rightskip}{0pt plus 5cm}template$<$typename A$>$ bool {\bf XrlPortManager}$<$ A $>$::remove\_\-rip\_\-address (
\begin{DoxyParamCaption}
\item[{const string \&}]{ifname, }
\item[{const string \&}]{vifname, }
\item[{const A \&}]{addr}
\end{DoxyParamCaption}
)}}
\label{classXrlPortManager_a3c76eb473427e44b1bcf8e0c4840a52d}


Remove an address running RIP. 


\begin{DoxyParams}{Parameters}
{\em interface} & to run RIP on. \\
\hline
{\em vif} & virtual interface to run RIP on. \\
\hline
{\em addr} & address to run RIP on.\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
true on success or if address is not running RIP, false on otherwise. 
\end{DoxyReturn}
\hypertarget{classXrlPortManager_a34b9857945a6d35aa23620388e9c6683}{
\index{XrlPortManager@{XrlPortManager}!shutdown@{shutdown}}
\index{shutdown@{shutdown}!XrlPortManager@{XrlPortManager}}
\subsubsection[{shutdown}]{\setlength{\rightskip}{0pt plus 5cm}template$<$typename A $>$ int {\bf XrlPortManager}$<$ A $>$::shutdown (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}virtual\mbox{]}}}}
\label{classXrlPortManager_a34b9857945a6d35aa23620388e9c6683}


Request shutdown of instance. 

\begin{DoxyReturn}{Returns}
XORP\_\-OK on success, otherwise XORP\_\-ERROR. 
\end{DoxyReturn}


Implements \hyperlink{classServiceBase_a6ad34506fd5a446d5667abcb2e1b593b}{ServiceBase}.

\hypertarget{classXrlPortManager_aef92cc4c81bf885ca42b54f6278db6c5}{
\index{XrlPortManager@{XrlPortManager}!startup@{startup}}
\index{startup@{startup}!XrlPortManager@{XrlPortManager}}
\subsubsection[{startup}]{\setlength{\rightskip}{0pt plus 5cm}template$<$typename A $>$ int {\bf XrlPortManager}$<$ A $>$::startup (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}virtual\mbox{]}}}}
\label{classXrlPortManager_aef92cc4c81bf885ca42b54f6278db6c5}


Request start up of instance. 

\begin{DoxyReturn}{Returns}
XORP\_\-OK on success, otherwise XORP\_\-ERROR. 
\end{DoxyReturn}


Implements \hyperlink{classServiceBase_a791755872b2056ddd82a2f00904c7d2b}{ServiceBase}.

\hypertarget{classXrlPortManager_ac01ab8753df8fc04da6ec085034d2cd9}{
\index{XrlPortManager@{XrlPortManager}!underlying\_\-rip\_\-address\_\-exists@{underlying\_\-rip\_\-address\_\-exists}}
\index{underlying\_\-rip\_\-address\_\-exists@{underlying\_\-rip\_\-address\_\-exists}!XrlPortManager@{XrlPortManager}}
\subsubsection[{underlying\_\-rip\_\-address\_\-exists}]{\setlength{\rightskip}{0pt plus 5cm}template$<$typename A$>$ bool {\bf XrlPortManager}$<$ A $>$::underlying\_\-rip\_\-address\_\-exists (
\begin{DoxyParamCaption}
\item[{const string \&}]{ifname, }
\item[{const string \&}]{vifname, }
\item[{const A \&}]{addr}
\end{DoxyParamCaption}
) const}}
\label{classXrlPortManager_ac01ab8753df8fc04da6ec085034d2cd9}


Determine if rip address exists. 

The result is based on \hyperlink{protocolthe-p}{the} current state of information from \hyperlink{protocolthe-p}{the} FEA.

\begin{DoxyReturn}{Returns}
true if \hyperlink{protocolthe-p}{the} address is up, false if \hyperlink{protocolthe-p}{the} address is not up or does not exist. 
\end{DoxyReturn}
\hypertarget{classXrlPortManager_ab8a7c25519230f702ca9d030789874a2}{
\index{XrlPortManager@{XrlPortManager}!underlying\_\-rip\_\-address\_\-up@{underlying\_\-rip\_\-address\_\-up}}
\index{underlying\_\-rip\_\-address\_\-up@{underlying\_\-rip\_\-address\_\-up}!XrlPortManager@{XrlPortManager}}
\subsubsection[{underlying\_\-rip\_\-address\_\-up}]{\setlength{\rightskip}{0pt plus 5cm}template$<$typename A$>$ bool {\bf XrlPortManager}$<$ A $>$::underlying\_\-rip\_\-address\_\-up (
\begin{DoxyParamCaption}
\item[{const string \&}]{ifname, }
\item[{const string \&}]{vifname, }
\item[{const A \&}]{addr}
\end{DoxyParamCaption}
) const}}
\label{classXrlPortManager_ab8a7c25519230f702ca9d030789874a2}


Determine if rip address is up. 

The result is based on \hyperlink{protocolthe-p}{the} current state of information from \hyperlink{protocolthe-p}{the} FEA.

\begin{DoxyReturn}{Returns}
true if \hyperlink{protocolthe-p}{the} address is up, false if \hyperlink{protocolthe-p}{the} address is not up or does not exist. 
\end{DoxyReturn}


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