\hypertarget{classIfMgrXrlMirror}{
\section{IfMgrXrlMirror Class Reference}
\label{classIfMgrXrlMirror}\index{IfMgrXrlMirror@{IfMgrXrlMirror}}
}


Maintainer of a local mirror of central IfMgr configuration state via Xrls sent by \hyperlink{protocolthe-p}{the} IfMgr.  




{\ttfamily \#include $<$ifmgr\_\-xrl\_\-mirror.hh$>$}

Inheritance diagram for IfMgrXrlMirror:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[height=2.886598cm]{classIfMgrXrlMirror}
\end{center}
\end{figure}
\subsection*{Public Types}
\begin{DoxyCompactItemize}
\item 
\hypertarget{classIfMgrXrlMirror_ae4d3e6a8d9a115a75f52c48f5f2aa7c4}{
typedef \hyperlink{classref__ptr}{IfMgrCommandSinkBase::Cmd} {\bfseries Cmd}}
\label{classIfMgrXrlMirror_ae4d3e6a8d9a115a75f52c48f5f2aa7c4}

\end{DoxyCompactItemize}
\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\hyperlink{classIfMgrXrlMirror_a0aad70d52e340b46fa14d1868582818c}{IfMgrXrlMirror} (\hyperlink{classEventLoop}{EventLoop} \&e, const char $\ast$rtarget, \hyperlink{classIPv4}{IPv4} finder\_\-addr, uint16\_\-t finder\_\-port)
\begin{DoxyCompactList}\small\item\em Constructor. \item\end{DoxyCompactList}\item 
\hyperlink{classIfMgrXrlMirror_ac01138ae27b882d1e9f93879dc8d32e1}{IfMgrXrlMirror} (\hyperlink{classEventLoop}{EventLoop} \&e, const char $\ast$rtarget, const char $\ast$finder\_\-hostname, uint16\_\-t finder\_\-port)
\begin{DoxyCompactList}\small\item\em Constructor. \item\end{DoxyCompactList}\item 
int \hyperlink{classIfMgrXrlMirror_a4a7257c1a25ff9f42d3cd532f41cd63c}{startup} ()
\begin{DoxyCompactList}\small\item\em Start running. \item\end{DoxyCompactList}\item 
int \hyperlink{classIfMgrXrlMirror_a18a46ecae9a1004751ef1c3077bc99a1}{shutdown} ()
\begin{DoxyCompactList}\small\item\em Stop running and shutdown. \item\end{DoxyCompactList}\item 
const \hyperlink{classIfMgrIfTree}{IfMgrIfTree} \& \hyperlink{classIfMgrXrlMirror_ab543e6f234fede768a12493d6c5693f4}{iftree} () const 
\item 
bool \hyperlink{classIfMgrXrlMirror_a836c76a9bf434b17b619bb31cca34533}{attach\_\-hint\_\-observer} (\hyperlink{classIfMgrHintObserver}{IfMgrHintObserver} $\ast$o)
\begin{DoxyCompactList}\small\item\em Attach an observer interested in receiving IfMgr hints. \item\end{DoxyCompactList}\item 
bool \hyperlink{classIfMgrXrlMirror_a61d7355e29ed07c3d3523eb8c39622f5}{detach\_\-hint\_\-observer} (\hyperlink{classIfMgrHintObserver}{IfMgrHintObserver} $\ast$o)
\begin{DoxyCompactList}\small\item\em Detach an observer interested in receiving IfMgr hints. \item\end{DoxyCompactList}\item 
void \hyperlink{classIfMgrXrlMirror_aedda82a7345a45226ab1d542cd1067b7}{delay\_\-updates} (const \hyperlink{classTimeVal}{TimeVal} \&delay)
\begin{DoxyCompactList}\small\item\em Delay \hyperlink{protocolthe-p}{the} interface configuration tree updates. \item\end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Protected Member Functions}
\begin{DoxyCompactItemize}
\item 
\hypertarget{classIfMgrXrlMirror_aeafc54d99c80276b577f68a5fdb86f7f}{
void {\bfseries finder\_\-ready\_\-event} ()}
\label{classIfMgrXrlMirror_aeafc54d99c80276b577f68a5fdb86f7f}

\item 
\hypertarget{classIfMgrXrlMirror_acb29ba8c48350d999c28bed4caa4644d}{
void {\bfseries finder\_\-disconnect\_\-event} ()}
\label{classIfMgrXrlMirror_acb29ba8c48350d999c28bed4caa4644d}

