\hypertarget{classEmulateSubnet}{
\section{EmulateSubnet$<$ A $>$ Class Template Reference}
\label{classEmulateSubnet}\index{EmulateSubnet@{EmulateSubnet}}
}


Bind together a set of \hyperlink{classIO}{IO} classes in order to form a virtual subnet for testing, one instance per subnet.  




{\ttfamily \#include $<$emulate\_\-net.hh$>$}

Inheritance diagram for EmulateSubnet$<$ A $>$:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[height=2.000000cm]{classEmulateSubnet}
\end{center}
\end{figure}
\subsection*{Classes}
\begin{DoxyCompactItemize}
\item 
struct \hyperlink{classEmulateSubnet_1_1Frame}{Frame}
\item 
struct \hyperlink{classEmulateSubnet_1_1Multiplex}{Multiplex}
\end{DoxyCompactItemize}
\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\hypertarget{classEmulateSubnet_aa0e965f198183d0795e818e2aa5643fe}{
{\bfseries EmulateSubnet} (\hyperlink{classTestInfo}{TestInfo} \&info, \hyperlink{classEventLoop}{EventLoop} \&eventloop)}
\label{classEmulateSubnet_aa0e965f198183d0795e818e2aa5643fe}

\item 
void \hyperlink{classEmulateSubnet_ab42db7b5e405d4ec89fcc0ca4a1f9710}{receive\_\-frames} (const string \&interface, const string \&vif, \hyperlink{classIPv4}{IPv4} dst, uint16\_\-t dport, \hyperlink{classIPv4}{IPv4} src, uint16\_\-t sport, uint8\_\-t $\ast$data, uint32\_\-t len, const string instance)
\begin{DoxyCompactList}\small\item\em Receive frames. \item\end{DoxyCompactList}\item 
\hypertarget{classEmulateSubnet_a68be1569b194a9a3e50dbba9e7324fc9}{
virtual void \hyperlink{classEmulateSubnet_a68be1569b194a9a3e50dbba9e7324fc9}{bind\_\-interface} (const string \&instance, const string \&interface, const string \&vif, const \hyperlink{classIPv4}{IPv4} \&listen\_\-addr, const uint16\_\-t listen\_\-port, \hyperlink{classDebugIO}{DebugIO} \&io)}
\label{classEmulateSubnet_a68be1569b194a9a3e50dbba9e7324fc9}

\begin{DoxyCompactList}\small\item\em Bind an interface to \hyperlink{protocolthe-p}{the} emulated subnet. \item\end{DoxyCompactList}\item 
\hypertarget{classEmulateSubnet_ad3ef29d5484be89123a7f160ae376d9e}{
void \hyperlink{classEmulateSubnet_ad3ef29d5484be89123a7f160ae376d9e}{unbind\_\-interface} (const string \&instance, const string \&interface, const string \&vif, const \hyperlink{classIPv4}{IPv4} \&listen\_\-addr, const uint16\_\-t listen\_\-port, \hyperlink{classDebugIO}{DebugIO} \&io)}
\label{classEmulateSubnet_ad3ef29d5484be89123a7f160ae376d9e}

\begin{DoxyCompactList}\small\item\em Unbind an interface from \hyperlink{protocolthe-p}{the} emulated subnet. \item\end{DoxyCompactList}\item 
\hypertarget{classEmulateSubnet_abd8d026e4221cee712f473de6c758eae}{
void {\bfseries set\_\-all\_\-nodes\_\-addr} (\hyperlink{classIPv4}{IPv4} all\_\-nodes\_\-addr)}
\label{classEmulateSubnet_abd8d026e4221cee712f473de6c758eae}

\item 
\hypertarget{classEmulateSubnet_aa0e965f198183d0795e818e2aa5643fe}{
{\bfseries EmulateSubnet} (\hyperlink{classTestInfo}{TestInfo} \&info, \hyperlink{classEventLoop}{EventLoop} \&eventloop)}
\label{classEmulateSubnet_aa0e965f198183d0795e818e2aa5643fe}

\item 
void \hyperlink{classEmulateSubnet_aaab897b4e981a9463c048757b2d76135}{receive\_\-frames} (const string \&interface, const string \&vif, A dst, A src, uint8\_\-t $\ast$data, uint32\_\-t len, const string instance)
\begin{DoxyCompactList}\small\item\em Receive frames. \item\end{DoxyCompactList}\item 
\hypertarget{classEmulateSubnet_a0857db62726822b2a630b767d831d209}{
void \hyperlink{classEmulateSubnet_a0857db62726822b2a630b767d831d209}{bind\_\-interfaces} (const string \&instance, const string \&interface, const string \&vif, \hyperlink{classDebugIO}{DebugIO}$<$ A $>$ \&io)}
\label{classEmulateSubnet_a0857db62726822b2a630b767d831d209}

\begin{DoxyCompactList}\small\item\em Bind together a set of interfaces. \item\end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Protected Member Functions}
\begin{DoxyCompactItemize}
\item 
\hypertarget{classEmulateSubnet_ae80ac5f8d53e5eb6625e2f1e7bfd45c6}{
void {\bfseries next} ()}
\label{classEmulateSubnet_ae80ac5f8d53e5eb6625e2f1e7bfd45c6}

