\hypertarget{LCBP_8h}{
\section{LCBP.h File Reference}
\label{LCBP_8h}\index{LCBP.h@{LCBP.h}}
}
LCB packet device interface. 

{\tt \#include \char`\"{}EDS/LCBV.h\char`\"{}}\par
{\tt \#include \char`\"{}EDS/io/EBF\_\-pkts.h\char`\"{}}\par


Include dependency graph for LCBP.h:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=401pt]{LCBP_8h__incl}
\end{center}
\end{figure}


This graph shows which files directly or indirectly include this file:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=107pt]{LCBP_8h__dep__incl}
\end{center}
\end{figure}
\subsection*{Typedefs}
\begin{CompactItemize}
\item 
\hypertarget{LCBP_8h_a0}{
typedef enum \hyperlink{LCBP_8h_a17}{\_\-LCBP\_\-EDS\_\-K} \hyperlink{LCBP_8h_a0}{LCBP\_\-EDS\_\-K}}
\label{LCBP_8h_a0}

\begin{CompactList}\small\item\em Typedef for enum \_\-LCBP\_\-EDS\_\-K. \item\end{CompactList}\end{CompactItemize}
\subsection*{Enumerations}
\begin{CompactItemize}
\item 
enum \hyperlink{LCBP_8h_a17}{\_\-LCBP\_\-EDS\_\-K} \{ \par
\hyperlink{LCBP_8h_a17a1}{LCBP\_\-EDS\_\-K\_\-NORMAL} =  0, 
\par
\hyperlink{LCBP_8h_a17a2}{LCBP\_\-EDS\_\-K\_\-TIMED} =  1
 \}
\begin{CompactList}\small\item\em Enumerates the event delivery style. \item\end{CompactList}\end{CompactItemize}
\subsection*{Functions}
\begin{CompactItemize}
\item 
\hyperlink{struct__LCBP}{LCBP} \hyperlink{LCBP_8h_a3}{LCBP\_\-get} ()
\begin{CompactList}\small\item\em Returns a pointer to the virtual LCB control block. \item\end{CompactList}\item 
unsigned int \hyperlink{LCBP_8h_a4}{LCBP\_\-create} (\hyperlink{struct__LCBP}{LCBP} lcb)
\begin{CompactList}\small\item\em Initializes the LCB virtual device control block. \item\end{CompactList}\item 
unsigned int \hyperlink{LCBP_8h_a5}{LCBP\_\-pkts\-Connect} (\hyperlink{struct__LCBP}{LCBP} lcb, \hyperlink{EBF__pkts_8h_a1}{EBF\_\-pkts} pkts)
\begin{CompactList}\small\item\em Connect a stream of packets to the virtual LCB. \item\end{CompactList}\item 
unsigned int \hyperlink{LCBP_8h_a6}{LCBP\_\-pkts\-Deliver} (\hyperlink{struct__LCBP}{LCBP} lcb)
\begin{CompactList}\small\item\em Feeds one packet at a time to the user provided callback routine. \item\end{CompactList}\item 
\hyperlink{EBF__pkts_8h_a1}{EBF\_\-pkts} \hyperlink{LCBP_8h_a7}{LCBP\_\-pkts\-Query} (\hyperlink{struct__LCBP}{LCBP} lcb)
\begin{CompactList}\small\item\em Returns the current EBF\_\-pkts. \item\end{CompactList}\item 
\hypertarget{LCBP_8h_a8}{
unsigned int {\bf LCBP\_\-pkt\-Cb\-Set} (\hyperlink{struct__LCBP}{LCBP} lcb, unsigned int proto, \hyperlink{LCBV_8h_a1}{LCBV\_\-pkt\-Cb} rtn, void $\ast$prm)}
\label{LCBP_8h_a8}

