\doxysection{src/trx\+\_\+ep.c File Reference}
\label{trx__ep_8c}\index{src/trx\_ep.c@{src/trx\_ep.c}}


TRX protocol socket endpoint management (clock/ctrl/data UDP sockets).  


{\ttfamily \#include $<$errno.\+h$>$}\newline
{\ttfamily \#include $<$stdio.\+h$>$}\newline
{\ttfamily \#include $<$string.\+h$>$}\newline
{\ttfamily \#include $<$stdarg.\+h$>$}\newline
{\ttfamily \#include $<$unistd.\+h$>$}\newline
{\ttfamily \#include $<$sys/socket.\+h$>$}\newline
{\ttfamily \#include $<$netinet/in.\+h$>$}\newline
{\ttfamily \#include $<$osmocom/core/talloc.\+h$>$}\newline
{\ttfamily \#include $<$osmocom/core/logging.\+h$>$}\newline
{\ttfamily \#include $<$osmocom/core/msgb.\+h$>$}\newline
{\ttfamily \#include $<$osmocom/core/osmo\+\_\+io.\+h$>$}\newline
{\ttfamily \#include $<$osmocom/core/socket.\+h$>$}\newline
{\ttfamily \#include $<$osmocom/core/utils.\+h$>$}\newline
{\ttfamily \#include $<$osmocom/trx/trxc.\+h$>$}\newline
{\ttfamily \#include $<$osmocom/trx/trxd.\+h$>$}\newline
{\ttfamily \#include $<$osmocom/trx/ep.\+h$>$}\newline
\doxysubsection*{Data Structures}
\begin{DoxyCompactItemize}
\item 
struct \textbf{ osmo\+\_\+trx\+\_\+ep\+\_\+chan}
\item 
struct \textbf{ osmo\+\_\+trx\+\_\+ep}
\end{DoxyCompactItemize}
\doxysubsection*{Macros}
\begin{DoxyCompactItemize}
\item 
\#define \textbf{ TRX\+\_\+\+EP\+\_\+\+L1\+\_\+\+PORT\+\_\+\+OFS}~100
\begin{DoxyCompactList}\small\item\em The L1 side uses a fixed base port offset (see trx\+\_\+toolkit) \end{DoxyCompactList}\item 
\#define \textbf{ TRX\+\_\+\+EP\+\_\+\+DATA\+\_\+\+BUF\+\_\+\+SIZE}~4096
\begin{DoxyCompactList}\small\item\em Maximum TRXD datagram size\+: 8 batched PDUs with the largest bursts. \end{DoxyCompactList}\item 
\#define \textbf{ OSMO\+\_\+\+TRX\+\_\+\+EP\+\_\+\+F\+\_\+\+OPEN}~(1 $<$$<$ 0)
\begin{DoxyCompactList}\small\item\em Sockets currently bound. \end{DoxyCompactList}\item 
\#define \textbf{ OSMO\+\_\+\+TRX\+\_\+\+EP\+\_\+\+F\+\_\+\+CLOCK\+\_\+\+SOCKET}~(1 $<$$<$ 1)
\begin{DoxyCompactList}\small\item\em Enable the clock socket (base\+\_\+port + 0) \end{DoxyCompactList}\item 
\#define \textbf{ OSMO\+\_\+\+TRX\+\_\+\+EP\+\_\+\+F\+\_\+\+PENDING\+\_\+\+FREE}~(1 $<$$<$ 2)
\begin{DoxyCompactList}\small\item\em \doxyref{osmo\+\_\+trx\+\_\+ep\+\_\+free()}{p.}{trx__ep_8c_afd3eb8dd5df6f258982203c4feeedb18} was called while a chan\textquotesingle{}s ctrl socket was still flushing\+: the actual free is deferred to \doxyref{trx\+\_\+ep\+\_\+ctrl\+\_\+close\+\_\+sendto\+\_\+cb()}{p.}{trx__ep_8c_a95a1b2d00959f07310a495e4823c8c94}, once the last one completes. \end{DoxyCompactList}\item 
\#define \textbf{ OSMO\+\_\+\+TRX\+\_\+\+EP\+\_\+\+F\+\_\+\+CTRL\+\_\+\+PROMISC}~(1 $<$$<$ 3)
\begin{DoxyCompactList}\small\item\em Leave the ctrl socket unconnected, accepting/replying to any peer. \end{DoxyCompactList}\item 
\#define \textbf{ OSMO\+\_\+\+TRX\+\_\+\+EP\+\_\+\+F\+\_\+\+NO\+\_\+\+PDU\+\_\+\+BATCH}~(1 $<$$<$ 4)
\begin{DoxyCompactList}\small\item\em Send one datagram per PDU instead of batching a TDMA frame\textquotesingle{}s worth of BURST.\+ind/req PDUs into one, even if TRXDv2+ is negotiated. \end{DoxyCompactList}\item 
\#define \textbf{ TRX\+\_\+\+EP\+\_\+\+DEFAULT\+\_\+\+BASE\+\_\+\+PORT}~5700
\begin{DoxyCompactList}\small\item\em Default base UDP port, see \doxyref{osmo\+\_\+trx\+\_\+ep\+\_\+set\+\_\+base\+\_\+port()}{p.}{trx__ep_8c_a8de9e23c68bf1285d626effe03687ecf} \end{DoxyCompactList}\item 
\#define \textbf{ LOGEP}(ep,  level,  fmt,  args...)
\item 
\#define \textbf{ LOGEPCH}(ep,  chan,  level,  fmt,  args...)
\end{DoxyCompactItemize}
\doxysubsection*{Functions}
\begin{DoxyCompactItemize}
\item 
\textbf{ \+\_\+\+\_\+attribute\+\_\+\+\_\+} ((weak))
\item 
static uint16\+\_\+t \textbf{ trx\+\_\+ep\+\_\+port} (const struct \textbf{ osmo\+\_\+trx\+\_\+ep} $\ast$ep, bool local, uint16\+\_\+t ofs)
\item 
static void \textbf{ trx\+\_\+ep\+\_\+clck\+\_\+read\+\_\+cb} (struct osmo\+\_\+io\+\_\+fd $\ast$iofd, int res, struct msgb $\ast$msg)
\item 
static void \textbf{ trx\+\_\+ep\+\_\+ctrl\+\_\+recvfrom\+\_\+cb} (struct osmo\+\_\+io\+\_\+fd $\ast$iofd, int res, struct msgb $\ast$msg, const struct osmo\+\_\+sockaddr $\ast$saddr)
\item 
static void \textbf{ trx\+\_\+ep\+\_\+data\+\_\+read\+\_\+cb} (struct osmo\+\_\+io\+\_\+fd $\ast$iofd, int res, struct msgb $\ast$msg)
\item 
static void \textbf{ trx\+\_\+ep\+\_\+write\+\_\+cb} (struct osmo\+\_\+io\+\_\+fd $\ast$iofd, int res, struct msgb $\ast$msg)
\item 
static void \textbf{ trx\+\_\+ep\+\_\+ctrl\+\_\+sendto\+\_\+cb} (struct osmo\+\_\+io\+\_\+fd $\ast$iofd, int res, struct msgb $\ast$msg, const struct osmo\+\_\+sockaddr $\ast$daddr)
\item 
static void \textbf{ trx\+\_\+ep\+\_\+ctrl\+\_\+close\+\_\+sendto\+\_\+cb} (struct osmo\+\_\+io\+\_\+fd $\ast$iofd, int res, struct msgb $\ast$msg, const struct osmo\+\_\+sockaddr $\ast$daddr)
\begin{DoxyCompactList}\small\item\em Write call-\/back for a channel\textquotesingle{}s ctrl\+\_\+iofd while it is being flushed asynchronously after \doxyref{osmo\+\_\+trx\+\_\+ep\+\_\+close()}{p.}{trx__ep_8c_a38607d3c25dfde685b0f779528455ef2}\+: a \textquotesingle{}goodbye\textquotesingle{} TRXC message (e.\+g. \end{DoxyCompactList}\item 
static void \textbf{ trx\+\_\+ep\+\_\+ctrl\+\_\+close} (struct \textbf{ osmo\+\_\+trx\+\_\+ep\+\_\+chan} $\ast$chan)
\item 
static struct osmo\+\_\+io\+\_\+fd $\ast$ \textbf{ trx\+\_\+ep\+\_\+open\+\_\+iofd} (struct \textbf{ osmo\+\_\+trx\+\_\+ep} $\ast$ep, uint16\+\_\+t ofs, const struct osmo\+\_\+io\+\_\+ops $\ast$ioops, enum osmo\+\_\+io\+\_\+fd\+\_\+mode mode, unsigned int buf\+\_\+size, void $\ast$data, bool connect\+\_\+socket)
\item 
static void \textbf{ trx\+\_\+ep\+\_\+chan\+\_\+init} (struct \textbf{ osmo\+\_\+trx\+\_\+ep\+\_\+chan} $\ast$chan, struct \textbf{ osmo\+\_\+trx\+\_\+ep} $\ast$ep, unsigned int num)
\item 
static int \textbf{ trx\+\_\+ep\+\_\+chan\+\_\+open} (struct \textbf{ osmo\+\_\+trx\+\_\+ep\+\_\+chan} $\ast$chan)
\item 
static void \textbf{ trx\+\_\+ep\+\_\+chan\+\_\+close} (struct \textbf{ osmo\+\_\+trx\+\_\+ep\+\_\+chan} $\ast$chan)
\item 
struct \textbf{ osmo\+\_\+trx\+\_\+ep} $\ast$ \textbf{ osmo\+\_\+trx\+\_\+ep\+\_\+alloc} (void $\ast$ctx, unsigned int num\+\_\+chans)
\begin{DoxyCompactList}\small\item\em Allocate a TRX endpoint instance. \end{DoxyCompactList}\item 
int \textbf{ osmo\+\_\+trx\+\_\+ep\+\_\+open} (struct \textbf{ osmo\+\_\+trx\+\_\+ep} $\ast$ep)
\begin{DoxyCompactList}\small\item\em Open the clock/ctrl/data sockets of the given endpoint. \end{DoxyCompactList}\item 
void \textbf{ osmo\+\_\+trx\+\_\+ep\+\_\+close} (struct \textbf{ osmo\+\_\+trx\+\_\+ep} $\ast$ep)
\begin{DoxyCompactList}\small\item\em Close all sockets of the given endpoint. \end{DoxyCompactList}\item 
void \textbf{ osmo\+\_\+trx\+\_\+ep\+\_\+free} (struct \textbf{ osmo\+\_\+trx\+\_\+ep} $\ast$ep)
\begin{DoxyCompactList}\small\item\em Free the given endpoint instance (closes all sockets). \end{DoxyCompactList}\item 
bool \textbf{ osmo\+\_\+trx\+\_\+ep\+\_\+is\+\_\+open} (const struct \textbf{ osmo\+\_\+trx\+\_\+ep} $\ast$ep)
\begin{DoxyCompactList}\small\item\em Whether the endpoint\textquotesingle{}s sockets are currently open. \end{DoxyCompactList}\item 
bool \textbf{ osmo\+\_\+trx\+\_\+ep\+\_\+is\+\_\+closing} (const struct \textbf{ osmo\+\_\+trx\+\_\+ep} $\ast$ep)
\begin{DoxyCompactList}\small\item\em Whether a ctrl socket from a previous \doxyref{osmo\+\_\+trx\+\_\+ep\+\_\+close()}{p.}{trx__ep_8c_a38607d3c25dfde685b0f779528455ef2} is still flushing a queued TRXC message in the background (see \doxyref{trx\+\_\+ep\+\_\+ctrl\+\_\+close()}{p.}{trx__ep_8c_ac3a21ac397090bf281e267e251fdd840}). \end{DoxyCompactList}\item 
void \textbf{ osmo\+\_\+trx\+\_\+ep\+\_\+set\+\_\+closed\+\_\+cb} (struct \textbf{ osmo\+\_\+trx\+\_\+ep} $\ast$ep, \textbf{ osmo\+\_\+trx\+\_\+ep\+\_\+closed\+\_\+cb\+\_\+t} closed\+\_\+cb)
\begin{DoxyCompactList}\small\item\em Set the call-\/back invoked once \doxyref{osmo\+\_\+trx\+\_\+ep\+\_\+close()}{p.}{trx__ep_8c_a38607d3c25dfde685b0f779528455ef2} has fully completed\+: immediately if no ctrl chan needed flushing, or once the last async flush finishes (see \doxyref{osmo\+\_\+trx\+\_\+ep\+\_\+is\+\_\+closing()}{p.}{trx__ep_8c_a4dd846461e53e491fbddf829fefcb263}) otherwise. \end{DoxyCompactList}\item 
void \textbf{ osmo\+\_\+trx\+\_\+ep\+\_\+set\+\_\+priv} (struct \textbf{ osmo\+\_\+trx\+\_\+ep} $\ast$ep, void $\ast$priv)
\begin{DoxyCompactList}\small\item\em Set the application-\/private data. \end{DoxyCompactList}\item 
void $\ast$ \textbf{ osmo\+\_\+trx\+\_\+ep\+\_\+get\+\_\+priv} (const struct \textbf{ osmo\+\_\+trx\+\_\+ep} $\ast$ep)
\begin{DoxyCompactList}\small\item\em Obtain the application-\/private data. \end{DoxyCompactList}\item 
unsigned int \textbf{ osmo\+\_\+trx\+\_\+ep\+\_\+get\+\_\+num\+\_\+chans} (const struct \textbf{ osmo\+\_\+trx\+\_\+ep} $\ast$ep)
\begin{DoxyCompactList}\small\item\em Obtain the number of channels. \end{DoxyCompactList}\item 
int \textbf{ osmo\+\_\+trx\+\_\+ep\+\_\+set\+\_\+num\+\_\+chans} (struct \textbf{ osmo\+\_\+trx\+\_\+ep} $\ast$ep, unsigned int num\+\_\+chans)
\begin{DoxyCompactList}\small\item\em Change the number of channels; only valid before \doxyref{osmo\+\_\+trx\+\_\+ep\+\_\+open()}{p.}{trx__ep_8c_a11e2dbc3d472ed74e5bc0d52aeea9663}. \end{DoxyCompactList}\item 
int \textbf{ osmo\+\_\+trx\+\_\+ep\+\_\+set\+\_\+mode} (struct \textbf{ osmo\+\_\+trx\+\_\+ep} $\ast$ep, enum \textbf{ osmo\+\_\+trx\+\_\+ep\+\_\+mode} mode)
\begin{DoxyCompactList}\small\item\em Set the endpoint mode (default\+: OSMO\+\_\+\+TRX\+\_\+\+EP\+\_\+\+MODE\+\_\+\+L1) \end{DoxyCompactList}\item 
enum \textbf{ osmo\+\_\+trx\+\_\+ep\+\_\+mode} \textbf{ osmo\+\_\+trx\+\_\+ep\+\_\+get\+\_\+mode} (const struct \textbf{ osmo\+\_\+trx\+\_\+ep} $\ast$ep)
\begin{DoxyCompactList}\small\item\em Obtain the endpoint mode. \end{DoxyCompactList}\item 
int \textbf{ osmo\+\_\+trx\+\_\+ep\+\_\+set\+\_\+laddr} (struct \textbf{ osmo\+\_\+trx\+\_\+ep} $\ast$ep, const char $\ast$addr)
\begin{DoxyCompactList}\small\item\em Set the local IP address (copied) \end{DoxyCompactList}\item 
const char $\ast$ \textbf{ osmo\+\_\+trx\+\_\+ep\+\_\+get\+\_\+laddr} (const struct \textbf{ osmo\+\_\+trx\+\_\+ep} $\ast$ep)
\begin{DoxyCompactList}\small\item\em Obtain the local IP address. \end{DoxyCompactList}\item 
int \textbf{ osmo\+\_\+trx\+\_\+ep\+\_\+set\+\_\+raddr} (struct \textbf{ osmo\+\_\+trx\+\_\+ep} $\ast$ep, const char $\ast$addr)
\begin{DoxyCompactList}\small\item\em Set the remote IP address (copied) \end{DoxyCompactList}\item 
const char $\ast$ \textbf{ osmo\+\_\+trx\+\_\+ep\+\_\+get\+\_\+raddr} (const struct \textbf{ osmo\+\_\+trx\+\_\+ep} $\ast$ep)
\begin{DoxyCompactList}\small\item\em Obtain the remote IP address. \end{DoxyCompactList}\item 
int \textbf{ osmo\+\_\+trx\+\_\+ep\+\_\+set\+\_\+base\+\_\+port} (struct \textbf{ osmo\+\_\+trx\+\_\+ep} $\ast$ep, uint16\+\_\+t base\+\_\+port)
\begin{DoxyCompactList}\small\item\em Set the base UDP port (default\+: 5700), see \doxyref{ep.\+h}{p.}{ep_8h} for the port layout. \end{DoxyCompactList}\item 
uint16\+\_\+t \textbf{ osmo\+\_\+trx\+\_\+ep\+\_\+get\+\_\+base\+\_\+port} (const struct \textbf{ osmo\+\_\+trx\+\_\+ep} $\ast$ep)
\begin{DoxyCompactList}\small\item\em Obtain the base UDP port. \end{DoxyCompactList}\item 
int \textbf{ osmo\+\_\+trx\+\_\+ep\+\_\+set\+\_\+clock\+\_\+socket} (struct \textbf{ osmo\+\_\+trx\+\_\+ep} $\ast$ep, bool enable)
\begin{DoxyCompactList}\small\item\em Enable/disable the clock socket (default\+: false) \end{DoxyCompactList}\item 
bool \textbf{ osmo\+\_\+trx\+\_\+ep\+\_\+get\+\_\+clock\+\_\+socket} (const struct \textbf{ osmo\+\_\+trx\+\_\+ep} $\ast$ep)
\begin{DoxyCompactList}\small\item\em Whether the clock socket is enabled. \end{DoxyCompactList}\item 
int \textbf{ osmo\+\_\+trx\+\_\+ep\+\_\+set\+\_\+ctrl\+\_\+promisc} (struct \textbf{ osmo\+\_\+trx\+\_\+ep} $\ast$ep, bool enable)
\begin{DoxyCompactList}\small\item\em Enable/disable promiscuous ctrl socket mode (default\+: false)\+: leaves the ctrl socket unconnected, accepting TRXC PDUs from any peer instead of only the configured one, e.\+g. \end{DoxyCompactList}\item 
bool \textbf{ osmo\+\_\+trx\+\_\+ep\+\_\+get\+\_\+ctrl\+\_\+promisc} (const struct \textbf{ osmo\+\_\+trx\+\_\+ep} $\ast$ep)
\begin{DoxyCompactList}\small\item\em Whether promiscuous ctrl socket mode is enabled. \end{DoxyCompactList}\item 
void \textbf{ osmo\+\_\+trx\+\_\+ep\+\_\+set\+\_\+pdu\+\_\+batch} (struct \textbf{ osmo\+\_\+trx\+\_\+ep} $\ast$ep, bool enable)
\begin{DoxyCompactList}\small\item\em Enable/disable batching BURST.\+ind/req PDUs on the data sockets (default\+: true)\+: when enabled and TRXDv2 (or higher) is negotiated on a channel, a TDMA frame\textquotesingle{}s worth of PDUs is accumulated and sent in a single datagram (see \doxyref{osmo\+\_\+trx\+\_\+ep\+\_\+send\+\_\+burst\+\_\+ind()}{p.}{trx__ep_8c_a680a6a5e9c36ec796583776da9f15166}/\+\_\+req()); when disabled, every PDU is sent in its own datagram regardless of the negotiated TRXD PDU version, trading datagram count for latency. \end{DoxyCompactList}\item 
bool \textbf{ osmo\+\_\+trx\+\_\+ep\+\_\+get\+\_\+pdu\+\_\+batch} (const struct \textbf{ osmo\+\_\+trx\+\_\+ep} $\ast$ep)
\begin{DoxyCompactList}\small\item\em Whether batching BURST.\+ind/req PDUs on the data sockets is enabled. \end{DoxyCompactList}\item 
int \textbf{ osmo\+\_\+trx\+\_\+ep\+\_\+set\+\_\+name} (struct \textbf{ osmo\+\_\+trx\+\_\+ep} $\ast$ep, const char $\ast$fmt,...)
\begin{DoxyCompactList}\small\item\em Set the name (log prefix) of the given instance, e.\+g. \end{DoxyCompactList}\item 
const char $\ast$ \textbf{ osmo\+\_\+trx\+\_\+ep\+\_\+get\+\_\+name} (const struct \textbf{ osmo\+\_\+trx\+\_\+ep} $\ast$ep)
\begin{DoxyCompactList}\small\item\em Obtain the name (log prefix) of the given instance. \end{DoxyCompactList}\item 
void \textbf{ osmo\+\_\+trx\+\_\+ep\+\_\+set\+\_\+log\+\_\+cat} (struct \textbf{ osmo\+\_\+trx\+\_\+ep} $\ast$ep, int log\+\_\+cat)
\begin{DoxyCompactList}\small\item\em Set the logging category (e.\+g. \end{DoxyCompactList}\item 
int \textbf{ osmo\+\_\+trx\+\_\+ep\+\_\+set\+\_\+pdu\+\_\+ver} (struct \textbf{ osmo\+\_\+trx\+\_\+ep} $\ast$ep, unsigned int chan, uint8\+\_\+t ver)
\begin{DoxyCompactList}\small\item\em Set the TRXD PDU version in use for the given channel (default\+: 0), usually after the negotiation (see \doxyref{osmo\+\_\+trxc\+\_\+client\+\_\+negotiate\+\_\+format()}{p.}{trxc__client_8h_ab31f5fca2e000ebac042384251349e24}) \end{DoxyCompactList}\item 
int \textbf{ osmo\+\_\+trx\+\_\+ep\+\_\+get\+\_\+pdu\+\_\+ver} (const struct \textbf{ osmo\+\_\+trx\+\_\+ep} $\ast$ep, unsigned int chan)
\begin{DoxyCompactList}\small\item\em Get the TRXD PDU version in use for the given channel. \end{DoxyCompactList}\item 
int \textbf{ osmo\+\_\+trx\+\_\+ep\+\_\+send\+\_\+clck\+\_\+ind} (struct \textbf{ osmo\+\_\+trx\+\_\+ep} $\ast$ep, uint32\+\_\+t fn)
\begin{DoxyCompactList}\small\item\em Send a clock indication (\char`\"{}\+IND CLOCK $<$fn$>$\char`\"{}) on the clock socket. \end{DoxyCompactList}\item 
int \textbf{ osmo\+\_\+trx\+\_\+ep\+\_\+send\+\_\+ctrl\+\_\+msg} (struct \textbf{ osmo\+\_\+trx\+\_\+ep} $\ast$ep, unsigned int chan, const struct \textbf{ osmo\+\_\+trxc\+\_\+msg} $\ast$tmsg)
\begin{DoxyCompactList}\small\item\em Send a TRXC message on the ctrl socket of the given channel. \end{DoxyCompactList}\item 
static int \textbf{ trx\+\_\+ep\+\_\+data\+\_\+tx\+\_\+flush} (struct \textbf{ osmo\+\_\+trx\+\_\+ep\+\_\+chan} $\ast$c)
\begin{DoxyCompactList}\small\item\em Flush a channel\textquotesingle{}s pending Tx batching buffer\+: write the accumulated msgb to the data socket and clear c-\/$>$tx\+\_\+msg. \end{DoxyCompactList}\item 
int \textbf{ osmo\+\_\+trx\+\_\+ep\+\_\+send\+\_\+burst\+\_\+ind} (struct \textbf{ osmo\+\_\+trx\+\_\+ep} $\ast$ep, unsigned int chan, const struct \textbf{ osmo\+\_\+trxd\+\_\+burst\+\_\+ind} $\ast$bi)
\begin{DoxyCompactList}\small\item\em Send a burst indication on the data socket of the given channel (OSMO\+\_\+\+TRX\+\_\+\+EP\+\_\+\+MODE\+\_\+\+TRX only). \end{DoxyCompactList}\item 
int \textbf{ osmo\+\_\+trx\+\_\+ep\+\_\+send\+\_\+burst\+\_\+req} (struct \textbf{ osmo\+\_\+trx\+\_\+ep} $\ast$ep, unsigned int chan, const struct \textbf{ osmo\+\_\+trxd\+\_\+burst\+\_\+req} $\ast$br)
\begin{DoxyCompactList}\small\item\em Send a burst transmit request on the data socket of the given channel (OSMO\+\_\+\+TRX\+\_\+\+EP\+\_\+\+MODE\+\_\+\+L1 only). \end{DoxyCompactList}\item 
int \textbf{ osmo\+\_\+trx\+\_\+ep\+\_\+send\+\_\+burst\+\_\+fin} (struct \textbf{ osmo\+\_\+trx\+\_\+ep} $\ast$ep, unsigned int chan)
\begin{DoxyCompactList}\small\item\em Flush the TRXDv2 batching buffer accumulated by \doxyref{osmo\+\_\+trx\+\_\+ep\+\_\+send\+\_\+burst\+\_\+ind()}{p.}{trx__ep_8c_a680a6a5e9c36ec796583776da9f15166} or \doxyref{osmo\+\_\+trx\+\_\+ep\+\_\+send\+\_\+burst\+\_\+req()}{p.}{trx__ep_8c_a68b09a204949f4337550a57cdf25cc62} (whichever applies to this endpoint\textquotesingle{}s mode), transmitting it in a single datagram; no-\/op (returns -\/ENOMSG) if nothing was accumulated, and for TRXDv0/v1 (each PDU is already sent immediately by \doxyref{osmo\+\_\+trx\+\_\+ep\+\_\+send\+\_\+burst\+\_\+ind()}{p.}{trx__ep_8c_a680a6a5e9c36ec796583776da9f15166}/\+\_\+req()). \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsection*{Variables}
\begin{DoxyCompactItemize}
\item 
static const struct osmo\+\_\+io\+\_\+ops \textbf{ trx\+\_\+ep\+\_\+ctrl\+\_\+close\+\_\+ioops}
\item 
static const struct osmo\+\_\+io\+\_\+ops \textbf{ trx\+\_\+ep\+\_\+clck\+\_\+ioops}
\item 
static const struct osmo\+\_\+io\+\_\+ops \textbf{ trx\+\_\+ep\+\_\+ctrl\+\_\+ioops}
\item 
static const struct osmo\+\_\+io\+\_\+ops \textbf{ trx\+\_\+ep\+\_\+data\+\_\+ioops}
\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}
TRX protocol socket endpoint management (clock/ctrl/data UDP sockets). 

Based on the socket handling in osmo-\/bts-\/trx (trx\+\_\+if.\+c) and the port numbering convention of trx\+\_\+toolkit (transceiver.\+py). 

\doxysubsection{Macro Definition Documentation}
\mbox{\label{trx__ep_8c_ada659cdd4c21f78927ddac870af8468f}} 
\index{trx\_ep.c@{trx\_ep.c}!LOGEP@{LOGEP}}
\index{LOGEP@{LOGEP}!trx\_ep.c@{trx\_ep.c}}
\doxysubsubsection{LOGEP}
{\footnotesize\ttfamily \#define LOGEP(\begin{DoxyParamCaption}\item[{}]{ep,  }\item[{}]{level,  }\item[{}]{fmt,  }\item[{}]{args... }\end{DoxyParamCaption})}

{\bfseries Value\+:}
\begin{DoxyCode}{0}
\DoxyCodeLine{        LOGP((ep) ? (ep)-\/>log\_cat : DLGLOBAL, level, \textcolor{stringliteral}{"{}(ep=\%s) "{}} fmt, \(\backslash\)}
\DoxyCodeLine{             (ep) ? (ep)-\/>name : \textcolor{stringliteral}{"{}NULL"{}}, \#\# args)}

\end{DoxyCode}
\mbox{\label{trx__ep_8c_aaef130d473305270196954e1e38b0a5a}} 
\index{trx\_ep.c@{trx\_ep.c}!LOGEPCH@{LOGEPCH}}
\index{LOGEPCH@{LOGEPCH}!trx\_ep.c@{trx\_ep.c}}
\doxysubsubsection{LOGEPCH}
{\footnotesize\ttfamily \#define LOGEPCH(\begin{DoxyParamCaption}\item[{}]{ep,  }\item[{}]{chan,  }\item[{}]{level,  }\item[{}]{fmt,  }\item[{}]{args... }\end{DoxyParamCaption})}

{\bfseries Value\+:}
\begin{DoxyCode}{0}
\DoxyCodeLine{        LOGP((ep) ? (ep)-\/>log\_cat : DLGLOBAL, level, \textcolor{stringliteral}{"{}(ep=\%s, chan=\%u) "{}} fmt, \(\backslash\)}
\DoxyCodeLine{             (ep) ? (ep)-\/>name : \textcolor{stringliteral}{"{}NULL"{}}, chan, \#\# args)}

\end{DoxyCode}
\mbox{\label{trx__ep_8c_ad7bd4a96d65cd1af339b0a769b9962a9}} 
\index{trx\_ep.c@{trx\_ep.c}!OSMO\_TRX\_EP\_F\_CLOCK\_SOCKET@{OSMO\_TRX\_EP\_F\_CLOCK\_SOCKET}}
\index{OSMO\_TRX\_EP\_F\_CLOCK\_SOCKET@{OSMO\_TRX\_EP\_F\_CLOCK\_SOCKET}!trx\_ep.c@{trx\_ep.c}}
\doxysubsubsection{OSMO\_TRX\_EP\_F\_CLOCK\_SOCKET}
{\footnotesize\ttfamily \#define OSMO\+\_\+\+TRX\+\_\+\+EP\+\_\+\+F\+\_\+\+CLOCK\+\_\+\+SOCKET~(1 $<$$<$ 1)}



Enable the clock socket (base\+\_\+port + 0) 

\mbox{\label{trx__ep_8c_a5a8a3ec604a84a51ae103186fdc37e4d}} 
\index{trx\_ep.c@{trx\_ep.c}!OSMO\_TRX\_EP\_F\_CTRL\_PROMISC@{OSMO\_TRX\_EP\_F\_CTRL\_PROMISC}}
\index{OSMO\_TRX\_EP\_F\_CTRL\_PROMISC@{OSMO\_TRX\_EP\_F\_CTRL\_PROMISC}!trx\_ep.c@{trx\_ep.c}}
\doxysubsubsection{OSMO\_TRX\_EP\_F\_CTRL\_PROMISC}
{\footnotesize\ttfamily \#define OSMO\+\_\+\+TRX\+\_\+\+EP\+\_\+\+F\+\_\+\+CTRL\+\_\+\+PROMISC~(1 $<$$<$ 3)}



Leave the ctrl socket unconnected, accepting/replying to any peer. 

\mbox{\label{trx__ep_8c_a386e51908096c8da5c023c7d66417c28}} 
\index{trx\_ep.c@{trx\_ep.c}!OSMO\_TRX\_EP\_F\_NO\_PDU\_BATCH@{OSMO\_TRX\_EP\_F\_NO\_PDU\_BATCH}}
\index{OSMO\_TRX\_EP\_F\_NO\_PDU\_BATCH@{OSMO\_TRX\_EP\_F\_NO\_PDU\_BATCH}!trx\_ep.c@{trx\_ep.c}}
\doxysubsubsection{OSMO\_TRX\_EP\_F\_NO\_PDU\_BATCH}
{\footnotesize\ttfamily \#define OSMO\+\_\+\+TRX\+\_\+\+EP\+\_\+\+F\+\_\+\+NO\+\_\+\+PDU\+\_\+\+BATCH~(1 $<$$<$ 4)}



Send one datagram per PDU instead of batching a TDMA frame\textquotesingle{}s worth of BURST.\+ind/req PDUs into one, even if TRXDv2+ is negotiated. 

\mbox{\label{trx__ep_8c_aff40a2c83fc70b5458bf77cee1074c3d}} 
\index{trx\_ep.c@{trx\_ep.c}!OSMO\_TRX\_EP\_F\_OPEN@{OSMO\_TRX\_EP\_F\_OPEN}}
\index{OSMO\_TRX\_EP\_F\_OPEN@{OSMO\_TRX\_EP\_F\_OPEN}!trx\_ep.c@{trx\_ep.c}}
\doxysubsubsection{OSMO\_TRX\_EP\_F\_OPEN}
{\footnotesize\ttfamily \#define OSMO\+\_\+\+TRX\+\_\+\+EP\+\_\+\+F\+\_\+\+OPEN~(1 $<$$<$ 0)}



Sockets currently bound. 

\mbox{\label{trx__ep_8c_a878fd015317539e74ece032a69aa7da2}} 
\index{trx\_ep.c@{trx\_ep.c}!OSMO\_TRX\_EP\_F\_PENDING\_FREE@{OSMO\_TRX\_EP\_F\_PENDING\_FREE}}
\index{OSMO\_TRX\_EP\_F\_PENDING\_FREE@{OSMO\_TRX\_EP\_F\_PENDING\_FREE}!trx\_ep.c@{trx\_ep.c}}
\doxysubsubsection{OSMO\_TRX\_EP\_F\_PENDING\_FREE}
{\footnotesize\ttfamily \#define OSMO\+\_\+\+TRX\+\_\+\+EP\+\_\+\+F\+\_\+\+PENDING\+\_\+\+FREE~(1 $<$$<$ 2)}



\doxyref{osmo\+\_\+trx\+\_\+ep\+\_\+free()}{p.}{trx__ep_8c_afd3eb8dd5df6f258982203c4feeedb18} was called while a chan\textquotesingle{}s ctrl socket was still flushing\+: the actual free is deferred to \doxyref{trx\+\_\+ep\+\_\+ctrl\+\_\+close\+\_\+sendto\+\_\+cb()}{p.}{trx__ep_8c_a95a1b2d00959f07310a495e4823c8c94}, once the last one completes. 

\mbox{\label{trx__ep_8c_a22fb20707157913d1f018560ff9c8dc9}} 
\index{trx\_ep.c@{trx\_ep.c}!TRX\_EP\_DATA\_BUF\_SIZE@{TRX\_EP\_DATA\_BUF\_SIZE}}
\index{TRX\_EP\_DATA\_BUF\_SIZE@{TRX\_EP\_DATA\_BUF\_SIZE}!trx\_ep.c@{trx\_ep.c}}
\doxysubsubsection{TRX\_EP\_DATA\_BUF\_SIZE}
{\footnotesize\ttfamily \#define TRX\+\_\+\+EP\+\_\+\+DATA\+\_\+\+BUF\+\_\+\+SIZE~4096}



Maximum TRXD datagram size\+: 8 batched PDUs with the largest bursts. 

\mbox{\label{trx__ep_8c_a6adedad2c7762cdc96a4dda1225057fd}} 
\index{trx\_ep.c@{trx\_ep.c}!TRX\_EP\_DEFAULT\_BASE\_PORT@{TRX\_EP\_DEFAULT\_BASE\_PORT}}
\index{TRX\_EP\_DEFAULT\_BASE\_PORT@{TRX\_EP\_DEFAULT\_BASE\_PORT}!trx\_ep.c@{trx\_ep.c}}
\doxysubsubsection{TRX\_EP\_DEFAULT\_BASE\_PORT}
{\footnotesize\ttfamily \#define TRX\+\_\+\+EP\+\_\+\+DEFAULT\+\_\+\+BASE\+\_\+\+PORT~5700}



Default base UDP port, see \doxyref{osmo\+\_\+trx\+\_\+ep\+\_\+set\+\_\+base\+\_\+port()}{p.}{trx__ep_8c_a8de9e23c68bf1285d626effe03687ecf} 

\mbox{\label{trx__ep_8c_a0740fb3a09382220d262df7a8c6898f8}} 
\index{trx\_ep.c@{trx\_ep.c}!TRX\_EP\_L1\_PORT\_OFS@{TRX\_EP\_L1\_PORT\_OFS}}
\index{TRX\_EP\_L1\_PORT\_OFS@{TRX\_EP\_L1\_PORT\_OFS}!trx\_ep.c@{trx\_ep.c}}
\doxysubsubsection{TRX\_EP\_L1\_PORT\_OFS}
{\footnotesize\ttfamily \#define TRX\+\_\+\+EP\+\_\+\+L1\+\_\+\+PORT\+\_\+\+OFS~100}



The L1 side uses a fixed base port offset (see trx\+\_\+toolkit) 



\doxysubsection{Function Documentation}
\mbox{\label{trx__ep_8c_af9aace1b44b73111e15aa39f06f43456}} 
\index{trx\_ep.c@{trx\_ep.c}!\_\_attribute\_\_@{\_\_attribute\_\_}}
\index{\_\_attribute\_\_@{\_\_attribute\_\_}!trx\_ep.c@{trx\_ep.c}}
\doxysubsubsection{\_\_attribute\_\_()}
{\footnotesize\ttfamily \+\_\+\+\_\+attribute\+\_\+\+\_\+ (\begin{DoxyParamCaption}\item[{(weak)}]{ }\end{DoxyParamCaption})}



References \textbf{ osmo\+\_\+trx\+\_\+ep\+\_\+chan\+::ep}, and \textbf{ LOGEP}.

\mbox{\label{trx__ep_8c_a28aa89ece8fae05a0c01afe110a8e58e}} 
\index{trx\_ep.c@{trx\_ep.c}!osmo\_trx\_ep\_alloc@{osmo\_trx\_ep\_alloc}}
\index{osmo\_trx\_ep\_alloc@{osmo\_trx\_ep\_alloc}!trx\_ep.c@{trx\_ep.c}}
\doxysubsubsection{osmo\_trx\_ep\_alloc()}
{\footnotesize\ttfamily struct \textbf{ osmo\+\_\+trx\+\_\+ep} $\ast$ osmo\+\_\+trx\+\_\+ep\+\_\+alloc (\begin{DoxyParamCaption}\item[{void $\ast$}]{ctx,  }\item[{unsigned int}]{num\+\_\+chans }\end{DoxyParamCaption})}



Allocate a TRX endpoint instance. 

The mode, addresses and base port default to zero/unset and must be configured via the osmo\+\_\+trx\+\_\+ep\+\_\+set\+\_\+$\ast$() accessors before \doxyref{osmo\+\_\+trx\+\_\+ep\+\_\+open()}{p.}{trx__ep_8c_a11e2dbc3d472ed74e5bc0d52aeea9663}; num\+\_\+chans may be changed later via \doxyref{osmo\+\_\+trx\+\_\+ep\+\_\+set\+\_\+num\+\_\+chans()}{p.}{trx__ep_8c_aa359f74c1f9c4a0e33a1e45239356912}, but before \doxyref{osmo\+\_\+trx\+\_\+ep\+\_\+open()}{p.}{trx__ep_8c_a11e2dbc3d472ed74e5bc0d52aeea9663}. 
\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em ctx} & talloc context to allocate from \\
\hline
\mbox{\texttt{ in}}  & {\em num\+\_\+chans} & number of channels ($>$ 0) \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
pointer to the allocated instance; NULL on error 
\end{DoxyReturn}


References \textbf{ osmo\+\_\+trx\+\_\+ep\+::base\+\_\+port}, \textbf{ osmo\+\_\+trx\+\_\+ep\+::log\+\_\+cat}, \textbf{ osmo\+\_\+trx\+\_\+ep\+::name}, \textbf{ osmo\+\_\+trx\+\_\+ep\+::num\+\_\+chans}, \textbf{ osmo\+\_\+trx\+\_\+ep\+\_\+set\+\_\+num\+\_\+chans()}, and \textbf{ TRX\+\_\+\+EP\+\_\+\+DEFAULT\+\_\+\+BASE\+\_\+\+PORT}.

\mbox{\label{trx__ep_8c_a38607d3c25dfde685b0f779528455ef2}} 
\index{trx\_ep.c@{trx\_ep.c}!osmo\_trx\_ep\_close@{osmo\_trx\_ep\_close}}
\index{osmo\_trx\_ep\_close@{osmo\_trx\_ep\_close}!trx\_ep.c@{trx\_ep.c}}
\doxysubsubsection{osmo\_trx\_ep\_close()}
{\footnotesize\ttfamily void osmo\+\_\+trx\+\_\+ep\+\_\+close (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+trx\+\_\+ep} $\ast$}]{ep }\end{DoxyParamCaption})}



Close all sockets of the given endpoint. 

No-\/op if not opened. Any TRXC message still queued on a ctrl socket (e.\+g. a \textquotesingle{}goodbye\textquotesingle{} \char`\"{}\+CMD POWEROFF\char`\"{} sent right before teardown) is flushed asynchronously (best-\/effort) instead of being dropped; pending Tx data batches are dropped. 

References \textbf{ osmo\+\_\+trx\+\_\+ep\+::chans}, \textbf{ osmo\+\_\+trx\+\_\+ep\+::clck\+\_\+iofd}, \textbf{ osmo\+\_\+trx\+\_\+ep\+::closed\+\_\+cb}, \textbf{ osmo\+\_\+trx\+\_\+ep\+::flags}, \textbf{ osmo\+\_\+trx\+\_\+ep\+::laddr}, \textbf{ LOGEP}, \textbf{ osmo\+\_\+trx\+\_\+ep\+::num\+\_\+chans}, \textbf{ OSMO\+\_\+\+TRX\+\_\+\+EP\+\_\+\+F\+\_\+\+OPEN}, \textbf{ osmo\+\_\+trx\+\_\+ep\+\_\+is\+\_\+closing()}, \textbf{ osmo\+\_\+trx\+\_\+ep\+::raddr}, \textbf{ trx\+\_\+ep\+\_\+chan\+\_\+close()}, and \textbf{ trx\+\_\+ep\+\_\+port()}.



Referenced by \textbf{ osmo\+\_\+trx\+\_\+ep\+\_\+free()}, and \textbf{ osmo\+\_\+trx\+\_\+ep\+\_\+open()}.

\mbox{\label{trx__ep_8c_afd3eb8dd5df6f258982203c4feeedb18}} 
\index{trx\_ep.c@{trx\_ep.c}!osmo\_trx\_ep\_free@{osmo\_trx\_ep\_free}}
\index{osmo\_trx\_ep\_free@{osmo\_trx\_ep\_free}!trx\_ep.c@{trx\_ep.c}}
\doxysubsubsection{osmo\_trx\_ep\_free()}
{\footnotesize\ttfamily void osmo\+\_\+trx\+\_\+ep\+\_\+free (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+trx\+\_\+ep} $\ast$}]{ep }\end{DoxyParamCaption})}



Free the given endpoint instance (closes all sockets). 

If a ctrl socket is still flushing (see \doxyref{osmo\+\_\+trx\+\_\+ep\+\_\+is\+\_\+closing()}{p.}{trx__ep_8c_a4dd846461e53e491fbddf829fefcb263}), the endpoint itself is kept alive until the flush completes (see \doxyref{trx\+\_\+ep\+\_\+ctrl\+\_\+close\+\_\+sendto\+\_\+cb()}{p.}{trx__ep_8c_a95a1b2d00959f07310a495e4823c8c94}), which then finishes this deferred free. 

References \textbf{ osmo\+\_\+trx\+\_\+ep\+::flags}, \textbf{ osmo\+\_\+trx\+\_\+ep\+\_\+close()}, \textbf{ OSMO\+\_\+\+TRX\+\_\+\+EP\+\_\+\+F\+\_\+\+PENDING\+\_\+\+FREE}, and \textbf{ osmo\+\_\+trx\+\_\+ep\+\_\+is\+\_\+closing()}.

\mbox{\label{trx__ep_8c_a8973e51e33cea63a0690c09cfd1adc1b}} 
\index{trx\_ep.c@{trx\_ep.c}!osmo\_trx\_ep\_get\_base\_port@{osmo\_trx\_ep\_get\_base\_port}}
\index{osmo\_trx\_ep\_get\_base\_port@{osmo\_trx\_ep\_get\_base\_port}!trx\_ep.c@{trx\_ep.c}}
\doxysubsubsection{osmo\_trx\_ep\_get\_base\_port()}
{\footnotesize\ttfamily uint16\+\_\+t osmo\+\_\+trx\+\_\+ep\+\_\+get\+\_\+base\+\_\+port (\begin{DoxyParamCaption}\item[{const struct \textbf{ osmo\+\_\+trx\+\_\+ep} $\ast$}]{ep }\end{DoxyParamCaption})}



Obtain the base UDP port. 



References \textbf{ osmo\+\_\+trx\+\_\+ep\+::base\+\_\+port}.

\mbox{\label{trx__ep_8c_a0944ea7e3284d74b8ba4037b74e1247f}} 
\index{trx\_ep.c@{trx\_ep.c}!osmo\_trx\_ep\_get\_clock\_socket@{osmo\_trx\_ep\_get\_clock\_socket}}
\index{osmo\_trx\_ep\_get\_clock\_socket@{osmo\_trx\_ep\_get\_clock\_socket}!trx\_ep.c@{trx\_ep.c}}
\doxysubsubsection{osmo\_trx\_ep\_get\_clock\_socket()}
{\footnotesize\ttfamily bool osmo\+\_\+trx\+\_\+ep\+\_\+get\+\_\+clock\+\_\+socket (\begin{DoxyParamCaption}\item[{const struct \textbf{ osmo\+\_\+trx\+\_\+ep} $\ast$}]{ep }\end{DoxyParamCaption})}



Whether the clock socket is enabled. 



References \textbf{ osmo\+\_\+trx\+\_\+ep\+::flags}, and \textbf{ OSMO\+\_\+\+TRX\+\_\+\+EP\+\_\+\+F\+\_\+\+CLOCK\+\_\+\+SOCKET}.

\mbox{\label{trx__ep_8c_a3149b3e125277e2cde3eee5579399fce}} 
\index{trx\_ep.c@{trx\_ep.c}!osmo\_trx\_ep\_get\_ctrl\_promisc@{osmo\_trx\_ep\_get\_ctrl\_promisc}}
\index{osmo\_trx\_ep\_get\_ctrl\_promisc@{osmo\_trx\_ep\_get\_ctrl\_promisc}!trx\_ep.c@{trx\_ep.c}}
\doxysubsubsection{osmo\_trx\_ep\_get\_ctrl\_promisc()}
{\footnotesize\ttfamily bool osmo\+\_\+trx\+\_\+ep\+\_\+get\+\_\+ctrl\+\_\+promisc (\begin{DoxyParamCaption}\item[{const struct \textbf{ osmo\+\_\+trx\+\_\+ep} $\ast$}]{ep }\end{DoxyParamCaption})}



Whether promiscuous ctrl socket mode is enabled. 



References \textbf{ osmo\+\_\+trx\+\_\+ep\+::flags}, and \textbf{ OSMO\+\_\+\+TRX\+\_\+\+EP\+\_\+\+F\+\_\+\+CTRL\+\_\+\+PROMISC}.

\mbox{\label{trx__ep_8c_afc92ec79a8e23ea98422043d5586b0ba}} 
\index{trx\_ep.c@{trx\_ep.c}!osmo\_trx\_ep\_get\_laddr@{osmo\_trx\_ep\_get\_laddr}}
\index{osmo\_trx\_ep\_get\_laddr@{osmo\_trx\_ep\_get\_laddr}!trx\_ep.c@{trx\_ep.c}}
\doxysubsubsection{osmo\_trx\_ep\_get\_laddr()}
{\footnotesize\ttfamily const char $\ast$ osmo\+\_\+trx\+\_\+ep\+\_\+get\+\_\+laddr (\begin{DoxyParamCaption}\item[{const struct \textbf{ osmo\+\_\+trx\+\_\+ep} $\ast$}]{ep }\end{DoxyParamCaption})}



Obtain the local IP address. 



References \textbf{ osmo\+\_\+trx\+\_\+ep\+::laddr}.

\mbox{\label{trx__ep_8c_a7ff547bc086ac9b10f805001cc266bf9}} 
\index{trx\_ep.c@{trx\_ep.c}!osmo\_trx\_ep\_get\_mode@{osmo\_trx\_ep\_get\_mode}}
\index{osmo\_trx\_ep\_get\_mode@{osmo\_trx\_ep\_get\_mode}!trx\_ep.c@{trx\_ep.c}}
\doxysubsubsection{osmo\_trx\_ep\_get\_mode()}
{\footnotesize\ttfamily enum \textbf{ osmo\+\_\+trx\+\_\+ep\+\_\+mode} osmo\+\_\+trx\+\_\+ep\+\_\+get\+\_\+mode (\begin{DoxyParamCaption}\item[{const struct \textbf{ osmo\+\_\+trx\+\_\+ep} $\ast$}]{ep }\end{DoxyParamCaption})}



Obtain the endpoint mode. 



References \textbf{ osmo\+\_\+trx\+\_\+ep\+::mode}.

\mbox{\label{trx__ep_8c_a25d774809eacaa95e41b6d969b1c20fd}} 
\index{trx\_ep.c@{trx\_ep.c}!osmo\_trx\_ep\_get\_name@{osmo\_trx\_ep\_get\_name}}
\index{osmo\_trx\_ep\_get\_name@{osmo\_trx\_ep\_get\_name}!trx\_ep.c@{trx\_ep.c}}
\doxysubsubsection{osmo\_trx\_ep\_get\_name()}
{\footnotesize\ttfamily const char $\ast$ osmo\+\_\+trx\+\_\+ep\+\_\+get\+\_\+name (\begin{DoxyParamCaption}\item[{const struct \textbf{ osmo\+\_\+trx\+\_\+ep} $\ast$}]{ep }\end{DoxyParamCaption})}



Obtain the name (log prefix) of the given instance. 



References \textbf{ osmo\+\_\+trx\+\_\+ep\+::name}.

\mbox{\label{trx__ep_8c_a3915235480027afec6902cc1b4d57933}} 
\index{trx\_ep.c@{trx\_ep.c}!osmo\_trx\_ep\_get\_num\_chans@{osmo\_trx\_ep\_get\_num\_chans}}
\index{osmo\_trx\_ep\_get\_num\_chans@{osmo\_trx\_ep\_get\_num\_chans}!trx\_ep.c@{trx\_ep.c}}
\doxysubsubsection{osmo\_trx\_ep\_get\_num\_chans()}
{\footnotesize\ttfamily unsigned int osmo\+\_\+trx\+\_\+ep\+\_\+get\+\_\+num\+\_\+chans (\begin{DoxyParamCaption}\item[{const struct \textbf{ osmo\+\_\+trx\+\_\+ep} $\ast$}]{ep }\end{DoxyParamCaption})}



Obtain the number of channels. 



References \textbf{ osmo\+\_\+trx\+\_\+ep\+::num\+\_\+chans}.

\mbox{\label{trx__ep_8c_ad0b591399e98481a33e9575a9e9d7828}} 
\index{trx\_ep.c@{trx\_ep.c}!osmo\_trx\_ep\_get\_pdu\_batch@{osmo\_trx\_ep\_get\_pdu\_batch}}
\index{osmo\_trx\_ep\_get\_pdu\_batch@{osmo\_trx\_ep\_get\_pdu\_batch}!trx\_ep.c@{trx\_ep.c}}
\doxysubsubsection{osmo\_trx\_ep\_get\_pdu\_batch()}
{\footnotesize\ttfamily bool osmo\+\_\+trx\+\_\+ep\+\_\+get\+\_\+pdu\+\_\+batch (\begin{DoxyParamCaption}\item[{const struct \textbf{ osmo\+\_\+trx\+\_\+ep} $\ast$}]{ep }\end{DoxyParamCaption})}



Whether batching BURST.\+ind/req PDUs on the data sockets is enabled. 



References \textbf{ osmo\+\_\+trx\+\_\+ep\+::flags}, and \textbf{ OSMO\+\_\+\+TRX\+\_\+\+EP\+\_\+\+F\+\_\+\+NO\+\_\+\+PDU\+\_\+\+BATCH}.

\mbox{\label{trx__ep_8c_afc3091f6584fceae3bd5c1301a17ca0e}} 
\index{trx\_ep.c@{trx\_ep.c}!osmo\_trx\_ep\_get\_pdu\_ver@{osmo\_trx\_ep\_get\_pdu\_ver}}
\index{osmo\_trx\_ep\_get\_pdu\_ver@{osmo\_trx\_ep\_get\_pdu\_ver}!trx\_ep.c@{trx\_ep.c}}
\doxysubsubsection{osmo\_trx\_ep\_get\_pdu\_ver()}
{\footnotesize\ttfamily int osmo\+\_\+trx\+\_\+ep\+\_\+get\+\_\+pdu\+\_\+ver (\begin{DoxyParamCaption}\item[{const struct \textbf{ osmo\+\_\+trx\+\_\+ep} $\ast$}]{ep,  }\item[{unsigned int}]{chan }\end{DoxyParamCaption})}



Get the TRXD PDU version in use for the given channel. 



References \textbf{ osmo\+\_\+trx\+\_\+ep\+::chans}, \textbf{ osmo\+\_\+trx\+\_\+ep\+::num\+\_\+chans}, and \textbf{ osmo\+\_\+trx\+\_\+ep\+\_\+chan\+::pdu\+\_\+ver}.

\mbox{\label{trx__ep_8c_a74488f3f55616b4f5d4f8523af418f03}} 
\index{trx\_ep.c@{trx\_ep.c}!osmo\_trx\_ep\_get\_priv@{osmo\_trx\_ep\_get\_priv}}
\index{osmo\_trx\_ep\_get\_priv@{osmo\_trx\_ep\_get\_priv}!trx\_ep.c@{trx\_ep.c}}
\doxysubsubsection{osmo\_trx\_ep\_get\_priv()}
{\footnotesize\ttfamily void $\ast$ osmo\+\_\+trx\+\_\+ep\+\_\+get\+\_\+priv (\begin{DoxyParamCaption}\item[{const struct \textbf{ osmo\+\_\+trx\+\_\+ep} $\ast$}]{ep }\end{DoxyParamCaption})}



Obtain the application-\/private data. 



References \textbf{ osmo\+\_\+trx\+\_\+ep\+::priv}.

\mbox{\label{trx__ep_8c_a498c5b1598ea56e07a55013daab3963c}} 
\index{trx\_ep.c@{trx\_ep.c}!osmo\_trx\_ep\_get\_raddr@{osmo\_trx\_ep\_get\_raddr}}
\index{osmo\_trx\_ep\_get\_raddr@{osmo\_trx\_ep\_get\_raddr}!trx\_ep.c@{trx\_ep.c}}
\doxysubsubsection{osmo\_trx\_ep\_get\_raddr()}
{\footnotesize\ttfamily const char $\ast$ osmo\+\_\+trx\+\_\+ep\+\_\+get\+\_\+raddr (\begin{DoxyParamCaption}\item[{const struct \textbf{ osmo\+\_\+trx\+\_\+ep} $\ast$}]{ep }\end{DoxyParamCaption})}



Obtain the remote IP address. 



References \textbf{ osmo\+\_\+trx\+\_\+ep\+::raddr}.

\mbox{\label{trx__ep_8c_a4dd846461e53e491fbddf829fefcb263}} 
\index{trx\_ep.c@{trx\_ep.c}!osmo\_trx\_ep\_is\_closing@{osmo\_trx\_ep\_is\_closing}}
\index{osmo\_trx\_ep\_is\_closing@{osmo\_trx\_ep\_is\_closing}!trx\_ep.c@{trx\_ep.c}}
\doxysubsubsection{osmo\_trx\_ep\_is\_closing()}
{\footnotesize\ttfamily bool osmo\+\_\+trx\+\_\+ep\+\_\+is\+\_\+closing (\begin{DoxyParamCaption}\item[{const struct \textbf{ osmo\+\_\+trx\+\_\+ep} $\ast$}]{ep }\end{DoxyParamCaption})}



Whether a ctrl socket from a previous \doxyref{osmo\+\_\+trx\+\_\+ep\+\_\+close()}{p.}{trx__ep_8c_a38607d3c25dfde685b0f779528455ef2} is still flushing a queued TRXC message in the background (see \doxyref{trx\+\_\+ep\+\_\+ctrl\+\_\+close()}{p.}{trx__ep_8c_ac3a21ac397090bf281e267e251fdd840}). 



References \textbf{ osmo\+\_\+trx\+\_\+ep\+::chans}, \textbf{ osmo\+\_\+trx\+\_\+ep\+\_\+chan\+::ctrl\+\_\+wr\+\_\+pending}, and \textbf{ osmo\+\_\+trx\+\_\+ep\+::num\+\_\+chans}.



Referenced by \textbf{ osmo\+\_\+trx\+\_\+ep\+\_\+close()}, \textbf{ osmo\+\_\+trx\+\_\+ep\+\_\+free()}, \textbf{ osmo\+\_\+trx\+\_\+ep\+\_\+open()}, \textbf{ osmo\+\_\+trx\+\_\+ep\+\_\+set\+\_\+num\+\_\+chans()}, and \textbf{ trx\+\_\+ep\+\_\+ctrl\+\_\+close\+\_\+sendto\+\_\+cb()}.

\mbox{\label{trx__ep_8c_a6d9bcdaa745a9fe71b881e9b8bb6491d}} 
\index{trx\_ep.c@{trx\_ep.c}!osmo\_trx\_ep\_is\_open@{osmo\_trx\_ep\_is\_open}}
\index{osmo\_trx\_ep\_is\_open@{osmo\_trx\_ep\_is\_open}!trx\_ep.c@{trx\_ep.c}}
\doxysubsubsection{osmo\_trx\_ep\_is\_open()}
{\footnotesize\ttfamily bool osmo\+\_\+trx\+\_\+ep\+\_\+is\+\_\+open (\begin{DoxyParamCaption}\item[{const struct \textbf{ osmo\+\_\+trx\+\_\+ep} $\ast$}]{ep }\end{DoxyParamCaption})}



Whether the endpoint\textquotesingle{}s sockets are currently open. 



References \textbf{ osmo\+\_\+trx\+\_\+ep\+::flags}, and \textbf{ OSMO\+\_\+\+TRX\+\_\+\+EP\+\_\+\+F\+\_\+\+OPEN}.

\mbox{\label{trx__ep_8c_a11e2dbc3d472ed74e5bc0d52aeea9663}} 
\index{trx\_ep.c@{trx\_ep.c}!osmo\_trx\_ep\_open@{osmo\_trx\_ep\_open}}
\index{osmo\_trx\_ep\_open@{osmo\_trx\_ep\_open}!trx\_ep.c@{trx\_ep.c}}
\doxysubsubsection{osmo\_trx\_ep\_open()}
{\footnotesize\ttfamily int osmo\+\_\+trx\+\_\+ep\+\_\+open (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+trx\+\_\+ep} $\ast$}]{ep }\end{DoxyParamCaption})}



Open the clock/ctrl/data sockets of the given endpoint. 

\begin{DoxyReturn}{Returns}
0 on success; -\/EALREADY if already open; -\/EBUSY if a previous \doxyref{osmo\+\_\+trx\+\_\+ep\+\_\+close()}{p.}{trx__ep_8c_a38607d3c25dfde685b0f779528455ef2} is still flushing a ctrl socket (see \doxyref{osmo\+\_\+trx\+\_\+ep\+\_\+is\+\_\+closing()}{p.}{trx__ep_8c_a4dd846461e53e491fbddf829fefcb263}); other negative values on error (all sockets closed) 
\end{DoxyReturn}


References \textbf{ osmo\+\_\+trx\+\_\+ep\+::chans}, \textbf{ osmo\+\_\+trx\+\_\+ep\+::clck\+\_\+iofd}, \textbf{ osmo\+\_\+trx\+\_\+ep\+::flags}, \textbf{ osmo\+\_\+trx\+\_\+ep\+::laddr}, \textbf{ LOGEP}, \textbf{ osmo\+\_\+trx\+\_\+ep\+::num\+\_\+chans}, \textbf{ osmo\+\_\+trx\+\_\+ep\+\_\+close()}, \textbf{ OSMO\+\_\+\+TRX\+\_\+\+EP\+\_\+\+F\+\_\+\+CLOCK\+\_\+\+SOCKET}, \textbf{ OSMO\+\_\+\+TRX\+\_\+\+EP\+\_\+\+F\+\_\+\+OPEN}, \textbf{ osmo\+\_\+trx\+\_\+ep\+\_\+is\+\_\+closing()}, \textbf{ OSMO\+\_\+\+TRXC\+\_\+\+MSG\+\_\+\+BUF\+\_\+\+SIZE}, \textbf{ osmo\+\_\+trx\+\_\+ep\+::raddr}, \textbf{ trx\+\_\+ep\+\_\+chan\+\_\+open()}, \textbf{ trx\+\_\+ep\+\_\+clck\+\_\+ioops}, \textbf{ trx\+\_\+ep\+\_\+open\+\_\+iofd()}, and \textbf{ trx\+\_\+ep\+\_\+port()}.

\mbox{\label{trx__ep_8c_a8195eca01fcf74e4f227872174fa8a4e}} 
\index{trx\_ep.c@{trx\_ep.c}!osmo\_trx\_ep\_send\_burst\_fin@{osmo\_trx\_ep\_send\_burst\_fin}}
\index{osmo\_trx\_ep\_send\_burst\_fin@{osmo\_trx\_ep\_send\_burst\_fin}!trx\_ep.c@{trx\_ep.c}}
\doxysubsubsection{osmo\_trx\_ep\_send\_burst\_fin()}
{\footnotesize\ttfamily int osmo\+\_\+trx\+\_\+ep\+\_\+send\+\_\+burst\+\_\+fin (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+trx\+\_\+ep} $\ast$}]{ep,  }\item[{unsigned int}]{chan }\end{DoxyParamCaption})}



Flush the TRXDv2 batching buffer accumulated by \doxyref{osmo\+\_\+trx\+\_\+ep\+\_\+send\+\_\+burst\+\_\+ind()}{p.}{trx__ep_8c_a680a6a5e9c36ec796583776da9f15166} or \doxyref{osmo\+\_\+trx\+\_\+ep\+\_\+send\+\_\+burst\+\_\+req()}{p.}{trx__ep_8c_a68b09a204949f4337550a57cdf25cc62} (whichever applies to this endpoint\textquotesingle{}s mode), transmitting it in a single datagram; no-\/op (returns -\/ENOMSG) if nothing was accumulated, and for TRXDv0/v1 (each PDU is already sent immediately by \doxyref{osmo\+\_\+trx\+\_\+ep\+\_\+send\+\_\+burst\+\_\+ind()}{p.}{trx__ep_8c_a680a6a5e9c36ec796583776da9f15166}/\+\_\+req()). 

\begin{DoxyReturn}{Returns}
0 on success; -\/ENOMSG if there was nothing to flush; other negative on error 
\end{DoxyReturn}


References \textbf{ osmo\+\_\+trx\+\_\+ep\+::chans}, \textbf{ osmo\+\_\+trx\+\_\+ep\+\_\+chan\+::ep}, \textbf{ trx\+\_\+ep\+\_\+data\+\_\+tx\+\_\+flush()}, and \textbf{ osmo\+\_\+trx\+\_\+ep\+\_\+chan\+::tx\+\_\+msg}.

\mbox{\label{trx__ep_8c_a680a6a5e9c36ec796583776da9f15166}} 
\index{trx\_ep.c@{trx\_ep.c}!osmo\_trx\_ep\_send\_burst\_ind@{osmo\_trx\_ep\_send\_burst\_ind}}
\index{osmo\_trx\_ep\_send\_burst\_ind@{osmo\_trx\_ep\_send\_burst\_ind}!trx\_ep.c@{trx\_ep.c}}
\doxysubsubsection{osmo\_trx\_ep\_send\_burst\_ind()}
{\footnotesize\ttfamily int osmo\+\_\+trx\+\_\+ep\+\_\+send\+\_\+burst\+\_\+ind (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+trx\+\_\+ep} $\ast$}]{ep,  }\item[{unsigned int}]{chan,  }\item[{const struct \textbf{ osmo\+\_\+trxd\+\_\+burst\+\_\+ind} $\ast$}]{bi }\end{DoxyParamCaption})}



Send a burst indication on the data socket of the given channel (OSMO\+\_\+\+TRX\+\_\+\+EP\+\_\+\+MODE\+\_\+\+TRX only). 

For TRXDv2, the PDUs are batched\+: they get accumulated until \doxyref{osmo\+\_\+trx\+\_\+ep\+\_\+send\+\_\+burst\+\_\+fin()}{p.}{trx__ep_8c_a8195eca01fcf74e4f227872174fa8a4e} is called, which transmits all accumulated PDUs in a single datagram. For TRXDv0/v1, each PDU is transmitted immediately.

\begin{DoxyReturn}{Returns}
0 on success; negative on error 
\end{DoxyReturn}


References \textbf{ osmo\+\_\+trx\+\_\+ep\+::chans}, \textbf{ osmo\+\_\+trx\+\_\+ep\+::flags}, \textbf{ OSMO\+\_\+\+TRX\+\_\+\+EP\+\_\+\+F\+\_\+\+NO\+\_\+\+PDU\+\_\+\+BATCH}, \textbf{ osmo\+\_\+trxd\+\_\+burst\+\_\+ind\+\_\+build()}, \textbf{ osmo\+\_\+trx\+\_\+ep\+\_\+chan\+::pdu\+\_\+ver}, \textbf{ TRX\+\_\+\+EP\+\_\+\+DATA\+\_\+\+BUF\+\_\+\+SIZE}, \textbf{ trx\+\_\+ep\+\_\+data\+\_\+tx\+\_\+flush()}, and \textbf{ osmo\+\_\+trx\+\_\+ep\+\_\+chan\+::tx\+\_\+msg}.

\mbox{\label{trx__ep_8c_a68b09a204949f4337550a57cdf25cc62}} 
\index{trx\_ep.c@{trx\_ep.c}!osmo\_trx\_ep\_send\_burst\_req@{osmo\_trx\_ep\_send\_burst\_req}}
\index{osmo\_trx\_ep\_send\_burst\_req@{osmo\_trx\_ep\_send\_burst\_req}!trx\_ep.c@{trx\_ep.c}}
\doxysubsubsection{osmo\_trx\_ep\_send\_burst\_req()}
{\footnotesize\ttfamily int osmo\+\_\+trx\+\_\+ep\+\_\+send\+\_\+burst\+\_\+req (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+trx\+\_\+ep} $\ast$}]{ep,  }\item[{unsigned int}]{chan,  }\item[{const struct \textbf{ osmo\+\_\+trxd\+\_\+burst\+\_\+req} $\ast$}]{br }\end{DoxyParamCaption})}



Send a burst transmit request on the data socket of the given channel (OSMO\+\_\+\+TRX\+\_\+\+EP\+\_\+\+MODE\+\_\+\+L1 only). 

For TRXDv2, the PDUs are batched\+: they get accumulated until \doxyref{osmo\+\_\+trx\+\_\+ep\+\_\+send\+\_\+burst\+\_\+fin()}{p.}{trx__ep_8c_a8195eca01fcf74e4f227872174fa8a4e} is called, which transmits all accumulated PDUs in a single datagram. For TRXDv0/v1, each PDU is transmitted immediately.

\begin{DoxyReturn}{Returns}
0 on success; negative on error 
\end{DoxyReturn}


References \textbf{ osmo\+\_\+trx\+\_\+ep\+::chans}, \textbf{ osmo\+\_\+trx\+\_\+ep\+::flags}, \textbf{ OSMO\+\_\+\+TRX\+\_\+\+EP\+\_\+\+F\+\_\+\+NO\+\_\+\+PDU\+\_\+\+BATCH}, \textbf{ osmo\+\_\+trxd\+\_\+burst\+\_\+req\+\_\+build()}, \textbf{ osmo\+\_\+trx\+\_\+ep\+\_\+chan\+::pdu\+\_\+ver}, \textbf{ TRX\+\_\+\+EP\+\_\+\+DATA\+\_\+\+BUF\+\_\+\+SIZE}, \textbf{ trx\+\_\+ep\+\_\+data\+\_\+tx\+\_\+flush()}, and \textbf{ osmo\+\_\+trx\+\_\+ep\+\_\+chan\+::tx\+\_\+msg}.

\mbox{\label{trx__ep_8c_ac4a09c58b17d9566ec11946fc45c1828}} 
\index{trx\_ep.c@{trx\_ep.c}!osmo\_trx\_ep\_send\_clck\_ind@{osmo\_trx\_ep\_send\_clck\_ind}}
\index{osmo\_trx\_ep\_send\_clck\_ind@{osmo\_trx\_ep\_send\_clck\_ind}!trx\_ep.c@{trx\_ep.c}}
\doxysubsubsection{osmo\_trx\_ep\_send\_clck\_ind()}
{\footnotesize\ttfamily int osmo\+\_\+trx\+\_\+ep\+\_\+send\+\_\+clck\+\_\+ind (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+trx\+\_\+ep} $\ast$}]{ep,  }\item[{uint32\+\_\+t}]{fn }\end{DoxyParamCaption})}



Send a clock indication (\char`\"{}\+IND CLOCK $<$fn$>$\char`\"{}) on the clock socket. 

\begin{DoxyReturn}{Returns}
0 on success; negative on error 
\end{DoxyReturn}


References \textbf{ osmo\+\_\+trx\+\_\+ep\+::clck\+\_\+iofd}, \textbf{ osmo\+\_\+trxc\+\_\+clock\+\_\+ind\+\_\+build()}, and \textbf{ OSMO\+\_\+\+TRXC\+\_\+\+MSG\+\_\+\+BUF\+\_\+\+SIZE}.

\mbox{\label{trx__ep_8c_a4f2334ef1db2595cae932524de6c7f0f}} 
\index{trx\_ep.c@{trx\_ep.c}!osmo\_trx\_ep\_send\_ctrl\_msg@{osmo\_trx\_ep\_send\_ctrl\_msg}}
\index{osmo\_trx\_ep\_send\_ctrl\_msg@{osmo\_trx\_ep\_send\_ctrl\_msg}!trx\_ep.c@{trx\_ep.c}}
\doxysubsubsection{osmo\_trx\_ep\_send\_ctrl\_msg()}
{\footnotesize\ttfamily int osmo\+\_\+trx\+\_\+ep\+\_\+send\+\_\+ctrl\+\_\+msg (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+trx\+\_\+ep} $\ast$}]{ep,  }\item[{unsigned int}]{chan,  }\item[{const struct \textbf{ osmo\+\_\+trxc\+\_\+msg} $\ast$}]{tmsg }\end{DoxyParamCaption})}



Send a TRXC message on the ctrl socket of the given channel. 

\begin{DoxyReturn}{Returns}
0 on success; negative on error 
\end{DoxyReturn}


References \textbf{ osmo\+\_\+trx\+\_\+ep\+::chans}, \textbf{ osmo\+\_\+trx\+\_\+ep\+\_\+chan\+::ctrl\+\_\+iofd}, \textbf{ osmo\+\_\+trx\+\_\+ep\+\_\+chan\+::ctrl\+\_\+peer}, \textbf{ osmo\+\_\+trx\+\_\+ep\+\_\+chan\+::ctrl\+\_\+wr\+\_\+pending}, \textbf{ OSMO\+\_\+\+TRXC\+\_\+\+MSG\+\_\+\+BUF\+\_\+\+SIZE}, and \textbf{ osmo\+\_\+trxc\+\_\+msg\+\_\+build()}.

\mbox{\label{trx__ep_8c_a8de9e23c68bf1285d626effe03687ecf}} 
\index{trx\_ep.c@{trx\_ep.c}!osmo\_trx\_ep\_set\_base\_port@{osmo\_trx\_ep\_set\_base\_port}}
\index{osmo\_trx\_ep\_set\_base\_port@{osmo\_trx\_ep\_set\_base\_port}!trx\_ep.c@{trx\_ep.c}}
\doxysubsubsection{osmo\_trx\_ep\_set\_base\_port()}
{\footnotesize\ttfamily int osmo\+\_\+trx\+\_\+ep\+\_\+set\+\_\+base\+\_\+port (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+trx\+\_\+ep} $\ast$}]{ep,  }\item[{uint16\+\_\+t}]{base\+\_\+port }\end{DoxyParamCaption})}



Set the base UDP port (default\+: 5700), see \doxyref{ep.\+h}{p.}{ep_8h} for the port layout. 

Base UDP port (default\+: 5700). 

References \textbf{ osmo\+\_\+trx\+\_\+ep\+::base\+\_\+port}, \textbf{ osmo\+\_\+trx\+\_\+ep\+::flags}, and \textbf{ OSMO\+\_\+\+TRX\+\_\+\+EP\+\_\+\+F\+\_\+\+OPEN}.

\mbox{\label{trx__ep_8c_a005113b95b4a0a2c1518915f0c0d5e19}} 
\index{trx\_ep.c@{trx\_ep.c}!osmo\_trx\_ep\_set\_clock\_socket@{osmo\_trx\_ep\_set\_clock\_socket}}
\index{osmo\_trx\_ep\_set\_clock\_socket@{osmo\_trx\_ep\_set\_clock\_socket}!trx\_ep.c@{trx\_ep.c}}
\doxysubsubsection{osmo\_trx\_ep\_set\_clock\_socket()}
{\footnotesize\ttfamily int osmo\+\_\+trx\+\_\+ep\+\_\+set\+\_\+clock\+\_\+socket (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+trx\+\_\+ep} $\ast$}]{ep,  }\item[{bool}]{enable }\end{DoxyParamCaption})}



Enable/disable the clock socket (default\+: false) 

Open the clock socket (base port + 0); default\+: false. 

References \textbf{ osmo\+\_\+trx\+\_\+ep\+::flags}, \textbf{ OSMO\+\_\+\+TRX\+\_\+\+EP\+\_\+\+F\+\_\+\+CLOCK\+\_\+\+SOCKET}, and \textbf{ OSMO\+\_\+\+TRX\+\_\+\+EP\+\_\+\+F\+\_\+\+OPEN}.

\mbox{\label{trx__ep_8c_a5d312e40b7c366a18c8f362bcdb5f4f4}} 
\index{trx\_ep.c@{trx\_ep.c}!osmo\_trx\_ep\_set\_closed\_cb@{osmo\_trx\_ep\_set\_closed\_cb}}
\index{osmo\_trx\_ep\_set\_closed\_cb@{osmo\_trx\_ep\_set\_closed\_cb}!trx\_ep.c@{trx\_ep.c}}
\doxysubsubsection{osmo\_trx\_ep\_set\_closed\_cb()}
{\footnotesize\ttfamily void osmo\+\_\+trx\+\_\+ep\+\_\+set\+\_\+closed\+\_\+cb (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+trx\+\_\+ep} $\ast$}]{ep,  }\item[{\textbf{ osmo\+\_\+trx\+\_\+ep\+\_\+closed\+\_\+cb\+\_\+t}}]{closed\+\_\+cb }\end{DoxyParamCaption})}



