\doxysection{src/proto\+\_\+clnt.c File Reference}
\label{proto__clnt_8c}\index{src/proto\_clnt.c@{src/proto\_clnt.c}}


e1d protocol client library (libosmo-\/e1d).  


{\ttfamily \#include $<$errno.\+h$>$}\newline
{\ttfamily \#include $<$fcntl.\+h$>$}\newline
{\ttfamily \#include $<$unistd.\+h$>$}\newline
{\ttfamily \#include $<$sys/socket.\+h$>$}\newline
{\ttfamily \#include $<$sys/un.\+h$>$}\newline
{\ttfamily \#include $<$talloc.\+h$>$}\newline
{\ttfamily \#include $<$osmocom/core/linuxlist.\+h$>$}\newline
{\ttfamily \#include $<$osmocom/core/logging.\+h$>$}\newline
{\ttfamily \#include $<$osmocom/core/msgb.\+h$>$}\newline
{\ttfamily \#include $<$osmocom/core/select.\+h$>$}\newline
{\ttfamily \#include $<$osmocom/core/socket.\+h$>$}\newline
{\ttfamily \#include $<$osmocom/core/utils.\+h$>$}\newline
{\ttfamily \#include $<$osmocom/e1d/proto.\+h$>$}\newline
{\ttfamily \#include $<$osmocom/e1d/proto\+\_\+clnt.\+h$>$}\newline
{\ttfamily \#include \char`\"{}log.\+h\char`\"{}}\newline
\doxysubsection*{Data Structures}
\begin{DoxyCompactItemize}
\item 
struct \textbf{ osmo\+\_\+e1dp\+\_\+client}
\begin{DoxyCompactList}\small\item\em Internal representation of client program connected to the CTL socket. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsection*{Typedefs}
\begin{DoxyCompactItemize}
\item 
typedef void($\ast$ \textbf{ osmo\+\_\+e1dp\+\_\+event\+\_\+cb\+\_\+t}) (enum \textbf{ osmo\+\_\+e1dp\+\_\+msg\+\_\+type}, uint8\+\_\+t, uint8\+\_\+t, uint8\+\_\+t, uint8\+\_\+t $\ast$, int)
\end{DoxyCompactItemize}
\doxysubsection*{Functions}
\begin{DoxyCompactItemize}
\item 
struct \textbf{ osmo\+\_\+e1dp\+\_\+client} $\ast$ \textbf{ osmo\+\_\+e1dp\+\_\+client\+\_\+create} (void $\ast$ctx, const char $\ast$path)
\begin{DoxyCompactList}\small\item\em Create a new client talking to the CTL server socket of osmo-\/e1d. \end{DoxyCompactList}\item 
void \textbf{ osmo\+\_\+e1dp\+\_\+client\+\_\+destroy} (struct \textbf{ osmo\+\_\+e1dp\+\_\+client} $\ast$clnt)
\begin{DoxyCompactList}\small\item\em Destroy a previously created client. \end{DoxyCompactList}\item 
int \textbf{ osmo\+\_\+e1dp\+\_\+client\+\_\+intf\+\_\+query} (struct \textbf{ osmo\+\_\+e1dp\+\_\+client} $\ast$clnt, struct \textbf{ osmo\+\_\+e1dp\+\_\+intf\+\_\+info} $\ast$$\ast$ii, int $\ast$n, uint8\+\_\+t \textbf{ intf})
\begin{DoxyCompactList}\small\item\em Query osmo-\/e1d for information about a specific E1 interface. \end{DoxyCompactList}\item 
int \textbf{ osmo\+\_\+e1dp\+\_\+client\+\_\+line\+\_\+query} (struct \textbf{ osmo\+\_\+e1dp\+\_\+client} $\ast$clnt, struct \textbf{ osmo\+\_\+e1dp\+\_\+line\+\_\+info} $\ast$$\ast$li, int $\ast$n, uint8\+\_\+t \textbf{ intf}, uint8\+\_\+t \textbf{ line})
\begin{DoxyCompactList}\small\item\em Query osmo-\/e1d for information about a specific E1 line. \end{DoxyCompactList}\item 
int \textbf{ osmo\+\_\+e1dp\+\_\+client\+\_\+ts\+\_\+query} (struct \textbf{ osmo\+\_\+e1dp\+\_\+client} $\ast$clnt, struct \textbf{ osmo\+\_\+e1dp\+\_\+ts\+\_\+info} $\ast$$\ast$ti, int $\ast$n, uint8\+\_\+t \textbf{ intf}, uint8\+\_\+t \textbf{ line}, uint8\+\_\+t \textbf{ ts})
\begin{DoxyCompactList}\small\item\em Query osmo-\/e1d for information about a specific E1 timeslot. \end{DoxyCompactList}\item 
int \textbf{ osmo\+\_\+e1dp\+\_\+client\+\_\+line\+\_\+config} (struct \textbf{ osmo\+\_\+e1dp\+\_\+client} $\ast$clnt, uint8\+\_\+t \textbf{ intf}, uint8\+\_\+t \textbf{ line}, enum \textbf{ osmo\+\_\+e1dp\+\_\+line\+\_\+mode} \textbf{ mode})
\begin{DoxyCompactList}\small\item\em Configure a specific E1 line in osmo-\/e1d. \end{DoxyCompactList}\item 
int \textbf{ osmo\+\_\+e1dp\+\_\+client\+\_\+set\+\_\+sa\+\_\+bits} (struct \textbf{ osmo\+\_\+e1dp\+\_\+client} $\ast$clnt, uint8\+\_\+t \textbf{ intf}, uint8\+\_\+t \textbf{ line}, uint8\+\_\+t sa\+\_\+bits)
\begin{DoxyCompactList}\small\item\em Set Sa-\/bits of a specific E1 line in osmo-\/e1d. \end{DoxyCompactList}\item 
int \textbf{ osmo\+\_\+e1dp\+\_\+client\+\_\+set\+\_\+cas} (struct \textbf{ osmo\+\_\+e1dp\+\_\+client} $\ast$clnt, uint8\+\_\+t \textbf{ intf}, uint8\+\_\+t \textbf{ line}, uint8\+\_\+t \textbf{ ts}, struct \textbf{ osmo\+\_\+e1dp\+\_\+cas\+\_\+bits} $\ast$cas)
\begin{DoxyCompactList}\small\item\em Set CAS bits of a specific time-\/slot on E1 line in osmo-\/e1d. \end{DoxyCompactList}\item 
int \textbf{ osmo\+\_\+e1dp\+\_\+client\+\_\+ts\+\_\+open} (struct \textbf{ osmo\+\_\+e1dp\+\_\+client} $\ast$clnt, uint8\+\_\+t \textbf{ intf}, uint8\+\_\+t \textbf{ line}, uint8\+\_\+t \textbf{ ts}, enum \textbf{ osmo\+\_\+e1dp\+\_\+ts\+\_\+mode} \textbf{ mode}, uint16\+\_\+t \textbf{ read\+\_\+bufsize})
\begin{DoxyCompactList}\small\item\em Open a specific E1 timeslot of osmo-\/e1d. \end{DoxyCompactList}\item 
int \textbf{ osmo\+\_\+e1dp\+\_\+client\+\_\+ts\+\_\+open\+\_\+force} (struct \textbf{ osmo\+\_\+e1dp\+\_\+client} $\ast$clnt, uint8\+\_\+t \textbf{ intf}, uint8\+\_\+t \textbf{ line}, uint8\+\_\+t \textbf{ ts}, enum \textbf{ osmo\+\_\+e1dp\+\_\+ts\+\_\+mode} \textbf{ mode}, uint16\+\_\+t \textbf{ read\+\_\+bufsize})
\begin{DoxyCompactList}\small\item\em Force-\/\+Open a specific E1 timeslot of osmo-\/e1d. \end{DoxyCompactList}\item 
void \textbf{ osmo\+\_\+e1dp\+\_\+client\+\_\+event\+\_\+register} (struct \textbf{ osmo\+\_\+e1dp\+\_\+client} $\ast$clnt, void($\ast$cb)(enum \textbf{ osmo\+\_\+e1dp\+\_\+msg\+\_\+type} event, uint8\+\_\+t \textbf{ intf}, uint8\+\_\+t \textbf{ line}, uint8\+\_\+t \textbf{ ts}, uint8\+\_\+t $\ast$data, int \textbf{ len}))
\begin{DoxyCompactList}\small\item\em Register event handler for incoming event messages. \end{DoxyCompactList}\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}
e1d protocol client library (libosmo-\/e1d). 

This library implements ways how an external client (application program) can talk to osmo-\/e1d. The primary purpose is to open specific E1 timeslots in order to receive and/or transmit data on them.

Each such open timeslot is represented to the client program as a file descriptor, which the client can read and/or write as usual. This is implemented using underlying UNIX domain sockets and file descriptor passing.

In addition to opening timeslots, client applications can also query osmo-\/e1d for information about its E1 interfaces, E1 lines and E1 timeslots.

The functions provided by this client library are implemented as synchronous/blocking calls to osmo-\/e1d. This means that an API call will be blocking until there is a response received from osmo-\/e1d. 

\doxysubsection{Typedef Documentation}
\mbox{\label{proto__clnt_8c_a6e0e9c31b372efb19730464f2f724df3}} 
\index{proto\_clnt.c@{proto\_clnt.c}!osmo\_e1dp\_event\_cb\_t@{osmo\_e1dp\_event\_cb\_t}}
\index{osmo\_e1dp\_event\_cb\_t@{osmo\_e1dp\_event\_cb\_t}!proto\_clnt.c@{proto\_clnt.c}}
\doxysubsubsection{osmo\_e1dp\_event\_cb\_t}
{\footnotesize\ttfamily typedef void($\ast$ osmo\+\_\+e1dp\+\_\+event\+\_\+cb\+\_\+t) (enum \textbf{ osmo\+\_\+e1dp\+\_\+msg\+\_\+type}, uint8\+\_\+t, uint8\+\_\+t, uint8\+\_\+t, uint8\+\_\+t $\ast$, int)}



\doxysubsection{Function Documentation}
\mbox{\label{proto__clnt_8c_aca7ea641880a949626133827f677d1b3}} 
\index{proto\_clnt.c@{proto\_clnt.c}!osmo\_e1dp\_client\_create@{osmo\_e1dp\_client\_create}}
\index{osmo\_e1dp\_client\_create@{osmo\_e1dp\_client\_create}!proto\_clnt.c@{proto\_clnt.c}}
\doxysubsubsection{osmo\_e1dp\_client\_create()}
{\footnotesize\ttfamily struct \textbf{ osmo\+\_\+e1dp\+\_\+client} $\ast$ osmo\+\_\+e1dp\+\_\+client\+\_\+create (\begin{DoxyParamCaption}\item[{void $\ast$}]{ctx,  }\item[{const char $\ast$}]{path }\end{DoxyParamCaption})}



Create a new client talking to the CTL server socket of osmo-\/e1d. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em ctx} & talloc context from which this client is allocated \\
\hline
\mbox{\texttt{ in}}  & {\em path} & path of the CTL unix domain socket of osmo-\/e1d \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
handle to newly-\/created client; NULL in case of errors 
\end{DoxyReturn}


References \textbf{ osmo\+\_\+e1dp\+\_\+client\+::ctl\+\_\+fd}, and \textbf{ osmo\+\_\+e1dp\+\_\+client\+::ctx}.

\mbox{\label{proto__clnt_8c_a2678fdc5cc14faeff11e3d32008af73e}} 
\index{proto\_clnt.c@{proto\_clnt.c}!osmo\_e1dp\_client\_destroy@{osmo\_e1dp\_client\_destroy}}
\index{osmo\_e1dp\_client\_destroy@{osmo\_e1dp\_client\_destroy}!proto\_clnt.c@{proto\_clnt.c}}
\doxysubsubsection{osmo\_e1dp\_client\_destroy()}
{\footnotesize\ttfamily void osmo\+\_\+e1dp\+\_\+client\+\_\+destroy (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+e1dp\+\_\+client} $\ast$}]{clnt }\end{DoxyParamCaption})}



Destroy a previously created client. 

Closes socket and releases memory. 
\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em clnt} & Client previously returned from \doxyref{osmo\+\_\+e1dp\+\_\+client\+\_\+create()}{p.}{proto__clnt_8c_aca7ea641880a949626133827f677d1b3}. \\
\hline
\end{DoxyParams}


References \textbf{ osmo\+\_\+e1dp\+\_\+client\+::ctl\+\_\+fd}.

\mbox{\label{proto__clnt_8c_a8492d6fe4ece1b9fcaa70602402e474f}} 
\index{proto\_clnt.c@{proto\_clnt.c}!osmo\_e1dp\_client\_event\_register@{osmo\_e1dp\_client\_event\_register}}
\index{osmo\_e1dp\_client\_event\_register@{osmo\_e1dp\_client\_event\_register}!proto\_clnt.c@{proto\_clnt.c}}
\doxysubsubsection{osmo\_e1dp\_client\_event\_register()}
{\footnotesize\ttfamily void osmo\+\_\+e1dp\+\_\+client\+\_\+event\+\_\+register (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+e1dp\+\_\+client} $\ast$}]{clnt,  }\item[{void($\ast$)(enum \textbf{ osmo\+\_\+e1dp\+\_\+msg\+\_\+type} event, uint8\+\_\+t \textbf{ intf}, uint8\+\_\+t \textbf{ line}, uint8\+\_\+t \textbf{ ts}, uint8\+\_\+t $\ast$data, int \textbf{ len})}]{cb }\end{DoxyParamCaption})}



Register event handler for incoming event messages. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em clnt} & Client previously returned from \doxyref{osmo\+\_\+e1dp\+\_\+client\+\_\+create()}{p.}{proto__clnt_8c_aca7ea641880a949626133827f677d1b3}. \\
\hline
\end{DoxyParams}


References \textbf{ osmo\+\_\+e1dp\+\_\+client\+::event\+\_\+cb}.

\mbox{\label{proto__clnt_8c_a8d987f00efe9fb8c0e3f6efcb6d76907}} 
\index{proto\_clnt.c@{proto\_clnt.c}!osmo\_e1dp\_client\_intf\_query@{osmo\_e1dp\_client\_intf\_query}}
\index{osmo\_e1dp\_client\_intf\_query@{osmo\_e1dp\_client\_intf\_query}!proto\_clnt.c@{proto\_clnt.c}}
\doxysubsubsection{osmo\_e1dp\_client\_intf\_query()}
{\footnotesize\ttfamily int osmo\+\_\+e1dp\+\_\+client\+\_\+intf\+\_\+query (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+e1dp\+\_\+client} $\ast$}]{clnt,  }\item[{struct \textbf{ osmo\+\_\+e1dp\+\_\+intf\+\_\+info} $\ast$$\ast$}]{ii,  }\item[{int $\ast$}]{n,  }\item[{uint8\+\_\+t}]{intf }\end{DoxyParamCaption})}



Query osmo-\/e1d for information about a specific E1 interface. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em clnt} & Client previously returned from \doxyref{osmo\+\_\+e1dp\+\_\+client\+\_\+create()}{p.}{proto__clnt_8c_aca7ea641880a949626133827f677d1b3}. \\
\hline
\mbox{\texttt{ out}}  & {\em ii} & callee-\/allocated array of interface information structures. \\
\hline
\mbox{\texttt{ out}}  & {\em n} & caller-\/provided pointer to integer. Will contain number of entries in ii. \\
\hline
\mbox{\texttt{ in}}  & {\em intf} & E1 interface number to query, or E1\+DP\+\_\+\+INVALID to query all interfaces. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
zero in case of success; negative in case of error. 
\end{DoxyReturn}


References \textbf{ E1\+DP\+\_\+\+CMD\+\_\+\+INTF\+\_\+\+QUERY}, \textbf{ E1\+DP\+\_\+\+INVALID}, \textbf{ intf}, \textbf{ osmo\+\_\+e1dp\+\_\+msg\+\_\+hdr\+::intf}, \textbf{ osmo\+\_\+e1dp\+\_\+msg\+\_\+hdr\+::line}, \textbf{ osmo\+\_\+e1dp\+\_\+msg\+\_\+hdr\+::ts}, and \textbf{ osmo\+\_\+e1dp\+\_\+msg\+\_\+hdr\+::type}.

\mbox{\label{proto__clnt_8c_ae12e3ebfeff8823c9e34e18da15a5959}} 
\index{proto\_clnt.c@{proto\_clnt.c}!osmo\_e1dp\_client\_line\_config@{osmo\_e1dp\_client\_line\_config}}
\index{osmo\_e1dp\_client\_line\_config@{osmo\_e1dp\_client\_line\_config}!proto\_clnt.c@{proto\_clnt.c}}
\doxysubsubsection{osmo\_e1dp\_client\_line\_config()}
{\footnotesize\ttfamily int osmo\+\_\+e1dp\+\_\+client\+\_\+line\+\_\+config (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+e1dp\+\_\+client} $\ast$}]{clnt,  }\item[{uint8\+\_\+t}]{intf,  }\item[{uint8\+\_\+t}]{line,  }\item[{enum \textbf{ osmo\+\_\+e1dp\+\_\+line\+\_\+mode}}]{mode }\end{DoxyParamCaption})}



