\doxysection{Socket convenience functions}
\label{group__socket}\index{Socket convenience functions@{Socket convenience functions}}


Osmocom socket convenience functions.  


\doxysubsection*{Files}
\begin{DoxyCompactItemize}
\item 
file \textbf{ socket.\+h}
\begin{DoxyCompactList}\small\item\em Osmocom socket convenience functions. \end{DoxyCompactList}\item 
file \textbf{ socket.\+c}
\end{DoxyCompactItemize}
\doxysubsection*{Data Structures}
\begin{DoxyCompactItemize}
\item 
struct \textbf{ osmo\+\_\+sockaddr}
\item 
struct \textbf{ osmo\+\_\+sock\+\_\+init2\+\_\+multiaddr\+\_\+pars}
\end{DoxyCompactItemize}
\doxysubsection*{Macros}
\begin{DoxyCompactItemize}
\item 
\#define \textbf{ OSMO\+\_\+\+SOCK\+\_\+\+MAX\+\_\+\+ADDRS}~32
\begin{DoxyCompactList}\small\item\em maximum number of local or remote addresses supported by an osmo\+\_\+sock instance \end{DoxyCompactList}\item 
\#define \textbf{ OSMO\+\_\+\+SOCK\+\_\+\+NAME\+\_\+\+MAXLEN}~(2 + INET6\+\_\+\+ADDRSTRLEN + 1 + 5 + 3 + 2 + INET6\+\_\+\+ADDRSTRLEN + 1 + 5 + 1)
\begin{DoxyCompactList}\small\item\em maximum length of a socket name (\char`\"{}r=1.\+2.\+3.\+4\+:123$<$-\/$>$l=5.\+6.\+7.\+8\+:987\char`\"{}) \end{DoxyCompactList}\item 
\#define \textbf{ OSMO\+\_\+\+SOCK\+\_\+\+MULTIADDR\+\_\+\+PEER\+\_\+\+STR\+\_\+\+MAXLEN}~(INET6\+\_\+\+ADDRSTRLEN $\ast$ \textbf{ OSMO\+\_\+\+SOCK\+\_\+\+MAX\+\_\+\+ADDRS} + INET6\+\_\+\+ADDRSTRLEN + 2 + 6 + 1)
\begin{DoxyCompactList}\small\item\em maximum length of a multi-\/address socket peer (endpoint) name\+: (5.\+6.\+7.\+8$\vert$\+::9)\+:987 char \textquotesingle{}(\textquotesingle{} + OSMO\+\_\+\+STREAM\+\_\+\+MAX\+\_\+\+ADDRS -\/ 1 addr separators + chars \char`\"{})\+:\char`\"{} + port buffer + char \textquotesingle{}\textbackslash{}0\textquotesingle{} \end{DoxyCompactList}\item 
\#define \textbf{ OSMO\+\_\+\+SOCK\+\_\+\+MULTIADDR\+\_\+\+NAME\+\_\+\+MAXLEN}~(\textbf{ OSMO\+\_\+\+SOCK\+\_\+\+MULTIADDR\+\_\+\+PEER\+\_\+\+STR\+\_\+\+MAXLEN} + 7)
\begin{DoxyCompactList}\small\item\em maximum length of a multia-\/address socket name (\char`\"{}r=(\+::2$\vert$1.\+2.\+3.\+4)\+:123$<$-\/$>$l=(5.\+6.\+7.\+8$\vert$\+::9)\+:987\char`\"{}) \end{DoxyCompactList}\item 
\#define \textbf{ OSMO\+\_\+\+SOCK\+\_\+\+F\+\_\+\+CONNECT}~(1 $<$$<$ 0)
\begin{DoxyCompactList}\small\item\em connect the socket to a remote peer \end{DoxyCompactList}\item 
\#define \textbf{ OSMO\+\_\+\+SOCK\+\_\+\+F\+\_\+\+BIND}~(1 $<$$<$ 1)
\begin{DoxyCompactList}\small\item\em bind the socket to a local address/port \end{DoxyCompactList}\item 
\#define \textbf{ OSMO\+\_\+\+SOCK\+\_\+\+F\+\_\+\+NONBLOCK}~(1 $<$$<$ 2)
\begin{DoxyCompactList}\small\item\em switch socket to non-\/blocking mode \end{DoxyCompactList}\item 
\#define \textbf{ OSMO\+\_\+\+SOCK\+\_\+\+F\+\_\+\+NO\+\_\+\+MCAST\+\_\+\+LOOP}~(1 $<$$<$ 3)
\begin{DoxyCompactList}\small\item\em disable multiast loop (IP\+\_\+\+MULTICAST\+\_\+\+LOOP) \end{DoxyCompactList}\item 
\#define \textbf{ OSMO\+\_\+\+SOCK\+\_\+\+F\+\_\+\+NO\+\_\+\+MCAST\+\_\+\+ALL}~(1 $<$$<$ 4)
\begin{DoxyCompactList}\small\item\em disable receiving all multiast even for non-\/subscribed groups \end{DoxyCompactList}\item 
\#define \textbf{ OSMO\+\_\+\+SOCK\+\_\+\+F\+\_\+\+UDP\+\_\+\+REUSEADDR}~(1 $<$$<$ 5)
\begin{DoxyCompactList}\small\item\em use SO\+\_\+\+REUSEADDR on UDP ports (required for multicast) \end{DoxyCompactList}\item 
\#define \textbf{ OSMO\+\_\+\+SOCK\+\_\+\+F\+\_\+\+DSCP}(\textbf{ x})~(((\textbf{ x})\&0x3f) $<$$<$ 24)
\begin{DoxyCompactList}\small\item\em use \doxyref{OSMO\+\_\+\+SOCK\+\_\+\+F\+\_\+\+DSCP(x)}{p.}{group__socket_ga6f3cbc5dea1ebecd6a4312ea65666627} to set IP DSCP \textquotesingle{}x\textquotesingle{} for packets transmitted on the socket \end{DoxyCompactList}\item 
\#define \textbf{ GET\+\_\+\+OSMO\+\_\+\+SOCK\+\_\+\+F\+\_\+\+DSCP}(f)~(((f) $>$$>$ 24) \& 0x3f)
\item 
\#define \textbf{ OSMO\+\_\+\+SOCK\+\_\+\+F\+\_\+\+PRIO}(\textbf{ x})~(((\textbf{ x})\&0xff) $<$$<$ 16)
\begin{DoxyCompactList}\small\item\em use \doxyref{OSMO\+\_\+\+SOCK\+\_\+\+F\+\_\+\+PRIO(x)}{p.}{group__socket_ga3d96505ab56ed6051eca99ab76f16ca3} to set priority \textquotesingle{}x\textquotesingle{} for packets transmitted on the socket \end{DoxyCompactList}\item 
\#define \textbf{ GET\+\_\+\+OSMO\+\_\+\+SOCK\+\_\+\+F\+\_\+\+PRIO}(f)~(((f) $>$$>$ 16) \& 0xff)
\end{DoxyCompactItemize}
\doxysubsection*{Functions}
\begin{DoxyCompactItemize}
\item 
int \textbf{ osmo\+\_\+sockaddr\+\_\+is\+\_\+local} (struct sockaddr $\ast$addr, unsigned int addrlen)
\item 
int \textbf{ osmo\+\_\+sockaddr\+\_\+is\+\_\+any} (const struct \textbf{ osmo\+\_\+sockaddr} $\ast$addr)
\item 
static socklen\+\_\+t \textbf{ osmo\+\_\+sockaddr\+\_\+size} (const struct \textbf{ osmo\+\_\+sockaddr} $\ast$addr)
\begin{DoxyCompactList}\small\item\em Return the size of the variant used in the address NOTE\+: This does not return the size of the in\{,6\}\+\_\+addr, but rather the size of the surrounding sockaddr\+\_\+in\{,6\}. \end{DoxyCompactList}\item 
unsigned int \textbf{ osmo\+\_\+sockaddr\+\_\+to\+\_\+str\+\_\+and\+\_\+uint} (char $\ast$addr, unsigned int addr\+\_\+len, uint16\+\_\+t $\ast$port, const struct sockaddr $\ast$sa)
\item 
size\+\_\+t \textbf{ osmo\+\_\+sockaddr\+\_\+in\+\_\+to\+\_\+str\+\_\+and\+\_\+uint} (char $\ast$addr, unsigned int addr\+\_\+len, uint16\+\_\+t $\ast$port, const struct sockaddr\+\_\+in $\ast$sin)
\item 
const char $\ast$ \textbf{ osmo\+\_\+sockaddr\+\_\+ntop} (const struct sockaddr $\ast$sa, char $\ast$dst)
\item 
uint16\+\_\+t \textbf{ osmo\+\_\+sockaddr\+\_\+port} (const struct sockaddr $\ast$sa)
\item 
void \textbf{ osmo\+\_\+sockaddr\+\_\+set\+\_\+port} (struct sockaddr $\ast$sa, uint16\+\_\+t port)
\item 
int \textbf{ osmo\+\_\+sockaddr\+\_\+local\+\_\+ip} (struct \textbf{ osmo\+\_\+sockaddr} $\ast$local\+\_\+ip, const struct \textbf{ osmo\+\_\+sockaddr} $\ast$remote\+\_\+ip)
\item 
int \textbf{ osmo\+\_\+sockaddr\+\_\+cmp} (const struct \textbf{ osmo\+\_\+sockaddr} $\ast$a, const struct \textbf{ osmo\+\_\+sockaddr} $\ast$b)
\item 
int \textbf{ osmo\+\_\+sockaddr\+\_\+to\+\_\+octets} (uint8\+\_\+t $\ast$dst, size\+\_\+t dst\+\_\+maxlen, const struct \textbf{ osmo\+\_\+sockaddr} $\ast$os)
\item 
int \textbf{ osmo\+\_\+sockaddr\+\_\+from\+\_\+octets} (struct \textbf{ osmo\+\_\+sockaddr} $\ast$os, const void $\ast$src, size\+\_\+t src\+\_\+len)
\item 
int \textbf{ osmo\+\_\+sockaddr\+\_\+from\+\_\+str\+\_\+and\+\_\+uint} (struct \textbf{ osmo\+\_\+sockaddr} $\ast$osa\+\_\+out, const char $\ast$ipstr, uint16\+\_\+t port)
\item 
int \textbf{ osmo\+\_\+sockaddr\+\_\+netmask\+\_\+to\+\_\+prefixlen} (const struct \textbf{ osmo\+\_\+sockaddr} $\ast$addr)
\item 
const char $\ast$ \textbf{ osmo\+\_\+sockaddr\+\_\+to\+\_\+str} (const struct \textbf{ osmo\+\_\+sockaddr} $\ast$sockaddr)
\item 
char $\ast$ \textbf{ osmo\+\_\+sockaddr\+\_\+to\+\_\+str\+\_\+buf} (char $\ast$buf, size\+\_\+t buf\+\_\+len, const struct \textbf{ osmo\+\_\+sockaddr} $\ast$sockaddr)
\item 
int \textbf{ osmo\+\_\+sockaddr\+\_\+to\+\_\+str\+\_\+buf2} (char $\ast$buf, size\+\_\+t buf\+\_\+len, const struct \textbf{ osmo\+\_\+sockaddr} $\ast$sockaddr)
\item 
char $\ast$ \textbf{ osmo\+\_\+sockaddr\+\_\+to\+\_\+str\+\_\+c} (void $\ast$ctx, const struct \textbf{ osmo\+\_\+sockaddr} $\ast$sockaddr)
\item 
int \textbf{ osmo\+\_\+sock\+\_\+init} (uint16\+\_\+t family, uint16\+\_\+t \textbf{ type}, uint8\+\_\+t \textbf{ proto}, const char $\ast$\textbf{ host}, uint16\+\_\+t port, unsigned int \textbf{ flags})
\item 
int \textbf{ osmo\+\_\+sock\+\_\+init2} (uint16\+\_\+t family, uint16\+\_\+t \textbf{ type}, uint8\+\_\+t \textbf{ proto}, const char $\ast$local\+\_\+host, uint16\+\_\+t local\+\_\+port, const char $\ast$remote\+\_\+host, uint16\+\_\+t remote\+\_\+port, unsigned int \textbf{ flags})
\item 
int \textbf{ osmo\+\_\+sock\+\_\+init2\+\_\+multiaddr} (uint16\+\_\+t family, uint16\+\_\+t \textbf{ type}, uint8\+\_\+t \textbf{ proto}, const char $\ast$$\ast$local\+\_\+hosts, size\+\_\+t local\+\_\+hosts\+\_\+cnt, uint16\+\_\+t local\+\_\+port, const char $\ast$$\ast$remote\+\_\+hosts, size\+\_\+t remote\+\_\+hosts\+\_\+cnt, uint16\+\_\+t remote\+\_\+port, unsigned int \textbf{ flags}) \textbf{ OSMO\+\_\+\+DEPRECATED\+\_\+\+OUTSIDE}(\char`\"{}Use \textbf{ osmo\+\_\+sock\+\_\+init2\+\_\+multiaddr2}() \textbf{ instead}\char`\"{})
\item 
int \textbf{ osmo\+\_\+sock\+\_\+init2\+\_\+multiaddr2} (uint16\+\_\+t family, uint16\+\_\+t \textbf{ type}, uint8\+\_\+t \textbf{ proto}, const char $\ast$$\ast$local\+\_\+hosts, size\+\_\+t local\+\_\+hosts\+\_\+cnt, uint16\+\_\+t local\+\_\+port, const char $\ast$$\ast$remote\+\_\+hosts, size\+\_\+t remote\+\_\+hosts\+\_\+cnt, uint16\+\_\+t remote\+\_\+port, unsigned int \textbf{ flags}, struct \textbf{ osmo\+\_\+sock\+\_\+init2\+\_\+multiaddr\+\_\+pars} $\ast$pars)
\item 
int \textbf{ osmo\+\_\+sock\+\_\+init\+\_\+osa} (uint16\+\_\+t \textbf{ type}, uint8\+\_\+t \textbf{ proto}, const struct \textbf{ osmo\+\_\+sockaddr} $\ast$local, const struct \textbf{ osmo\+\_\+sockaddr} $\ast$remote, unsigned int \textbf{ flags})
\item 
int \textbf{ osmo\+\_\+sock\+\_\+init\+\_\+ofd} (struct \textbf{ osmo\+\_\+fd} $\ast$ofd, int family, int \textbf{ type}, int \textbf{ proto}, const char $\ast$\textbf{ host}, uint16\+\_\+t port, unsigned int \textbf{ flags})
\item 
int \textbf{ osmo\+\_\+sock\+\_\+init2\+\_\+ofd} (struct \textbf{ osmo\+\_\+fd} $\ast$ofd, int family, int \textbf{ type}, int \textbf{ proto}, const char $\ast$local\+\_\+host, uint16\+\_\+t local\+\_\+port, const char $\ast$remote\+\_\+host, uint16\+\_\+t remote\+\_\+port, unsigned int \textbf{ flags})
\item 
int \textbf{ osmo\+\_\+sock\+\_\+init\+\_\+osa\+\_\+ofd} (struct \textbf{ osmo\+\_\+fd} $\ast$ofd, int \textbf{ type}, int \textbf{ proto}, const struct \textbf{ osmo\+\_\+sockaddr} $\ast$local, const struct \textbf{ osmo\+\_\+sockaddr} $\ast$remote, unsigned int \textbf{ flags})
\item 
int \textbf{ osmo\+\_\+sock\+\_\+init\+\_\+sa} (struct sockaddr $\ast$ss, uint16\+\_\+t \textbf{ type}, uint8\+\_\+t \textbf{ proto}, unsigned int \textbf{ flags})
\item 
int \textbf{ osmo\+\_\+sock\+\_\+unix\+\_\+init} (uint16\+\_\+t \textbf{ type}, uint8\+\_\+t \textbf{ proto}, const char $\ast$socket\+\_\+path, unsigned int \textbf{ flags})
\item 
int \textbf{ osmo\+\_\+sock\+\_\+unix\+\_\+init\+\_\+ofd} (struct \textbf{ osmo\+\_\+fd} $\ast$ofd, uint16\+\_\+t \textbf{ type}, uint8\+\_\+t \textbf{ proto}, const char $\ast$socket\+\_\+path, unsigned int \textbf{ flags})
\item 
char $\ast$ \textbf{ osmo\+\_\+sock\+\_\+get\+\_\+name} (const void $\ast$ctx, int fd)
\item 
const char $\ast$ \textbf{ osmo\+\_\+sock\+\_\+get\+\_\+name2} (int fd)
\item 
char $\ast$ \textbf{ osmo\+\_\+sock\+\_\+get\+\_\+name2\+\_\+c} (const void $\ast$ctx, int fd)
\item 
int \textbf{ osmo\+\_\+sock\+\_\+get\+\_\+name\+\_\+buf} (char $\ast$str, size\+\_\+t str\+\_\+len, int fd)
\item 
int \textbf{ osmo\+\_\+sock\+\_\+get\+\_\+ip\+\_\+and\+\_\+port} (int fd, char $\ast$ip, size\+\_\+t ip\+\_\+len, char $\ast$port, size\+\_\+t port\+\_\+len, bool local)
\item 
int \textbf{ osmo\+\_\+sock\+\_\+get\+\_\+local\+\_\+ip} (int fd, char $\ast$\textbf{ host}, size\+\_\+t \textbf{ len})
\item 
int \textbf{ osmo\+\_\+sock\+\_\+get\+\_\+local\+\_\+ip\+\_\+port} (int fd, char $\ast$port, size\+\_\+t \textbf{ len})
\item 
int \textbf{ osmo\+\_\+sock\+\_\+get\+\_\+remote\+\_\+ip} (int fd, char $\ast$\textbf{ host}, size\+\_\+t \textbf{ len})
\item 
int \textbf{ osmo\+\_\+sock\+\_\+get\+\_\+remote\+\_\+ip\+\_\+port} (int fd, char $\ast$port, size\+\_\+t \textbf{ len})
\item 
int \textbf{ osmo\+\_\+sock\+\_\+multiaddr\+\_\+get\+\_\+ip\+\_\+and\+\_\+port} (int fd, int ip\+\_\+proto, char $\ast$ip, size\+\_\+t $\ast$ip\+\_\+cnt, size\+\_\+t ip\+\_\+len, char $\ast$port, size\+\_\+t port\+\_\+len, bool local)
\item 
int \textbf{ osmo\+\_\+multiaddr\+\_\+ip\+\_\+and\+\_\+port\+\_\+snprintf} (char $\ast$str, size\+\_\+t str\+\_\+len, const char $\ast$ip, size\+\_\+t ip\+\_\+cnt, size\+\_\+t ip\+\_\+len, const char $\ast$portbuf)
\item 
int \textbf{ osmo\+\_\+sock\+\_\+multiaddr\+\_\+get\+\_\+name\+\_\+buf} (char $\ast$str, size\+\_\+t str\+\_\+len, int fd, int sk\+\_\+proto)
\item 
int \textbf{ osmo\+\_\+sock\+\_\+multiaddr\+\_\+add\+\_\+local\+\_\+addr} (int sfd, const char $\ast$$\ast$addrs, size\+\_\+t addrs\+\_\+cnt)
\item 
int \textbf{ osmo\+\_\+sock\+\_\+multiaddr\+\_\+del\+\_\+local\+\_\+addr} (int sfd, const char $\ast$$\ast$addrs, size\+\_\+t addrs\+\_\+cnt)
\item 
int \textbf{ osmo\+\_\+sock\+\_\+mcast\+\_\+loop\+\_\+set} (int fd, bool enable)
\item 
int \textbf{ osmo\+\_\+sock\+\_\+mcast\+\_\+ttl\+\_\+set} (int fd, uint8\+\_\+t ttl)
\item 
int \textbf{ osmo\+\_\+sock\+\_\+mcast\+\_\+all\+\_\+set} (int fd, bool enable)
\item 
int \textbf{ osmo\+\_\+sock\+\_\+mcast\+\_\+iface\+\_\+set} (int fd, const char $\ast$ifname)
\item 
int \textbf{ osmo\+\_\+sock\+\_\+mcast\+\_\+subscribe} (int fd, const char $\ast$grp\+\_\+addr)
\item 
int \textbf{ osmo\+\_\+sock\+\_\+local\+\_\+ip} (char $\ast$local\+\_\+ip, const char $\ast$remote\+\_\+ip)
\item 
int \textbf{ osmo\+\_\+sock\+\_\+set\+\_\+dscp} (int fd, uint8\+\_\+t dscp)
\item 
int \textbf{ osmo\+\_\+sock\+\_\+set\+\_\+priority} (int fd, int prio)
\item 
int \textbf{ osmo\+\_\+sock\+\_\+get\+\_\+nonblock} (int fd)
\item 
int \textbf{ osmo\+\_\+sock\+\_\+set\+\_\+nonblock} (int fd, int on)
\item 
int \textbf{ osmo\+\_\+sock\+\_\+sctp\+\_\+get\+\_\+peer\+\_\+addr\+\_\+info} (int fd, struct sctp\+\_\+paddrinfo $\ast$pinfo, size\+\_\+t $\ast$pinfo\+\_\+cnt)
\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}
Osmocom socket convenience functions. 



\doxysubsection{Macro Definition Documentation}
\mbox{\label{group__socket_ga4970b1b90d27644ff2ab37a33d1a09c5}} 
\index{Socket convenience functions@{Socket convenience functions}!GET\_OSMO\_SOCK\_F\_DSCP@{GET\_OSMO\_SOCK\_F\_DSCP}}
\index{GET\_OSMO\_SOCK\_F\_DSCP@{GET\_OSMO\_SOCK\_F\_DSCP}!Socket convenience functions@{Socket convenience functions}}
\doxysubsubsection{GET\_OSMO\_SOCK\_F\_DSCP}
{\footnotesize\ttfamily \#define GET\+\_\+\+OSMO\+\_\+\+SOCK\+\_\+\+F\+\_\+\+DSCP(\begin{DoxyParamCaption}\item[{}]{f }\end{DoxyParamCaption})~(((f) $>$$>$ 24) \& 0x3f)}

\mbox{\label{group__socket_ga3a268537621c5097a00a50819fc67d74}} 
\index{Socket convenience functions@{Socket convenience functions}!GET\_OSMO\_SOCK\_F\_PRIO@{GET\_OSMO\_SOCK\_F\_PRIO}}
\index{GET\_OSMO\_SOCK\_F\_PRIO@{GET\_OSMO\_SOCK\_F\_PRIO}!Socket convenience functions@{Socket convenience functions}}
\doxysubsubsection{GET\_OSMO\_SOCK\_F\_PRIO}
{\footnotesize\ttfamily \#define GET\+\_\+\+OSMO\+\_\+\+SOCK\+\_\+\+F\+\_\+\+PRIO(\begin{DoxyParamCaption}\item[{}]{f }\end{DoxyParamCaption})~(((f) $>$$>$ 16) \& 0xff)}

\mbox{\label{group__socket_ga642c796a06636fe18f1daea1bbf1cc13}} 
\index{Socket convenience functions@{Socket convenience functions}!OSMO\_SOCK\_F\_BIND@{OSMO\_SOCK\_F\_BIND}}
\index{OSMO\_SOCK\_F\_BIND@{OSMO\_SOCK\_F\_BIND}!Socket convenience functions@{Socket convenience functions}}
\doxysubsubsection{OSMO\_SOCK\_F\_BIND}
{\footnotesize\ttfamily \#define OSMO\+\_\+\+SOCK\+\_\+\+F\+\_\+\+BIND~(1 $<$$<$ 1)}



bind the socket to a local address/port 

\mbox{\label{group__socket_gaa686c67100001f1b7be0e8f00a770c37}} 
\index{Socket convenience functions@{Socket convenience functions}!OSMO\_SOCK\_F\_CONNECT@{OSMO\_SOCK\_F\_CONNECT}}
\index{OSMO\_SOCK\_F\_CONNECT@{OSMO\_SOCK\_F\_CONNECT}!Socket convenience functions@{Socket convenience functions}}
\doxysubsubsection{OSMO\_SOCK\_F\_CONNECT}
{\footnotesize\ttfamily \#define OSMO\+\_\+\+SOCK\+\_\+\+F\+\_\+\+CONNECT~(1 $<$$<$ 0)}



connect the socket to a remote peer 

\mbox{\label{group__socket_ga6f3cbc5dea1ebecd6a4312ea65666627}} 
\index{Socket convenience functions@{Socket convenience functions}!OSMO\_SOCK\_F\_DSCP@{OSMO\_SOCK\_F\_DSCP}}
\index{OSMO\_SOCK\_F\_DSCP@{OSMO\_SOCK\_F\_DSCP}!Socket convenience functions@{Socket convenience functions}}
\doxysubsubsection{OSMO\_SOCK\_F\_DSCP}
{\footnotesize\ttfamily \#define OSMO\+\_\+\+SOCK\+\_\+\+F\+\_\+\+DSCP(\begin{DoxyParamCaption}\item[{}]{\textbf{ x} }\end{DoxyParamCaption})~(((\textbf{ x})\&0x3f) $<$$<$ 24)}



use \doxyref{OSMO\+\_\+\+SOCK\+\_\+\+F\+\_\+\+DSCP(x)}{p.}{group__socket_ga6f3cbc5dea1ebecd6a4312ea65666627} to set IP DSCP \textquotesingle{}x\textquotesingle{} for packets transmitted on the socket 

\mbox{\label{group__socket_ga1af36cd850690c8f592caa8f2dc3e612}} 
\index{Socket convenience functions@{Socket convenience functions}!OSMO\_SOCK\_F\_NO\_MCAST\_ALL@{OSMO\_SOCK\_F\_NO\_MCAST\_ALL}}
\index{OSMO\_SOCK\_F\_NO\_MCAST\_ALL@{OSMO\_SOCK\_F\_NO\_MCAST\_ALL}!Socket convenience functions@{Socket convenience functions}}
\doxysubsubsection{OSMO\_SOCK\_F\_NO\_MCAST\_ALL}
{\footnotesize\ttfamily \#define OSMO\+\_\+\+SOCK\+\_\+\+F\+\_\+\+NO\+\_\+\+MCAST\+\_\+\+ALL~(1 $<$$<$ 4)}



disable receiving all multiast even for non-\/subscribed groups 

\mbox{\label{group__socket_gaecc9539e779824d52eaa8a3c37e941c7}} 
\index{Socket convenience functions@{Socket convenience functions}!OSMO\_SOCK\_F\_NO\_MCAST\_LOOP@{OSMO\_SOCK\_F\_NO\_MCAST\_LOOP}}
\index{OSMO\_SOCK\_F\_NO\_MCAST\_LOOP@{OSMO\_SOCK\_F\_NO\_MCAST\_LOOP}!Socket convenience functions@{Socket convenience functions}}
\doxysubsubsection{OSMO\_SOCK\_F\_NO\_MCAST\_LOOP}
{\footnotesize\ttfamily \#define OSMO\+\_\+\+SOCK\+\_\+\+F\+\_\+\+NO\+\_\+\+MCAST\+\_\+\+LOOP~(1 $<$$<$ 3)}



disable multiast loop (IP\+\_\+\+MULTICAST\+\_\+\+LOOP) 

\mbox{\label{group__socket_ga27b043d6ad4ceb700a863e17db7fc670}} 
\index{Socket convenience functions@{Socket convenience functions}!OSMO\_SOCK\_F\_NONBLOCK@{OSMO\_SOCK\_F\_NONBLOCK}}
\index{OSMO\_SOCK\_F\_NONBLOCK@{OSMO\_SOCK\_F\_NONBLOCK}!Socket convenience functions@{Socket convenience functions}}
\doxysubsubsection{OSMO\_SOCK\_F\_NONBLOCK}
{\footnotesize\ttfamily \#define OSMO\+\_\+\+SOCK\+\_\+\+F\+\_\+\+NONBLOCK~(1 $<$$<$ 2)}



switch socket to non-\/blocking mode 

\mbox{\label{group__socket_ga3d96505ab56ed6051eca99ab76f16ca3}} 
\index{Socket convenience functions@{Socket convenience functions}!OSMO\_SOCK\_F\_PRIO@{OSMO\_SOCK\_F\_PRIO}}
\index{OSMO\_SOCK\_F\_PRIO@{OSMO\_SOCK\_F\_PRIO}!Socket convenience functions@{Socket convenience functions}}
\doxysubsubsection{OSMO\_SOCK\_F\_PRIO}
{\footnotesize\ttfamily \#define OSMO\+\_\+\+SOCK\+\_\+\+F\+\_\+\+PRIO(\begin{DoxyParamCaption}\item[{}]{\textbf{ x} }\end{DoxyParamCaption})~(((\textbf{ x})\&0xff) $<$$<$ 16)}



use \doxyref{OSMO\+\_\+\+SOCK\+\_\+\+F\+\_\+\+PRIO(x)}{p.}{group__socket_ga3d96505ab56ed6051eca99ab76f16ca3} to set priority \textquotesingle{}x\textquotesingle{} for packets transmitted on the socket 

\mbox{\label{group__socket_gacf7b1899fb6ccaeb8703ef4eded34684}} 
\index{Socket convenience functions@{Socket convenience functions}!OSMO\_SOCK\_F\_UDP\_REUSEADDR@{OSMO\_SOCK\_F\_UDP\_REUSEADDR}}
\index{OSMO\_SOCK\_F\_UDP\_REUSEADDR@{OSMO\_SOCK\_F\_UDP\_REUSEADDR}!Socket convenience functions@{Socket convenience functions}}
\doxysubsubsection{OSMO\_SOCK\_F\_UDP\_REUSEADDR}
{\footnotesize\ttfamily \#define OSMO\+\_\+\+SOCK\+\_\+\+F\+\_\+\+UDP\+\_\+\+REUSEADDR~(1 $<$$<$ 5)}



use SO\+\_\+\+REUSEADDR on UDP ports (required for multicast) 

\mbox{\label{group__socket_gae4c08dc00d7838698bc30966691f5760}} 
\index{Socket convenience functions@{Socket convenience functions}!OSMO\_SOCK\_MAX\_ADDRS@{OSMO\_SOCK\_MAX\_ADDRS}}
\index{OSMO\_SOCK\_MAX\_ADDRS@{OSMO\_SOCK\_MAX\_ADDRS}!Socket convenience functions@{Socket convenience functions}}
\doxysubsubsection{OSMO\_SOCK\_MAX\_ADDRS}
{\footnotesize\ttfamily \#define OSMO\+\_\+\+SOCK\+\_\+\+MAX\+\_\+\+ADDRS~32}



maximum number of local or remote addresses supported by an osmo\+\_\+sock instance 

\mbox{\label{group__socket_gac2608bdadb53f7c9c19ae0ed6f9166db}} 
\index{Socket convenience functions@{Socket convenience functions}!OSMO\_SOCK\_MULTIADDR\_NAME\_MAXLEN@{OSMO\_SOCK\_MULTIADDR\_NAME\_MAXLEN}}
\index{OSMO\_SOCK\_MULTIADDR\_NAME\_MAXLEN@{OSMO\_SOCK\_MULTIADDR\_NAME\_MAXLEN}!Socket convenience functions@{Socket convenience functions}}
\doxysubsubsection{OSMO\_SOCK\_MULTIADDR\_NAME\_MAXLEN}
{\footnotesize\ttfamily \#define OSMO\+\_\+\+SOCK\+\_\+\+MULTIADDR\+\_\+\+NAME\+\_\+\+MAXLEN~(\textbf{ OSMO\+\_\+\+SOCK\+\_\+\+MULTIADDR\+\_\+\+PEER\+\_\+\+STR\+\_\+\+MAXLEN} + 7)}



maximum length of a multia-\/address socket name (\char`\"{}r=(\+::2$\vert$1.\+2.\+3.\+4)\+:123$<$-\/$>$l=(5.\+6.\+7.\+8$\vert$\+::9)\+:987\char`\"{}) 

\mbox{\label{group__socket_gaf4d29d5d47130a624c2f0cb4e45535da}} 
\index{Socket convenience functions@{Socket convenience functions}!OSMO\_SOCK\_MULTIADDR\_PEER\_STR\_MAXLEN@{OSMO\_SOCK\_MULTIADDR\_PEER\_STR\_MAXLEN}}
\index{OSMO\_SOCK\_MULTIADDR\_PEER\_STR\_MAXLEN@{OSMO\_SOCK\_MULTIADDR\_PEER\_STR\_MAXLEN}!Socket convenience functions@{Socket convenience functions}}
\doxysubsubsection{OSMO\_SOCK\_MULTIADDR\_PEER\_STR\_MAXLEN}
{\footnotesize\ttfamily \#define OSMO\+\_\+\+SOCK\+\_\+\+MULTIADDR\+\_\+\+PEER\+\_\+\+STR\+\_\+\+MAXLEN~(INET6\+\_\+\+ADDRSTRLEN $\ast$ \textbf{ OSMO\+\_\+\+SOCK\+\_\+\+MAX\+\_\+\+ADDRS} + INET6\+\_\+\+ADDRSTRLEN + 2 + 6 + 1)}



maximum length of a multi-\/address socket peer (endpoint) name\+: (5.\+6.\+7.\+8$\vert$\+::9)\+:987 char \textquotesingle{}(\textquotesingle{} + OSMO\+\_\+\+STREAM\+\_\+\+MAX\+\_\+\+ADDRS -\/ 1 addr separators + chars \char`\"{})\+:\char`\"{} + port buffer + char \textquotesingle{}\textbackslash{}0\textquotesingle{} 

\mbox{\label{group__socket_ga22a44e09d135767610646c73e7abe57f}} 
\index{Socket convenience functions@{Socket convenience functions}!OSMO\_SOCK\_NAME\_MAXLEN@{OSMO\_SOCK\_NAME\_MAXLEN}}
\index{OSMO\_SOCK\_NAME\_MAXLEN@{OSMO\_SOCK\_NAME\_MAXLEN}!Socket convenience functions@{Socket convenience functions}}
\doxysubsubsection{OSMO\_SOCK\_NAME\_MAXLEN}
{\footnotesize\ttfamily \#define OSMO\+\_\+\+SOCK\+\_\+\+NAME\+\_\+\+MAXLEN~(2 + INET6\+\_\+\+ADDRSTRLEN + 1 + 5 + 3 + 2 + INET6\+\_\+\+ADDRSTRLEN + 1 + 5 + 1)}



maximum length of a socket name (\char`\"{}r=1.\+2.\+3.\+4\+:123$<$-\/$>$l=5.\+6.\+7.\+8\+:987\char`\"{}) 



\doxysubsection{Function Documentation}
\mbox{\label{group__socket_ga7236135a9d2ec8bccd8682ae7e9881fd}} 
\index{Socket convenience functions@{Socket convenience functions}!osmo\_multiaddr\_ip\_and\_port\_snprintf@{osmo\_multiaddr\_ip\_and\_port\_snprintf}}
\index{osmo\_multiaddr\_ip\_and\_port\_snprintf@{osmo\_multiaddr\_ip\_and\_port\_snprintf}!Socket convenience functions@{Socket convenience functions}}
\doxysubsubsection{osmo\_multiaddr\_ip\_and\_port\_snprintf()}
{\footnotesize\ttfamily int osmo\+\_\+multiaddr\+\_\+ip\+\_\+and\+\_\+port\+\_\+snprintf (\begin{DoxyParamCaption}\item[{char $\ast$}]{str,  }\item[{size\+\_\+t}]{str\+\_\+len,  }\item[{const char $\ast$}]{ip,  }\item[{size\+\_\+t}]{ip\+\_\+cnt,  }\item[{size\+\_\+t}]{ip\+\_\+len,  }\item[{const char $\ast$}]{portbuf }\end{DoxyParamCaption})}

\mbox{\label{group__socket_ga50a6e81b2f328d35ece2ab8005cefc6a}} 
\index{Socket convenience functions@{Socket convenience functions}!osmo\_sock\_get\_ip\_and\_port@{osmo\_sock\_get\_ip\_and\_port}}
\index{osmo\_sock\_get\_ip\_and\_port@{osmo\_sock\_get\_ip\_and\_port}!Socket convenience functions@{Socket convenience functions}}
\doxysubsubsection{osmo\_sock\_get\_ip\_and\_port()}
{\footnotesize\ttfamily int osmo\+\_\+sock\+\_\+get\+\_\+ip\+\_\+and\+\_\+port (\begin{DoxyParamCaption}\item[{int}]{fd,  }\item[{char $\ast$}]{ip,  }\item[{size\+\_\+t}]{ip\+\_\+len,  }\item[{char $\ast$}]{port,  }\item[{size\+\_\+t}]{port\+\_\+len,  }\item[{bool}]{local }\end{DoxyParamCaption})}

\mbox{\label{group__socket_ga2fd9c4f771cb0e669c6a452e4dc52256}} 
\index{Socket convenience functions@{Socket convenience functions}!osmo\_sock\_get\_local\_ip@{osmo\_sock\_get\_local\_ip}}
\index{osmo\_sock\_get\_local\_ip@{osmo\_sock\_get\_local\_ip}!Socket convenience functions@{Socket convenience functions}}
\doxysubsubsection{osmo\_sock\_get\_local\_ip()}
{\footnotesize\ttfamily int osmo\+\_\+sock\+\_\+get\+\_\+local\+\_\+ip (\begin{DoxyParamCaption}\item[{int}]{fd,  }\item[{char $\ast$}]{host,  }\item[{size\+\_\+t}]{len }\end{DoxyParamCaption})}

\mbox{\label{group__socket_ga5d1cbb310e9dbe2856f0d324a7250f56}} 
\index{Socket convenience functions@{Socket convenience functions}!osmo\_sock\_get\_local\_ip\_port@{osmo\_sock\_get\_local\_ip\_port}}
\index{osmo\_sock\_get\_local\_ip\_port@{osmo\_sock\_get\_local\_ip\_port}!Socket convenience functions@{Socket convenience functions}}
\doxysubsubsection{osmo\_sock\_get\_local\_ip\_port()}
{\footnotesize\ttfamily int osmo\+\_\+sock\+\_\+get\+\_\+local\+\_\+ip\+\_\+port (\begin{DoxyParamCaption}\item[{int}]{fd,  }\item[{char $\ast$}]{port,  }\item[{size\+\_\+t}]{len }\end{DoxyParamCaption})}

\mbox{\label{group__socket_ga42ee983e4f1feae807a87768de0b2af3}} 
\index{Socket convenience functions@{Socket convenience functions}!osmo\_sock\_get\_name@{osmo\_sock\_get\_name}}
\index{osmo\_sock\_get\_name@{osmo\_sock\_get\_name}!Socket convenience functions@{Socket convenience functions}}
\doxysubsubsection{osmo\_sock\_get\_name()}
{\footnotesize\ttfamily char $\ast$ osmo\+\_\+sock\+\_\+get\+\_\+name (\begin{DoxyParamCaption}\item[{const void $\ast$}]{ctx,  }\item[{int}]{fd }\end{DoxyParamCaption})}

\mbox{\label{group__socket_ga7996f9b2938be6386d78af309906637d}} 
\index{Socket convenience functions@{Socket convenience functions}!osmo\_sock\_get\_name2@{osmo\_sock\_get\_name2}}
\index{osmo\_sock\_get\_name2@{osmo\_sock\_get\_name2}!Socket convenience functions@{Socket convenience functions}}
\doxysubsubsection{osmo\_sock\_get\_name2()}
{\footnotesize\ttfamily const char $\ast$ osmo\+\_\+sock\+\_\+get\+\_\+name2 (\begin{DoxyParamCaption}\item[{int}]{fd }\end{DoxyParamCaption})}

\mbox{\label{group__socket_ga3f0ec92748ad707c87b7758d549ab699}} 
\index{Socket convenience functions@{Socket convenience functions}!osmo\_sock\_get\_name2\_c@{osmo\_sock\_get\_name2\_c}}
\index{osmo\_sock\_get\_name2\_c@{osmo\_sock\_get\_name2\_c}!Socket convenience functions@{Socket convenience functions}}
\doxysubsubsection{osmo\_sock\_get\_name2\_c()}
{\footnotesize\ttfamily char $\ast$ osmo\+\_\+sock\+\_\+get\+\_\+name2\+\_\+c (\begin{DoxyParamCaption}\item[{const void $\ast$}]{ctx,  }\item[{int}]{fd }\end{DoxyParamCaption})}

\mbox{\label{group__socket_ga4a407d661515fc2028e036e39cc37d64}} 
\index{Socket convenience functions@{Socket convenience functions}!osmo\_sock\_get\_name\_buf@{osmo\_sock\_get\_name\_buf}}
\index{osmo\_sock\_get\_name\_buf@{osmo\_sock\_get\_name\_buf}!Socket convenience functions@{Socket convenience functions}}
\doxysubsubsection{osmo\_sock\_get\_name\_buf()}
{\footnotesize\ttfamily int osmo\+\_\+sock\+\_\+get\+\_\+name\+\_\+buf (\begin{DoxyParamCaption}\item[{char $\ast$}]{str,  }\item[{size\+\_\+t}]{str\+\_\+len,  }\item[{int}]{fd }\end{DoxyParamCaption})}

\mbox{\label{group__socket_gae15494202f58f65f785ecd01cbe58c66}} 
\index{Socket convenience functions@{Socket convenience functions}!osmo\_sock\_get\_nonblock@{osmo\_sock\_get\_nonblock}}
\index{osmo\_sock\_get\_nonblock@{osmo\_sock\_get\_nonblock}!Socket convenience functions@{Socket convenience functions}}
\doxysubsubsection{osmo\_sock\_get\_nonblock()}
{\footnotesize\ttfamily int osmo\+\_\+sock\+\_\+get\+\_\+nonblock (\begin{DoxyParamCaption}\item[{int}]{fd }\end{DoxyParamCaption})}

\mbox{\label{group__socket_gac331a5587179fad782042b47e73cdcc8}} 
\index{Socket convenience functions@{Socket convenience functions}!osmo\_sock\_get\_remote\_ip@{osmo\_sock\_get\_remote\_ip}}
\index{osmo\_sock\_get\_remote\_ip@{osmo\_sock\_get\_remote\_ip}!Socket convenience functions@{Socket convenience functions}}
\doxysubsubsection{osmo\_sock\_get\_remote\_ip()}
{\footnotesize\ttfamily int osmo\+\_\+sock\+\_\+get\+\_\+remote\+\_\+ip (\begin{DoxyParamCaption}\item[{int}]{fd,  }\item[{char $\ast$}]{host,  }\item[{size\+\_\+t}]{len }\end{DoxyParamCaption})}

\mbox{\label{group__socket_ga79ef34f1de3375e3d4d3e890e9663e72}} 
\index{Socket convenience functions@{Socket convenience functions}!osmo\_sock\_get\_remote\_ip\_port@{osmo\_sock\_get\_remote\_ip\_port}}
\index{osmo\_sock\_get\_remote\_ip\_port@{osmo\_sock\_get\_remote\_ip\_port}!Socket convenience functions@{Socket convenience functions}}
\doxysubsubsection{osmo\_sock\_get\_remote\_ip\_port()}
{\footnotesize\ttfamily int osmo\+\_\+sock\+\_\+get\+\_\+remote\+\_\+ip\+\_\+port (\begin{DoxyParamCaption}\item[{int}]{fd,  }\item[{char $\ast$}]{port,  }\item[{size\+\_\+t}]{len }\end{DoxyParamCaption})}

\mbox{\label{group__socket_ga6541a3a4c15bc6c8fbcbe5fcbe0de640}} 
\index{Socket convenience functions@{Socket convenience functions}!osmo\_sock\_init@{osmo\_sock\_init}}
\index{osmo\_sock\_init@{osmo\_sock\_init}!Socket convenience functions@{Socket convenience functions}}
\doxysubsubsection{osmo\_sock\_init()}
{\footnotesize\ttfamily int osmo\+\_\+sock\+\_\+init (\begin{DoxyParamCaption}\item[{uint16\+\_\+t}]{family,  }\item[{uint16\+\_\+t}]{type,  }\item[{uint8\+\_\+t}]{proto,  }\item[{const char $\ast$}]{host,  }\item[{uint16\+\_\+t}]{port,  }\item[{unsigned int}]{flags }\end{DoxyParamCaption})}

\mbox{\label{group__socket_ga95ffbbf949feb5939de9fa70f70be9ee}} 
\index{Socket convenience functions@{Socket convenience functions}!osmo\_sock\_init2@{osmo\_sock\_init2}}
\index{osmo\_sock\_init2@{osmo\_sock\_init2}!Socket convenience functions@{Socket convenience functions}}
\doxysubsubsection{osmo\_sock\_init2()}
{\footnotesize\ttfamily int osmo\+\_\+sock\+\_\+init2 (\begin{DoxyParamCaption}\item[{uint16\+\_\+t}]{family,  }\item[{uint16\+\_\+t}]{type,  }\item[{uint8\+\_\+t}]{proto,  }\item[{const char $\ast$}]{local\+\_\+host,  }\item[{uint16\+\_\+t}]{local\+\_\+port,  }\item[{const char $\ast$}]{remote\+\_\+host,  }\item[{uint16\+\_\+t}]{remote\+\_\+port,  }\item[{unsigned int}]{flags }\end{DoxyParamCaption})}

\mbox{\label{group__socket_gab0e1e4c91993c8d20b567c31e99cc64b}} 
\index{Socket convenience functions@{Socket convenience functions}!osmo\_sock\_init2\_multiaddr@{osmo\_sock\_init2\_multiaddr}}
\index{osmo\_sock\_init2\_multiaddr@{osmo\_sock\_init2\_multiaddr}!Socket convenience functions@{Socket convenience functions}}
\doxysubsubsection{osmo\_sock\_init2\_multiaddr()}
{\footnotesize\ttfamily int osmo\+\_\+sock\+\_\+init2\+\_\+multiaddr (\begin{DoxyParamCaption}\item[{uint16\+\_\+t}]{family,  }\item[{uint16\+\_\+t}]{type,  }\item[{uint8\+\_\+t}]{proto,  }\item[{const char $\ast$$\ast$}]{local\+\_\+hosts,  }\item[{size\+\_\+t}]{local\+\_\+hosts\+\_\+cnt,  }\item[{uint16\+\_\+t}]{local\+\_\+port,  }\item[{const char $\ast$$\ast$}]{remote\+\_\+hosts,  }\item[{size\+\_\+t}]{remote\+\_\+hosts\+\_\+cnt,  }\item[{uint16\+\_\+t}]{remote\+\_\+port,  }\item[{unsigned int}]{flags }\end{DoxyParamCaption})}

\mbox{\label{group__socket_gaac9e12947211a1c1037c2ba914a4e088}} 
\index{Socket convenience functions@{Socket convenience functions}!osmo\_sock\_init2\_multiaddr2@{osmo\_sock\_init2\_multiaddr2}}
\index{osmo\_sock\_init2\_multiaddr2@{osmo\_sock\_init2\_multiaddr2}!Socket convenience functions@{Socket convenience functions}}
\doxysubsubsection{osmo\_sock\_init2\_multiaddr2()}
{\footnotesize\ttfamily int osmo\+\_\+sock\+\_\+init2\+\_\+multiaddr2 (\begin{DoxyParamCaption}\item[{uint16\+\_\+t}]{family,  }\item[{uint16\+\_\+t}]{type,  }\item[{uint8\+\_\+t}]{proto,  }\item[{const char $\ast$$\ast$}]{local\+\_\+hosts,  }\item[{size\+\_\+t}]{local\+\_\+hosts\+\_\+cnt,  }\item[{uint16\+\_\+t}]{local\+\_\+port,  }\item[{const char $\ast$$\ast$}]{remote\+\_\+hosts,  }\item[{size\+\_\+t}]{remote\+\_\+hosts\+\_\+cnt,  }\item[{uint16\+\_\+t}]{remote\+\_\+port,  }\item[{unsigned int}]{flags,  }\item[{struct \textbf{ osmo\+\_\+sock\+\_\+init2\+\_\+multiaddr\+\_\+pars} $\ast$}]{pars }\end{DoxyParamCaption})}

\mbox{\label{group__socket_ga67a4d3cca7937c4a8e40e98c01fcfb98}} 
\index{Socket convenience functions@{Socket convenience functions}!osmo\_sock\_init2\_ofd@{osmo\_sock\_init2\_ofd}}
\index{osmo\_sock\_init2\_ofd@{osmo\_sock\_init2\_ofd}!Socket convenience functions@{Socket convenience functions}}
\doxysubsubsection{osmo\_sock\_init2\_ofd()}
{\footnotesize\ttfamily int osmo\+\_\+sock\+\_\+init2\+\_\+ofd (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+fd} $\ast$}]{ofd,  }\item[{int}]{family,  }\item[{int}]{type,  }\item[{int}]{proto,  }\item[{const char $\ast$}]{local\+\_\+host,  }\item[{uint16\+\_\+t}]{local\+\_\+port,  }\item[{const char $\ast$}]{remote\+\_\+host,  }\item[{uint16\+\_\+t}]{remote\+\_\+port,  }\item[{unsigned int}]{flags }\end{DoxyParamCaption})}

\mbox{\label{group__socket_ga66109962305745831fcd461483179534}} 
\index{Socket convenience functions@{Socket convenience functions}!osmo\_sock\_init\_ofd@{osmo\_sock\_init\_ofd}}
\index{osmo\_sock\_init\_ofd@{osmo\_sock\_init\_ofd}!Socket convenience functions@{Socket convenience functions}}
\doxysubsubsection{osmo\_sock\_init\_ofd()}
{\footnotesize\ttfamily int osmo\+\_\+sock\+\_\+init\+\_\+ofd (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+fd} $\ast$}]{ofd,  }\item[{int}]{family,  }\item[{int}]{type,  }\item[{int}]{proto,  }\item[{const char $\ast$}]{host,  }\item[{uint16\+\_\+t}]{port,  }\item[{unsigned int}]{flags }\end{DoxyParamCaption})}

\mbox{\label{group__socket_ga0e00f552ace126ec3a284faeb34b3813}} 
\index{Socket convenience functions@{Socket convenience functions}!osmo\_sock\_init\_osa@{osmo\_sock\_init\_osa}}
\index{osmo\_sock\_init\_osa@{osmo\_sock\_init\_osa}!Socket convenience functions@{Socket convenience functions}}
\doxysubsubsection{osmo\_sock\_init\_osa()}
{\footnotesize\ttfamily int osmo\+\_\+sock\+\_\+init\+\_\+osa (\begin{DoxyParamCaption}\item[{uint16\+\_\+t}]{type,  }\item[{uint8\+\_\+t}]{proto,  }\item[{const struct \textbf{ osmo\+\_\+sockaddr} $\ast$}]{local,  }\item[{const struct \textbf{ osmo\+\_\+sockaddr} $\ast$}]{remote,  }\item[{unsigned int}]{flags }\end{DoxyParamCaption})}

\mbox{\label{group__socket_gacf46828ab5f054147251ebe5715f1add}} 
\index{Socket convenience functions@{Socket convenience functions}!osmo\_sock\_init\_osa\_ofd@{osmo\_sock\_init\_osa\_ofd}}
\index{osmo\_sock\_init\_osa\_ofd@{osmo\_sock\_init\_osa\_ofd}!Socket convenience functions@{Socket convenience functions}}
\doxysubsubsection{osmo\_sock\_init\_osa\_ofd()}
{\footnotesize\ttfamily int osmo\+\_\+sock\+\_\+init\+\_\+osa\+\_\+ofd (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+fd} $\ast$}]{ofd,  }\item[{int}]{type,  }\item[{int}]{proto,  }\item[{const struct \textbf{ osmo\+\_\+sockaddr} $\ast$}]{local,  }\item[{const struct \textbf{ osmo\+\_\+sockaddr} $\ast$}]{remote,  }\item[{unsigned int}]{flags }\end{DoxyParamCaption})}

\mbox{\label{group__socket_gade7aa852d99c199675e68baac1fee73c}} 
\index{Socket convenience functions@{Socket convenience functions}!osmo\_sock\_init\_sa@{osmo\_sock\_init\_sa}}
\index{osmo\_sock\_init\_sa@{osmo\_sock\_init\_sa}!Socket convenience functions@{Socket convenience functions}}
\doxysubsubsection{osmo\_sock\_init\_sa()}
{\footnotesize\ttfamily int osmo\+\_\+sock\+\_\+init\+\_\+sa (\begin{DoxyParamCaption}\item[{struct sockaddr $\ast$}]{ss,  }\item[{uint16\+\_\+t}]{type,  }\item[{uint8\+\_\+t}]{proto,  }\item[{unsigned int}]{flags }\end{DoxyParamCaption})}

\mbox{\label{group__socket_gae2060fed8214db649330bdca51b9c53c}} 
\index{Socket convenience functions@{Socket convenience functions}!osmo\_sock\_local\_ip@{osmo\_sock\_local\_ip}}
\index{osmo\_sock\_local\_ip@{osmo\_sock\_local\_ip}!Socket convenience functions@{Socket convenience functions}}
\doxysubsubsection{osmo\_sock\_local\_ip()}
{\footnotesize\ttfamily int osmo\+\_\+sock\+\_\+local\+\_\+ip (\begin{DoxyParamCaption}\item[{char $\ast$}]{local\+\_\+ip,  }\item[{const char $\ast$}]{remote\+\_\+ip }\end{DoxyParamCaption})}

\mbox{\label{group__socket_ga7e0ad7f569f9725b1bc677826a7d3cd0}} 
\index{Socket convenience functions@{Socket convenience functions}!osmo\_sock\_mcast\_all\_set@{osmo\_sock\_mcast\_all\_set}}
\index{osmo\_sock\_mcast\_all\_set@{osmo\_sock\_mcast\_all\_set}!Socket convenience functions@{Socket convenience functions}}
\doxysubsubsection{osmo\_sock\_mcast\_all\_set()}
{\footnotesize\ttfamily int osmo\+\_\+sock\+\_\+mcast\+\_\+all\+\_\+set (\begin{DoxyParamCaption}\item[{int}]{fd,  }\item[{bool}]{enable }\end{DoxyParamCaption})}

\mbox{\label{group__socket_gac65f07a57203419611d8e925dd1e45b5}} 
\index{Socket convenience functions@{Socket convenience functions}!osmo\_sock\_mcast\_iface\_set@{osmo\_sock\_mcast\_iface\_set}}
\index{osmo\_sock\_mcast\_iface\_set@{osmo\_sock\_mcast\_iface\_set}!Socket convenience functions@{Socket convenience functions}}
\doxysubsubsection{osmo\_sock\_mcast\_iface\_set()}
{\footnotesize\ttfamily int osmo\+\_\+sock\+\_\+mcast\+\_\+iface\+\_\+set (\begin{DoxyParamCaption}\item[{int}]{fd,  }\item[{const char $\ast$}]{ifname }\end{DoxyParamCaption})}

\mbox{\label{group__socket_ga5084bc78d5b1e27271586cb1285f147b}} 
\index{Socket convenience functions@{Socket convenience functions}!osmo\_sock\_mcast\_loop\_set@{osmo\_sock\_mcast\_loop\_set}}
\index{osmo\_sock\_mcast\_loop\_set@{osmo\_sock\_mcast\_loop\_set}!Socket convenience functions@{Socket convenience functions}}
\doxysubsubsection{osmo\_sock\_mcast\_loop\_set()}
{\footnotesize\ttfamily int osmo\+\_\+sock\+\_\+mcast\+\_\+loop\+\_\+set (\begin{DoxyParamCaption}\item[{int}]{fd,  }\item[{bool}]{enable }\end{DoxyParamCaption})}

\mbox{\label{group__socket_gae601bc27d51581ce69e4ea5ab35e8c8f}} 
\index{Socket convenience functions@{Socket convenience functions}!osmo\_sock\_mcast\_subscribe@{osmo\_sock\_mcast\_subscribe}}
\index{osmo\_sock\_mcast\_subscribe@{osmo\_sock\_mcast\_subscribe}!Socket convenience functions@{Socket convenience functions}}
\doxysubsubsection{osmo\_sock\_mcast\_subscribe()}
{\footnotesize\ttfamily int osmo\+\_\+sock\+\_\+mcast\+\_\+subscribe (\begin{DoxyParamCaption}\item[{int}]{fd,  }\item[{const char $\ast$}]{grp\+\_\+addr }\end{DoxyParamCaption})}

\mbox{\label{group__socket_ga9a131f0fa9fb28ac1352081cd999b964}} 
\index{Socket convenience functions@{Socket convenience functions}!osmo\_sock\_mcast\_ttl\_set@{osmo\_sock\_mcast\_ttl\_set}}
\index{osmo\_sock\_mcast\_ttl\_set@{osmo\_sock\_mcast\_ttl\_set}!Socket convenience functions@{Socket convenience functions}}
\doxysubsubsection{osmo\_sock\_mcast\_ttl\_set()}
{\footnotesize\ttfamily int osmo\+\_\+sock\+\_\+mcast\+\_\+ttl\+\_\+set (\begin{DoxyParamCaption}\item[{int}]{fd,  }\item[{uint8\+\_\+t}]{ttl }\end{DoxyParamCaption})}

\mbox{\label{group__socket_ga231f23f7e66925c7b749f1b4a9614034}} 
\index{Socket convenience functions@{Socket convenience functions}!osmo\_sock\_multiaddr\_add\_local\_addr@{osmo\_sock\_multiaddr\_add\_local\_addr}}
\index{osmo\_sock\_multiaddr\_add\_local\_addr@{osmo\_sock\_multiaddr\_add\_local\_addr}!Socket convenience functions@{Socket convenience functions}}
\doxysubsubsection{osmo\_sock\_multiaddr\_add\_local\_addr()}
{\footnotesize\ttfamily int osmo\+\_\+sock\+\_\+multiaddr\+\_\+add\+\_\+local\+\_\+addr (\begin{DoxyParamCaption}\item[{int}]{sfd,  }\item[{const char $\ast$$\ast$}]{addrs,  }\item[{size\+\_\+t}]{addrs\+\_\+cnt }\end{DoxyParamCaption})}

\mbox{\label{group__socket_ga519eca10e77a28ce141510f9f2816119}} 
\index{Socket convenience functions@{Socket convenience functions}!osmo\_sock\_multiaddr\_del\_local\_addr@{osmo\_sock\_multiaddr\_del\_local\_addr}}
\index{osmo\_sock\_multiaddr\_del\_local\_addr@{osmo\_sock\_multiaddr\_del\_local\_addr}!Socket convenience functions@{Socket convenience functions}}
\doxysubsubsection{osmo\_sock\_multiaddr\_del\_local\_addr()}
{\footnotesize\ttfamily int osmo\+\_\+sock\+\_\+multiaddr\+\_\+del\+\_\+local\+\_\+addr (\begin{DoxyParamCaption}\item[{int}]{sfd,  }\item[{const char $\ast$$\ast$}]{addrs,  }\item[{size\+\_\+t}]{addrs\+\_\+cnt }\end{DoxyParamCaption})}

\mbox{\label{group__socket_ga8a6ba657e144a51505b3b702f2ef2514}} 
\index{Socket convenience functions@{Socket convenience functions}!osmo\_sock\_multiaddr\_get\_ip\_and\_port@{osmo\_sock\_multiaddr\_get\_ip\_and\_port}}
\index{osmo\_sock\_multiaddr\_get\_ip\_and\_port@{osmo\_sock\_multiaddr\_get\_ip\_and\_port}!Socket convenience functions@{Socket convenience functions}}
\doxysubsubsection{osmo\_sock\_multiaddr\_get\_ip\_and\_port()}
{\footnotesize\ttfamily int osmo\+\_\+sock\+\_\+multiaddr\+\_\+get\+\_\+ip\+\_\+and\+\_\+port (\begin{DoxyParamCaption}\item[{int}]{fd,  }\item[{int}]{ip\+\_\+proto,  }\item[{char $\ast$}]{ip,  }\item[{size\+\_\+t $\ast$}]{ip\+\_\+cnt,  }\item[{size\+\_\+t}]{ip\+\_\+len,  }\item[{char $\ast$}]{port,  }\item[{size\+\_\+t}]{port\+\_\+len,  }\item[{bool}]{local }\end{DoxyParamCaption})}

\mbox{\label{group__socket_gaecc22fd01a9c7d25977b3ead3cdf8be2}} 
\index{Socket convenience functions@{Socket convenience functions}!osmo\_sock\_multiaddr\_get\_name\_buf@{osmo\_sock\_multiaddr\_get\_name\_buf}}
\index{osmo\_sock\_multiaddr\_get\_name\_buf@{osmo\_sock\_multiaddr\_get\_name\_buf}!Socket convenience functions@{Socket convenience functions}}
\doxysubsubsection{osmo\_sock\_multiaddr\_get\_name\_buf()}
{\footnotesize\ttfamily int osmo\+\_\+sock\+\_\+multiaddr\+\_\+get\+\_\+name\+\_\+buf (\begin{DoxyParamCaption}\item[{char $\ast$}]{str,  }\item[{size\+\_\+t}]{str\+\_\+len,  }\item[{int}]{fd,  }\item[{int}]{sk\+\_\+proto }\end{DoxyParamCaption})}

\mbox{\label{group__socket_ga6ac818fa65b39d9a091ccb7ab0258cd2}} 
\index{Socket convenience functions@{Socket convenience functions}!osmo\_sock\_sctp\_get\_peer\_addr\_info@{osmo\_sock\_sctp\_get\_peer\_addr\_info}}
\index{osmo\_sock\_sctp\_get\_peer\_addr\_info@{osmo\_sock\_sctp\_get\_peer\_addr\_info}!Socket convenience functions@{Socket convenience functions}}
\doxysubsubsection{osmo\_sock\_sctp\_get\_peer\_addr\_info()}
{\footnotesize\ttfamily int osmo\+\_\+sock\+\_\+sctp\+\_\+get\+\_\+peer\+\_\+addr\+\_\+info (\begin{DoxyParamCaption}\item[{int}]{fd,  }\item[{struct sctp\+\_\+paddrinfo $\ast$}]{pinfo,  }\item[{size\+\_\+t $\ast$}]{pinfo\+\_\+cnt }\end{DoxyParamCaption})}

\mbox{\label{group__socket_ga9ccc0f95ae62e250a454e544c2595e47}} 
\index{Socket convenience functions@{Socket convenience functions}!osmo\_sock\_set\_dscp@{osmo\_sock\_set\_dscp}}
\index{osmo\_sock\_set\_dscp@{osmo\_sock\_set\_dscp}!Socket convenience functions@{Socket convenience functions}}
\doxysubsubsection{osmo\_sock\_set\_dscp()}
{\footnotesize\ttfamily int osmo\+\_\+sock\+\_\+set\+\_\+dscp (\begin{DoxyParamCaption}\item[{int}]{fd,  }\item[{uint8\+\_\+t}]{dscp }\end{DoxyParamCaption})}

\mbox{\label{group__socket_gae5d5dec8c60cbf646b2f23dd74645bd9}} 
\index{Socket convenience functions@{Socket convenience functions}!osmo\_sock\_set\_nonblock@{osmo\_sock\_set\_nonblock}}
\index{osmo\_sock\_set\_nonblock@{osmo\_sock\_set\_nonblock}!Socket convenience functions@{Socket convenience functions}}
\doxysubsubsection{osmo\_sock\_set\_nonblock()}
{\footnotesize\ttfamily int osmo\+\_\+sock\+\_\+set\+\_\+nonblock (\begin{DoxyParamCaption}\item[{int}]{fd,  }\item[{int}]{on }\end{DoxyParamCaption})}

\mbox{\label{group__socket_ga5066129f926cd67d45d57225931741a1}} 
\index{Socket convenience functions@{Socket convenience functions}!osmo\_sock\_set\_priority@{osmo\_sock\_set\_priority}}
\index{osmo\_sock\_set\_priority@{osmo\_sock\_set\_priority}!Socket convenience functions@{Socket convenience functions}}
\doxysubsubsection{osmo\_sock\_set\_priority()}
{\footnotesize\ttfamily int osmo\+\_\+sock\+\_\+set\+\_\+priority (\begin{DoxyParamCaption}\item[{int}]{fd,  }\item[{int}]{prio }\end{DoxyParamCaption})}

\mbox{\label{group__socket_gad444f45f056e27aab3687c19b2e52753}} 
\index{Socket convenience functions@{Socket convenience functions}!osmo\_sock\_unix\_init@{osmo\_sock\_unix\_init}}
\index{osmo\_sock\_unix\_init@{osmo\_sock\_unix\_init}!Socket convenience functions@{Socket convenience functions}}
\doxysubsubsection{osmo\_sock\_unix\_init()}
{\footnotesize\ttfamily int osmo\+\_\+sock\+\_\+unix\+\_\+init (\begin{DoxyParamCaption}\item[{uint16\+\_\+t}]{type,  }\item[{uint8\+\_\+t}]{proto,  }\item[{const char $\ast$}]{socket\+\_\+path,  }\item[{unsigned int}]{flags }\end{DoxyParamCaption})}

\mbox{\label{group__socket_ga97e142eb8d6437d16f916c3d03f6dd3c}} 
\index{Socket convenience functions@{Socket convenience functions}!osmo\_sock\_unix\_init\_ofd@{osmo\_sock\_unix\_init\_ofd}}
\index{osmo\_sock\_unix\_init\_ofd@{osmo\_sock\_unix\_init\_ofd}!Socket convenience functions@{Socket convenience functions}}
\doxysubsubsection{osmo\_sock\_unix\_init\_ofd()}
{\footnotesize\ttfamily int osmo\+\_\+sock\+\_\+unix\+\_\+init\+\_\+ofd (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+fd} $\ast$}]{ofd,  }\item[{uint16\+\_\+t}]{type,  }\item[{uint8\+\_\+t}]{proto,  }\item[{const char $\ast$}]{socket\+\_\+path,  }\item[{unsigned int}]{flags }\end{DoxyParamCaption})}

\mbox{\label{group__socket_ga00b04e05323b733fa52937ccdb5e7afd}} 
\index{Socket convenience functions@{Socket convenience functions}!osmo\_sockaddr\_cmp@{osmo\_sockaddr\_cmp}}
\index{osmo\_sockaddr\_cmp@{osmo\_sockaddr\_cmp}!Socket convenience functions@{Socket convenience functions}}
\doxysubsubsection{osmo\_sockaddr\_cmp()}
{\footnotesize\ttfamily int osmo\+\_\+sockaddr\+\_\+cmp (\begin{DoxyParamCaption}\item[{const struct \textbf{ osmo\+\_\+sockaddr} $\ast$}]{a,  }\item[{const struct \textbf{ osmo\+\_\+sockaddr} $\ast$}]{b }\end{DoxyParamCaption})}

\mbox{\label{group__socket_ga86058fac21a55fd2f7710defe338f3aa}} 
\index{Socket convenience functions@{Socket convenience functions}!osmo\_sockaddr\_from\_octets@{osmo\_sockaddr\_from\_octets}}
\index{osmo\_sockaddr\_from\_octets@{osmo\_sockaddr\_from\_octets}!Socket convenience functions@{Socket convenience functions}}
\doxysubsubsection{osmo\_sockaddr\_from\_octets()}
{\footnotesize\ttfamily int osmo\+\_\+sockaddr\+\_\+from\+\_\+octets (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+sockaddr} $\ast$}]{os,  }\item[{const void $\ast$}]{src,  }\item[{size\+\_\+t}]{src\+\_\+len }\end{DoxyParamCaption})}

\mbox{\label{group__socket_ga5ce65b23c53fa2e03b5b37d170fea066}} 
\index{Socket convenience functions@{Socket convenience functions}!osmo\_sockaddr\_from\_str\_and\_uint@{osmo\_sockaddr\_from\_str\_and\_uint}}
\index{osmo\_sockaddr\_from\_str\_and\_uint@{osmo\_sockaddr\_from\_str\_and\_uint}!Socket convenience functions@{Socket convenience functions}}
\doxysubsubsection{osmo\_sockaddr\_from\_str\_and\_uint()}
{\footnotesize\ttfamily int osmo\+\_\+sockaddr\+\_\+from\+\_\+str\+\_\+and\+\_\+uint (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+sockaddr} $\ast$}]{osa\+\_\+out,  }\item[{const char $\ast$}]{ipstr,  }\item[{uint16\+\_\+t}]{port }\end{DoxyParamCaption})}

\mbox{\label{group__socket_ga0695d8b527844e0d635536a66f0276a4}} 
\index{Socket convenience functions@{Socket convenience functions}!osmo\_sockaddr\_in\_to\_str\_and\_uint@{osmo\_sockaddr\_in\_to\_str\_and\_uint}}
\index{osmo\_sockaddr\_in\_to\_str\_and\_uint@{osmo\_sockaddr\_in\_to\_str\_and\_uint}!Socket convenience functions@{Socket convenience functions}}
\doxysubsubsection{osmo\_sockaddr\_in\_to\_str\_and\_uint()}
{\footnotesize\ttfamily size\+\_\+t osmo\+\_\+sockaddr\+\_\+in\+\_\+to\+\_\+str\+\_\+and\+\_\+uint (\begin{DoxyParamCaption}\item[{char $\ast$}]{addr,  }\item[{unsigned int}]{addr\+\_\+len,  }\item[{uint16\+\_\+t $\ast$}]{port,  }\item[{const struct sockaddr\+\_\+in $\ast$}]{sin }\end{DoxyParamCaption})}

\mbox{\label{group__socket_ga4cf2d01f4571c6c41e63f739c2801a3d}} 
\index{Socket convenience functions@{Socket convenience functions}!osmo\_sockaddr\_is\_any@{osmo\_sockaddr\_is\_any}}
\index{osmo\_sockaddr\_is\_any@{osmo\_sockaddr\_is\_any}!Socket convenience functions@{Socket convenience functions}}
\doxysubsubsection{osmo\_sockaddr\_is\_any()}
{\footnotesize\ttfamily int osmo\+\_\+sockaddr\+\_\+is\+\_\+any (\begin{DoxyParamCaption}\item[{const struct \textbf{ osmo\+\_\+sockaddr} $\ast$}]{addr }\end{DoxyParamCaption})}

\mbox{\label{group__socket_gaada6ed9f0b165ba0d5b87b296019a3c3}} 
\index{Socket convenience functions@{Socket convenience functions}!osmo\_sockaddr\_is\_local@{osmo\_sockaddr\_is\_local}}
\index{osmo\_sockaddr\_is\_local@{osmo\_sockaddr\_is\_local}!Socket convenience functions@{Socket convenience functions}}
\doxysubsubsection{osmo\_sockaddr\_is\_local()}
{\footnotesize\ttfamily int osmo\+\_\+sockaddr\+\_\+is\+\_\+local (\begin{DoxyParamCaption}\item[{struct sockaddr $\ast$}]{addr,  }\item[{unsigned int}]{addrlen }\end{DoxyParamCaption})}

\mbox{\label{group__socket_ga485530c80633f84427da59f27be8f0f2}} 
\index{Socket convenience functions@{Socket convenience functions}!osmo\_sockaddr\_local\_ip@{osmo\_sockaddr\_local\_ip}}
\index{osmo\_sockaddr\_local\_ip@{osmo\_sockaddr\_local\_ip}!Socket convenience functions@{Socket convenience functions}}
\doxysubsubsection{osmo\_sockaddr\_local\_ip()}
{\footnotesize\ttfamily int osmo\+\_\+sockaddr\+\_\+local\+\_\+ip (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+sockaddr} $\ast$}]{local\+\_\+ip,  }\item[{const struct \textbf{ osmo\+\_\+sockaddr} $\ast$}]{remote\+\_\+ip }\end{DoxyParamCaption})}