Set the call-\/back invoked once \doxyref{osmo\+\_\+trx\+\_\+ep\+\_\+close()}{p.}{trx__ep_8c_a38607d3c25dfde685b0f779528455ef2} has fully completed\+: immediately if no ctrl chan needed flushing, or once the last async flush finishes (see \doxyref{osmo\+\_\+trx\+\_\+ep\+\_\+is\+\_\+closing()}{p.}{trx__ep_8c_a4dd846461e53e491fbddf829fefcb263}) otherwise. 



References \textbf{ osmo\+\_\+trx\+\_\+ep\+::closed\+\_\+cb}.

\mbox{\label{trx__ep_8c_aa6dd8fb133b8c60cd5f84eb985732806}} 
\index{trx\_ep.c@{trx\_ep.c}!osmo\_trx\_ep\_set\_ctrl\_promisc@{osmo\_trx\_ep\_set\_ctrl\_promisc}}
\index{osmo\_trx\_ep\_set\_ctrl\_promisc@{osmo\_trx\_ep\_set\_ctrl\_promisc}!trx\_ep.c@{trx\_ep.c}}
\doxysubsubsection{osmo\_trx\_ep\_set\_ctrl\_promisc()}
{\footnotesize\ttfamily int osmo\+\_\+trx\+\_\+ep\+\_\+set\+\_\+ctrl\+\_\+promisc (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+trx\+\_\+ep} $\ast$}]{ep,  }\item[{bool}]{enable }\end{DoxyParamCaption})}



