libosmogsm  1.9.2
Osmocom GSM library
gsm0808_utils.h
Go to the documentation of this file.
1 
4 /*
5  * (C) 2016 by sysmocom - s.f.m.c. GmbH, Author: Philipp Maier
6  * All Rights Reserved
7  *
8  * SPDX-License-Identifier: GPL-2.0+
9  *
10  * This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  * GNU General Public License for more details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with this program. If not, see <http://www.gnu.org/licenses/>.
22  *
23  */
24 #pragma once
25 
26 struct sockaddr_storage;
27 
30 #include <osmocom/gsm/gsm29205.h>
31 #include <osmocom/gsm/gsm23003.h>
32 #include <osmocom/gsm/gsm_utils.h>
33 #include <osmocom/gsm/tlv.h>
34 #include <osmocom/gsm/gsm48.h>
35 #include <osmocom/core/endian.h>
36 
38 #define GSM0808_CELL_ID_LIST2_MAXLEN 127
39 
46  uint16_t ci;
48  uint16_t lac;
50  /* osmocom specific: */
52 };
53 
58 };
59 
64  unsigned int id_list_len;
65 };
66 
69 #if OSMO_IS_LITTLE_ENDIAN
70  uint8_t pvi:1, /* Preemption Vulnerability indicator */
71  qa:1, /* Queuing allowed indicator */
72  priority_level:4, /* Priority level: 1 == hightest, 14 == lowest */
73  pci:1, /* Preemption Capability indicator */
74  spare:1;
75 #elif OSMO_IS_BIG_ENDIAN
76 /* auto-generated from the little endian part above (libosmocore/contrib/struct_endianness.py) */
77  uint8_t spare:1, pci:1, priority_level:4, qa:1, pvi:1;
78 #endif
79 } __attribute__ ((packed));
80 
83 #if OSMO_IS_LITTLE_ENDIAN
84  uint8_t tp_ind:1, /* Talker priority supported */
85  as_ind_circuit:1, /* A-interface circuit sharing supported */
86  as_ind_link:1, /* A-interface link sharing supported */
87  bss_res:1, /* BSS supports re-establishment */
88  tcp:1, /* Talker channel parameter supported */
89  spare:3;
90 #elif OSMO_IS_BIG_ENDIAN
91 /* auto-generated from the little endian part above (libosmocore/contrib/struct_endianness.py) */
92  uint8_t spare:3, tcp:1, bss_res:1, as_ind_link:1, as_ind_circuit:1, tp_ind:1;
93 #endif
94 } __attribute__ ((packed));
95 
96 /* TS 48.008 3.2.2.52 */
101 };
102 
103 /* TS 48.008 Table 10.5.8 */
107 };
108 
118 };
119 
122 #if OSMO_IS_LITTLE_ENDIAN
123  uint8_t call_ref_hi[3];
124  uint8_t call_priority:3,
125  af:1, /* Acknowledgement flag */
126  sf:1, /* Service flag */
127  call_ref_lo:3;
128  uint8_t spare:4,
129  ciphering_info:4;
130 #elif OSMO_IS_BIG_ENDIAN
131 /* auto-generated from the little endian part above (libosmocore/contrib/struct_endianness.py) */
132  uint8_t call_ref_hi[3];
133  uint8_t call_ref_lo:3, sf:1, af:1, call_priority:3;
134  uint8_t ciphering_info:4, spare:4;
135 #endif
136 } __attribute__ ((packed));
137 
138 /* TS 48.008 3.2.2.26 */
142 };
143 
146  uint8_t seq_last;
147  uint8_t seq_number;
149 };
150 
152 #define CIRCUIT_POOL_LIST_MAXLEN 252
155  unsigned int list_len;
156 };
157 
158 /* 3GPP TS 48.008 Table 3.2.2.90.1 Talker Priority */
163 };
164 
166 #define LAYER_3_INFORMATION_MAXLEN 252
169  unsigned int l3_len;
170 };
171 
173 #define TALKER_IDENTITY_MAXLEN 17
176  unsigned int id_bits;
177 };
178 
179 /* 3GPP TS 48.008 3.2.2.94 VGCS/VBS Cell Status */
185 };
186 
188 #define SMS_TO_VGCS_MAXLEN 252
191  unsigned int sms_len;
192 };
193 
195 #define APP_DATA_MAXLEN 9
198  unsigned int data_len;
199 };
200 
205 };
206 
207 #define GSM0808_DP_MASK_TALKERS_LISTENERS 0x04
208 #define GSM0808_DP_MASK_DISPATCHERS 0x02
209 #define GSM0808_DP_MASK_NETWORK_APP 0x01
210 
212 #if OSMO_IS_LITTLE_ENDIAN
213  uint8_t ai:1, /* Application Indicator */
214  di:4, /* Data identifier */
215  dp:3; /* Distribution parameter (bit mask) */
216 #elif OSMO_IS_BIG_ENDIAN
217 /* auto-generated from the little endian part above (libosmocore/contrib/struct_endianness.py) */
218  uint8_t dp:3, di:4, ai:1;
219 #endif
220 } __attribute__ ((packed));
221 
223 #define MSISDN_MAXLEN 20
224 
226 struct osmo_lcls {
231  bool corr_needed;
232 };
233 
234 char *osmo_lcls_dump(const struct osmo_lcls *lcls);
235 char *osmo_lcls_dump_buf(char *buf, size_t buf_len, const struct osmo_lcls *lcls);
236 char *osmo_lcls_dump_c(void *ctx, const struct osmo_lcls *lcls);
237 char *osmo_gcr_dump(const struct osmo_lcls *lcls);
238 char *osmo_gcr_dump_buf(char *buf, size_t buf_len, const struct osmo_lcls *lcls);
239 
240 extern const struct value_string gsm0808_cell_id_discr_names[];
241 static inline const char *gsm0808_cell_id_discr_name(enum CELL_IDENT id_discr)
242 { return get_value_string(gsm0808_cell_id_discr_names, id_discr); }
243 
244 const char *gsm0808_cell_id_name(const struct gsm0808_cell_id *cid);
245 const char *gsm0808_cell_id_name2(const struct gsm0808_cell_id *cid);
246 char *gsm0808_cell_id_name_buf(char *buf, size_t buflen, const struct gsm0808_cell_id *cid);
247 char *gsm0808_cell_id_name_c(const void *ctx, const struct gsm0808_cell_id *cid);
248 const char *gsm0808_cell_id_list_name(const struct gsm0808_cell_id_list2 *cil);
249 int gsm0808_cell_id_list_name_buf(char *buf, size_t buflen, const struct gsm0808_cell_id_list2 *cil);
250 char *gsm0808_cell_id_list_name_c(const void *ctx, const struct gsm0808_cell_id_list2 *cil);
251 int gsm0808_cell_id_u_name(char *buf, size_t buflen,
252  enum CELL_IDENT id_discr, const union gsm0808_cell_id_u *u);
253 bool gsm0808_cell_ids_match(const struct gsm0808_cell_id *id1, const struct gsm0808_cell_id *id2, bool exact_match);
254 int gsm0808_cell_id_matches_list(const struct gsm0808_cell_id *id, const struct gsm0808_cell_id_list2 *list,
255  unsigned int match_nr, bool exact_match);
256 void gsm0808_cell_id_from_cgi(struct gsm0808_cell_id *cid, enum CELL_IDENT id_discr,
257  const struct osmo_cell_global_id *cgi);
258 int gsm0808_cell_id_to_cgi(struct osmo_cell_global_id *cgi, const struct gsm0808_cell_id *cid);
259 void gsm0808_msgb_put_cell_id_u(struct msgb *msg, enum CELL_IDENT id_discr, const union gsm0808_cell_id_u *u);
260 int gsm0808_decode_cell_id_u(union gsm0808_cell_id_u *out, enum CELL_IDENT discr, const uint8_t *buf, unsigned int len);
261 int gsm0808_cell_id_size(enum CELL_IDENT discr);
262 
263 uint8_t gsm0808_enc_cause(struct msgb *msg, uint16_t cause);
264 uint8_t gsm0808_enc_aoip_trasp_addr(struct msgb *msg,
265  const struct sockaddr_storage *ss);
266 int gsm0808_dec_aoip_trasp_addr(struct sockaddr_storage *ss,
267  const uint8_t *elem, uint8_t len);
268 int gsm0808_dec_osmux_cid(uint8_t *cid, const uint8_t *elem, uint8_t len);
269 
270 uint8_t gsm0808_enc_lcls(struct msgb *msg, const struct osmo_lcls *lcls);
271 int gsm0808_dec_lcls(struct osmo_lcls *lcls, const struct tlv_parsed *tp);
272 
273 uint8_t gsm0808_enc_speech_codec(struct msgb *msg,
274  const struct gsm0808_speech_codec *sc)
275  OSMO_DEPRECATED("use gsm0808_enc_speech_codec2() instead");
277  const struct gsm0808_speech_codec *sc);
279  const uint8_t *elem, uint8_t len);
280 uint8_t gsm0808_enc_speech_codec_list(struct msgb *msg,
281  const struct gsm0808_speech_codec_list *scl)
282  OSMO_DEPRECATED("use gsm0808_enc_speech_codec_list2() instead");
284  const struct gsm0808_speech_codec_list *scl);
286  const uint8_t *elem, uint8_t len);
287 uint8_t gsm0808_enc_channel_type(struct msgb *msg,
288  const struct gsm0808_channel_type *ct);
290  const uint8_t *elem, uint8_t len);
291 uint8_t gsm0808_enc_encrypt_info(struct msgb *msg,
292  const struct gsm0808_encrypt_info *ei);
294  const uint8_t *elem, uint8_t len);
295 int gsm0808_enc_kc128(struct msgb *msg, const uint8_t *kc128);
296 int gsm0808_dec_kc128(uint8_t *kc128, const uint8_t *elem, uint8_t len);
297 uint8_t gsm0808_enc_cell_id_list2(struct msgb *msg, const struct gsm0808_cell_id_list2 *cil);
298 uint8_t gsm0808_enc_cell_id_list(struct msgb *msg,
299  const struct gsm0808_cell_id_list *cil)
300  OSMO_DEPRECATED("use gsm0808_enc_cell_id_list2 instead");
301 int gsm0808_dec_cell_id_list2(struct gsm0808_cell_id_list2 *cil, const uint8_t *elem, uint8_t len);
303  const uint8_t *elem, uint8_t len)
304  OSMO_DEPRECATED("use gsm0808_dec_cell_id_list2 instead");
305 int gsm0808_cell_id_list_add(struct gsm0808_cell_id_list2 *dst, const struct gsm0808_cell_id_list2 *src);
306 void gsm0808_cell_id_to_list(struct gsm0808_cell_id_list2 *dst, const struct gsm0808_cell_id *src);
307 uint8_t gsm0808_enc_cell_id(struct msgb *msg, const struct gsm0808_cell_id *ci);
308 int gsm0808_dec_cell_id(struct gsm0808_cell_id *ci, const uint8_t *elem, uint8_t len);
309 int gsm0808_chan_type_to_speech_codec(uint8_t perm_spch);
311  uint8_t perm_spch);
312 uint16_t gsm0808_sc_cfg_from_gsm48_mr_cfg(const struct gsm48_multi_rate_conf *cfg, bool fr);
313 int gsm48_mr_cfg_from_gsm0808_sc_cfg(struct gsm48_multi_rate_conf *cfg, uint16_t s15_s0);
314 
317 {
318  return (cause >> 4) & 0x7;
319 }
320 
322 static inline bool gsm0808_cause_ext(enum gsm0808_cause cause)
323 {
324  /* check that cause looks like 1XXX0000 where XXX represent class */
325  return (cause & 0x80) && !(cause & 0x0F);
326 }
327 
328 int gsm0808_get_cipher_reject_cause(const struct tlv_parsed *tp)
329 OSMO_DEPRECATED("Use gsm0808_get_cause() instead");
330 
332 static inline uint8_t gsm0808_current_channel_type_1(enum gsm_chan_t type)
333 {
334  switch (type) {
335  default:
336  return 0;
337  case GSM_LCHAN_SDCCH:
338  return 0x01;
339  case GSM_LCHAN_TCH_F:
340  return 0x18;
341  case GSM_LCHAN_TCH_H:
342  return 0x19;
343  }
344 }
345 
349  enum gsm48_chan_mode mode)
350 {
351 #define MODE_TYPE(mode, type) ((mode << 16) | type)
352 
353  switch (MODE_TYPE(mode, type)) {
355  return GSM0808_PERM_FR1;
357  return GSM0808_PERM_HR1;
359  return GSM0808_PERM_FR2;
361  return GSM0808_PERM_HR2; /* (deprecated) */
363  return GSM0808_PERM_FR3;
365  return GSM0808_PERM_HR3;
367  return GSM0808_PERM_FR4;
369  return GSM0808_PERM_HR4;
371  return GSM0808_PERM_FR5; /* FR only */
373  return GSM0808_PERM_HR6; /* HR only */
374  default:
375  return 0;
376  }
377 
378 #undef MODE_TYPE
379 }
380 
382 static inline uint8_t gsm0808_chosen_channel(enum gsm_chan_t type, enum gsm48_chan_mode mode)
383 {
384  uint8_t channel_mode = 0, channel = 0;
385 
386  switch (mode) {
393  channel_mode = 0x9;
394  break;
395  case GSM48_CMODE_SIGN:
396  channel_mode = 0x8;
397  break;
399  channel_mode = 0xe;
400  break;
402  channel_mode = 0xb;
403  break;
405  channel_mode = 0xc;
406  break;
408  channel_mode = 0xd;
409  break;
411  channel_mode = 0x1;
412  break;
414  channel_mode = 0x2;
415  break;
417  channel_mode = 0x3;
418  break;
420  channel_mode = 0x4;
421  break;
423  channel_mode = 0x5;
424  break;
426  channel_mode = 0x6;
427  break;
429  channel_mode = 0x7;
430  break;
432  channel_mode = 0xa;
433  break;
435  channel_mode = 0xf;
436  break;
437  default:
438  return 0;
439  }
440 
441  switch (type) {
442  case GSM_LCHAN_NONE:
443  channel = 0x0;
444  break;
445  case GSM_LCHAN_SDCCH:
446  channel = 0x1;
447  break;
448  case GSM_LCHAN_TCH_F:
449  channel = 0x8;
450  break;
451  case GSM_LCHAN_TCH_H:
452  channel = 0x9;
453  break;
454  /* TODO: more than 1 TCHs? */
455  default:
456  return 0;
457  }
458 
459  return channel_mode << 4 | channel;
460 }
461 
462 const char *gsm0808_channel_type_name(const struct gsm0808_channel_type *ct);
463 char *gsm0808_channel_type_name_buf(char *buf, size_t buf_len, const struct gsm0808_channel_type *ct);
464 char *gsm0808_channel_type_name_c(const void *ctx, const struct gsm0808_channel_type *ct);
465 
466 uint8_t gsm0808_enc_group_callref(struct msgb *msg, const struct gsm0808_group_callref *gc);
467 int gsm0808_dec_group_callref(struct gsm0808_group_callref *gc, const uint8_t *elem, uint8_t len);
468 uint8_t gsm0808_enc_priority(struct msgb *msg, const struct gsm0808_priority *pri);
469 int gsm0808_dec_priority(struct gsm0808_priority *pri, const uint8_t *elem, uint8_t len);
470 uint8_t gsm0808_enc_vgcs_feature_flags(struct msgb *msg, const struct gsm0808_vgcs_feature_flags *ff);
471 int gsm0808_dec_vgcs_feature_flags(struct gsm0808_vgcs_feature_flags *ff, const uint8_t *elem, uint8_t len);
472 uint8_t gsm0808_enc_talker_identity(struct msgb *msg, const struct gsm0808_talker_identity *ti);
473 int gsm0808_dec_talker_identity(struct gsm0808_talker_identity *ti, const uint8_t *elem, uint8_t len);
474 uint8_t gsm0808_enc_data_identity(struct msgb *msg, const struct gsm0808_data_identity *ai);
475 int gsm0808_dec_data_identity(struct gsm0808_data_identity *ai, const uint8_t *elem, uint8_t len);
476 uint8_t gsm0808_enc_msisdn(struct msgb *msg, const char *msisdn);
477 int gsm0808_dec_msisdn(char *msisdn, const char *elem, uint8_t len);
478 uint8_t gsm0808_enc_assign_req(struct msgb *msg, const enum gsm0808_assignment_requirement ar);
479 int gsm0808_dec_assign_req(enum gsm0808_assignment_requirement *ar, const uint8_t *elem, uint8_t len);
480 uint8_t gsm0808_enc_cell_id_list_segment(struct msgb *msg, uint8_t ie_type,
481  const struct gsm0808_cell_id_list_segment *ci);
482 int gsm0808_dec_cell_id_list_segment(struct gsm0808_cell_id_list_segment *ci, const uint8_t *elem, uint8_t len);
483 int gsm0808_dec_call_id(uint32_t *ci, const uint8_t *elem, uint8_t len);
484 
gsm0808_cell_id_u::lac_and_ci
struct osmo_lac_and_ci_id lac_and_ci
Definition: gsm0808_utils.h:45
gsm0808_cell_id_from_cgi
void gsm0808_cell_id_from_cgi(struct gsm0808_cell_id *cid, enum CELL_IDENT id_discr, const struct osmo_cell_global_id *cgi)
Copy information from a CGI to form a Cell Identifier of the specified kind.
Definition: gsm0808_utils.c:1956
gsm0808_dec_call_id
int gsm0808_dec_call_id(uint32_t *ci, const uint8_t *elem, uint8_t len)
Decode Call Identifier IE (3GPP TS 48.008 3.2.2.105).
Definition: gsm0808_utils.c:2562
GSM0808_CALL_PRIORITY_LEVEL_2
@ GSM0808_CALL_PRIORITY_LEVEL_2
Definition: gsm0808_utils.h:113
len
uint8_t len
Definition: gsm_04_11.h:2
osmo_lcls::control
enum gsm0808_lcls_control control
§3.2.2.117 Connection Status Control.
Definition: gsm0808_utils.h:228
gsm0808_downlink_dtx_flag
gsm0808_downlink_dtx_flag
Definition: gsm0808_utils.h:139
gsm0808_cause_ext
static bool gsm0808_cause_ext(enum gsm0808_cause cause)
Definition: gsm0808_utils.h:322
gsm0808_enc_aoip_trasp_addr
uint8_t gsm0808_enc_aoip_trasp_addr(struct msgb *msg, const struct sockaddr_storage *ss)
gsm0808_enc_vgcs_feature_flags
uint8_t gsm0808_enc_vgcs_feature_flags(struct msgb *msg, const struct gsm0808_vgcs_feature_flags *ff)
Encode VGCS Feature Flags IE (3GPP TS 48.008 3.2.2.88).
Definition: gsm0808_utils.c:2297
gsm_chan_t
gsm_chan_t
Definition: gsm_utils.h:235
gsm0808_lcls_config
gsm0808_lcls_config
Definition: gsm_08_08.h:781
gsm0808_enc_speech_codec_list
uint8_t gsm0808_enc_speech_codec_list(struct msgb *msg, const struct gsm0808_speech_codec_list *scl) OSMO_DEPRECATED("use gsm0808_enc_speech_codec_list2() instead")
Deprecated: gsm0808_enc_speech_codec_list2() wrapper for backwards compatibility.
Definition: gsm0808_utils.c:439
endian.h
GSM0808_TALKER_PRIORITY_PRIVILEGED
@ GSM0808_TALKER_PRIORITY_PRIVILEGED
Definition: gsm0808_utils.h:161
GSM0808_SF_VBS
@ GSM0808_SF_VBS
Definition: gsm0808_utils.h:105
osmo_lcls::gcr
struct osmo_gcr_parsed gcr
§3.2.2.115 Global Call Reference.
Definition: gsm0808_utils.h:229
gsm48_mr_cfg_from_gsm0808_sc_cfg
int gsm48_mr_cfg_from_gsm0808_sc_cfg(struct gsm48_multi_rate_conf *cfg, uint16_t s15_s0)
Determine a GSM 04.08 AMR configuration struct from a set of speech codec configuration bits (S0-S15)
Definition: gsm0808_utils.c:1718
OSMO_DEPRECATED
#define OSMO_DEPRECATED(text)
get_value_string
const char * get_value_string(const struct value_string *vs, uint32_t val)
GSM0808_SF_VGCS
@ GSM0808_SF_VGCS
Definition: gsm0808_utils.h:106
osmo_location_area_id
Definition: gsm23003.h:16
cause
uint8_t cause
Definition: gsm_04_08.h:808
GSM0808_CSTAT_ESTABLISHED
@ GSM0808_CSTAT_ESTABLISHED
Definition: gsm0808_utils.h:181
gsm0808_dec_msisdn
int gsm0808_dec_msisdn(char *msisdn, const char *elem, uint8_t len)
Decode MSISDN IE (3GPP TS 48.008 3.2.2.101).
Definition: gsm0808_utils.c:2404
osmo_lcls::corr_needed
bool corr_needed
§3.2.2.118 Correlation-Not-Needed.
Definition: gsm0808_utils.h:231
gsm0808_enc_cell_id
uint8_t gsm0808_enc_cell_id(struct msgb *msg, const struct gsm0808_cell_id *ci)
Encode Cell Identifier IE (3GPP TS 48.008 3.2.2.17).
Definition: gsm0808_utils.c:1525
__attribute__
enum gsm0808_assignment_requirement __attribute__
gsm0808_dec_group_callref
int gsm0808_dec_group_callref(struct gsm0808_group_callref *gc, const uint8_t *elem, uint8_t len)
Decode Group Call Reference IE (3GPP TS 48.008 3.2.2.55).
Definition: gsm0808_utils.c:2240
gsm0808_enc_speech_codec_list2
int gsm0808_enc_speech_codec_list2(struct msgb *msg, const struct gsm0808_speech_codec_list *scl)
Encode TS 08.08 Speech Codec list.
Definition: gsm0808_utils.c:411
TALKER_IDENTITY_MAXLEN
#define TALKER_IDENTITY_MAXLEN
Parsed representation of a Talker Identity IE (3GPP TS 48.008 3.2.2.91)
Definition: gsm0808_utils.h:173
gsm0808_msgb_put_cell_id_u
void gsm0808_msgb_put_cell_id_u(struct msgb *msg, enum CELL_IDENT id_discr, const union gsm0808_cell_id_u *u)
Definition: gsm0808_utils.c:1023
gsm0808_current_channel_type_1
static uint8_t gsm0808_current_channel_type_1(enum gsm_chan_t type)
Definition: gsm0808_utils.h:332
GSM0808_CALL_PRIORITY_NONE
@ GSM0808_CALL_PRIORITY_NONE
Definition: gsm0808_utils.h:110
GSM0808_CALL_PRIORITY_LEVEL_A
@ GSM0808_CALL_PRIORITY_LEVEL_A
Definition: gsm0808_utils.h:117
gsm0808_dec_cell_id_list2
int gsm0808_dec_cell_id_list2(struct gsm0808_cell_id_list2 *cil, const uint8_t *elem, uint8_t len)
Decode Cell Identifier List IE.
Definition: gsm0808_utils.c:1304
gsm0808_permitted_speech
gsm0808_permitted_speech
GSM 08.08 3.2.2.11 Channel Type (see also 3GPP TS 48.008, section 3.2.2.11)
Definition: gsm_08_08.h:493
GSM48_CMODE_DATA_12k0
@ GSM48_CMODE_DATA_12k0
CSD: 12.0 kbit/s radio interface rate, 9.6 kbit/s services (TCH/F9.6)
Definition: gsm_04_08.h:788
GSM48_CMODE_DATA_14k5_29k0
@ GSM48_CMODE_DATA_14k5_29k0
Definition: gsm_04_08.h:775
gsm0808_cell_id::id_discr
enum CELL_IDENT id_discr
Definition: gsm0808_utils.h:56
osmo_cell_global_id_ps
Definition: gsm23003.h:36
osmo_cell_global_id
Definition: gsm23003.h:28
gsm0808_cell_id_list2::id_list
union gsm0808_cell_id_u id_list[GSM0808_CELL_ID_LIST2_MAXLEN]
Definition: gsm0808_utils.h:63
GSM0808_PERM_FR2
@ GSM0808_PERM_FR2
GSM EFR.
Definition: gsm_08_08.h:495
gsm0808_channel_type_name_buf
char * gsm0808_channel_type_name_buf(char *buf, size_t buf_len, const struct gsm0808_channel_type *ct)
Definition: gsm0808_utils.c:2191
gsm0808_dec_channel_type
int gsm0808_dec_channel_type(struct gsm0808_channel_type *ct, const uint8_t *elem, uint8_t len)
Decode TS 08.08 Channel Type IE.
Definition: gsm0808_utils.c:559
gsm0808_enc_cell_id_list
uint8_t gsm0808_enc_cell_id_list(struct msgb *msg, const struct gsm0808_cell_id_list *cil) OSMO_DEPRECATED("use gsm0808_enc_cell_id_list2 instead")
DEPRECATED: Use gsm0808_enc_cell_id_list2 instead.
Definition: gsm0808_utils.c:1129
GSM0808_CALL_PRIORITY_LEVEL_B
@ GSM0808_CALL_PRIORITY_LEVEL_B
Definition: gsm0808_utils.h:116
GSM0808_PERM_HR6
@ GSM0808_PERM_HR6
OHR AMR.
Definition: gsm_08_08.h:503
gsm0808_cause_class
gsm0808_cause_class
Definition: gsm_08_08.h:433
GSM0808_CSTAT_NOT_ESTABLISHED2
@ GSM0808_CSTAT_NOT_ESTABLISHED2
Definition: gsm0808_utils.h:184
gsm0808_cell_id_list_segment
Parsed representation of a Cell Identifier List Segment IE (3GPP TS 48.008 3.2.2.27a)
Definition: gsm0808_utils.h:145
gsm0808_speech_codec_from_chan_type
int gsm0808_speech_codec_from_chan_type(struct gsm0808_speech_codec *sc, uint8_t perm_spch)
Extrapolate a speech codec field from a given permitted speech parameter (channel type).
Definition: gsm0808_utils.c:1612
msg
uint8_t msg[0]
Definition: gsm_08_08.h:729
GSM48_CMODE_DATA_32k0
@ GSM48_CMODE_DATA_32k0
ECSD: 32.0 kbit/s radio interface rate, 32.0 kbit/s services (E-TCH/F32.0)
Definition: gsm_04_08.h:782
gsm0808_enc_msisdn
uint8_t gsm0808_enc_msisdn(struct msgb *msg, const char *msisdn)
Encode MSISDN IE (3GPP TS 48.008 3.2.2.101).
Definition: gsm0808_utils.c:2377
gsm48_multi_rate_conf
Definition: gsm_04_08.h:603
gsm0808_cell_id_size
int gsm0808_cell_id_size(enum CELL_IDENT discr)
Definition: gsm0808_utils.c:938
gsm0808_enc_kc128
int gsm0808_enc_kc128(struct msgb *msg, const uint8_t *kc128)
Encode TS 48.008 Kc128 IE.
Definition: gsm0808_utils.c:867
gsm0808_sms_to_vgcs::sms_len
unsigned int sms_len
Definition: gsm0808_utils.h:191
GSM48_CMODE_DATA_29k0_14k5
@ GSM48_CMODE_DATA_29k0_14k5
Definition: gsm_04_08.h:769
gsm0808_enc_channel_type
uint8_t gsm0808_enc_channel_type(struct msgb *msg, const struct gsm0808_channel_type *ct)
Encode TS 08.08 Channel Type IE.
Definition: gsm0808_utils.c:491
GSM_LCHAN_TCH_H
@ GSM_LCHAN_TCH_H
Definition: gsm_utils.h:239
gsm0808_dec_speech_codec_list
int gsm0808_dec_speech_codec_list(struct gsm0808_speech_codec_list *scl, const uint8_t *elem, uint8_t len)
Decode TS 08.08 Speech Codec list IE.
Definition: gsm0808_utils.c:455
gsm0808_cell_id_matches_list
int gsm0808_cell_id_matches_list(const struct gsm0808_cell_id *id, const struct gsm0808_cell_id_list2 *list, unsigned int match_nr, bool exact_match)
Find an index in a Cell Identifier list that matches a given single Cell Identifer.
Definition: gsm0808_utils.c:1936
gsm0808_layer_3_information::l3_len
unsigned int l3_len
Definition: gsm0808_utils.h:169
GSM0808_PERM_FR5
@ GSM0808_PERM_FR5
FR AMR-WB.
Definition: gsm_08_08.h:498
gsm29205.h
gsm0808_application_data
Definition: gsm0808_utils.h:196
gsm0808_sms_to_vgcs::sms
uint8_t sms[SMS_TO_VGCS_MAXLEN]
Definition: gsm0808_utils.h:190
osmo_lcls
LCLS-related parameters from 3GPP TS 48.008.
Definition: gsm0808_utils.h:226
gsm0808_channel_type
Definition: gsm_08_08.h:740
GSM0808_CALL_PRIORITY_LEVEL_1
@ GSM0808_CALL_PRIORITY_LEVEL_1
Definition: gsm0808_utils.h:114
gsm0808_enc_speech_codec2
int gsm0808_enc_speech_codec2(struct msgb *msg, const struct gsm0808_speech_codec *sc)
Encode TS 08.08 Speech Codec IE.
Definition: gsm0808_utils.c:296
GSM0808_PERM_FR4
@ GSM0808_PERM_FR4
OFR AMR-WB.
Definition: gsm_08_08.h:497
gsm0808_dec_talker_identity
int gsm0808_dec_talker_identity(struct gsm0808_talker_identity *ti, const uint8_t *elem, uint8_t len)
Decode Talker Identity IE (3GPP TS 48.008 3.2.2.91).
Definition: gsm0808_utils.c:2449
gsm0808_talker_identity
Definition: gsm0808_utils.h:174
type
uint8_t type
Definition: gsm_08_08.h:2
GSM0808_CSTAT_NOT_ESTABLISHED1
@ GSM0808_CSTAT_NOT_ESTABLISHED1
Definition: gsm0808_utils.h:182
GSM0808_ASRQ_IMMEDIATE
@ GSM0808_ASRQ_IMMEDIATE
Definition: gsm0808_utils.h:99
osmo_lcls_dump_buf
char * osmo_lcls_dump_buf(char *buf, size_t buf_len, const struct osmo_lcls *lcls)
Dump LCLS parameters (GCR excluded) into string for printing.
Definition: gsm0808_utils.c:724
GSM48_CMODE_DATA_6k0
@ GSM48_CMODE_DATA_6k0
CSD: 6.0 kbit/s radio interface rate, 4.8 kbit/s services (TCH/{F,H}4.8)
Definition: gsm_04_08.h:790
osmo_gcr_dump_buf
char * osmo_gcr_dump_buf(char *buf, size_t buf_len, const struct osmo_lcls *lcls)
Dump GCR struct into string for printing.
Definition: gsm0808_utils.c:760
GSM0808_TALKER_PRIORITY_EMERGENCY
@ GSM0808_TALKER_PRIORITY_EMERGENCY
Definition: gsm0808_utils.h:162
GSM0808_CALL_PRIORITY_LEVEL_4
@ GSM0808_CALL_PRIORITY_LEVEL_4
Definition: gsm0808_utils.h:111
osmo_service_area_id
Definition: gsm23003.h:59
gsm0808_dec_speech_codec
int gsm0808_dec_speech_codec(struct gsm0808_speech_codec *sc, const uint8_t *elem, uint8_t len)
Decode TS 08.08 Speech Codec IE.
Definition: gsm0808_utils.c:332
gsm0808_dec_osmux_cid
int gsm0808_dec_osmux_cid(uint8_t *cid, const uint8_t *elem, uint8_t len)
gsm0808_cell_id_u::global_ps
struct osmo_cell_global_id_ps global_ps
Definition: gsm0808_utils.h:51
gsm0808_cell_id_u::ci
uint16_t ci
Definition: gsm0808_utils.h:46
gsm0808_chosen_channel
static uint8_t gsm0808_chosen_channel(enum gsm_chan_t type, enum gsm48_chan_mode mode)
Return 3GPP TS 48.008 3.2.2.33 Chosen Channel.
Definition: gsm0808_utils.h:382
msgb
GSM48_CMODE_DATA_29k0_43k5
@ GSM48_CMODE_DATA_29k0_43k5
Definition: gsm_04_08.h:777
gsm0808_speech_codec_list
Definition: gsm_08_08.h:724
GSM_LCHAN_TCH_F
@ GSM_LCHAN_TCH_F
Definition: gsm_utils.h:238
mode
uint8_t mode
Definition: gsm_04_08.h:690
GSM48_CMODE_SPEECH_V5
@ GSM48_CMODE_SPEECH_V5
Speech: FR AMR-WB (TCH/WFS)
Definition: gsm_04_08.h:762
gsm0808_speech_codec
3GPP TS 48.008 3.2.2.104 Speech Codec.
Definition: gsm_08_08.h:592
GSM48_CMODE_SPEECH_V4
@ GSM48_CMODE_SPEECH_V4
Speech: OFR AMR-WB (O-TCH/WFS) or OHR AMR-WB (O-TCH/WHS)
Definition: gsm_04_08.h:760
CELL_IDENT
CELL_IDENT
Definition: gsm_08_08.h:17
gsm0808_enc_cell_id_list2
uint8_t gsm0808_enc_cell_id_list2(struct msgb *msg, const struct gsm0808_cell_id_list2 *cil)
Encode TS 08.08 Cell Identifier List IE.
Definition: gsm0808_utils.c:1087
gsm0808_chan_type_to_speech_codec
int gsm0808_chan_type_to_speech_codec(uint8_t perm_spch)
Convert the representation of the permitted speech codec identifier that is used in struct gsm0808_ch...
Definition: gsm0808_utils.c:1574
gsm0808_cause
gsm0808_cause
Definition: gsm_08_08.h:366
gsm0808_cell_id_list_name_buf
int gsm0808_cell_id_list_name_buf(char *buf, size_t buflen, const struct gsm0808_cell_id_list2 *cil)
Return a human readable representation of the Cell Identifier List, like "LAC[2]:{123,...
Definition: gsm0808_utils.c:2141
GSM0808_ASRQ_DELAY_ALLOWED
@ GSM0808_ASRQ_DELAY_ALLOWED
Definition: gsm0808_utils.h:98
gsm0808_cell_id_u::lac
uint16_t lac
Definition: gsm0808_utils.h:48
APP_DATA_MAXLEN
#define APP_DATA_MAXLEN
Parsed representation of a Application Data IE (3GPP TS 48.008 3.2.2.98)
Definition: gsm0808_utils.h:195
GSM48_CMODE_DATA_3k6
@ GSM48_CMODE_DATA_3k6
CSD: 3.6 kbit/s radio interface rate, 2.4 kbit/s and less services (TCH/{F,H}2.4)
Definition: gsm_04_08.h:792
gsm0808_circuit_pool_list
Definition: gsm0808_utils.h:153
gsm0808_circuit_pool_list::list_len
unsigned int list_len
Definition: gsm0808_utils.h:155
LAYER_3_INFORMATION_MAXLEN
#define LAYER_3_INFORMATION_MAXLEN
Parsed representation of a Layer 3 Information IE (3GPP TS 48.008 3.2.2.24)
Definition: gsm0808_utils.h:166
GSM_LCHAN_NONE
@ GSM_LCHAN_NONE
Definition: gsm_utils.h:236
GSM0808_PERM_HR2
@ GSM0808_PERM_HR2
(deprecated)
Definition: gsm_08_08.h:500
GSM48_CMODE_SPEECH_EFR
@ GSM48_CMODE_SPEECH_EFR
Speech: EFR (TCH/EFS)
Definition: gsm_04_08.h:756
gsm48.h
SMS_TO_VGCS_MAXLEN
#define SMS_TO_VGCS_MAXLEN
Parsed representation of a SMS to VGCS IE (3GPP TS 48.008 3.2.2.92)
Definition: gsm0808_utils.h:188
gsm0808_dec_assign_req
int gsm0808_dec_assign_req(enum gsm0808_assignment_requirement *ar, const uint8_t *elem, uint8_t len)
Decode Assignment Requirements IE (3GPP TS 48.008 3.2.2.52).
Definition: gsm0808_utils.c:2490
gsm_utils.h
osmo_lcls::gcr_available
bool gcr_available
Definition: gsm0808_utils.h:230
gsm0808_assignment_requirement
gsm0808_assignment_requirement
Definition: gsm0808_utils.h:97
GSM0808_CALL_PRIORITY_LEVEL_0
@ GSM0808_CALL_PRIORITY_LEVEL_0
Definition: gsm0808_utils.h:115
gsm0808_channel_type_name
const char * gsm0808_channel_type_name(const struct gsm0808_channel_type *ct)
Definition: gsm0808_utils.c:2199
gsm0808_service_flag
gsm0808_service_flag
Definition: gsm0808_utils.h:104
gsm0808_cell_id::id
union gsm0808_cell_id_u id
Definition: gsm0808_utils.h:57
gsm0808_cell_id_list
DEPRECATED: This definition of the cell identifier list is insufficient.
Definition: gsm_08_08.h:774
gsm0808_cell_id_list_name_c
char * gsm0808_cell_id_list_name_c(const void *ctx, const struct gsm0808_cell_id_list2 *cil)
Definition: gsm0808_utils.c:2179
gsm0808_cell_id_list2
Parsed representation of a Cell Identifier List IE (3GPP TS 48.008 3.2.2.27).
Definition: gsm0808_utils.h:61
GSM48_CMODE_SPEECH_V1
@ GSM48_CMODE_SPEECH_V1
Speech: FR (TCH/FS) or HR (TCH/HS)
Definition: gsm_04_08.h:754
gsm0808_cell_ids_match
bool gsm0808_cell_ids_match(const struct gsm0808_cell_id *id1, const struct gsm0808_cell_id *id2, bool exact_match)
Return true if the common information between the two Cell Identifiers match.
Definition: gsm0808_utils.c:1919
gsm0808_enc_cell_id_list_segment
uint8_t gsm0808_enc_cell_id_list_segment(struct msgb *msg, uint8_t ie_type, const struct gsm0808_cell_id_list_segment *ci)
Encode Cell Identifier List Segment IE (3GPP TS 48.008 3.2.2.27a).
Definition: gsm0808_utils.c:2508
GSM0808_ASRQ_IMMEDIATE_ON_DEMAND
@ GSM0808_ASRQ_IMMEDIATE_ON_DEMAND
Definition: gsm0808_utils.h:100
GSM0808_DTX_FLAG_FORBID
@ GSM0808_DTX_FLAG_FORBID
Definition: gsm0808_utils.h:141
gsm_04_08.h
GSM48_CMODE_DATA_14k5
@ GSM48_CMODE_DATA_14k5
CSD: 14.5 kbit/s radio interface rate, 14.4 kbit/s services (TCH/F14.4)
Definition: gsm_04_08.h:786
GSM0808_PERM_HR4
@ GSM0808_PERM_HR4
OHR AMR-WB.
Definition: gsm_08_08.h:502
gsm0808_application_data::data_len
unsigned int data_len
Definition: gsm0808_utils.h:198
gsm0808_cell_id_u_name
int gsm0808_cell_id_u_name(char *buf, size_t buflen, enum CELL_IDENT id_discr, const union gsm0808_cell_id_u *u)
Print a human readable name of the cell identifier to the char buffer.
Definition: gsm0808_utils.c:1821
gsm0808_cell_id_list_segment::seq_last
uint8_t seq_last
Definition: gsm0808_utils.h:146
GSM_LCHAN_SDCCH
@ GSM_LCHAN_SDCCH
Definition: gsm_utils.h:237
gsm0808_cell_id_name
const char * gsm0808_cell_id_name(const struct gsm0808_cell_id *cid)
Return a human readable representation of a Cell Identifier, like "LAC:123" or "CGI:001-01-42-23".
Definition: gsm0808_utils.c:2105
gsm0808_cell_id
Parsed representation of Cell Identifier IE (3GPP TS 48.008 3.2.2.17)
Definition: gsm0808_utils.h:55
gsm0808_dec_cell_id_list
int gsm0808_dec_cell_id_list(struct gsm0808_cell_id_list *cil, const uint8_t *elem, uint8_t len) OSMO_DEPRECATED("use gsm0808_dec_cell_id_list2 instead")
DEPRECATED: Use gsm0808_dec_cell_id_list2 instead.
Definition: gsm0808_utils.c:1371
MODE_TYPE
#define MODE_TYPE(mode, type)
gsm0808_enc_talker_identity
uint8_t gsm0808_enc_talker_identity(struct msgb *msg, const struct gsm0808_talker_identity *ti)
Encode Talker Identity IE (3GPP TS 48.008 3.2.2.91).
Definition: gsm0808_utils.c:2421
gsm0808_cell_id_list_name
const char * gsm0808_cell_id_list_name(const struct gsm0808_cell_id_list2 *cil)
Return a human-readable representation of cil in a static buffer.
Definition: gsm0808_utils.c:2172
gsm0808_cell_id_list_segment::seq_number
uint8_t seq_number
Definition: gsm0808_utils.h:147
osmo_lcls_dump
char * osmo_lcls_dump(const struct osmo_lcls *lcls)
Dump LCLS parameters (GCR excluded) into static string buffer for printing.
Definition: gsm0808_utils.c:742
gsm23003.h
gsm0808_channel_type_name_c
char * gsm0808_channel_type_name_c(const void *ctx, const struct gsm0808_channel_type *ct)
Definition: gsm0808_utils.c:2205
GSM48_CMODE_DATA_43k5
@ GSM48_CMODE_DATA_43k5
ECSD: 43.5 kbit/s radio interface rate, 43.2 kbit/s services (E-TCH/F43.2)
Definition: gsm_04_08.h:780
GSM0808_PERM_FR3
@ GSM0808_PERM_FR3
FR AMR.
Definition: gsm_08_08.h:496
gsm0808_enc_lcls
uint8_t gsm0808_enc_lcls(struct msgb *msg, const struct osmo_lcls *lcls)
Add LCLS parameters to a given msgb, 3GPP TS 48.008 §3.2.2.115 - 3.2.2.120.
Definition: gsm0808_utils.c:672
gsm0808_dec_kc128
int gsm0808_dec_kc128(uint8_t *kc128, const uint8_t *elem, uint8_t len)
Decode TS 48.008 Kc128 IE.
Definition: gsm0808_utils.c:879
GSM0808_AI_APP_DATA
@ GSM0808_AI_APP_DATA
Definition: gsm0808_utils.h:203
GSM48_CMODE_SIGN
@ GSM48_CMODE_SIGN
Signalling only (TCH/F or TCH/H)
Definition: gsm_04_08.h:752
osmo_gcr_parsed
Parsed representation of Global Call Reference, 3GPP TS 29.205 Table B 2.1.9.1.
Definition: gsm29205.h:29
GSM48_CMODE_SPEECH_V6
@ GSM48_CMODE_SPEECH_V6
Speech: OHR AMR (O-TCH/AHS)
Definition: gsm_04_08.h:764
gsm0808_talker_identity::talker_id
uint8_t talker_id[TALKER_IDENTITY_MAXLEN]
Definition: gsm0808_utils.h:175
CIRCUIT_POOL_LIST_MAXLEN
#define CIRCUIT_POOL_LIST_MAXLEN
Parsed representation of a Circuit Pool List IE (3GPP TS 48.008 3.2.2.26)
Definition: gsm0808_utils.h:152
GSM48_CMODE_DATA_43k5_29k0
@ GSM48_CMODE_DATA_43k5_29k0
Definition: gsm_04_08.h:771
gsm0808_permitted_speech
static enum gsm0808_permitted_speech gsm0808_permitted_speech(enum gsm_chan_t type, enum gsm48_chan_mode mode)
Return 3GPP TS 48.008 3.2.2.51 Speech Version aka permitted speech version indication in 3....
Definition: gsm0808_utils.h:348
GSM0808_CSTAT_RELEASED_NO_USER
@ GSM0808_CSTAT_RELEASED_NO_USER
Definition: gsm0808_utils.h:183
GSM0808_PERM_HR1
@ GSM0808_PERM_HR1
GSM HR.
Definition: gsm_08_08.h:499
gsm0808_cell_id_name2
const char * gsm0808_cell_id_name2(const struct gsm0808_cell_id *cid)
Like gsm0808_cell_id_name() but uses a different static buffer.
Definition: gsm0808_utils.c:2115
value_string
osmo_lcls_dump_c
char * osmo_lcls_dump_c(void *ctx, const struct osmo_lcls *lcls)
Definition: gsm0808_utils.c:747
gsm0808_dec_cell_id
int gsm0808_dec_cell_id(struct gsm0808_cell_id *ci, const uint8_t *elem, uint8_t len)
Decode Cell Identifier IE (3GPP TS 48.008 3.2.2.17).
Definition: gsm0808_utils.c:1550
gsm0808_get_cipher_reject_cause
int gsm0808_get_cipher_reject_cause(const struct tlv_parsed *tp) OSMO_DEPRECATED("Use gsm0808_get_cause() instead")
Definition: gsm0808_utils.c:1806
GSM48_CMODE_SPEECH_AMR
@ GSM48_CMODE_SPEECH_AMR
Speech: AMR (TCH/AFS or TCH/AHS)
Definition: gsm_04_08.h:758
gsm0808_cell_id_to_cgi
int gsm0808_cell_id_to_cgi(struct osmo_cell_global_id *cgi, const struct gsm0808_cell_id *cid)
Overwrite parts of cgi with values from a Cell Identifier.
Definition: gsm0808_utils.c:2018
gsm0808_cell_id_u::sai
struct osmo_service_area_id sai
Definition: gsm0808_utils.h:49
GSM48_CMODE_DATA_14k5_43k5
@ GSM48_CMODE_DATA_14k5_43k5
Definition: gsm_04_08.h:773
gsm0808_talker_identity::id_bits
unsigned int id_bits
Definition: gsm0808_utils.h:176
gsm0808_sms_to_vgcs
Definition: gsm0808_utils.h:189
gsm_08_08.h
osmo_gcr_dump
char * osmo_gcr_dump(const struct osmo_lcls *lcls)
Dump GCR struct into static string buffer for printing.
Definition: gsm0808_utils.c:779
gsm0808_cell_id_list_segment::cil
struct gsm0808_cell_id_list2 cil
Definition: gsm0808_utils.h:148
gsm0808_encrypt_info
Definition: gsm_08_08.h:760
gsm0808_cell_id_list_add
int gsm0808_cell_id_list_add(struct gsm0808_cell_id_list2 *dst, const struct gsm0808_cell_id_list2 *src)
Append entries from one Cell Identifier List to another.
Definition: gsm0808_utils.c:1457
GSM0808_DTX_FLAG_ALLOW
@ GSM0808_DTX_FLAG_ALLOW
Definition: gsm0808_utils.h:140
gsm0808_circuit_pool_list::pool
uint8_t pool[CIRCUIT_POOL_LIST_MAXLEN]
Definition: gsm0808_utils.h:154
gsm0808_dec_priority
int gsm0808_dec_priority(struct gsm0808_priority *pri, const uint8_t *elem, uint8_t len)
Decode Priority IE (3GPP TS 48.008 3.2.2.18).
Definition: gsm0808_utils.c:2280
GSM0808_PERM_HR3
@ GSM0808_PERM_HR3
HR AMR.
Definition: gsm_08_08.h:501
gsm0808_enc_priority
uint8_t gsm0808_enc_priority(struct msgb *msg, const struct gsm0808_priority *pri)
Encode Priority IE (3GPP TS 48.008 3.2.2.18).
Definition: gsm0808_utils.c:2257
gsm0808_group_callref
Packed representation of a Group Call Reference IE (3GPP TS 48.008 3.2.2.55)
Definition: gsm0808_utils.h:121
GSM0808_CELL_ID_LIST2_MAXLEN
#define GSM0808_CELL_ID_LIST2_MAXLEN
(225-1)/2 is the maximum number of elements in a cell identifier list.
Definition: gsm0808_utils.h:38
gsm0808_dec_cell_id_list_segment
int gsm0808_dec_cell_id_list_segment(struct gsm0808_cell_id_list_segment *ci, const uint8_t *elem, uint8_t len)
Decode Cell Identifier List Segment IE (3GPP TS 48.008 3.2.2.27a).
Definition: gsm0808_utils.c:2537
GSM48_CMODE_DATA_29k0
@ GSM48_CMODE_DATA_29k0
ECSD: 29.0 kbit/s radio interface rate, 28.8 kbit/s services (E-TCH/F28.8)
Definition: gsm_04_08.h:784
gsm0808_cell_id_discr_name
static const char * gsm0808_cell_id_discr_name(enum CELL_IDENT id_discr)
Definition: gsm0808_utils.h:241
gsm0808_call_priority
gsm0808_call_priority
Definition: gsm0808_utils.h:109
gsm0808_priority
Packed representation of a Priority IE (GGPP TS 48.008 3.2.2.18)
Definition: gsm0808_utils.h:68
gsm0808_cell_id_u::lai_and_lac
struct osmo_location_area_id lai_and_lac
Definition: gsm0808_utils.h:47
gsm0808_decode_cell_id_u
int gsm0808_decode_cell_id_u(union gsm0808_cell_id_u *out, enum CELL_IDENT discr, const uint8_t *buf, unsigned int len)
Decode a single GSM 08.08 Cell ID list element payload.
Definition: gsm0808_utils.c:968
gsm0808_enc_encrypt_info
uint8_t gsm0808_enc_encrypt_info(struct msgb *msg, const struct gsm0808_encrypt_info *ei)
Encode TS 08.08 Encryption Information IE.
Definition: gsm0808_utils.c:789
gsm0808_dec_vgcs_feature_flags
int gsm0808_dec_vgcs_feature_flags(struct gsm0808_vgcs_feature_flags *ff, const uint8_t *elem, uint8_t len)
Decode VGCS Feature Flags IE (3GPP TS 48.008 3.2.2.88).
Definition: gsm0808_utils.c:2320
gsm0808_lcls_control
gsm0808_lcls_control
Definition: gsm_08_08.h:792
GSM0808_AI_CONFIRM_APP_DATA
@ GSM0808_AI_CONFIRM_APP_DATA
Definition: gsm0808_utils.h:204
gsm0808_application_idndicator
gsm0808_application_idndicator
Packed representation of a Data Identity IE (GGPP TS 48.008 3.2.2.99)
Definition: gsm0808_utils.h:202
gsm0808_cell_id_list2::id_list_len
unsigned int id_list_len
Definition: gsm0808_utils.h:64
GSM0808_PERM_FR1
@ GSM0808_PERM_FR1
GSM FR.
Definition: gsm_08_08.h:494
gsm0808_dec_encrypt_info
int gsm0808_dec_encrypt_info(struct gsm0808_encrypt_info *ei, const uint8_t *elem, uint8_t len)
Decode TS 08.08 Encryption Information IE.
Definition: gsm0808_utils.c:828
gsm0808_enc_speech_codec
uint8_t gsm0808_enc_speech_codec(struct msgb *msg, const struct gsm0808_speech_codec *sc) OSMO_DEPRECATED("use gsm0808_enc_speech_codec2() instead")
Deprecated: gsm0808_enc_speech_codec2() wrapper for backwards compatibility.
Definition: gsm0808_utils.c:316
gsm0808_data_identity
Definition: gsm0808_utils.h:211
gsm0808_layer_3_information::l3
uint8_t l3[LAYER_3_INFORMATION_MAXLEN]
Definition: gsm0808_utils.h:168
gsm0808_layer_3_information
Definition: gsm0808_utils.h:167
tlv.h
osmo_lcls::config
enum gsm0808_lcls_config config
§3.2.2.116 Configuration.
Definition: gsm0808_utils.h:227
gsm0808_enc_group_callref
uint8_t gsm0808_enc_group_callref(struct msgb *msg, const struct gsm0808_group_callref *gc)
Encode Group Call Reference IE (3GPP TS 48.008 3.2.2.55).
Definition: gsm0808_utils.c:2217
gsm0808_enc_data_identity
uint8_t gsm0808_enc_data_identity(struct msgb *msg, const struct gsm0808_data_identity *ai)
Encode Data Identity IE (3GPP TS 48.008 3.2.2.99).
Definition: gsm0808_utils.c:2337
GSM0808_TALKER_PRIORITY_NORMAL
@ GSM0808_TALKER_PRIORITY_NORMAL
Definition: gsm0808_utils.h:160
gsm0808_cell_id_u::global
struct osmo_cell_global_id global
Definition: gsm0808_utils.h:44
gsm0808_vgcs_vbs_cell_status
gsm0808_vgcs_vbs_cell_status
Definition: gsm0808_utils.h:180
gsm0808_vgcs_feature_flags
Packed representation of a VGCS Feature Flags IE (3GPP TS 48.008 3.2.2.88)
Definition: gsm0808_utils.h:82
gsm0808_application_data::data
uint8_t data[APP_DATA_MAXLEN]
Definition: gsm0808_utils.h:197
GSM0808_CALL_PRIORITY_LEVEL_3
@ GSM0808_CALL_PRIORITY_LEVEL_3
Definition: gsm0808_utils.h:112
gsm0808_dec_aoip_trasp_addr
int gsm0808_dec_aoip_trasp_addr(struct sockaddr_storage *ss, const uint8_t *elem, uint8_t len)
gsm0808_cell_id_discr_names
const struct value_string gsm0808_cell_id_discr_names[]
value_string[] for enum CELL_IDENT.
Definition: gsm0808_utils.c:2062
gsm0808_enc_cause
uint8_t gsm0808_enc_cause(struct msgb *msg, uint16_t cause)
gsm0808_cell_id_name_buf
char * gsm0808_cell_id_name_buf(char *buf, size_t buflen, const struct gsm0808_cell_id *cid)
Definition: gsm0808_utils.c:2091
gsm48_chan_mode
gsm48_chan_mode
10.5.2.6 Channel Mode value
Definition: gsm_04_08.h:750
gsm0808_enc_assign_req
uint8_t gsm0808_enc_assign_req(struct msgb *msg, const enum gsm0808_assignment_requirement ar)
Encode Assignment Requirements IE (3GPP TS 48.008 3.2.2.52).
Definition: gsm0808_utils.c:2471
osmo_lac_and_ci_id
Definition: gsm23003.h:53
gsm0808_dec_data_identity
int gsm0808_dec_data_identity(struct gsm0808_data_identity *ai, const uint8_t *elem, uint8_t len)
Decode Data Identity IE (3GPP TS 48.008 3.2.2.99).
Definition: gsm0808_utils.c:2360
gsm0808_cell_id_list2::id_discr
enum CELL_IDENT id_discr
Definition: gsm0808_utils.h:62
gsm0808_cause_class
static enum gsm0808_cause_class gsm0808_cause_class(enum gsm0808_cause cause)
Definition: gsm0808_utils.h:316
GSM48_CMODE_DATA_43k5_14k5
@ GSM48_CMODE_DATA_43k5_14k5
Definition: gsm_04_08.h:767
tlv_parsed
result of the TLV parser
Definition: tlv.h:532
gsm0808_talker_priority
gsm0808_talker_priority
Definition: gsm0808_utils.h:159
gsm0808_cell_id_name_c
char * gsm0808_cell_id_name_c(const void *ctx, const struct gsm0808_cell_id *cid)
Definition: gsm0808_utils.c:2121
gsm0808_sc_cfg_from_gsm48_mr_cfg
uint16_t gsm0808_sc_cfg_from_gsm48_mr_cfg(const struct gsm48_multi_rate_conf *cfg, bool fr)
Determine a set of AMR speech codec configuration bits (S0-S15) from a given GSM 04....
Definition: gsm0808_utils.c:1665
gsm0808_dec_lcls
int gsm0808_dec_lcls(struct osmo_lcls *lcls, const struct tlv_parsed *tp)
Decode LCLS parameters to a given msgb, 3GPP TS 48.008 §3.2.2.115 - 3.2.2.120.
Definition: gsm0808_utils.c:705
gsm0808_cell_id_u
Instead of this, use either struct gsm0808_cell_id or gsm0808_cell_id_list2.
Definition: gsm0808_utils.h:43
gsm0808_cell_id_to_list
void gsm0808_cell_id_to_list(struct gsm0808_cell_id_list2 *dst, const struct gsm0808_cell_id *src)
Convert a single Cell Identifier to a Cell Identifier List with one entry.
Definition: gsm0808_utils.c:1494