rtx3GPP.h File Reference

Functions for implementing various algorithms described in various 3GPP standards documents. More...

#include "rtxsrc/rtxContext.h"
#include "rtxsrc/rtxTBCD.h"

Go to the source code of this file.

Functions

EXTERNRT int rtx3GPPFromRangeFormat (OSUINT32 rfarray[], OSUINT32 rfcount, OSUINT32 range, OSUINT32 *presult)
 This function converts a value from one of the bit range formats defined in 3GPP TS 44.018 sections 10.5.2.13.3 through 10.5.2.13.6 into an unsigned integer value.
EXTERNRT int rtx3GPPEncGSMCharStr (OSCTXT *pctxt, const char *value)
 This function encodes an 8-bit ASCII character string to GSM 7-bit format as specified in 3GPP TS 23.038.
EXTERNRT int rtx3GPPDecGSMCharStr (OSCTXT *pctxt, char *outbuf, OSSIZE outbufsiz, OSSIZE nchars)
 This function decodes characters encoded in GSM 7-bit format as specified in 3GPP TS 23.038 to a standard ASCII character array.
EXTERNRT int rtx3GPPEnc_MCC_MNC (OSCTXT *pctxt, const char *mcc, const char *mnc)
 This function is used to encode an MCC/MNC pair.
EXTERNRT int rtx3GPPDec_MCC_MNC (OSCTXT *pctxt, char mcc[4], char mnc[4])
 This function is used to decode an MCC/MNC pair.
EXTERNRT int rtx3GPPDecL3NonImperative (OSCTXT *pctxt, OSBOOL callCtrl)
 This function decodes the non-imperative part of an L3 message having an empty non-imperative part.
EXTERNRT int rtx3GPPEncMobileIdentityType1 (OSCTXT *pctxt, OSUINT8 type, const char *pstr)
 This function is used to encode different alternatives within the MobileIdentify CHOICE type.
EXTERNRT int rtx3GPPDecMobileIdentityType1 (OSCTXT *pctxt, OSUINT8 len, OSBOOL odd, OSUINT8 digit1, char *strbuf, OSSIZE bufsize)
 This function is used to decode common data present in different alternatives within the MobileIdentify CHOICE type.

Detailed Description

Functions for implementing various algorithms described in various 3GPP standards documents.

Definition in file rtx3GPP.h.


Function Documentation

EXTERNRT int rtx3GPPDec_MCC_MNC ( OSCTXT pctxt,
char  mcc[4],
char  mnc[4] 
)

This function is used to decode an MCC/MNC pair.

Parameters:
pctxt Pointer to context structure.
mcc Buffer to receive MCC value (3 digits).
mnc Buffer to receive MNC value (3 digits).
Returns:
Completion status of operation:
  • zero (0) = success,
  • negative return value is error. @ return
EXTERNRT int rtx3GPPDecGSMCharStr ( OSCTXT pctxt,
char *  outbuf,
OSSIZE  outbufsiz,
OSSIZE  nchars 
)

This function decodes characters encoded in GSM 7-bit format as specified in 3GPP TS 23.038 to a standard ASCII character array.

Parameters:
pctxt Pointer to context structure
outbuf Output array to receive decoded characters
outbufsiz Size of output buffer
nchars Number of characters to be decoded
Returns:
Completion status of operation:
  • 0 = success
  • negative return value is error.
EXTERNRT int rtx3GPPDecL3NonImperative ( OSCTXT pctxt,
OSBOOL  callCtrl 
)

This function decodes the non-imperative part of an L3 message having an empty non-imperative part.

This is not for use with circuit-switched call control messages (3GPP TS 24.008 section 9.3) as it does not handle the SHIFT IE case.

This will report an error if a comprehension required IE is found.

Parameters:
pctxt Pointer to context structure.
callCtrl Boolean indicating this is a call control message.
Returns:
Completion status of operation:
  • zero (0) = success,
  • negative return value is error.
EXTERNRT int rtx3GPPDecMobileIdentityType1 ( OSCTXT pctxt,
OSUINT8  len,
OSBOOL  odd,
OSUINT8  digit1,
char *  strbuf,
OSSIZE  bufsize 
)

This function is used to decode common data present in different alternatives within the MobileIdentify CHOICE type.

These include the IMSI, IMEI, and IMEISV alternatives.

Parameters:
pctxt Pointer to context structure.
len Length in bytes of the data to be decoded.
odd Odd/even indicator boolean decoded from header.
digit1 First BCD character decoded from header.
strbuf Character array to hold decoded value. This must be at least one byte larger to hold the maximum sized string value to account for the null terminator character.
bufsize Size in bytes of strbuf.
Returns:
Completion status of operation:
  • zero (0) = success,
  • negative return value is error.
EXTERNRT int rtx3GPPEnc_MCC_MNC ( OSCTXT pctxt,
const char *  mcc,
const char *  mnc 
)

This function is used to encode an MCC/MNC pair.

Parameters:
pctxt Pointer to context structure.
mcc MCC value (3 digits).
mnc MNC value (3 digits).
Returns:
Completion status of operation:
  • zero (0) = success,
  • negative return value is error. @ return
EXTERNRT int rtx3GPPEncGSMCharStr ( OSCTXT pctxt,
const char *  value 
)

This function encodes an 8-bit ASCII character string to GSM 7-bit format as specified in 3GPP TS 23.038.

Parameters:
pctxt Pointer to context structure
value Character string to be encoded
Returns:
Completion status of operation:
  • 0 = success
  • negative return value is error.
EXTERNRT int rtx3GPPEncMobileIdentityType1 ( OSCTXT pctxt,
OSUINT8  type,
const char *  pstr 
)

This function is used to encode different alternatives within the MobileIdentify CHOICE type.

These include the IMSI, IMEI, and IMEISV alternatives.

Parameters:
pctxt Pointer to context structure.
type Choice type alternative (t) value.
pstr Numeric string content of IMSI, IMEI, etc.
Returns:
Completion status of operation:
  • zero (0) = success,
  • negative return value is error.
EXTERNRT int rtx3GPPFromRangeFormat ( OSUINT32  rfarray[],
OSUINT32  rfcount,
OSUINT32  range,
OSUINT32 *  presult 
)

This function converts a value from one of the bit range formats defined in 3GPP TS 44.018 sections 10.5.2.13.3 through 10.5.2.13.6 into an unsigned integer value.

Parameters:
rfarray Array of range format values.
frcount Number of items in array on which conversion is to be done.
range Range value (1024, 512, 256, 128).
presult Pointer to unsigned integer value to receive result of the conversion.
Returns:
Completion status of operation:
  • 0 (0) = success,
  • negative return value is error.