Enable/disable promiscuous ctrl socket mode (default\+: false)\+: leaves the ctrl socket unconnected, accepting TRXC PDUs from any peer instead of only the configured one, e.\+g. 

Unconnected ctrl socket accepting/replying to any peer; default\+: false.

a test tool injecting extra TRXC commands from its own socket. The RSP always goes back to whoever actually sent the CMD, promiscuous or not (see \doxyref{trx\+\_\+ep\+\_\+ctrl\+\_\+recvfrom\+\_\+cb()}{p.}{trx__ep_8c_a653378d12902ff75f0c6fa2e25620650} and chan-\/$>$ctrl\+\_\+peer). 

References \textbf{ osmo\+\_\+trx\+\_\+ep\+::flags}, \textbf{ OSMO\+\_\+\+TRX\+\_\+\+EP\+\_\+\+F\+\_\+\+CTRL\+\_\+\+PROMISC}, and \textbf{ OSMO\+\_\+\+TRX\+\_\+\+EP\+\_\+\+F\+\_\+\+OPEN}.

\mbox{\label{trx__ep_8c_afa4d72e1e3055df97b09c51297950625}} 
\index{trx\_ep.c@{trx\_ep.c}!osmo\_trx\_ep\_set\_laddr@{osmo\_trx\_ep\_set\_laddr}}
\index{osmo\_trx\_ep\_set\_laddr@{osmo\_trx\_ep\_set\_laddr}!trx\_ep.c@{trx\_ep.c}}
\doxysubsubsection{osmo\_trx\_ep\_set\_laddr()}
{\footnotesize\ttfamily int osmo\+\_\+trx\+\_\+ep\+\_\+set\+\_\+laddr (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+trx\+\_\+ep} $\ast$}]{ep,  }\item[{const char $\ast$}]{addr }\end{DoxyParamCaption})}