Configure a specific E1 line in osmo-\/e1d. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em clnt} & Client previously returned from \doxyref{osmo\+\_\+e1dp\+\_\+client\+\_\+create()}{p.}{proto__clnt_8c_aca7ea641880a949626133827f677d1b3}. \\
\hline
\mbox{\texttt{ in}}  & {\em intf} & E1 interface number to configure. \\
\hline
\mbox{\texttt{ in}}  & {\em line} & E1 line number (within interface) to configure. \\
\hline
\mbox{\texttt{ in}}  & {\em mode} & E1 line mode to set on line. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
zero in case of success; negative in case of error. 
\end{DoxyReturn}


References \textbf{ cfg}, \textbf{ E1\+DP\+\_\+\+CMD\+\_\+\+LINE\+\_\+\+CONFIG}, \textbf{ E1\+DP\+\_\+\+INVALID}, \textbf{ intf}, \textbf{ osmo\+\_\+e1dp\+\_\+msg\+\_\+hdr\+::intf}, \textbf{ line}, \textbf{ osmo\+\_\+e1dp\+\_\+msg\+\_\+hdr\+::line}, \textbf{ mode}, \textbf{ osmo\+\_\+e1dp\+\_\+line\+\_\+config\+::mode}, \textbf{ osmo\+\_\+e1dp\+\_\+msg\+\_\+hdr\+::ts}, and \textbf{ osmo\+\_\+e1dp\+\_\+msg\+\_\+hdr\+::type}.