\mbox{\label{group__socket_ga72afd420dd1cbe5f53661e1e2421a8e0}} 
\index{Socket convenience functions@{Socket convenience functions}!osmo\_sockaddr\_netmask\_to\_prefixlen@{osmo\_sockaddr\_netmask\_to\_prefixlen}}
\index{osmo\_sockaddr\_netmask\_to\_prefixlen@{osmo\_sockaddr\_netmask\_to\_prefixlen}!Socket convenience functions@{Socket convenience functions}}
\doxysubsubsection{osmo\_sockaddr\_netmask\_to\_prefixlen()}
{\footnotesize\ttfamily int osmo\+\_\+sockaddr\+\_\+netmask\+\_\+to\+\_\+prefixlen (\begin{DoxyParamCaption}\item[{const struct \textbf{ osmo\+\_\+sockaddr} $\ast$}]{addr }\end{DoxyParamCaption})}

\mbox{\label{group__socket_ga28fe7ce47715dbea88271b0ed6fa2404}} 
\index{Socket convenience functions@{Socket convenience functions}!osmo\_sockaddr\_ntop@{osmo\_sockaddr\_ntop}}
\index{osmo\_sockaddr\_ntop@{osmo\_sockaddr\_ntop}!Socket convenience functions@{Socket convenience functions}}
\doxysubsubsection{osmo\_sockaddr\_ntop()}
{\footnotesize\ttfamily const char $\ast$ osmo\+\_\+sockaddr\+\_\+ntop (\begin{DoxyParamCaption}\item[{const struct sockaddr $\ast$}]{sa,  }\item[{char $\ast$}]{dst }\end{DoxyParamCaption})}