Set the local IP address (copied) 

Local/remote IP address (copied); must be set before \doxyref{osmo\+\_\+trx\+\_\+ep\+\_\+open()}{p.}{ep_8h_a11e2dbc3d472ed74e5bc0d52aeea9663} 

References \textbf{ osmo\+\_\+trx\+\_\+ep\+::flags}, \textbf{ osmo\+\_\+trx\+\_\+ep\+::laddr}, and \textbf{ OSMO\+\_\+\+TRX\+\_\+\+EP\+\_\+\+F\+\_\+\+OPEN}.

\mbox{\label{trx__ep_8c_ad9d0a1d4462c0ea37ddc05bcb299d0d8}} 
\index{trx\_ep.c@{trx\_ep.c}!osmo\_trx\_ep\_set\_log\_cat@{osmo\_trx\_ep\_set\_log\_cat}}
\index{osmo\_trx\_ep\_set\_log\_cat@{osmo\_trx\_ep\_set\_log\_cat}!trx\_ep.c@{trx\_ep.c}}
\doxysubsubsection{osmo\_trx\_ep\_set\_log\_cat()}
{\footnotesize\ttfamily void osmo\+\_\+trx\+\_\+ep\+\_\+set\+\_\+log\+\_\+cat (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+trx\+\_\+ep} $\ast$}]{ep,  }\item[{int}]{log\+\_\+cat }\end{DoxyParamCaption})}



