\hypertarget{classWinRtmPipe}{
\section{WinRtmPipe Class Reference}
\label{classWinRtmPipe}\index{WinRtmPipe@{WinRtmPipe}}
}


\hyperlink{classWinRtmPipe}{WinRtmPipe} class opens a routing socket and forwards data arriving on \hyperlink{protocolthe-p}{the} socket to WinRtmPipeObservers.  




{\ttfamily \#include $<$windows\_\-rtm\_\-pipe.hh$>$}

\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\hypertarget{classWinRtmPipe_a3220228a79446b22ec8b1eea153653d2}{
{\bfseries WinRtmPipe} (\hyperlink{classEventLoop}{EventLoop} \&eventloop)}
\label{classWinRtmPipe_a3220228a79446b22ec8b1eea153653d2}

\item 
int \hyperlink{classWinRtmPipe_a660757cc5df9bc3b3f708cb3791017e6}{start} (int af, string \&error\_\-msg)
\begin{DoxyCompactList}\small\item\em Start \hyperlink{protocolthe-p}{the} routing socket operation for a given address family. \item\end{DoxyCompactList}\item 
int \hyperlink{classWinRtmPipe_acca091c0872bad939461b3d5d69cf633}{stop} (string \&error\_\-msg)
\begin{DoxyCompactList}\small\item\em Stop \hyperlink{protocolthe-p}{the} routing socket operation. \item\end{DoxyCompactList}\item 
bool \hyperlink{classWinRtmPipe_abfdad088d0371a1b63ca98f626424265}{is\_\-open} () const 
\begin{DoxyCompactList}\small\item\em Test if \hyperlink{protocolthe-p}{the} routing socket is open. \item\end{DoxyCompactList}\item 
ssize\_\-t \hyperlink{classWinRtmPipe_a630183384b2af3da4245380e13512a9e}{write} (const void $\ast$data, size\_\-t nbytes)
\begin{DoxyCompactList}\small\item\em Write data to routing socket. \item\end{DoxyCompactList}\item 
uint32\_\-t \hyperlink{classWinRtmPipe_a2a43e926531acd53364323b995f15070}{seqno} () const 
\begin{DoxyCompactList}\small\item\em Get \hyperlink{protocolthe-p}{the} sequence number for next message written into \hyperlink{protocolthe-p}{the} kernel. \item\end{DoxyCompactList}\item 
pid\_\-t \hyperlink{classWinRtmPipe_a86593f0ae62dc886dae5ecf61ea5c9c9}{pid} () const 
\begin{DoxyCompactList}\small\item\em Get \hyperlink{protocolthe-p}{the} cached process identifier value. \item\end{DoxyCompactList}\item 
int \hyperlink{classWinRtmPipe_a16e7a70135923eacdc1dc96bd39db85b}{force\_\-read} (string \&error\_\-msg)
\begin{DoxyCompactList}\small\item\em Force socket to read data. \item\end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Private Types}
\begin{DoxyCompactItemize}
\item 
\hypertarget{classWinRtmPipe_ab7eabb8cd15d8b70b49a03aa1f67fbc9}{
typedef list$<$ \hyperlink{classWinRtmPipeObserver}{WinRtmPipeObserver} $\ast$ $>$ {\bfseries ObserverList}}
\label{classWinRtmPipe_ab7eabb8cd15d8b70b49a03aa1f67fbc9}

\end{DoxyCompactItemize}
\subsection*{Private Member Functions}
\begin{DoxyCompactItemize}
\item 
\hypertarget{classWinRtmPipe_a89a710ad639c0fb47be488567e5b029e}{
void \hyperlink{classWinRtmPipe_a89a710ad639c0fb47be488567e5b029e}{io\_\-event} (\hyperlink{classXorpFd}{XorpFd} fd, IoEventType type)}
\label{classWinRtmPipe_a89a710ad639c0fb47be488567e5b029e}

