aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/libmsc
diff options
context:
space:
mode:
Diffstat (limited to 'openbsc/src/libmsc')
-rw-r--r--openbsc/src/libmsc/db.c14
-rw-r--r--openbsc/src/libmsc/gsm_04_08.c94
-rw-r--r--openbsc/src/libmsc/gsm_04_11.c102
-rw-r--r--openbsc/src/libmsc/gsm_04_80.c8
-rw-r--r--openbsc/src/libmsc/gsm_subscriber.c2
-rw-r--r--openbsc/src/libmsc/mncc_builtin.c6
-rw-r--r--openbsc/src/libmsc/rrlp.c8
-rw-r--r--openbsc/src/libmsc/silent_call.c6
-rw-r--r--openbsc/src/libmsc/token_auth.c8
-rw-r--r--openbsc/src/libmsc/vty_interface_layer3.c2
10 files changed, 125 insertions, 125 deletions
diff --git a/openbsc/src/libmsc/db.c b/openbsc/src/libmsc/db.c
index 3de683044..f08fb790c 100644
--- a/openbsc/src/libmsc/db.c
+++ b/openbsc/src/libmsc/db.c
@@ -737,7 +737,7 @@ int db_sync_equipment(struct gsm_equipment *equip)
dbi_result result;
unsigned char *cm2, *cm3;
char *q_imei;
- u_int8_t classmark1;
+ uint8_t classmark1;
memcpy(&classmark1, &equip->classmark1, sizeof(classmark1));
DEBUGP(DDB, "Sync Equipment IMEI=%s, classmark1=%02x",
@@ -821,7 +821,7 @@ int db_subscriber_alloc_tmsi(struct gsm_subscriber *subscriber)
int db_subscriber_alloc_exten(struct gsm_subscriber *subscriber)
{
dbi_result result = NULL;
- u_int32_t try;
+ uint32_t try;
for (;;) {
try = (rand()%(GSM_MAX_EXTEN-GSM_MIN_EXTEN+1)+GSM_MIN_EXTEN);
@@ -855,10 +855,10 @@ int db_subscriber_alloc_exten(struct gsm_subscriber *subscriber)
* an error.
*/
-int db_subscriber_alloc_token(struct gsm_subscriber *subscriber, u_int32_t *token)
+int db_subscriber_alloc_token(struct gsm_subscriber *subscriber, uint32_t *token)
{
dbi_result result;
- u_int32_t try;
+ uint32_t try;
for (;;) {
try = rand();
@@ -1060,7 +1060,7 @@ static struct gsm_sms *sms_from_result(struct gsm_network *net, dbi_result resul
sms->user_data_len = dbi_result_get_field_length(result, "user_data");
user_data = dbi_result_get_binary(result, "user_data");
if (sms->user_data_len > sizeof(sms->user_data))
- sms->user_data_len = (u_int8_t) sizeof(sms->user_data);
+ sms->user_data_len = (uint8_t) sizeof(sms->user_data);
memcpy(sms->user_data, user_data, sms->user_data_len);
text = dbi_result_get_string(result, "text");
@@ -1219,8 +1219,8 @@ int db_sms_inc_deliver_attempts(struct gsm_sms *sms)
}
int db_apdu_blob_store(struct gsm_subscriber *subscr,
- u_int8_t apdu_id_flags, u_int8_t len,
- u_int8_t *apdu)
+ uint8_t apdu_id_flags, uint8_t len,
+ uint8_t *apdu)
{
dbi_result result;
unsigned char *q_apdu;
diff --git a/openbsc/src/libmsc/gsm_04_08.c b/openbsc/src/libmsc/gsm_04_08.c
index 138e26cfa..7d6580a19 100644
--- a/openbsc/src/libmsc/gsm_04_08.c
+++ b/openbsc/src/libmsc/gsm_04_08.c
@@ -61,19 +61,19 @@
void *tall_locop_ctx;
void *tall_authciphop_ctx;
-int gsm0408_loc_upd_acc(struct gsm_subscriber_connection *conn, u_int32_t tmsi);
+int gsm0408_loc_upd_acc(struct gsm_subscriber_connection *conn, uint32_t tmsi);
static int gsm48_tx_simple(struct gsm_subscriber_connection *conn,
- u_int8_t pdisc, u_int8_t msg_type);
+ uint8_t pdisc, uint8_t msg_type);
static void schedule_reject(struct gsm_subscriber_connection *conn);
static void release_anchor(struct gsm_subscriber_connection *conn);
struct gsm_lai {
- u_int16_t mcc;
- u_int16_t mnc;
- u_int16_t lac;
+ uint16_t mcc;
+ uint16_t mnc;
+ uint16_t lac;
};
-static u_int32_t new_callref = 0x80000001;
+static uint32_t new_callref = 0x80000001;
void cc_tx_to_mncc(struct gsm_network *net, struct msgb *msg)
{
@@ -356,7 +356,7 @@ void gsm0408_clear_all_trans(struct gsm_network *net, int protocol)
}
/* Chapter 9.2.14 : Send LOCATION UPDATING REJECT */
-int gsm0408_loc_upd_rej(struct gsm_subscriber_connection *conn, u_int8_t cause)
+int gsm0408_loc_upd_rej(struct gsm_subscriber_connection *conn, uint8_t cause)
{
struct gsm_bts *bts = conn->bts;
struct msgb *msg;
@@ -380,13 +380,13 @@ int gsm0408_loc_upd_rej(struct gsm_subscriber_connection *conn, u_int8_t cause)
}
/* Chapter 9.2.13 : Send LOCATION UPDATE ACCEPT */
-int gsm0408_loc_upd_acc(struct gsm_subscriber_connection *conn, u_int32_t tmsi)
+int gsm0408_loc_upd_acc(struct gsm_subscriber_connection *conn, uint32_t tmsi)
{
struct gsm_bts *bts = conn->bts;
struct msgb *msg = gsm48_msgb_alloc();
struct gsm48_hdr *gh;
struct gsm48_loc_area_id *lai;
- u_int8_t *mid;
+ uint8_t *mid;
msg->lchan = conn->lchan;
@@ -409,7 +409,7 @@ int gsm0408_loc_upd_acc(struct gsm_subscriber_connection *conn, u_int32_t tmsi)
}
/* Transmit Chapter 9.2.10 Identity Request */
-static int mm_tx_identity_req(struct gsm_subscriber_connection *conn, u_int8_t id_type)
+static int mm_tx_identity_req(struct gsm_subscriber_connection *conn, uint8_t id_type)
{
struct msgb *msg = gsm48_msgb_alloc();
struct gsm48_hdr *gh;
@@ -432,7 +432,7 @@ static int mm_rx_id_resp(struct gsm_subscriber_connection *conn, struct msgb *ms
struct gsm_lchan *lchan = msg->lchan;
struct gsm_bts *bts = lchan->ts->trx->bts;
struct gsm_network *net = bts->network;
- u_int8_t mi_type = gh->data[1] & GSM_MI_TYPE_MASK;
+ uint8_t mi_type = gh->data[1] & GSM_MI_TYPE_MASK;
char mi_string[GSM48_MI_SIZE];
gsm48_mi_to_string(mi_string, sizeof(mi_string), &gh->data[1], gh->data[0]);
@@ -486,7 +486,7 @@ static void schedule_reject(struct gsm_subscriber_connection *conn)
bsc_schedule_timer(&conn->loc_operation->updating_timer, 5, 0);
}
-static const char *lupd_name(u_int8_t type)
+static const char *lupd_name(uint8_t type)
{
switch (type) {
case GSM48_LUPD_NORMAL:
@@ -507,7 +507,7 @@ static int mm_rx_loc_upd_req(struct gsm_subscriber_connection *conn, struct msgb
struct gsm48_loc_upd_req *lu;
struct gsm_subscriber *subscr = NULL;
struct gsm_bts *bts = conn->bts;
- u_int8_t mi_type;
+ uint8_t mi_type;
char mi_string[GSM48_MI_SIZE];
int rc;
@@ -604,7 +604,7 @@ static int mm_rx_loc_upd_req(struct gsm_subscriber_connection *conn, struct msgb
}
#if 0
-static u_int8_t to_bcd8(u_int8_t val)
+static uint8_t to_bcd8(uint8_t val)
{
return ((val / 10) << 4) | (val % 10);
}
@@ -616,7 +616,7 @@ int gsm48_tx_mm_info(struct gsm_subscriber_connection *conn)
struct msgb *msg = gsm48_msgb_alloc();
struct gsm48_hdr *gh;
struct gsm_network *net = conn->bts->network;
- u_int8_t *ptr8;
+ uint8_t *ptr8;
int name_len, name_pad;
#if 0
time_t cur_t;
@@ -639,7 +639,7 @@ int gsm48_tx_mm_info(struct gsm_subscriber_connection *conn)
ptr8[1] = name_len*2 +1;
ptr8[2] = 0x90; /* UCS2, no spare bits, no CI */
- ptr16 = (u_int16_t *) msgb_put(msg, name_len*2);
+ ptr16 = (uint16_t *) msgb_put(msg, name_len*2);
for (i = 0; i < name_len; i++)
ptr16[i] = htons(net->name_long[i]);
@@ -665,12 +665,12 @@ int gsm48_tx_mm_info(struct gsm_subscriber_connection *conn)
#if 0
name_len = strlen(net->name_short);
/* 10.5.3.5a */
- ptr8 = (u_int8_t *) msgb_put(msg, 3);
+ ptr8 = (uint8_t *) msgb_put(msg, 3);
ptr8[0] = GSM48_IE_NAME_SHORT;
ptr8[1] = name_len*2 + 1;
ptr8[2] = 0x90; /* UCS2, no spare bits, no CI */
- ptr16 = (u_int16_t *) msgb_put(msg, name_len*2);
+ ptr16 = (uint16_t *) msgb_put(msg, name_len*2);
for (i = 0; i < name_len; i++)
ptr16[i] = htons(net->name_short[i]);
#endif
@@ -679,7 +679,7 @@ int gsm48_tx_mm_info(struct gsm_subscriber_connection *conn)
if (name_pad > 0)
name_len++;
/* 10.5.3.5a */
- ptr8 = (u_int8_t *) msgb_put(msg, 3);
+ ptr8 = (uint8_t *) msgb_put(msg, 3);
ptr8[0] = GSM48_IE_NAME_SHORT;
ptr8[1] = name_len +1;
ptr8[2] = 0x80 | name_pad; /* Cell Broadcast DCS, no CI */
@@ -714,7 +714,7 @@ int gsm48_tx_mm_info(struct gsm_subscriber_connection *conn)
}
/* Section 9.2.2 */
-int gsm48_tx_mm_auth_req(struct gsm_subscriber_connection *conn, u_int8_t *rand, int key_seq)
+int gsm48_tx_mm_auth_req(struct gsm_subscriber_connection *conn, uint8_t *rand, int key_seq)
{
struct msgb *msg = gsm48_msgb_alloc();
struct gsm48_hdr *gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh));
@@ -804,7 +804,7 @@ static int _gsm48_rx_mm_serv_req_sec_cb(
*/
static int gsm48_rx_mm_serv_req(struct gsm_subscriber_connection *conn, struct msgb *msg)
{
- u_int8_t mi_type;
+ uint8_t mi_type;
char mi_string[GSM48_MI_SIZE];
struct gsm_bts *bts = conn->bts;
@@ -813,10 +813,10 @@ static int gsm48_rx_mm_serv_req(struct gsm_subscriber_connection *conn, struct m
struct gsm48_service_request *req =
(struct gsm48_service_request *)gh->data;
/* unfortunately in Phase1 the classmark2 length is variable */
- u_int8_t classmark2_len = gh->data[1];
- u_int8_t *classmark2 = gh->data+2;
- u_int8_t mi_len = *(classmark2 + classmark2_len);
- u_int8_t *mi = (classmark2 + classmark2_len + 1);
+ uint8_t classmark2_len = gh->data[1];
+ uint8_t *classmark2 = gh->data+2;
+ uint8_t mi_len = *(classmark2 + classmark2_len);
+ uint8_t *mi = (classmark2 + classmark2_len + 1);
DEBUGP(DMM, "<- CM SERVICE REQUEST ");
if (msg->data_len < sizeof(struct gsm48_service_request*)) {
@@ -878,7 +878,7 @@ static int gsm48_rx_mm_imsi_detach_ind(struct msgb *msg)
struct gsm48_hdr *gh = msgb_l3(msg);
struct gsm48_imsi_detach_ind *idi =
(struct gsm48_imsi_detach_ind *) gh->data;
- u_int8_t mi_type = idi->mi[0] & GSM_MI_TYPE_MASK;
+ uint8_t mi_type = idi->mi[0] & GSM_MI_TYPE_MASK;
char mi_string[GSM48_MI_SIZE];
struct gsm_subscriber *subscr = NULL;
@@ -1025,8 +1025,8 @@ static int gsm48_rx_rr_pag_resp(struct gsm_subscriber_connection *conn, struct m
struct gsm_bts *bts = conn->bts;
struct gsm48_hdr *gh = msgb_l3(msg);
struct gsm48_pag_resp *resp;
- u_int8_t *classmark2_lv = gh->data + 1;
- u_int8_t mi_type;
+ uint8_t *classmark2_lv = gh->data + 1;
+ uint8_t mi_type;
char mi_string[GSM48_MI_SIZE];
struct gsm_subscriber *subscr = NULL;
int rc = 0;
@@ -1068,8 +1068,8 @@ static int gsm48_rx_rr_classmark(struct gsm_subscriber_connection *conn, struct
struct gsm48_hdr *gh = msgb_l3(msg);
struct gsm_subscriber *subscr = conn->subscr;
unsigned int payload_len = msgb_l3len(msg) - sizeof(*gh);
- u_int8_t cm2_len, cm3_len = 0;
- u_int8_t *cm2, *cm3 = NULL;
+ uint8_t cm2_len, cm3_len = 0;
+ uint8_t *cm2, *cm3 = NULL;
DEBUGP(DRR, "CLASSMARK CHANGE ");
@@ -1136,9 +1136,9 @@ static int gsm48_rx_rr_meas_rep(struct msgb *msg)
static int gsm48_rx_rr_app_info(struct gsm_subscriber_connection *conn, struct msgb *msg)
{
struct gsm48_hdr *gh = msgb_l3(msg);
- u_int8_t apdu_id_flags;
- u_int8_t apdu_len;
- u_int8_t *apdu_data;
+ uint8_t apdu_id_flags;
+ uint8_t apdu_len;
+ uint8_t *apdu_data;
apdu_id_flags = gh->data[0];
apdu_len = gh->data[1];
@@ -1256,8 +1256,8 @@ static int gsm0408_rcv_rr(struct gsm_subscriber_connection *conn, struct msgb *m
return rc;
}
-int gsm48_send_rr_app_info(struct gsm_subscriber_connection *conn, u_int8_t apdu_id,
- u_int8_t apdu_len, const u_int8_t *apdu)
+int gsm48_send_rr_app_info(struct gsm_subscriber_connection *conn, uint8_t apdu_id,
+ uint8_t apdu_len, const uint8_t *apdu)
{
struct msgb *msg = gsm48_msgb_alloc();
struct gsm48_hdr *gh;
@@ -1300,7 +1300,7 @@ static int gsm48_cc_tx_status(struct gsm_trans *trans, void *arg)
{
struct msgb *msg = gsm48_msgb_alloc();
struct gsm48_hdr *gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh));
- u_int8_t *cause, *call_state;
+ uint8_t *cause, *call_state;
gh->msg_type = GSM48_MT_CC_STATUS;
@@ -1316,7 +1316,7 @@ static int gsm48_cc_tx_status(struct gsm_trans *trans, void *arg)
}
static int gsm48_tx_simple(struct gsm_subscriber_connection *conn,
- u_int8_t pdisc, u_int8_t msg_type)
+ uint8_t pdisc, uint8_t msg_type)
{
struct msgb *msg = gsm48_msgb_alloc();
struct gsm48_hdr *gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh));
@@ -1377,7 +1377,7 @@ static int mncc_recvmsg(struct gsm_network *net, struct gsm_trans *trans,
}
int mncc_release_ind(struct gsm_network *net, struct gsm_trans *trans,
- u_int32_t callref, int location, int value)
+ uint32_t callref, int location, int value)
{
struct gsm_mncc rel;
@@ -1475,7 +1475,7 @@ static int setup_trig_pag_evt(unsigned int hooknum, unsigned int event,
return 0;
}
-static int tch_recv_mncc(struct gsm_network *net, u_int32_t callref, int enable);
+static int tch_recv_mncc(struct gsm_network *net, uint32_t callref, int enable);
/* handle audio path for handover */
static int handle_ho_signal(unsigned int subsys, unsigned int signal,
@@ -1645,7 +1645,7 @@ static int tch_map(struct gsm_lchan *lchan, struct gsm_lchan *remote_lchan)
}
/* bridge channels of two transactions */
-static int tch_bridge(struct gsm_network *net, u_int32_t *refs)
+static int tch_bridge(struct gsm_network *net, uint32_t *refs)
{
struct gsm_trans *trans1 = trans_find_by_callref(net, refs[0]);
struct gsm_trans *trans2 = trans_find_by_callref(net, refs[1]);
@@ -1661,7 +1661,7 @@ static int tch_bridge(struct gsm_network *net, u_int32_t *refs)
}
/* enable receive of channels to MNCC upqueue */
-static int tch_recv_mncc(struct gsm_network *net, u_int32_t callref, int enable)
+static int tch_recv_mncc(struct gsm_network *net, uint32_t callref, int enable)
{
struct gsm_trans *trans;
struct gsm_lchan *lchan;
@@ -1823,7 +1823,7 @@ static void gsm48_start_cc_timer(struct gsm_trans *trans, int current,
static int gsm48_cc_rx_setup(struct gsm_trans *trans, struct msgb *msg)
{
struct gsm48_hdr *gh = msgb_l3(msg);
- u_int8_t msg_type = gh->msg_type & 0xbf;
+ uint8_t msg_type = gh->msg_type & 0xbf;
unsigned int payload_len = msgb_l3len(msg) - sizeof(*gh);
struct tlv_parsed tp;
struct gsm_mncc setup;
@@ -2882,7 +2882,7 @@ static int _gsm48_lchan_modify(struct gsm_trans *trans, void *arg)
}
static struct downstate {
- u_int32_t states;
+ uint32_t states;
int type;
int (*rout) (struct gsm_trans *trans, void *arg);
} downstatelist[] = {
@@ -3154,7 +3154,7 @@ int mncc_tx_to_cc(struct gsm_network *net, int msg_type, void *arg)
static struct datastate {
- u_int32_t states;
+ uint32_t states;
int type;
int (*rout) (struct gsm_trans *trans, struct msgb *msg);
} datastatelist[] = {
@@ -3210,8 +3210,8 @@ static struct datastate {
static int gsm0408_rcv_cc(struct gsm_subscriber_connection *conn, struct msgb *msg)
{
struct gsm48_hdr *gh = msgb_l3(msg);
- u_int8_t msg_type = gh->msg_type & 0xbf;
- u_int8_t transaction_id = ((gh->proto_discr & 0xf0) ^ 0x80) >> 4; /* flip */
+ uint8_t msg_type = gh->msg_type & 0xbf;
+ uint8_t transaction_id = ((gh->proto_discr & 0xf0) ^ 0x80) >> 4; /* flip */
struct gsm_trans *trans = NULL;
int i, rc = 0;
@@ -3298,7 +3298,7 @@ int gsm0408_new_conn(struct gsm_subscriber_connection *conn)
int gsm0408_dispatch(struct gsm_subscriber_connection *conn, struct msgb *msg)
{
struct gsm48_hdr *gh = msgb_l3(msg);
- u_int8_t pdisc = gh->proto_discr & 0x0f;
+ uint8_t pdisc = gh->proto_discr & 0x0f;
int rc = 0;
if (silent_call_reroute(conn, msg))
diff --git a/openbsc/src/libmsc/gsm_04_11.c b/openbsc/src/libmsc/gsm_04_11.c
index 0f8d7c24c..c7ac8f4a4 100644
--- a/openbsc/src/libmsc/gsm_04_11.c
+++ b/openbsc/src/libmsc/gsm_04_11.c
@@ -55,7 +55,7 @@
#define GSM411_ALLOC_HEADROOM 128
void *tall_gsms_ctx;
-static u_int32_t new_callref = 0x40000001;
+static uint32_t new_callref = 0x40000001;
static const struct value_string cp_cause_strs[] = {
{ GSM411_CP_CAUSE_NET_FAIL, "Network Failure" },
@@ -173,7 +173,7 @@ struct msgb *gsm411_msgb_alloc(void)
"GSM 04.11");
}
-static int gsm411_sendmsg(struct gsm_subscriber_connection *conn, struct msgb *msg, u_int8_t link_id)
+static int gsm411_sendmsg(struct gsm_subscriber_connection *conn, struct msgb *msg, uint8_t link_id)
{
DEBUGP(DSMS, "GSM4.11 TX %s\n", hexdump(msg->data, msg->len));
msg->l3h = msg->data;
@@ -192,7 +192,7 @@ static void cp_timer_expired(void *data)
/* Prefix msg with a 04.08/04.11 CP header */
static int gsm411_cp_sendmsg(struct msgb *msg, struct gsm_trans *trans,
- u_int8_t msg_type)
+ uint8_t msg_type)
{
struct gsm48_hdr *gh;
@@ -228,10 +228,10 @@ static int gsm411_cp_sendmsg(struct msgb *msg, struct gsm_trans *trans,
/* Prefix msg with a RP-DATA header and send as CP-DATA */
static int gsm411_rp_sendmsg(struct msgb *msg, struct gsm_trans *trans,
- u_int8_t rp_msg_type, u_int8_t rp_msg_ref)
+ uint8_t rp_msg_type, uint8_t rp_msg_ref)
{
struct gsm411_rp_hdr *rp;
- u_int8_t len = msg->len;
+ uint8_t len = msg->len;
/* GSM 04.11 RP-DATA header */
rp = (struct gsm411_rp_hdr *)msgb_push(msg, sizeof(*rp));
@@ -243,9 +243,9 @@ static int gsm411_rp_sendmsg(struct msgb *msg, struct gsm_trans *trans,
}
/* Turn int into semi-octet representation: 98 => 0x89 */
-static u_int8_t bcdify(u_int8_t value)
+static uint8_t bcdify(uint8_t value)
{
- u_int8_t ret;
+ uint8_t ret;
ret = value / 10;
ret |= (value % 10) << 4;
@@ -254,9 +254,9 @@ static u_int8_t bcdify(u_int8_t value)
}
/* Turn semi-octet representation into int: 0x89 => 98 */
-static u_int8_t unbcdify(u_int8_t value)
+static uint8_t unbcdify(uint8_t value)
{
- u_int8_t ret;
+ uint8_t ret;
if ((value & 0x0F) > 9 || (value >> 4) > 9)
LOGP(DSMS, LOGL_ERROR,
@@ -269,7 +269,7 @@ static u_int8_t unbcdify(u_int8_t value)
}
/* Generate 03.40 TP-SCTS */
-static void gsm340_gen_scts(u_int8_t *scts, time_t time)
+static void gsm340_gen_scts(uint8_t *scts, time_t time)
{
struct tm *tm = localtime(&time);
@@ -283,11 +283,11 @@ static void gsm340_gen_scts(u_int8_t *scts, time_t time)
}
/* Decode 03.40 TP-SCTS (into utc/gmt timestamp) */
-static time_t gsm340_scts(u_int8_t *scts)
+static time_t gsm340_scts(uint8_t *scts)
{
struct tm tm;
- u_int8_t yr = unbcdify(*scts++);
+ uint8_t yr = unbcdify(*scts++);
if (yr <= 80)
tm.tm_year = 100 + yr;
@@ -315,10 +315,10 @@ static unsigned long gsm340_vp_default(void)
}
/* Decode validity period format 'relative' */
-static unsigned long gsm340_vp_relative(u_int8_t *sms_vp)
+static unsigned long gsm340_vp_relative(uint8_t *sms_vp)
{
/* Chapter 9.2.3.12.1 */
- u_int8_t vp;
+ uint8_t vp;
unsigned long minutes;
vp = *(sms_vp);
@@ -334,7 +334,7 @@ static unsigned long gsm340_vp_relative(u_int8_t *sms_vp)
}
/* Decode validity period format 'absolute' */
-static unsigned long gsm340_vp_absolute(u_int8_t *sms_vp)
+static unsigned long gsm340_vp_absolute(uint8_t *sms_vp)
{
/* Chapter 9.2.3.12.2 */
time_t expires, now;
@@ -350,9 +350,9 @@ static unsigned long gsm340_vp_absolute(u_int8_t *sms_vp)
}
/* Decode validity period format 'relative in integer representation' */
-static unsigned long gsm340_vp_relative_integer(u_int8_t *sms_vp)
+static unsigned long gsm340_vp_relative_integer(uint8_t *sms_vp)
{
- u_int8_t vp;
+ uint8_t vp;
unsigned long minutes;
vp = *(sms_vp);
if (vp == 0) {
@@ -365,7 +365,7 @@ static unsigned long gsm340_vp_relative_integer(u_int8_t *sms_vp)
}
/* Decode validity period format 'relative in semi-octet representation' */
-static unsigned long gsm340_vp_relative_semioctet(u_int8_t *sms_vp)
+static unsigned long gsm340_vp_relative_semioctet(uint8_t *sms_vp)
{
unsigned long minutes;
minutes = unbcdify(*sms_vp++)*60; /* hours */
@@ -375,9 +375,9 @@ static unsigned long gsm340_vp_relative_semioctet(u_int8_t *sms_vp)
}
/* decode validity period. return minutes */
-static unsigned long gsm340_validity_period(u_int8_t sms_vpf, u_int8_t *sms_vp)
+static unsigned long gsm340_validity_period(uint8_t sms_vpf, uint8_t *sms_vp)
{
- u_int8_t fi; /* functionality indicator */
+ uint8_t fi; /* functionality indicator */
switch (sms_vpf) {
case GSM340_TP_VPF_RELATIVE:
@@ -413,9 +413,9 @@ static unsigned long gsm340_validity_period(u_int8_t sms_vpf, u_int8_t *sms_vp)
}
/* determine coding alphabet dependent on GSM 03.38 Section 4 DCS */
-enum sms_alphabet gsm338_get_sms_alphabet(u_int8_t dcs)
+enum sms_alphabet gsm338_get_sms_alphabet(uint8_t dcs)
{
- u_int8_t cgbits = dcs >> 4;
+ uint8_t cgbits = dcs >> 4;
enum sms_alphabet alpha = DCS_NONE;
if ((cgbits & 0xc) == 0) {
@@ -463,7 +463,7 @@ static int gsm340_rx_sms_submit(struct msgb *msg, struct gsm_sms *gsms)
}
/* generate a TPDU address field compliant with 03.40 sec. 9.1.2.5 */
-static int gsm340_gen_oa(u_int8_t *oa, unsigned int oa_len,
+static int gsm340_gen_oa(uint8_t *oa, unsigned int oa_len,
struct gsm_subscriber *subscr)
{
int len_in_bytes;
@@ -482,10 +482,10 @@ static int gsm340_gen_oa(u_int8_t *oa, unsigned int oa_len,
* returns total size of TPDU */
static int gsm340_gen_tpdu(struct msgb *msg, struct gsm_sms *sms)
{
- u_int8_t *smsp;
- u_int8_t oa[12]; /* max len per 03.40 */
- u_int8_t oa_len = 0;
- u_int8_t octet_len;
+ uint8_t *smsp;
+ uint8_t oa[12]; /* max len per 03.40 */
+ uint8_t oa_len = 0;
+ uint8_t octet_len;
unsigned int old_msg_len = msg->len;
/* generate first octet with masked bits */
@@ -552,12 +552,12 @@ static int gsm340_gen_tpdu(struct msgb *msg, struct gsm_sms *sms)
* return value > 0: RP CAUSE for ERROR; < 0: silent error; 0 = success */
static int gsm340_rx_tpdu(struct gsm_subscriber_connection *conn, struct msgb *msg)
{
- u_int8_t *smsp = msgb_sms(msg);
+ uint8_t *smsp = msgb_sms(msg);
struct gsm_sms *gsms;
- u_int8_t sms_mti, sms_mms, sms_vpf, sms_alphabet, sms_rp;
- u_int8_t *sms_vp;
- u_int8_t da_len_bytes;
- u_int8_t address_lv[12]; /* according to 03.40 / 9.1.2.5 */
+ uint8_t sms_mti, sms_mms, sms_vpf, sms_alphabet, sms_rp;
+ uint8_t *sms_vp;
+ uint8_t da_len_bytes;
+ uint8_t address_lv[12]; /* according to 03.40 / 9.1.2.5 */
int rc = 0;
counter_inc(conn->bts->network->stats.sms.submitted);
@@ -685,7 +685,7 @@ out:
return rc;
}
-static int gsm411_send_rp_ack(struct gsm_trans *trans, u_int8_t msg_ref)
+static int gsm411_send_rp_ack(struct gsm_trans *trans, uint8_t msg_ref)
{
struct msgb *msg = gsm411_msgb_alloc();
@@ -695,7 +695,7 @@ static int gsm411_send_rp_ack(struct gsm_trans *trans, u_int8_t msg_ref)
}
static int gsm411_send_rp_error(struct gsm_trans *trans,
- u_int8_t msg_ref, u_int8_t cause)
+ uint8_t msg_ref, uint8_t cause)
{
struct msgb *msg = gsm411_msgb_alloc();
@@ -710,9 +710,9 @@ static int gsm411_send_rp_error(struct gsm_trans *trans,
/* Receive a 04.11 TPDU inside RP-DATA / user data */
static int gsm411_rx_rp_ud(struct msgb *msg, struct gsm_trans *trans,
struct gsm411_rp_hdr *rph,
- u_int8_t src_len, u_int8_t *src,
- u_int8_t dst_len, u_int8_t *dst,
- u_int8_t tpdu_len, u_int8_t *tpdu)
+ uint8_t src_len, uint8_t *src,
+ uint8_t dst_len, uint8_t *dst,
+ uint8_t tpdu_len, uint8_t *tpdu)
{
int rc = 0;
@@ -743,8 +743,8 @@ static int gsm411_rx_rp_ud(struct msgb *msg, struct gsm_trans *trans,
static int gsm411_rx_rp_data(struct msgb *msg, struct gsm_trans *trans,
struct gsm411_rp_hdr *rph)
{
- u_int8_t src_len, dst_len, rpud_len;
- u_int8_t *src = NULL, *dst = NULL , *rp_ud = NULL;
+ uint8_t src_len, dst_len, rpud_len;
+ uint8_t *src = NULL, *dst = NULL , *rp_ud = NULL;
/* in the MO case, this should always be zero length */
src_len = rph->data[0];
@@ -812,8 +812,8 @@ static int gsm411_rx_rp_error(struct msgb *msg, struct gsm_trans *trans,
{
struct gsm_network *net = trans->conn->bts->network;
struct gsm_sms *sms = trans->sms.sms;
- u_int8_t cause_len = rph->data[0];
- u_int8_t cause = rph->data[1];
+ uint8_t cause_len = rph->data[0];
+ uint8_t cause = rph->data[1];
/* Error in response to MT RP_DATA, i.e. the MS did not
* successfully receive the SMS. We need to investigate
@@ -886,7 +886,7 @@ static int gsm411_rx_cp_data(struct msgb *msg, struct gsm48_hdr *gh,
struct gsm_trans *trans)
{
struct gsm411_rp_hdr *rp_data = (struct gsm411_rp_hdr*)&gh->data;
- u_int8_t msg_type = rp_data->msg_type & 0x07;
+ uint8_t msg_type = rp_data->msg_type & 0x07;
int rc = 0;
switch (msg_type) {
@@ -936,10 +936,10 @@ static int gsm411_tx_cp_ack(struct gsm_trans *trans)
return rc;
}
-static int gsm411_tx_cp_error(struct gsm_trans *trans, u_int8_t cause)
+static int gsm411_tx_cp_error(struct gsm_trans *trans, uint8_t cause)
{
struct msgb *msg = gsm411_msgb_alloc();
- u_int8_t *causep;
+ uint8_t *causep;
LOGP(DSMS, LOGL_NOTICE, "TX CP-ERROR, cause %d (%s)\n", cause,
get_value_string(cp_cause_strs, cause));
@@ -955,8 +955,8 @@ int gsm0411_rcv_sms(struct gsm_subscriber_connection *conn,
struct msgb *msg)
{
struct gsm48_hdr *gh = msgb_l3(msg);
- u_int8_t msg_type = gh->msg_type;
- u_int8_t transaction_id = ((gh->proto_discr >> 4) ^ 0x8); /* flip */
+ uint8_t msg_type = gh->msg_type;
+ uint8_t transaction_id = ((gh->proto_discr >> 4) ^ 0x8); /* flip */
struct gsm_trans *trans;
int rc = 0;
@@ -1074,8 +1074,8 @@ int gsm411_send_sms(struct gsm_subscriber_connection *conn, struct gsm_sms *sms)
{
struct msgb *msg = gsm411_msgb_alloc();
struct gsm_trans *trans;
- u_int8_t *data, *rp_ud_len;
- u_int8_t msg_ref = 42;
+ uint8_t *data, *rp_ud_len;
+ uint8_t msg_ref = 42;
int transaction_id;
int rc;
@@ -1108,7 +1108,7 @@ int gsm411_send_sms(struct gsm_subscriber_connection *conn, struct gsm_sms *sms)
trans->conn = conn;
/* Hardcode SMSC Originating Address for now */
- data = (u_int8_t *)msgb_put(msg, 8);
+ data = (uint8_t *)msgb_put(msg, 8);
data[0] = 0x07; /* originator length == 7 */
data[1] = 0x91; /* type of number: international, ISDN */
data[2] = 0x44; /* 447785016005 */
@@ -1119,11 +1119,11 @@ int gsm411_send_sms(struct gsm_subscriber_connection *conn, struct gsm_sms *sms)
data[7] = 0x50;
/* Hardcoded Destination Address */
- data = (u_int8_t *)msgb_put(msg, 1);
+ data = (uint8_t *)msgb_put(msg, 1);
data[0] = 0; /* destination length == 0 */
/* obtain a pointer for the rp_ud_len, so we can fill it later */
- rp_ud_len = (u_int8_t *)msgb_put(msg, 1);
+ rp_ud_len = (uint8_t *)msgb_put(msg, 1);
/* generate the 03.40 TPDU */
rc = gsm340_gen_tpdu(msg, sms);
diff --git a/openbsc/src/libmsc/gsm_04_80.c b/openbsc/src/libmsc/gsm_04_80.c
index 240bfb3a9..39738a5ee 100644
--- a/openbsc/src/libmsc/gsm_04_80.c
+++ b/openbsc/src/libmsc/gsm_04_80.c
@@ -39,7 +39,7 @@
#include <osmocom/core/msgb.h>
#include <osmocom/gsm/tlv.h>
-static inline unsigned char *msgb_wrap_with_TL(struct msgb *msgb, u_int8_t tag)
+static inline unsigned char *msgb_wrap_with_TL(struct msgb *msgb, uint8_t tag)
{
uint8_t *data = msgb_push(msgb, 2);
@@ -48,8 +48,8 @@ static inline unsigned char *msgb_wrap_with_TL(struct msgb *msgb, u_int8_t tag)
return data;
}
-static inline unsigned char *msgb_push_TLV1(struct msgb *msgb, u_int8_t tag,
- u_int8_t value)
+static inline unsigned char *msgb_push_TLV1(struct msgb *msgb, uint8_t tag,
+ uint8_t value)
{
uint8_t *data = msgb_push(msgb, 3);
@@ -67,7 +67,7 @@ int gsm0480_send_ussd_response(struct gsm_subscriber_connection *conn,
{
struct msgb *msg = gsm48_msgb_alloc();
struct gsm48_hdr *gh;
- u_int8_t *ptr8;
+ uint8_t *ptr8;
int response_len;
/* First put the payload text into the message */
diff --git a/openbsc/src/libmsc/gsm_subscriber.c b/openbsc/src/libmsc/gsm_subscriber.c
index ff4a647d5..f0372aff7 100644
--- a/openbsc/src/libmsc/gsm_subscriber.c
+++ b/openbsc/src/libmsc/gsm_subscriber.c
@@ -266,7 +266,7 @@ void subscr_put_channel(struct gsm_subscriber *subscr)
struct gsm_subscriber *subscr_get_by_tmsi(struct gsm_network *net,
- u_int32_t tmsi)
+ uint32_t tmsi)
{
char tmsi_string[14];
struct gsm_subscriber *subscr;
diff --git a/openbsc/src/libmsc/mncc_builtin.c b/openbsc/src/libmsc/mncc_builtin.c
index 11355fba0..96b729011 100644
--- a/openbsc/src/libmsc/mncc_builtin.c
+++ b/openbsc/src/libmsc/mncc_builtin.c
@@ -40,7 +40,7 @@ void *tall_call_ctx;
static LLIST_HEAD(call_list);
-static u_int32_t new_callref = 0x00000001;
+static uint32_t new_callref = 0x00000001;
static void free_call(struct gsm_call *call)
{
@@ -50,7 +50,7 @@ static void free_call(struct gsm_call *call)
}
-static struct gsm_call *get_call_ref(u_int32_t callref)
+static struct gsm_call *get_call_ref(uint32_t callref)
{
struct gsm_call *callt;
@@ -168,7 +168,7 @@ static int mncc_setup_cnf(struct gsm_call *call, int msg_type,
struct gsm_mncc connect_ack, frame_recv;
struct gsm_network *net = call->net;
struct gsm_call *remote;
- u_int32_t refs[2];
+ uint32_t refs[2];
/* acknowledge connect */
memset(&connect_ack, 0, sizeof(struct gsm_mncc));
diff --git a/openbsc/src/libmsc/rrlp.c b/openbsc/src/libmsc/rrlp.c
index ae5ca478e..37f7f3eda 100644
--- a/openbsc/src/libmsc/rrlp.c
+++ b/openbsc/src/libmsc/rrlp.c
@@ -29,20 +29,20 @@
/* RRLP msPositionReq, nsBased,
* Accuracy=60, Method=gps, ResponseTime=2, oneSet */
-static const u_int8_t ms_based_pos_req[] = { 0x40, 0x01, 0x78, 0xa8 };
+static const uint8_t ms_based_pos_req[] = { 0x40, 0x01, 0x78, 0xa8 };
/* RRLP msPositionReq, msBasedPref,
Accuracy=60, Method=gpsOrEOTD, ResponseTime=5, multipleSets */
-static const u_int8_t ms_pref_pos_req[] = { 0x40, 0x02, 0x79, 0x50 };
+static const uint8_t ms_pref_pos_req[] = { 0x40, 0x02, 0x79, 0x50 };
/* RRLP msPositionReq, msAssistedPref,
Accuracy=60, Method=gpsOrEOTD, ResponseTime=5, multipleSets */
-static const u_int8_t ass_pref_pos_req[] = { 0x40, 0x03, 0x79, 0x50 };
+static const uint8_t ass_pref_pos_req[] = { 0x40, 0x03, 0x79, 0x50 };
static int send_rrlp_req(struct gsm_subscriber_connection *conn)
{
struct gsm_network *net = conn->bts->network;
- const u_int8_t *req;
+ const uint8_t *req;
switch (net->rrlp.mode) {
case RRLP_MODE_MS_BASED:
diff --git a/openbsc/src/libmsc/silent_call.c b/openbsc/src/libmsc/silent_call.c
index 83e27a924..9e9b72db1 100644
--- a/openbsc/src/libmsc/silent_call.c
+++ b/openbsc/src/libmsc/silent_call.c
@@ -80,8 +80,8 @@ int silent_call_rx(struct gsm_subscriber_connection *conn, struct msgb *msg)
}
struct msg_match {
- u_int8_t pdisc;
- u_int8_t msg_type;
+ uint8_t pdisc;
+ uint8_t msg_type;
};
/* list of messages that are handled inside OpenBSC, even in a silent call */
@@ -94,7 +94,7 @@ static const struct msg_match silent_call_accept[] = {
int silent_call_reroute(struct gsm_subscriber_connection *conn, struct msgb *msg)
{
struct gsm48_hdr *gh = msgb_l3(msg);
- u_int8_t pdisc = gh->proto_discr & 0x0f;
+ uint8_t pdisc = gh->proto_discr & 0x0f;
int i;
/* if we're not part of a silent call, never reroute */
diff --git a/openbsc/src/libmsc/token_auth.c b/openbsc/src/libmsc/token_auth.c
index 4a62e8d47..b9e481dc1 100644
--- a/openbsc/src/libmsc/token_auth.c
+++ b/openbsc/src/libmsc/token_auth.c
@@ -32,7 +32,7 @@
#define TOKEN_SMS_TEXT "HAR 2009 GSM. Register at http://har2009.gnumonks.org/ " \
"Your IMSI is %s, auth token is %08X, phone no is %s."
-static char *build_sms_string(struct gsm_subscriber *subscr, u_int32_t token)
+static char *build_sms_string(struct gsm_subscriber *subscr, uint32_t token)
{
char *sms_str;
unsigned int len;
@@ -63,7 +63,7 @@ static int token_subscr_cb(unsigned int subsys, unsigned int signal,
return 0;
if (subscr->flags & GSM_SUBSCRIBER_FIRST_CONTACT) {
- u_int32_t token;
+ uint32_t token;
char *sms_str;
/* we've seen this subscriber for the first time. */
@@ -97,7 +97,7 @@ unauth:
if (rc) {
struct gsm_subscriber_connection *conn = connection_for_subscr(subscr);
if (conn) {
- u_int8_t auth_rand[16];
+ uint8_t auth_rand[16];
/* kick the subscriber off the network */
gsm48_tx_mm_auth_req(conn, auth_rand, 0);
gsm48_tx_mm_auth_rej(conn);
@@ -116,7 +116,7 @@ static int token_sms_cb(unsigned int subsys, unsigned int signal,
struct sms_signal_data *sig = signal_data;
struct gsm_sms *sms = sig->sms;;
struct gsm_subscriber_connection *conn;
- u_int8_t auth_rand[16];
+ uint8_t auth_rand[16];
if (signal != S_SMS_DELIVERED)
diff --git a/openbsc/src/libmsc/vty_interface_layer3.c b/openbsc/src/libmsc/vty_interface_layer3.c
index 8d6109b46..503bee470 100644
--- a/openbsc/src/libmsc/vty_interface_layer3.c
+++ b/openbsc/src/libmsc/vty_interface_layer3.c
@@ -142,7 +142,7 @@ DEFUN(sms_send_pend,
}
static int _send_sms_str(struct gsm_subscriber *receiver, char *str,
- u_int8_t tp_pid)
+ uint8_t tp_pid)
{
struct gsm_sms *sms;