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

\end{DoxyCode}