\begin{DoxyCompactList}\small\item\em Read data available for \hyperlink{classWinRtmPipe}{WinRtmPipe} and invoke \hyperlink{classWinRtmPipeObserver_a4a17384822bec7bfe6802a26df6ae0c2}{WinRtmPipeObserver::routing\_\-socket\_\-data()} on all observers of routing socket. \item\end{DoxyCompactList}\item 
\hypertarget{classWinRtmPipe_a00c0b418060f4048d80f55cefcfc0cdf}{
\hyperlink{classWinRtmPipe}{WinRtmPipe} \& {\bfseries operator=} (const \hyperlink{classWinRtmPipe}{WinRtmPipe} \&)}
\label{classWinRtmPipe_a00c0b418060f4048d80f55cefcfc0cdf}

\item 
\hypertarget{classWinRtmPipe_ab704a3a9576e9df63d00d798d9cf8c09}{
{\bfseries WinRtmPipe} (const \hyperlink{classWinRtmPipe}{WinRtmPipe} \&)}
\label{classWinRtmPipe_ab704a3a9576e9df63d00d798d9cf8c09}

\end{DoxyCompactItemize}
\subsection*{Private Attributes}
\begin{DoxyCompactItemize}
\item 
\hypertarget{classWinRtmPipe_a2da7fdd31a3f77eba56ba970831403d1}{
\hyperlink{classEventLoop}{EventLoop} \& {\bfseries \_\-eventloop}}
\label{classWinRtmPipe_a2da7fdd31a3f77eba56ba970831403d1}

\item 
\hypertarget{classWinRtmPipe_a1d97f09c5f51cb154986f3c5b10b610b}{
\hyperlink{classXorpFd}{XorpFd} {\bfseries \_\-fd}}
\label{classWinRtmPipe_a1d97f09c5f51cb154986f3c5b10b610b}

\item 
\hypertarget{classWinRtmPipe_add05d15c39a7e6925cc975ccdc2321bc}{
ObserverList {\bfseries \_\-ol}}
\label{classWinRtmPipe_add05d15c39a7e6925cc975ccdc2321bc}

\item 
\hypertarget{classWinRtmPipe_a53d749e5de50f157a031625e02605986}{
uint16\_\-t {\bfseries \_\-seqno}}
\label{classWinRtmPipe_a53d749e5de50f157a031625e02605986}

\item 
\hypertarget{classWinRtmPipe_aa1f0d67a2eebb512c728b5fb3bc82c0e}{
uint16\_\-t {\bfseries \_\-instance\_\-no}}
\label{classWinRtmPipe_aa1f0d67a2eebb512c728b5fb3bc82c0e}

\end{DoxyCompactItemize}
\subsection*{Static Private Attributes}
\begin{DoxyCompactItemize}
\item 
\hypertarget{classWinRtmPipe_ac75fb08aab100ca878b682fa8fe126b0}{
static const size\_\-t {\bfseries ROUTING\_\-SOCKET\_\-BYTES} = 8$\ast$1024}
\label{classWinRtmPipe_ac75fb08aab100ca878b682fa8fe126b0}

\item 
\hypertarget{classWinRtmPipe_ae1b48432f7a5fd2c1baeb1e257d8e9c2}{
static uint16\_\-t {\bfseries \_\-instance\_\-cnt} = 0}
\label{classWinRtmPipe_ae1b48432f7a5fd2c1baeb1e257d8e9c2}

\item 
\hypertarget{classWinRtmPipe_a404ae9b02faca05dcbcb57c1de9d2423}{
static pid\_\-t {\bfseries \_\-pid} = getpid()}
\label{classWinRtmPipe_a404ae9b02faca05dcbcb57c1de9d2423}

\end{DoxyCompactItemize}
\subsection*{Friends}
\begin{DoxyCompactItemize}
\item 
\hypertarget{classWinRtmPipe_a6fa96c9ed51e02c8e780a0584e3d2546}{
class \hyperlink{classWinRtmPipe_a6fa96c9ed51e02c8e780a0584e3d2546}{WinRtmPipePlumber}}
\label{classWinRtmPipe_a6fa96c9ed51e02c8e780a0584e3d2546}

