\hypertarget{classIfTree}{
\section{IfTree Class Reference}
\label{classIfTree}\index{IfTree@{IfTree}}
}


Container class for FEA Interface objects in a system.  




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

Inheritance diagram for IfTree:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[height=3.000000cm]{classIfTree}
\end{center}
\end{figure}
\subsection*{Public Types}
\begin{DoxyCompactItemize}
\item 
\hypertarget{classIfTree_a67a345d3b33ada8bfd7457a4b256e9b6}{
typedef map$<$ string, \hyperlink{classIfTreeInterface}{IfTreeInterface} $\ast$ $>$ {\bfseries IfMap}}
\label{classIfTree_a67a345d3b33ada8bfd7457a4b256e9b6}

\item 
\hypertarget{classIfTree_afd6b44a3f2f8a3014c97921d4651b59f}{
typedef map$<$ uint32\_\-t, \hyperlink{classIfTreeInterface}{IfTreeInterface} $\ast$ $>$ {\bfseries IfIndexMap}}
\label{classIfTree_afd6b44a3f2f8a3014c97921d4651b59f}

\item 
\hypertarget{classIfTree_a087255b6461351e5a65490a61ebf97d5}{
typedef multimap$<$ uint32\_\-t, \hyperlink{classIfTreeVif}{IfTreeVif} $\ast$ $>$ {\bfseries VifIndexMap}}
\label{classIfTree_a087255b6461351e5a65490a61ebf97d5}

\end{DoxyCompactItemize}
\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\hypertarget{classIfTree_a3352cb353dc4cfd048b591252ef9629b}{
\hyperlink{classIfTree_a3352cb353dc4cfd048b591252ef9629b}{IfTree} (const char $\ast$tree\_\-name)}
\label{classIfTree_a3352cb353dc4cfd048b591252ef9629b}

\begin{DoxyCompactList}\small\item\em Default constructor. \item\end{DoxyCompactList}\item 
\hyperlink{classIfTree_a66af6c7ab7a1e095de28a7adc0b22a17}{IfTree} (const \hyperlink{classIfTree}{IfTree} \&other)
\begin{DoxyCompactList}\small\item\em Constructor from another \hyperlink{classIfTree}{IfTree}. \item\end{DoxyCompactList}\item 
\hypertarget{classIfTree_aefd89c9990155c660e6423620f57838c}{
virtual \hyperlink{classIfTree_aefd89c9990155c660e6423620f57838c}{$\sim$IfTree} ()}
\label{classIfTree_aefd89c9990155c660e6423620f57838c}

\begin{DoxyCompactList}\small\item\em Destructor. \item\end{DoxyCompactList}\item 
\hyperlink{classIfTree}{IfTree} \& \hyperlink{classIfTree_abdce57c3d2892f34ac01073e990ddfa6}{operator=} (const \hyperlink{classIfTree}{IfTree} \&other)
\begin{DoxyCompactList}\small\item\em Assignment operator. \item\end{DoxyCompactList}\item 
\hypertarget{classIfTree_aefa9dcec7a709b612b5668ec04b1fdc6}{
void \hyperlink{classIfTree_aefa9dcec7a709b612b5668ec04b1fdc6}{clear} ()}
\label{classIfTree_aefa9dcec7a709b612b5668ec04b1fdc6}

\begin{DoxyCompactList}\small\item\em Remove all interface state from \hyperlink{protocolthe-p}{the} interface tree. \item\end{DoxyCompactList}\item 
\hypertarget{classIfTree_a75d6f7e46de762984ca2369e2a64ed69}{
void \hyperlink{classIfTree_a75d6f7e46de762984ca2369e2a64ed69}{registerListener} (\hyperlink{classIfTreeListener}{IfTreeListener} $\ast$l) const }
\label{classIfTree_a75d6f7e46de762984ca2369e2a64ed69}

\begin{DoxyCompactList}\small\item\em Not really const, but better than having to pass non-\/const references to other classes. \item\end{DoxyCompactList}\item 
\hypertarget{classIfTree_ac76e333b23edd1d2323df629d82952cc}{
void \hyperlink{classIfTree_ac76e333b23edd1d2323df629d82952cc}{unregisterListener} (\hyperlink{classIfTreeListener}{IfTreeListener} $\ast$l) const }
\label{classIfTree_ac76e333b23edd1d2323df629d82952cc}

