\doxysection{src/gb/gprs\+\_\+ns2\+\_\+udp.c File Reference}
\label{gprs__ns2__udp_8c}\index{src/gb/gprs\_ns2\_udp.c@{src/gb/gprs\_ns2\_udp.c}}


NS-\/over-\/\+UDP implementation.  


{\ttfamily \#include $<$errno.\+h$>$}\newline
{\ttfamily \#include $<$osmocom/core/osmo\+\_\+io.\+h$>$}\newline
{\ttfamily \#include $<$osmocom/core/select.\+h$>$}\newline
{\ttfamily \#include $<$osmocom/core/sockaddr\+\_\+str.\+h$>$}\newline
{\ttfamily \#include $<$osmocom/core/socket.\+h$>$}\newline
{\ttfamily \#include $<$osmocom/gprs/gprs\+\_\+ns2.\+h$>$}\newline
{\ttfamily \#include \char`\"{}common\+\_\+vty.\+h\char`\"{}}\newline
{\ttfamily \#include \char`\"{}gprs\+\_\+ns2\+\_\+internal.\+h\char`\"{}}\newline
\doxysubsection*{Data Structures}
\begin{DoxyCompactItemize}
\item 
struct \textbf{ priv\+\_\+bind}
\item 
struct \textbf{ priv\+\_\+vc}
\end{DoxyCompactItemize}
\doxysubsection*{Functions}
\begin{DoxyCompactItemize}
\item 
static void \textbf{ free\+\_\+bind} (struct \textbf{ gprs\+\_\+ns2\+\_\+vc\+\_\+bind} $\ast$bind)
\begin{DoxyCompactList}\small\item\em clean up all private driver state. \end{DoxyCompactList}\item 
static void \textbf{ free\+\_\+vc} (struct \textbf{ gprs\+\_\+ns2\+\_\+vc} $\ast$nsvc)
\item 
static void \textbf{ dump\+\_\+vty} (const struct \textbf{ gprs\+\_\+ns2\+\_\+vc\+\_\+bind} $\ast$bind, struct \textbf{ vty} $\ast$\textbf{ vty}, bool stats)
\item 
struct \textbf{ gprs\+\_\+ns2\+\_\+vc} $\ast$ \textbf{ gprs\+\_\+ns2\+\_\+nsvc\+\_\+by\+\_\+sockaddr\+\_\+bind} (struct \textbf{ gprs\+\_\+ns2\+\_\+vc\+\_\+bind} $\ast$bind, const struct \textbf{ osmo\+\_\+sockaddr} $\ast$rem\+\_\+addr)
\begin{DoxyCompactList}\small\item\em Find a NS-\/\+VC by its remote socket address. \end{DoxyCompactList}\item 
static int \textbf{ nsip\+\_\+sendmsg} (struct \textbf{ gprs\+\_\+ns2\+\_\+vc\+\_\+bind} $\ast$bind, struct \textbf{ msgb} $\ast$\textbf{ msg}, const struct \textbf{ osmo\+\_\+sockaddr} $\ast$dest)
\item 
static int \textbf{ nsip\+\_\+vc\+\_\+sendmsg} (struct \textbf{ gprs\+\_\+ns2\+\_\+vc} $\ast$nsvc, struct \textbf{ msgb} $\ast$\textbf{ msg})
\begin{DoxyCompactList}\small\item\em send the msg and free it afterwards. \end{DoxyCompactList}\item 
static struct \textbf{ priv\+\_\+vc} $\ast$ \textbf{ ns2\+\_\+driver\+\_\+alloc\+\_\+vc} (struct \textbf{ gprs\+\_\+ns2\+\_\+vc\+\_\+bind} $\ast$bind, struct \textbf{ gprs\+\_\+ns2\+\_\+vc} $\ast$nsvc, const struct \textbf{ osmo\+\_\+sockaddr} $\ast$remote)
\item 
static void \textbf{ handle\+\_\+nsip\+\_\+recvfrom} (struct \textbf{ osmo\+\_\+io\+\_\+fd} $\ast$iofd, int error, struct \textbf{ msgb} $\ast$\textbf{ msg}, const struct \textbf{ osmo\+\_\+sockaddr} $\ast$saddr)
\item 
static void \textbf{ handle\+\_\+nsip\+\_\+sendto} (struct \textbf{ osmo\+\_\+io\+\_\+fd} $\ast$iofd, int \textbf{ res}, struct \textbf{ msgb} $\ast$\textbf{ msg}, const struct \textbf{ osmo\+\_\+sockaddr} $\ast$daddr)
\item 
struct \textbf{ gprs\+\_\+ns2\+\_\+vc\+\_\+bind} $\ast$ \textbf{ gprs\+\_\+ns2\+\_\+ip\+\_\+bind\+\_\+by\+\_\+sockaddr} (struct \textbf{ gprs\+\_\+ns2\+\_\+inst} $\ast$nsi, const struct \textbf{ osmo\+\_\+sockaddr} $\ast$sockaddr)
\begin{DoxyCompactList}\small\item\em Find NS bind for a given socket address. \end{DoxyCompactList}\item 
int \textbf{ gprs\+\_\+ns2\+\_\+ip\+\_\+bind} (struct \textbf{ gprs\+\_\+ns2\+\_\+inst} $\ast$nsi, const char $\ast$\textbf{ name}, const struct \textbf{ osmo\+\_\+sockaddr} $\ast$local, int dscp, struct \textbf{ gprs\+\_\+ns2\+\_\+vc\+\_\+bind} $\ast$$\ast$result)
\begin{DoxyCompactList}\small\item\em Bind to an IPv4/\+IPv6 address. \end{DoxyCompactList}\item 
struct \textbf{ gprs\+\_\+ns2\+\_\+vc} $\ast$ \textbf{ ns2\+\_\+ip\+\_\+bind\+\_\+connect} (struct \textbf{ gprs\+\_\+ns2\+\_\+vc\+\_\+bind} $\ast$bind, struct \textbf{ gprs\+\_\+ns2\+\_\+nse} $\ast$nse, const struct \textbf{ osmo\+\_\+sockaddr} $\ast$remote)
\begin{DoxyCompactList}\small\item\em Create new NS-\/\+VC to a given remote address. \end{DoxyCompactList}\item 
const struct \textbf{ osmo\+\_\+sockaddr} $\ast$ \textbf{ gprs\+\_\+ns2\+\_\+ip\+\_\+vc\+\_\+local} (const struct \textbf{ gprs\+\_\+ns2\+\_\+vc} $\ast$nsvc)
\begin{DoxyCompactList}\small\item\em Return the socket address of the local peer of a NS-\/\+VC. \end{DoxyCompactList}\item 
const struct \textbf{ osmo\+\_\+sockaddr} $\ast$ \textbf{ gprs\+\_\+ns2\+\_\+ip\+\_\+vc\+\_\+remote} (const struct \textbf{ gprs\+\_\+ns2\+\_\+vc} $\ast$nsvc)
\begin{DoxyCompactList}\small\item\em Return the socket address of the remote peer of a NS-\/\+VC. \end{DoxyCompactList}\item 
bool \textbf{ gprs\+\_\+ns2\+\_\+ip\+\_\+vc\+\_\+equal} (const struct \textbf{ gprs\+\_\+ns2\+\_\+vc} $\ast$nsvc, const struct \textbf{ osmo\+\_\+sockaddr} $\ast$local, const struct \textbf{ osmo\+\_\+sockaddr} $\ast$remote, uint16\+\_\+t nsvci)
\begin{DoxyCompactList}\small\item\em Compare the NS-\/\+VC with the given parameter. \end{DoxyCompactList}\item 
const struct \textbf{ osmo\+\_\+sockaddr} $\ast$ \textbf{ gprs\+\_\+ns2\+\_\+ip\+\_\+bind\+\_\+sockaddr} (struct \textbf{ gprs\+\_\+ns2\+\_\+vc\+\_\+bind} $\ast$bind)
\begin{DoxyCompactList}\small\item\em Return the locally bound socket address of the bind. \end{DoxyCompactList}\item 
int \textbf{ gprs\+\_\+ns2\+\_\+is\+\_\+ip\+\_\+bind} (struct \textbf{ gprs\+\_\+ns2\+\_\+vc\+\_\+bind} $\ast$bind)
\begin{DoxyCompactList}\small\item\em Is the given bind an IP bind? \end{DoxyCompactList}\item 
int \textbf{ gprs\+\_\+ns2\+\_\+ip\+\_\+bind\+\_\+set\+\_\+dscp} (struct \textbf{ gprs\+\_\+ns2\+\_\+vc\+\_\+bind} $\ast$bind, int dscp)
\begin{DoxyCompactList}\small\item\em Set the DSCP (TOS) bit value of the given bind. \end{DoxyCompactList}\item 
int \textbf{ gprs\+\_\+ns2\+\_\+ip\+\_\+bind\+\_\+set\+\_\+priority} (struct \textbf{ gprs\+\_\+ns2\+\_\+vc\+\_\+bind} $\ast$bind, uint8\+\_\+t \textbf{ priority})
\begin{DoxyCompactList}\small\item\em Set the socket priority of the given bind. \end{DoxyCompactList}\item 
int \textbf{ ns2\+\_\+ip\+\_\+count\+\_\+bind} (struct \textbf{ gprs\+\_\+ns2\+\_\+inst} $\ast$nsi, struct \textbf{ osmo\+\_\+sockaddr} $\ast$remote)
\begin{DoxyCompactList}\small\item\em Count UDP binds compatible with remote. \end{DoxyCompactList}\item 
struct \textbf{ gprs\+\_\+ns2\+\_\+vc\+\_\+bind} $\ast$ \textbf{ ns2\+\_\+ip\+\_\+get\+\_\+bind\+\_\+by\+\_\+index} (struct \textbf{ gprs\+\_\+ns2\+\_\+inst} $\ast$nsi, struct \textbf{ osmo\+\_\+sockaddr} $\ast$remote, int index)
\item 
void \textbf{ ns2\+\_\+ip\+\_\+set\+\_\+txqueue\+\_\+max\+\_\+length} (struct \textbf{ gprs\+\_\+ns2\+\_\+vc\+\_\+bind} $\ast$bind, unsigned int max\+\_\+length)
\item 
void \textbf{ gprs\+\_\+ns2\+\_\+ip\+\_\+bind\+\_\+set\+\_\+sns\+\_\+weight} (struct \textbf{ gprs\+\_\+ns2\+\_\+vc\+\_\+bind} $\ast$bind, uint8\+\_\+t signalling, uint8\+\_\+t \textbf{ data})
\begin{DoxyCompactList}\small\item\em set the signalling and data weight for this bind \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsection*{Variables}
\begin{DoxyCompactItemize}
\item 
struct \textbf{ gprs\+\_\+ns2\+\_\+vc\+\_\+driver} \textbf{ vc\+\_\+driver\+\_\+ip}
\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}
NS-\/over-\/\+UDP implementation. 

GPRS Networks Service (NS) messages on the Gb interface. 3GPP TS 08.\+16 version 8.\+0.\+1 Release 1999 / ETSI TS 101 299 V8.\+0.\+1 (2002-\/05) as well as its successor 3GPP TS 48.\+016 

\doxysubsection{Function Documentation}
\mbox{\label{gprs__ns2__udp_8c_a83a4494ac7f6f12b6e6b2c6a3aecd6a4}} 
\index{gprs\_ns2\_udp.c@{gprs\_ns2\_udp.c}!dump\_vty@{dump\_vty}}
\index{dump\_vty@{dump\_vty}!gprs\_ns2\_udp.c@{gprs\_ns2\_udp.c}}
\doxysubsubsection{dump\_vty()}
{\footnotesize\ttfamily static void dump\+\_\+vty (\begin{DoxyParamCaption}\item[{const struct \textbf{ gprs\+\_\+ns2\+\_\+vc\+\_\+bind} $\ast$}]{bind,  }\item[{struct \textbf{ vty} $\ast$}]{vty,  }\item[{bool}]{stats }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}



References \textbf{ priv\+\_\+bind\+::addr}, \textbf{ priv\+\_\+bind\+::dscp}, \textbf{ osmo\+\_\+sockaddr\+\_\+str\+::ip}, \textbf{ llist\+\_\+for\+\_\+each\+\_\+entry}, \textbf{ ns2\+\_\+vty\+\_\+dump\+\_\+nsvc()}, \textbf{ gprs\+\_\+ns2\+\_\+vc\+\_\+bind\+::nsvc}, \textbf{ osmo\+\_\+sockaddr\+\_\+str\+\_\+from\+\_\+sockaddr()}, \textbf{ osmo\+\_\+sockaddr\+\_\+str\+::port}, \textbf{ priv\+\_\+bind\+::priority}, \textbf{ gprs\+\_\+ns2\+\_\+vc\+\_\+bind\+::priv}, \textbf{ osmo\+\_\+sockaddr\+::sas}, \textbf{ gprs\+\_\+ns2\+\_\+vc\+\_\+bind\+::sns\+\_\+data\+\_\+weight}, \textbf{ gprs\+\_\+ns2\+\_\+vc\+\_\+bind\+::sns\+\_\+sig\+\_\+weight}, \textbf{ osmo\+\_\+sockaddr\+::u}, \textbf{ VTY\+\_\+\+NEWLINE}, and \textbf{ vty\+\_\+out()}.



Referenced by \textbf{ gprs\+\_\+ns2\+\_\+ip\+\_\+bind()}.

\mbox{\label{gprs__ns2__udp_8c_aa89cc0502634be0baf2ef0adbf2a38ac}} 
\index{gprs\_ns2\_udp.c@{gprs\_ns2\_udp.c}!free\_bind@{free\_bind}}
\index{free\_bind@{free\_bind}!gprs\_ns2\_udp.c@{gprs\_ns2\_udp.c}}
\doxysubsubsection{free\_bind()}
{\footnotesize\ttfamily static void free\+\_\+bind (\begin{DoxyParamCaption}\item[{struct \textbf{ gprs\+\_\+ns2\+\_\+vc\+\_\+bind} $\ast$}]{bind }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}



clean up all private driver state. 

Should be only called by \doxyref{gprs\+\_\+ns2\+\_\+free\+\_\+bind()}{p.}{group__libgb_ga60ce0e2a04d5ac46598ebd123fe744f6} 

References \textbf{ gprs\+\_\+ns2\+\_\+is\+\_\+ip\+\_\+bind()}, \textbf{ priv\+\_\+bind\+::iofd}, \textbf{ OSMO\+\_\+\+ASSERT}, \textbf{ osmo\+\_\+iofd\+\_\+free()}, and \textbf{ gprs\+\_\+ns2\+\_\+vc\+\_\+bind\+::priv}.

\mbox{\label{gprs__ns2__udp_8c_af69dea93a93b1e8edcedc44f5a27e8f8}} 
\index{gprs\_ns2\_udp.c@{gprs\_ns2\_udp.c}!free\_vc@{free\_vc}}
\index{free\_vc@{free\_vc}!gprs\_ns2\_udp.c@{gprs\_ns2\_udp.c}}
\doxysubsubsection{free\_vc()}
{\footnotesize\ttfamily static void free\+\_\+vc (\begin{DoxyParamCaption}\item[{struct \textbf{ gprs\+\_\+ns2\+\_\+vc} $\ast$}]{nsvc }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}



References \textbf{ gprs\+\_\+ns2\+\_\+vc\+::bind}, \textbf{ gprs\+\_\+ns2\+\_\+is\+\_\+ip\+\_\+bind()}, \textbf{ OSMO\+\_\+\+ASSERT}, and \textbf{ gprs\+\_\+ns2\+\_\+vc\+::priv}.



Referenced by \textbf{ gprs\+\_\+ns2\+\_\+ip\+\_\+bind()}.

\mbox{\label{gprs__ns2__udp_8c_ae777bdd223a7190ca183c0e0ebe0b26a}} 
\index{gprs\_ns2\_udp.c@{gprs\_ns2\_udp.c}!gprs\_ns2\_ip\_bind@{gprs\_ns2\_ip\_bind}}
\index{gprs\_ns2\_ip\_bind@{gprs\_ns2\_ip\_bind}!gprs\_ns2\_udp.c@{gprs\_ns2\_udp.c}}
\doxysubsubsection{gprs\_ns2\_ip\_bind()}
{\footnotesize\ttfamily int gprs\+\_\+ns2\+\_\+ip\+\_\+bind (\begin{DoxyParamCaption}\item[{struct \textbf{ gprs\+\_\+ns2\+\_\+inst} $\ast$}]{nsi,  }\item[{const char $\ast$}]{name,  }\item[{const struct \textbf{ osmo\+\_\+sockaddr} $\ast$}]{local,  }\item[{int}]{dscp,  }\item[{struct \textbf{ gprs\+\_\+ns2\+\_\+vc\+\_\+bind} $\ast$$\ast$}]{result }\end{DoxyParamCaption})}



Bind to an IPv4/\+IPv6 address. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em nsi} & NS Instance in which to create the NSVC \\
\hline
\mbox{\texttt{ in}}  & {\em local} & the local address to bind to \\
\hline
\mbox{\texttt{ in}}  & {\em dscp} & the DSCP/\+TOS bits used for transmitted data \\
\hline
\mbox{\texttt{ out}}  & {\em result} & pointer to the created bind or if a bind with the name exists return the bind. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
0 on success; negative on error. -\/EALREADY returned in case a bind with the name exists 
\end{DoxyReturn}


References \textbf{ priv\+\_\+bind\+::addr}, \textbf{ gprs\+\_\+ns2\+\_\+vc\+\_\+bind\+::driver}, \textbf{ priv\+\_\+bind\+::dscp}, \textbf{ dump\+\_\+vty()}, \textbf{ gprs\+\_\+ns2\+\_\+vc\+\_\+bind\+::dump\+\_\+vty}, \textbf{ free\+\_\+vc()}, \textbf{ gprs\+\_\+ns2\+\_\+vc\+\_\+bind\+::free\+\_\+vc}, \textbf{ gprs\+\_\+ns2\+\_\+free\+\_\+bind()}, \textbf{ gprs\+\_\+ns2\+\_\+ip\+\_\+bind\+\_\+by\+\_\+sockaddr()}, \textbf{ GPRS\+\_\+\+NS2\+\_\+\+LL\+\_\+\+UDP}, \textbf{ handle\+\_\+nsip\+\_\+recvfrom()}, \textbf{ handle\+\_\+nsip\+\_\+sendto()}, \textbf{ priv\+\_\+bind\+::iofd}, \textbf{ gprs\+\_\+ns2\+\_\+vc\+\_\+bind\+::ll}, \textbf{ gprs\+\_\+ns2\+\_\+vc\+\_\+bind\+::mtu}, \textbf{ name}, \textbf{ ns2\+\_\+bind\+\_\+alloc()}, \textbf{ nsip\+\_\+vc\+\_\+sendmsg()}, \textbf{ OSMO\+\_\+\+IO\+\_\+\+FD\+\_\+\+MODE\+\_\+\+RECVFROM\+\_\+\+SENDTO}, \textbf{ osmo\+\_\+iofd\+\_\+register()}, \textbf{ osmo\+\_\+iofd\+\_\+set\+\_\+alloc\+\_\+info()}, \textbf{ osmo\+\_\+iofd\+\_\+set\+\_\+txqueue\+\_\+max\+\_\+length()}, \textbf{ osmo\+\_\+iofd\+\_\+setup()}, \textbf{ OSMO\+\_\+\+SOCK\+\_\+\+F\+\_\+\+BIND}, \textbf{ OSMO\+\_\+\+SOCK\+\_\+\+F\+\_\+\+DSCP}, \textbf{ osmo\+\_\+sock\+\_\+init\+\_\+osa()}, \textbf{ gprs\+\_\+ns2\+\_\+vc\+\_\+bind\+::priv}, \textbf{ osmo\+\_\+sockaddr\+::sa}, \textbf{ gprs\+\_\+ns2\+\_\+vc\+\_\+bind\+::send\+\_\+vc}, \textbf{ osmo\+\_\+io\+\_\+ops\+::sendto\+\_\+cb}, \textbf{ gprs\+\_\+ns2\+\_\+vc\+\_\+bind\+::transfer\+\_\+capability}, \textbf{ gprs\+\_\+ns2\+\_\+inst\+::txqueue\+\_\+max\+\_\+length}, \textbf{ osmo\+\_\+sockaddr\+::u}, and \textbf{ vc\+\_\+driver\+\_\+ip}.



Referenced by \textbf{ DEFUN()}.

\mbox{\label{gprs__ns2__udp_8c_a1d48413fcc9331bb9d374ccf29a39d35}} 
\index{gprs\_ns2\_udp.c@{gprs\_ns2\_udp.c}!gprs\_ns2\_ip\_bind\_by\_sockaddr@{gprs\_ns2\_ip\_bind\_by\_sockaddr}}
\index{gprs\_ns2\_ip\_bind\_by\_sockaddr@{gprs\_ns2\_ip\_bind\_by\_sockaddr}!gprs\_ns2\_udp.c@{gprs\_ns2\_udp.c}}
\doxysubsubsection{gprs\_ns2\_ip\_bind\_by\_sockaddr()}
{\footnotesize\ttfamily struct \textbf{ gprs\+\_\+ns2\+\_\+vc\+\_\+bind} $\ast$ gprs\+\_\+ns2\+\_\+ip\+\_\+bind\+\_\+by\+\_\+sockaddr (\begin{DoxyParamCaption}\item[{struct \textbf{ gprs\+\_\+ns2\+\_\+inst} $\ast$}]{nsi,  }\item[{const struct \textbf{ osmo\+\_\+sockaddr} $\ast$}]{sockaddr }\end{DoxyParamCaption})}



Find NS bind for a given socket address. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em nsi} & NS instance \\
\hline
\mbox{\texttt{ in}}  & {\em sockaddr} & socket address to search for \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}

\end{DoxyReturn}


References \textbf{ gprs\+\_\+ns2\+\_\+inst\+::binding}, \textbf{ gprs\+\_\+ns2\+\_\+ip\+\_\+bind\+\_\+sockaddr()}, \textbf{ gprs\+\_\+ns2\+\_\+is\+\_\+ip\+\_\+bind()}, \textbf{ list}, \textbf{ llist\+\_\+for\+\_\+each\+\_\+entry}, \textbf{ OSMO\+\_\+\+ASSERT}, and \textbf{ osmo\+\_\+sockaddr\+\_\+cmp()}.



Referenced by \textbf{ DEFUN()}, and \textbf{ gprs\+\_\+ns2\+\_\+ip\+\_\+bind()}.

\mbox{\label{gprs__ns2__udp_8c_abc6c5168cd4db66baf60ca62a3609027}} 
\index{gprs\_ns2\_udp.c@{gprs\_ns2\_udp.c}!gprs\_ns2\_ip\_bind\_set\_dscp@{gprs\_ns2\_ip\_bind\_set\_dscp}}
\index{gprs\_ns2\_ip\_bind\_set\_dscp@{gprs\_ns2\_ip\_bind\_set\_dscp}!gprs\_ns2\_udp.c@{gprs\_ns2\_udp.c}}
\doxysubsubsection{gprs\_ns2\_ip\_bind\_set\_dscp()}
{\footnotesize\ttfamily int gprs\+\_\+ns2\+\_\+ip\+\_\+bind\+\_\+set\+\_\+dscp (\begin{DoxyParamCaption}\item[{struct \textbf{ gprs\+\_\+ns2\+\_\+vc\+\_\+bind} $\ast$}]{bind,  }\item[{int}]{dscp }\end{DoxyParamCaption})}



Set the DSCP (TOS) bit value of the given bind. 



References \textbf{ priv\+\_\+bind\+::dscp}, \textbf{ gprs\+\_\+ns2\+\_\+is\+\_\+ip\+\_\+bind()}, \textbf{ priv\+\_\+bind\+::iofd}, \textbf{ LOGBIND}, \textbf{ LOGL\+\_\+\+ERROR}, \textbf{ OSMO\+\_\+\+ASSERT}, \textbf{ osmo\+\_\+iofd\+\_\+get\+\_\+fd()}, \textbf{ osmo\+\_\+sock\+\_\+set\+\_\+dscp()}, and \textbf{ gprs\+\_\+ns2\+\_\+vc\+\_\+bind\+::priv}.



Referenced by \textbf{ DEFUN()}.

\mbox{\label{gprs__ns2__udp_8c_a0db4579d0b0f86d9c5628bda3fa24f87}} 
\index{gprs\_ns2\_udp.c@{gprs\_ns2\_udp.c}!gprs\_ns2\_ip\_bind\_set\_priority@{gprs\_ns2\_ip\_bind\_set\_priority}}
\index{gprs\_ns2\_ip\_bind\_set\_priority@{gprs\_ns2\_ip\_bind\_set\_priority}!gprs\_ns2\_udp.c@{gprs\_ns2\_udp.c}}
\doxysubsubsection{gprs\_ns2\_ip\_bind\_set\_priority()}
{\footnotesize\ttfamily int gprs\+\_\+ns2\+\_\+ip\+\_\+bind\+\_\+set\+\_\+priority (\begin{DoxyParamCaption}\item[{struct \textbf{ gprs\+\_\+ns2\+\_\+vc\+\_\+bind} $\ast$}]{bind,  }\item[{uint8\+\_\+t}]{priority }\end{DoxyParamCaption})}



Set the socket priority of the given bind. 



References \textbf{ gprs\+\_\+ns2\+\_\+is\+\_\+ip\+\_\+bind()}, \textbf{ priv\+\_\+bind\+::iofd}, \textbf{ LOGBIND}, \textbf{ LOGL\+\_\+\+ERROR}, \textbf{ OSMO\+\_\+\+ASSERT}, \textbf{ osmo\+\_\+iofd\+\_\+get\+\_\+fd()}, \textbf{ osmo\+\_\+sock\+\_\+set\+\_\+priority()}, \textbf{ priority}, \textbf{ priv\+\_\+bind\+::priority}, and \textbf{ gprs\+\_\+ns2\+\_\+vc\+\_\+bind\+::priv}.



Referenced by \textbf{ DEFUN()}.

\mbox{\label{gprs__ns2__udp_8c_a36472eed4f70e5a5952fbc07bdb76b7f}} 
\index{gprs\_ns2\_udp.c@{gprs\_ns2\_udp.c}!gprs\_ns2\_ip\_bind\_set\_sns\_weight@{gprs\_ns2\_ip\_bind\_set\_sns\_weight}}
\index{gprs\_ns2\_ip\_bind\_set\_sns\_weight@{gprs\_ns2\_ip\_bind\_set\_sns\_weight}!gprs\_ns2\_udp.c@{gprs\_ns2\_udp.c}}
\doxysubsubsection{gprs\_ns2\_ip\_bind\_set\_sns\_weight()}
{\footnotesize\ttfamily void gprs\+\_\+ns2\+\_\+ip\+\_\+bind\+\_\+set\+\_\+sns\+\_\+weight (\begin{DoxyParamCaption}\item[{struct \textbf{ gprs\+\_\+ns2\+\_\+vc\+\_\+bind} $\ast$}]{bind,  }\item[{uint8\+\_\+t}]{signalling,  }\item[{uint8\+\_\+t}]{data }\end{DoxyParamCaption})}



set the signalling and data weight for this bind 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em bind} & \\
\hline
\mbox{\texttt{ in}}  & {\em signalling} & the signalling weight \\
\hline
\mbox{\texttt{ in}}  & {\em data} & the data weight \\
\hline
\end{DoxyParams}


References \textbf{ data}, \textbf{ gprs\+\_\+ns2\+\_\+is\+\_\+ip\+\_\+bind()}, \textbf{ ns2\+\_\+sns\+\_\+update\+\_\+weights()}, \textbf{ OSMO\+\_\+\+ASSERT}, \textbf{ gprs\+\_\+ns2\+\_\+vc\+\_\+bind\+::sns\+\_\+data\+\_\+weight}, and \textbf{ gprs\+\_\+ns2\+\_\+vc\+\_\+bind\+::sns\+\_\+sig\+\_\+weight}.



Referenced by \textbf{ DEFUN()}.

\mbox{\label{gprs__ns2__udp_8c_a1ce64188a0acad56a1d21d53a18d561b}} 
\index{gprs\_ns2\_udp.c@{gprs\_ns2\_udp.c}!gprs\_ns2\_ip\_bind\_sockaddr@{gprs\_ns2\_ip\_bind\_sockaddr}}
\index{gprs\_ns2\_ip\_bind\_sockaddr@{gprs\_ns2\_ip\_bind\_sockaddr}!gprs\_ns2\_udp.c@{gprs\_ns2\_udp.c}}
\doxysubsubsection{gprs\_ns2\_ip\_bind\_sockaddr()}
{\footnotesize\ttfamily const struct \textbf{ osmo\+\_\+sockaddr} $\ast$ gprs\+\_\+ns2\+\_\+ip\+\_\+bind\+\_\+sockaddr (\begin{DoxyParamCaption}\item[{struct \textbf{ gprs\+\_\+ns2\+\_\+vc\+\_\+bind} $\ast$}]{bind }\end{DoxyParamCaption})}



Return the locally bound socket address of the bind. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em bind} & The bind whose local address we want to know \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
address of the local bind 
\end{DoxyReturn}


References \textbf{ priv\+\_\+bind\+::addr}, \textbf{ gprs\+\_\+ns2\+\_\+is\+\_\+ip\+\_\+bind()}, \textbf{ OSMO\+\_\+\+ASSERT}, and \textbf{ gprs\+\_\+ns2\+\_\+vc\+\_\+bind\+::priv}.



Referenced by \textbf{ config\+\_\+write\+\_\+vbind()}, \textbf{ gprs\+\_\+ns2\+\_\+ip\+\_\+bind\+\_\+by\+\_\+sockaddr()}, \textbf{ gprs\+\_\+ns2\+\_\+ll\+\_\+str\+\_\+buf()}, \textbf{ ns2\+\_\+add\+\_\+procedure()}, \textbf{ ns2\+\_\+create\+\_\+vc()}, \textbf{ ns2\+\_\+get\+\_\+sbind\+\_\+ip4\+\_\+entry()}, \textbf{ ns2\+\_\+get\+\_\+sbind\+\_\+ip6\+\_\+entry()}, \textbf{ ns2\+\_\+ip\+\_\+bind\+\_\+connect()}, \textbf{ ns2\+\_\+ip\+\_\+count\+\_\+bind()}, \textbf{ ns2\+\_\+ip\+\_\+get\+\_\+bind\+\_\+by\+\_\+index()}, \textbf{ ns2\+\_\+sns\+\_\+add\+\_\+elements()}, \textbf{ ns2\+\_\+sns\+\_\+bss\+\_\+valid\+\_\+configuration()}, \textbf{ ns2\+\_\+sns\+\_\+compute\+\_\+local\+\_\+ep\+\_\+from\+\_\+binds()}, \textbf{ ns2\+\_\+sns\+\_\+count\+\_\+num\+\_\+local\+\_\+ep()}, \textbf{ ns2\+\_\+sns\+\_\+update\+\_\+weights()}, and \textbf{ remove\+\_\+bind\+\_\+elem()}.

\mbox{\label{gprs__ns2__udp_8c_acea1beca99e787361064e11816c79b3a}} 
\index{gprs\_ns2\_udp.c@{gprs\_ns2\_udp.c}!gprs\_ns2\_ip\_vc\_equal@{gprs\_ns2\_ip\_vc\_equal}}
\index{gprs\_ns2\_ip\_vc\_equal@{gprs\_ns2\_ip\_vc\_equal}!gprs\_ns2\_udp.c@{gprs\_ns2\_udp.c}}
\doxysubsubsection{gprs\_ns2\_ip\_vc\_equal()}
{\footnotesize\ttfamily bool gprs\+\_\+ns2\+\_\+ip\+\_\+vc\+\_\+equal (\begin{DoxyParamCaption}\item[{const struct \textbf{ gprs\+\_\+ns2\+\_\+vc} $\ast$}]{nsvc,  }\item[{const struct \textbf{ osmo\+\_\+sockaddr} $\ast$}]{local,  }\item[{const struct \textbf{ osmo\+\_\+sockaddr} $\ast$}]{remote,  }\item[{uint16\+\_\+t}]{nsvci }\end{DoxyParamCaption})}



Compare the NS-\/\+VC with the given parameter. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em nsvc} & NS-\/\+VC to compare with \\
\hline
\mbox{\texttt{ in}}  & {\em local} & The local address \\
\hline
\mbox{\texttt{ in}}  & {\em remote} & The remote address \\
\hline
\mbox{\texttt{ in}}  & {\em nsvci} & NS-\/\+VCI will only be used if the NS-\/\+VC in BLOCKRESET mode otherwise NS-\/\+VCI isn\textquotesingle{}t applicable. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
true if the NS-\/\+VC has the same properties as given 
\end{DoxyReturn}


References \textbf{ priv\+\_\+bind\+::addr}, \textbf{ gprs\+\_\+ns2\+\_\+vc\+::bind}, \textbf{ gprs\+\_\+ns2\+\_\+vc\+\_\+bind\+::driver}, \textbf{ GPRS\+\_\+\+NS2\+\_\+\+VC\+\_\+\+MODE\+\_\+\+BLOCKRESET}, \textbf{ gprs\+\_\+ns2\+\_\+vc\+::mode}, \textbf{ gprs\+\_\+ns2\+\_\+vc\+::nsvci}, \textbf{ osmo\+\_\+sockaddr\+\_\+cmp()}, \textbf{ gprs\+\_\+ns2\+\_\+vc\+::priv}, \textbf{ gprs\+\_\+ns2\+\_\+vc\+\_\+bind\+::priv}, \textbf{ priv\+\_\+vc\+::remote}, and \textbf{ vc\+\_\+driver\+\_\+ip}.

\mbox{\label{gprs__ns2__udp_8c_aa78fe2cc00afbad05816b358a3276f17}} 
\index{gprs\_ns2\_udp.c@{gprs\_ns2\_udp.c}!gprs\_ns2\_ip\_vc\_local@{gprs\_ns2\_ip\_vc\_local}}
\index{gprs\_ns2\_ip\_vc\_local@{gprs\_ns2\_ip\_vc\_local}!gprs\_ns2\_udp.c@{gprs\_ns2\_udp.c}}
\doxysubsubsection{gprs\_ns2\_ip\_vc\_local()}
{\footnotesize\ttfamily const struct \textbf{ osmo\+\_\+sockaddr} $\ast$ gprs\+\_\+ns2\+\_\+ip\+\_\+vc\+\_\+local (\begin{DoxyParamCaption}\item[{const struct \textbf{ gprs\+\_\+ns2\+\_\+vc} $\ast$}]{nsvc }\end{DoxyParamCaption})}



Return the socket address of the local peer of a NS-\/\+VC. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em nsvc} & NS-\/\+VC whose local peer we want to know \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
address of the local peer; NULL in case of error 
\end{DoxyReturn}


References \textbf{ priv\+\_\+bind\+::addr}, \textbf{ gprs\+\_\+ns2\+\_\+vc\+::bind}, \textbf{ gprs\+\_\+ns2\+\_\+vc\+\_\+bind\+::driver}, \textbf{ gprs\+\_\+ns2\+\_\+vc\+\_\+bind\+::priv}, and \textbf{ vc\+\_\+driver\+\_\+ip}.

\mbox{\label{gprs__ns2__udp_8c_a8fd3161ea605df85fffe870f40766ffb}} 
\index{gprs\_ns2\_udp.c@{gprs\_ns2\_udp.c}!gprs\_ns2\_ip\_vc\_remote@{gprs\_ns2\_ip\_vc\_remote}}
\index{gprs\_ns2\_ip\_vc\_remote@{gprs\_ns2\_ip\_vc\_remote}!gprs\_ns2\_udp.c@{gprs\_ns2\_udp.c}}
\doxysubsubsection{gprs\_ns2\_ip\_vc\_remote()}
{\footnotesize\ttfamily const struct \textbf{ osmo\+\_\+sockaddr} $\ast$ gprs\+\_\+ns2\+\_\+ip\+\_\+vc\+\_\+remote (\begin{DoxyParamCaption}\item[{const struct \textbf{ gprs\+\_\+ns2\+\_\+vc} $\ast$}]{nsvc }\end{DoxyParamCaption})}



Return the socket address of the remote peer of a NS-\/\+VC. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em nsvc} & NS-\/\+VC whose remote peer we want to know \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
address of the remote peer; NULL in case of error 
\end{DoxyReturn}


References \textbf{ gprs\+\_\+ns2\+\_\+vc\+::bind}, \textbf{ gprs\+\_\+ns2\+\_\+vc\+\_\+bind\+::driver}, \textbf{ gprs\+\_\+ns2\+\_\+vc\+::priv}, \textbf{ priv\+\_\+vc\+::remote}, and \textbf{ vc\+\_\+driver\+\_\+ip}.



Referenced by \textbf{ config\+\_\+write\+\_\+nsvc()}, \textbf{ do\+\_\+sns\+\_\+change\+\_\+weight()}, \textbf{ do\+\_\+sns\+\_\+delete()}, \textbf{ gprs\+\_\+ns2\+\_\+ll\+\_\+str\+\_\+buf()}, \textbf{ gprs\+\_\+ns2\+\_\+nsvc\+\_\+by\+\_\+sockaddr\+\_\+nse()}, \textbf{ ns2\+\_\+sns\+\_\+compute\+\_\+local\+\_\+ep\+\_\+from\+\_\+binds()}, and \textbf{ nsvc\+\_\+for\+\_\+bind\+\_\+and\+\_\+remote()}.

\mbox{\label{gprs__ns2__udp_8c_a0a7277d548a97db61b0d693880b06924}} 
\index{gprs\_ns2\_udp.c@{gprs\_ns2\_udp.c}!gprs\_ns2\_is\_ip\_bind@{gprs\_ns2\_is\_ip\_bind}}
\index{gprs\_ns2\_is\_ip\_bind@{gprs\_ns2\_is\_ip\_bind}!gprs\_ns2\_udp.c@{gprs\_ns2\_udp.c}}
\doxysubsubsection{gprs\_ns2\_is\_ip\_bind()}
{\footnotesize\ttfamily int gprs\+\_\+ns2\+\_\+is\+\_\+ip\+\_\+bind (\begin{DoxyParamCaption}\item[{struct \textbf{ gprs\+\_\+ns2\+\_\+vc\+\_\+bind} $\ast$}]{bind }\end{DoxyParamCaption})}



Is the given bind an IP bind? 



References \textbf{ gprs\+\_\+ns2\+\_\+vc\+\_\+bind\+::driver}, and \textbf{ vc\+\_\+driver\+\_\+ip}.



Referenced by \textbf{ DEFUN()}, \textbf{ free\+\_\+bind()}, \textbf{ free\+\_\+vc()}, \textbf{ gprs\+\_\+ns2\+\_\+free\+\_\+bind()}, \textbf{ gprs\+\_\+ns2\+\_\+ip\+\_\+bind\+\_\+by\+\_\+sockaddr()}, \textbf{ gprs\+\_\+ns2\+\_\+ip\+\_\+bind\+\_\+set\+\_\+dscp()}, \textbf{ gprs\+\_\+ns2\+\_\+ip\+\_\+bind\+\_\+set\+\_\+priority()}, \textbf{ gprs\+\_\+ns2\+\_\+ip\+\_\+bind\+\_\+set\+\_\+sns\+\_\+weight()}, \textbf{ gprs\+\_\+ns2\+\_\+ip\+\_\+bind\+\_\+sockaddr()}, \textbf{ gprs\+\_\+ns2\+\_\+ll\+\_\+str\+\_\+buf()}, \textbf{ gprs\+\_\+ns2\+\_\+nsvc\+\_\+by\+\_\+sockaddr\+\_\+bind()}, \textbf{ gprs\+\_\+ns2\+\_\+sns\+\_\+add\+\_\+bind()}, \textbf{ ns2\+\_\+ip\+\_\+bind\+\_\+connect()}, \textbf{ ns2\+\_\+ip\+\_\+count\+\_\+bind()}, \textbf{ ns2\+\_\+ip\+\_\+get\+\_\+bind\+\_\+by\+\_\+index()}, and \textbf{ ns2\+\_\+ip\+\_\+set\+\_\+txqueue\+\_\+max\+\_\+length()}.

\mbox{\label{gprs__ns2__udp_8c_abdf1d19f4662c3264954a5513d223d47}} 
\index{gprs\_ns2\_udp.c@{gprs\_ns2\_udp.c}!gprs\_ns2\_nsvc\_by\_sockaddr\_bind@{gprs\_ns2\_nsvc\_by\_sockaddr\_bind}}
\index{gprs\_ns2\_nsvc\_by\_sockaddr\_bind@{gprs\_ns2\_nsvc\_by\_sockaddr\_bind}!gprs\_ns2\_udp.c@{gprs\_ns2\_udp.c}}
\doxysubsubsection{gprs\_ns2\_nsvc\_by\_sockaddr\_bind()}
{\footnotesize\ttfamily struct \textbf{ gprs\+\_\+ns2\+\_\+vc} $\ast$ gprs\+\_\+ns2\+\_\+nsvc\+\_\+by\+\_\+sockaddr\+\_\+bind (\begin{DoxyParamCaption}\item[{struct \textbf{ gprs\+\_\+ns2\+\_\+vc\+\_\+bind} $\ast$}]{bind,  }\item[{const struct \textbf{ osmo\+\_\+sockaddr} $\ast$}]{rem\+\_\+addr }\end{DoxyParamCaption})}



Find a NS-\/\+VC by its remote socket address. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em bind} & in which to search \\
\hline
\mbox{\texttt{ in}}  & {\em rem\+\_\+addr} & remote peer socket address to search \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
NS-\/\+VC matching sockaddr; NULL if none found 
\end{DoxyReturn}


References \textbf{ gprs\+\_\+ns2\+\_\+is\+\_\+ip\+\_\+bind()}, \textbf{ llist\+\_\+for\+\_\+each\+\_\+entry}, \textbf{ gprs\+\_\+ns2\+\_\+vc\+\_\+bind\+::nsvc}, \textbf{ OSMO\+\_\+\+ASSERT}, \textbf{ osmo\+\_\+sockaddr\+\_\+cmp()}, \textbf{ gprs\+\_\+ns2\+\_\+vc\+::priv}, \textbf{ priv\+\_\+vc\+::remote}, \textbf{ osmo\+\_\+sockaddr\+::sa}, and \textbf{ osmo\+\_\+sockaddr\+::u}.



Referenced by \textbf{ DEFUN()}, \textbf{ handle\+\_\+nsip\+\_\+recvfrom()}, \textbf{ handle\+\_\+nsip\+\_\+sendto()}, \textbf{ ns2\+\_\+create\+\_\+vc\+\_\+sns()}, \textbf{ ns2\+\_\+ip\+\_\+bind\+\_\+connect()}, and \textbf{ ns\+\_\+nse\+\_\+nsvc\+\_\+udp\+\_\+cmds()}.

\mbox{\label{gprs__ns2__udp_8c_a116ff716bb7525fb3be82d5e610ce79e}} 
\index{gprs\_ns2\_udp.c@{gprs\_ns2\_udp.c}!handle\_nsip\_recvfrom@{handle\_nsip\_recvfrom}}
\index{handle\_nsip\_recvfrom@{handle\_nsip\_recvfrom}!gprs\_ns2\_udp.c@{gprs\_ns2\_udp.c}}
\doxysubsubsection{handle\_nsip\_recvfrom()}
{\footnotesize\ttfamily static void handle\+\_\+nsip\+\_\+recvfrom (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+io\+\_\+fd} $\ast$}]{iofd,  }\item[{int}]{error,  }\item[{struct \textbf{ msgb} $\ast$}]{msg,  }\item[{const struct \textbf{ osmo\+\_\+sockaddr} $\ast$}]{saddr }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}



