libosmogsm  0.9.6.20171026
Osmocom GSM library
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
gsm0808_utils.c File Reference
#include "config.h"
#include <osmocom/core/utils.h>
#include <osmocom/core/msgb.h>
#include <osmocom/core/byteswap.h>
#include <string.h>
#include <errno.h>
#include <osmocom/gsm/protocol/gsm_08_08.h>

Macros

#define IP_V4_ADDR_LEN   4
 
#define IP_V6_ADDR_LEN   16
 
#define IP_PORT_LEN   2
 
#define CHANNEL_TYPE_ELEMENT_MAXLEN   11
 
#define CHANNEL_TYPE_ELEMENT_MINLEN   3
 
#define ENCRYPT_INFO_ELEMENT_MINLEN   1
 

Functions

static uint8_t enc_speech_codec (struct msgb *msg, const struct gsm0808_speech_codec *sc)
 
uint8_t gsm0808_enc_speech_codec (struct msgb *msg, const struct gsm0808_speech_codec *sc)
 Encode TS 08.08 Speech Codec IE. More...
 
int gsm0808_dec_speech_codec (struct gsm0808_speech_codec *sc, const uint8_t *elem, uint8_t len)
 Decode TS 08.08 Speech Codec IE. More...
 
uint8_t gsm0808_enc_speech_codec_list (struct msgb *msg, const struct gsm0808_speech_codec_list *scl)
 Encode TS 08.08 Speech Codec list. More...
 
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. More...
 
uint8_t gsm0808_enc_channel_type (struct msgb *msg, const struct gsm0808_channel_type *ct)
 Encode TS 08.08 Channel Type IE. More...
 
int gsm0808_dec_channel_type (struct gsm0808_channel_type *ct, const uint8_t *elem, uint8_t len)
 Decode TS 08.08 Channel Type IE. More...
 
uint8_t gsm0808_enc_encrypt_info (struct msgb *msg, const struct gsm0808_encrypt_info *ei)
 Encode TS 08.08 Encryption Information IE. More...
 
int gsm0808_dec_encrypt_info (struct gsm0808_encrypt_info *ei, const uint8_t *elem, uint8_t len)
 Decode TS 08.08 Encryption Information IE. More...
 
uint8_t gsm0808_enc_cell_id_list (struct msgb *msg, const struct gsm0808_cell_id_list *cil)
 Encode TS 08.08 Cell Identifier List IE. More...
 
int gsm0808_dec_cell_id_list (struct gsm0808_cell_id_list *cil, const uint8_t *elem, uint8_t len)
 Decode Cell Identifier List IE. More...
 
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_channel_type to the speech codec representation we use in struct gsm0808_speech_codec. More...
 
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). More...
 

Macro Definition Documentation

#define CHANNEL_TYPE_ELEMENT_MAXLEN   11
#define CHANNEL_TYPE_ELEMENT_MINLEN   3
#define ENCRYPT_INFO_ELEMENT_MINLEN   1
#define IP_PORT_LEN   2
#define IP_V4_ADDR_LEN   4
#define IP_V6_ADDR_LEN   16

Function Documentation