Set the logging category (e.\+g. 

DTRX in osmo-\/bts; default\+: DLGLOBAL) 

References \textbf{ osmo\+\_\+trx\+\_\+ep\+::log\+\_\+cat}.

\mbox{\label{trx__ep_8c_a50167e712196b0a1e8347e76c47b9846}} 
\index{trx\_ep.c@{trx\_ep.c}!osmo\_trx\_ep\_set\_mode@{osmo\_trx\_ep\_set\_mode}}
\index{osmo\_trx\_ep\_set\_mode@{osmo\_trx\_ep\_set\_mode}!trx\_ep.c@{trx\_ep.c}}
\doxysubsubsection{osmo\_trx\_ep\_set\_mode()}
{\footnotesize\ttfamily int osmo\+\_\+trx\+\_\+ep\+\_\+set\+\_\+mode (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+trx\+\_\+ep} $\ast$}]{ep,  }\item[{enum \textbf{ osmo\+\_\+trx\+\_\+ep\+\_\+mode}}]{mode }\end{DoxyParamCaption})}



Set the endpoint mode (default\+: OSMO\+\_\+\+TRX\+\_\+\+EP\+\_\+\+MODE\+\_\+\+L1) 



References \textbf{ osmo\+\_\+trx\+\_\+ep\+::flags}, \textbf{ osmo\+\_\+trx\+\_\+ep\+::mode}, and \textbf{ OSMO\+\_\+\+TRX\+\_\+\+EP\+\_\+\+F\+\_\+\+OPEN}.

