\doxysection{src/gb/gb\+\_\+internal.h File Reference}
\label{gb__internal_8h}\index{src/gb/gb\_internal.h@{src/gb/gb\_internal.h}}
{\ttfamily \#include $<$osmocom/core/msgb.\+h$>$}\newline
{\ttfamily \#include $<$osmocom/gsm/tlv.\+h$>$}\newline
{\ttfamily \#include $<$osmocom/gprs/gprs\+\_\+ns.\+h$>$}\newline
\doxysubsection*{Functions}
\begin{DoxyCompactItemize}
\item 
int \textbf{ gprs\+\_\+ns\+\_\+rx\+\_\+sns} (struct \textbf{ gprs\+\_\+ns\+\_\+inst} $\ast$nsi, struct \textbf{ msgb} $\ast$\textbf{ msg}, struct \textbf{ tlv\+\_\+parsed} $\ast$tp)
\item 
struct \textbf{ osmo\+\_\+fsm\+\_\+inst} $\ast$ \textbf{ gprs\+\_\+sns\+\_\+bss\+\_\+fsm\+\_\+alloc} (void $\ast$ctx, struct \textbf{ gprs\+\_\+nsvc} $\ast$nsvc, const char $\ast$id)
\item 
int \textbf{ gprs\+\_\+sns\+\_\+bss\+\_\+fsm\+\_\+start} (struct \textbf{ gprs\+\_\+ns\+\_\+inst} $\ast$nsi)
\item 
int \textbf{ gprs\+\_\+sns\+\_\+init} (void)
\item 
void \textbf{ gprs\+\_\+nsvc\+\_\+start\+\_\+test} (struct \textbf{ gprs\+\_\+nsvc} $\ast$nsvc)
\begin{DoxyCompactList}\small\item\em Start the ALIVE timer procedure in all NS-\/\+VCs part of this NS Instance. \end{DoxyCompactList}\item 
void \textbf{ gprs\+\_\+start\+\_\+alive\+\_\+all\+\_\+nsvcs} (struct \textbf{ gprs\+\_\+ns\+\_\+inst} $\ast$nsi)
\item 
int \textbf{ gprs\+\_\+ns\+\_\+tx\+\_\+sns\+\_\+ack} (struct \textbf{ gprs\+\_\+nsvc} $\ast$nsvc, uint8\+\_\+t trans\+\_\+id, uint8\+\_\+t $\ast$\textbf{ cause}, const struct \textbf{ gprs\+\_\+ns\+\_\+ie\+\_\+ip4\+\_\+elem} $\ast$ip4\+\_\+elems, unsigned int num\+\_\+ip4\+\_\+elems)
\begin{DoxyCompactList}\small\item\em Encode + Transmit a SNS-\/\+ACK as per Section 9.\+3.\+1. \end{DoxyCompactList}\item 
int \textbf{ gprs\+\_\+ns\+\_\+tx\+\_\+sns\+\_\+config} (struct \textbf{ gprs\+\_\+nsvc} $\ast$nsvc, bool end\+\_\+flag, const struct \textbf{ gprs\+\_\+ns\+\_\+ie\+\_\+ip4\+\_\+elem} $\ast$ip4\+\_\+elems, unsigned int num\+\_\+ip4\+\_\+elems)
\begin{DoxyCompactList}\small\item\em Encode + Transmit a SNS-\/\+CONFIG as per Section 9.\+3.\+4. \end{DoxyCompactList}\item 
int \textbf{ gprs\+\_\+ns\+\_\+tx\+\_\+sns\+\_\+config\+\_\+ack} (struct \textbf{ gprs\+\_\+nsvc} $\ast$nsvc, uint8\+\_\+t $\ast$\textbf{ cause})
\begin{DoxyCompactList}\small\item\em Encode + Transmit a SNS-\/\+CONFIG-\/\+ACK as per Section 9.\+3.\+5. \end{DoxyCompactList}\item 
int \textbf{ gprs\+\_\+ns\+\_\+tx\+\_\+sns\+\_\+size} (struct \textbf{ gprs\+\_\+nsvc} $\ast$nsvc, bool reset\+\_\+flag, uint16\+\_\+t max\+\_\+nr\+\_\+nsvc, uint16\+\_\+t $\ast$ip4\+\_\+ep\+\_\+nr, uint16\+\_\+t $\ast$ip6\+\_\+ep\+\_\+nr)
\begin{DoxyCompactList}\small\item\em Encode + transmit a SNS-\/\+SIZE as per Section 9.\+3.\+7. \end{DoxyCompactList}\item 
int \textbf{ gprs\+\_\+ns\+\_\+tx\+\_\+sns\+\_\+size\+\_\+ack} (struct \textbf{ gprs\+\_\+nsvc} $\ast$nsvc, uint8\+\_\+t $\ast$\textbf{ cause})
\begin{DoxyCompactList}\small\item\em Encode + Transmit a SNS-\/\+SIZE-\/\+ACK as per Section 9.\+3.\+8. \end{DoxyCompactList}\item 
void \textbf{ gprs\+\_\+sns\+\_\+dump\+\_\+vty} (struct \textbf{ vty} $\ast$\textbf{ vty}, const struct \textbf{ gprs\+\_\+ns\+\_\+inst} $\ast$nsi, bool stats)
\end{DoxyCompactItemize}


\doxysubsection{Function Documentation}
\mbox{\label{gb__internal_8h_adeeafe99a980eb2612867f0d0cd92703}} 
\index{gb\_internal.h@{gb\_internal.h}!gprs\_ns\_rx\_sns@{gprs\_ns\_rx\_sns}}
\index{gprs\_ns\_rx\_sns@{gprs\_ns\_rx\_sns}!gb\_internal.h@{gb\_internal.h}}
\doxysubsubsection{gprs\_ns\_rx\_sns()}
{\footnotesize\ttfamily int gprs\+\_\+ns\+\_\+rx\+\_\+sns (\begin{DoxyParamCaption}\item[{struct \textbf{ gprs\+\_\+ns\+\_\+inst} $\ast$}]{nsi,  }\item[{struct \textbf{ msgb} $\ast$}]{msg,  }\item[{struct \textbf{ tlv\+\_\+parsed} $\ast$}]{tp }\end{DoxyParamCaption})}



References \textbf{ gprs\+\_\+ns\+\_\+inst\+::bss\+\_\+sns\+\_\+fi}, \textbf{ gprs\+\_\+ns\+\_\+hdr\+::data}, \textbf{ DNS}, \textbf{ get\+\_\+value\+\_\+string()}, \textbf{ gprs\+\_\+ns\+\_\+pdu\+\_\+strings}, \textbf{ GPRS\+\_\+\+SNS\+\_\+\+EV\+\_\+\+ADD}, \textbf{ GPRS\+\_\+\+SNS\+\_\+\+EV\+\_\+\+CHANGE\+\_\+\+WEIGHT}, \textbf{ GPRS\+\_\+\+SNS\+\_\+\+EV\+\_\+\+CONFIG}, \textbf{ GPRS\+\_\+\+SNS\+\_\+\+EV\+\_\+\+CONFIG\+\_\+\+ACK}, \textbf{ GPRS\+\_\+\+SNS\+\_\+\+EV\+\_\+\+CONFIG\+\_\+\+END}, \textbf{ GPRS\+\_\+\+SNS\+\_\+\+EV\+\_\+\+DELETE}, \textbf{ GPRS\+\_\+\+SNS\+\_\+\+EV\+\_\+\+SIZE}, \textbf{ GPRS\+\_\+\+SNS\+\_\+\+EV\+\_\+\+SIZE\+\_\+\+ACK}, \textbf{ LOGL\+\_\+\+DEBUG}, \textbf{ LOGL\+\_\+\+ERROR}, \textbf{ LOGL\+\_\+\+NOTICE}, \textbf{ LOGP}, \textbf{ msg}, \textbf{ msgb\+\_\+nsei}, \textbf{ nsei}, \textbf{ osmo\+\_\+fsm\+\_\+inst\+\_\+dispatch}, \textbf{ gprs\+\_\+ns\+\_\+hdr\+::pdu\+\_\+type}, \textbf{ SNS\+\_\+\+PDUT\+\_\+\+ACK}, \textbf{ SNS\+\_\+\+PDUT\+\_\+\+ADD}, \textbf{ SNS\+\_\+\+PDUT\+\_\+\+CHANGE\+\_\+\+WEIGHT}, \textbf{ SNS\+\_\+\+PDUT\+\_\+\+CONFIG}, \textbf{ SNS\+\_\+\+PDUT\+\_\+\+CONFIG\+\_\+\+ACK}, \textbf{ SNS\+\_\+\+PDUT\+\_\+\+DELETE}, \textbf{ SNS\+\_\+\+PDUT\+\_\+\+SIZE}, and \textbf{ SNS\+\_\+\+PDUT\+\_\+\+SIZE\+\_\+\+ACK}.



Referenced by \textbf{ gprs\+\_\+ns\+\_\+process\+\_\+msg()}.

\mbox{\label{gb__internal_8h_acd0a066efad503257729a6432eaf3ee9}} 
\index{gb\_internal.h@{gb\_internal.h}!gprs\_sns\_bss\_fsm\_alloc@{gprs\_sns\_bss\_fsm\_alloc}}
\index{gprs\_sns\_bss\_fsm\_alloc@{gprs\_sns\_bss\_fsm\_alloc}!gb\_internal.h@{gb\_internal.h}}
\doxysubsubsection{gprs\_sns\_bss\_fsm\_alloc()}
{\footnotesize\ttfamily struct \textbf{ osmo\+\_\+fsm\+\_\+inst} $\ast$ gprs\+\_\+sns\+\_\+bss\+\_\+fsm\+\_\+alloc (\begin{DoxyParamCaption}\item[{void $\ast$}]{ctx,  }\item[{struct \textbf{ gprs\+\_\+nsvc} $\ast$}]{nsvc,  }\item[{const char $\ast$}]{id }\end{DoxyParamCaption})}



References \textbf{ gprs\+\_\+nsvc\+::bts\+\_\+addr}, \textbf{ gprs\+\_\+ns\+\_\+ie\+\_\+ip4\+\_\+elem\+::data\+\_\+weight}, \textbf{ gprs\+\_\+sns\+\_\+bss\+\_\+fsm}, \textbf{ gprs\+\_\+nsvc\+::ip}, \textbf{ gprs\+\_\+sns\+\_\+state\+::ip4\+\_\+local}, \textbf{ gprs\+\_\+ns\+\_\+ie\+\_\+ip4\+\_\+elem\+::ip\+\_\+addr}, \textbf{ gprs\+\_\+ns\+\_\+inst\+::local\+\_\+ip}, \textbf{ gprs\+\_\+ns\+\_\+inst\+::local\+\_\+port}, \textbf{ LOGL\+\_\+\+DEBUG}, \textbf{ gprs\+\_\+sns\+\_\+state\+::next\+\_\+nsvci}, \textbf{ gprs\+\_\+nsvc\+::nsi}, \textbf{ gprs\+\_\+sns\+\_\+state\+::nsi}, \textbf{ gprs\+\_\+ns\+\_\+inst\+::nsip}, \textbf{ gprs\+\_\+sns\+\_\+state\+::nsvc\+\_\+hack}, \textbf{ gprs\+\_\+sns\+\_\+state\+::num\+\_\+ip4\+\_\+local}, \textbf{ gprs\+\_\+sns\+\_\+state\+::num\+\_\+max\+\_\+ip4\+\_\+remote}, \textbf{ gprs\+\_\+sns\+\_\+state\+::num\+\_\+max\+\_\+nsvcs}, \textbf{ osmo\+\_\+fsm\+\_\+inst\+\_\+alloc()}, \textbf{ osmo\+\_\+fsm\+\_\+inst\+\_\+term}, \textbf{ OSMO\+\_\+\+FSM\+\_\+\+TERM\+\_\+\+ERROR}, \textbf{ osmo\+\_\+sock\+\_\+local\+\_\+ip()}, \textbf{ osmo\+\_\+fsm\+\_\+inst\+::priv}, \textbf{ gprs\+\_\+ns\+\_\+ie\+\_\+ip4\+\_\+elem\+::sig\+\_\+weight}, and \textbf{ gprs\+\_\+ns\+\_\+ie\+\_\+ip4\+\_\+elem\+::udp\+\_\+port}.



Referenced by \textbf{ gprs\+\_\+ns\+\_\+nsip\+\_\+connect\+\_\+sns()}.

\mbox{\label{gb__internal_8h_a0b79a9e6e7a682928f05484bde50dcc7}} 
\index{gb\_internal.h@{gb\_internal.h}!gprs\_sns\_bss\_fsm\_start@{gprs\_sns\_bss\_fsm\_start}}
\index{gprs\_sns\_bss\_fsm\_start@{gprs\_sns\_bss\_fsm\_start}!gb\_internal.h@{gb\_internal.h}}
\doxysubsubsection{gprs\_sns\_bss\_fsm\_start()}
{\footnotesize\ttfamily int gprs\+\_\+sns\+\_\+bss\+\_\+fsm\+\_\+start (\begin{DoxyParamCaption}\item[{struct \textbf{ gprs\+\_\+ns\+\_\+inst} $\ast$}]{nsi }\end{DoxyParamCaption})}



References \textbf{ gprs\+\_\+ns\+\_\+inst\+::bss\+\_\+sns\+\_\+fi}, \textbf{ GPRS\+\_\+\+SNS\+\_\+\+EV\+\_\+\+START}, and \textbf{ osmo\+\_\+fsm\+\_\+inst\+\_\+dispatch}.



Referenced by \textbf{ gprs\+\_\+ns\+\_\+nsip\+\_\+connect\+\_\+sns()}.

\mbox{\label{gb__internal_8h_a2cb17918aa03e15bfe2792bef0335ee5}} 
\index{gb\_internal.h@{gb\_internal.h}!gprs\_sns\_dump\_vty@{gprs\_sns\_dump\_vty}}
\index{gprs\_sns\_dump\_vty@{gprs\_sns\_dump\_vty}!gb\_internal.h@{gb\_internal.h}}
\doxysubsubsection{gprs\_sns\_dump\_vty()}
{\footnotesize\ttfamily void gprs\+\_\+sns\+\_\+dump\+\_\+vty (\begin{DoxyParamCaption}\item[{struct \textbf{ vty} $\ast$}]{vty,  }\item[{const struct \textbf{ gprs\+\_\+ns\+\_\+inst} $\ast$}]{nsi,  }\item[{bool}]{stats }\end{DoxyParamCaption})}



References \textbf{ gprs\+\_\+ns\+\_\+inst\+::bss\+\_\+sns\+\_\+fi}, \textbf{ gprs\+\_\+sns\+\_\+state\+::ip4\+\_\+local}, \textbf{ gprs\+\_\+sns\+\_\+state\+::ip4\+\_\+remote}, \textbf{ gprs\+\_\+sns\+\_\+state\+::nsi}, \textbf{ gprs\+\_\+sns\+\_\+state\+::num\+\_\+ip4\+\_\+local}, \textbf{ gprs\+\_\+sns\+\_\+state\+::num\+\_\+ip4\+\_\+remote}, \textbf{ gprs\+\_\+sns\+\_\+state\+::num\+\_\+max\+\_\+ip4\+\_\+remote}, \textbf{ gprs\+\_\+sns\+\_\+state\+::num\+\_\+max\+\_\+nsvcs}, \textbf{ osmo\+\_\+fsm\+\_\+inst\+::priv}, \textbf{ vty\+\_\+dump\+\_\+sns\+\_\+ip4()}, \textbf{ VTY\+\_\+\+NEWLINE}, \textbf{ vty\+\_\+out()}, and \textbf{ vty\+\_\+out\+\_\+fsm\+\_\+inst()}.



Referenced by \textbf{ dump\+\_\+ns()}.

\mbox{\label{gb__internal_8h_a5dc9cef920e0753b4d42b0f0419d52be}} 
\index{gb\_internal.h@{gb\_internal.h}!gprs\_sns\_init@{gprs\_sns\_init}}
\index{gprs\_sns\_init@{gprs\_sns\_init}!gb\_internal.h@{gb\_internal.h}}
\doxysubsubsection{gprs\_sns\_init()}
{\footnotesize\ttfamily int gprs\+\_\+sns\+\_\+init (\begin{DoxyParamCaption}\item[{void}]{ }\end{DoxyParamCaption})}



References \textbf{ DNS}, \textbf{ gprs\+\_\+sns\+\_\+bss\+\_\+fsm}, \textbf{ osmo\+\_\+fsm\+::log\+\_\+subsys}, and \textbf{ osmo\+\_\+fsm\+\_\+register()}.



Referenced by \textbf{ gprs\+\_\+ns\+\_\+instantiate()}.