Referenced by \textbf{ osmo\+\_\+netdev\+\_\+add\+\_\+addr()}, and \textbf{ osmo\+\_\+netdev\+\_\+add\+\_\+route()}.

\mbox{\label{group__socket_ga3a3a807a0cfac8ba92e4fab518a1dce8}} 
\index{Socket convenience functions@{Socket convenience functions}!osmo\_sockaddr\_port@{osmo\_sockaddr\_port}}
\index{osmo\_sockaddr\_port@{osmo\_sockaddr\_port}!Socket convenience functions@{Socket convenience functions}}
\doxysubsubsection{osmo\_sockaddr\_port()}
{\footnotesize\ttfamily uint16\+\_\+t osmo\+\_\+sockaddr\+\_\+port (\begin{DoxyParamCaption}\item[{const struct sockaddr $\ast$}]{sa }\end{DoxyParamCaption})}

\mbox{\label{group__socket_ga345c1c06891aa2c9d02e352c5bc78eb8}} 
\index{Socket convenience functions@{Socket convenience functions}!osmo\_sockaddr\_set\_port@{osmo\_sockaddr\_set\_port}}
\index{osmo\_sockaddr\_set\_port@{osmo\_sockaddr\_set\_port}!Socket convenience functions@{Socket convenience functions}}
\doxysubsubsection{osmo\_sockaddr\_set\_port()}
{\footnotesize\ttfamily void osmo\+\_\+sockaddr\+\_\+set\+\_\+port (\begin{DoxyParamCaption}\item[{struct sockaddr $\ast$}]{sa,  }\item[{uint16\+\_\+t}]{port }\end{DoxyParamCaption})}