\begin{DoxyCompactList}\small\item\em Not really const, but better than having to pass non-\/const references to other classes. \item\end{DoxyCompactList}\item 
void \hyperlink{classIfTree_ad6be0507ac10239183e80e7cecfa3333}{add\_\-recursive\_\-interface} (const \hyperlink{classIfTreeInterface}{IfTreeInterface} \&other\_\-iface, bool mark\_\-state)
\begin{DoxyCompactList}\small\item\em Add recursively a new interface. \item\end{DoxyCompactList}\item 
int \hyperlink{classIfTree_aeffde039b32c005681c50412495cc1ac}{add\_\-interface} (const string \&ifname)
\begin{DoxyCompactList}\small\item\em Create a new interface. \item\end{DoxyCompactList}\item 
int \hyperlink{classIfTree_ab2705822703d42ebef087e5dc7aeb2cb}{remove\_\-interface} (const string \&ifname)
\begin{DoxyCompactList}\small\item\em Label interface as ready for deletion. \item\end{DoxyCompactList}\item 
int \hyperlink{classIfTree_a52b07c17c442b0b49b33acaf931deb6e}{update\_\-interface} (const \hyperlink{classIfTreeInterface}{IfTreeInterface} \&other\_\-iface)
\begin{DoxyCompactList}\small\item\em Recursively create a new interface or update its state if it already exists. \item\end{DoxyCompactList}\item 
\hyperlink{classIfTreeInterface}{IfTreeInterface} $\ast$ \hyperlink{classIfTree_a1fb1e6bf9053e491534db02396efb645}{find\_\-interface} (const string \&ifname)
\begin{DoxyCompactList}\small\item\em Find an interface. \item\end{DoxyCompactList}\item 
const \hyperlink{classIfTreeInterface}{IfTreeInterface} $\ast$ \hyperlink{classIfTree_a35deb09f90f42e9eadffa5fe87285b85}{find\_\-interface} (const string \&ifname) const 
\begin{DoxyCompactList}\small\item\em Find a const interface. \item\end{DoxyCompactList}\item 
\hyperlink{classIfTreeInterface}{IfTreeInterface} $\ast$ \hyperlink{classIfTree_aa941a3f8114078ed14ceb44ca5c90fd7}{find\_\-interface} (uint32\_\-t pif\_\-index)
\begin{DoxyCompactList}\small\item\em Find an interface for a given physical index. \item\end{DoxyCompactList}\item 
const \hyperlink{classIfTreeInterface}{IfTreeInterface} $\ast$ \hyperlink{classIfTree_ae305f9fe60b64a89c9f158e86a9cd42e}{find\_\-interface} (uint32\_\-t pif\_\-index) const 
\begin{DoxyCompactList}\small\item\em Find a const interface for a given physical index. \item\end{DoxyCompactList}\item 
\hyperlink{classIfTreeVif}{IfTreeVif} $\ast$ \hyperlink{classIfTree_abdd21879f2b0fd9c175cab301d5e5aa1}{find\_\-vif} (const string \&ifname, const string \&vifname)
\begin{DoxyCompactList}\small\item\em Find a vif. \item\end{DoxyCompactList}\item 
const \hyperlink{classIfTreeVif}{IfTreeVif} $\ast$ \hyperlink{classIfTree_a6057b490161397fc56937a3e50c784cf}{find\_\-vif} (const string \&ifname, const string \&vifname) const 
\begin{DoxyCompactList}\small\item\em Find a const vif. \item\end{DoxyCompactList}\item 
\hyperlink{classIfTreeVif}{IfTreeVif} $\ast$ \hyperlink{classIfTree_ac52bf153078f337a29a5fd3af06bf0ac}{find\_\-vif} (uint32\_\-t pif\_\-index)
\begin{DoxyCompactList}\small\item\em Find a vif for a given physical index. \item\end{DoxyCompactList}\item 
const \hyperlink{classIfTreeVif}{IfTreeVif} $\ast$ \hyperlink{classIfTree_a671178ed4e9d1100be747bca94df401e}{find\_\-vif} (uint32\_\-t pif\_\-index) const 
\begin{DoxyCompactList}\small\item\em Find a const vif for a given physical index. \item\end{DoxyCompactList}\item 
\hyperlink{classIfTreeAddr4}{IfTreeAddr4} $\ast$ \hyperlink{classIfTree_ae17b39d862c3ade0e2a3ef4b11ec93fa}{find\_\-addr} (const string \&ifname, const string \&vifname, const \hyperlink{classIPv4}{IPv4} \&addr)
\begin{DoxyCompactList}\small\item\em Find an \hyperlink{classIPv4}{IPv4} address. \item\end{DoxyCompactList}\item 
const \hyperlink{classIfTreeAddr4}{IfTreeAddr4} $\ast$ \hyperlink{classIfTree_ac638a990dd8b312b6f3e548459b7ddad}{find\_\-addr} (const string \&ifname, const string \&vifname, const \hyperlink{classIPv4}{IPv4} \&addr) const 
\begin{DoxyCompactList}\small\item\em Find a const \hyperlink{classIPv4}{IPv4} address. \item\end{DoxyCompactList}\item 
\hyperlink{classIfTreeAddr6}{IfTreeAddr6} $\ast$ \hyperlink{classIfTree_abc1598bc3d21d04064e84294825f23f0}{find\_\-addr} (const string \&ifname, const string \&vifname, const \hyperlink{classIPv6}{IPv6} \&addr)
\begin{DoxyCompactList}\small\item\em Find an \hyperlink{classIPv6}{IPv6} address. \item\end{DoxyCompactList}\item 
const \hyperlink{classIfTreeAddr6}{IfTreeAddr6} $\ast$ \hyperlink{classIfTree_adf3bd24c5e46f5acf7f4863176a5c37a}{find\_\-addr} (const string \&ifname, const string \&vifname, const \hyperlink{classIPv6}{IPv6} \&addr) const 
\begin{DoxyCompactList}\small\item\em Find a const \hyperlink{classIPv6}{IPv6} address. \item\end{DoxyCompactList}\item 
bool \hyperlink{classIfTree_a0dd292b8971eed0974d428ab7a3f47ec}{find\_\-interface\_\-vif\_\-by\_\-addr} (const \hyperlink{classIPvX}{IPvX} \&addr, const \hyperlink{classIfTreeInterface}{IfTreeInterface} $\ast$\&ifp, const \hyperlink{classIfTreeVif}{IfTreeVif} $\ast$\&vifp) const 
\begin{DoxyCompactList}\small\item\em Find an interface and a vif by an address that belongs to that interface and vif. \item\end{DoxyCompactList}\item 
bool \hyperlink{classIfTree_a1ec77266d2894403d34273c2111ae149}{find\_\-interface\_\-vif\_\-same\_\-subnet\_\-or\_\-p2p} (const \hyperlink{classIPvX}{IPvX} \&addr, const \hyperlink{classIfTreeInterface}{IfTreeInterface} $\ast$\&ifp, const \hyperlink{classIfTreeVif}{IfTreeVif} $\ast$\&vifp) const 
\begin{DoxyCompactList}\small\item\em Find an interface and a vif by an address that shares \hyperlink{protocolthe-p}{the} same subnet or p2p address. \item\end{DoxyCompactList}\item 
IfMap \& \hyperlink{classIfTree_a63748d665b030b50ea7ef97904022686}{interfaces} ()
\begin{DoxyCompactList}\small\item\em Get \hyperlink{protocolthe-p}{the} map with \hyperlink{protocolthe-p}{the} stored interfaces. \item\end{DoxyCompactList}\item 
const IfMap \& \hyperlink{classIfTree_a5233893cbc524cd141515d463b3c8662}{interfaces} () const 
\begin{DoxyCompactList}\small\item\em Get \hyperlink{protocolthe-p}{the} const map with \hyperlink{protocolthe-p}{the} stored interfaces. \item\end{DoxyCompactList}\item 
\hyperlink{classIfTree}{IfTree} \& \hyperlink{classIfTree_a24e07aac45cb769710cea9481e682b58}{align\_\-with\_\-pulled\_\-changes} (const \hyperlink{classIfTree}{IfTree} \&other, const \hyperlink{classIfTree}{IfTree} \&user\_\-config)
\begin{DoxyCompactList}\small\item\em Align system-\/user merged configuration with \hyperlink{protocolthe-p}{the} pulled changes in \hyperlink{protocolthe-p}{the} system configuration. \item\end{DoxyCompactList}\item 
\hyperlink{classIfTree}{IfTree} \& \hyperlink{classIfTree_a67d309506cfa49338b1bb3cc18408b1e}{align\_\-with\_\-observed\_\-changes} (const \hyperlink{classIfTree}{IfTree} \&other, const \hyperlink{classIfTree}{IfTree} \&user\_\-config)
\begin{DoxyCompactList}\small\item\em Align system-\/user merged configuration with \hyperlink{protocolthe-p}{the} observed changes in \hyperlink{protocolthe-p}{the} system configuration. \item\end{DoxyCompactList}\item 
\hyperlink{classIfTree}{IfTree} \& \hyperlink{classIfTree_a50112db6b82c523b9fe0a2b66be0fabb}{align\_\-with\_\-user\_\-config} (const \hyperlink{classIfTree}{IfTree} \&other)
\begin{DoxyCompactList}\small\item\em Align system-\/user merged configuration with \hyperlink{protocolthe-p}{the} user configuration changes. \item\end{DoxyCompactList}\item 
\hyperlink{classIfTree}{IfTree} \& \hyperlink{classIfTree_aeafb056b6e4a1d5163dc9089ed9d9589}{prepare\_\-replacement\_\-state} (const \hyperlink{classIfTree}{IfTree} \&other)
\begin{DoxyCompactList}\small\item\em Prepare configuration for pushing and replacing previous configuration. \item\end{DoxyCompactList}\item 
\hyperlink{classIfTree}{IfTree} \& \hyperlink{classIfTree_accdd9c38b224f9d6d784f755d668bcf3}{prune\_\-bogus\_\-deleted\_\-state} (const \hyperlink{classIfTree}{IfTree} \&old\_\-iftree)
\begin{DoxyCompactList}\small\item\em Prune bogus deleted state. \item\end{DoxyCompactList}\item 
\hypertarget{classIfTree_a97f08de1e0b8407d6888109c546ff9cb}{
void \hyperlink{classIfTree_a97f08de1e0b8407d6888109c546ff9cb}{finalize\_\-state} ()}
\label{classIfTree_a97f08de1e0b8407d6888109c546ff9cb}

\begin{DoxyCompactList}\small\item\em Delete interfaces labelled as ready for deletion, call \hyperlink{classIfTree_a97f08de1e0b8407d6888109c546ff9cb}{finalize\_\-state()} on remaining interfaces, and set state to NO\_\-CHANGE. \item\end{DoxyCompactList}\item 
string \hyperlink{classIfTree_a7e96d9a4624677f37a4f6f304b5eaa62}{str} () const 
\item 
\hypertarget{classIfTree_a4c87092f23516dcc2bd3504258ee7e37}{
const string \& {\bfseries getName} () const }
\label{classIfTree_a4c87092f23516dcc2bd3504258ee7e37}

\item 
\hypertarget{classIfTree_ae542cac7f1b23bf7e7cc14f31b53494e}{
void {\bfseries markVifDeleted} (\hyperlink{classIfTreeVif}{IfTreeVif} $\ast$ifp)}
\label{classIfTree_ae542cac7f1b23bf7e7cc14f31b53494e}

\item 
\hypertarget{classIfTree_ac2fdbba1310107764138b090cadcdcf5}{
void {\bfseries markIfaceDeleted} (\hyperlink{classIfTreeInterface}{IfTreeInterface} $\ast$ifp)}
\label{classIfTree_ac2fdbba1310107764138b090cadcdcf5}

\end{DoxyCompactItemize}
\subsection*{Protected Member Functions}
\begin{DoxyCompactItemize}
\item 
\hypertarget{classIfTree_a2dbfc9a214a145d678a7a8dd3894b0ea}{
void {\bfseries insert\_\-ifindex} (\hyperlink{classIfTreeInterface}{IfTreeInterface} $\ast$ifp)}
\label{classIfTree_a2dbfc9a214a145d678a7a8dd3894b0ea}