\item 
unsigned int \hyperlink{LCBP_8h_a9}{LCBP\_\-pkts\-Rng\-Free} (\hyperlink{struct__LCBP}{LCBP} lcb, \hyperlink{struct__EBF__pkt}{EBF\_\-pkt} $\ast$from, \hyperlink{struct__EBF__pkt}{EBF\_\-pkt} $\ast$to)
\begin{CompactList}\small\item\em Dummy implementation of the corresponds LCBD routine. \item\end{CompactList}\item 
\hypertarget{LCBP_8h_a10}{
unsigned int {\bf LCBP\_\-edm\_\-configure} (\hyperlink{struct__LCBP}{LCBP} lcb, \hyperlink{LCBP_8h_a0}{LCBP\_\-EDS\_\-K} style, void $\ast$prm)}
\label{LCBP_8h_a10}

\item 
unsigned int \hyperlink{LCBP_8h_a11}{LCBP\_\-edm\_\-reset} (\hyperlink{struct__LCBP}{LCBP} lcb)
\begin{CompactList}\small\item\em Resets the LCB handle, preparing it for a new set of data. This is generally called when switching to a new event stream. \item\end{CompactList}\item 
unsigned int \hyperlink{LCBP_8h_a12}{LCBP\_\-evt\_\-cb\_\-set} (\hyperlink{struct__LCBP}{LCBP} lcb, unsigned int proto, \hyperlink{LCBV_8h_a1}{LCBV\_\-pkt\-Cb} rtn, void $\ast$prm)
\begin{CompactList}\small\item\em Establishes a callback handler for the specified protocal. \item\end{CompactList}\item 
unsigned int \hyperlink{LCBP_8h_a13}{LCBP\_\-evt\_\-enable} (\hyperlink{struct__LCBP}{LCBP} lcb, int enable)
\begin{CompactList}\small\item\em Enables/Disables the flow of events. \item\end{CompactList}\item 
unsigned int \hyperlink{LCBP_8h_a14}{LCBP\_\-evt\_\-handler\_\-create} (\hyperlink{struct__LCBP}{LCBP} lcb, int priority)
\begin{CompactList}\small\item\em Creates the event que handler service task. \item\end{CompactList}\item 
unsigned int \hyperlink{LCBP_8h_a15}{LCBP\_\-evt\_\-que\_\-install} (\hyperlink{struct__LCBP}{LCBP} lcb, FORK\_\-que $\ast$que)
\begin{CompactList}\small\item\em Installs queue from {\em fcb\/} as the task message queue for event traffic. \item\end{CompactList}\item 
FORK\_\-que $\ast$ \hyperlink{LCBP_8h_a16}{LCBP\_\-evt\_\-que\_\-get} (\hyperlink{struct__LCBP}{LCBP} lcb, int que\_\-id)
\begin{CompactList}\small\item\em Installs queue from {\em fcb\/} as the task message queue for event traffic. \item\end{CompactList}\end{CompactItemize}


\subsection{Detailed Description}
LCB packet device interface. 

\begin{Desc}
\item[Author:]JJRussell - \href{mailto:russell@slac.stanford.edu}{\tt russell@slac.stanford.edu}\end{Desc}


\footnotesize\begin{verbatim}   CVS $Id: LCBP.h,v 1.4 2007/02/14 01:01:53 russell Exp $
\end{verbatim}
\normalsize


\begin{Desc}
\item[]This is a realization of an LCB like device, satisfying the abstract interface defined in \hyperlink{LCBV_8h}{LCBV.h}\end{Desc}


\subsection{Enumeration Type Documentation}
\hypertarget{LCBP_8h_a17}{
\index{LCBP.h@{LCBP.h}!_LCBP_EDS_K@{\_\-LCBP\_\-EDS\_\-K}}
\index{_LCBP_EDS_K@{\_\-LCBP\_\-EDS\_\-K}!LCBP.h@{LCBP.h}}
\subsubsection[\_\-LCBP\_\-EDS\_\-K]{\setlength{\rightskip}{0pt plus 5cm}enum \hyperlink{LCBP_8h_a17}{\_\-LCBP\_\-EDS\_\-K}}}
\label{LCBP_8h_a17}


Enumerates the event delivery style. 

