libosmogsm  0.9.6.20171026
Osmocom GSM library
gsm23003.c File Reference

Utility function implementations related to 3GPP TS 23.003. More...

#include <ctype.h>
#include <osmocom/gsm/gsm23003.h>
#include <osmocom/gsm/protocol/gsm_23_003.h>

Functions

static bool is_n_digits (const char *str, int min_digits, int max_digits)
 
bool osmo_imsi_str_valid (const char *imsi)
 Determine whether the given IMSI is valid according to 3GPP TS 23.003. More...
 
bool osmo_msisdn_str_valid (const char *msisdn)
 Determine whether the given MSISDN is valid according to 3GPP TS 23.003. More...
 

Detailed Description

Utility function implementations related to 3GPP TS 23.003.

Function Documentation

◆ is_n_digits()

static bool is_n_digits ( const char *  str,
int  min_digits,
int  max_digits 
)
static

References len.

Referenced by osmo_imsi_str_valid(), and osmo_msisdn_str_valid().

◆ osmo_imsi_str_valid()

bool osmo_imsi_str_valid ( const char *  imsi)

Determine whether the given IMSI is valid according to 3GPP TS 23.003.

Parameters
imsiIMSI digits in ASCII string representation.
Returns
true when the IMSI is valid, false for invalid characters or number of digits.

References GSM23003_IMSI_MAX_DIGITS, GSM23003_IMSI_MIN_DIGITS, and is_n_digits().

◆ osmo_msisdn_str_valid()

bool osmo_msisdn_str_valid ( const char *  msisdn)

Determine whether the given MSISDN is valid according to 3GPP TS 23.003.

Parameters
msisdnMSISDN digits in ASCII string representation.
Returns
true when the MSISDN is valid, false for invalid characters or number of digits.

References is_n_digits().