\mbox{\label{trx__ep_8c_add195a7e7ca41ed4f7b8e856b0aa6bd5}} 
\index{trx\_ep.c@{trx\_ep.c}!osmo\_trx\_ep\_set\_name@{osmo\_trx\_ep\_set\_name}}
\index{osmo\_trx\_ep\_set\_name@{osmo\_trx\_ep\_set\_name}!trx\_ep.c@{trx\_ep.c}}
\doxysubsubsection{osmo\_trx\_ep\_set\_name()}
{\footnotesize\ttfamily int osmo\+\_\+trx\+\_\+ep\+\_\+set\+\_\+name (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+trx\+\_\+ep} $\ast$}]{ep,  }\item[{const char $\ast$}]{fmt,  }\item[{}]{... }\end{DoxyParamCaption})}



Set the name (log prefix) of the given instance, e.\+g. 

\char`\"{}phy0\char`\"{} 

References \textbf{ osmo\+\_\+trx\+\_\+ep\+::name}.

\mbox{\label{trx__ep_8c_aa359f74c1f9c4a0e33a1e45239356912}} 
\index{trx\_ep.c@{trx\_ep.c}!osmo\_trx\_ep\_set\_num\_chans@{osmo\_trx\_ep\_set\_num\_chans}}
\index{osmo\_trx\_ep\_set\_num\_chans@{osmo\_trx\_ep\_set\_num\_chans}!trx\_ep.c@{trx\_ep.c}}
\doxysubsubsection{osmo\_trx\_ep\_set\_num\_chans()}
{\footnotesize\ttfamily int osmo\+\_\+trx\+\_\+ep\+\_\+set\+\_\+num\+\_\+chans (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+trx\+\_\+ep} $\ast$}]{ep,  }\item[{unsigned int}]{num\+\_\+chans }\end{DoxyParamCaption})}



Change the number of channels; only valid before \doxyref{osmo\+\_\+trx\+\_\+ep\+\_\+open()}{p.}{trx__ep_8c_a11e2dbc3d472ed74e5bc0d52aeea9663}. 

\begin{DoxyReturn}{Returns}
0 on success; -\/EBUSY if the endpoint is already open or a ctrl socket from a previous \doxyref{osmo\+\_\+trx\+\_\+ep\+\_\+close()}{p.}{trx__ep_8c_a38607d3c25dfde685b0f779528455ef2} is still flushing (see \doxyref{osmo\+\_\+trx\+\_\+ep\+\_\+is\+\_\+closing()}{p.}{trx__ep_8c_a4dd846461e53e491fbddf829fefcb263}); -\/EINVAL if num\+\_\+chans is 0; -\/ENOMEM on allocation failure 
\end{DoxyReturn}


References \textbf{ osmo\+\_\+trx\+\_\+ep\+::chans}, \textbf{ osmo\+\_\+trx\+\_\+ep\+::flags}, \textbf{ osmo\+\_\+trx\+\_\+ep\+::num\+\_\+chans}, \textbf{ OSMO\+\_\+\+TRX\+\_\+\+EP\+\_\+\+F\+\_\+\+OPEN}, \textbf{ osmo\+\_\+trx\+\_\+ep\+\_\+is\+\_\+closing()}, and \textbf{ trx\+\_\+ep\+\_\+chan\+\_\+init()}.



Referenced by \textbf{ osmo\+\_\+trx\+\_\+ep\+\_\+alloc()}.

\mbox{\label{trx__ep_8c_a625a97dcfb59c97f2417bb51eedfeaff}} 
\index{trx\_ep.c@{trx\_ep.c}!osmo\_trx\_ep\_set\_pdu\_batch@{osmo\_trx\_ep\_set\_pdu\_batch}}
\index{osmo\_trx\_ep\_set\_pdu\_batch@{osmo\_trx\_ep\_set\_pdu\_batch}!trx\_ep.c@{trx\_ep.c}}
\doxysubsubsection{osmo\_trx\_ep\_set\_pdu\_batch()}
{\footnotesize\ttfamily void osmo\+\_\+trx\+\_\+ep\+\_\+set\+\_\+pdu\+\_\+batch (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+trx\+\_\+ep} $\ast$}]{ep,  }\item[{bool}]{enable }\end{DoxyParamCaption})}



Enable/disable batching BURST.\+ind/req PDUs on the data sockets (default\+: true)\+: when enabled and TRXDv2 (or higher) is negotiated on a channel, a TDMA frame\textquotesingle{}s worth of PDUs is accumulated and sent in a single datagram (see \doxyref{osmo\+\_\+trx\+\_\+ep\+\_\+send\+\_\+burst\+\_\+ind()}{p.}{trx__ep_8c_a680a6a5e9c36ec796583776da9f15166}/\+\_\+req()); when disabled, every PDU is sent in its own datagram regardless of the negotiated TRXD PDU version, trading datagram count for latency. 

May be changed at any time. 

References \textbf{ osmo\+\_\+trx\+\_\+ep\+::flags}, and \textbf{ OSMO\+\_\+\+TRX\+\_\+\+EP\+\_\+\+F\+\_\+\+NO\+\_\+\+PDU\+\_\+\+BATCH}.