\item 
\hypertarget{classIfMgrXrlMirror_ac044ae7b495101d362b0c44b3f60a18a}{
void {\bfseries register\_\-with\_\-ifmgr} ()}
\label{classIfMgrXrlMirror_ac044ae7b495101d362b0c44b3f60a18a}

\item 
\hypertarget{classIfMgrXrlMirror_a77152ae075a7e96dc143ca1542f67f86}{
void {\bfseries unregister\_\-with\_\-ifmgr} ()}
\label{classIfMgrXrlMirror_a77152ae075a7e96dc143ca1542f67f86}

\item 
\hypertarget{classIfMgrXrlMirror_a6f3c0a014b009ed6b89511a26af39b1c}{
void {\bfseries tree\_\-complete} ()}
\label{classIfMgrXrlMirror_a6f3c0a014b009ed6b89511a26af39b1c}

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

\item 
\hypertarget{classIfMgrXrlMirror_a3150b48ea43a0c6c27a90d11eda57ade}{
void {\bfseries register\_\-cb} (const \hyperlink{classXrlError}{XrlError} \&e)}
\label{classIfMgrXrlMirror_a3150b48ea43a0c6c27a90d11eda57ade}

\item 
\hypertarget{classIfMgrXrlMirror_a44f0e859affccac1c4bbd4492f364d59}{
void {\bfseries unregister\_\-cb} (const \hyperlink{classXrlError}{XrlError} \&e)}
\label{classIfMgrXrlMirror_a44f0e859affccac1c4bbd4492f364d59}

\end{DoxyCompactItemize}
\subsection*{Protected Attributes}
\begin{DoxyCompactItemize}
\item 
\hypertarget{classIfMgrXrlMirror_a531febeb56a9392c51729481bd3eb99b}{
\hyperlink{classEventLoop}{EventLoop} \& {\bfseries \_\-e}}
\label{classIfMgrXrlMirror_a531febeb56a9392c51729481bd3eb99b}

\item 
\hypertarget{classIfMgrXrlMirror_afbd6f4411e3bd9a14b44a3621964a6d1}{
\hyperlink{classIPv4}{IPv4} {\bfseries \_\-finder\_\-addr}}
\label{classIfMgrXrlMirror_afbd6f4411e3bd9a14b44a3621964a6d1}

\item 
\hypertarget{classIfMgrXrlMirror_aebd4ed03a8c0ebca0513096e2190a033}{
string {\bfseries \_\-finder\_\-hostname}}
\label{classIfMgrXrlMirror_aebd4ed03a8c0ebca0513096e2190a033}

\item 
\hypertarget{classIfMgrXrlMirror_a93bc089e629c7887b55d61855af5295f}{
uint16\_\-t {\bfseries \_\-finder\_\-port}}
\label{classIfMgrXrlMirror_a93bc089e629c7887b55d61855af5295f}

\item 
\hypertarget{classIfMgrXrlMirror_a281e5b608d9e3f73d915b6628f7dddd4}{
\hyperlink{classIfMgrIfTree}{IfMgrIfTree} {\bfseries \_\-iftree}}
\label{classIfMgrXrlMirror_a281e5b608d9e3f73d915b6628f7dddd4}

\item 
\hypertarget{classIfMgrXrlMirror_a4a9598675b83f7d87b20e47c5bd9ddff}{
\hyperlink{classIfMgrCommandDispatcher}{IfMgrCommandDispatcher} {\bfseries \_\-dispatcher}}
\label{classIfMgrXrlMirror_a4a9598675b83f7d87b20e47c5bd9ddff}

\item 
\hypertarget{classIfMgrXrlMirror_a2d89876ea808d86f83970992bb1790c5}{
string {\bfseries \_\-rtarget}}
\label{classIfMgrXrlMirror_a2d89876ea808d86f83970992bb1790c5}

\item 
\hypertarget{classIfMgrXrlMirror_a2bdd70dad6a1bc3769c32c8686ef4b5b}{
\hyperlink{classIfMgrXrlMirrorRouter}{IfMgrXrlMirrorRouter} $\ast$ {\bfseries \_\-rtr}}
\label{classIfMgrXrlMirror_a2bdd70dad6a1bc3769c32c8686ef4b5b}

\item 
\hypertarget{classIfMgrXrlMirror_ab9be86bd8e4cc52530bc72cc4990282e}{
\hyperlink{classIfMgrXrlMirrorTarget}{IfMgrXrlMirrorTarget} $\ast$ {\bfseries \_\-xrl\_\-tgt}}
\label{classIfMgrXrlMirror_ab9be86bd8e4cc52530bc72cc4990282e}