\mbox{\label{proto__clnt_8c_a18dc639c152d9e765b134834b384569c}} 
\index{proto\_clnt.c@{proto\_clnt.c}!osmo\_e1dp\_client\_line\_query@{osmo\_e1dp\_client\_line\_query}}
\index{osmo\_e1dp\_client\_line\_query@{osmo\_e1dp\_client\_line\_query}!proto\_clnt.c@{proto\_clnt.c}}
\doxysubsubsection{osmo\_e1dp\_client\_line\_query()}
{\footnotesize\ttfamily int osmo\+\_\+e1dp\+\_\+client\+\_\+line\+\_\+query (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+e1dp\+\_\+client} $\ast$}]{clnt,  }\item[{struct \textbf{ osmo\+\_\+e1dp\+\_\+line\+\_\+info} $\ast$$\ast$}]{li,  }\item[{int $\ast$}]{n,  }\item[{uint8\+\_\+t}]{intf,  }\item[{uint8\+\_\+t}]{line }\end{DoxyParamCaption})}



Query osmo-\/e1d for information about a specific E1 line. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em clnt} & Client previously returned from \doxyref{osmo\+\_\+e1dp\+\_\+client\+\_\+create()}{p.}{proto__clnt_8c_aca7ea641880a949626133827f677d1b3}. \\
\hline
\mbox{\texttt{ out}}  & {\em li} & callee-\/allocated array of line information structures. \\
\hline
\mbox{\texttt{ out}}  & {\em n} & caller-\/provided pointer to integer. Will contain number of entries in li. \\
\hline
\mbox{\texttt{ in}}  & {\em intf} & E1 interface number to query. \\
\hline
\mbox{\texttt{ in}}  & {\em line} & E1 line number (within interface) to query, or E1\+DP\+\_\+\+INVALID to query all lines within the interface. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
zero in case of success; negative in case of error. 
\end{DoxyReturn}