References \textbf{ gprs\+\_\+ns2\+\_\+nse\+::dialect}, \textbf{ GPRS\+\_\+\+NS2\+\_\+\+DIALECT\+\_\+\+SNS}, \textbf{ gprs\+\_\+ns2\+\_\+nsvc\+\_\+by\+\_\+sockaddr\+\_\+bind()}, \textbf{ msg}, \textbf{ msgb\+\_\+data()}, \textbf{ msgb\+\_\+free()}, \textbf{ ns2\+\_\+create\+\_\+vc()}, \textbf{ NS2\+\_\+\+CS\+\_\+\+CREATED}, \textbf{ NS2\+\_\+\+CS\+\_\+\+ERROR}, \textbf{ NS2\+\_\+\+CS\+\_\+\+FOUND}, \textbf{ NS2\+\_\+\+CS\+\_\+\+REJECTED}, \textbf{ NS2\+\_\+\+CS\+\_\+\+SKIPPED}, \textbf{ ns2\+\_\+driver\+\_\+alloc\+\_\+vc()}, \textbf{ ns2\+\_\+recv\+\_\+vc()}, \textbf{ ns2\+\_\+vc\+\_\+fsm\+\_\+start()}, \textbf{ gprs\+\_\+ns2\+\_\+vc\+::nse}, \textbf{ nsip\+\_\+sendmsg()}, and \textbf{ osmo\+\_\+iofd\+\_\+get\+\_\+data()}.