\item 
\hypertarget{classIfMgrXrlMirror_a243c5546240eb21b9324c13e4f864009}{
list$<$ \hyperlink{classIfMgrHintObserver}{IfMgrHintObserver} $\ast$ $>$ {\bfseries \_\-hint\_\-observers}}
\label{classIfMgrXrlMirror_a243c5546240eb21b9324c13e4f864009}

\item 
\hypertarget{classIfMgrXrlMirror_a9807660854966440cc29482d7d65f42b}{
\hyperlink{classXorpTimer}{XorpTimer} {\bfseries \_\-reg\_\-timer}}
\label{classIfMgrXrlMirror_a9807660854966440cc29482d7d65f42b}

\end{DoxyCompactItemize}
\subsection*{Private Member Functions}
\begin{DoxyCompactItemize}
\item 
\hypertarget{classIfMgrXrlMirror_abc49173059e4a70c999c17a1e5576343}{
void \hyperlink{classIfMgrXrlMirror_abc49173059e4a70c999c17a1e5576343}{do\_\-updates} ()}
\label{classIfMgrXrlMirror_abc49173059e4a70c999c17a1e5576343}

\begin{DoxyCompactList}\small\item\em Perform \hyperlink{protocolthe-p}{the} interface configuration tree updates. \item\end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Private Attributes}
\begin{DoxyCompactItemize}
\item 
\hypertarget{classIfMgrXrlMirror_a77ba9f6689d4e555d51158ca5c2e6189}{
\hyperlink{classTimeVal}{TimeVal} {\bfseries \_\-updates\_\-delay}}
\label{classIfMgrXrlMirror_a77ba9f6689d4e555d51158ca5c2e6189}

\item 
\hypertarget{classIfMgrXrlMirror_aacc58b0fac96f65a80e550f4161c72da}{
\hyperlink{classXorpTimer}{XorpTimer} {\bfseries \_\-updates\_\-timer}}
\label{classIfMgrXrlMirror_aacc58b0fac96f65a80e550f4161c72da}

\end{DoxyCompactItemize}


\subsection{Detailed Description}
Maintainer of a local mirror of central IfMgr configuration state via Xrls sent by \hyperlink{protocolthe-p}{the} IfMgr. The \hyperlink{classIfMgrXrlMirror}{IfMgrXrlMirror} contains a copy of \hyperlink{protocolthe-p}{the} central interface configuration state. The \hyperlink{classIfMgrXrlMirror}{IfMgrXrlMirror} class implements \hyperlink{protocolthe-p}{the} \hyperlink{classServiceBase}{ServiceBase} interface. When \hyperlink{classIfMgrXrlMirror_a4a7257c1a25ff9f42d3cd532f41cd63c}{startup()} is called it attempts to register with \hyperlink{protocolthe-p}{the} \hyperlink{classIfMgrXrlReplicationManager}{IfMgrXrlReplicationManager} instance running within \hyperlink{protocolthe-p}{the} FEA. If registration succeeds it will receive \hyperlink{protocolthe-p}{the} complete configuration tree and receive future configuration tree. Once \hyperlink{protocolthe-p}{the} configuration tree is received it transitions into \hyperlink{protocolthe-p}{the} SERVICE\_\-RUNNING state and is considered operational.

When \hyperlink{protocolthe-p}{the} status of \hyperlink{protocolthe-p}{the} \hyperlink{classIfMgrXrlMirror}{IfMgrXrlMirror} is SERVICE\_\-RUNNING, then a copy of \hyperlink{protocolthe-p}{the} interface configuration state is accessible through \hyperlink{protocolthe-p}{the} \hyperlink{classIfMgrXrlMirror_ab543e6f234fede768a12493d6c5693f4}{iftree()} method. If \hyperlink{protocolthe-p}{the} instance is another state then configuration tree available through \hyperlink{protocolthe-p}{the} \hyperlink{classIfMgrXrlMirror}{IfMgrXrlMirror} will be empty.

For parties that are interested in receiving synchronous configuration tree change notifications, they can register as hint observers. Hints provide coarse indication that a change has occured -\/ they announce \hyperlink{protocolthe-p}{the} which item in \hyperlink{protocolthe-p}{the} tree has changed and should be checked. Hint observers express interest through \hyperlink{protocolthe-p}{the} \hyperlink{classIfMgrXrlMirror_a836c76a9bf434b17b619bb31cca34533}{attach\_\-hint\_\-observer()} and \hyperlink{classIfMgrXrlMirror_a61d7355e29ed07c3d3523eb8c39622f5}{detach\_\-hint\_\-observer()} methods. 