References \textbf{ E1\+DP\+\_\+\+CMD\+\_\+\+LINE\+\_\+\+QUERY}, \textbf{ E1\+DP\+\_\+\+INVALID}, \textbf{ intf}, \textbf{ osmo\+\_\+e1dp\+\_\+msg\+\_\+hdr\+::intf}, \textbf{ line}, \textbf{ osmo\+\_\+e1dp\+\_\+msg\+\_\+hdr\+::line}, \textbf{ osmo\+\_\+e1dp\+\_\+msg\+\_\+hdr\+::ts}, and \textbf{ osmo\+\_\+e1dp\+\_\+msg\+\_\+hdr\+::type}.

\mbox{\label{proto__clnt_8c_a71b19d3e3ed4891b51ef520f2dbe1253}} 
\index{proto\_clnt.c@{proto\_clnt.c}!osmo\_e1dp\_client\_set\_cas@{osmo\_e1dp\_client\_set\_cas}}
\index{osmo\_e1dp\_client\_set\_cas@{osmo\_e1dp\_client\_set\_cas}!proto\_clnt.c@{proto\_clnt.c}}
\doxysubsubsection{osmo\_e1dp\_client\_set\_cas()}
{\footnotesize\ttfamily int osmo\+\_\+e1dp\+\_\+client\+\_\+set\+\_\+cas (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+e1dp\+\_\+client} $\ast$}]{clnt,  }\item[{uint8\+\_\+t}]{intf,  }\item[{uint8\+\_\+t}]{line,  }\item[{uint8\+\_\+t}]{ts,  }\item[{struct \textbf{ osmo\+\_\+e1dp\+\_\+cas\+\_\+bits} $\ast$}]{cas }\end{DoxyParamCaption})}