\begin{Desc}
\item[Enumerator: ]\par
\begin{description}
\index{LCBP_EDS_K_NORMAL@{LCBP\_\-EDS\_\-K\_\-NORMAL}!LCBP.h@{LCBP.h}}\index{LCBP.h@{LCBP.h}!LCBP_EDS_K_NORMAL@{LCBP\_\-EDS\_\-K\_\-NORMAL}}\item[{\em 
\hypertarget{LCBP_8h_a17a1}{
LCBP\_\-EDS\_\-K\_\-NORMAL}
\label{LCBP_8h_a17a1}
}]Normal event delivery \index{LCBP_EDS_K_TIMED@{LCBP\_\-EDS\_\-K\_\-TIMED}!LCBP.h@{LCBP.h}}\index{LCBP.h@{LCBP.h}!LCBP_EDS_K_TIMED@{LCBP\_\-EDS\_\-K\_\-TIMED}}\item[{\em 
\hypertarget{LCBP_8h_a17a2}{
LCBP\_\-EDS\_\-K\_\-TIMED}
\label{LCBP_8h_a17a2}
}]Timed event delivery \end{description}
\end{Desc}



\subsection{Function Documentation}
\hypertarget{LCBP_8h_a4}{
\index{LCBP.h@{LCBP.h}!LCBP_create@{LCBP\_\-create}}
\index{LCBP_create@{LCBP\_\-create}!LCBP.h@{LCBP.h}}
\subsubsection[LCBP\_\-create]{\setlength{\rightskip}{0pt plus 5cm}unsigned int LCBP\_\-create (\hyperlink{struct__LCBP}{LCBP} {\em lcb})}}
\label{LCBP_8h_a4}


Initializes the LCB virtual device control block. 

\begin{Desc}
\item[Returns:]Status\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em lcb}]The virtual LCB device handle\end{description}
\end{Desc}
\hypertarget{LCBP_8h_a11}{
\index{LCBP.h@{LCBP.h}!LCBP_edm_reset@{LCBP\_\-edm\_\-reset}}
\index{LCBP_edm_reset@{LCBP\_\-edm\_\-reset}!LCBP.h@{LCBP.h}}
\subsubsection[LCBP\_\-edm\_\-reset]{\setlength{\rightskip}{0pt plus 5cm}unsigned int LCBP\_\-edm\_\-reset (\hyperlink{struct__LCBP}{LCBP} {\em lcb})}}
\label{LCBP_8h_a11}


Resets the LCB handle, preparing it for a new set of data. This is generally called when switching to a new event stream. 

\begin{Desc}
\item[Returns:]Status\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em lcb}]The LCB control/context handle\end{description}
\end{Desc}
\hypertarget{LCBP_8h_a12}{
\index{LCBP.h@{LCBP.h}!LCBP_evt_cb_set@{LCBP\_\-evt\_\-cb\_\-set}}
\index{LCBP_evt_cb_set@{LCBP\_\-evt\_\-cb\_\-set}!LCBP.h@{LCBP.h}}
\subsubsection[LCBP\_\-evt\_\-cb\_\-set]{\setlength{\rightskip}{0pt plus 5cm}int LCBP\_\-evt\_\-cb\_\-set (\hyperlink{struct__LCBP}{LCBP} {\em lcb}, unsigned int {\em proto}, \hyperlink{LCBV_8h_a1}{LCBV\_\-pkt\-Cb} {\em rtn}, void $\ast$ {\em prm})}}
\label{LCBP_8h_a12}


Establishes a callback handler for the specified protocal. 

\begin{Desc}
\item[Return values:]
\begin{description}
\item[{\em 0,Success}]\item[{\em -1,Protocal}]out-of-range\end{description}
\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em lcb}]The virtual LCB device handle \item[{\em proto}]The protocol number \item[{\em rtn}]The callback routine \item[{\em prm}]Parameter to the callback routine\end{description}
\end{Desc}
\hypertarget{LCBP_8h_a13}{
\index{LCBP.h@{LCBP.h}!LCBP_evt_enable@{LCBP\_\-evt\_\-enable}}
\index{LCBP_evt_enable@{LCBP\_\-evt\_\-enable}!LCBP.h@{LCBP.h}}
\subsubsection[LCBP\_\-evt\_\-enable]{\setlength{\rightskip}{0pt plus 5cm}int LCBP\_\-evt\_\-enable (\hyperlink{struct__LCBP}{LCBP} {\em lcb}, int {\em enable})}}
\label{LCBP_8h_a13}