\end{DoxyCompactItemize}


\subsection{Detailed Description}
\hyperlink{classWinRtmPipe}{WinRtmPipe} class opens a routing socket and forwards data arriving on \hyperlink{protocolthe-p}{the} socket to WinRtmPipeObservers. The \hyperlink{classWinRtmPipe}{WinRtmPipe} hooks itself into \hyperlink{protocolthe-p}{the} \hyperlink{classEventLoop}{EventLoop} and activity usually happens asynchronously. 

\subsection{Member Function Documentation}
\hypertarget{classWinRtmPipe_a16e7a70135923eacdc1dc96bd39db85b}{
\index{WinRtmPipe@{WinRtmPipe}!force\_\-read@{force\_\-read}}
\index{force\_\-read@{force\_\-read}!WinRtmPipe@{WinRtmPipe}}
\subsubsection[{force\_\-read}]{\setlength{\rightskip}{0pt plus 5cm}int WinRtmPipe::force\_\-read (
\begin{DoxyParamCaption}
\item[{string \&}]{error\_\-msg}
\end{DoxyParamCaption}
)}}
\label{classWinRtmPipe_a16e7a70135923eacdc1dc96bd39db85b}


Force socket to read data. 

This usually is performed after writing a request that \hyperlink{protocolthe-p}{the} kernel will answer (e.g., after writing a route lookup). Use sparingly, with caution, and at your own risk.


\begin{DoxyParams}{Parameters}
{\em error\_\-msg} & \hyperlink{protocolthe-p}{the} error message (if error). \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
XORP\_\-OK on success, otherwise XORP\_\-ERROR. 
\end{DoxyReturn}
\hypertarget{classWinRtmPipe_abfdad088d0371a1b63ca98f626424265}{
\index{WinRtmPipe@{WinRtmPipe}!is\_\-open@{is\_\-open}}
\index{is\_\-open@{is\_\-open}!WinRtmPipe@{WinRtmPipe}}
\subsubsection[{is\_\-open}]{\setlength{\rightskip}{0pt plus 5cm}bool WinRtmPipe::is\_\-open (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
) const\hspace{0.3cm}{\ttfamily  \mbox{[}inline\mbox{]}}}}
\label{classWinRtmPipe_abfdad088d0371a1b63ca98f626424265}


Test if \hyperlink{protocolthe-p}{the} routing socket is open. 

This method is needed because \hyperlink{classWinRtmPipe}{WinRtmPipe} may fail to open routing socket during startup.

\begin{DoxyReturn}{Returns}
true if \hyperlink{protocolthe-p}{the} routing socket is open, otherwise false. 
\end{DoxyReturn}
\hypertarget{classWinRtmPipe_a86593f0ae62dc886dae5ecf61ea5c9c9}{
\index{WinRtmPipe@{WinRtmPipe}!pid@{pid}}
\index{pid@{pid}!WinRtmPipe@{WinRtmPipe}}
\subsubsection[{pid}]{\setlength{\rightskip}{0pt plus 5cm}pid\_\-t WinRtmPipe::pid (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
) const\hspace{0.3cm}{\ttfamily  \mbox{[}inline\mbox{]}}}}
\label{classWinRtmPipe_a86593f0ae62dc886dae5ecf61ea5c9c9}


Get \hyperlink{protocolthe-p}{the} cached process identifier value. 

\begin{DoxyReturn}{Returns}
\hyperlink{protocolthe-p}{the} cached process identifier value. 
\end{DoxyReturn}
\hypertarget{classWinRtmPipe_a2a43e926531acd53364323b995f15070}{
\index{WinRtmPipe@{WinRtmPipe}!seqno@{seqno}}
\index{seqno@{seqno}!WinRtmPipe@{WinRtmPipe}}
\subsubsection[{seqno}]{\setlength{\rightskip}{0pt plus 5cm}uint32\_\-t WinRtmPipe::seqno (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
) const\hspace{0.3cm}{\ttfamily  \mbox{[}inline\mbox{]}}}}
\label{classWinRtmPipe_a2a43e926531acd53364323b995f15070}