Set CAS bits of a specific time-\/slot on E1 line in osmo-\/e1d. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em clnt} & Client previously returned from \doxyref{osmo\+\_\+e1dp\+\_\+client\+\_\+create()}{p.}{proto__clnt_8c_aca7ea641880a949626133827f677d1b3}. \\
\hline
\mbox{\texttt{ in}}  & {\em intf} & E1 interface number to configure. \\
\hline
\mbox{\texttt{ in}}  & {\em line} & E1 line number (within interface) to configure. \\
\hline
\mbox{\texttt{ in}}  & {\em time-\/slot} & number (within line) to configure. \\
\hline
\mbox{\texttt{ in}}  & {\em CAS} & bits associated to this time-\/slot. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
zero in case of success; negative in case of error. 
\end{DoxyReturn}


References \textbf{ E1\+DP\+\_\+\+CMD\+\_\+\+CAS}, \textbf{ intf}, \textbf{ osmo\+\_\+e1dp\+\_\+msg\+\_\+hdr\+::intf}, \textbf{ line}, \textbf{ osmo\+\_\+e1dp\+\_\+msg\+\_\+hdr\+::line}, \textbf{ ts}, \textbf{ osmo\+\_\+e1dp\+\_\+msg\+\_\+hdr\+::ts}, and \textbf{ osmo\+\_\+e1dp\+\_\+msg\+\_\+hdr\+::type}.

