\doxysection{include/osmocom/core/sockaddr\+\_\+str.h File Reference}
\label{sockaddr__str_8h}\index{include/osmocom/core/sockaddr\_str.h@{include/osmocom/core/sockaddr\_str.h}}


Common API to store an IP address and port.  


{\ttfamily \#include $<$stdint.\+h$>$}\newline
{\ttfamily \#include $<$stdbool.\+h$>$}\newline
{\ttfamily \#include $<$arpa/inet.\+h$>$}\newline
{\ttfamily \#include $<$osmocom/core/defs.\+h$>$}\newline
\doxysubsection*{Data Structures}
\begin{DoxyCompactItemize}
\item 
struct \textbf{ osmo\+\_\+sockaddr\+\_\+str}
\end{DoxyCompactItemize}
\doxysubsection*{Macros}
\begin{DoxyCompactItemize}
\item 
\#define \textbf{ OSMO\+\_\+\+SOCKADDR\+\_\+\+STR\+\_\+\+FMT}~\char`\"{}\%s\%s\%s\+:\%\textbf{ u}\char`\"{}
\begin{DoxyCompactList}\small\item\em Format string to print an \doxyref{osmo\+\_\+sockaddr\+\_\+str}{p.}{structosmo__sockaddr__str}. \end{DoxyCompactList}\item 
\#define \textbf{ OSMO\+\_\+\+SOCKADDR\+\_\+\+STR\+\_\+\+FMT\+\_\+\+ARGS\+\_\+\+NOT\+\_\+\+NULL}(\textbf{ R})
\item 
\#define \textbf{ OSMO\+\_\+\+SOCKADDR\+\_\+\+STR\+\_\+\+FMT\+\_\+\+ARGS}(\textbf{ R})
\end{DoxyCompactItemize}
\doxysubsection*{Functions}
\begin{DoxyCompactItemize}
\item 
int \textbf{ osmo\+\_\+ip\+\_\+str\+\_\+type} (const char $\ast$ip)
\item 
bool \textbf{ osmo\+\_\+sockaddr\+\_\+str\+\_\+is\+\_\+set} (const struct \textbf{ osmo\+\_\+sockaddr\+\_\+str} $\ast$sockaddr\+\_\+str)
\item 
bool \textbf{ osmo\+\_\+sockaddr\+\_\+str\+\_\+is\+\_\+nonzero} (const struct \textbf{ osmo\+\_\+sockaddr\+\_\+str} $\ast$sockaddr\+\_\+str)
\item 
int \textbf{ osmo\+\_\+sockaddr\+\_\+str\+\_\+cmp} (const struct \textbf{ osmo\+\_\+sockaddr\+\_\+str} $\ast$a, const struct \textbf{ osmo\+\_\+sockaddr\+\_\+str} $\ast$b)
\item 
int \textbf{ osmo\+\_\+sockaddr\+\_\+str\+\_\+from\+\_\+str} (struct \textbf{ osmo\+\_\+sockaddr\+\_\+str} $\ast$sockaddr\+\_\+str, const char $\ast$ip, uint16\+\_\+t port)
\item 
int \textbf{ osmo\+\_\+sockaddr\+\_\+str\+\_\+from\+\_\+str2} (struct \textbf{ osmo\+\_\+sockaddr\+\_\+str} $\ast$sockaddr\+\_\+str, const char $\ast$ip)
\item 
int \textbf{ osmo\+\_\+sockaddr\+\_\+str\+\_\+from\+\_\+in\+\_\+addr} (struct \textbf{ osmo\+\_\+sockaddr\+\_\+str} $\ast$sockaddr\+\_\+str, const struct in\+\_\+addr $\ast$addr, uint16\+\_\+t port)
\item 
int \textbf{ osmo\+\_\+sockaddr\+\_\+str\+\_\+from\+\_\+in6\+\_\+addr} (struct \textbf{ osmo\+\_\+sockaddr\+\_\+str} $\ast$sockaddr\+\_\+str, const struct in6\+\_\+addr $\ast$addr, uint16\+\_\+t port)
\item 
int \textbf{ osmo\+\_\+sockaddr\+\_\+str\+\_\+from\+\_\+32} (struct \textbf{ osmo\+\_\+sockaddr\+\_\+str} $\ast$sockaddr\+\_\+str, uint32\+\_\+t ip, uint16\+\_\+t port)
\item 
int \textbf{ osmo\+\_\+sockaddr\+\_\+str\+\_\+from\+\_\+32h} (struct \textbf{ osmo\+\_\+sockaddr\+\_\+str} $\ast$sockaddr\+\_\+str, uint32\+\_\+t ip, uint16\+\_\+t port)
\item 
int \textbf{ osmo\+\_\+sockaddr\+\_\+str\+\_\+from\+\_\+sockaddr\+\_\+in} (struct \textbf{ osmo\+\_\+sockaddr\+\_\+str} $\ast$sockaddr\+\_\+str, const struct sockaddr\+\_\+in $\ast$src)
\item 
int \textbf{ osmo\+\_\+sockaddr\+\_\+str\+\_\+from\+\_\+sockaddr\+\_\+in6} (struct \textbf{ osmo\+\_\+sockaddr\+\_\+str} $\ast$sockaddr\+\_\+str, const struct sockaddr\+\_\+in6 $\ast$src)
\item 
int \textbf{ osmo\+\_\+sockaddr\+\_\+str\+\_\+from\+\_\+sockaddr} (struct \textbf{ osmo\+\_\+sockaddr\+\_\+str} $\ast$sockaddr\+\_\+str, const struct sockaddr\+\_\+storage $\ast$src)
\item 
int \textbf{ osmo\+\_\+sockaddr\+\_\+str\+\_\+from\+\_\+osa} (struct \textbf{ osmo\+\_\+sockaddr\+\_\+str} $\ast$sockaddr\+\_\+str, const struct \textbf{ osmo\+\_\+sockaddr} $\ast$src)
\item 
int \textbf{ osmo\+\_\+sockaddr\+\_\+str\+\_\+to\+\_\+in\+\_\+addr} (const struct \textbf{ osmo\+\_\+sockaddr\+\_\+str} $\ast$sockaddr\+\_\+str, struct in\+\_\+addr $\ast$dst)
\item 
int \textbf{ osmo\+\_\+sockaddr\+\_\+str\+\_\+to\+\_\+in6\+\_\+addr} (const struct \textbf{ osmo\+\_\+sockaddr\+\_\+str} $\ast$sockaddr\+\_\+str, struct in6\+\_\+addr $\ast$dst)
\item 
int \textbf{ osmo\+\_\+sockaddr\+\_\+str\+\_\+to\+\_\+32} (const struct \textbf{ osmo\+\_\+sockaddr\+\_\+str} $\ast$sockaddr\+\_\+str, uint32\+\_\+t $\ast$ip)
\item 
int \textbf{ osmo\+\_\+sockaddr\+\_\+str\+\_\+to\+\_\+32h} (const struct \textbf{ osmo\+\_\+sockaddr\+\_\+str} $\ast$sockaddr\+\_\+str, uint32\+\_\+t $\ast$ip)
\item 
int \textbf{ osmo\+\_\+sockaddr\+\_\+str\+\_\+to\+\_\+sockaddr\+\_\+in} (const struct \textbf{ osmo\+\_\+sockaddr\+\_\+str} $\ast$sockaddr\+\_\+str, struct sockaddr\+\_\+in $\ast$dst)
\item 
int \textbf{ osmo\+\_\+sockaddr\+\_\+str\+\_\+to\+\_\+sockaddr\+\_\+in6} (const struct \textbf{ osmo\+\_\+sockaddr\+\_\+str} $\ast$sockaddr\+\_\+str, struct sockaddr\+\_\+in6 $\ast$dst)
\item 
int \textbf{ osmo\+\_\+sockaddr\+\_\+str\+\_\+to\+\_\+sockaddr} (const struct \textbf{ osmo\+\_\+sockaddr\+\_\+str} $\ast$sockaddr\+\_\+str, struct sockaddr\+\_\+storage $\ast$dst)
\item 
int \textbf{ osmo\+\_\+sockaddr\+\_\+str\+\_\+to\+\_\+osa} (const struct \textbf{ osmo\+\_\+sockaddr\+\_\+str} $\ast$sockaddr\+\_\+str, struct \textbf{ osmo\+\_\+sockaddr} $\ast$dst)
\item 
int \textbf{ osmo\+\_\+sockaddr\+\_\+str\+\_\+from\+\_\+32n} (struct \textbf{ osmo\+\_\+sockaddr\+\_\+str} $\ast$sockaddr\+\_\+str, uint32\+\_\+t ip, uint16\+\_\+t port) \textbf{ OSMO\+\_\+\+DEPRECATED}(\char`\"{}osmo\+\_\+sockaddr\+\_\+str\+\_\+from\+\_\+32n() actually uses $\ast$\textbf{ host}$\ast$ byte order. Use \textbf{ osmo\+\_\+sockaddr\+\_\+str\+\_\+from\+\_\+32h}() \textbf{ instead}\char`\"{})
\item 
int \textbf{ osmo\+\_\+sockaddr\+\_\+str\+\_\+to\+\_\+32n} (const struct \textbf{ osmo\+\_\+sockaddr\+\_\+str} $\ast$sockaddr\+\_\+str, uint32\+\_\+t $\ast$ip) \textbf{ OSMO\+\_\+\+DEPRECATED}(\char`\"{}osmo\+\_\+sockaddr\+\_\+str\+\_\+to\+\_\+32n() actually uses $\ast$\textbf{ host}$\ast$ byte order. Use \textbf{ osmo\+\_\+sockaddr\+\_\+str\+\_\+to\+\_\+32h}() \textbf{ instead}\char`\"{})
\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}
Common API to store an IP address and port. 