\item 
\hypertarget{classIfTree_a007061fb80779c8dbe30bee125760973}{
void {\bfseries erase\_\-ifindex} (\hyperlink{classIfTreeInterface}{IfTreeInterface} $\ast$ifp)}
\label{classIfTree_a007061fb80779c8dbe30bee125760973}

\item 
\hypertarget{classIfTree_ae7d25ec7fa690bf1b2939a49d84c0265}{
void {\bfseries insert\_\-vifindex} (\hyperlink{classIfTreeVif}{IfTreeVif} $\ast$vifp)}
\label{classIfTree_ae7d25ec7fa690bf1b2939a49d84c0265}

\item 
\hypertarget{classIfTree_a896759b294b4860c6549fda0f3c1e514}{
void {\bfseries erase\_\-vifindex} (\hyperlink{classIfTreeVif}{IfTreeVif} $\ast$vifp)}
\label{classIfTree_a896759b294b4860c6549fda0f3c1e514}

\item 
\hypertarget{classIfTree_a37c13869a047462ed37eded049cc1fae}{
void {\bfseries sendEvent} (IfTreeVifEventE e, \hyperlink{classIfTreeVif}{IfTreeVif} $\ast$vifp)}
\label{classIfTree_a37c13869a047462ed37eded049cc1fae}

\item 
\hypertarget{classIfTree_ac801718ce9853ec3ed28099a0ee983c0}{
void {\bfseries sendEvent} (IfTreeIfaceEventE e, \hyperlink{classIfTreeInterface}{IfTreeInterface} $\ast$ifp)}
\label{classIfTree_ac801718ce9853ec3ed28099a0ee983c0}

\end{DoxyCompactItemize}
\subsection*{Private Attributes}
\begin{DoxyCompactItemize}
\item 
\hypertarget{classIfTree_ad9729f44aa2b6e405c092dd8bf456288}{
string {\bfseries name}}
\label{classIfTree_ad9729f44aa2b6e405c092dd8bf456288}

\item 
\hypertarget{classIfTree_a98a98df7f032eb9b217a7a3b55886292}{
IfMap {\bfseries \_\-interfaces}}
\label{classIfTree_a98a98df7f032eb9b217a7a3b55886292}

\item 
\hypertarget{classIfTree_ab0de6ecabc21b410f73b0213a7a6f8d7}{
IfIndexMap {\bfseries \_\-ifindex\_\-map}}
\label{classIfTree_ab0de6ecabc21b410f73b0213a7a6f8d7}

\item 
\hypertarget{classIfTree_a8fb9a92744c1bf017d92d8422e983bab}{
VifIndexMap {\bfseries \_\-vifindex\_\-map}}
\label{classIfTree_a8fb9a92744c1bf017d92d8422e983bab}

\item 
\hypertarget{classIfTree_a28da6d7046bc5dd57c2d0d81401ace7d}{
list$<$ \hyperlink{classIfTreeListener}{IfTreeListener} $\ast$ $>$ {\bfseries listeners}}
\label{classIfTree_a28da6d7046bc5dd57c2d0d81401ace7d}

\end{DoxyCompactItemize}
\subsection*{Friends}
\begin{DoxyCompactItemize}
\item 
\hypertarget{classIfTree_a9cadf8a68bac8552930ec26b7a992d39}{
class \hyperlink{classIfTree_a9cadf8a68bac8552930ec26b7a992d39}{IfTreeInterface}}
\label{classIfTree_a9cadf8a68bac8552930ec26b7a992d39}

\item 
\hypertarget{classIfTree_a8ae8422183b666cd59331ddb1adc6f85}{
class \hyperlink{classIfTree_a8ae8422183b666cd59331ddb1adc6f85}{IfTreeVif}}
\label{classIfTree_a8ae8422183b666cd59331ddb1adc6f85}

\end{DoxyCompactItemize}


\subsection{Detailed Description}
Container class for FEA Interface objects in a system. 

\subsection{Constructor \& Destructor Documentation}
\hypertarget{classIfTree_a66af6c7ab7a1e095de28a7adc0b22a17}{
\index{IfTree@{IfTree}!IfTree@{IfTree}}
\index{IfTree@{IfTree}!IfTree@{IfTree}}
\subsubsection[{IfTree}]{\setlength{\rightskip}{0pt plus 5cm}IfTree::IfTree (
\begin{DoxyParamCaption}
\item[{const {\bf IfTree} \&}]{other}
\end{DoxyParamCaption}
)}}
\label{classIfTree_a66af6c7ab7a1e095de28a7adc0b22a17}


Constructor from another \hyperlink{classIfTree}{IfTree}. 


\begin{DoxyParams}{Parameters}
{\em other} & \hyperlink{protocolthe-p}{the} other \hyperlink{classIfTree}{IfTree}. \\
\hline
\end{DoxyParams}


\subsection{Member Function Documentation}
\hypertarget{classIfTree_aeffde039b32c005681c50412495cc1ac}{
\index{IfTree@{IfTree}!add\_\-interface@{add\_\-interface}}
\index{add\_\-interface@{add\_\-interface}!IfTree@{IfTree}}
\subsubsection[{add\_\-interface}]{\setlength{\rightskip}{0pt plus 5cm}int IfTree::add\_\-interface (
\begin{DoxyParamCaption}
\item[{const string \&}]{ifname}
\end{DoxyParamCaption}
)}}
\label{classIfTree_aeffde039b32c005681c50412495cc1ac}


Create a new interface. 


\begin{DoxyParams}{Parameters}
{\em ifname} & \hyperlink{protocolthe-p}{the} interface name. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
XORP\_\-OK on success, otherwise XORP\_\-ERROR. 
\end{DoxyReturn}
\hypertarget{classIfTree_ad6be0507ac10239183e80e7cecfa3333}{
\index{IfTree@{IfTree}!add\_\-recursive\_\-interface@{add\_\-recursive\_\-interface}}
\index{add\_\-recursive\_\-interface@{add\_\-recursive\_\-interface}!IfTree@{IfTree}}
\subsubsection[{add\_\-recursive\_\-interface}]{\setlength{\rightskip}{0pt plus 5cm}void IfTree::add\_\-recursive\_\-interface (
\begin{DoxyParamCaption}
\item[{const {\bf IfTreeInterface} \&}]{other\_\-iface, }
\item[{bool}]{mark\_\-state}
\end{DoxyParamCaption}
)}}
\label{classIfTree_ad6be0507ac10239183e80e7cecfa3333}


Add recursively a new interface. 


\begin{DoxyParams}{Parameters}
{\em other\_\-iface} & \hyperlink{protocolthe-p}{the} interface to add recursively. \\
\hline
{\em mark\_\-state} & if true, then mark \hyperlink{protocolthe-p}{the} state same as \hyperlink{protocolthe-p}{the} state from \hyperlink{protocolthe-p}{the} other interface, otherwise \hyperlink{protocolthe-p}{the} state will be CREATED. \\
\hline
\end{DoxyParams}
\hypertarget{classIfTree_a67d309506cfa49338b1bb3cc18408b1e}{
\index{IfTree@{IfTree}!align\_\-with\_\-observed\_\-changes@{align\_\-with\_\-observed\_\-changes}}
\index{align\_\-with\_\-observed\_\-changes@{align\_\-with\_\-observed\_\-changes}!IfTree@{IfTree}}
\subsubsection[{align\_\-with\_\-observed\_\-changes}]{\setlength{\rightskip}{0pt plus 5cm}{\bf IfTree} \& IfTree::align\_\-with\_\-observed\_\-changes (
\begin{DoxyParamCaption}
\item[{const {\bf IfTree} \&}]{other, }
\item[{const {\bf IfTree} \&}]{user\_\-config}
\end{DoxyParamCaption}
)}}
\label{classIfTree_a67d309506cfa49338b1bb3cc18408b1e}


Align system-\/user merged configuration with \hyperlink{protocolthe-p}{the} observed changes in \hyperlink{protocolthe-p}{the} system configuration. 

Inside \hyperlink{protocolthe-p}{the} FEA there may be multiple configuration representations, typically one \hyperlink{protocolthe-p}{the} user modifies, one that mirrors \hyperlink{protocolthe-p}{the} hardware, and one that merges those two (e.g., some of \hyperlink{protocolthe-p}{the} merged information comes from \hyperlink{protocolthe-p}{the} user configuration while other might come from \hyperlink{protocolthe-p}{the} underlying system). On certain systems there could be asynchronous updates originated by \hyperlink{protocolthe-p}{the} system that are captured by \hyperlink{protocolthe-p}{the} FEA interface observer (e.g., a cable is unplugged, a tunnel interface is added/deleted, etc).