\mbox{\label{proto__clnt_8c_ab32655ee53838577f14c883909d8f411}} 
\index{proto\_clnt.c@{proto\_clnt.c}!osmo\_e1dp\_client\_set\_sa\_bits@{osmo\_e1dp\_client\_set\_sa\_bits}}
\index{osmo\_e1dp\_client\_set\_sa\_bits@{osmo\_e1dp\_client\_set\_sa\_bits}!proto\_clnt.c@{proto\_clnt.c}}
\doxysubsubsection{osmo\_e1dp\_client\_set\_sa\_bits()}
{\footnotesize\ttfamily int osmo\+\_\+e1dp\+\_\+client\+\_\+set\+\_\+sa\+\_\+bits (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+e1dp\+\_\+client} $\ast$}]{clnt,  }\item[{uint8\+\_\+t}]{intf,  }\item[{uint8\+\_\+t}]{line,  }\item[{uint8\+\_\+t}]{sa\+\_\+bits }\end{DoxyParamCaption})}



Set Sa-\/bits of a specific E1 line in osmo-\/e1d. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em clnt} & Client previously returned from \doxyref{osmo\+\_\+e1dp\+\_\+client\+\_\+create()}{p.}{proto__clnt_8c_aca7ea641880a949626133827f677d1b3}. \\
\hline
\mbox{\texttt{ in}}  & {\em intf} & E1 interface number to configure. \\
\hline
\mbox{\texttt{ in}}  & {\em line} & E1 line number (within interface) to configure. \\
\hline
\mbox{\texttt{ in}}  & {\em sa\+\_\+bits} & Sa bits to set on line. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
zero in case of success; negative in case of error. 
\end{DoxyReturn}


