\doxysection{socket.\+h}
\label{socket_8h_source}\index{include/osmocom/core/socket.h@{include/osmocom/core/socket.h}}
\textbf{ Go to the documentation of this file.}
\begin{DoxyCode}{0}
\DoxyCodeLine{1 }
\DoxyCodeLine{4 \textcolor{preprocessor}{\#pragma once}}
\DoxyCodeLine{5 }
\DoxyCodeLine{10 \textcolor{preprocessor}{\#include <stdint.h>}}
\DoxyCodeLine{11 \textcolor{preprocessor}{\#include <stdbool.h>}}
\DoxyCodeLine{12 \textcolor{preprocessor}{\#include <stddef.h>}}
\DoxyCodeLine{13 }
\DoxyCodeLine{14 \textcolor{preprocessor}{\#include <osmocom/core/defs.h>}}
\DoxyCodeLine{15 \textcolor{preprocessor}{\#include <osmocom/core/socket\_compat.h>}}
\DoxyCodeLine{16 }
\DoxyCodeLine{18 \textcolor{preprocessor}{\#define OSMO\_SOCK\_MAX\_ADDRS 32}}
\DoxyCodeLine{19 }
\DoxyCodeLine{21 \textcolor{preprocessor}{\#define OSMO\_SOCK\_NAME\_MAXLEN (2 + INET6\_ADDRSTRLEN + 1 + 5 + 3 + 2 + INET6\_ADDRSTRLEN + 1 + 5 + 1)}}
\DoxyCodeLine{22 }
\DoxyCodeLine{26 \textcolor{preprocessor}{\#define OSMO\_SOCK\_MULTIADDR\_PEER\_STR\_MAXLEN (INET6\_ADDRSTRLEN * OSMO\_SOCK\_MAX\_ADDRS + INET6\_ADDRSTRLEN + 2 + 6 + 1)}}
\DoxyCodeLine{28 \textcolor{preprocessor}{\#define OSMO\_SOCK\_MULTIADDR\_NAME\_MAXLEN (OSMO\_SOCK\_MULTIADDR\_PEER\_STR\_MAXLEN + 7)}}
\DoxyCodeLine{29 }
\DoxyCodeLine{30 \textcolor{keyword}{struct }osmo\_fd;}
\DoxyCodeLine{31 \textcolor{keyword}{struct }sctp\_paddrinfo;}
\DoxyCodeLine{32 }
\DoxyCodeLine{33 \textcolor{keyword}{struct }osmo\_sockaddr \{}
\DoxyCodeLine{34         \textcolor{keyword}{union }\{}
\DoxyCodeLine{35                 \textcolor{keyword}{struct }sockaddr sa;}
\DoxyCodeLine{36                 \textcolor{keyword}{struct }sockaddr\_storage sas;}
\DoxyCodeLine{37                 \textcolor{keyword}{struct }sockaddr\_in sin;}
\DoxyCodeLine{38                 \textcolor{keyword}{struct }sockaddr\_in6 sin6;}
\DoxyCodeLine{39         \} u;}
\DoxyCodeLine{40 \};}
\DoxyCodeLine{41 }
\DoxyCodeLine{42 \textcolor{keywordtype}{int} osmo\_sockaddr\_is\_local(\textcolor{keyword}{struct} sockaddr *addr, \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{int} addrlen);}
\DoxyCodeLine{43 \textcolor{keywordtype}{int} osmo\_sockaddr\_is\_any(\textcolor{keyword}{const} \textcolor{keyword}{struct} osmo\_sockaddr *addr);}
\DoxyCodeLine{44 }
\DoxyCodeLine{53 \textcolor{keyword}{static} \textcolor{keyword}{inline} socklen\_t osmo\_sockaddr\_size(\textcolor{keyword}{const} \textcolor{keyword}{struct} osmo\_sockaddr *addr)}
\DoxyCodeLine{54 \{}
\DoxyCodeLine{55         \textcolor{keywordflow}{if} (!addr)}
\DoxyCodeLine{56                 \textcolor{keywordflow}{return} 0;}
\DoxyCodeLine{57 \textcolor{preprocessor}{\#if \_\_LIBOSMOCORE\_HAVE\_SYS\_SOCKET\_H}}
\DoxyCodeLine{58         \textcolor{keywordflow}{switch} (addr-\/>u.sa.sa\_family) \{}
\DoxyCodeLine{59         \textcolor{keywordflow}{case} AF\_INET:}
\DoxyCodeLine{60                 \textcolor{keywordflow}{return} \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct }sockaddr\_in);}
\DoxyCodeLine{61         \textcolor{keywordflow}{case} AF\_INET6:}
\DoxyCodeLine{62                 \textcolor{keywordflow}{return} \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct }sockaddr\_in6);}
\DoxyCodeLine{63         \textcolor{keywordflow}{default}:}
\DoxyCodeLine{64                 \textcolor{keywordflow}{return} \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct }osmo\_sockaddr);}
\DoxyCodeLine{65         \}}
\DoxyCodeLine{66 \textcolor{preprocessor}{\#else}}
\DoxyCodeLine{67         \textcolor{keywordflow}{return} 0;}
\DoxyCodeLine{68 \textcolor{preprocessor}{\#endif }\textcolor{comment}{/* if \_\_LIBOSMOCORE\_HAVE\_SYS\_SOCKET\_H */}\textcolor{preprocessor}{}}
\DoxyCodeLine{69 \}}
\DoxyCodeLine{70 }
\DoxyCodeLine{71 \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{int} osmo\_sockaddr\_to\_str\_and\_uint(\textcolor{keywordtype}{char} *addr, \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{int} addr\_len, uint16\_t *port,}
\DoxyCodeLine{72                                            \textcolor{keyword}{const} \textcolor{keyword}{struct} sockaddr *sa);}
\DoxyCodeLine{73 \textcolor{keywordtype}{size\_t} osmo\_sockaddr\_in\_to\_str\_and\_uint(\textcolor{keywordtype}{char} *addr, \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{int} addr\_len, uint16\_t *port,}
\DoxyCodeLine{74                                         \textcolor{keyword}{const} \textcolor{keyword}{struct} sockaddr\_in *sin);}
\DoxyCodeLine{75 }
\DoxyCodeLine{76 \textcolor{keyword}{const} \textcolor{keywordtype}{char} *osmo\_sockaddr\_ntop(\textcolor{keyword}{const} \textcolor{keyword}{struct} sockaddr *sa, \textcolor{keywordtype}{char} *dst);}
\DoxyCodeLine{77 uint16\_t osmo\_sockaddr\_port(\textcolor{keyword}{const} \textcolor{keyword}{struct} sockaddr *sa);}
\DoxyCodeLine{78 \textcolor{keywordtype}{void} osmo\_sockaddr\_set\_port(\textcolor{keyword}{struct} sockaddr *sa, uint16\_t port);}
\DoxyCodeLine{79 }
\DoxyCodeLine{80 \textcolor{keywordtype}{int} osmo\_sockaddr\_local\_ip(\textcolor{keyword}{struct} osmo\_sockaddr *local\_ip,}
\DoxyCodeLine{81                            \textcolor{keyword}{const} \textcolor{keyword}{struct} osmo\_sockaddr *remote\_ip);}
\DoxyCodeLine{82 \textcolor{keywordtype}{int} osmo\_sockaddr\_cmp(\textcolor{keyword}{const} \textcolor{keyword}{struct} osmo\_sockaddr *a,}
\DoxyCodeLine{83                       \textcolor{keyword}{const} \textcolor{keyword}{struct} osmo\_sockaddr *b);}
\DoxyCodeLine{84 }
\DoxyCodeLine{85 \textcolor{keywordtype}{int} osmo\_sockaddr\_to\_octets(uint8\_t *dst, \textcolor{keywordtype}{size\_t} dst\_maxlen, \textcolor{keyword}{const} \textcolor{keyword}{struct} osmo\_sockaddr *os);}
\DoxyCodeLine{86 \textcolor{keywordtype}{int} osmo\_sockaddr\_from\_octets(\textcolor{keyword}{struct} osmo\_sockaddr *os, \textcolor{keyword}{const} \textcolor{keywordtype}{void} *src, \textcolor{keywordtype}{size\_t} src\_len);}
\DoxyCodeLine{87 \textcolor{keywordtype}{int} osmo\_sockaddr\_from\_str\_and\_uint(\textcolor{keyword}{struct} osmo\_sockaddr *osa\_out, \textcolor{keyword}{const} \textcolor{keywordtype}{char} *ipstr, uint16\_t port);}
\DoxyCodeLine{88 }
\DoxyCodeLine{89 \textcolor{keywordtype}{int} osmo\_sockaddr\_netmask\_to\_prefixlen(\textcolor{keyword}{const} \textcolor{keyword}{struct} osmo\_sockaddr *addr);}
\DoxyCodeLine{90 }
\DoxyCodeLine{91 \textcolor{keyword}{const} \textcolor{keywordtype}{char} *osmo\_sockaddr\_to\_str(\textcolor{keyword}{const} \textcolor{keyword}{struct} osmo\_sockaddr *sockaddr);}
\DoxyCodeLine{92 \textcolor{keywordtype}{char} *osmo\_sockaddr\_to\_str\_buf(\textcolor{keywordtype}{char} *buf, \textcolor{keywordtype}{size\_t} buf\_len,}
\DoxyCodeLine{93                                \textcolor{keyword}{const} \textcolor{keyword}{struct} osmo\_sockaddr *sockaddr);}
\DoxyCodeLine{94 \textcolor{keywordtype}{int} osmo\_sockaddr\_to\_str\_buf2(\textcolor{keywordtype}{char} *buf, \textcolor{keywordtype}{size\_t} buf\_len, \textcolor{keyword}{const} \textcolor{keyword}{struct} osmo\_sockaddr *sockaddr);}
\DoxyCodeLine{95 \textcolor{keywordtype}{char} *osmo\_sockaddr\_to\_str\_c(\textcolor{keywordtype}{void} *ctx, \textcolor{keyword}{const} \textcolor{keyword}{struct} osmo\_sockaddr *sockaddr);}
\DoxyCodeLine{96 }
\DoxyCodeLine{97 \textcolor{comment}{/* flags for osmo\_sock\_init. */}}
\DoxyCodeLine{99 \textcolor{preprocessor}{\#define OSMO\_SOCK\_F\_CONNECT     (1 << 0)}}
\DoxyCodeLine{101 \textcolor{preprocessor}{\#define OSMO\_SOCK\_F\_BIND        (1 << 1)}}
\DoxyCodeLine{103 \textcolor{preprocessor}{\#define OSMO\_SOCK\_F\_NONBLOCK    (1 << 2)}}
\DoxyCodeLine{105 \textcolor{preprocessor}{\#define OSMO\_SOCK\_F\_NO\_MCAST\_LOOP (1 << 3)}}
\DoxyCodeLine{107 \textcolor{preprocessor}{\#define OSMO\_SOCK\_F\_NO\_MCAST\_ALL  (1 << 4)}}
\DoxyCodeLine{109 \textcolor{preprocessor}{\#define OSMO\_SOCK\_F\_UDP\_REUSEADDR (1 << 5)}}
\DoxyCodeLine{110 }
\DoxyCodeLine{112 \textcolor{preprocessor}{\#define OSMO\_SOCK\_F\_DSCP(x)     (((x)\&0x3f) << 24)}}
\DoxyCodeLine{113 \textcolor{preprocessor}{\#define GET\_OSMO\_SOCK\_F\_DSCP(f) (((f) >> 24) \& 0x3f)}}
\DoxyCodeLine{114 }
\DoxyCodeLine{116 \textcolor{preprocessor}{\#define OSMO\_SOCK\_F\_PRIO(x)     (((x)\&0xff) << 16)}}
\DoxyCodeLine{117 \textcolor{preprocessor}{\#define GET\_OSMO\_SOCK\_F\_PRIO(f) (((f) >> 16) \& 0xff)}}
\DoxyCodeLine{118 }
\DoxyCodeLine{119 }
\DoxyCodeLine{120 \textcolor{keywordtype}{int} osmo\_sock\_init(uint16\_t family, uint16\_t type, uint8\_t proto,}
\DoxyCodeLine{121                    \textcolor{keyword}{const} \textcolor{keywordtype}{char} *host, uint16\_t port, \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{int} flags);}
\DoxyCodeLine{122 }
\DoxyCodeLine{123 \textcolor{keywordtype}{int} osmo\_sock\_init2(uint16\_t family, uint16\_t type, uint8\_t proto,}
\DoxyCodeLine{124                    \textcolor{keyword}{const} \textcolor{keywordtype}{char} *local\_host, uint16\_t local\_port,}
\DoxyCodeLine{125                    \textcolor{keyword}{const} \textcolor{keywordtype}{char} *remote\_host, uint16\_t remote\_port, \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{int} flags);}
\DoxyCodeLine{126 }
\DoxyCodeLine{127 \textcolor{keyword}{struct }osmo\_sock\_init2\_multiaddr\_pars \{}
\DoxyCodeLine{128         \textcolor{keyword}{union }\{}
\DoxyCodeLine{129                 \textcolor{keyword}{struct }\{}
\DoxyCodeLine{130                         uint8\_t version; \textcolor{comment}{/* set to 0 */}}
\DoxyCodeLine{131                         \textcolor{keyword}{struct }\{}
\DoxyCodeLine{132                                 \textcolor{keywordtype}{bool} set;}
\DoxyCodeLine{133                                 \textcolor{keywordtype}{bool} abort\_on\_failure;}
\DoxyCodeLine{134                                 uint32\_t value;}
\DoxyCodeLine{135                         \} sockopt\_auth\_supported;}
\DoxyCodeLine{136                         \textcolor{keyword}{struct }\{}
\DoxyCodeLine{137                                 \textcolor{keywordtype}{bool} set;}
\DoxyCodeLine{138                                 \textcolor{keywordtype}{bool} abort\_on\_failure;}
\DoxyCodeLine{139                                 uint32\_t value;}
\DoxyCodeLine{140                         \} sockopt\_asconf\_supported;}
\DoxyCodeLine{141                         \textcolor{keyword}{struct }\{}
\DoxyCodeLine{142                                 \textcolor{keywordtype}{bool} set;}
\DoxyCodeLine{143                                 \textcolor{keywordtype}{bool} abort\_on\_failure;}
\DoxyCodeLine{144                                 \textcolor{keywordtype}{bool} num\_ostreams\_present;}
\DoxyCodeLine{145                                 \textcolor{keywordtype}{bool} max\_instreams\_present;}
\DoxyCodeLine{146                                 \textcolor{keywordtype}{bool} max\_attempts\_present;}
\DoxyCodeLine{147                                 \textcolor{keywordtype}{bool} max\_init\_timeo\_present;}
\DoxyCodeLine{148                                 uint16\_t num\_ostreams\_value;}
\DoxyCodeLine{149                                 uint16\_t max\_instreams\_value;}
\DoxyCodeLine{150                                 uint16\_t max\_attempts\_value;}
\DoxyCodeLine{151                                 uint16\_t max\_init\_timeo\_value;}
\DoxyCodeLine{152                         \} sockopt\_initmsg;}
\DoxyCodeLine{153                 \} sctp;}
\DoxyCodeLine{154         \};}
\DoxyCodeLine{155 \};}
\DoxyCodeLine{156 \textcolor{keywordtype}{int} osmo\_sock\_init2\_multiaddr(uint16\_t family, uint16\_t type, uint8\_t proto,}
\DoxyCodeLine{157                    \textcolor{keyword}{const} \textcolor{keywordtype}{char} **local\_hosts, \textcolor{keywordtype}{size\_t} local\_hosts\_cnt, uint16\_t local\_port,}
\DoxyCodeLine{158                    \textcolor{keyword}{const} \textcolor{keywordtype}{char} **remote\_hosts, \textcolor{keywordtype}{size\_t} remote\_hosts\_cnt, uint16\_t remote\_port, \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{int} flags)}
\DoxyCodeLine{159                    OSMO\_DEPRECATED\_OUTSIDE(\textcolor{stringliteral}{"{}Use osmo\_sock\_init2\_multiaddr2() instead"{}});}
\DoxyCodeLine{160 \textcolor{keywordtype}{int} osmo\_sock\_init2\_multiaddr2(uint16\_t family, uint16\_t type, uint8\_t proto,}
\DoxyCodeLine{161                    \textcolor{keyword}{const} \textcolor{keywordtype}{char} **local\_hosts, \textcolor{keywordtype}{size\_t} local\_hosts\_cnt, uint16\_t local\_port,}
\DoxyCodeLine{162                    \textcolor{keyword}{const} \textcolor{keywordtype}{char} **remote\_hosts, \textcolor{keywordtype}{size\_t} remote\_hosts\_cnt, uint16\_t remote\_port,}
\DoxyCodeLine{163                    \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{int} flags, \textcolor{keyword}{struct} osmo\_sock\_init2\_multiaddr\_pars *pars);}
\DoxyCodeLine{164 }
\DoxyCodeLine{165 \textcolor{keywordtype}{int} osmo\_sock\_init\_osa(uint16\_t type, uint8\_t proto,}
\DoxyCodeLine{166                     \textcolor{keyword}{const} \textcolor{keyword}{struct} osmo\_sockaddr *local,}
\DoxyCodeLine{167                     \textcolor{keyword}{const} \textcolor{keyword}{struct} osmo\_sockaddr *remote,}
\DoxyCodeLine{168                     \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{int} flags);}
\DoxyCodeLine{169 }
\DoxyCodeLine{170 \textcolor{keywordtype}{int} osmo\_sock\_init\_ofd(\textcolor{keyword}{struct} osmo\_fd *ofd, \textcolor{keywordtype}{int} family, \textcolor{keywordtype}{int} type, \textcolor{keywordtype}{int} proto,}
\DoxyCodeLine{171                         \textcolor{keyword}{const} \textcolor{keywordtype}{char} *host, uint16\_t port, \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{int} flags);}
\DoxyCodeLine{172 }
\DoxyCodeLine{173 \textcolor{keywordtype}{int} osmo\_sock\_init2\_ofd(\textcolor{keyword}{struct} osmo\_fd *ofd, \textcolor{keywordtype}{int} family, \textcolor{keywordtype}{int} type, \textcolor{keywordtype}{int} proto,}
\DoxyCodeLine{174                         \textcolor{keyword}{const} \textcolor{keywordtype}{char} *local\_host, uint16\_t local\_port,}
\DoxyCodeLine{175                         \textcolor{keyword}{const} \textcolor{keywordtype}{char} *remote\_host, uint16\_t remote\_port, \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{int} flags);}
\DoxyCodeLine{176 }
\DoxyCodeLine{177 \textcolor{keywordtype}{int} osmo\_sock\_init\_osa\_ofd(\textcolor{keyword}{struct} osmo\_fd *ofd, \textcolor{keywordtype}{int} type, \textcolor{keywordtype}{int} proto,}
\DoxyCodeLine{178                            \textcolor{keyword}{const} \textcolor{keyword}{struct} osmo\_sockaddr *local,}
\DoxyCodeLine{179                            \textcolor{keyword}{const} \textcolor{keyword}{struct} osmo\_sockaddr *remote,}
\DoxyCodeLine{180                            \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{int} flags);}
\DoxyCodeLine{181 }
\DoxyCodeLine{182 \textcolor{keywordtype}{int} osmo\_sock\_init\_sa(\textcolor{keyword}{struct} sockaddr *ss, uint16\_t type,}
\DoxyCodeLine{183                       uint8\_t proto, \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{int} flags);}
\DoxyCodeLine{184 }
\DoxyCodeLine{185 \textcolor{keywordtype}{int} osmo\_sock\_unix\_init(uint16\_t type, uint8\_t proto,}
\DoxyCodeLine{186                         \textcolor{keyword}{const} \textcolor{keywordtype}{char} *socket\_path, \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{int} flags);}
\DoxyCodeLine{187 }
\DoxyCodeLine{188 \textcolor{keywordtype}{int} osmo\_sock\_unix\_init\_ofd(\textcolor{keyword}{struct} osmo\_fd *ofd, uint16\_t type, uint8\_t proto,}
\DoxyCodeLine{189                             \textcolor{keyword}{const} \textcolor{keywordtype}{char} *socket\_path, \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{int} flags);}
\DoxyCodeLine{190 }
\DoxyCodeLine{191 \textcolor{keywordtype}{char} *osmo\_sock\_get\_name(\textcolor{keyword}{const} \textcolor{keywordtype}{void} *ctx, \textcolor{keywordtype}{int} fd);}
\DoxyCodeLine{192 \textcolor{keyword}{const} \textcolor{keywordtype}{char} *osmo\_sock\_get\_name2(\textcolor{keywordtype}{int} fd);}
\DoxyCodeLine{193 \textcolor{keywordtype}{char} *osmo\_sock\_get\_name2\_c(\textcolor{keyword}{const} \textcolor{keywordtype}{void} *ctx, \textcolor{keywordtype}{int} fd);}
\DoxyCodeLine{194 \textcolor{keywordtype}{int} osmo\_sock\_get\_name\_buf(\textcolor{keywordtype}{char} *str, \textcolor{keywordtype}{size\_t} str\_len, \textcolor{keywordtype}{int} fd);}
\DoxyCodeLine{195 \textcolor{keywordtype}{int} osmo\_sock\_get\_ip\_and\_port(\textcolor{keywordtype}{int} fd, \textcolor{keywordtype}{char} *ip, \textcolor{keywordtype}{size\_t} ip\_len, \textcolor{keywordtype}{char} *port, \textcolor{keywordtype}{size\_t} port\_len, \textcolor{keywordtype}{bool} local);}
\DoxyCodeLine{196 \textcolor{keywordtype}{int} osmo\_sock\_get\_local\_ip(\textcolor{keywordtype}{int} fd, \textcolor{keywordtype}{char} *host, \textcolor{keywordtype}{size\_t} len);}
\DoxyCodeLine{197 \textcolor{keywordtype}{int} osmo\_sock\_get\_local\_ip\_port(\textcolor{keywordtype}{int} fd, \textcolor{keywordtype}{char} *port, \textcolor{keywordtype}{size\_t} len);}
\DoxyCodeLine{198 \textcolor{keywordtype}{int} osmo\_sock\_get\_remote\_ip(\textcolor{keywordtype}{int} fd, \textcolor{keywordtype}{char} *host, \textcolor{keywordtype}{size\_t} len);}
\DoxyCodeLine{199 \textcolor{keywordtype}{int} osmo\_sock\_get\_remote\_ip\_port(\textcolor{keywordtype}{int} fd, \textcolor{keywordtype}{char} *port, \textcolor{keywordtype}{size\_t} len);}
\DoxyCodeLine{200 }
\DoxyCodeLine{201 \textcolor{keywordtype}{int} osmo\_sock\_multiaddr\_get\_ip\_and\_port(\textcolor{keywordtype}{int} fd, \textcolor{keywordtype}{int} ip\_proto, \textcolor{keywordtype}{char} *ip, \textcolor{keywordtype}{size\_t} *ip\_cnt, \textcolor{keywordtype}{size\_t} ip\_len,}
\DoxyCodeLine{202                                         \textcolor{keywordtype}{char} *port, \textcolor{keywordtype}{size\_t} port\_len, \textcolor{keywordtype}{bool} local);}
\DoxyCodeLine{203 \textcolor{keywordtype}{int} osmo\_multiaddr\_ip\_and\_port\_snprintf(\textcolor{keywordtype}{char} *str, \textcolor{keywordtype}{size\_t} str\_len,}
\DoxyCodeLine{204                                         \textcolor{keyword}{const} \textcolor{keywordtype}{char} *ip, \textcolor{keywordtype}{size\_t} ip\_cnt, \textcolor{keywordtype}{size\_t} ip\_len,}
\DoxyCodeLine{205                                         \textcolor{keyword}{const} \textcolor{keywordtype}{char} *portbuf);}
\DoxyCodeLine{206 \textcolor{keywordtype}{int} osmo\_sock\_multiaddr\_get\_name\_buf(\textcolor{keywordtype}{char} *str, \textcolor{keywordtype}{size\_t} str\_len, \textcolor{keywordtype}{int} fd, \textcolor{keywordtype}{int} sk\_proto);}
\DoxyCodeLine{207 \textcolor{keywordtype}{int} osmo\_sock\_multiaddr\_add\_local\_addr(\textcolor{keywordtype}{int} sfd, \textcolor{keyword}{const} \textcolor{keywordtype}{char} **addrs, \textcolor{keywordtype}{size\_t} addrs\_cnt);}
\DoxyCodeLine{208 \textcolor{keywordtype}{int} osmo\_sock\_multiaddr\_del\_local\_addr(\textcolor{keywordtype}{int} sfd, \textcolor{keyword}{const} \textcolor{keywordtype}{char} **addrs, \textcolor{keywordtype}{size\_t} addrs\_cnt);}
\DoxyCodeLine{209 }
\DoxyCodeLine{210 \textcolor{keywordtype}{int} osmo\_sock\_mcast\_loop\_set(\textcolor{keywordtype}{int} fd, \textcolor{keywordtype}{bool} enable);}
\DoxyCodeLine{211 \textcolor{keywordtype}{int} osmo\_sock\_mcast\_ttl\_set(\textcolor{keywordtype}{int} fd, uint8\_t ttl);}
\DoxyCodeLine{212 \textcolor{keywordtype}{int} osmo\_sock\_mcast\_all\_set(\textcolor{keywordtype}{int} fd, \textcolor{keywordtype}{bool} enable);}
\DoxyCodeLine{213 \textcolor{keywordtype}{int} osmo\_sock\_mcast\_iface\_set(\textcolor{keywordtype}{int} fd, \textcolor{keyword}{const} \textcolor{keywordtype}{char} *ifname);}
\DoxyCodeLine{214 \textcolor{keywordtype}{int} osmo\_sock\_mcast\_subscribe(\textcolor{keywordtype}{int} fd, \textcolor{keyword}{const} \textcolor{keywordtype}{char} *grp\_addr);}
\DoxyCodeLine{215 }
\DoxyCodeLine{216 \textcolor{keywordtype}{int} osmo\_sock\_local\_ip(\textcolor{keywordtype}{char} *local\_ip, \textcolor{keyword}{const} \textcolor{keywordtype}{char} *remote\_ip);}
\DoxyCodeLine{217 }
\DoxyCodeLine{218 \textcolor{keywordtype}{int} osmo\_sock\_set\_dscp(\textcolor{keywordtype}{int} fd, uint8\_t dscp);}
\DoxyCodeLine{219 \textcolor{keywordtype}{int} osmo\_sock\_set\_priority(\textcolor{keywordtype}{int} fd, \textcolor{keywordtype}{int} prio);}
\DoxyCodeLine{220 \textcolor{keywordtype}{int} osmo\_sock\_get\_nonblock(\textcolor{keywordtype}{int} fd);}
\DoxyCodeLine{221 \textcolor{keywordtype}{int} osmo\_sock\_set\_nonblock(\textcolor{keywordtype}{int} fd, \textcolor{keywordtype}{int} on);}
\DoxyCodeLine{222 }
\DoxyCodeLine{223 \textcolor{keywordtype}{int} osmo\_sock\_sctp\_get\_peer\_addr\_info(\textcolor{keywordtype}{int} fd, \textcolor{keyword}{struct} sctp\_paddrinfo *pinfo, \textcolor{keywordtype}{size\_t} *pinfo\_cnt);}
\DoxyCodeLine{224 }

\end{DoxyCode}