This method is used to align those updates with \hyperlink{protocolthe-p}{the} merged configuration.

1. If an interface in \hyperlink{protocolthe-p}{the} other tree is not in \hyperlink{protocolthe-p}{the} local tree, it is tested whether is in \hyperlink{protocolthe-p}{the} user configuration tree. If not, \hyperlink{protocolthe-p}{the} rest of \hyperlink{protocolthe-p}{the} processing is not applied and \hyperlink{protocolthe-p}{the} interface is ignored. Otherwise it is created, its state is merged from \hyperlink{protocolthe-p}{the} user config and other tree, and is marked as \char`\"{}CREATED\char`\"{}. 2. If an interface in \hyperlink{protocolthe-p}{the} local tree is marked as \char`\"{}soft\char`\"{}, its state is not modified and \hyperlink{protocolthe-p}{the} rest of \hyperlink{protocolthe-p}{the} processing is ignored. 3. If an interface in \hyperlink{protocolthe-p}{the} local tree is marked as \char`\"{}default\_\-system\_\-config\char`\"{}, \hyperlink{protocolthe-p}{the} rest of \hyperlink{protocolthe-p}{the} processing is not applied, and its state (and \hyperlink{protocolthe-p}{the} subtree below it) is copied as-\/is from \hyperlink{protocolthe-p}{the} other tree. 4. If an item in \hyperlink{protocolthe-p}{the} other tree is not in \hyperlink{protocolthe-p}{the} local tree, it is tested whether is in \hyperlink{protocolthe-p}{the} user configuration tree. If not, \hyperlink{protocolthe-p}{the} rest of \hyperlink{protocolthe-p}{the} processing is not applied and \hyperlink{protocolthe-p}{the} item is ignored. Otherwise it is created, its state is merged from \hyperlink{protocolthe-p}{the} user config and \hyperlink{protocolthe-p}{the} other tree, and is marked as \char`\"{}CREATED\char`\"{}. 5. If an item in \hyperlink{protocolthe-p}{the} other tree is marked as: (a) \char`\"{}NO\_\-CHANGE\char`\"{}: The state of \hyperlink{protocolthe-p}{the} entry in \hyperlink{protocolthe-p}{the} other tree is not propagated to \hyperlink{protocolthe-p}{the} local tree, but its subtree entries are processed. (b) \char`\"{}DELETED\char`\"{}: The item in \hyperlink{protocolthe-p}{the} local tree is disabled, and \hyperlink{protocolthe-p}{the} subtree entries are ignored. (c) \char`\"{}CREATED\char`\"{} or \char`\"{}CHANGED\char`\"{}: If \hyperlink{protocolthe-p}{the} state of \hyperlink{protocolthe-p}{the} entry is different in \hyperlink{protocolthe-p}{the} other and \hyperlink{protocolthe-p}{the} local tree, it is copied to \hyperlink{protocolthe-p}{the} local tree, and \hyperlink{protocolthe-p}{the} item in \hyperlink{protocolthe-p}{the} local tree is marked as \char`\"{}CREATED\char`\"{} or \char`\"{}CHANGED\char`\"{}. unless it was marked earlier as \char`\"{}CREATED\char`\"{}. Also, if \hyperlink{protocolthe-p}{the} item is disabled in \hyperlink{protocolthe-p}{the} user config tree, it is marked as \char`\"{}disabled\char`\"{} in \hyperlink{protocolthe-p}{the} local tree.


\begin{DoxyParams}{Parameters}
{\em other} & \hyperlink{protocolthe-p}{the} configuration tree to align state with. \\
\hline
{\em user\_\-config} & \hyperlink{protocolthe-p}{the} user configuration tree to reference during \hyperlink{protocolthe-p}{the} alignment. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
modified configuration structure.
\end{DoxyReturn}
Inside \hyperlink{protocolthe-p}{the} FEA there may be multiple configuration representations, typically one \hyperlink{protocolthe-p}{the} user modifies, one that mirrors \hyperlink{protocolthe-p}{the} hardware, and one that merges those two (e.g., some of \hyperlink{protocolthe-p}{the} merged information comes from \hyperlink{protocolthe-p}{the} user configuration while other might come from \hyperlink{protocolthe-p}{the} underlying system). On certain systems there could be asynchronous updates originated by \hyperlink{protocolthe-p}{the} system that are captured by \hyperlink{protocolthe-p}{the} FEA interface observer (e.g., a cable is unplugged, a tunnel interface is added/deleted, etc).

This method is used to align those updates with \hyperlink{protocolthe-p}{the} merged configuration.

The alignment works as follows: 1. If an interface in \hyperlink{protocolthe-p}{the} other tree is not in \hyperlink{protocolthe-p}{the} local tree, it is tested whether is in \hyperlink{protocolthe-p}{the} user configuration tree. If not, \hyperlink{protocolthe-p}{the} rest of \hyperlink{protocolthe-p}{the} processing is not applied and \hyperlink{protocolthe-p}{the} interface is ignored. Otherwise it is created, its state is merged from \hyperlink{protocolthe-p}{the} user config and other tree, and is marked as \char`\"{}CREATED\char`\"{}. 2. If an interface in \hyperlink{protocolthe-p}{the} local tree is marked as \char`\"{}soft\char`\"{}, its state is not modified and \hyperlink{protocolthe-p}{the} rest of \hyperlink{protocolthe-p}{the} processing is ignored. 3. If an interface in \hyperlink{protocolthe-p}{the} local tree is marked as \char`\"{}default\_\-system\_\-config\char`\"{}, \hyperlink{protocolthe-p}{the} rest of \hyperlink{protocolthe-p}{the} processing is not applied, and its state (and \hyperlink{protocolthe-p}{the} subtree below it) is copied as-\/is from \hyperlink{protocolthe-p}{the} other tree. 4. If an item in \hyperlink{protocolthe-p}{the} other tree is not in \hyperlink{protocolthe-p}{the} local tree, it is tested whether is in \hyperlink{protocolthe-p}{the} user configuration tree. If not, \hyperlink{protocolthe-p}{the} rest of \hyperlink{protocolthe-p}{the} processing is not applied and \hyperlink{protocolthe-p}{the} item is ignored. Otherwise it is created, its state is merged from \hyperlink{protocolthe-p}{the} user config and \hyperlink{protocolthe-p}{the} other tree, and is marked as \char`\"{}CREATED\char`\"{}. 5. If an item in \hyperlink{protocolthe-p}{the} other tree is marked as: (a) \char`\"{}NO\_\-CHANGE\char`\"{}: The state of \hyperlink{protocolthe-p}{the} entry in \hyperlink{protocolthe-p}{the} other tree is not propagated to \hyperlink{protocolthe-p}{the} local tree, but its subtree entries are processed. (b) \char`\"{}DELETED\char`\"{}: The item in \hyperlink{protocolthe-p}{the} local tree is disabled, and \hyperlink{protocolthe-p}{the} subtree entries are ignored. (c) \char`\"{}CREATED\char`\"{} or \char`\"{}CHANGED\char`\"{}: If \hyperlink{protocolthe-p}{the} state of \hyperlink{protocolthe-p}{the} entry is different in \hyperlink{protocolthe-p}{the} other and \hyperlink{protocolthe-p}{the} local tree, it is copied to \hyperlink{protocolthe-p}{the} local tree, and \hyperlink{protocolthe-p}{the} item in \hyperlink{protocolthe-p}{the} local tree is marked as \char`\"{}CREATED\char`\"{} or \char`\"{}CHANGED\char`\"{}. Also, if \hyperlink{protocolthe-p}{the} item is disabled in \hyperlink{protocolthe-p}{the} user config tree, it is marked as \char`\"{}disabled\char`\"{} in \hyperlink{protocolthe-p}{the} local tree.