References \textbf{ E1\+DP\+\_\+\+CMD\+\_\+\+SABITS}, \textbf{ E1\+DP\+\_\+\+INVALID}, \textbf{ intf}, \textbf{ osmo\+\_\+e1dp\+\_\+msg\+\_\+hdr\+::intf}, \textbf{ line}, \textbf{ osmo\+\_\+e1dp\+\_\+msg\+\_\+hdr\+::line}, \textbf{ osmo\+\_\+e1dp\+\_\+msg\+\_\+hdr\+::ts}, and \textbf{ osmo\+\_\+e1dp\+\_\+msg\+\_\+hdr\+::type}.

\mbox{\label{proto__clnt_8c_ad658f16939ee4063e9adea12e947cd01}} 
\index{proto\_clnt.c@{proto\_clnt.c}!osmo\_e1dp\_client\_ts\_open@{osmo\_e1dp\_client\_ts\_open}}
\index{osmo\_e1dp\_client\_ts\_open@{osmo\_e1dp\_client\_ts\_open}!proto\_clnt.c@{proto\_clnt.c}}
\doxysubsubsection{osmo\_e1dp\_client\_ts\_open()}
{\footnotesize\ttfamily int osmo\+\_\+e1dp\+\_\+client\+\_\+ts\+\_\+open (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+e1dp\+\_\+client} $\ast$}]{clnt,  }\item[{uint8\+\_\+t}]{intf,  }\item[{uint8\+\_\+t}]{line,  }\item[{uint8\+\_\+t}]{ts,  }\item[{enum \textbf{ osmo\+\_\+e1dp\+\_\+ts\+\_\+mode}}]{mode,  }\item[{uint16\+\_\+t}]{read\+\_\+bufsize }\end{DoxyParamCaption})}



Open a specific E1 timeslot of osmo-\/e1d. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em clnt} & Client previously returned from \doxyref{osmo\+\_\+e1dp\+\_\+client\+\_\+create()}{p.}{proto__clnt_8c_aca7ea641880a949626133827f677d1b3}. \\
\hline
\mbox{\texttt{ in}}  & {\em intf} & E1 interface number of line containing timeslot. \\
\hline
\mbox{\texttt{ in}}  & {\em line} & E1 line number (within interface) of line containing timeslot. \\
\hline
\mbox{\texttt{ in}}  & {\em ts} & E1 timeslot number (within line) to open. \\
\hline
\mbox{\texttt{ in}}  & {\em mode} & timeslot mode (RAW, HDLC-\/\+FCE) in which to open timeslot. \\
\hline
\mbox{\texttt{ in}}  & {\em read\+\_\+bufsize} & size of read buffer (in octets) to use. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
file descriptor of opened timeslot in case of success; negative in case of error. 
\end{DoxyReturn}
\mbox{\label{proto__clnt_8c_a6beaf831bc2080ad4c73f10c6257dcc0}} 
\index{proto\_clnt.c@{proto\_clnt.c}!osmo\_e1dp\_client\_ts\_open\_force@{osmo\_e1dp\_client\_ts\_open\_force}}
\index{osmo\_e1dp\_client\_ts\_open\_force@{osmo\_e1dp\_client\_ts\_open\_force}!proto\_clnt.c@{proto\_clnt.c}}
\doxysubsubsection{osmo\_e1dp\_client\_ts\_open\_force()}
{\footnotesize\ttfamily int osmo\+\_\+e1dp\+\_\+client\+\_\+ts\+\_\+open\+\_\+force (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+e1dp\+\_\+client} $\ast$}]{clnt,  }\item[{uint8\+\_\+t}]{intf,  }\item[{uint8\+\_\+t}]{line,  }\item[{uint8\+\_\+t}]{ts,  }\item[{enum \textbf{ osmo\+\_\+e1dp\+\_\+ts\+\_\+mode}}]{mode,  }\item[{uint16\+\_\+t}]{read\+\_\+bufsize }\end{DoxyParamCaption})}