\mbox{\label{group__socket_ga2593ce381512d4616186386b4b46894e}} 
\index{Socket convenience functions@{Socket convenience functions}!osmo\_sockaddr\_size@{osmo\_sockaddr\_size}}
\index{osmo\_sockaddr\_size@{osmo\_sockaddr\_size}!Socket convenience functions@{Socket convenience functions}}
\doxysubsubsection{osmo\_sockaddr\_size()}
{\footnotesize\ttfamily static socklen\+\_\+t osmo\+\_\+sockaddr\+\_\+size (\begin{DoxyParamCaption}\item[{const struct \textbf{ osmo\+\_\+sockaddr} $\ast$}]{addr }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}



Return the size of the variant used in the address NOTE\+: This does not return the size of the in\{,6\}\+\_\+addr, but rather the size of the surrounding sockaddr\+\_\+in\{,6\}. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em addr} & the \doxyref{osmo\+\_\+sockaddr}{p.}{structosmo__sockaddr} to get the size of \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
the size of the struct variant being used. If the value in sa\+\_\+family is unsupported it will return the size of struct \doxyref{osmo\+\_\+sockaddr}{p.}{structosmo__sockaddr}. Returns 0 if addr is NULL. This way it can simply be a wrapper for sendto() which can be called with NULL/0 for dest\+\_\+addr / addrlen (and then behaves like a send() call). 
\end{DoxyReturn}