Referenced by \textbf{ gprs\+\_\+ns2\+\_\+ip\+\_\+bind()}.

\mbox{\label{gprs__ns2__udp_8c_a2c9671a805cb7df7489ad21961fd8d20}} 
\index{gprs\_ns2\_udp.c@{gprs\_ns2\_udp.c}!handle\_nsip\_sendto@{handle\_nsip\_sendto}}
\index{handle\_nsip\_sendto@{handle\_nsip\_sendto}!gprs\_ns2\_udp.c@{gprs\_ns2\_udp.c}}
\doxysubsubsection{handle\_nsip\_sendto()}
{\footnotesize\ttfamily static void handle\+\_\+nsip\+\_\+sendto (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+io\+\_\+fd} $\ast$}]{iofd,  }\item[{int}]{res,  }\item[{struct \textbf{ msgb} $\ast$}]{msg,  }\item[{const struct \textbf{ osmo\+\_\+sockaddr} $\ast$}]{daddr }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}



References \textbf{ gprs\+\_\+ns2\+\_\+vc\+::bind}, \textbf{ gprs\+\_\+ns2\+\_\+nsvc\+\_\+by\+\_\+sockaddr\+\_\+bind()}, \textbf{ msg}, \textbf{ msgb\+\_\+length()}, \textbf{ NS\+\_\+\+CTR\+\_\+\+BYTES\+\_\+\+OUT}, \textbf{ NS\+\_\+\+CTR\+\_\+\+BYTES\+\_\+\+OUT\+\_\+\+DROP}, \textbf{ NS\+\_\+\+CTR\+\_\+\+PKTS\+\_\+\+OUT}, \textbf{ NS\+\_\+\+CTR\+\_\+\+PKTS\+\_\+\+OUT\+\_\+\+DROP}, \textbf{ osmo\+\_\+iofd\+\_\+get\+\_\+data()}, \textbf{ OSMO\+\_\+\+LIKELY}, \textbf{ RATE\+\_\+\+CTR\+\_\+\+ADD\+\_\+\+NS}, \textbf{ RATE\+\_\+\+CTR\+\_\+\+INC\+\_\+\+NS}, and \textbf{ res}.