Force-\/\+Open a specific E1 timeslot of osmo-\/e1d. 

The normal (non-\/force) opening of a timeslot will fail in case the given timeslot is already open (by either this or some other client). Using the open\+\_\+force variant you can force osmo-\/e1d to disregard the existing client/timeslot and transfer ownership of the timeslot to this client. 
\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em clnt} & Client previously returned from \doxyref{osmo\+\_\+e1dp\+\_\+client\+\_\+create()}{p.}{proto__clnt_8c_aca7ea641880a949626133827f677d1b3}. \\
\hline
\mbox{\texttt{ in}}  & {\em intf} & E1 interface number of line containing timeslot. \\
\hline
\mbox{\texttt{ in}}  & {\em line} & E1 line number (within interface) of line containing timeslot. \\
\hline
\mbox{\texttt{ in}}  & {\em ts} & E1 timeslot number (within line) to open. \\
\hline
\mbox{\texttt{ in}}  & {\em mode} & timeslot mode (RAW, HDLC-\/\+FCE) in which to open timeslot. \\
\hline
\mbox{\texttt{ in}}  & {\em read\+\_\+bufsize} & size of read buffer (in octets) to use. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
file descriptor of opened timeslot in case of success; negative in case of error. 
\end{DoxyReturn}
\mbox{\label{proto__clnt_8c_a3cd2906cda1a345c994d015c7d7c7217}} 
\index{proto\_clnt.c@{proto\_clnt.c}!osmo\_e1dp\_client\_ts\_query@{osmo\_e1dp\_client\_ts\_query}}
\index{osmo\_e1dp\_client\_ts\_query@{osmo\_e1dp\_client\_ts\_query}!proto\_clnt.c@{proto\_clnt.c}}
\doxysubsubsection{osmo\_e1dp\_client\_ts\_query()}
{\footnotesize\ttfamily int osmo\+\_\+e1dp\+\_\+client\+\_\+ts\+\_\+query (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+e1dp\+\_\+client} $\ast$}]{clnt,  }\item[{struct \textbf{ osmo\+\_\+e1dp\+\_\+ts\+\_\+info} $\ast$$\ast$}]{ti,  }\item[{int $\ast$}]{n,  }\item[{uint8\+\_\+t}]{intf,  }\item[{uint8\+\_\+t}]{line,  }\item[{uint8\+\_\+t}]{ts }\end{DoxyParamCaption})}



Query osmo-\/e1d for information about a specific E1 timeslot. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em clnt} & Client previously returned from \doxyref{osmo\+\_\+e1dp\+\_\+client\+\_\+create()}{p.}{proto__clnt_8c_aca7ea641880a949626133827f677d1b3}. \\
\hline
\mbox{\texttt{ out}}  & {\em ti} & callee-\/allocated array of timeslot information structures. \\
\hline
\mbox{\texttt{ out}}  & {\em n} & caller-\/provided pointer to integer. Will contain number of entries in ti. \\
\hline
\mbox{\texttt{ in}}  & {\em intf} & E1 interface number to query. \\
\hline
\mbox{\texttt{ in}}  & {\em line} & E1 line number (within interface) to query. \\
\hline
\mbox{\texttt{ in}}  & {\em ts} & E1 timeslot numer (within line) to query, or E1\+DP\+\_\+\+INVALID to query all of the timeslots within the line. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
zero in case of success; negative in case of error. 
\end{DoxyReturn}


References \textbf{ E1\+DP\+\_\+\+CMD\+\_\+\+TS\+\_\+\+QUERY}, \textbf{ intf}, \textbf{ osmo\+\_\+e1dp\+\_\+msg\+\_\+hdr\+::intf}, \textbf{ line}, \textbf{ osmo\+\_\+e1dp\+\_\+msg\+\_\+hdr\+::line}, \textbf{ ts}, \textbf{ osmo\+\_\+e1dp\+\_\+msg\+\_\+hdr\+::ts}, and \textbf{ osmo\+\_\+e1dp\+\_\+msg\+\_\+hdr\+::type}.