Enables/Disables the flow of events. 

\begin{Desc}
\item[Return values:]
\begin{description}
\item[{\em 0,Event}]enable was not set before this call \item[{\em 1,Event}]enable was set before this call \item[{\em Anything}]else, an LCBP error\end{description}
\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em lcb}]The virtual LCB device handle \item[{\em enable}]Enable (1) / Disable (0) flag\end{description}
\end{Desc}
\hypertarget{LCBP_8h_a14}{
\index{LCBP.h@{LCBP.h}!LCBP_evt_handler_create@{LCBP\_\-evt\_\-handler\_\-create}}
\index{LCBP_evt_handler_create@{LCBP\_\-evt\_\-handler\_\-create}!LCBP.h@{LCBP.h}}
\subsubsection[LCBP\_\-evt\_\-handler\_\-create]{\setlength{\rightskip}{0pt plus 5cm}unsigned int LCBP\_\-evt\_\-handler\_\-create (\hyperlink{struct__LCBP}{LCBP} {\em lcb}, int {\em priority})}}
\label{LCBP_8h_a14}


Creates the event que handler service task. 

\begin{Desc}
\item[Returns:]Status\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em lcb}]The LCBP driver handle \item[{\em priority}]The priority of the task. If specified as -1, then a default value is assigned.\end{description}
\end{Desc}
\hypertarget{LCBP_8h_a16}{
\index{LCBP.h@{LCBP.h}!LCBP_evt_que_get@{LCBP\_\-evt\_\-que\_\-get}}
\index{LCBP_evt_que_get@{LCBP\_\-evt\_\-que\_\-get}!LCBP.h@{LCBP.h}}
\subsubsection[LCBP\_\-evt\_\-que\_\-get]{\setlength{\rightskip}{0pt plus 5cm}FORK\_\-que $\ast$ LCBP\_\-evt\_\-que\_\-get (\hyperlink{struct__LCBP}{LCBP} {\em lcb}, int {\em que\_\-id})}}
\label{LCBP_8h_a16}


Installs queue from {\em fcb\/} as the task message queue for event traffic. 

\begin{Desc}
\item[Return values:]
\begin{description}
\item[{\em Pointer}]to the fork que or NULL if non-existent\end{description}
\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em lcb}]Pointer to private LCBP structure \item[{\em que\_\-id}]The FORK que id\end{description}
\end{Desc}
\hypertarget{LCBP_8h_a15}{
\index{LCBP.h@{LCBP.h}!LCBP_evt_que_install@{LCBP\_\-evt\_\-que\_\-install}}
\index{LCBP_evt_que_install@{LCBP\_\-evt\_\-que\_\-install}!LCBP.h@{LCBP.h}}
\subsubsection[LCBP\_\-evt\_\-que\_\-install]{\setlength{\rightskip}{0pt plus 5cm}unsigned int LCBP\_\-evt\_\-que\_\-install (\hyperlink{struct__LCBP}{LCBP} {\em lcb}, FORK\_\-que $\ast$ {\em que})}}
\label{LCBP_8h_a15}


Installs queue from {\em fcb\/} as the task message queue for event traffic. 

\begin{Desc}
\item[Return values:]
\begin{description}
\item[{\em 0,currently}]there is no failure mode \end{description}
\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em lcb}]Pointer to private LCBP structure \item[{\em que}]The FORK que to use\end{description}
\end{Desc}
\hypertarget{LCBP_8h_a3}{
\index{LCBP.h@{LCBP.h}!LCBP_get@{LCBP\_\-get}}
\index{LCBP_get@{LCBP\_\-get}!LCBP.h@{LCBP.h}}
\subsubsection[LCBP\_\-get]{\setlength{\rightskip}{0pt plus 5cm}\hyperlink{struct__LCBP}{LCBP} LCBP\_\-get (void)}}
\label{LCBP_8h_a3}


Returns a pointer to the virtual LCB control block. 