\begin{DoxyParams}{Parameters}
{\em other} & \hyperlink{protocolthe-p}{the} configuration tree to align state with. \\
\hline
{\em user\_\-config} & \hyperlink{protocolthe-p}{the} user configuration tree to reference during \hyperlink{protocolthe-p}{the} alignment. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
modified configuration structure. 
\end{DoxyReturn}
\hypertarget{classIfTree_a24e07aac45cb769710cea9481e682b58}{
\index{IfTree@{IfTree}!align\_\-with\_\-pulled\_\-changes@{align\_\-with\_\-pulled\_\-changes}}
\index{align\_\-with\_\-pulled\_\-changes@{align\_\-with\_\-pulled\_\-changes}!IfTree@{IfTree}}
\subsubsection[{align\_\-with\_\-pulled\_\-changes}]{\setlength{\rightskip}{0pt plus 5cm}{\bf IfTree} \& IfTree::align\_\-with\_\-pulled\_\-changes (
\begin{DoxyParamCaption}
\item[{const {\bf IfTree} \&}]{other, }
\item[{const {\bf IfTree} \&}]{user\_\-config}
\end{DoxyParamCaption}
)}}
\label{classIfTree_a24e07aac45cb769710cea9481e682b58}


Align system-\/user merged configuration with \hyperlink{protocolthe-p}{the} pulled changes in \hyperlink{protocolthe-p}{the} system configuration. 

Inside \hyperlink{protocolthe-p}{the} FEA there may be multiple configuration representations, typically one \hyperlink{protocolthe-p}{the} user modifies, one that mirrors \hyperlink{protocolthe-p}{the} hardware, and one that merges those two (e.g., some of \hyperlink{protocolthe-p}{the} merged information comes from \hyperlink{protocolthe-p}{the} user configuration while other might come from \hyperlink{protocolthe-p}{the} underlying system). Errors may occur pushing \hyperlink{protocolthe-p}{the} user config down onto \hyperlink{protocolthe-p}{the} hardware and we need a method to update \hyperlink{protocolthe-p}{the} merged config from \hyperlink{protocolthe-p}{the} h/w config that exists after \hyperlink{protocolthe-p}{the} config push. We can't just copy \hyperlink{protocolthe-p}{the} h/w config since \hyperlink{protocolthe-p}{the} user config is restricted to configuration set by \hyperlink{protocolthe-p}{the} user.

The alignment works as follows: 1. If an interface in \hyperlink{protocolthe-p}{the} local tree is marked as \char`\"{}soft\char`\"{}, its state is not modified and \hyperlink{protocolthe-p}{the} rest of \hyperlink{protocolthe-p}{the} processing is ignored. 2. If an interface in \hyperlink{protocolthe-p}{the} local tree is marked as \char`\"{}default\_\-system\_\-config\char`\"{}, \hyperlink{protocolthe-p}{the} rest of \hyperlink{protocolthe-p}{the} processing is not applied, and \hyperlink{protocolthe-p}{the} following rules are used instead: (a) If \hyperlink{protocolthe-p}{the} interface is not in \hyperlink{protocolthe-p}{the} other tree, it is marked as \char`\"{}disabled\char`\"{} and its vifs are marked for deletion. (b) Otherwise, its state (and \hyperlink{protocolthe-p}{the} subtree below it) is copied as-\/is from \hyperlink{protocolthe-p}{the} other tree. 3. If an item in \hyperlink{protocolthe-p}{the} local tree is not in \hyperlink{protocolthe-p}{the} other tree, it is marked as \char`\"{}disabled\char`\"{} in \hyperlink{protocolthe-p}{the} local tree. 4. If an item in \hyperlink{protocolthe-p}{the} local tree is in \hyperlink{protocolthe-p}{the} other tree, and its state is different in \hyperlink{protocolthe-p}{the} local and \hyperlink{protocolthe-p}{the} other tree, \hyperlink{protocolthe-p}{the} state is copied from \hyperlink{protocolthe-p}{the} other tree to \hyperlink{protocolthe-p}{the} local tree. Also, if \hyperlink{protocolthe-p}{the} item is disabled in \hyperlink{protocolthe-p}{the} user config tree, it is marked as \char`\"{}disabled\char`\"{} in \hyperlink{protocolthe-p}{the} local tree.


\begin{DoxyParams}{Parameters}
{\em other} & \hyperlink{protocolthe-p}{the} configuration tree to align state with. \\
\hline
{\em user\_\-config} & \hyperlink{protocolthe-p}{the} user configuration tree to reference during \hyperlink{protocolthe-p}{the} alignment. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
modified configuration structure. 
\end{DoxyReturn}
\hypertarget{classIfTree_a50112db6b82c523b9fe0a2b66be0fabb}{
\index{IfTree@{IfTree}!align\_\-with\_\-user\_\-config@{align\_\-with\_\-user\_\-config}}
\index{align\_\-with\_\-user\_\-config@{align\_\-with\_\-user\_\-config}!IfTree@{IfTree}}
\subsubsection[{align\_\-with\_\-user\_\-config}]{\setlength{\rightskip}{0pt plus 5cm}{\bf IfTree} \& IfTree::align\_\-with\_\-user\_\-config (
\begin{DoxyParamCaption}
\item[{const {\bf IfTree} \&}]{other}
\end{DoxyParamCaption}
)}}
\label{classIfTree_a50112db6b82c523b9fe0a2b66be0fabb}


Align system-\/user merged configuration with \hyperlink{protocolthe-p}{the} user configuration changes. 

Inside \hyperlink{protocolthe-p}{the} FEA there may be multiple configuration representations, typically one \hyperlink{protocolthe-p}{the} user modifies, one that mirrors \hyperlink{protocolthe-p}{the} hardware, and one that merges those two (e.g., some of \hyperlink{protocolthe-p}{the} merged information comes from \hyperlink{protocolthe-p}{the} user configuration while other might come from \hyperlink{protocolthe-p}{the} underlying system).

This method is used to align \hyperlink{protocolthe-p}{the} user configuration changes with \hyperlink{protocolthe-p}{the} merged configuration.

The alignment works as follows: 1. If an item in \hyperlink{protocolthe-p}{the} other tree is not in \hyperlink{protocolthe-p}{the} local tree, it is created in \hyperlink{protocolthe-p}{the} local tree and its state (and \hyperlink{protocolthe-p}{the} subtree below it) is copied as-\/is from \hyperlink{protocolthe-p}{the} other tree, and \hyperlink{protocolthe-p}{the} rest of \hyperlink{protocolthe-p}{the} processing is ignored. 2. If an item in \hyperlink{protocolthe-p}{the} other tree is marked as: (a) \char`\"{}DELETED\char`\"{}: The item in \hyperlink{protocolthe-p}{the} local tree is marked as \char`\"{}DELETED\char`\"{}, and \hyperlink{protocolthe-p}{the} subtree entries are ignored. (b) All other: If \hyperlink{protocolthe-p}{the} state of \hyperlink{protocolthe-p}{the} item is different in \hyperlink{protocolthe-p}{the} other and \hyperlink{protocolthe-p}{the} local tree, it is copied to \hyperlink{protocolthe-p}{the} local tree. Note that we compare \hyperlink{protocolthe-p}{the} state even for \char`\"{}NO\_\-CHANGE\char`\"{} items in case a previous change to a parent item in \hyperlink{protocolthe-p}{the} merged tree has affected \hyperlink{protocolthe-p}{the} entry (e.g., disabled interface would disable \hyperlink{protocolthe-p}{the} vifs and addresses as well).


\begin{DoxyParams}{Parameters}
{\em other} & \hyperlink{protocolthe-p}{the} configuration tree to align state with. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
modified configuration structure. 
\end{DoxyReturn}
\hypertarget{classIfTree_ac638a990dd8b312b6f3e548459b7ddad}{
\index{IfTree@{IfTree}!find\_\-addr@{find\_\-addr}}
\index{find\_\-addr@{find\_\-addr}!IfTree@{IfTree}}
\subsubsection[{find\_\-addr}]{\setlength{\rightskip}{0pt plus 5cm}const {\bf IfTreeAddr4} $\ast$ IfTree::find\_\-addr (
\begin{DoxyParamCaption}
\item[{const string \&}]{ifname, }
\item[{const string \&}]{vifname, }
\item[{const {\bf IPv4} \&}]{addr}
\end{DoxyParamCaption}
) const}}
\label{classIfTree_ac638a990dd8b312b6f3e548459b7ddad}


Find a const \hyperlink{classIPv4}{IPv4} address. 