\item 
\hypertarget{classEmulateSubnet_a17245b11041902610650fc327e0f683a}{
virtual void {\bfseries forward} (\hyperlink{classEmulateSubnet_1_1Frame}{Frame} frame)}
\label{classEmulateSubnet_a17245b11041902610650fc327e0f683a}

\end{DoxyCompactItemize}
\subsection*{Protected Attributes}
\begin{DoxyCompactItemize}
\item 
\hypertarget{classEmulateSubnet_a9e0ae775b93ae9cff601e68af5f96d97}{
\hyperlink{classTestInfo}{TestInfo} \& {\bfseries \_\-info}}
\label{classEmulateSubnet_a9e0ae775b93ae9cff601e68af5f96d97}

\item 
\hypertarget{classEmulateSubnet_a4aac1c72277c3f7741f0727d934fdf0b}{
\hyperlink{classEventLoop}{EventLoop} \& {\bfseries \_\-eventloop}}
\label{classEmulateSubnet_a4aac1c72277c3f7741f0727d934fdf0b}

\item 
\hypertarget{classEmulateSubnet_a050f69e3d06ae6c8184a3a2753acea74}{
map$<$ const \hyperlink{classEmulateSubnet_1_1Multiplex}{Multiplex}, \hyperlink{classDebugIO}{DebugIO} $\ast$ $>$ {\bfseries \_\-ios}}
\label{classEmulateSubnet_a050f69e3d06ae6c8184a3a2753acea74}

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

\item 
\hypertarget{classEmulateSubnet_a08a5a69073188c7e61dec8c7f022c81f}{
deque$<$ \hyperlink{classEmulateSubnet_1_1Frame}{Frame} $>$ {\bfseries \_\-queue} \mbox{[}2\mbox{]}}
\label{classEmulateSubnet_a08a5a69073188c7e61dec8c7f022c81f}

\item 
\hypertarget{classEmulateSubnet_ab342134a52052161359fa7221cb0d641}{
int {\bfseries \_\-queue\_\-add}}
\label{classEmulateSubnet_ab342134a52052161359fa7221cb0d641}

\item 
\hypertarget{classEmulateSubnet_ab070714ba57544ee270fa2a6b89641ea}{
int {\bfseries \_\-queue\_\-remove}}
\label{classEmulateSubnet_ab070714ba57544ee270fa2a6b89641ea}

\item 
\hypertarget{classEmulateSubnet_a73a1590c4fca2effec5840f409a9ce51}{
\hyperlink{classIPv4}{IPv4} {\bfseries \_\-all\_\-nodes\_\-addr}}
\label{classEmulateSubnet_a73a1590c4fca2effec5840f409a9ce51}

\end{DoxyCompactItemize}
\subsection*{Private Member Functions}
\begin{DoxyCompactItemize}
\item 
\hypertarget{classEmulateSubnet_ae80ac5f8d53e5eb6625e2f1e7bfd45c6}{
void {\bfseries next} ()}
\label{classEmulateSubnet_ae80ac5f8d53e5eb6625e2f1e7bfd45c6}

\item 
\hypertarget{classEmulateSubnet_a17245b11041902610650fc327e0f683a}{
void {\bfseries forward} (\hyperlink{classEmulateSubnet_1_1Frame}{Frame} frame)}
\label{classEmulateSubnet_a17245b11041902610650fc327e0f683a}