\begin{Desc}
\item[Returns:]A pointer to the virtual LCB control block\end{Desc}
\hypertarget{LCBP_8h_a5}{
\index{LCBP.h@{LCBP.h}!LCBP_pktsConnect@{LCBP\_\-pktsConnect}}
\index{LCBP_pktsConnect@{LCBP\_\-pktsConnect}!LCBP.h@{LCBP.h}}
\subsubsection[LCBP\_\-pktsConnect]{\setlength{\rightskip}{0pt plus 5cm}unsigned int LCBP\_\-pkts\-Connect (\hyperlink{struct__LCBP}{LCBP} {\em lcb}, \hyperlink{EBF__pkts_8h_a1}{EBF\_\-pkts} {\em pkts})}}
\label{LCBP_8h_a5}


Connect a stream of packets to the virtual LCB. 

\begin{Desc}
\item[Returns:]Status\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em lcb}]The virtual LCB device handle \item[{\em pkts}]The vector of packets\end{description}
\end{Desc}
\hypertarget{LCBP_8h_a6}{
\index{LCBP.h@{LCBP.h}!LCBP_pktsDeliver@{LCBP\_\-pktsDeliver}}
\index{LCBP_pktsDeliver@{LCBP\_\-pktsDeliver}!LCBP.h@{LCBP.h}}
\subsubsection[LCBP\_\-pktsDeliver]{\setlength{\rightskip}{0pt plus 5cm}unsigned int LCBP\_\-pkts\-Deliver (\hyperlink{struct__LCBP}{LCBP} {\em lcb})}}
\label{LCBP_8h_a6}


Feeds one packet at a time to the user provided callback routine. 

\begin{Desc}
\item[Returns:]A bit mask of LCBP\_\-PKT\_\-FATE\_\-M from the terminating callback or LCBP\_\-PKT\_\-FATE\_\-M\_\-EOF;\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em lcb}]The virtual LCB device handle\end{description}
\end{Desc}
\begin{Desc}
\item[]The signature and return values are built to match that of the actual LCBP driver. Therefore, the user callback routine should work in both environments. The cavaet is that there obviously non-portable things one can do in the callback, like manipulating the contents of the vector of packets. The point is, that with this routine, at least the capability of writing a portable processing routine exists.\end{Desc}
\hypertarget{LCBP_8h_a7}{
\index{LCBP.h@{LCBP.h}!LCBP_pktsQuery@{LCBP\_\-pktsQuery}}
\index{LCBP_pktsQuery@{LCBP\_\-pktsQuery}!LCBP.h@{LCBP.h}}
\subsubsection[LCBP\_\-pktsQuery]{\setlength{\rightskip}{0pt plus 5cm}\hyperlink{EBF__pkts_8h_a1}{EBF\_\-pkts} LCBP\_\-pkts\-Query (\hyperlink{struct__LCBP}{LCBP} {\em lcb})}}
\label{LCBP_8h_a7}


Returns the current EBF\_\-pkts. 

\begin{Desc}
\item[Returns:]The current EBF\_\-pkts\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em lcb}]The virtual LCB device handle\end{description}
\end{Desc}
\hypertarget{LCBP_8h_a9}{
\index{LCBP.h@{LCBP.h}!LCBP_pktsRngFree@{LCBP\_\-pktsRngFree}}
\index{LCBP_pktsRngFree@{LCBP\_\-pktsRngFree}!LCBP.h@{LCBP.h}}
\subsubsection[LCBP\_\-pktsRngFree]{\setlength{\rightskip}{0pt plus 5cm}unsigned int LCBP\_\-pkts\-Rng\-Free (\hyperlink{struct__LCBP}{LCBP} {\em lcb}, \hyperlink{struct__EBF__pkt}{EBF\_\-pkt} $\ast$ {\em from}, \hyperlink{struct__EBF__pkt}{EBF\_\-pkt} $\ast$ {\em to})}}
\label{LCBP_8h_a9}


Dummy implementation of the corresponds LCBD routine. 

\begin{Desc}
\item[Returns:]Status\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em lcb}]The virtual LCB device handle \item[{\em from}]The address to start the free at. \item[{\em to}]The address of the last packet to free.\end{description}
\end{Desc}
