\hypertarget{classPortIOBase}{
\section{PortIOBase$<$ A $>$ Class Template Reference}
\label{classPortIOBase}\index{PortIOBase@{PortIOBase}}
}


Base class for RIP \hyperlink{classPort}{Port} I/O classes.  




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

Inheritance diagram for PortIOBase$<$ A $>$:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[height=2.000000cm]{classPortIOBase}
\end{center}
\end{figure}
\subsection*{Public Types}
\begin{DoxyCompactItemize}
\item 
\hypertarget{classPortIOBase_ab2d789037afa466490a32fec7cce8c9a}{
typedef A {\bfseries Addr}}
\label{classPortIOBase_ab2d789037afa466490a32fec7cce8c9a}

\item 
\hypertarget{classPortIOBase_a1b094d53e1aaa33096236c1d83d1e7bc}{
typedef \hyperlink{classPortIOUserBase}{PortIOUserBase}$<$ A $>$ {\bfseries PortIOUser}}
\label{classPortIOBase_a1b094d53e1aaa33096236c1d83d1e7bc}

\end{DoxyCompactItemize}
\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\hypertarget{classPortIOBase_a9c2aaa6c7333f1cf302c8dee87012f2e}{
\hyperlink{classPortIOBase_a9c2aaa6c7333f1cf302c8dee87012f2e}{PortIOBase} (\hyperlink{classPortIOUserBase}{PortIOUser} \&user, const string \&ifname, const string \&vifname, const Addr \&address, bool enabled=true)}
\label{classPortIOBase_a9c2aaa6c7333f1cf302c8dee87012f2e}

\begin{DoxyCompactList}\small\item\em Constructor associating a \hyperlink{classPort}{Port} I/O \hyperlink{classUser}{User} object with I/O object. \item\end{DoxyCompactList}\item 
virtual bool \hyperlink{classPortIOBase_a05d942cfaac1f0ace17e51f75041cb86}{send} (const Addr \&dst\_\-addr, uint16\_\-t dst\_\-port, const vector$<$ uint8\_\-t $>$ \&rip\_\-packet)=0
\begin{DoxyCompactList}\small\item\em \hyperlink{structSend}{Send} RIP packet to \hyperlink{classPort}{Port}. \item\end{DoxyCompactList}\item 
virtual bool \hyperlink{classPortIOBase_a5df37d0b4273c43c4f2bc44adb07c92a}{pending} () const =0
\begin{DoxyCompactList}\small\item\em Check if send request is pending. \item\end{DoxyCompactList}\item 
\hypertarget{classPortIOBase_a058b7e9a7a1c6b864753bf5085f05bba}{
const string \& \hyperlink{classPortIOBase_a058b7e9a7a1c6b864753bf5085f05bba}{ifname} () const }
\label{classPortIOBase_a058b7e9a7a1c6b864753bf5085f05bba}

\begin{DoxyCompactList}\small\item\em Get Interface name associated with I/O. \item\end{DoxyCompactList}\item 
\hypertarget{classPortIOBase_abae28a1ee83d58ec3f507dd8f4d5c80c}{
const string \& \hyperlink{classPortIOBase_abae28a1ee83d58ec3f507dd8f4d5c80c}{vifname} () const }
\label{classPortIOBase_abae28a1ee83d58ec3f507dd8f4d5c80c}

\begin{DoxyCompactList}\small\item\em Get Virtual Interface name associated with I/O. \item\end{DoxyCompactList}\item 
\hypertarget{classPortIOBase_aab99161eb5a9efb3fc28007f3c98bcc6}{
const Addr \& \hyperlink{classPortIOBase_aab99161eb5a9efb3fc28007f3c98bcc6}{address} () const }
\label{classPortIOBase_aab99161eb5a9efb3fc28007f3c98bcc6}

\begin{DoxyCompactList}\small\item\em Get associated address. \item\end{DoxyCompactList}\item 
\hypertarget{classPortIOBase_a5439dbb8a676402c749e2cd90379c847}{
size\_\-t \hyperlink{classPortIOBase_a5439dbb8a676402c749e2cd90379c847}{max\_\-route\_\-entries\_\-per\_\-packet} () const }
\label{classPortIOBase_a5439dbb8a676402c749e2cd90379c847}