References \textbf{ osmo\+\_\+sockaddr\+::sa}, and \textbf{ osmo\+\_\+sockaddr\+::u}.



Referenced by \textbf{ iofd\+\_\+poll\+\_\+ofd\+\_\+cb\+\_\+recvmsg\+\_\+sendmsg()}, and \textbf{ osmo\+\_\+iofd\+\_\+sendto\+\_\+msgb()}.

\mbox{\label{group__socket_ga6e09b835c0d7fd46e07c3b51da3a950b}} 
\index{Socket convenience functions@{Socket convenience functions}!osmo\_sockaddr\_to\_octets@{osmo\_sockaddr\_to\_octets}}
\index{osmo\_sockaddr\_to\_octets@{osmo\_sockaddr\_to\_octets}!Socket convenience functions@{Socket convenience functions}}
\doxysubsubsection{osmo\_sockaddr\_to\_octets()}
{\footnotesize\ttfamily int osmo\+\_\+sockaddr\+\_\+to\+\_\+octets (\begin{DoxyParamCaption}\item[{uint8\+\_\+t $\ast$}]{dst,  }\item[{size\+\_\+t}]{dst\+\_\+maxlen,  }\item[{const struct \textbf{ osmo\+\_\+sockaddr} $\ast$}]{os }\end{DoxyParamCaption})}