\subsection{Constructor \& Destructor Documentation}
\hypertarget{classIfMgrXrlMirror_a0aad70d52e340b46fa14d1868582818c}{
\index{IfMgrXrlMirror@{IfMgrXrlMirror}!IfMgrXrlMirror@{IfMgrXrlMirror}}
\index{IfMgrXrlMirror@{IfMgrXrlMirror}!IfMgrXrlMirror@{IfMgrXrlMirror}}
\subsubsection[{IfMgrXrlMirror}]{\setlength{\rightskip}{0pt plus 5cm}IfMgrXrlMirror::IfMgrXrlMirror (
\begin{DoxyParamCaption}
\item[{{\bf EventLoop} \&}]{e, }
\item[{const char $\ast$}]{rtarget, }
\item[{{\bf IPv4}}]{finder\_\-addr, }
\item[{uint16\_\-t}]{finder\_\-port}
\end{DoxyParamCaption}
)}}
\label{classIfMgrXrlMirror_a0aad70d52e340b46fa14d1868582818c}


Constructor. 


\begin{DoxyParams}{Parameters}
{\em eventloop} & to use for events. \\
\hline
{\em rtarget} & name of \hyperlink{classXrl}{Xrl} class or target to supply interface configuration updates. \\
\hline
{\em finder\_\-addr} & address to route finder messages to. \\
\hline
{\em finder\_\-port} & port to direct finder messages to. \\
\hline
\end{DoxyParams}
\hypertarget{classIfMgrXrlMirror_ac01138ae27b882d1e9f93879dc8d32e1}{
\index{IfMgrXrlMirror@{IfMgrXrlMirror}!IfMgrXrlMirror@{IfMgrXrlMirror}}
\index{IfMgrXrlMirror@{IfMgrXrlMirror}!IfMgrXrlMirror@{IfMgrXrlMirror}}
\subsubsection[{IfMgrXrlMirror}]{\setlength{\rightskip}{0pt plus 5cm}IfMgrXrlMirror::IfMgrXrlMirror (
\begin{DoxyParamCaption}
\item[{{\bf EventLoop} \&}]{e, }
\item[{const char $\ast$}]{rtarget, }
\item[{const char $\ast$}]{finder\_\-hostname, }
\item[{uint16\_\-t}]{finder\_\-port}
\end{DoxyParamCaption}
)}}
\label{classIfMgrXrlMirror_ac01138ae27b882d1e9f93879dc8d32e1}


Constructor. 


\begin{DoxyParams}{Parameters}
{\em eventloop} & to use for events. \\
\hline
{\em rtarget} & name of \hyperlink{classXrl}{Xrl} class or target to supply interface configuration updates. \\
\hline
{\em finder\_\-hostname} & host name to route finder messages to. \\
\hline
{\em finder\_\-port} & port to direct finder messages to. \\
\hline
\end{DoxyParams}


\subsection{Member Function Documentation}
\hypertarget{classIfMgrXrlMirror_a836c76a9bf434b17b619bb31cca34533}{
\index{IfMgrXrlMirror@{IfMgrXrlMirror}!attach\_\-hint\_\-observer@{attach\_\-hint\_\-observer}}
\index{attach\_\-hint\_\-observer@{attach\_\-hint\_\-observer}!IfMgrXrlMirror@{IfMgrXrlMirror}}
\subsubsection[{attach\_\-hint\_\-observer}]{\setlength{\rightskip}{0pt plus 5cm}bool IfMgrXrlMirror::attach\_\-hint\_\-observer (
\begin{DoxyParamCaption}
\item[{{\bf IfMgrHintObserver} $\ast$}]{o}
\end{DoxyParamCaption}
)}}
\label{classIfMgrXrlMirror_a836c76a9bf434b17b619bb31cca34533}


Attach an observer interested in receiving IfMgr hints. 


\begin{DoxyParams}{Parameters}
{\em o} & observer to be attached. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
true on success, false if observer is already registered. 
\end{DoxyReturn}
\hypertarget{classIfMgrXrlMirror_aedda82a7345a45226ab1d542cd1067b7}{
\index{IfMgrXrlMirror@{IfMgrXrlMirror}!delay\_\-updates@{delay\_\-updates}}
\index{delay\_\-updates@{delay\_\-updates}!IfMgrXrlMirror@{IfMgrXrlMirror}}
\subsubsection[{delay\_\-updates}]{\setlength{\rightskip}{0pt plus 5cm}void IfMgrXrlMirror::delay\_\-updates (
\begin{DoxyParamCaption}
\item[{const {\bf TimeVal} \&}]{delay}
\end{DoxyParamCaption}
)}}
\label{classIfMgrXrlMirror_aedda82a7345a45226ab1d542cd1067b7}