Referenced by \textbf{ gprs\+\_\+ns2\+\_\+ip\+\_\+bind()}.

\mbox{\label{gprs__ns2__udp_8c_a293f9de30f496cd80df40305d7510505}} 
\index{gprs\_ns2\_udp.c@{gprs\_ns2\_udp.c}!ns2\_driver\_alloc\_vc@{ns2\_driver\_alloc\_vc}}
\index{ns2\_driver\_alloc\_vc@{ns2\_driver\_alloc\_vc}!gprs\_ns2\_udp.c@{gprs\_ns2\_udp.c}}
\doxysubsubsection{ns2\_driver\_alloc\_vc()}
{\footnotesize\ttfamily static struct \textbf{ priv\+\_\+vc} $\ast$ ns2\+\_\+driver\+\_\+alloc\+\_\+vc (\begin{DoxyParamCaption}\item[{struct \textbf{ gprs\+\_\+ns2\+\_\+vc\+\_\+bind} $\ast$}]{bind,  }\item[{struct \textbf{ gprs\+\_\+ns2\+\_\+vc} $\ast$}]{nsvc,  }\item[{const struct \textbf{ osmo\+\_\+sockaddr} $\ast$}]{remote }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}



References \textbf{ gprs\+\_\+ns2\+\_\+vc\+::priv}, and \textbf{ priv\+\_\+vc\+::remote}.



Referenced by \textbf{ handle\+\_\+nsip\+\_\+recvfrom()}.

\mbox{\label{gprs__ns2__udp_8c_a6d14b6db5637595add5fb19f45db9f61}} 
\index{gprs\_ns2\_udp.c@{gprs\_ns2\_udp.c}!ns2\_ip\_bind\_connect@{ns2\_ip\_bind\_connect}}
\index{ns2\_ip\_bind\_connect@{ns2\_ip\_bind\_connect}!gprs\_ns2\_udp.c@{gprs\_ns2\_udp.c}}
\doxysubsubsection{ns2\_ip\_bind\_connect()}
{\footnotesize\ttfamily struct \textbf{ gprs\+\_\+ns2\+\_\+vc} $\ast$ ns2\+\_\+ip\+\_\+bind\+\_\+connect (\begin{DoxyParamCaption}\item[{struct \textbf{ gprs\+\_\+ns2\+\_\+vc\+\_\+bind} $\ast$}]{bind,  }\item[{struct \textbf{ gprs\+\_\+ns2\+\_\+nse} $\ast$}]{nse,  }\item[{const struct \textbf{ osmo\+\_\+sockaddr} $\ast$}]{remote }\end{DoxyParamCaption})}



Create new NS-\/\+VC to a given remote address. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em bind} & the bind we want to connect \\
\hline
\mbox{\texttt{ in}}  & {\em nse} & NS entity to be used for the new NS-\/\+VC \\
\hline
\mbox{\texttt{ in}}  & {\em remote} & remote address to connect to \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
pointer to newly-\/allocated and connected NS-\/\+VC; NULL on error 
\end{DoxyReturn}