\begin{DoxyCompactList}\small\item\em Get \hyperlink{protocolthe-p}{the} maximum number of route entries in a packet. \item\end{DoxyCompactList}\item 
bool \hyperlink{classPortIOBase_a6464105bc89205b08f053ef36b65d371}{set\_\-max\_\-route\_\-entries\_\-per\_\-packet} (size\_\-t max\_\-entries)
\begin{DoxyCompactList}\small\item\em Set \hyperlink{protocolthe-p}{the} maximum number of route entries in a packet. \item\end{DoxyCompactList}\item 
\hypertarget{classPortIOBase_a3da7555e5aabcfb66e3389c88eb9caeb}{
bool \hyperlink{classPortIOBase_a3da7555e5aabcfb66e3389c88eb9caeb}{enabled} () const }
\label{classPortIOBase_a3da7555e5aabcfb66e3389c88eb9caeb}

\begin{DoxyCompactList}\small\item\em Get enabled status of I/O system. \item\end{DoxyCompactList}\item 
void \hyperlink{classPortIOBase_a9479ea794591d375db8b2e6b88c4cdd1}{set\_\-enabled} (bool en)
\begin{DoxyCompactList}\small\item\em Set enabled status of I/O system. \item\end{DoxyCompactList}\item 
\hypertarget{classPortIOBase_a113a31a8184047e7ea812f929718b4cd}{
{\footnotesize template$<$$>$ }\\bool {\bfseries set\_\-max\_\-route\_\-entries\_\-per\_\-packet} (size\_\-t max\_\-entries)}
\label{classPortIOBase_a113a31a8184047e7ea812f929718b4cd}

\end{DoxyCompactItemize}
\subsection*{Protected Attributes}
\begin{DoxyCompactItemize}
\item 
\hypertarget{classPortIOBase_a730ab22e3b01cdac38ecf3fa752b1c6c}{
\hyperlink{classPortIOUserBase}{PortIOUser} \& {\bfseries \_\-user}}
\label{classPortIOBase_a730ab22e3b01cdac38ecf3fa752b1c6c}

\item 
\hypertarget{classPortIOBase_af5e7ad2c635f73f9b172f9718d84558b}{
string {\bfseries \_\-ifname}}
\label{classPortIOBase_af5e7ad2c635f73f9b172f9718d84558b}

\item 
\hypertarget{classPortIOBase_a0d55e9e6e902cc31e44d8748438adc15}{
string {\bfseries \_\-vifname}}
\label{classPortIOBase_a0d55e9e6e902cc31e44d8748438adc15}

\item 
\hypertarget{classPortIOBase_a52d8bcc20e057824c950d407481bac61}{
Addr {\bfseries \_\-addr}}
\label{classPortIOBase_a52d8bcc20e057824c950d407481bac61}

\item 
\hypertarget{classPortIOBase_a75faefd1d167d836eb5fb799680f12ed}{
size\_\-t {\bfseries \_\-max\_\-rte\_\-pp}}
\label{classPortIOBase_a75faefd1d167d836eb5fb799680f12ed}

\item 
\hypertarget{classPortIOBase_a422ea089b0d6f07cb69fd172486b6fa1}{
bool {\bfseries \_\-en}}
\label{classPortIOBase_a422ea089b0d6f07cb69fd172486b6fa1}

\end{DoxyCompactItemize}


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

Base class for RIP \hyperlink{classPort}{Port} I/O classes. RIP \hyperlink{classPort}{Port} I/O classes provide support for reading and writing to RIP Ports. 

\subsection{Member Function Documentation}
\hypertarget{classPortIOBase_a5df37d0b4273c43c4f2bc44adb07c92a}{
\index{PortIOBase@{PortIOBase}!pending@{pending}}
\index{pending@{pending}!PortIOBase@{PortIOBase}}
\subsubsection[{pending}]{\setlength{\rightskip}{0pt plus 5cm}template$<$typename A$>$ virtual bool {\bf PortIOBase}$<$ A $>$::pending (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
) const\hspace{0.3cm}{\ttfamily  \mbox{[}pure virtual\mbox{]}}}}
\label{classPortIOBase_a5df37d0b4273c43c4f2bc44adb07c92a}


Check if send request is pending. 

\begin{DoxyReturn}{Returns}
true if a send request is pending, false otherwise. 
\end{DoxyReturn}


Implemented in \hyperlink{classBlockedPortIO_a31cb575aa24c729090314970e9be309e}{BlockedPortIO$<$ A $>$}, \hyperlink{classSpoofPortIO_a0d9c5bb65b2290ee07eda22179177cee}{SpoofPortIO$<$ A $>$}, \hyperlink{classXrlPortIO_a01e03741e127145289f4bbe8b8e1d709}{XrlPortIO$<$ A $>$}, and \hyperlink{classSpoofPortIO_a0d9c5bb65b2290ee07eda22179177cee}{SpoofPortIO$<$ IPv4 $>$}.