\mbox{\label{group__socket_ga793ce40b40fad45721a9b81476c356d3}} 
\index{Socket convenience functions@{Socket convenience functions}!osmo\_sockaddr\_to\_str@{osmo\_sockaddr\_to\_str}}
\index{osmo\_sockaddr\_to\_str@{osmo\_sockaddr\_to\_str}!Socket convenience functions@{Socket convenience functions}}
\doxysubsubsection{osmo\_sockaddr\_to\_str()}
{\footnotesize\ttfamily const char $\ast$ osmo\+\_\+sockaddr\+\_\+to\+\_\+str (\begin{DoxyParamCaption}\item[{const struct \textbf{ osmo\+\_\+sockaddr} $\ast$}]{sockaddr }\end{DoxyParamCaption})}

\mbox{\label{group__socket_ga85e86cf67b2c967170b6a9068eb1a98d}} 
\index{Socket convenience functions@{Socket convenience functions}!osmo\_sockaddr\_to\_str\_and\_uint@{osmo\_sockaddr\_to\_str\_and\_uint}}
\index{osmo\_sockaddr\_to\_str\_and\_uint@{osmo\_sockaddr\_to\_str\_and\_uint}!Socket convenience functions@{Socket convenience functions}}
\doxysubsubsection{osmo\_sockaddr\_to\_str\_and\_uint()}
{\footnotesize\ttfamily unsigned int osmo\+\_\+sockaddr\+\_\+to\+\_\+str\+\_\+and\+\_\+uint (\begin{DoxyParamCaption}\item[{char $\ast$}]{addr,  }\item[{unsigned int}]{addr\+\_\+len,  }\item[{uint16\+\_\+t $\ast$}]{port,  }\item[{const struct sockaddr $\ast$}]{sa }\end{DoxyParamCaption})}