References \textbf{ gprs\+\_\+ns2\+\_\+nse\+::dialect}, \textbf{ gprs\+\_\+ns2\+\_\+free\+\_\+nsvc()}, \textbf{ gprs\+\_\+ns2\+\_\+ip\+\_\+bind\+\_\+sockaddr()}, \textbf{ gprs\+\_\+ns2\+\_\+is\+\_\+ip\+\_\+bind()}, \textbf{ gprs\+\_\+ns2\+\_\+lltype\+\_\+str()}, \textbf{ gprs\+\_\+ns2\+\_\+nsvc\+\_\+by\+\_\+sockaddr\+\_\+bind()}, \textbf{ gprs\+\_\+ns2\+\_\+nse\+::ll}, \textbf{ LOGL\+\_\+\+ERROR}, \textbf{ LOGNSE}, \textbf{ ns2\+\_\+dialect\+\_\+to\+\_\+vc\+\_\+mode()}, \textbf{ ns2\+\_\+vc\+\_\+alloc()}, \textbf{ gprs\+\_\+ns2\+\_\+nse\+::nsei}, \textbf{ OSMO\+\_\+\+ASSERT}, \textbf{ osmo\+\_\+identifier\+\_\+sanitize\+\_\+buf()}, \textbf{ osmo\+\_\+sockaddr\+\_\+to\+\_\+str()}, \textbf{ osmo\+\_\+sockaddr\+\_\+to\+\_\+str\+\_\+buf()}, \textbf{ gprs\+\_\+ns2\+\_\+vc\+::priv}, and \textbf{ priv\+\_\+vc\+::remote}.



