\doxysection{gsm\+\_\+48\+\_\+049.\+h}
\label{gsm__48__049_8h_source}\index{include/osmocom/gsm/protocol/gsm\_48\_049.h@{include/osmocom/gsm/protocol/gsm\_48\_049.h}}
\textbf{ Go to the documentation of this file.}
\begin{DoxyCode}{0}
\DoxyCodeLine{1 \textcolor{preprocessor}{\#pragma once}}
\DoxyCodeLine{2 \textcolor{preprocessor}{\#include <stdint.h>}}
\DoxyCodeLine{3 \textcolor{preprocessor}{\#include <osmocom/core/utils.h>}}
\DoxyCodeLine{4 }
\DoxyCodeLine{5 \textcolor{comment}{/* CBSP is an ETSI/3GPP standard protocol used between CBC (Cell}}
\DoxyCodeLine{6 \textcolor{comment}{ * Brodadcast Centre) and BSC (Base Station Controller) in 2G/GSM/GERAN}}
\DoxyCodeLine{7 \textcolor{comment}{ * networks.  It is specified in 3GPP TS 48.049.}}
\DoxyCodeLine{8 \textcolor{comment}{ *}}
\DoxyCodeLine{9 \textcolor{comment}{ * (C) 2019 by Harald Welte <laforge@gnumonks.org>}}
\DoxyCodeLine{10 \textcolor{comment}{ * All rights reserved.}}
\DoxyCodeLine{11 \textcolor{comment}{ *}}
\DoxyCodeLine{12 \textcolor{comment}{ * SPDX-\/License-\/Identifier: GPL-\/2.0+}}
\DoxyCodeLine{13 \textcolor{comment}{ *}}
\DoxyCodeLine{14 \textcolor{comment}{ * Released under the terms of the GNU General Public License, Version 2 or}}
\DoxyCodeLine{15 \textcolor{comment}{ * (at your option) any later version.}}
\DoxyCodeLine{16 \textcolor{comment}{ */}}
\DoxyCodeLine{17 }
\DoxyCodeLine{18 \textcolor{comment}{/* 5.2 TCP/IP */}}
\DoxyCodeLine{19 \textcolor{preprocessor}{\#define CBSP\_TCP\_PORT 48049}}
\DoxyCodeLine{20 }
\DoxyCodeLine{21 \textcolor{comment}{/* 8.2.1 Information Element Identifiers */}}
\DoxyCodeLine{22 \textcolor{keyword}{enum} cbsp\_iei \{}
\DoxyCodeLine{23         CBSP\_IEI\_MSG\_CONTENT                = 0x01,}
\DoxyCodeLine{24         CBSP\_IEI\_OLD\_SERIAL\_NR            = 0x02,}
\DoxyCodeLine{25         CBSP\_IEI\_NEW\_SERIAL\_NR            = 0x03,}
\DoxyCodeLine{26         CBSP\_IEI\_CELL\_LIST            = 0x04,}
\DoxyCodeLine{27         CBSP\_IEI\_CATEGORY              = 0x05,}
\DoxyCodeLine{28         CBSP\_IEI\_REP\_PERIOD          = 0x06,}
\DoxyCodeLine{29         CBSP\_IEI\_NUM\_BCAST\_REQ            = 0x07,}
\DoxyCodeLine{30         CBSP\_IEI\_NUM\_BCAST\_COMPL\_LIST      = 0x08,}
\DoxyCodeLine{31         CBSP\_IEI\_FAILURE\_LIST              = 0x09,}
\DoxyCodeLine{32         CBSP\_IEI\_RR\_LOADING\_LIST        = 0x0a,}
\DoxyCodeLine{33         CBSP\_IEI\_CAUSE                    = 0x0b,}
\DoxyCodeLine{34         CBSP\_IEI\_DCS                        = 0x0c,}
\DoxyCodeLine{35         CBSP\_IEI\_RECOVERY\_IND              = 0x0d,}
\DoxyCodeLine{36         CBSP\_IEI\_MSG\_ID                  = 0x0e,}
\DoxyCodeLine{37         CBSP\_IEI\_EMERG\_IND            = 0x0f,}
\DoxyCodeLine{38         CBSP\_IEI\_WARN\_TYPE            = 0x10,}
\DoxyCodeLine{39         CBSP\_IEI\_WARN\_SEC\_INFO            = 0x11,}
\DoxyCodeLine{40         CBSP\_IEI\_CHANNEL\_IND                = 0x12,}
\DoxyCodeLine{41         CBSP\_IEI\_NUM\_OF\_PAGES              = 0x13,}
\DoxyCodeLine{42         CBSP\_IEI\_SCHEDULE\_PERIOD        = 0x14,}
\DoxyCodeLine{43         CBSP\_IEI\_NUM\_OF\_RES\_SLOTS      = 0x15,}
\DoxyCodeLine{44         CBSP\_IEI\_BCAST\_MSG\_TYPE          = 0x16,}
\DoxyCodeLine{45         CBSP\_IEI\_WARNING\_PERIOD          = 0x17,}
\DoxyCodeLine{46         CBSP\_IEI\_KEEP\_ALIVE\_REP\_PERIOD    = 0x18,}
\DoxyCodeLine{47 \};}
\DoxyCodeLine{48 }
\DoxyCodeLine{49 \textcolor{comment}{/* 8.2.2 Message Type */}}
\DoxyCodeLine{50 \textcolor{keyword}{enum} cbsp\_msg\_type \{}
\DoxyCodeLine{51         CBSP\_MSGT\_WRITE\_REPLACE          = 0x01,}
\DoxyCodeLine{52         CBSP\_MSGT\_WRITE\_REPLACE\_COMPL      = 0x02,}
\DoxyCodeLine{53         CBSP\_MSGT\_WRITE\_REPLACE\_FAIL        = 0x03,}
\DoxyCodeLine{54         CBSP\_MSGT\_KILL                    = 0x04,}
\DoxyCodeLine{55         CBSP\_MSGT\_KILL\_COMPL                = 0x05,}
\DoxyCodeLine{56         CBSP\_MSGT\_KILL\_FAIL          = 0x06,}
\DoxyCodeLine{57         CBSP\_MSGT\_LOAD\_QUERY                = 0x07,}
\DoxyCodeLine{58         CBSP\_MSGT\_LOAD\_QUERY\_COMPL    = 0x08,}
\DoxyCodeLine{59         CBSP\_MSGT\_LOAD\_QUERY\_FAIL      = 0x09,}
\DoxyCodeLine{60         CBSP\_MSGT\_MSG\_STATUS\_QUERY    = 0x0a,}
\DoxyCodeLine{61         CBSP\_MSGT\_MSG\_STATUS\_QUERY\_COMPL= 0x0b,}
\DoxyCodeLine{62         CBSP\_MSGT\_MSG\_STATUS\_QUERY\_FAIL  = 0x0c,}
\DoxyCodeLine{63         CBSP\_MSGT\_SET\_DRX              = 0x0d,}
\DoxyCodeLine{64         CBSP\_MSGT\_SET\_DRX\_COMPL          = 0x0e,}
\DoxyCodeLine{65         CBSP\_MSGT\_SET\_DRX\_FAIL            = 0x0f,}
\DoxyCodeLine{66         CBSP\_MSGT\_RESET                  = 0x10,}
\DoxyCodeLine{67         CBSP\_MSGT\_RESET\_COMPL              = 0x11,}
\DoxyCodeLine{68         CBSP\_MSGT\_RESET\_FAIL                = 0x12,}
\DoxyCodeLine{69         CBSP\_MSGT\_RESTART              = 0x13,}
\DoxyCodeLine{70         CBSP\_MSGT\_FAILURE              = 0x14,}
\DoxyCodeLine{71         CBSP\_MSGT\_ERROR\_IND          = 0x15,}
\DoxyCodeLine{72         CBSP\_MSGT\_KEEP\_ALIVE                = 0x16,}
\DoxyCodeLine{73         CBSP\_MSGT\_KEEP\_ALIVE\_COMPL    = 0x17,}
\DoxyCodeLine{74 \};}
\DoxyCodeLine{75 }
\DoxyCodeLine{76 \textcolor{comment}{/* 8.2.7 Category */}}
\DoxyCodeLine{77 \textcolor{keyword}{enum} cbsp\_category \{}
\DoxyCodeLine{78         CBSP\_CATEG\_HIGH\_PRIO                = 0x00,}
\DoxyCodeLine{79         CBSP\_CATEG\_BACKGROUND              = 0x01,}
\DoxyCodeLine{80         CBSP\_CATEG\_NORMAL              = 0x02,}
\DoxyCodeLine{81 \};}
\DoxyCodeLine{82 }
\DoxyCodeLine{83 \textcolor{comment}{/* Cell ID Discriminator (8.2.11, ...) */}}
\DoxyCodeLine{84 \textcolor{keyword}{enum} cbsp\_cell\_id\_disc \{}
\DoxyCodeLine{85         CBSP\_CIDD\_WHOLE\_CGI          = 0x0,}
\DoxyCodeLine{86         CBSP\_CIDD\_LAC\_CI                = 0x1,}
\DoxyCodeLine{87         CBSP\_CIDD\_CI                        = 0x2,}
\DoxyCodeLine{88         CBSP\_CIDD\_LAI                      = 0x4,}
\DoxyCodeLine{89         CBSP\_CIDD\_LAC                      = 0x5,}
\DoxyCodeLine{90         CBSP\_CIDD\_ALL\_IN\_BSC                = 0x6,}
\DoxyCodeLine{91 \};}
\DoxyCodeLine{92 }
\DoxyCodeLine{93 \textcolor{comment}{/* 8.2.13 Cause */}}
\DoxyCodeLine{94 \textcolor{keyword}{enum} cbsp\_cell\_id\_cause \{}
\DoxyCodeLine{95         CBSP\_CAUSE\_PARAM\_NOT\_RECOGNISED                  = 0x00,}
\DoxyCodeLine{96         CBSP\_CAUSE\_PARAM\_VAL\_INVALID                        = 0x01,}
\DoxyCodeLine{97         CBSP\_CAUSE\_MSG\_REF\_NOT\_IDENTIFIED              = 0x02,}
\DoxyCodeLine{98         CBSP\_CAUSE\_CELL\_ID\_NOT\_VALID                        = 0x03,}
\DoxyCodeLine{99         CBSP\_CAUSE\_UNRECOGNISED\_MSG                  = 0x04,}
\DoxyCodeLine{100         CBSP\_CAUSE\_MISSING\_MAND\_IE                    = 0x05,}
\DoxyCodeLine{101         CBSP\_CAUSE\_BSC\_CAPACITY\_EXCEEDED                = 0x06,}
\DoxyCodeLine{102         CBSP\_CAUSE\_CELL\_MEMORY\_EXCEEDED                  = 0x07,}
\DoxyCodeLine{103         CBSP\_CAUSE\_BSC\_MEMORY\_EXCEEDED                    = 0x08,}
\DoxyCodeLine{104         CBSP\_CAUSE\_CB\_NOT\_SUPPORTED                  = 0x09,}
\DoxyCodeLine{105         CBSP\_CAUSE\_CB\_NOT\_OPERATIONAL                      = 0x0a,}
\DoxyCodeLine{106         CBSP\_CAUSE\_INCOMPATIBLE\_DRX\_PARAM              = 0x0b,}
\DoxyCodeLine{107         CBSP\_CAUSE\_EXT\_CHAN\_NOT\_SUPPORTED              = 0x0c,}
\DoxyCodeLine{108         CBSP\_CAUSE\_MSG\_REF\_ALREADY\_USED                  = 0x0d,}
\DoxyCodeLine{109         CBSP\_CAUSE\_UNSPECIFIED\_ERROR                        = 0x0e,}
\DoxyCodeLine{110         CBSP\_CAUSE\_LAI\_OR\_LAC\_NPT\_VALID                  = 0x0f,}
\DoxyCodeLine{111 \};}
\DoxyCodeLine{112 }
\DoxyCodeLine{113 \textcolor{comment}{/* 8.2.20 Chanel Indicator */}}
\DoxyCodeLine{114 \textcolor{keyword}{enum} cbsp\_channel\_ind \{}
\DoxyCodeLine{115         CBSP\_CHAN\_IND\_BASIC  = 0,}
\DoxyCodeLine{116         CBSP\_CHAN\_IND\_EXTENDED    = 1,}
\DoxyCodeLine{117 \};}
\DoxyCodeLine{118 }
\DoxyCodeLine{119 \textcolor{comment}{/* not explicitly specified, but every message starts with those mandatory elements */}}
\DoxyCodeLine{120 \textcolor{keyword}{struct }cbsp\_header \{}
\DoxyCodeLine{121         uint8\_t msg\_type;}
\DoxyCodeLine{122         uint8\_t len[3]; \textcolor{comment}{/* excluding the header */}}
\DoxyCodeLine{123 \} \_\_attribute\_\_((packed));}
\DoxyCodeLine{124 }
\DoxyCodeLine{125 \textcolor{keyword}{extern} \textcolor{keyword}{const} \textcolor{keyword}{struct }value\_string cbsp\_msg\_type\_names[];}
\DoxyCodeLine{126 \textcolor{keyword}{extern} \textcolor{keyword}{const} \textcolor{keyword}{struct }value\_string cbsp\_iei\_names[];}
\DoxyCodeLine{127 \textcolor{keyword}{extern} \textcolor{keyword}{const} \textcolor{keyword}{struct }value\_string cbsp\_category\_names[];}
\DoxyCodeLine{128 \textcolor{keyword}{extern} \textcolor{keyword}{const} \textcolor{keyword}{struct }tlv\_definition cbsp\_att\_tlvdef;}

\end{DoxyCode}