\begin{DoxyParams}{Parameters}
{\em ifname} & \hyperlink{protocolthe-p}{the} interface name to search for. \\
\hline
{\em vifname} & \hyperlink{protocolthe-p}{the} vif name to search for. \\
\hline
{\em addr} & \hyperlink{protocolthe-p}{the} address to search for. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
a const pointer to \hyperlink{protocolthe-p}{the} vif (\hyperlink{classIfTreeAddr4}{IfTreeAddr4}) or NULL if not found. 
\end{DoxyReturn}
\hypertarget{classIfTree_ae17b39d862c3ade0e2a3ef4b11ec93fa}{
\index{IfTree@{IfTree}!find\_\-addr@{find\_\-addr}}
\index{find\_\-addr@{find\_\-addr}!IfTree@{IfTree}}
\subsubsection[{find\_\-addr}]{\setlength{\rightskip}{0pt plus 5cm}{\bf IfTreeAddr4} $\ast$ IfTree::find\_\-addr (
\begin{DoxyParamCaption}
\item[{const string \&}]{ifname, }
\item[{const string \&}]{vifname, }
\item[{const {\bf IPv4} \&}]{addr}
\end{DoxyParamCaption}
)}}
\label{classIfTree_ae17b39d862c3ade0e2a3ef4b11ec93fa}


Find an \hyperlink{classIPv4}{IPv4} address. 


\begin{DoxyParams}{Parameters}
{\em ifname} & \hyperlink{protocolthe-p}{the} interface name to search for. \\
\hline
{\em vifname} & \hyperlink{protocolthe-p}{the} vif name to search for. \\
\hline
{\em addr} & \hyperlink{protocolthe-p}{the} address to search for. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
a pointer to \hyperlink{protocolthe-p}{the} vif (\hyperlink{classIfTreeAddr4}{IfTreeAddr4}) or NULL if not found. 
\end{DoxyReturn}
\hypertarget{classIfTree_adf3bd24c5e46f5acf7f4863176a5c37a}{
\index{IfTree@{IfTree}!find\_\-addr@{find\_\-addr}}
\index{find\_\-addr@{find\_\-addr}!IfTree@{IfTree}}
\subsubsection[{find\_\-addr}]{\setlength{\rightskip}{0pt plus 5cm}const {\bf IfTreeAddr6} $\ast$ IfTree::find\_\-addr (
\begin{DoxyParamCaption}
\item[{const string \&}]{ifname, }
\item[{const string \&}]{vifname, }
\item[{const {\bf IPv6} \&}]{addr}
\end{DoxyParamCaption}
) const}}
\label{classIfTree_adf3bd24c5e46f5acf7f4863176a5c37a}


Find a const \hyperlink{classIPv6}{IPv6} address. 


\begin{DoxyParams}{Parameters}
{\em ifname} & \hyperlink{protocolthe-p}{the} interface name to search for. \\
\hline
{\em vifname} & \hyperlink{protocolthe-p}{the} vif name to search for. \\
\hline
{\em addr} & \hyperlink{protocolthe-p}{the} address to search for. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
a pointer to \hyperlink{protocolthe-p}{the} vif (\hyperlink{classIfTreeAddr6}{IfTreeAddr6}) or NULL if not found. 
\end{DoxyReturn}
\hypertarget{classIfTree_abc1598bc3d21d04064e84294825f23f0}{
\index{IfTree@{IfTree}!find\_\-addr@{find\_\-addr}}
\index{find\_\-addr@{find\_\-addr}!IfTree@{IfTree}}
\subsubsection[{find\_\-addr}]{\setlength{\rightskip}{0pt plus 5cm}{\bf IfTreeAddr6} $\ast$ IfTree::find\_\-addr (
\begin{DoxyParamCaption}
\item[{const string \&}]{ifname, }
\item[{const string \&}]{vifname, }
\item[{const {\bf IPv6} \&}]{addr}
\end{DoxyParamCaption}
)}}
\label{classIfTree_abc1598bc3d21d04064e84294825f23f0}


Find an \hyperlink{classIPv6}{IPv6} address. 


\begin{DoxyParams}{Parameters}
{\em ifname} & \hyperlink{protocolthe-p}{the} interface name to search for. \\
\hline
{\em vifname} & \hyperlink{protocolthe-p}{the} vif name to search for. \\
\hline
{\em addr} & \hyperlink{protocolthe-p}{the} address to search for. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
a pointer to \hyperlink{protocolthe-p}{the} vif (\hyperlink{classIfTreeAddr6}{IfTreeAddr6}) or NULL if not found. 
\end{DoxyReturn}
\hypertarget{classIfTree_a1fb1e6bf9053e491534db02396efb645}{
\index{IfTree@{IfTree}!find\_\-interface@{find\_\-interface}}
\index{find\_\-interface@{find\_\-interface}!IfTree@{IfTree}}
\subsubsection[{find\_\-interface}]{\setlength{\rightskip}{0pt plus 5cm}{\bf IfTreeInterface} $\ast$ IfTree::find\_\-interface (
\begin{DoxyParamCaption}
\item[{const string \&}]{ifname}
\end{DoxyParamCaption}
)}}
\label{classIfTree_a1fb1e6bf9053e491534db02396efb645}


Find an interface. 


\begin{DoxyParams}{Parameters}
{\em ifname} & \hyperlink{protocolthe-p}{the} interface name to search for. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
a pointer to \hyperlink{protocolthe-p}{the} interface (\hyperlink{classIfTreeInterface}{IfTreeInterface}) or NULL if not found. 
\end{DoxyReturn}
\hypertarget{classIfTree_a35deb09f90f42e9eadffa5fe87285b85}{
\index{IfTree@{IfTree}!find\_\-interface@{find\_\-interface}}
\index{find\_\-interface@{find\_\-interface}!IfTree@{IfTree}}
\subsubsection[{find\_\-interface}]{\setlength{\rightskip}{0pt plus 5cm}const {\bf IfTreeInterface} $\ast$ IfTree::find\_\-interface (
\begin{DoxyParamCaption}
\item[{const string \&}]{ifname}
\end{DoxyParamCaption}
) const}}
\label{classIfTree_a35deb09f90f42e9eadffa5fe87285b85}


Find a const interface. 


\begin{DoxyParams}{Parameters}
{\em ifname} & \hyperlink{protocolthe-p}{the} interface name to search for. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
a const pointer to \hyperlink{protocolthe-p}{the} interface (\hyperlink{classIfTreeInterface}{IfTreeInterface}) or NULL if not found. 
\end{DoxyReturn}
\hypertarget{classIfTree_aa941a3f8114078ed14ceb44ca5c90fd7}{
\index{IfTree@{IfTree}!find\_\-interface@{find\_\-interface}}
\index{find\_\-interface@{find\_\-interface}!IfTree@{IfTree}}
\subsubsection[{find\_\-interface}]{\setlength{\rightskip}{0pt plus 5cm}{\bf IfTreeInterface} $\ast$ IfTree::find\_\-interface (
\begin{DoxyParamCaption}
\item[{uint32\_\-t}]{pif\_\-index}
\end{DoxyParamCaption}
)}}
\label{classIfTree_aa941a3f8114078ed14ceb44ca5c90fd7}


Find an interface for a given physical index. 


\begin{DoxyParams}{Parameters}
{\em pif\_\-index} & \hyperlink{protocolthe-p}{the} physical interface index to search for. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
a pointer to \hyperlink{protocolthe-p}{the} interface (\hyperlink{classIfTreeInterface}{IfTreeInterface}) or NULL if not found. 
\end{DoxyReturn}
\hypertarget{classIfTree_ae305f9fe60b64a89c9f158e86a9cd42e}{
\index{IfTree@{IfTree}!find\_\-interface@{find\_\-interface}}
\index{find\_\-interface@{find\_\-interface}!IfTree@{IfTree}}
\subsubsection[{find\_\-interface}]{\setlength{\rightskip}{0pt plus 5cm}const {\bf IfTreeInterface} $\ast$ IfTree::find\_\-interface (
\begin{DoxyParamCaption}
\item[{uint32\_\-t}]{pif\_\-index}
\end{DoxyParamCaption}
) const}}
\label{classIfTree_ae305f9fe60b64a89c9f158e86a9cd42e}


Find a const interface for a given physical index. 


