\doxysection{gsm48\+\_\+rest\+\_\+octets.\+h}
\label{gsm48__rest__octets_8h_source}\index{include/osmocom/gsm/gsm48\_rest\_octets.h@{include/osmocom/gsm/gsm48\_rest\_octets.h}}
\textbf{ Go to the documentation of this file.}
\begin{DoxyCode}{0}
\DoxyCodeLine{1 \textcolor{preprocessor}{\#pragma once}}
\DoxyCodeLine{2 }
\DoxyCodeLine{3 \textcolor{preprocessor}{\#include <stdbool.h>}}
\DoxyCodeLine{4 \textcolor{preprocessor}{\#include <osmocom/gsm/sysinfo.h>}}
\DoxyCodeLine{5 \textcolor{preprocessor}{\#include <osmocom/gsm/protocol/gsm\_44\_060.h>}}
\DoxyCodeLine{6 }
\DoxyCodeLine{7 \textcolor{comment}{/* 16 is the max. number of SI2quater messages according to 3GPP TS 44.018 Table 10.5.2.33b.1:}}
\DoxyCodeLine{8 \textcolor{comment}{   4-\/bit index is used (2\#1111 = 10\#15) */}}
\DoxyCodeLine{9 \textcolor{preprocessor}{\#define SI2Q\_MAX\_NUM 16}}
\DoxyCodeLine{10 \textcolor{comment}{/* length in bits (for single SI2quater message) */}}
\DoxyCodeLine{11 \textcolor{preprocessor}{\#define SI2Q\_MAX\_LEN 160}}
\DoxyCodeLine{12 \textcolor{preprocessor}{\#define SI2Q\_MIN\_LEN 18}}
\DoxyCodeLine{13 }
\DoxyCodeLine{14 \textcolor{comment}{/* generate SI1 rest octets */}}
\DoxyCodeLine{15 \textcolor{keywordtype}{int} osmo\_gsm48\_rest\_octets\_si1\_encode(uint8\_t *data, uint8\_t *nch\_pos, \textcolor{keywordtype}{int} is1800\_net);}
\DoxyCodeLine{16 \textcolor{keywordtype}{int} osmo\_gsm48\_si1ro\_nch\_pos\_decode(uint8\_t value, uint8\_t *num\_blocks, uint8\_t *first\_block);}
\DoxyCodeLine{17 \textcolor{keywordtype}{int} osmo\_gsm48\_si1ro\_nch\_pos\_encode(uint8\_t num\_blocks, uint8\_t first\_block);}
\DoxyCodeLine{18 }
\DoxyCodeLine{19 \textcolor{keywordtype}{int} osmo\_gsm48\_rest\_octets\_si2quater\_encode(uint8\_t *data, uint8\_t si2q\_index, uint8\_t si2q\_count,}
\DoxyCodeLine{20                                             \textcolor{keyword}{const} uint16\_t *uarfcn\_list, \textcolor{keywordtype}{size\_t} *u\_offset,}
\DoxyCodeLine{21                                             \textcolor{keywordtype}{size\_t} uarfcn\_length, uint16\_t *scramble\_list,}
\DoxyCodeLine{22                                             \textcolor{keyword}{struct} osmo\_earfcn\_si2q *si2quater\_neigh\_list,}
\DoxyCodeLine{23                                             \textcolor{keywordtype}{size\_t} *e\_offset);}
\DoxyCodeLine{24 }
\DoxyCodeLine{25 \textcolor{keyword}{struct }osmo\_gsm48\_si\_pch\_nch\_info \{}
\DoxyCodeLine{26         \textcolor{keywordtype}{bool} present;}
\DoxyCodeLine{27         \textcolor{keywordtype}{bool} paging\_channel\_restructuring;}
\DoxyCodeLine{28         uint8\_t nln\_sacch;}
\DoxyCodeLine{29         \textcolor{keywordtype}{bool} call\_priority\_present;}
\DoxyCodeLine{30         uint8\_t call\_priority;}
\DoxyCodeLine{31         \textcolor{keywordtype}{bool} nln\_status\_sacch;}
\DoxyCodeLine{32 \};}
\DoxyCodeLine{33 }
\DoxyCodeLine{34 \textcolor{keyword}{struct }osmo\_gsm48\_si\_vbs\_vgcs\_options \{}
\DoxyCodeLine{35         \textcolor{keywordtype}{bool} present;}
\DoxyCodeLine{36         \textcolor{keywordtype}{bool} inband\_notifications;}
\DoxyCodeLine{37         \textcolor{keywordtype}{bool} inband\_pagings;}
\DoxyCodeLine{38 \};}
\DoxyCodeLine{39 }
\DoxyCodeLine{40 \textcolor{keyword}{struct }osmo\_gsm48\_si\_dtm\_support \{}
\DoxyCodeLine{41         \textcolor{keywordtype}{bool} present;}
\DoxyCodeLine{42         uint8\_t rac;}
\DoxyCodeLine{43         uint8\_t max\_lapdm;}
\DoxyCodeLine{44 \};}
\DoxyCodeLine{45 }
\DoxyCodeLine{46 \textcolor{keyword}{struct }osmo\_gsm48\_si\_gprs\_ms\_txpwr\_max\_ccch \{}
\DoxyCodeLine{47         \textcolor{keywordtype}{bool} present;}
\DoxyCodeLine{48         uint8\_t max\_txpwr;}
\DoxyCodeLine{49 \};}
\DoxyCodeLine{50 }
\DoxyCodeLine{51 \textcolor{keyword}{struct }osmo\_gsm48\_si6\_ro\_info \{}
\DoxyCodeLine{52         \textcolor{keyword}{struct }osmo\_gsm48\_si\_pch\_nch\_info pch\_nch\_info;}
\DoxyCodeLine{53         \textcolor{keyword}{struct }osmo\_gsm48\_si\_vbs\_vgcs\_options vbs\_vgcs\_options;}
\DoxyCodeLine{54         \textcolor{keyword}{struct }osmo\_gsm48\_si\_dtm\_support dtm\_support;}
\DoxyCodeLine{55         \textcolor{keywordtype}{bool} band\_indicator\_1900;}
\DoxyCodeLine{56         \textcolor{keyword}{struct }osmo\_gsm48\_si\_gprs\_ms\_txpwr\_max\_ccch gprs\_ms\_txpwr\_max\_ccch;}
\DoxyCodeLine{57         \textcolor{comment}{/* MBMS: not supported in Osmocom */}}
\DoxyCodeLine{58         \textcolor{comment}{/* AMR config (group channel): not supported in Osmocom */}}
\DoxyCodeLine{59 \};}
\DoxyCodeLine{60 }
\DoxyCodeLine{61 \textcolor{keywordtype}{int} osmo\_gsm48\_rest\_octets\_si6\_encode(uint8\_t *data, \textcolor{keyword}{const} \textcolor{keyword}{struct} osmo\_gsm48\_si6\_ro\_info *in);}
\DoxyCodeLine{62 }
\DoxyCodeLine{63 \textcolor{comment}{/* 3GPP TS 44.018 Table 10.5.2.34.1 (Optional) "{}Selection Parameters"{} */}}
\DoxyCodeLine{64 \textcolor{keyword}{struct }osmo\_gsm48\_si\_selection\_params \{}
\DoxyCodeLine{65         uint16\_t penalty\_time:5, \textcolor{comment}{/* PENALTY\_TIME */}}
\DoxyCodeLine{66                   temp\_offs:3, \textcolor{comment}{/* TEMPORARY\_OFFSET */}}
\DoxyCodeLine{67                   cell\_resel\_off:6, \textcolor{comment}{/* CELL\_RESELECT\_OFFSET */}}
\DoxyCodeLine{68                   cbq:1, \textcolor{comment}{/* CELL\_BAR\_QUALIFY (CBQ) */}}
\DoxyCodeLine{69                   present:1;}
\DoxyCodeLine{70 \};}
\DoxyCodeLine{71 }
\DoxyCodeLine{72 \textcolor{comment}{/* 3GPP TS 44.018 Table 10.5.2.34.1 "{}Optional Power offset"{} */}}
\DoxyCodeLine{73 \textcolor{keyword}{struct }osmo\_gsm48\_si\_power\_offset \{}
\DoxyCodeLine{74         uint8\_t power\_offset:2, \textcolor{comment}{/* POWER OFFSET */}}
\DoxyCodeLine{75                  present:1;}
\DoxyCodeLine{76 \};}
\DoxyCodeLine{77 }
\DoxyCodeLine{78 \textcolor{comment}{/* 3GPP TS 44.018 Table 10.5.2.34.1 "{}GPRS Indicator"{} */}}
\DoxyCodeLine{79 \textcolor{keyword}{struct }osmo\_gsm48\_si3\_gprs\_ind \{}
\DoxyCodeLine{80         uint8\_t si13\_position:1, \textcolor{comment}{/* SI13 POSITION */}}
\DoxyCodeLine{81                  ra\_colour:3, \textcolor{comment}{/* RA COLOUR */}}
\DoxyCodeLine{82                  present:1;}
\DoxyCodeLine{83 \};}
\DoxyCodeLine{84 }
\DoxyCodeLine{85 \textcolor{comment}{/* 3GPP TS 44.018 Table 10.5.2.35.1 "{}LSA Parameters"{} */}}
\DoxyCodeLine{86 \textcolor{keyword}{struct }osmo\_gsm48\_lsa\_params \{}
\DoxyCodeLine{87         uint32\_t prio\_thr:3, \textcolor{comment}{/* PRIO\_THR */}}
\DoxyCodeLine{88                  lsa\_offset:3, \textcolor{comment}{/* LSA\_OFFSET */}}
\DoxyCodeLine{89                  mcc:12, \textcolor{comment}{/* MCC */}}
\DoxyCodeLine{90                  mnc:12; \textcolor{comment}{/* MNC */}}
\DoxyCodeLine{91         \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{int} present;}
\DoxyCodeLine{92 \};}
\DoxyCodeLine{93 }
\DoxyCodeLine{94 \textcolor{keyword}{struct }osmo\_gsm48\_si\_ro\_info \{}
\DoxyCodeLine{95         \textcolor{keyword}{struct }osmo\_gsm48\_si\_selection\_params selection\_params;}
\DoxyCodeLine{96         \textcolor{keyword}{struct }osmo\_gsm48\_si\_power\_offset power\_offset;}
\DoxyCodeLine{97         \textcolor{keywordtype}{bool} si2ter\_indicator;}
\DoxyCodeLine{98         \textcolor{keywordtype}{bool} early\_cm\_ctrl;}
\DoxyCodeLine{99         \textcolor{keyword}{struct }\{}
\DoxyCodeLine{100                 uint8\_t where:3,}
\DoxyCodeLine{101                          present:1;}
\DoxyCodeLine{102         \} scheduling;}
\DoxyCodeLine{103         \textcolor{keyword}{struct }osmo\_gsm48\_si3\_gprs\_ind gprs\_ind;}
\DoxyCodeLine{104         \textcolor{comment}{/* SI 3 specific */}}
\DoxyCodeLine{105         \textcolor{keywordtype}{bool} early\_cm\_restrict\_3g;}
\DoxyCodeLine{106         \textcolor{keywordtype}{bool} si2quater\_indicator;}
\DoxyCodeLine{107         \textcolor{comment}{/* SI 4 specific */}}
\DoxyCodeLine{108         \textcolor{keyword}{struct }osmo\_gsm48\_lsa\_params lsa\_params;}
\DoxyCodeLine{109         uint16\_t cell\_id;}
\DoxyCodeLine{110         uint8\_t break\_ind;     \textcolor{comment}{/* do we have SI7 + SI8 ? */}}
\DoxyCodeLine{111 \};}
\DoxyCodeLine{112 }
\DoxyCodeLine{113 \textcolor{comment}{/* Generate SI3 Rest Octests (Chapter 10.5.2.34 / Table 10.4.72) */}}
\DoxyCodeLine{114 \textcolor{keywordtype}{int} osmo\_gsm48\_rest\_octets\_si3\_encode(uint8\_t *data, \textcolor{keyword}{const} \textcolor{keyword}{struct} osmo\_gsm48\_si\_ro\_info *si3);}
\DoxyCodeLine{115 }
\DoxyCodeLine{116 \textcolor{comment}{/* Generate SI4 Rest Octets (Chapter 10.5.2.35) */}}
\DoxyCodeLine{117 \textcolor{keywordtype}{int} osmo\_gsm48\_rest\_octets\_si4\_encode(uint8\_t *data, \textcolor{keyword}{const} \textcolor{keyword}{struct} osmo\_gsm48\_si\_ro\_info *si4, \textcolor{keywordtype}{int} len);}
\DoxyCodeLine{118 }
\DoxyCodeLine{119 \textcolor{keyword}{struct }osmo\_gsm48\_si13\_info \{}
\DoxyCodeLine{120         \textcolor{keyword}{struct }osmo\_gprs\_cell\_options cell\_opts;}
\DoxyCodeLine{121         \textcolor{keyword}{struct }osmo\_gprs\_power\_ctrl\_pars pwr\_ctrl\_pars;}
\DoxyCodeLine{122         uint8\_t bcch\_change\_mark;}
\DoxyCodeLine{123         uint8\_t si\_change\_field;}
\DoxyCodeLine{124         uint8\_t rac;}
\DoxyCodeLine{125         uint8\_t spgc\_ccch\_sup;}
\DoxyCodeLine{126         uint8\_t net\_ctrl\_ord;}
\DoxyCodeLine{127         uint8\_t prio\_acc\_thr;}
\DoxyCodeLine{128 \};}
\DoxyCodeLine{129 }
\DoxyCodeLine{130 \textcolor{comment}{/* Parse/Generate SI13 Rest Octests (Chapter 10.5.2.37b) */}}
\DoxyCodeLine{131 \textcolor{keywordtype}{int} osmo\_gsm48\_rest\_octets\_si13\_decode(\textcolor{keyword}{struct} osmo\_gsm48\_si13\_info *si13, \textcolor{keyword}{const} uint8\_t *data);}
\DoxyCodeLine{132 \textcolor{keywordtype}{int} osmo\_gsm48\_rest\_octets\_si13\_encode(uint8\_t *data, \textcolor{keyword}{const} \textcolor{keyword}{struct} osmo\_gsm48\_si13\_info *si13);}
\DoxyCodeLine{133 }
\DoxyCodeLine{134 \textcolor{comment}{/* Parse SI3 Rest Octets */}}
\DoxyCodeLine{135 \textcolor{keywordtype}{void} osmo\_gsm48\_rest\_octets\_si3\_decode(\textcolor{keyword}{struct} osmo\_gsm48\_si\_ro\_info *si3, \textcolor{keyword}{const} uint8\_t *data);}
\DoxyCodeLine{136 }
\DoxyCodeLine{137 \textcolor{comment}{/* Parse SI4 Rest Octets */}}
\DoxyCodeLine{138 \textcolor{keywordtype}{void} osmo\_gsm48\_rest\_octets\_si4\_decode(\textcolor{keyword}{struct} osmo\_gsm48\_si\_ro\_info *si4, \textcolor{keyword}{const} uint8\_t *data, \textcolor{keywordtype}{int} len);}

\end{DoxyCode}