\mbox{\label{trx__ep_8c_a95baa5ab99126758b1c4275584c286d3}} 
\index{trx\_ep.c@{trx\_ep.c}!osmo\_trx\_ep\_set\_pdu\_ver@{osmo\_trx\_ep\_set\_pdu\_ver}}
\index{osmo\_trx\_ep\_set\_pdu\_ver@{osmo\_trx\_ep\_set\_pdu\_ver}!trx\_ep.c@{trx\_ep.c}}
\doxysubsubsection{osmo\_trx\_ep\_set\_pdu\_ver()}
{\footnotesize\ttfamily int osmo\+\_\+trx\+\_\+ep\+\_\+set\+\_\+pdu\+\_\+ver (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+trx\+\_\+ep} $\ast$}]{ep,  }\item[{unsigned int}]{chan,  }\item[{uint8\+\_\+t}]{ver }\end{DoxyParamCaption})}



Set the TRXD PDU version in use for the given channel (default\+: 0), usually after the negotiation (see \doxyref{osmo\+\_\+trxc\+\_\+client\+\_\+negotiate\+\_\+format()}{p.}{trxc__client_8h_ab31f5fca2e000ebac042384251349e24}) 

Per-\/channel TRXD PDU version in use (set after SETFORMAT negotiation) 

References \textbf{ osmo\+\_\+trx\+\_\+ep\+::chans}, \textbf{ LOGEPCH}, \textbf{ osmo\+\_\+trx\+\_\+ep\+::num\+\_\+chans}, \textbf{ OSMO\+\_\+\+TRXD\+\_\+\+PDU\+\_\+\+VER\+\_\+\+MAX}, and \textbf{ osmo\+\_\+trx\+\_\+ep\+\_\+chan\+::pdu\+\_\+ver}.

\mbox{\label{trx__ep_8c_ac1121eccd4cb8b10220aaa765cd76ff5}} 
\index{trx\_ep.c@{trx\_ep.c}!osmo\_trx\_ep\_set\_priv@{osmo\_trx\_ep\_set\_priv}}
\index{osmo\_trx\_ep\_set\_priv@{osmo\_trx\_ep\_set\_priv}!trx\_ep.c@{trx\_ep.c}}
\doxysubsubsection{osmo\_trx\_ep\_set\_priv()}
{\footnotesize\ttfamily void osmo\+\_\+trx\+\_\+ep\+\_\+set\+\_\+priv (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+trx\+\_\+ep} $\ast$}]{ep,  }\item[{void $\ast$}]{priv }\end{DoxyParamCaption})}



Set the application-\/private data. 



References \textbf{ osmo\+\_\+trx\+\_\+ep\+::priv}.

\mbox{\label{trx__ep_8c_ad9d930621e1a5f5ed361db6fe74e0c7d}} 
\index{trx\_ep.c@{trx\_ep.c}!osmo\_trx\_ep\_set\_raddr@{osmo\_trx\_ep\_set\_raddr}}
\index{osmo\_trx\_ep\_set\_raddr@{osmo\_trx\_ep\_set\_raddr}!trx\_ep.c@{trx\_ep.c}}
\doxysubsubsection{osmo\_trx\_ep\_set\_raddr()}
{\footnotesize\ttfamily int osmo\+\_\+trx\+\_\+ep\+\_\+set\+\_\+raddr (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+trx\+\_\+ep} $\ast$}]{ep,  }\item[{const char $\ast$}]{addr }\end{DoxyParamCaption})}



Set the remote IP address (copied) 



References \textbf{ osmo\+\_\+trx\+\_\+ep\+::flags}, \textbf{ OSMO\+\_\+\+TRX\+\_\+\+EP\+\_\+\+F\+\_\+\+OPEN}, and \textbf{ osmo\+\_\+trx\+\_\+ep\+::raddr}.

\mbox{\label{trx__ep_8c_aede409cb6aec0c54d1a388343b4504b3}} 
\index{trx\_ep.c@{trx\_ep.c}!trx\_ep\_chan\_close@{trx\_ep\_chan\_close}}
\index{trx\_ep\_chan\_close@{trx\_ep\_chan\_close}!trx\_ep.c@{trx\_ep.c}}
\doxysubsubsection{trx\_ep\_chan\_close()}
{\footnotesize\ttfamily static void trx\+\_\+ep\+\_\+chan\+\_\+close (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+trx\+\_\+ep\+\_\+chan} $\ast$}]{chan }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}



References \textbf{ osmo\+\_\+trx\+\_\+ep\+\_\+chan\+::data\+\_\+iofd}, \textbf{ trx\+\_\+ep\+\_\+ctrl\+\_\+close()}, and \textbf{ osmo\+\_\+trx\+\_\+ep\+\_\+chan\+::tx\+\_\+msg}.



Referenced by \textbf{ osmo\+\_\+trx\+\_\+ep\+\_\+close()}.

\mbox{\label{trx__ep_8c_aca232fc0d75259a905744eb47d05d044}} 
\index{trx\_ep.c@{trx\_ep.c}!trx\_ep\_chan\_init@{trx\_ep\_chan\_init}}
\index{trx\_ep\_chan\_init@{trx\_ep\_chan\_init}!trx\_ep.c@{trx\_ep.c}}
\doxysubsubsection{trx\_ep\_chan\_init()}
{\footnotesize\ttfamily static void trx\+\_\+ep\+\_\+chan\+\_\+init (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+trx\+\_\+ep\+\_\+chan} $\ast$}]{chan,  }\item[{struct \textbf{ osmo\+\_\+trx\+\_\+ep} $\ast$}]{ep,  }\item[{unsigned int}]{num }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}



References \textbf{ osmo\+\_\+trx\+\_\+ep\+\_\+chan\+::ep}, and \textbf{ osmo\+\_\+trx\+\_\+ep\+\_\+chan\+::num}.



Referenced by \textbf{ osmo\+\_\+trx\+\_\+ep\+\_\+set\+\_\+num\+\_\+chans()}.

\mbox{\label{trx__ep_8c_a9844e7a1e69a09cf770609039d8dd38b}} 
\index{trx\_ep.c@{trx\_ep.c}!trx\_ep\_chan\_open@{trx\_ep\_chan\_open}}
\index{trx\_ep\_chan\_open@{trx\_ep\_chan\_open}!trx\_ep.c@{trx\_ep.c}}
\doxysubsubsection{trx\_ep\_chan\_open()}
{\footnotesize\ttfamily static int trx\+\_\+ep\+\_\+chan\+\_\+open (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+trx\+\_\+ep\+\_\+chan} $\ast$}]{chan }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}



References \textbf{ osmo\+\_\+trx\+\_\+ep\+\_\+chan\+::ctrl\+\_\+iofd}, \textbf{ osmo\+\_\+trx\+\_\+ep\+\_\+chan\+::ctrl\+\_\+peer}, \textbf{ osmo\+\_\+trx\+\_\+ep\+\_\+chan\+::data\+\_\+iofd}, \textbf{ osmo\+\_\+trx\+\_\+ep\+\_\+chan\+::ep}, \textbf{ osmo\+\_\+trx\+\_\+ep\+::flags}, \textbf{ LOGEPCH}, \textbf{ osmo\+\_\+trx\+\_\+ep\+\_\+chan\+::num}, \textbf{ OSMO\+\_\+\+TRX\+\_\+\+EP\+\_\+\+F\+\_\+\+CTRL\+\_\+\+PROMISC}, \textbf{ OSMO\+\_\+\+TRXC\+\_\+\+MSG\+\_\+\+BUF\+\_\+\+SIZE}, \textbf{ trx\+\_\+ep\+\_\+ctrl\+\_\+ioops}, \textbf{ TRX\+\_\+\+EP\+\_\+\+DATA\+\_\+\+BUF\+\_\+\+SIZE}, \textbf{ trx\+\_\+ep\+\_\+data\+\_\+ioops}, and \textbf{ trx\+\_\+ep\+\_\+open\+\_\+iofd()}.



Referenced by \textbf{ osmo\+\_\+trx\+\_\+ep\+\_\+open()}.

\mbox{\label{trx__ep_8c_a10aea2fc96dd6d8dba60fe4d4f7165e7}} 
\index{trx\_ep.c@{trx\_ep.c}!trx\_ep\_clck\_read\_cb@{trx\_ep\_clck\_read\_cb}}
\index{trx\_ep\_clck\_read\_cb@{trx\_ep\_clck\_read\_cb}!trx\_ep.c@{trx\_ep.c}}
\doxysubsubsection{trx\_ep\_clck\_read\_cb()}
{\footnotesize\ttfamily static void trx\+\_\+ep\+\_\+clck\+\_\+read\+\_\+cb (\begin{DoxyParamCaption}\item[{struct osmo\+\_\+io\+\_\+fd $\ast$}]{iofd,  }\item[{int}]{res,  }\item[{struct msgb $\ast$}]{msg }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}



References \textbf{ LOGEP}, \textbf{ osmo\+\_\+trx\+\_\+ep\+\_\+rx\+\_\+clck\+\_\+ind()}, and \textbf{ osmo\+\_\+trxc\+\_\+clock\+\_\+ind\+\_\+parse()}.

\mbox{\label{trx__ep_8c_ac3a21ac397090bf281e267e251fdd840}} 
\index{trx\_ep.c@{trx\_ep.c}!trx\_ep\_ctrl\_close@{trx\_ep\_ctrl\_close}}
\index{trx\_ep\_ctrl\_close@{trx\_ep\_ctrl\_close}!trx\_ep.c@{trx\_ep.c}}
\doxysubsubsection{trx\_ep\_ctrl\_close()}
{\footnotesize\ttfamily static void trx\+\_\+ep\+\_\+ctrl\+\_\+close (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+trx\+\_\+ep\+\_\+chan} $\ast$}]{chan }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}



References \textbf{ osmo\+\_\+trx\+\_\+ep\+\_\+chan\+::ctrl\+\_\+iofd}, \textbf{ osmo\+\_\+trx\+\_\+ep\+\_\+chan\+::ctrl\+\_\+wr\+\_\+pending}, \textbf{ osmo\+\_\+trx\+\_\+ep\+\_\+chan\+::ep}, \textbf{ LOGEPCH}, \textbf{ osmo\+\_\+trx\+\_\+ep\+\_\+chan\+::num}, and \textbf{ trx\+\_\+ep\+\_\+ctrl\+\_\+close\+\_\+ioops}.



Referenced by \textbf{ trx\+\_\+ep\+\_\+chan\+\_\+close()}.