\begin{DoxyParams}{Parameters}
{\em pif\_\-index} & \hyperlink{protocolthe-p}{the} physical interface index to search for. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
a const pointer to \hyperlink{protocolthe-p}{the} interface (\hyperlink{classIfTreeInterface}{IfTreeInterface}) or NULL if not found. 
\end{DoxyReturn}
\hypertarget{classIfTree_a0dd292b8971eed0974d428ab7a3f47ec}{
\index{IfTree@{IfTree}!find\_\-interface\_\-vif\_\-by\_\-addr@{find\_\-interface\_\-vif\_\-by\_\-addr}}
\index{find\_\-interface\_\-vif\_\-by\_\-addr@{find\_\-interface\_\-vif\_\-by\_\-addr}!IfTree@{IfTree}}
\subsubsection[{find\_\-interface\_\-vif\_\-by\_\-addr}]{\setlength{\rightskip}{0pt plus 5cm}bool IfTree::find\_\-interface\_\-vif\_\-by\_\-addr (
\begin{DoxyParamCaption}
\item[{const {\bf IPvX} \&}]{addr, }
\item[{const {\bf IfTreeInterface} $\ast$\&}]{ifp, }
\item[{const {\bf IfTreeVif} $\ast$\&}]{vifp}
\end{DoxyParamCaption}
) const}}
\label{classIfTree_a0dd292b8971eed0974d428ab7a3f47ec}


Find an interface and a vif by an address that belongs to that interface and vif. 


\begin{DoxyParams}{Parameters}
{\em addr} & \hyperlink{protocolthe-p}{the} address. \\
\hline
{\em ifp} & return-\/by-\/reference a pointer to \hyperlink{protocolthe-p}{the} interface. \\
\hline
{\em vifp} & return-\/by-\/reference a pointer to \hyperlink{protocolthe-p}{the} vif. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
true if a match is found, otherwise false. 
\end{DoxyReturn}
\hypertarget{classIfTree_a1ec77266d2894403d34273c2111ae149}{
\index{IfTree@{IfTree}!find\_\-interface\_\-vif\_\-same\_\-subnet\_\-or\_\-p2p@{find\_\-interface\_\-vif\_\-same\_\-subnet\_\-or\_\-p2p}}
\index{find\_\-interface\_\-vif\_\-same\_\-subnet\_\-or\_\-p2p@{find\_\-interface\_\-vif\_\-same\_\-subnet\_\-or\_\-p2p}!IfTree@{IfTree}}
\subsubsection[{find\_\-interface\_\-vif\_\-same\_\-subnet\_\-or\_\-p2p}]{\setlength{\rightskip}{0pt plus 5cm}bool IfTree::find\_\-interface\_\-vif\_\-same\_\-subnet\_\-or\_\-p2p (
\begin{DoxyParamCaption}
\item[{const {\bf IPvX} \&}]{addr, }
\item[{const {\bf IfTreeInterface} $\ast$\&}]{ifp, }
\item[{const {\bf IfTreeVif} $\ast$\&}]{vifp}
\end{DoxyParamCaption}
) const}}
\label{classIfTree_a1ec77266d2894403d34273c2111ae149}


Find an interface and a vif by an address that shares \hyperlink{protocolthe-p}{the} same subnet or p2p address. 


\begin{DoxyParams}{Parameters}
{\em addr} & \hyperlink{protocolthe-p}{the} address. \\
\hline
{\em ifp} & return-\/by-\/reference a pointer to \hyperlink{protocolthe-p}{the} interface. \\
\hline
{\em vifp} & return-\/by-\/reference a pointer to \hyperlink{protocolthe-p}{the} vif. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
true if a match is found, otherwise false. 
\end{DoxyReturn}
\hypertarget{classIfTree_a671178ed4e9d1100be747bca94df401e}{
\index{IfTree@{IfTree}!find\_\-vif@{find\_\-vif}}
\index{find\_\-vif@{find\_\-vif}!IfTree@{IfTree}}
\subsubsection[{find\_\-vif}]{\setlength{\rightskip}{0pt plus 5cm}const {\bf IfTreeVif} $\ast$ IfTree::find\_\-vif (
\begin{DoxyParamCaption}
\item[{uint32\_\-t}]{pif\_\-index}
\end{DoxyParamCaption}
) const}}
\label{classIfTree_a671178ed4e9d1100be747bca94df401e}


Find a const vif for a given physical index. 


\begin{DoxyParams}{Parameters}
{\em pif\_\-index} & \hyperlink{protocolthe-p}{the} physical interface index to search for. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
a const pointer to \hyperlink{protocolthe-p}{the} vif (\hyperlink{classIfTreeVif}{IfTreeVif}) or NULL if not found. 
\end{DoxyReturn}
\hypertarget{classIfTree_abdd21879f2b0fd9c175cab301d5e5aa1}{
\index{IfTree@{IfTree}!find\_\-vif@{find\_\-vif}}
\index{find\_\-vif@{find\_\-vif}!IfTree@{IfTree}}
\subsubsection[{find\_\-vif}]{\setlength{\rightskip}{0pt plus 5cm}{\bf IfTreeVif} $\ast$ IfTree::find\_\-vif (
\begin{DoxyParamCaption}
\item[{const string \&}]{ifname, }
\item[{const string \&}]{vifname}
\end{DoxyParamCaption}
)}}
\label{classIfTree_abdd21879f2b0fd9c175cab301d5e5aa1}


Find a vif. 


\begin{DoxyParams}{Parameters}
{\em ifname} & \hyperlink{protocolthe-p}{the} interface name to search for. \\
\hline
{\em vifname} & \hyperlink{protocolthe-p}{the} vif name to search for. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
a pointer to \hyperlink{protocolthe-p}{the} vif (\hyperlink{classIfTreeVif}{IfTreeVif}) or NULL if not found. 
\end{DoxyReturn}
\hypertarget{classIfTree_a6057b490161397fc56937a3e50c784cf}{
\index{IfTree@{IfTree}!find\_\-vif@{find\_\-vif}}
\index{find\_\-vif@{find\_\-vif}!IfTree@{IfTree}}
\subsubsection[{find\_\-vif}]{\setlength{\rightskip}{0pt plus 5cm}const {\bf IfTreeVif} $\ast$ IfTree::find\_\-vif (
\begin{DoxyParamCaption}
\item[{const string \&}]{ifname, }
\item[{const string \&}]{vifname}
\end{DoxyParamCaption}
) const}}
\label{classIfTree_a6057b490161397fc56937a3e50c784cf}


Find a const vif. 


\begin{DoxyParams}{Parameters}
{\em ifname} & \hyperlink{protocolthe-p}{the} interface name to search for. \\
\hline
{\em vifname} & \hyperlink{protocolthe-p}{the} vif name to search for. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
a const pointer to \hyperlink{protocolthe-p}{the} vif (\hyperlink{classIfTreeVif}{IfTreeVif}) or NULL if not found. 
\end{DoxyReturn}
\hypertarget{classIfTree_ac52bf153078f337a29a5fd3af06bf0ac}{
\index{IfTree@{IfTree}!find\_\-vif@{find\_\-vif}}
\index{find\_\-vif@{find\_\-vif}!IfTree@{IfTree}}
\subsubsection[{find\_\-vif}]{\setlength{\rightskip}{0pt plus 5cm}{\bf IfTreeVif} $\ast$ IfTree::find\_\-vif (
\begin{DoxyParamCaption}
\item[{uint32\_\-t}]{pif\_\-index}
\end{DoxyParamCaption}
)}}
\label{classIfTree_ac52bf153078f337a29a5fd3af06bf0ac}


Find a vif for a given physical index. 


\begin{DoxyParams}{Parameters}
{\em pif\_\-index} & \hyperlink{protocolthe-p}{the} physical interface index to search for. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
a pointer to \hyperlink{protocolthe-p}{the} vif (\hyperlink{classIfTreeVif}{IfTreeVif}) or NULL if not found. 
\end{DoxyReturn}
\hypertarget{classIfTree_a63748d665b030b50ea7ef97904022686}{
\index{IfTree@{IfTree}!interfaces@{interfaces}}
\index{interfaces@{interfaces}!IfTree@{IfTree}}
\subsubsection[{interfaces}]{\setlength{\rightskip}{0pt plus 5cm}IfMap\& IfTree::interfaces (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}inline\mbox{]}}}}
\label{classIfTree_a63748d665b030b50ea7ef97904022686}


Get \hyperlink{protocolthe-p}{the} map with \hyperlink{protocolthe-p}{the} stored interfaces. 