Delay \hyperlink{protocolthe-p}{the} interface configuration tree updates. 


\begin{DoxyParams}{Parameters}
{\em delay} & \hyperlink{protocolthe-p}{the} delay. \\
\hline
\end{DoxyParams}
\hypertarget{classIfMgrXrlMirror_a61d7355e29ed07c3d3523eb8c39622f5}{
\index{IfMgrXrlMirror@{IfMgrXrlMirror}!detach\_\-hint\_\-observer@{detach\_\-hint\_\-observer}}
\index{detach\_\-hint\_\-observer@{detach\_\-hint\_\-observer}!IfMgrXrlMirror@{IfMgrXrlMirror}}
\subsubsection[{detach\_\-hint\_\-observer}]{\setlength{\rightskip}{0pt plus 5cm}bool IfMgrXrlMirror::detach\_\-hint\_\-observer (
\begin{DoxyParamCaption}
\item[{{\bf IfMgrHintObserver} $\ast$}]{o}
\end{DoxyParamCaption}
)}}
\label{classIfMgrXrlMirror_a61d7355e29ed07c3d3523eb8c39622f5}


Detach an observer interested in receiving IfMgr hints. 


\begin{DoxyParams}{Parameters}
{\em o} & observer to be detached. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
true on success, false if observer was not registered. 
\end{DoxyReturn}
\hypertarget{classIfMgrXrlMirror_ab543e6f234fede768a12493d6c5693f4}{
\index{IfMgrXrlMirror@{IfMgrXrlMirror}!iftree@{iftree}}
\index{iftree@{iftree}!IfMgrXrlMirror@{IfMgrXrlMirror}}
\subsubsection[{iftree}]{\setlength{\rightskip}{0pt plus 5cm}const {\bf IfMgrIfTree}\& IfMgrXrlMirror::iftree (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
) const\hspace{0.3cm}{\ttfamily  \mbox{[}inline\mbox{]}}}}
\label{classIfMgrXrlMirror_ab543e6f234fede768a12493d6c5693f4}
\begin{DoxyReturn}{Returns}
interface configuration tree. Should only be trusted when \hyperlink{classServiceBase_a90a2baa98739294468a33df22fa985c4}{status()} is SERVICE\_\-READY. 
\end{DoxyReturn}
\hypertarget{classIfMgrXrlMirror_a18a46ecae9a1004751ef1c3077bc99a1}{
\index{IfMgrXrlMirror@{IfMgrXrlMirror}!shutdown@{shutdown}}
\index{shutdown@{shutdown}!IfMgrXrlMirror@{IfMgrXrlMirror}}
\subsubsection[{shutdown}]{\setlength{\rightskip}{0pt plus 5cm}int IfMgrXrlMirror::shutdown (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}virtual\mbox{]}}}}
\label{classIfMgrXrlMirror_a18a46ecae9a1004751ef1c3077bc99a1}


Stop running and shutdown. 

Deregister with \hyperlink{protocolthe-p}{the} registration target and transition to SERVICE\_\-SHUTDOWN state when complete.

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


Implements \hyperlink{classServiceBase_a6ad34506fd5a446d5667abcb2e1b593b}{ServiceBase}.

\hypertarget{classIfMgrXrlMirror_a4a7257c1a25ff9f42d3cd532f41cd63c}{
\index{IfMgrXrlMirror@{IfMgrXrlMirror}!startup@{startup}}
\index{startup@{startup}!IfMgrXrlMirror@{IfMgrXrlMirror}}
\subsubsection[{startup}]{\setlength{\rightskip}{0pt plus 5cm}int IfMgrXrlMirror::startup (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}virtual\mbox{]}}}}
\label{classIfMgrXrlMirror_a4a7257c1a25ff9f42d3cd532f41cd63c}


Start running. 

Attempt to register instance with \hyperlink{protocolthe-p}{the} registration target supplied in \hyperlink{protocolthe-p}{the} constructor and await interface configuration tree data. When data is received transition into \hyperlink{protocolthe-p}{the} SERVICE\_\-RUNNING state (see \hyperlink{classServiceBase}{ServiceBase} for states).

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


Implements \hyperlink{classServiceBase_a791755872b2056ddd82a2f00904c7d2b}{ServiceBase}.



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