\mbox{\label{trx__ep_8c_a95a1b2d00959f07310a495e4823c8c94}} 
\index{trx\_ep.c@{trx\_ep.c}!trx\_ep\_ctrl\_close\_sendto\_cb@{trx\_ep\_ctrl\_close\_sendto\_cb}}
\index{trx\_ep\_ctrl\_close\_sendto\_cb@{trx\_ep\_ctrl\_close\_sendto\_cb}!trx\_ep.c@{trx\_ep.c}}
\doxysubsubsection{trx\_ep\_ctrl\_close\_sendto\_cb()}
{\footnotesize\ttfamily static void trx\+\_\+ep\+\_\+ctrl\+\_\+close\+\_\+sendto\+\_\+cb (\begin{DoxyParamCaption}\item[{struct osmo\+\_\+io\+\_\+fd $\ast$}]{iofd,  }\item[{int}]{res,  }\item[{struct msgb $\ast$}]{msg,  }\item[{const struct osmo\+\_\+sockaddr $\ast$}]{daddr }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}



Write call-\/back for a channel\textquotesingle{}s ctrl\+\_\+iofd while it is being flushed asynchronously after \doxyref{osmo\+\_\+trx\+\_\+ep\+\_\+close()}{p.}{trx__ep_8c_a38607d3c25dfde685b0f779528455ef2}\+: a \textquotesingle{}goodbye\textquotesingle{} TRXC message (e.\+g. 

\char`\"{}\+CMD POWEROFF\char`\"{}) may have been enqueued via \doxyref{osmo\+\_\+trx\+\_\+ep\+\_\+send\+\_\+ctrl\+\_\+msg()}{p.}{trx__ep_8c_a4f2334ef1db2595cae932524de6c7f0f} right before tearing down the endpoint; osmo\+\_\+iofd\+\_\+free() would otherwise drop it together with the (now pointless) rest of the Tx queue. Keeps waiting until every byte enqueued on it has actually completed (or a write fails), then frees the iofd and, if \doxyref{osmo\+\_\+trx\+\_\+ep\+\_\+free()}{p.}{trx__ep_8c_afd3eb8dd5df6f258982203c4feeedb18} was called on the (kept alive) endpoint in the meantime and no other channel is still flushing, finally frees the endpoint too. 

References \textbf{ osmo\+\_\+trx\+\_\+ep\+::closed\+\_\+cb}, \textbf{ osmo\+\_\+trx\+\_\+ep\+\_\+chan\+::ctrl\+\_\+iofd}, \textbf{ osmo\+\_\+trx\+\_\+ep\+\_\+chan\+::ctrl\+\_\+wr\+\_\+pending}, \textbf{ osmo\+\_\+trx\+\_\+ep\+\_\+chan\+::ep}, \textbf{ osmo\+\_\+trx\+\_\+ep\+::flags}, \textbf{ LOGEP}, \textbf{ LOGEPCH}, \textbf{ osmo\+\_\+trx\+\_\+ep\+\_\+chan\+::num}, \textbf{ OSMO\+\_\+\+TRX\+\_\+\+EP\+\_\+\+F\+\_\+\+PENDING\+\_\+\+FREE}, and \textbf{ osmo\+\_\+trx\+\_\+ep\+\_\+is\+\_\+closing()}.

\mbox{\label{trx__ep_8c_a653378d12902ff75f0c6fa2e25620650}} 
\index{trx\_ep.c@{trx\_ep.c}!trx\_ep\_ctrl\_recvfrom\_cb@{trx\_ep\_ctrl\_recvfrom\_cb}}
\index{trx\_ep\_ctrl\_recvfrom\_cb@{trx\_ep\_ctrl\_recvfrom\_cb}!trx\_ep.c@{trx\_ep.c}}
\doxysubsubsection{trx\_ep\_ctrl\_recvfrom\_cb()}
{\footnotesize\ttfamily static void trx\+\_\+ep\+\_\+ctrl\+\_\+recvfrom\+\_\+cb (\begin{DoxyParamCaption}\item[{struct osmo\+\_\+io\+\_\+fd $\ast$}]{iofd,  }\item[{int}]{res,  }\item[{struct msgb $\ast$}]{msg,  }\item[{const struct osmo\+\_\+sockaddr $\ast$}]{saddr }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}



References \textbf{ osmo\+\_\+trx\+\_\+ep\+\_\+chan\+::ctrl\+\_\+peer}, \textbf{ osmo\+\_\+trx\+\_\+ep\+\_\+chan\+::ep}, \textbf{ LOGEPCH}, \textbf{ osmo\+\_\+trx\+\_\+ep\+\_\+chan\+::num}, \textbf{ osmo\+\_\+trx\+\_\+ep\+\_\+rx\+\_\+ctrl\+\_\+msg()}, and \textbf{ osmo\+\_\+trxc\+\_\+msg\+\_\+parse()}.

\mbox{\label{trx__ep_8c_aa54554554e0bbb5b009ac65f818709fd}} 
\index{trx\_ep.c@{trx\_ep.c}!trx\_ep\_ctrl\_sendto\_cb@{trx\_ep\_ctrl\_sendto\_cb}}
\index{trx\_ep\_ctrl\_sendto\_cb@{trx\_ep\_ctrl\_sendto\_cb}!trx\_ep.c@{trx\_ep.c}}
\doxysubsubsection{trx\_ep\_ctrl\_sendto\_cb()}
{\footnotesize\ttfamily static void trx\+\_\+ep\+\_\+ctrl\+\_\+sendto\+\_\+cb (\begin{DoxyParamCaption}\item[{struct osmo\+\_\+io\+\_\+fd $\ast$}]{iofd,  }\item[{int}]{res,  }\item[{struct msgb $\ast$}]{msg,  }\item[{const struct osmo\+\_\+sockaddr $\ast$}]{daddr }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}



References \textbf{ osmo\+\_\+trx\+\_\+ep\+\_\+chan\+::ctrl\+\_\+wr\+\_\+pending}, \textbf{ osmo\+\_\+trx\+\_\+ep\+\_\+chan\+::ep}, \textbf{ LOGEPCH}, and \textbf{ osmo\+\_\+trx\+\_\+ep\+\_\+chan\+::num}.

\mbox{\label{trx__ep_8c_a62e8793008ac6393ec697305c247d8e8}} 
\index{trx\_ep.c@{trx\_ep.c}!trx\_ep\_data\_read\_cb@{trx\_ep\_data\_read\_cb}}
\index{trx\_ep\_data\_read\_cb@{trx\_ep\_data\_read\_cb}!trx\_ep.c@{trx\_ep.c}}
\doxysubsubsection{trx\_ep\_data\_read\_cb()}
{\footnotesize\ttfamily static void trx\+\_\+ep\+\_\+data\+\_\+read\+\_\+cb (\begin{DoxyParamCaption}\item[{struct osmo\+\_\+io\+\_\+fd $\ast$}]{iofd,  }\item[{int}]{res,  }\item[{struct msgb $\ast$}]{msg }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}



References \textbf{ osmo\+\_\+trx\+\_\+ep\+\_\+chan\+::ep}, \textbf{ LOGEPCH}, \textbf{ osmo\+\_\+trx\+\_\+ep\+::mode}, \textbf{ osmo\+\_\+trx\+\_\+ep\+\_\+chan\+::num}, \textbf{ OSMO\+\_\+\+TRX\+\_\+\+EP\+\_\+\+MODE\+\_\+\+L1}, \textbf{ osmo\+\_\+trx\+\_\+ep\+\_\+rx\+\_\+burst\+\_\+ind()}, \textbf{ osmo\+\_\+trx\+\_\+ep\+\_\+rx\+\_\+burst\+\_\+req()}, \textbf{ osmo\+\_\+trxd\+\_\+burst\+\_\+ind\+\_\+parse()}, \textbf{ osmo\+\_\+trxd\+\_\+burst\+\_\+req\+\_\+parse()}, and \textbf{ osmo\+\_\+trxd\+\_\+parse\+\_\+state\+\_\+init()}.

\mbox{\label{trx__ep_8c_a5bf45cd3d3a4e4fe020b0a0dda66830a}} 
\index{trx\_ep.c@{trx\_ep.c}!trx\_ep\_data\_tx\_flush@{trx\_ep\_data\_tx\_flush}}
\index{trx\_ep\_data\_tx\_flush@{trx\_ep\_data\_tx\_flush}!trx\_ep.c@{trx\_ep.c}}
\doxysubsubsection{trx\_ep\_data\_tx\_flush()}
{\footnotesize\ttfamily static int trx\+\_\+ep\+\_\+data\+\_\+tx\+\_\+flush (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+trx\+\_\+ep\+\_\+chan} $\ast$}]{c }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}



Flush a channel\textquotesingle{}s pending Tx batching buffer\+: write the accumulated msgb to the data socket and clear c-\/$>$tx\+\_\+msg. 

Shared by \doxyref{osmo\+\_\+trx\+\_\+ep\+\_\+send\+\_\+burst\+\_\+fin()}{p.}{trx__ep_8c_a8195eca01fcf74e4f227872174fa8a4e} and the immediate (non-\/batched, TRXDv0/v1) send path. 

References \textbf{ osmo\+\_\+trx\+\_\+ep\+\_\+chan\+::data\+\_\+iofd}, \textbf{ osmo\+\_\+trxd\+\_\+build\+\_\+fin()}, \textbf{ osmo\+\_\+trx\+\_\+ep\+\_\+chan\+::pdu\+\_\+ver}, and \textbf{ osmo\+\_\+trx\+\_\+ep\+\_\+chan\+::tx\+\_\+msg}.



Referenced by \textbf{ osmo\+\_\+trx\+\_\+ep\+\_\+send\+\_\+burst\+\_\+fin()}, \textbf{ osmo\+\_\+trx\+\_\+ep\+\_\+send\+\_\+burst\+\_\+ind()}, and \textbf{ osmo\+\_\+trx\+\_\+ep\+\_\+send\+\_\+burst\+\_\+req()}.

\mbox{\label{trx__ep_8c_a6665f00f096b82c62ccb75e35e046af2}} 
\index{trx\_ep.c@{trx\_ep.c}!trx\_ep\_open\_iofd@{trx\_ep\_open\_iofd}}
\index{trx\_ep\_open\_iofd@{trx\_ep\_open\_iofd}!trx\_ep.c@{trx\_ep.c}}
\doxysubsubsection{trx\_ep\_open\_iofd()}
{\footnotesize\ttfamily static struct osmo\+\_\+io\+\_\+fd $\ast$ trx\+\_\+ep\+\_\+open\+\_\+iofd (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+trx\+\_\+ep} $\ast$}]{ep,  }\item[{uint16\+\_\+t}]{ofs,  }\item[{const struct osmo\+\_\+io\+\_\+ops $\ast$}]{ioops,  }\item[{enum osmo\+\_\+io\+\_\+fd\+\_\+mode}]{mode,  }\item[{unsigned int}]{buf\+\_\+size,  }\item[{void $\ast$}]{data,  }\item[{bool}]{connect\+\_\+socket }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}



References \textbf{ osmo\+\_\+trx\+\_\+ep\+::laddr}, \textbf{ LOGEP}, \textbf{ osmo\+\_\+trx\+\_\+ep\+::raddr}, and \textbf{ trx\+\_\+ep\+\_\+port()}.



Referenced by \textbf{ osmo\+\_\+trx\+\_\+ep\+\_\+open()}, and \textbf{ trx\+\_\+ep\+\_\+chan\+\_\+open()}.

\mbox{\label{trx__ep_8c_ae01cc2be1634f7352ca1b53363db37f1}} 
\index{trx\_ep.c@{trx\_ep.c}!trx\_ep\_port@{trx\_ep\_port}}
\index{trx\_ep\_port@{trx\_ep\_port}!trx\_ep.c@{trx\_ep.c}}
\doxysubsubsection{trx\_ep\_port()}
{\footnotesize\ttfamily static uint16\+\_\+t trx\+\_\+ep\+\_\+port (\begin{DoxyParamCaption}\item[{const struct \textbf{ osmo\+\_\+trx\+\_\+ep} $\ast$}]{ep,  }\item[{bool}]{local,  }\item[{uint16\+\_\+t}]{ofs }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}



References \textbf{ osmo\+\_\+trx\+\_\+ep\+::base\+\_\+port}, \textbf{ osmo\+\_\+trx\+\_\+ep\+\_\+chan\+::ep}, \textbf{ osmo\+\_\+trx\+\_\+ep\+::mode}, \textbf{ OSMO\+\_\+\+TRX\+\_\+\+EP\+\_\+\+MODE\+\_\+\+L1}, and \textbf{ TRX\+\_\+\+EP\+\_\+\+L1\+\_\+\+PORT\+\_\+\+OFS}.



Referenced by \textbf{ osmo\+\_\+trx\+\_\+ep\+\_\+close()}, \textbf{ osmo\+\_\+trx\+\_\+ep\+\_\+open()}, and \textbf{ trx\+\_\+ep\+\_\+open\+\_\+iofd()}.

\mbox{\label{trx__ep_8c_a4bd3145ae8fc0fb9b309315bb6d03997}} 
\index{trx\_ep.c@{trx\_ep.c}!trx\_ep\_write\_cb@{trx\_ep\_write\_cb}}
\index{trx\_ep\_write\_cb@{trx\_ep\_write\_cb}!trx\_ep.c@{trx\_ep.c}}
\doxysubsubsection{trx\_ep\_write\_cb()}
{\footnotesize\ttfamily static void trx\+\_\+ep\+\_\+write\+\_\+cb (\begin{DoxyParamCaption}\item[{struct osmo\+\_\+io\+\_\+fd $\ast$}]{iofd,  }\item[{int}]{res,  }\item[{struct msgb $\ast$}]{msg }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}



\doxysubsection{Variable Documentation}
\mbox{\label{trx__ep_8c_a9264bb74c977d6258f1140f9a145427a}} 
\index{trx\_ep.c@{trx\_ep.c}!trx\_ep\_clck\_ioops@{trx\_ep\_clck\_ioops}}
\index{trx\_ep\_clck\_ioops@{trx\_ep\_clck\_ioops}!trx\_ep.c@{trx\_ep.c}}
\doxysubsubsection{trx\_ep\_clck\_ioops}
{\footnotesize\ttfamily const struct osmo\+\_\+io\+\_\+ops trx\+\_\+ep\+\_\+clck\+\_\+ioops\hspace{0.3cm}{\ttfamily [static]}}

{\bfseries Initial value\+:}
\begin{DoxyCode}{0}
\DoxyCodeLine{= \{}
\DoxyCodeLine{        .read\_cb = \&trx\_ep\_clck\_read\_cb,}
\DoxyCodeLine{        .write\_cb = \&trx\_ep\_write\_cb,}
\DoxyCodeLine{\}}

\end{DoxyCode}


Referenced by \textbf{ osmo\+\_\+trx\+\_\+ep\+\_\+open()}.

\mbox{\label{trx__ep_8c_aa58a0018b5755343bd19b00e772e4a9d}} 
\index{trx\_ep.c@{trx\_ep.c}!trx\_ep\_ctrl\_close\_ioops@{trx\_ep\_ctrl\_close\_ioops}}
\index{trx\_ep\_ctrl\_close\_ioops@{trx\_ep\_ctrl\_close\_ioops}!trx\_ep.c@{trx\_ep.c}}
\doxysubsubsection{trx\_ep\_ctrl\_close\_ioops}
{\footnotesize\ttfamily const struct osmo\+\_\+io\+\_\+ops trx\+\_\+ep\+\_\+ctrl\+\_\+close\+\_\+ioops\hspace{0.3cm}{\ttfamily [static]}}

{\bfseries Initial value\+:}
\begin{DoxyCode}{0}
\DoxyCodeLine{= \{}
\DoxyCodeLine{        .sendto\_cb = \&trx\_ep\_ctrl\_close\_sendto\_cb,}
\DoxyCodeLine{\}}

\end{DoxyCode}


Referenced by \textbf{ trx\+\_\+ep\+\_\+ctrl\+\_\+close()}.

\mbox{\label{trx__ep_8c_aa8dc0002a9f5d16415a8cc1483b6f782}} 
\index{trx\_ep.c@{trx\_ep.c}!trx\_ep\_ctrl\_ioops@{trx\_ep\_ctrl\_ioops}}
\index{trx\_ep\_ctrl\_ioops@{trx\_ep\_ctrl\_ioops}!trx\_ep.c@{trx\_ep.c}}
\doxysubsubsection{trx\_ep\_ctrl\_ioops}
{\footnotesize\ttfamily const struct osmo\+\_\+io\+\_\+ops trx\+\_\+ep\+\_\+ctrl\+\_\+ioops\hspace{0.3cm}{\ttfamily [static]}}

{\bfseries Initial value\+:}
\begin{DoxyCode}{0}
\DoxyCodeLine{= \{}
\DoxyCodeLine{        .recvfrom\_cb = \&trx\_ep\_ctrl\_recvfrom\_cb,}
\DoxyCodeLine{        .sendto\_cb = \&trx\_ep\_ctrl\_sendto\_cb,}
\DoxyCodeLine{\}}

\end{DoxyCode}


Referenced by \textbf{ trx\+\_\+ep\+\_\+chan\+\_\+open()}.

\mbox{\label{trx__ep_8c_a0167e62e1fb6a4e55311c2cf73f05cc7}} 
\index{trx\_ep.c@{trx\_ep.c}!trx\_ep\_data\_ioops@{trx\_ep\_data\_ioops}}
\index{trx\_ep\_data\_ioops@{trx\_ep\_data\_ioops}!trx\_ep.c@{trx\_ep.c}}
\doxysubsubsection{trx\_ep\_data\_ioops}
{\footnotesize\ttfamily const struct osmo\+\_\+io\+\_\+ops trx\+\_\+ep\+\_\+data\+\_\+ioops\hspace{0.3cm}{\ttfamily [static]}}

{\bfseries Initial value\+:}
\begin{DoxyCode}{0}
\DoxyCodeLine{= \{}
\DoxyCodeLine{        .read\_cb = \&trx\_ep\_data\_read\_cb,}
\DoxyCodeLine{        .write\_cb = \&trx\_ep\_write\_cb,}
\DoxyCodeLine{\}}

\end{DoxyCode}


Referenced by \textbf{ trx\+\_\+ep\+\_\+chan\+\_\+open()}.

