diff options
author | Harald Welte <laforge@gnumonks.org> | 2010-05-02 11:26:34 +0200 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2010-05-04 07:20:43 +0200 |
commit | eaa614cb9e7e72701e6ac479ff570c04bae497e0 (patch) | |
tree | af57f86fa059aaaca8ab1de2cf921900cf66926e /openbsc/include | |
parent | e6afd6077999406b91be9163e454f993929c2317 (diff) |
[gprs] Use stdint.h types (uintXX_t instead of u_intXX_t)
libosmocore already uses them, it's time (at least for new code)
in openbsc to do the same.
Diffstat (limited to 'openbsc/include')
-rw-r--r-- | openbsc/include/openbsc/gprs_bssgp.h | 16 | ||||
-rw-r--r-- | openbsc/include/openbsc/gprs_llc.h | 4 | ||||
-rw-r--r-- | openbsc/include/openbsc/gprs_ns.h | 16 | ||||
-rw-r--r-- | openbsc/include/openbsc/gprs_sgsn.h | 62 | ||||
-rw-r--r-- | openbsc/include/openbsc/gsm_04_08_gprs.h | 36 |
5 files changed, 72 insertions, 62 deletions
diff --git a/openbsc/include/openbsc/gprs_bssgp.h b/openbsc/include/openbsc/gprs_bssgp.h index a00481e4e..c70868af3 100644 --- a/openbsc/include/openbsc/gprs_bssgp.h +++ b/openbsc/include/openbsc/gprs_bssgp.h @@ -1,6 +1,8 @@ #ifndef _GPRS_BSSGP_H #define _GPRS_BSSGP_H +#include <stdint.h> + /* Section 11.3.26 / Table 11.27 */ enum bssgp_pdu_type { /* PDUs between RL and BSSGP SAPs */ @@ -49,15 +51,15 @@ enum bssgp_pdu_type { /* Section 10.2.1 and 10.2.2 */ struct bssgp_ud_hdr { - u_int8_t pdu_type; - u_int32_t tlli; - u_int8_t qos_profile[3]; - u_int8_t data[0]; /* TLV's */ + uint8_t pdu_type; + uint32_t tlli; + uint8_t qos_profile[3]; + uint8_t data[0]; /* TLV's */ } __attribute__((packed)); struct bssgp_normal_hdr { - u_int8_t pdu_type; - u_int8_t data[0]; /* TLV's */ + uint8_t pdu_type; + uint8_t data[0]; /* TLV's */ }; enum bssgp_iei_type { @@ -140,7 +142,7 @@ enum gprs_bssgp_cause { extern int gprs_bssgp_rcvmsg(struct msgb *msg); /* Wrapper around TLV parser to parse BSSGP IEs */ -static inline int bssgp_tlv_parse(struct tlv_parsed *tp, u_int8_t *buf, int len) +static inline int bssgp_tlv_parse(struct tlv_parsed *tp, uint8_t *buf, int len) { return tlv_parse(tp, &tvlv_att_def, buf, len, 0, 0); } diff --git a/openbsc/include/openbsc/gprs_llc.h b/openbsc/include/openbsc/gprs_llc.h index cd4e21523..2ed2d12ea 100644 --- a/openbsc/include/openbsc/gprs_llc.h +++ b/openbsc/include/openbsc/gprs_llc.h @@ -1,6 +1,8 @@ #ifndef _GPRS_LLC_H #define _GPRS_LLC_H +#include <stdint.h> + /* Section 4.7 LLC Layer Structure */ enum gprs_llc_sapi { GPRS_SAPI_GMM = 1, @@ -15,6 +17,6 @@ enum gprs_llc_sapi { int gprs_llc_rcvmsg(struct msgb *msg, struct tlv_parsed *tv); -int gprs_llc_tx_ui(struct msgb *msg, u_int8_t sapi, int command); +int gprs_llc_tx_ui(struct msgb *msg, uint8_t sapi, int command); #endif diff --git a/openbsc/include/openbsc/gprs_ns.h b/openbsc/include/openbsc/gprs_ns.h index ca02c4b5d..573536d11 100644 --- a/openbsc/include/openbsc/gprs_ns.h +++ b/openbsc/include/openbsc/gprs_ns.h @@ -1,13 +1,15 @@ #ifndef _GPRS_NS_H #define _GPRS_NS_H +#include <stdint.h> + /* GPRS Networks Service (NS) messages on the Gb interface * 3GPP TS 08.16 version 8.0.1 Release 1999 / ETSI TS 101 299 V8.0.1 (2002-05) * 3GPP TS 48.016 version 6.5.0 Release 6 / ETSI TS 148 016 V6.5.0 (2005-11) */ struct gprs_ns_hdr { - u_int8_t pdu_type; - u_int8_t data[0]; + uint8_t pdu_type; + uint8_t data[0]; } __attribute__((packed)); /* TS 08.16, Section 10.3.7, Table 14 */ @@ -95,7 +97,7 @@ enum gprs_ns_evt { struct gprs_nsvc; typedef int gprs_ns_cb_t(enum gprs_ns_evt event, struct gprs_nsvc *nsvc, - struct msgb *msg, u_int16_t bvci); + struct msgb *msg, uint16_t bvci); /* An instance of the NS protocol stack */ struct gprs_ns_inst { @@ -120,11 +122,11 @@ struct gprs_nsvc { struct llist_head list; struct gprs_ns_inst *nsi; - u_int16_t nsei; /* end-to-end significance */ - u_int16_t nsvci; /* uniquely identifies NS-VC at SGSN */ + uint16_t nsei; /* end-to-end significance */ + uint16_t nsvci; /* uniquely identifies NS-VC at SGSN */ - u_int32_t state; - u_int32_t remote_state; + uint32_t state; + uint32_t remote_state; struct timer_list alive_timer; int timer_is_tns_alive; diff --git a/openbsc/include/openbsc/gprs_sgsn.h b/openbsc/include/openbsc/gprs_sgsn.h index 92ce34d42..a3c7c78f4 100644 --- a/openbsc/include/openbsc/gprs_sgsn.h +++ b/openbsc/include/openbsc/gprs_sgsn.h @@ -1,6 +1,8 @@ #ifndef _GPRS_SGSN_H #define _GPRS_SGSN_H +#include <stdint.h> + /* TS 04.08 4.1.3.3 GMM mobility management states on the network side */ enum gprs_mm_state { GMM_DEREGISTERED, /* 4.1.3.3.1.1 */ @@ -25,43 +27,43 @@ struct sgsn_mm_ctx { char imsi[GSM_IMSI_LENGTH]; enum gprs_mm_state mm_state; - u_int32_t p_tmsi; - u_int32_t p_tmsi_sig; + uint32_t p_tmsi; + uint32_t p_tmsi_sig; char imei[GSM_IMEI_LENGTH]; /* Opt: Software Version Numbber / TS 23.195 */ char msisdn[GSM_EXTENSION_LENGTH]; struct gprs_ra_id ra; - u_int16_t cell_id; - u_int32_t cell_id_age; - u_int16_t sac; /* Iu: Service Area Code */ - u_int32_t sac_age;/* Iu: Service Area Code age */ + uint16_t cell_id; + uint32_t cell_id_age; + uint16_t sac; /* Iu: Service Area Code */ + uint32_t sac_age;/* Iu: Service Area Code age */ /* VLR number */ - u_int32_t new_sgsn_addr; + uint32_t new_sgsn_addr; /* Authentication Triplets */ /* Kc */ /* Iu: CK, IK, KSI */ /* CKSN */ enum gprs_ciph_algo ciph_algo; struct { - u_int8_t buf[14]; /* 10.5.5.12a */ - u_int8_t len; + uint8_t buf[14]; /* 10.5.5.12a */ + uint8_t len; } ms_radio_access_capa; struct { - u_int8_t buf[4]; /* 10.5.5.12 */ - u_int8_t len; + uint8_t buf[4]; /* 10.5.5.12 */ + uint8_t len; } ms_network_capa; - u_int16_t drx_parms; + uint16_t drx_parms; int mnrg; /* MS reported to HLR? */ int ngaf; /* MS reported to MSC/VLR? */ int ppf; /* paging for GPRS + non-GPRS? */ /* SMS Parameters */ int recovery; - u_int8_t radio_prio_sms; + uint8_t radio_prio_sms; struct llist_head pdp_list; /* Additional bits not present in the GSM TS */ - u_int32_t tlli; + uint32_t tlli; struct timer_list timer; unsigned int T; }; @@ -80,33 +82,33 @@ struct sgsn_pdp_ctx { unsigned int id; enum pdp_ctx_state state; enum pdp_type type; - u_int32_t addresss; + uint32_t addresss; char *apn_subscribed; char *apn_used; - u_int16_t nsapi; - u_int8_t ti; /* transaction identifier */ - u_int32_t ggsn_in_use; + uint16_t nsapi; + uint8_t ti; /* transaction identifier */ + uint32_t ggsn_in_use; int vplmn_allowed; - u_int32_t qos_profile_subscr; - u_int32_t qos_profile_req; - u_int32_t qos_profile_neg; - u_int8_t radio_prio; - u_int32_t tx_npdu_nr; - u_int32_t rx_npdu_nr; - u_int32_t tx_gtp_snd; - u_int32_t rx_gtp_snu; - u_int32_t charging_id; + uint32_t qos_profile_subscr; + uint32_t qos_profile_req; + uint32_t qos_profile_neg; + uint8_t radio_prio; + uint32_t tx_npdu_nr; + uint32_t rx_npdu_nr; + uint32_t tx_gtp_snd; + uint32_t rx_gtp_snu; + uint32_t charging_id; int reordering_reqd; }; /* look-up a SGSN MM context based on TLLI + RAI */ -struct sgsn_mm_ctx *sgsn_mm_ctx_by_tlli(u_int32_t tlli, +struct sgsn_mm_ctx *sgsn_mm_ctx_by_tlli(uint32_t tlli, const struct gprs_ra_id *raid); -struct sgsn_mm_ctx *sgsn_mm_ctx_by_ptmsi(u_int32_t tmsi); +struct sgsn_mm_ctx *sgsn_mm_ctx_by_ptmsi(uint32_t tmsi); struct sgsn_mm_ctx *sgsn_mm_ctx_by_imsi(const char *imsi); /* Allocate a new SGSN MM context */ -struct sgsn_mm_ctx *sgsn_mm_ctx_alloc(u_int32_t tlli, +struct sgsn_mm_ctx *sgsn_mm_ctx_alloc(uint32_t tlli, const struct gprs_ra_id *raid); #endif /* _GPRS_SGSN_H */ diff --git a/openbsc/include/openbsc/gsm_04_08_gprs.h b/openbsc/include/openbsc/gsm_04_08_gprs.h index afc5abc93..7f9aa76e1 100644 --- a/openbsc/include/openbsc/gsm_04_08_gprs.h +++ b/openbsc/include/openbsc/gsm_04_08_gprs.h @@ -1,6 +1,8 @@ #ifndef _GSM48_GPRS_H #define _GSM48_GPRS_H +#include <stdint.h> + /* Table 10.4 / 10.4a, GPRS Mobility Management (GMM) */ #define GSM48_MT_GMM_ATTACH_REQ 0x01 #define GSM48_MT_GMM_ATTACH_ACK 0x02 @@ -74,11 +76,11 @@ enum gsm48_gprs_ie_sm { /* Chapter 9.4.15 / Table 9.4.15 */ struct gsm48_ra_upd_ack { - u_int8_t force_stby:4, /* 10.5.5.7 */ + uint8_t force_stby:4, /* 10.5.5.7 */ upd_result:4; /* 10.5.5.17 */ - u_int8_t ra_upd_timer; /* 10.5.7.3 */ + uint8_t ra_upd_timer; /* 10.5.7.3 */ struct gsm48_ra_id ra_id; /* 10.5.5.15 */ - u_int8_t data[0]; + uint8_t data[0]; } __attribute__((packed)); /* Chapter 10.5.7.3 */ @@ -91,29 +93,29 @@ enum gsm48_gprs_tmr_unit { /* Chapter 9.4.2 / Table 9.4.2 */ struct gsm48_attach_ack { - u_int8_t att_result:4, /* 10.5.5.7 */ + uint8_t att_result:4, /* 10.5.5.7 */ force_stby:4; /* 10.5.5.1 */ - u_int8_t ra_upd_timer; /* 10.5.7.3 */ - u_int8_t radio_prio; /* 10.5.7.2 */ + uint8_t ra_upd_timer; /* 10.5.7.3 */ + uint8_t radio_prio; /* 10.5.7.2 */ struct gsm48_ra_id ra_id; /* 10.5.5.15 */ - u_int8_t data[0]; + uint8_t data[0]; } __attribute__((packed)); /* Chapter 9.5.1 / Table 9.5.1 */ struct gsm48_act_pdp_ctx_req { - u_int8_t req_nsapi; - u_int8_t req_llc_sapi; - u_int8_t req_qos_lv[4]; - u_int8_t data[0]; + uint8_t req_nsapi; + uint8_t req_llc_sapi; + uint8_t req_qos_lv[4]; + uint8_t data[0]; } __attribute__((packed)); /* Chapter 9.5.2 / Table 9.5.2 */ struct gsm48_act_pdp_ctx_ack { - u_int8_t llc_sapi; - u_int8_t qos_lv[4]; - u_int8_t radio_prio:4, + uint8_t llc_sapi; + uint8_t qos_lv[4]; + uint8_t radio_prio:4, spare:4; - u_int8_t data[0]; + uint8_t data[0]; } __attribute__((packed)); /* Chapter 10.5.5.14 / Table 10.5.147 */ @@ -179,9 +181,9 @@ enum gsm48_pdp_state { PDP_S_MODIFY_PENDING, }; -int gprs_tlli_type(u_int32_t tlli); +int gprs_tlli_type(uint32_t tlli); struct gsm_bts *gsm48_bts_by_ra_id(struct gsm_network *net, - const u_int8_t *buf, unsigned int len); + const uint8_t *buf, unsigned int len); #endif /* _GSM48_GPRS_H */ |