\hypertarget{classPortIOBase_a05d942cfaac1f0ace17e51f75041cb86}{
\index{PortIOBase@{PortIOBase}!send@{send}}
\index{send@{send}!PortIOBase@{PortIOBase}}
\subsubsection[{send}]{\setlength{\rightskip}{0pt plus 5cm}template$<$typename A$>$ virtual bool {\bf PortIOBase}$<$ A $>$::send (
\begin{DoxyParamCaption}
\item[{const Addr \&}]{dst\_\-addr, }
\item[{uint16\_\-t}]{dst\_\-port, }
\item[{const vector$<$ uint8\_\-t $>$ \&}]{rip\_\-packet}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}pure virtual\mbox{]}}}}
\label{classPortIOBase_a05d942cfaac1f0ace17e51f75041cb86}


\hyperlink{structSend}{Send} RIP packet to \hyperlink{classPort}{Port}. 

The invoker of this method is expected to be \hyperlink{protocolthe-p}{the} associated \hyperlink{classPort}{Port} I/O \hyperlink{classUser}{User} instance. The invoker is responsible for \hyperlink{protocolthe-p}{the} packet data in \hyperlink{protocolthe-p}{the} send request and should not decommission \hyperlink{protocolthe-p}{the} data until it receives \hyperlink{protocolthe-p}{the} PortIOUserBase$<$A$>$::send\_\-completion callback. If \hyperlink{protocolthe-p}{the} request to send fails immediately \hyperlink{protocolthe-p}{the} send\_\-completion callback is not called for \hyperlink{protocolthe-p}{the} associated data.


\begin{DoxyParams}{Parameters}
{\em dst\_\-addr} & address to send packet. \\
\hline
{\em dst\_\-port} & port to send packet to. \\
\hline
{\em rip\_\-packet} & vector containing rip packet to be sent.\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
false on immediately detectable failure, true otherwise. 
\end{DoxyReturn}


Implemented in \hyperlink{classBlockedPortIO_a744bfb4c16260238e106e60e77e4956f}{BlockedPortIO$<$ A $>$}, \hyperlink{classSpoofPortIO_add12adef9977f02561d8b331c40f7833}{SpoofPortIO$<$ A $>$}, \hyperlink{classXrlPortIO_ab9ceceaaf4e99591f9b5bd575b60e87d}{XrlPortIO$<$ A $>$}, and \hyperlink{classSpoofPortIO_add12adef9977f02561d8b331c40f7833}{SpoofPortIO$<$ IPv4 $>$}.

\hypertarget{classPortIOBase_a9479ea794591d375db8b2e6b88c4cdd1}{
\index{PortIOBase@{PortIOBase}!set\_\-enabled@{set\_\-enabled}}
\index{set\_\-enabled@{set\_\-enabled}!PortIOBase@{PortIOBase}}
\subsubsection[{set\_\-enabled}]{\setlength{\rightskip}{0pt plus 5cm}template$<$typename A $>$ void {\bf PortIOBase}$<$ A $>$::set\_\-enabled (
\begin{DoxyParamCaption}
\item[{bool}]{en}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}inline\mbox{]}}}}
\label{classPortIOBase_a9479ea794591d375db8b2e6b88c4cdd1}


Set enabled status of I/O system. 

The user object associated with \hyperlink{protocolthe-p}{the} I/O system will be notified through PortIOBase$<$A$>$::port\_\-io\_\-enabled\_\-change() if \hyperlink{protocolthe-p}{the} enabled state changes.


\begin{DoxyParams}{Parameters}
{\em en} & new enable state. \\
\hline
\end{DoxyParams}
\hypertarget{classPortIOBase_a6464105bc89205b08f053ef36b65d371}{
\index{PortIOBase@{PortIOBase}!set\_\-max\_\-route\_\-entries\_\-per\_\-packet@{set\_\-max\_\-route\_\-entries\_\-per\_\-packet}}
\index{set\_\-max\_\-route\_\-entries\_\-per\_\-packet@{set\_\-max\_\-route\_\-entries\_\-per\_\-packet}!PortIOBase@{PortIOBase}}
\subsubsection[{set\_\-max\_\-route\_\-entries\_\-per\_\-packet}]{\setlength{\rightskip}{0pt plus 5cm}template$<$typename A$>$ bool {\bf PortIOBase}$<$ A $>$::set\_\-max\_\-route\_\-entries\_\-per\_\-packet (
\begin{DoxyParamCaption}
\item[{size\_\-t}]{max\_\-entries}
\end{DoxyParamCaption}
)}}
\label{classPortIOBase_a6464105bc89205b08f053ef36b65d371}


Set \hyperlink{protocolthe-p}{the} maximum number of route entries in a packet. 

\begin{DoxyReturn}{Returns}
true on success, false if route entries per packet is fixed. 
\end{DoxyReturn}


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