Referenced by \textbf{ gprs\+\_\+ns2\+\_\+ip\+\_\+connect\+\_\+inactive()}, \textbf{ ns2\+\_\+create\+\_\+vc\+\_\+sns()}, and \textbf{ ns2\+\_\+sns\+\_\+st\+\_\+bss\+\_\+size\+\_\+onenter()}.

\mbox{\label{gprs__ns2__udp_8c_ab8317d0fe7598c71d4013dec9eb1ff3a}} 
\index{gprs\_ns2\_udp.c@{gprs\_ns2\_udp.c}!ns2\_ip\_count\_bind@{ns2\_ip\_count\_bind}}
\index{ns2\_ip\_count\_bind@{ns2\_ip\_count\_bind}!gprs\_ns2\_udp.c@{gprs\_ns2\_udp.c}}
\doxysubsubsection{ns2\_ip\_count\_bind()}
{\footnotesize\ttfamily int ns2\+\_\+ip\+\_\+count\+\_\+bind (\begin{DoxyParamCaption}\item[{struct \textbf{ gprs\+\_\+ns2\+\_\+inst} $\ast$}]{nsi,  }\item[{struct \textbf{ osmo\+\_\+sockaddr} $\ast$}]{remote }\end{DoxyParamCaption})}



Count UDP binds compatible with remote. 