\mbox{\label{group__socket_ga352118db1d772f5af9eb08743d12fdcd}} 
\index{Socket convenience functions@{Socket convenience functions}!osmo\_sockaddr\_to\_str\_buf@{osmo\_sockaddr\_to\_str\_buf}}
\index{osmo\_sockaddr\_to\_str\_buf@{osmo\_sockaddr\_to\_str\_buf}!Socket convenience functions@{Socket convenience functions}}
\doxysubsubsection{osmo\_sockaddr\_to\_str\_buf()}
{\footnotesize\ttfamily char $\ast$ osmo\+\_\+sockaddr\+\_\+to\+\_\+str\+\_\+buf (\begin{DoxyParamCaption}\item[{char $\ast$}]{buf,  }\item[{size\+\_\+t}]{buf\+\_\+len,  }\item[{const struct \textbf{ osmo\+\_\+sockaddr} $\ast$}]{sockaddr }\end{DoxyParamCaption})}

\mbox{\label{group__socket_ga85363264fab8d26e417f6535f16f8382}} 
\index{Socket convenience functions@{Socket convenience functions}!osmo\_sockaddr\_to\_str\_buf2@{osmo\_sockaddr\_to\_str\_buf2}}
\index{osmo\_sockaddr\_to\_str\_buf2@{osmo\_sockaddr\_to\_str\_buf2}!Socket convenience functions@{Socket convenience functions}}
\doxysubsubsection{osmo\_sockaddr\_to\_str\_buf2()}
{\footnotesize\ttfamily int osmo\+\_\+sockaddr\+\_\+to\+\_\+str\+\_\+buf2 (\begin{DoxyParamCaption}\item[{char $\ast$}]{buf,  }\item[{size\+\_\+t}]{buf\+\_\+len,  }\item[{const struct \textbf{ osmo\+\_\+sockaddr} $\ast$}]{sockaddr }\end{DoxyParamCaption})}

\mbox{\label{group__socket_ga3859ef3f3d2bd5c3c6623b7838016ff9}} 
\index{Socket convenience functions@{Socket convenience functions}!osmo\_sockaddr\_to\_str\_c@{osmo\_sockaddr\_to\_str\_c}}
\index{osmo\_sockaddr\_to\_str\_c@{osmo\_sockaddr\_to\_str\_c}!Socket convenience functions@{Socket convenience functions}}
\doxysubsubsection{osmo\_sockaddr\_to\_str\_c()}
{\footnotesize\ttfamily char $\ast$ osmo\+\_\+sockaddr\+\_\+to\+\_\+str\+\_\+c (\begin{DoxyParamCaption}\item[{void $\ast$}]{ctx,  }\item[{const struct \textbf{ osmo\+\_\+sockaddr} $\ast$}]{sockaddr }\end{DoxyParamCaption})}