\end{DoxyCompactItemize}
\subsection*{Private Attributes}
\begin{DoxyCompactItemize}
\item 
\hypertarget{classEmulateSubnet_ae1a4d5de23e8854bb86eb400a23eeb36}{
map$<$ const \hyperlink{classEmulateSubnet_1_1Multiplex}{Multiplex}, \hyperlink{classDebugIO}{DebugIO}$<$ A $>$ $\ast$ $>$ {\bfseries \_\-ios}}
\label{classEmulateSubnet_ae1a4d5de23e8854bb86eb400a23eeb36}

\end{DoxyCompactItemize}


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

Bind together a set of \hyperlink{classIO}{IO} classes in order to form a virtual subnet for testing, one instance per subnet. 

\subsection{Member Function Documentation}
\hypertarget{classEmulateSubnet_ab42db7b5e405d4ec89fcc0ca4a1f9710}{
\index{EmulateSubnet@{EmulateSubnet}!receive\_\-frames@{receive\_\-frames}}
\index{receive\_\-frames@{receive\_\-frames}!EmulateSubnet@{EmulateSubnet}}
\subsubsection[{receive\_\-frames}]{\setlength{\rightskip}{0pt plus 5cm}template$<$typename A $>$ void {\bf EmulateSubnet}$<$ A $>$::receive\_\-frames (
\begin{DoxyParamCaption}
\item[{const string \&}]{interface, }
\item[{const string \&}]{vif, }
\item[{{\bf IPv4}}]{dst, }
\item[{uint16\_\-t}]{dport, }
\item[{{\bf IPv4}}]{src, }
\item[{uint16\_\-t}]{sport, }
\item[{uint8\_\-t $\ast$}]{data, }
\item[{uint32\_\-t}]{len, }
\item[{const string}]{instance}
\end{DoxyParamCaption}
)}}
\label{classEmulateSubnet_ab42db7b5e405d4ec89fcc0ca4a1f9710}


Receive frames. 

All frames generated by an OLSR instance arrive here. Note that a frame arriving from one OLSR instance is not sent directly to another. The frames are queued and only when OLSR instance gives back control to \hyperlink{protocolthe-p}{the} eventloop are \hyperlink{protocolthe-p}{the} frames forwarded. This ensures that two OLSR instances are not in each others call graphs, which can cause re-\/entrancy problems. \hypertarget{classEmulateSubnet_aaab897b4e981a9463c048757b2d76135}{
\index{EmulateSubnet@{EmulateSubnet}!receive\_\-frames@{receive\_\-frames}}
\index{receive\_\-frames@{receive\_\-frames}!EmulateSubnet@{EmulateSubnet}}
\subsubsection[{receive\_\-frames}]{\setlength{\rightskip}{0pt plus 5cm}template$<$typename A $>$ void {\bf EmulateSubnet}$<$ A $>$::receive\_\-frames (
\begin{DoxyParamCaption}
\item[{const string \&}]{interface, }
\item[{const string \&}]{vif, }
\item[{A}]{dst, }
\item[{A}]{src, }
\item[{uint8\_\-t $\ast$}]{data, }
\item[{uint32\_\-t}]{len, }
\item[{const string}]{instance}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}inline\mbox{]}}}}
\label{classEmulateSubnet_aaab897b4e981a9463c048757b2d76135}


Receive frames. 

All frames generated by an OSPF instances arrive here. Note that a frame arriving from one OSPF instance is not sent directly to another. The frames are queued and only when OSPF instance gives back control to \hyperlink{protocolthe-p}{the} eventloop are \hyperlink{protocolthe-p}{the} frames forwarded. This ensures that two OSPF instances are not in each others call graphs, which can cause re-\/entrancy problems. 

The documentation for this class was generated from the following files:\begin{DoxyCompactItemize}
\item 
/home/greearb/git/xorp.ct.github/xorp/contrib/olsr/emulate\_\-net.hh\item 
/home/greearb/git/xorp.ct.github/xorp/ospf/tests/test\_\-peering.cc\item 
/home/greearb/git/xorp.ct.github/xorp/contrib/olsr/emulate\_\-net.cc\end{DoxyCompactItemize}