\begin{DoxyReturn}{Returns}
\hyperlink{protocolthe-p}{the} map with \hyperlink{protocolthe-p}{the} stored interfaces. 
\end{DoxyReturn}
\hypertarget{classIfTree_a5233893cbc524cd141515d463b3c8662}{
\index{IfTree@{IfTree}!interfaces@{interfaces}}
\index{interfaces@{interfaces}!IfTree@{IfTree}}
\subsubsection[{interfaces}]{\setlength{\rightskip}{0pt plus 5cm}const IfMap\& IfTree::interfaces (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
) const\hspace{0.3cm}{\ttfamily  \mbox{[}inline\mbox{]}}}}
\label{classIfTree_a5233893cbc524cd141515d463b3c8662}


Get \hyperlink{protocolthe-p}{the} const map with \hyperlink{protocolthe-p}{the} stored interfaces. 

\begin{DoxyReturn}{Returns}
\hyperlink{protocolthe-p}{the} const map with \hyperlink{protocolthe-p}{the} stored interfaces. 
\end{DoxyReturn}
\hypertarget{classIfTree_abdce57c3d2892f34ac01073e990ddfa6}{
\index{IfTree@{IfTree}!operator=@{operator=}}
\index{operator=@{operator=}!IfTree@{IfTree}}
\subsubsection[{operator=}]{\setlength{\rightskip}{0pt plus 5cm}{\bf IfTree} \& IfTree::operator= (
\begin{DoxyParamCaption}
\item[{const {\bf IfTree} \&}]{other}
\end{DoxyParamCaption}
)}}
\label{classIfTree_abdce57c3d2892f34ac01073e990ddfa6}


Assignment operator. 


\begin{DoxyParams}{Parameters}
{\em other} & \hyperlink{protocolthe-p}{the} other \hyperlink{classIfTree}{IfTree}. \\
\hline
\end{DoxyParams}
\hypertarget{classIfTree_aeafb056b6e4a1d5163dc9089ed9d9589}{
\index{IfTree@{IfTree}!prepare\_\-replacement\_\-state@{prepare\_\-replacement\_\-state}}
\index{prepare\_\-replacement\_\-state@{prepare\_\-replacement\_\-state}!IfTree@{IfTree}}
\subsubsection[{prepare\_\-replacement\_\-state}]{\setlength{\rightskip}{0pt plus 5cm}{\bf IfTree} \& IfTree::prepare\_\-replacement\_\-state (
\begin{DoxyParamCaption}
\item[{const {\bf IfTree} \&}]{other}
\end{DoxyParamCaption}
)}}
\label{classIfTree_aeafb056b6e4a1d5163dc9089ed9d9589}


Prepare configuration for pushing and replacing previous configuration. 

If \hyperlink{protocolthe-p}{the} previous configuration is to be replaced with new configuration, we need to prepare \hyperlink{protocolthe-p}{the} state that will delete, update, and add \hyperlink{protocolthe-p}{the} new state as appropriate. The preparation works as follows:
\begin{DoxyItemize}
\item All items in \hyperlink{protocolthe-p}{the} local tree are preserved and marked as created.
\item All items in \hyperlink{protocolthe-p}{the} other tree that are not in \hyperlink{protocolthe-p}{the} local tree are added to \hyperlink{protocolthe-p}{the} local tree and are marked as deleted.
\end{DoxyItemize}


\begin{DoxyParams}{Parameters}
{\em other} & \hyperlink{protocolthe-p}{the} configuration tree to be used to prepare \hyperlink{protocolthe-p}{the} replacement state. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
modified configuration structure.
\end{DoxyReturn}
If \hyperlink{protocolthe-p}{the} previous configuration is to be replaced with new configuration, we need to prepare \hyperlink{protocolthe-p}{the} state that will delete, update, and add \hyperlink{protocolthe-p}{the} new state as appropriate. The preparation works as follows:
\begin{DoxyItemize}
\item All items in \hyperlink{protocolthe-p}{the} local tree are preserved and are marked as created.
\item All items in \hyperlink{protocolthe-p}{the} other tree that are not in \hyperlink{protocolthe-p}{the} local tree are added to \hyperlink{protocolthe-p}{the} local tree and are marked as deleted.
\end{DoxyItemize}


\begin{DoxyParams}{Parameters}
{\em other} & \hyperlink{protocolthe-p}{the} configuration tree to be used to prepare \hyperlink{protocolthe-p}{the} replacement state. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
modified configuration structure. 
\end{DoxyReturn}
\hypertarget{classIfTree_accdd9c38b224f9d6d784f755d668bcf3}{
\index{IfTree@{IfTree}!prune\_\-bogus\_\-deleted\_\-state@{prune\_\-bogus\_\-deleted\_\-state}}
\index{prune\_\-bogus\_\-deleted\_\-state@{prune\_\-bogus\_\-deleted\_\-state}!IfTree@{IfTree}}
\subsubsection[{prune\_\-bogus\_\-deleted\_\-state}]{\setlength{\rightskip}{0pt plus 5cm}{\bf IfTree} \& IfTree::prune\_\-bogus\_\-deleted\_\-state (
\begin{DoxyParamCaption}
\item[{const {\bf IfTree} \&}]{old\_\-iftree}
\end{DoxyParamCaption}
)}}
\label{classIfTree_accdd9c38b224f9d6d784f755d668bcf3}


Prune bogus deleted state. 

If an item in \hyperlink{protocolthe-p}{the} local tree is marked as deleted, but is not in \hyperlink{protocolthe-p}{the} other tree, then it is removed.


\begin{DoxyParams}{Parameters}
{\em old\_\-iftree} & \hyperlink{protocolthe-p}{the} old tree with \hyperlink{protocolthe-p}{the} state that is used as reference. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
\hyperlink{protocolthe-p}{the} modified configuration tree. 
\end{DoxyReturn}
\hypertarget{classIfTree_ab2705822703d42ebef087e5dc7aeb2cb}{
\index{IfTree@{IfTree}!remove\_\-interface@{remove\_\-interface}}
\index{remove\_\-interface@{remove\_\-interface}!IfTree@{IfTree}}
\subsubsection[{remove\_\-interface}]{\setlength{\rightskip}{0pt plus 5cm}int IfTree::remove\_\-interface (
\begin{DoxyParamCaption}
\item[{const string \&}]{ifname}
\end{DoxyParamCaption}
)}}
\label{classIfTree_ab2705822703d42ebef087e5dc7aeb2cb}


Label interface as ready for deletion. 

Deletion does not occur until \hyperlink{classIfTree_a97f08de1e0b8407d6888109c546ff9cb}{finalize\_\-state()} is called.


\begin{DoxyParams}{Parameters}
{\em ifname} & \hyperlink{protocolthe-p}{the} name of \hyperlink{protocolthe-p}{the} interface to be labelled. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
XORP\_\-OK on success, otherwise XORP\_\-ERROR. 
\end{DoxyReturn}
\hypertarget{classIfTree_a7e96d9a4624677f37a4f6f304b5eaa62}{
\index{IfTree@{IfTree}!str@{str}}
\index{str@{str}!IfTree@{IfTree}}
\subsubsection[{str}]{\setlength{\rightskip}{0pt plus 5cm}string IfTree::str (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
) const}}
\label{classIfTree_a7e96d9a4624677f37a4f6f304b5eaa62}
\begin{DoxyReturn}{Returns}
string representation of \hyperlink{classIfTree}{IfTree}. 
\end{DoxyReturn}


Reimplemented from \hyperlink{classIfTreeItem}{IfTreeItem}.

\hypertarget{classIfTree_a52b07c17c442b0b49b33acaf931deb6e}{
\index{IfTree@{IfTree}!update\_\-interface@{update\_\-interface}}
\index{update\_\-interface@{update\_\-interface}!IfTree@{IfTree}}
\subsubsection[{update\_\-interface}]{\setlength{\rightskip}{0pt plus 5cm}int IfTree::update\_\-interface (
\begin{DoxyParamCaption}
\item[{const {\bf IfTreeInterface} \&}]{other\_\-iface}
\end{DoxyParamCaption}
)}}
\label{classIfTree_a52b07c17c442b0b49b33acaf931deb6e}


Recursively create a new interface or update its state if it already exists. 


\begin{DoxyParams}{Parameters}
{\em other\_\-iface} & \hyperlink{protocolthe-p}{the} interface with \hyperlink{protocolthe-p}{the} state to copy from. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
XORP\_\-OK on success, otherwise XORP\_\-ERROR. 
\end{DoxyReturn}


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