References \textbf{ gprs\+\_\+ns2\+\_\+inst\+::binding}, \textbf{ gprs\+\_\+ns2\+\_\+ip\+\_\+bind\+\_\+sockaddr()}, \textbf{ gprs\+\_\+ns2\+\_\+is\+\_\+ip\+\_\+bind()}, \textbf{ list}, \textbf{ llist\+\_\+for\+\_\+each\+\_\+entry}, \textbf{ osmo\+\_\+sockaddr\+::sa}, and \textbf{ osmo\+\_\+sockaddr\+::u}.

\mbox{\label{gprs__ns2__udp_8c_af086fbb52419c7dfa939c63a8bfd2025}} 
\index{gprs\_ns2\_udp.c@{gprs\_ns2\_udp.c}!ns2\_ip\_get\_bind\_by\_index@{ns2\_ip\_get\_bind\_by\_index}}
\index{ns2\_ip\_get\_bind\_by\_index@{ns2\_ip\_get\_bind\_by\_index}!gprs\_ns2\_udp.c@{gprs\_ns2\_udp.c}}
\doxysubsubsection{ns2\_ip\_get\_bind\_by\_index()}
{\footnotesize\ttfamily struct \textbf{ gprs\+\_\+ns2\+\_\+vc\+\_\+bind} $\ast$ ns2\+\_\+ip\+\_\+get\+\_\+bind\+\_\+by\+\_\+index (\begin{DoxyParamCaption}\item[{struct \textbf{ gprs\+\_\+ns2\+\_\+inst} $\ast$}]{nsi,  }\item[{struct \textbf{ osmo\+\_\+sockaddr} $\ast$}]{remote,  }\item[{int}]{index }\end{DoxyParamCaption})}



