Loading...
Searching...
No Matches
gsm48_ie.h
Go to the documentation of this file.
#pragma once
#include <stdint.h>
#include <string.h>
#include <errno.h>
#include <osmocom/core/msgb.h>
#include <osmocom/core/defs.h>
#include <osmocom/gsm/tlv.h>
#include <osmocom/gsm/mncc.h>
#include <osmocom/gsm/protocol/gsm_04_08.h>
/* decode a 'called/calling/connect party BCD number' as in 10.5.4.7 */
int gsm48_decode_bcd_number(char *output, int output_len,
const uint8_t *bcd_lv, int h_len)
OSMO_DEPRECATED_OUTSIDE("Use gsm48_decode_bcd_number2() for improved bounds checking");
int gsm48_decode_bcd_number2(char *output, size_t output_len,
const uint8_t *bcd_lv, size_t input_len,
size_t h_len);
/* convert a ASCII phone number to 'called/calling/connect party BCD number' */
int gsm48_encode_bcd_number(uint8_t *bcd_lv, uint8_t max_len,
int h_len, const char *input);
/* decode 'bearer capability' */
int gsm48_decode_bearer_cap(struct gsm_mncc_bearer_cap *bcap,
const uint8_t *lv);
/* encode 'bearer capability' */
int gsm48_encode_bearer_cap(struct msgb *msg, int lv_only,
const struct gsm_mncc_bearer_cap *bcap);
/* decode 'call control cap' */
int gsm48_decode_cccap(struct gsm_mncc_cccap *ccap, const uint8_t *lv);
/* encode 'call control cap' */
int gsm48_encode_cccap(struct msgb *msg,
const struct gsm_mncc_cccap *ccap);
/* decode 'called party BCD number' */
int gsm48_decode_called(struct gsm_mncc_number *called,
const uint8_t *lv);
/* encode 'called party BCD number' */
int gsm48_encode_called(struct msgb *msg,
const struct gsm_mncc_number *called);
/* decode callerid of various IEs */
int gsm48_decode_callerid(struct gsm_mncc_number *callerid,
const uint8_t *lv);
/* encode callerid of various IEs */
int gsm48_encode_callerid(struct msgb *msg, int ie, int max_len,
const struct gsm_mncc_number *callerid);
/* decode 'cause' */
int gsm48_decode_cause(struct gsm_mncc_cause *cause,
const uint8_t *lv);
/* encode 'cause' */
int gsm48_encode_cause(struct msgb *msg, int lv_only,
const struct gsm_mncc_cause *cause);
/* decode 'calling number' */
int gsm48_decode_calling(struct gsm_mncc_number *calling,
const uint8_t *lv);
/* encode 'calling number' */
int gsm48_encode_calling(struct msgb *msg,
const struct gsm_mncc_number *calling);
/* decode 'connected number' */
int gsm48_decode_connected(struct gsm_mncc_number *connected,
const uint8_t *lv);
/* encode 'connected number' */
int gsm48_encode_connected(struct msgb *msg,
const struct gsm_mncc_number *connected);
/* decode 'redirecting number' */
int gsm48_decode_redirecting(struct gsm_mncc_number *redirecting,
const uint8_t *lv);
/* encode 'redirecting number' */
int gsm48_encode_redirecting(struct msgb *msg,
const struct gsm_mncc_number *redirecting);
/* decode 'facility' */
int gsm48_decode_facility(struct gsm_mncc_facility *facility,
const uint8_t *lv);
/* encode 'facility' */
int gsm48_encode_facility(struct msgb *msg, int lv_only,
const struct gsm_mncc_facility *facility);
/* decode 'notify' */
int gsm48_decode_notify(int *notify, const uint8_t *v);
/* encode 'notify' */
int gsm48_encode_notify(struct msgb *msg, int notify);
/* decode 'signal' */
int gsm48_decode_signal(int *signal, const uint8_t *v);
/* encode 'signal' */
int gsm48_encode_signal(struct msgb *msg, int signal);
/* decode 'keypad' */
int gsm48_decode_keypad(int *keypad, const uint8_t *lv);
/* encode 'keypad' */
int gsm48_encode_keypad(struct msgb *msg, int keypad);
/* decode 'progress' */
int gsm48_decode_progress(struct gsm_mncc_progress *progress,
const uint8_t *lv);
/* encode 'progress' */
int gsm48_encode_progress(struct msgb *msg, int lv_only,
const struct gsm_mncc_progress *p);
/* decode 'user-user' */
int gsm48_decode_useruser(struct gsm_mncc_useruser *uu,
const uint8_t *lv);
/* encode 'useruser' */
int gsm48_encode_useruser(struct msgb *msg, int lv_only,
const struct gsm_mncc_useruser *uu);
/* decode 'ss version' */
int gsm48_decode_ssversion(struct gsm_mncc_ssversion *ssv,
const uint8_t *lv);
/* encode 'ss version' */
int gsm48_encode_ssversion(struct msgb *msg,
const struct gsm_mncc_ssversion *ssv);
/* decode 'more data' does not require a function, because it has no value */
/* encode 'more data' */
int gsm48_encode_more(struct msgb *msg);
/* structure of one frequency */
struct gsm_sysinfo_freq {
/* if the frequency included in the sysinfo */
uint8_t mask;
};
/* decode "Cell Channel Description" (10.5.2.1b) and other frequency lists */
int gsm48_decode_freq_list(struct gsm_sysinfo_freq *f, uint8_t *cd,
uint8_t len, uint8_t mask, uint8_t frqt);
/* decode "CSN.1 encoded Classmark 3" (10.5.1.7) */
int gsm48_decode_classmark3(struct gsm48_classmark3 *classmark3_out,
const uint8_t *classmark3, size_t classmark3_len);
defs.h
gsm48_encode_useruser
int gsm48_encode_useruser(struct msgb *msg, int lv_only, const struct gsm_mncc_useruser *uu)
Encode TS 04.08 User-User IE (10.5.4.25)
Definition gsm48_ie.c:786
gsm48_decode_signal
int gsm48_decode_signal(int *signal, const uint8_t *v)
Decode TS 04.08 Signal IE (10.5.4.23)
Definition gsm48_ie.c:690
gsm48_encode_facility
int gsm48_encode_facility(struct msgb *msg, int lv_only, const struct gsm_mncc_facility *facility)
Encode TS 04.08 Facility IE (10.5.4.15)
Definition gsm48_ie.c:655
gsm48_decode_cause
int gsm48_decode_cause(struct gsm_mncc_cause *cause, const uint8_t *lv)
Decode TS 04.08 Cause IE (10.5.4.11)
Definition gsm48_ie.c:508
gsm48_decode_connected
int gsm48_decode_connected(struct gsm_mncc_number *connected, const uint8_t *lv)
Decode TS 04.08 Connected Number IE (10.5.4.13)
Definition gsm48_ie.c:609
gsm48_decode_cccap
int gsm48_decode_cccap(struct gsm_mncc_cccap *ccap, const uint8_t *lv)
Decode TS 04.08 Call Control Capabilities IE (10.5.4.5a)
Definition gsm48_ie.c:356
gsm48_encode_calling
int gsm48_encode_calling(struct msgb *msg, const struct gsm_mncc_number *calling)
Encode TS 04.08 Calling Number IE (10.5.4.9)
Definition gsm48_ie.c:602
gsm48_decode_calling
int gsm48_decode_calling(struct gsm_mncc_number *calling, const uint8_t *lv)
Decode TS 04.08 Calling Number IE (10.5.4.9)
Definition gsm48_ie.c:595
gsm48_encode_keypad
int gsm48_encode_keypad(struct msgb *msg, int keypad)
Encode TS 04.08 Keypad IE (10.5.4.17)
Definition gsm48_ie.c:719
gsm48_encode_callerid
int gsm48_encode_callerid(struct msgb *msg, int ie, int max_len, const struct gsm_mncc_number *callerid)
Encode TS 04.08 Caller ID IE.
Definition gsm48_ie.c:474
gsm48_encode_progress
int gsm48_encode_progress(struct msgb *msg, int lv_only, const struct gsm_mncc_progress *p)
Encode TS 04.08 Progress IE (10.5.4.21)
Definition gsm48_ie.c:743
gsm48_decode_progress
int gsm48_decode_progress(struct gsm_mncc_progress *progress, const uint8_t *lv)
Decode TS 04.08 Progress IE (10.5.4.21)
Definition gsm48_ie.c:727
gsm48_encode_ssversion
int gsm48_encode_ssversion(struct msgb *msg, const struct gsm_mncc_ssversion *ssv)
Encode TS 04.08 SS Version IE (10.5.4.24)
Definition gsm48_ie.c:821
gsm48_decode_notify
int gsm48_decode_notify(int *notify, const uint8_t *v)
Decode TS 04.08 Notify IE (10.5.4.20)
Definition gsm48_ie.c:674
gsm48_decode_bcd_number2
int gsm48_decode_bcd_number2(char *output, size_t output_len, const uint8_t *bcd_lv, size_t input_len, size_t h_len)
Decode a 'called/calling/connect party BCD number' as in 10.5.4.7.
Definition gsm48_ie.c:76
gsm48_encode_notify
int gsm48_encode_notify(struct msgb *msg, int notify)
Encode TS 04.08 Notify IE (10.5.4.20)
Definition gsm48_ie.c:682
gsm48_decode_facility
int gsm48_decode_facility(struct gsm_mncc_facility *facility, const uint8_t *lv)
Decode TS 04.08 Facility IE (10.5.4.15)
Definition gsm48_ie.c:637
gsm48_decode_bearer_cap
int gsm48_decode_bearer_cap(struct gsm_mncc_bearer_cap *bcap, const uint8_t *lv)
Decode TS 04.08 Bearer Capability IE (10.5.4.5)
Definition gsm48_ie.c:185
gsm48_encode_more
int gsm48_encode_more(struct msgb *msg)
Encode TS 04.08 More Data IE (10.5.4.19)
Definition gsm48_ie.c:839
gsm48_decode_useruser
int gsm48_decode_useruser(struct gsm_mncc_useruser *uu, const uint8_t *lv)
Decode TS 04.08 User-User IE (10.5.4.25)
Definition gsm48_ie.c:760
gsm48_decode_classmark3
int gsm48_decode_classmark3(struct gsm48_classmark3 *classmark3_out, const uint8_t *classmark3, size_t classmark3_len)
Decode 3GPP TS 24.008 Mobile Station Classmark 3 (10.5.1.7).
Definition gsm48_ie.c:1305
gsm48_decode_keypad
int gsm48_decode_keypad(int *keypad, const uint8_t *lv)
Decode TS 04.08 Keypad IE (10.5.4.17)
Definition gsm48_ie.c:706
gsm48_decode_callerid
int gsm48_decode_callerid(struct gsm_mncc_number *callerid, const uint8_t *lv)
Decode TS 04.08 Caller ID.
Definition gsm48_ie.c:442
gsm48_encode_cccap
int gsm48_encode_cccap(struct msgb *msg, const struct gsm_mncc_cccap *ccap)
Encodoe TS 04.08 Call Control Capabilities (10.5.4.5a)
Definition gsm48_ie.c:374
gsm48_encode_redirecting
int gsm48_encode_redirecting(struct msgb *msg, const struct gsm_mncc_number *redirecting)
Encode TS 04.08 Redirecting Number IE (10.5.4.21b)
Definition gsm48_ie.c:630
gsm48_encode_called
int gsm48_encode_called(struct msgb *msg, const struct gsm_mncc_number *called)
Encode TS 04.08 Called Party IE (10.5.4.7)
Definition gsm48_ie.c:417
gsm48_encode_signal
int gsm48_encode_signal(struct msgb *msg, int signal)
Encode TS 04.08 Signal IE (10.5.4.23)
Definition gsm48_ie.c:698
gsm48_decode_called
int gsm48_decode_called(struct gsm_mncc_number *called, const uint8_t *lv)
Decode TS 04.08 Called Party BCD Number IE (10.5.4.7)
Definition gsm48_ie.c:395
gsm48_decode_ssversion
int gsm48_decode_ssversion(struct gsm_mncc_ssversion *ssv, const uint8_t *lv)
Decode TS 04.08 SS Version IE (10.5.4.24)
Definition gsm48_ie.c:806
gsm48_encode_bcd_number
int gsm48_encode_bcd_number(uint8_t *bcd_lv, uint8_t max_len, int h_len, const char *input)
convert a ASCII phone number to 'called/calling/connect party BCD number'
Definition gsm48_ie.c:149
gsm48_decode_bcd_number
int gsm48_decode_bcd_number(char *output, int output_len, const uint8_t *bcd_lv, int h_len) OSMO_DEPRECATED_OUTSIDE("Use gsm48_decode_bcd_number2() for improved bounds checking")
Like gsm48_decode_bcd_number2() but with less airtight bounds checking.
Definition gsm48_ie.c:51
gsm48_encode_bearer_cap
int gsm48_encode_bearer_cap(struct msgb *msg, int lv_only, const struct gsm_mncc_bearer_cap *bcap)
Encode TS 04.08 Bearer Capability IE (10.5.4.5)
Definition gsm48_ie.c:298
gsm48_decode_redirecting
int gsm48_decode_redirecting(struct gsm_mncc_number *redirecting, const uint8_t *lv)
Decode TS 04.08 Redirecting Number IE (10.5.4.21b)
Definition gsm48_ie.c:623
gsm48_decode_freq_list
int gsm48_decode_freq_list(struct gsm_sysinfo_freq *f, uint8_t *cd, uint8_t len, uint8_t mask, uint8_t frqt)
Decode TS 04.08 Cell Channel Description IE (10.5.2.1b) and other frequency lists.
Definition gsm48_ie.c:866
gsm48_encode_connected
int gsm48_encode_connected(struct msgb *msg, const struct gsm_mncc_number *connected)
Encode TS 04.08 Connected Number IE (10.5.4.13)
Definition gsm48_ie.c:616
gsm48_encode_cause
int gsm48_encode_cause(struct msgb *msg, int lv_only, const struct gsm_mncc_cause *cause)
Encode TS 04.08 Cause IE (10.5.4.11)
Definition gsm48_ie.c:555
OSMO_DEPRECATED_OUTSIDE
#define OSMO_DEPRECATED_OUTSIDE(text)
gsm_04_08.h
GSM TS 04.08 definitions.
cause
uint8_t cause
Definition gsm_04_08.h:2
len
uint8_t len
Definition gsm_04_11.h:0
msg
uint8_t msg[0]
Definition gsm_08_08.h:8
mncc.h
msgb.h
gsm48_classmark3
Definition gsm_04_08.h:62
gsm_mncc_bearer_cap
Definition mncc.h:12
gsm_mncc_cause
Definition mncc.h:41
gsm_mncc_cccap
Definition mncc.h:72
gsm_mncc_facility
Definition mncc.h:62
gsm_mncc_number
Definition mncc.h:33
gsm_mncc_progress
Definition mncc.h:56
gsm_mncc_ssversion
Definition mncc.h:67
gsm_mncc_useruser
Definition mncc.h:51
gsm_sysinfo_freq
Definition gsm48_ie.h:114
gsm_sysinfo_freq::mask
uint8_t mask
Definition gsm48_ie.h:116
msgb
tlv.h