\doxysection{include/osmocom/gprs/protocol/gsm\+\_\+08\+\_\+16.h File Reference}
\label{gsm__08__16_8h}\index{include/osmocom/gprs/protocol/gsm\_08\_16.h@{include/osmocom/gprs/protocol/gsm\_08\_16.h}}


GPRS Networks Service (NS) messages on the Gb interface.  


{\ttfamily \#include $<$stdint.\+h$>$}\newline
{\ttfamily \#include $<$arpa/inet.\+h$>$}\newline
{\ttfamily \#include $<$osmocom/core/utils.\+h$>$}\newline
\doxysubsection*{Data Structures}
\begin{DoxyCompactItemize}
\item 
struct \textbf{ gprs\+\_\+ns\+\_\+hdr}
\begin{DoxyCompactList}\small\item\em Common header of GPRS NS. \end{DoxyCompactList}\item 
struct \textbf{ gprs\+\_\+ns\+\_\+ie\+\_\+ip4\+\_\+elem}
\begin{DoxyCompactList}\small\item\em Section 10.\+3.\+2c List of IP4 Elements. \end{DoxyCompactList}\item 
struct \textbf{ gprs\+\_\+ns\+\_\+ie\+\_\+ip6\+\_\+elem}
\begin{DoxyCompactList}\small\item\em Section 10.\+3.\+2d List of IP6 Elements. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsection*{Enumerations}
\begin{DoxyCompactItemize}
\item 
enum \textbf{ ns\+\_\+pdu\+\_\+type} \{ \newline
\textbf{ NS\+\_\+\+PDUT\+\_\+\+UNITDATA} = 0x00
, \newline
\textbf{ NS\+\_\+\+PDUT\+\_\+\+RESET} = 0x02
, \newline
\textbf{ NS\+\_\+\+PDUT\+\_\+\+RESET\+\_\+\+ACK} = 0x03
, \newline
\textbf{ NS\+\_\+\+PDUT\+\_\+\+BLOCK} = 0x04
, \newline
\textbf{ NS\+\_\+\+PDUT\+\_\+\+BLOCK\+\_\+\+ACK} = 0x05
, \newline
\textbf{ NS\+\_\+\+PDUT\+\_\+\+UNBLOCK} = 0x06
, \newline
\textbf{ NS\+\_\+\+PDUT\+\_\+\+UNBLOCK\+\_\+\+ACK} = 0x07
, \newline
\textbf{ NS\+\_\+\+PDUT\+\_\+\+STATUS} = 0x08
, \newline
\textbf{ NS\+\_\+\+PDUT\+\_\+\+ALIVE} = 0x0a
, \newline
\textbf{ NS\+\_\+\+PDUT\+\_\+\+ALIVE\+\_\+\+ACK} = 0x0b
, \newline
\textbf{ SNS\+\_\+\+PDUT\+\_\+\+ACK} = 0x0c
, \newline
\textbf{ SNS\+\_\+\+PDUT\+\_\+\+ADD} = 0x0d
, \newline
\textbf{ SNS\+\_\+\+PDUT\+\_\+\+CHANGE\+\_\+\+WEIGHT} = 0x0e
, \newline
\textbf{ SNS\+\_\+\+PDUT\+\_\+\+CONFIG} = 0x0f
, \newline
\textbf{ SNS\+\_\+\+PDUT\+\_\+\+CONFIG\+\_\+\+ACK} = 0x10
, \newline
\textbf{ SNS\+\_\+\+PDUT\+\_\+\+DELETE} = 0x11
, \newline
\textbf{ SNS\+\_\+\+PDUT\+\_\+\+SIZE} = 0x12
, \newline
\textbf{ SNS\+\_\+\+PDUT\+\_\+\+SIZE\+\_\+\+ACK} = 0x13
 \}
\begin{DoxyCompactList}\small\item\em NS PDU Type (TS 08.\+16, Section 10.\+3.\+7, Table 14) \end{DoxyCompactList}\item 
enum \textbf{ ns\+\_\+ctrl\+\_\+ie} \{ \newline
\textbf{ NS\+\_\+\+IE\+\_\+\+CAUSE} = 0x00
, \newline
\textbf{ NS\+\_\+\+IE\+\_\+\+VCI} = 0x01
, \newline
\textbf{ NS\+\_\+\+IE\+\_\+\+PDU} = 0x02
, \newline
\textbf{ NS\+\_\+\+IE\+\_\+\+BVCI} = 0x03
, \newline
\textbf{ NS\+\_\+\+IE\+\_\+\+NSEI} = 0x04
, \newline
\textbf{ NS\+\_\+\+IE\+\_\+\+IPv4\+\_\+\+LIST} = 0x05
, \newline
\textbf{ NS\+\_\+\+IE\+\_\+\+IPv6\+\_\+\+LIST} = 0x06
, \newline
\textbf{ NS\+\_\+\+IE\+\_\+\+MAX\+\_\+\+NR\+\_\+\+NSVC} = 0x07
, \newline
\textbf{ NS\+\_\+\+IE\+\_\+\+IPv4\+\_\+\+EP\+\_\+\+NR} = 0x08
, \newline
\textbf{ NS\+\_\+\+IE\+\_\+\+IPv6\+\_\+\+EP\+\_\+\+NR} = 0x09
, \newline
\textbf{ NS\+\_\+\+IE\+\_\+\+RESET\+\_\+\+FLAG} = 0x0a
, \newline
\textbf{ NS\+\_\+\+IE\+\_\+\+IP\+\_\+\+ADDR} = 0x0b
, \newline
\textbf{ NS\+\_\+\+IE\+\_\+\+TRANS\+\_\+\+ID} = 0xff
 \}
\begin{DoxyCompactList}\small\item\em NS Control IE (TS 08.\+16, Section 10.\+3, Table 12) \end{DoxyCompactList}\item 
enum \textbf{ ns\+\_\+cause} \{ \newline
\textbf{ NS\+\_\+\+CAUSE\+\_\+\+TRANSIT\+\_\+\+FAIL} = 0x00
, \newline
\textbf{ NS\+\_\+\+CAUSE\+\_\+\+OM\+\_\+\+INTERVENTION} = 0x01
, \newline
\textbf{ NS\+\_\+\+CAUSE\+\_\+\+EQUIP\+\_\+\+FAIL} = 0x02
, \newline
\textbf{ NS\+\_\+\+CAUSE\+\_\+\+NSVC\+\_\+\+BLOCKED} = 0x03
, \newline
\textbf{ NS\+\_\+\+CAUSE\+\_\+\+NSVC\+\_\+\+UNKNOWN} = 0x04
, \newline
\textbf{ NS\+\_\+\+CAUSE\+\_\+\+BVCI\+\_\+\+UNKNOWN} = 0x05
, \newline
\textbf{ NS\+\_\+\+CAUSE\+\_\+\+SEM\+\_\+\+INCORR\+\_\+\+PDU} = 0x08
, \newline
\textbf{ NS\+\_\+\+CAUSE\+\_\+\+PDU\+\_\+\+INCOMP\+\_\+\+PSTATE} = 0x0a
, \newline
\textbf{ NS\+\_\+\+CAUSE\+\_\+\+PROTO\+\_\+\+ERR\+\_\+\+UNSPEC} = 0x0b
, \newline
\textbf{ NS\+\_\+\+CAUSE\+\_\+\+INVAL\+\_\+\+ESSENT\+\_\+\+IE} = 0x0c
, \newline
\textbf{ NS\+\_\+\+CAUSE\+\_\+\+MISSING\+\_\+\+ESSENT\+\_\+\+IE} = 0x0d
, \newline
\textbf{ NS\+\_\+\+CAUSE\+\_\+\+INVAL\+\_\+\+NR\+\_\+\+IPv4\+\_\+\+EP} = 0x0e
, \newline
\textbf{ NS\+\_\+\+CAUSE\+\_\+\+INVAL\+\_\+\+NR\+\_\+\+IPv6\+\_\+\+EP} = 0x0f
, \newline
\textbf{ NS\+\_\+\+CAUSE\+\_\+\+INVAL\+\_\+\+NR\+\_\+\+NS\+\_\+\+VC} = 0x10
, \newline
\textbf{ NS\+\_\+\+CAUSE\+\_\+\+INVAL\+\_\+\+WEIGH} = 0x11
, \newline
\textbf{ NS\+\_\+\+CAUSE\+\_\+\+UNKN\+\_\+\+IP\+\_\+\+EP} = 0x12
, \newline
\textbf{ NS\+\_\+\+CAUSE\+\_\+\+UNKN\+\_\+\+IP\+\_\+\+ADDR} = 0x13
, \newline
\textbf{ NS\+\_\+\+CAUSE\+\_\+\+UNKN\+\_\+\+IP\+\_\+\+TEST\+\_\+\+FAILED} = 0x14
 \}
\begin{DoxyCompactList}\small\item\em NS Cause (TS 08.\+16, Section 10.\+3.\+2, Table 13) \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsection*{Functions}
\begin{DoxyCompactItemize}
\item 
struct \textbf{ gprs\+\_\+ns\+\_\+hdr} \textbf{ \+\_\+\+\_\+attribute\+\_\+\+\_\+} ((packed))
\end{DoxyCompactItemize}
\doxysubsection*{Variables}
\begin{DoxyCompactItemize}
\item 
uint8\+\_\+t \textbf{ pdu\+\_\+type}
\begin{DoxyCompactList}\small\item\em NS PDU type. \end{DoxyCompactList}\item 
uint8\+\_\+t \textbf{ data} [0]
\begin{DoxyCompactList}\small\item\em variable-\/length payload \end{DoxyCompactList}\item 
uint32\+\_\+t \textbf{ ip\+\_\+addr}
\item 
uint16\+\_\+t \textbf{ udp\+\_\+port}
\item 
uint8\+\_\+t \textbf{ sig\+\_\+weight}
\item 
uint8\+\_\+t \textbf{ data\+\_\+weight}
\item 
const struct \textbf{ value\+\_\+string} \textbf{ gprs\+\_\+ns\+\_\+pdu\+\_\+strings} [$\,$]
\item 
enum \textbf{ ns\+\_\+pdu\+\_\+type} \textbf{ \+\_\+\+\_\+attribute\+\_\+\+\_\+}
\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}
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) 3GPP TS 48.\+016 version 6.\+5.\+0 Release 6 / ETSI TS 148 016 V6.\+5.\+0 (2005-\/11) 