Get \hyperlink{protocolthe-p}{the} sequence number for next message written into \hyperlink{protocolthe-p}{the} kernel. 

The sequence number is derived from \hyperlink{protocolthe-p}{the} instance number of this routing socket and a 16-\/bit counter.

\begin{DoxyReturn}{Returns}
\hyperlink{protocolthe-p}{the} sequence number for \hyperlink{protocolthe-p}{the} next message written into \hyperlink{protocolthe-p}{the} kernel. 
\end{DoxyReturn}
\hypertarget{classWinRtmPipe_a660757cc5df9bc3b3f708cb3791017e6}{
\index{WinRtmPipe@{WinRtmPipe}!start@{start}}
\index{start@{start}!WinRtmPipe@{WinRtmPipe}}
\subsubsection[{start}]{\setlength{\rightskip}{0pt plus 5cm}int WinRtmPipe::start (
\begin{DoxyParamCaption}
\item[{int}]{af, }
\item[{string \&}]{error\_\-msg}
\end{DoxyParamCaption}
)}}
\label{classWinRtmPipe_a660757cc5df9bc3b3f708cb3791017e6}


Start \hyperlink{protocolthe-p}{the} routing socket operation for a given address family. 


\begin{DoxyParams}{Parameters}
{\em af} & \hyperlink{protocolthe-p}{the} address family. \\
\hline
{\em error\_\-msg} & \hyperlink{protocolthe-p}{the} error message (if error). \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
XORP\_\-OK on success, otherwise XORP\_\-ERROR. 
\end{DoxyReturn}
\hypertarget{classWinRtmPipe_acca091c0872bad939461b3d5d69cf633}{
\index{WinRtmPipe@{WinRtmPipe}!stop@{stop}}
\index{stop@{stop}!WinRtmPipe@{WinRtmPipe}}
\subsubsection[{stop}]{\setlength{\rightskip}{0pt plus 5cm}int WinRtmPipe::stop (
\begin{DoxyParamCaption}
\item[{string \&}]{error\_\-msg}
\end{DoxyParamCaption}
)}}
\label{classWinRtmPipe_acca091c0872bad939461b3d5d69cf633}


Stop \hyperlink{protocolthe-p}{the} routing socket operation. 


\begin{DoxyParams}{Parameters}
{\em error\_\-msg} & \hyperlink{protocolthe-p}{the} error message (if error). \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
XORP\_\-OK on success, otherwise XORP\_\-ERROR. 
\end{DoxyReturn}
\hypertarget{classWinRtmPipe_a630183384b2af3da4245380e13512a9e}{
\index{WinRtmPipe@{WinRtmPipe}!write@{write}}
\index{write@{write}!WinRtmPipe@{WinRtmPipe}}
\subsubsection[{write}]{\setlength{\rightskip}{0pt plus 5cm}ssize\_\-t WinRtmPipe::write (
\begin{DoxyParamCaption}
\item[{const void $\ast$}]{data, }
\item[{size\_\-t}]{nbytes}
\end{DoxyParamCaption}
)}}
\label{classWinRtmPipe_a630183384b2af3da4245380e13512a9e}


Write data to routing socket. 

This method also updates \hyperlink{protocolthe-p}{the} sequence number associated with this routing socket.

\begin{DoxyReturn}{Returns}
\hyperlink{protocolthe-p}{the} number of bytes which were written, or -\/1 if 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/data\_\-plane/control\_\-socket/windows\_\-rtm\_\-pipe.hh\item 
/home/greearb/git/xorp.ct.github/xorp/fea/data\_\-plane/control\_\-socket/windows\_\-rtm\_\-pipe.cc\end{DoxyCompactItemize}