References \textbf{ gprs\+\_\+ns2\+\_\+inst\+::binding}, \textbf{ gprs\+\_\+ns2\+\_\+ip\+\_\+bind\+\_\+sockaddr()}, \textbf{ gprs\+\_\+ns2\+\_\+is\+\_\+ip\+\_\+bind()}, \textbf{ list}, \textbf{ llist\+\_\+for\+\_\+each\+\_\+entry}, \textbf{ osmo\+\_\+sockaddr\+::sa}, and \textbf{ osmo\+\_\+sockaddr\+::u}.

\mbox{\label{gprs__ns2__udp_8c_ad19bf86640befcf389f785e9e9edcbe4}} 
\index{gprs\_ns2\_udp.c@{gprs\_ns2\_udp.c}!ns2\_ip\_set\_txqueue\_max\_length@{ns2\_ip\_set\_txqueue\_max\_length}}
\index{ns2\_ip\_set\_txqueue\_max\_length@{ns2\_ip\_set\_txqueue\_max\_length}!gprs\_ns2\_udp.c@{gprs\_ns2\_udp.c}}
\doxysubsubsection{ns2\_ip\_set\_txqueue\_max\_length()}
{\footnotesize\ttfamily void ns2\+\_\+ip\+\_\+set\+\_\+txqueue\+\_\+max\+\_\+length (\begin{DoxyParamCaption}\item[{struct \textbf{ gprs\+\_\+ns2\+\_\+vc\+\_\+bind} $\ast$}]{bind,  }\item[{unsigned int}]{max\+\_\+length }\end{DoxyParamCaption})}



References \textbf{ gprs\+\_\+ns2\+\_\+is\+\_\+ip\+\_\+bind()}, \textbf{ priv\+\_\+bind\+::iofd}, \textbf{ OSMO\+\_\+\+ASSERT}, \textbf{ osmo\+\_\+iofd\+\_\+set\+\_\+txqueue\+\_\+max\+\_\+length()}, and \textbf{ gprs\+\_\+ns2\+\_\+vc\+\_\+bind\+::priv}.



Referenced by \textbf{ DEFUN()}.

\mbox{\label{gprs__ns2__udp_8c_a6b6c6912766278663f7b2733a63d22df}} 
\index{gprs\_ns2\_udp.c@{gprs\_ns2\_udp.c}!nsip\_sendmsg@{nsip\_sendmsg}}
\index{nsip\_sendmsg@{nsip\_sendmsg}!gprs\_ns2\_udp.c@{gprs\_ns2\_udp.c}}
\doxysubsubsection{nsip\_sendmsg()}
{\footnotesize\ttfamily static int nsip\+\_\+sendmsg (\begin{DoxyParamCaption}\item[{struct \textbf{ gprs\+\_\+ns2\+\_\+vc\+\_\+bind} $\ast$}]{bind,  }\item[{struct \textbf{ msgb} $\ast$}]{msg,  }\item[{const struct \textbf{ osmo\+\_\+sockaddr} $\ast$}]{dest }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}



References \textbf{ priv\+\_\+bind\+::iofd}, \textbf{ msg}, \textbf{ osmo\+\_\+iofd\+\_\+sendto\+\_\+msgb()}, and \textbf{ gprs\+\_\+ns2\+\_\+vc\+\_\+bind\+::priv}.



Referenced by \textbf{ handle\+\_\+nsip\+\_\+recvfrom()}, and \textbf{ nsip\+\_\+vc\+\_\+sendmsg()}.

\mbox{\label{gprs__ns2__udp_8c_a0c055bf5a3c087c4a80241c3db5f98b7}} 
\index{gprs\_ns2\_udp.c@{gprs\_ns2\_udp.c}!nsip\_vc\_sendmsg@{nsip\_vc\_sendmsg}}
\index{nsip\_vc\_sendmsg@{nsip\_vc\_sendmsg}!gprs\_ns2\_udp.c@{gprs\_ns2\_udp.c}}
\doxysubsubsection{nsip\_vc\_sendmsg()}
{\footnotesize\ttfamily static int nsip\+\_\+vc\+\_\+sendmsg (\begin{DoxyParamCaption}\item[{struct \textbf{ gprs\+\_\+ns2\+\_\+vc} $\ast$}]{nsvc,  }\item[{struct \textbf{ msgb} $\ast$}]{msg }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}



send the msg and free it afterwards. 


\begin{DoxyParams}{Parameters}
{\em nsvc} & NS-\/\+VC on which the message shall be sent \\
\hline
{\em msg} & message to be sent \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
number of bytes transmitted; negative on error 
\end{DoxyReturn}


References \textbf{ msg}, \textbf{ nsip\+\_\+sendmsg()}, \textbf{ gprs\+\_\+ns2\+\_\+vc\+\_\+bind\+::nsvc}, \textbf{ gprs\+\_\+ns2\+\_\+vc\+::priv}, and \textbf{ priv\+\_\+vc\+::remote}.



Referenced by \textbf{ gprs\+\_\+ns2\+\_\+ip\+\_\+bind()}.



\doxysubsection{Variable Documentation}
\mbox{\label{gprs__ns2__udp_8c_ac90b4d4652fbaa38508fe6ff6e99fbbf}} 
\index{gprs\_ns2\_udp.c@{gprs\_ns2\_udp.c}!vc\_driver\_ip@{vc\_driver\_ip}}
\index{vc\_driver\_ip@{vc\_driver\_ip}!gprs\_ns2\_udp.c@{gprs\_ns2\_udp.c}}
\doxysubsubsection{vc\_driver\_ip}
{\footnotesize\ttfamily struct \textbf{ gprs\+\_\+ns2\+\_\+vc\+\_\+driver} vc\+\_\+driver\+\_\+ip}

{\bfseries Initial value\+:}
\begin{DoxyCode}{0}
\DoxyCodeLine{= \{}
\DoxyCodeLine{        .name = \textcolor{stringliteral}{"{}GB UDP IPv4/IPv6"{}},}
\DoxyCodeLine{        .free\_bind = free\_bind,}
\DoxyCodeLine{\}}

\end{DoxyCode}


Referenced by \textbf{ gprs\+\_\+ns2\+\_\+ip\+\_\+bind()}, \textbf{ gprs\+\_\+ns2\+\_\+ip\+\_\+vc\+\_\+equal()}, \textbf{ gprs\+\_\+ns2\+\_\+ip\+\_\+vc\+\_\+local()}, \textbf{ gprs\+\_\+ns2\+\_\+ip\+\_\+vc\+\_\+remote()}, and \textbf{ gprs\+\_\+ns2\+\_\+is\+\_\+ip\+\_\+bind()}.

