misc: Move from u_int to uint types of stdint.h

This was done with sed on the files.
This commit is contained in:
Holger Hans Peter Freyther 2011-04-18 17:04:00 +02:00
parent 5cde92cb0e
commit c42ad8b686
73 changed files with 960 additions and 958 deletions

View File

@ -52,10 +52,10 @@ int abis_link_event(int event, void *data);
signal some event (such as layer 1 connect/disconnect) from the signal some event (such as layer 1 connect/disconnect) from the
input core to the stack. input core to the stack.
int subch_demux_in(mx, const u_int8_t *data, int len); int subch_demux_in(mx, const uint8_t *data, int len);
receive 'len' bytes from a given E1 timeslot (TRAU frames) receive 'len' bytes from a given E1 timeslot (TRAU frames)
int subchan_mux_out(mx, u_int8_t *data, int len); int subchan_mux_out(mx, uint8_t *data, int len);
obtain 'len' bytes of output data to be sent on E1 timeslot obtain 'len' bytes of output data to be sent on E1 timeslot
Intrface by Input Core for Input Plugins Intrface by Input Core for Input Plugins
@ -112,8 +112,8 @@ struct e1inp_sign_link {
struct llist_head tx_list; struct llist_head tx_list;
/* SAPI and TEI on the E1 TS */ /* SAPI and TEI on the E1 TS */
u_int8_t sapi; uint8_t sapi;
u_int8_t tei; uint8_t tei;
} }
enum e1inp_ts_type { enum e1inp_ts_type {
@ -160,7 +160,7 @@ int e1inp_update_ts(struct e1inp_ts *ts);
/* Receive a packet from the E1 driver */ /* Receive a packet from the E1 driver */
int e1inp_rx_ts(struct e1inp_ts *ts, struct msgb *msg, int e1inp_rx_ts(struct e1inp_ts *ts, struct msgb *msg,
u_int8_t tei, u_int8_t sapi); uint8_t tei, uint8_t sapi);
/* Send a packet, callback function in the driver */ /* Send a packet, callback function in the driver */
int e1driver_tx_ts(struct e1inp_ts *ts, struct msgb *msg) int e1driver_tx_ts(struct e1inp_ts *ts, struct msgb *msg)

View File

@ -12,7 +12,7 @@ specific parameters from channel assignment:
hopping sequence generation (6.2.3): hopping sequence generation (6.2.3):
u_int8_t rntable[114] = { uint8_t rntable[114] = {
48, 98, 63, 1, 36, 95, 78, 102, 94, 73, 48, 98, 63, 1, 36, 95, 78, 102, 94, 73,
0, 64, 25, 81, 76, 59, 124, 23, 104, 100, 0, 64, 25, 81, 76, 59, 124, 23, 104, 100,
101, 47, 118, 85, 18, 56, 96, 86, 54, 2, 101, 47, 118, 85, 18, 56, 96, 86, 54, 2,
@ -29,15 +29,15 @@ u_int8_t rntable[114] = {
/* mai=0 represents lowest ARFCN in the MA */ /* mai=0 represents lowest ARFCN in the MA */
u_int8_t hopping_mai(u_int8_t hsn, u_int32_t fn, u_int8_t maio, uint8_t hopping_mai(uint8_t hsn, uint32_t fn, uint8_t maio,
u_int8_t t1, u_int8_t t2, u_int8_t t3_) uint8_t t1, uint8_t t2, uint8_t t3_)
{ {
u_int8_t mai; uint8_t mai;
if (hsn == 0) /* cyclic hopping */ if (hsn == 0) /* cyclic hopping */
mai = (fn + maio) % n; mai = (fn + maio) % n;
else { else {
u_int32_t m, m_, t_, s; uint32_t m, m_, t_, s;
m = t2 + rntable[(hsn xor (t1 % 64)) + t3]; m = t2 + rntable[(hsn xor (t1 % 64)) + t3];
m_ = m % (2^NBIN); m_ = m % (2^NBIN);

View File

@ -27,10 +27,10 @@
#include <osmocom/gsm/protocol/gsm_12_21.h> #include <osmocom/gsm/protocol/gsm_12_21.h>
struct cell_global_id { struct cell_global_id {
u_int16_t mcc; uint16_t mcc;
u_int16_t mnc; uint16_t mnc;
u_int16_t lac; uint16_t lac;
u_int16_t ci; uint16_t ci;
}; };
/* The BCCH info from an ip.access test, in host byte order /* The BCCH info from an ip.access test, in host byte order
@ -38,20 +38,20 @@ struct cell_global_id {
struct ipac_bcch_info { struct ipac_bcch_info {
struct llist_head list; struct llist_head list;
u_int16_t info_type; uint16_t info_type;
u_int8_t freq_qual; uint8_t freq_qual;
u_int16_t arfcn; uint16_t arfcn;
u_int8_t rx_lev; uint8_t rx_lev;
u_int8_t rx_qual; uint8_t rx_qual;
int16_t freq_err; int16_t freq_err;
u_int16_t frame_offset; uint16_t frame_offset;
u_int32_t frame_nr_offset; uint32_t frame_nr_offset;
u_int8_t bsic; uint8_t bsic;
struct cell_global_id cgi; struct cell_global_id cgi;
u_int8_t ba_list_si2[16]; uint8_t ba_list_si2[16];
u_int8_t ba_list_si2bis[16]; uint8_t ba_list_si2bis[16];
u_int8_t ba_list_si2ter[16]; uint8_t ba_list_si2ter[16];
u_int8_t ca_list_si1[16]; uint8_t ca_list_si1[16];
}; };
extern const struct value_string abis_nm_adm_state_names[]; extern const struct value_string abis_nm_adm_state_names[];
@ -72,40 +72,40 @@ struct abis_nm_cfg {
extern int abis_nm_rcvmsg(struct msgb *msg); extern int abis_nm_rcvmsg(struct msgb *msg);
int abis_nm_tlv_parse(struct tlv_parsed *tp, struct gsm_bts *bts, const u_int8_t *buf, int len); int abis_nm_tlv_parse(struct tlv_parsed *tp, struct gsm_bts *bts, const uint8_t *buf, int len);
int abis_nm_rx(struct msgb *msg); int abis_nm_rx(struct msgb *msg);
int abis_nm_opstart(struct gsm_bts *bts, u_int8_t obj_class, u_int8_t i0, u_int8_t i1, u_int8_t i2); int abis_nm_opstart(struct gsm_bts *bts, uint8_t obj_class, uint8_t i0, uint8_t i1, uint8_t i2);
int abis_nm_chg_adm_state(struct gsm_bts *bts, u_int8_t obj_class, u_int8_t i0, int abis_nm_chg_adm_state(struct gsm_bts *bts, uint8_t obj_class, uint8_t i0,
u_int8_t i1, u_int8_t i2, enum abis_nm_adm_state adm_state); uint8_t i1, uint8_t i2, enum abis_nm_adm_state adm_state);
int abis_nm_establish_tei(struct gsm_bts *bts, u_int8_t trx_nr, int abis_nm_establish_tei(struct gsm_bts *bts, uint8_t trx_nr,
u_int8_t e1_port, u_int8_t e1_timeslot, u_int8_t e1_subslot, uint8_t e1_port, uint8_t e1_timeslot, uint8_t e1_subslot,
u_int8_t tei); uint8_t tei);
int abis_nm_conn_terr_sign(struct gsm_bts_trx *trx, int abis_nm_conn_terr_sign(struct gsm_bts_trx *trx,
u_int8_t e1_port, u_int8_t e1_timeslot, u_int8_t e1_subslot); uint8_t e1_port, uint8_t e1_timeslot, uint8_t e1_subslot);
int abis_nm_conn_terr_traf(struct gsm_bts_trx_ts *ts, int abis_nm_conn_terr_traf(struct gsm_bts_trx_ts *ts,
u_int8_t e1_port, u_int8_t e1_timeslot, uint8_t e1_port, uint8_t e1_timeslot,
u_int8_t e1_subslot); uint8_t e1_subslot);
int abis_nm_set_bts_attr(struct gsm_bts *bts, u_int8_t *attr, int attr_len); int abis_nm_set_bts_attr(struct gsm_bts *bts, uint8_t *attr, int attr_len);
int abis_nm_set_radio_attr(struct gsm_bts_trx *trx, u_int8_t *attr, int attr_len); int abis_nm_set_radio_attr(struct gsm_bts_trx *trx, uint8_t *attr, int attr_len);
int abis_nm_set_channel_attr(struct gsm_bts_trx_ts *ts, u_int8_t chan_comb); int abis_nm_set_channel_attr(struct gsm_bts_trx_ts *ts, uint8_t chan_comb);
int abis_nm_sw_act_req_ack(struct gsm_bts *bts, u_int8_t obj_class, u_int8_t i1, int abis_nm_sw_act_req_ack(struct gsm_bts *bts, uint8_t obj_class, uint8_t i1,
u_int8_t i2, u_int8_t i3, int nack, u_int8_t *attr, int att_len); uint8_t i2, uint8_t i3, int nack, uint8_t *attr, int att_len);
int abis_nm_raw_msg(struct gsm_bts *bts, int len, u_int8_t *msg); int abis_nm_raw_msg(struct gsm_bts *bts, int len, uint8_t *msg);
int abis_nm_event_reports(struct gsm_bts *bts, int on); int abis_nm_event_reports(struct gsm_bts *bts, int on);
int abis_nm_reset_resource(struct gsm_bts *bts); int abis_nm_reset_resource(struct gsm_bts *bts);
int abis_nm_software_load(struct gsm_bts *bts, int trx_nr, const char *fname, int abis_nm_software_load(struct gsm_bts *bts, int trx_nr, const char *fname,
u_int8_t win_size, int forced, uint8_t win_size, int forced,
gsm_cbfn *cbfn, void *cb_data); gsm_cbfn *cbfn, void *cb_data);
int abis_nm_software_load_status(struct gsm_bts *bts); int abis_nm_software_load_status(struct gsm_bts *bts);
int abis_nm_software_activate(struct gsm_bts *bts, const char *fname, int abis_nm_software_activate(struct gsm_bts *bts, const char *fname,
gsm_cbfn *cbfn, void *cb_data); gsm_cbfn *cbfn, void *cb_data);
int abis_nm_conn_mdrop_link(struct gsm_bts *bts, u_int8_t e1_port0, u_int8_t ts0, int abis_nm_conn_mdrop_link(struct gsm_bts *bts, uint8_t e1_port0, uint8_t ts0,
u_int8_t e1_port1, u_int8_t ts1); uint8_t e1_port1, uint8_t ts1);
int abis_nm_perform_test(struct gsm_bts *bts, u_int8_t obj_class, int abis_nm_perform_test(struct gsm_bts *bts, uint8_t obj_class,
u_int8_t bts_nr, u_int8_t trx_nr, u_int8_t ts_nr, uint8_t bts_nr, uint8_t trx_nr, uint8_t ts_nr,
u_int8_t test_nr, u_int8_t auton_report, struct msgb *msg); uint8_t test_nr, uint8_t auton_report, struct msgb *msg);
int abis_nm_chcomb4pchan(enum gsm_phys_chan_config pchan); int abis_nm_chcomb4pchan(enum gsm_phys_chan_config pchan);
@ -113,19 +113,19 @@ int abis_nm_chcomb4pchan(enum gsm_phys_chan_config pchan);
int abis_nm_bs11_reset_resource(struct gsm_bts *bts); int abis_nm_bs11_reset_resource(struct gsm_bts *bts);
int abis_nm_bs11_db_transmission(struct gsm_bts *bts, int begin); int abis_nm_bs11_db_transmission(struct gsm_bts *bts, int begin);
int abis_nm_bs11_create_object(struct gsm_bts *bts, enum abis_bs11_objtype type, int abis_nm_bs11_create_object(struct gsm_bts *bts, enum abis_bs11_objtype type,
u_int8_t idx, u_int8_t attr_len, const u_int8_t *attr); uint8_t idx, uint8_t attr_len, const uint8_t *attr);
int abis_nm_bs11_create_envaBTSE(struct gsm_bts *bts, u_int8_t idx); int abis_nm_bs11_create_envaBTSE(struct gsm_bts *bts, uint8_t idx);
int abis_nm_bs11_create_bport(struct gsm_bts *bts, u_int8_t idx); int abis_nm_bs11_create_bport(struct gsm_bts *bts, uint8_t idx);
int abis_nm_bs11_delete_object(struct gsm_bts *bts, int abis_nm_bs11_delete_object(struct gsm_bts *bts,
enum abis_bs11_objtype type, u_int8_t idx); enum abis_bs11_objtype type, uint8_t idx);
int abis_nm_bs11_delete_bport(struct gsm_bts *bts, u_int8_t idx); int abis_nm_bs11_delete_bport(struct gsm_bts *bts, uint8_t idx);
int abis_nm_bs11_conn_oml_tei(struct gsm_bts *bts, u_int8_t e1_port, int abis_nm_bs11_conn_oml_tei(struct gsm_bts *bts, uint8_t e1_port,
u_int8_t e1_timeslot, u_int8_t e1_subslot, u_int8_t tei); uint8_t e1_timeslot, uint8_t e1_subslot, uint8_t tei);
int abis_nm_bs11_get_oml_tei_ts(struct gsm_bts *bts); int abis_nm_bs11_get_oml_tei_ts(struct gsm_bts *bts);
int abis_nm_bs11_get_serno(struct gsm_bts *bts); int abis_nm_bs11_get_serno(struct gsm_bts *bts);
int abis_nm_bs11_set_trx_power(struct gsm_bts_trx *trx, u_int8_t level); int abis_nm_bs11_set_trx_power(struct gsm_bts_trx *trx, uint8_t level);
int abis_nm_bs11_get_trx_power(struct gsm_bts_trx *trx); int abis_nm_bs11_get_trx_power(struct gsm_bts_trx *trx);
int abis_nm_bs11_logon(struct gsm_bts *bts, u_int8_t level, const char *name, int on); int abis_nm_bs11_logon(struct gsm_bts *bts, uint8_t level, const char *name, int on);
int abis_nm_bs11_factory_logon(struct gsm_bts *bts, int on); int abis_nm_bs11_factory_logon(struct gsm_bts *bts, int on);
int abis_nm_bs11_infield_logon(struct gsm_bts *bts, int on); int abis_nm_bs11_infield_logon(struct gsm_bts *bts, int on);
int abis_nm_bs11_set_trx1_pw(struct gsm_bts *bts, const char *password); int abis_nm_bs11_set_trx1_pw(struct gsm_bts *bts, const char *password);
@ -135,33 +135,33 @@ int abis_nm_bs11_set_pll(struct gsm_bts *bts, int value);
int abis_nm_bs11_get_cclk(struct gsm_bts *bts); int abis_nm_bs11_get_cclk(struct gsm_bts *bts);
int abis_nm_bs11_get_state(struct gsm_bts *bts); int abis_nm_bs11_get_state(struct gsm_bts *bts);
int abis_nm_bs11_load_swl(struct gsm_bts *bts, const char *fname, int abis_nm_bs11_load_swl(struct gsm_bts *bts, const char *fname,
u_int8_t win_size, int forced, gsm_cbfn *cbfn); uint8_t win_size, int forced, gsm_cbfn *cbfn);
int abis_nm_bs11_set_ext_time(struct gsm_bts *bts); int abis_nm_bs11_set_ext_time(struct gsm_bts *bts);
int abis_nm_bs11_get_bport_line_cfg(struct gsm_bts *bts, u_int8_t bport); int abis_nm_bs11_get_bport_line_cfg(struct gsm_bts *bts, uint8_t bport);
int abis_nm_bs11_set_bport_line_cfg(struct gsm_bts *bts, u_int8_t bport, enum abis_bs11_line_cfg line_cfg); int abis_nm_bs11_set_bport_line_cfg(struct gsm_bts *bts, uint8_t bport, enum abis_bs11_line_cfg line_cfg);
int abis_nm_bs11_bsc_disconnect(struct gsm_bts *bts, int reconnect); int abis_nm_bs11_bsc_disconnect(struct gsm_bts *bts, int reconnect);
int abis_nm_bs11_restart(struct gsm_bts *bts); int abis_nm_bs11_restart(struct gsm_bts *bts);
/* ip.access nanoBTS specific commands */ /* ip.access nanoBTS specific commands */
int abis_nm_ipaccess_msg(struct gsm_bts *bts, u_int8_t msg_type, int abis_nm_ipaccess_msg(struct gsm_bts *bts, uint8_t msg_type,
u_int8_t obj_class, u_int8_t bts_nr, uint8_t obj_class, uint8_t bts_nr,
u_int8_t trx_nr, u_int8_t ts_nr, uint8_t trx_nr, uint8_t ts_nr,
u_int8_t *attr, int attr_len); uint8_t *attr, int attr_len);
int abis_nm_ipaccess_set_nvattr(struct gsm_bts_trx *trx, u_int8_t *attr, int abis_nm_ipaccess_set_nvattr(struct gsm_bts_trx *trx, uint8_t *attr,
int attr_len); int attr_len);
int abis_nm_ipaccess_restart(struct gsm_bts_trx *trx); int abis_nm_ipaccess_restart(struct gsm_bts_trx *trx);
int abis_nm_ipaccess_set_attr(struct gsm_bts *bts, u_int8_t obj_class, int abis_nm_ipaccess_set_attr(struct gsm_bts *bts, uint8_t obj_class,
u_int8_t bts_nr, u_int8_t trx_nr, u_int8_t ts_nr, uint8_t bts_nr, uint8_t trx_nr, uint8_t ts_nr,
u_int8_t *attr, u_int8_t attr_len); uint8_t *attr, uint8_t attr_len);
int abis_nm_ipaccess_rsl_connect(struct gsm_bts_trx *trx, int abis_nm_ipaccess_rsl_connect(struct gsm_bts_trx *trx,
u_int32_t ip, u_int16_t port, u_int8_t stream); uint32_t ip, uint16_t port, uint8_t stream);
void abis_nm_ipaccess_cgi(u_int8_t *buf, struct gsm_bts *bts); void abis_nm_ipaccess_cgi(uint8_t *buf, struct gsm_bts *bts);
int ipac_parse_bcch_info(struct ipac_bcch_info *binf, u_int8_t *buf); int ipac_parse_bcch_info(struct ipac_bcch_info *binf, uint8_t *buf);
const char *ipacc_testres_name(u_int8_t res); const char *ipacc_testres_name(uint8_t res);
/* Functions calling into other code parts */ /* Functions calling into other code parts */
const char *nm_opstate_name(u_int8_t os); const char *nm_opstate_name(uint8_t os);
const char *nm_avail_name(u_int8_t avail); const char *nm_avail_name(uint8_t avail);
int nm_is_running(struct gsm_nm_state *s); int nm_is_running(struct gsm_nm_state *s);
int abis_nm_vty_init(void); int abis_nm_vty_init(void);

View File

@ -32,61 +32,61 @@ struct gsm_subscriber;
struct gsm_bts_trx_ts; struct gsm_bts_trx_ts;
int rsl_bcch_info(struct gsm_bts_trx *trx, u_int8_t type, int rsl_bcch_info(struct gsm_bts_trx *trx, uint8_t type,
const u_int8_t *data, int len); const uint8_t *data, int len);
int rsl_sacch_filling(struct gsm_bts_trx *trx, u_int8_t type, int rsl_sacch_filling(struct gsm_bts_trx *trx, uint8_t type,
const u_int8_t *data, int len); const uint8_t *data, int len);
int rsl_chan_activate(struct gsm_bts_trx *trx, u_int8_t chan_nr, int rsl_chan_activate(struct gsm_bts_trx *trx, uint8_t chan_nr,
u_int8_t act_type, uint8_t act_type,
struct rsl_ie_chan_mode *chan_mode, struct rsl_ie_chan_mode *chan_mode,
struct rsl_ie_chan_ident *chan_ident, struct rsl_ie_chan_ident *chan_ident,
u_int8_t bs_power, u_int8_t ms_power, uint8_t bs_power, uint8_t ms_power,
u_int8_t ta); uint8_t ta);
int rsl_chan_activate_lchan(struct gsm_lchan *lchan, u_int8_t act_type, int rsl_chan_activate_lchan(struct gsm_lchan *lchan, uint8_t act_type,
u_int8_t ta, u_int8_t ho_ref); uint8_t ta, uint8_t ho_ref);
int rsl_chan_mode_modify_req(struct gsm_lchan *ts); int rsl_chan_mode_modify_req(struct gsm_lchan *ts);
int rsl_encryption_cmd(struct msgb *msg); int rsl_encryption_cmd(struct msgb *msg);
int rsl_paging_cmd(struct gsm_bts *bts, u_int8_t paging_group, u_int8_t len, int rsl_paging_cmd(struct gsm_bts *bts, uint8_t paging_group, uint8_t len,
u_int8_t *ms_ident, u_int8_t chan_needed); uint8_t *ms_ident, uint8_t chan_needed);
int rsl_imm_assign_cmd(struct gsm_bts *bts, u_int8_t len, u_int8_t *val); int rsl_imm_assign_cmd(struct gsm_bts *bts, uint8_t len, uint8_t *val);
int rsl_data_request(struct msgb *msg, u_int8_t link_id); int rsl_data_request(struct msgb *msg, uint8_t link_id);
int rsl_establish_request(struct gsm_lchan *lchan, u_int8_t link_id); int rsl_establish_request(struct gsm_lchan *lchan, uint8_t link_id);
int rsl_relase_request(struct gsm_lchan *lchan, u_int8_t link_id); int rsl_relase_request(struct gsm_lchan *lchan, uint8_t link_id);
/* Siemens vendor-specific RSL extensions */ /* Siemens vendor-specific RSL extensions */
int rsl_siemens_mrpci(struct gsm_lchan *lchan, struct rsl_mrpci *mrpci); int rsl_siemens_mrpci(struct gsm_lchan *lchan, struct rsl_mrpci *mrpci);
/* ip.access specfic RSL extensions */ /* ip.access specfic RSL extensions */
int rsl_ipacc_crcx(struct gsm_lchan *lchan); int rsl_ipacc_crcx(struct gsm_lchan *lchan);
int rsl_ipacc_mdcx(struct gsm_lchan *lchan, u_int32_t ip, int rsl_ipacc_mdcx(struct gsm_lchan *lchan, uint32_t ip,
u_int16_t port, u_int8_t rtp_payload2); uint16_t port, uint8_t rtp_payload2);
int rsl_ipacc_mdcx_to_rtpsock(struct gsm_lchan *lchan); int rsl_ipacc_mdcx_to_rtpsock(struct gsm_lchan *lchan);
int rsl_ipacc_pdch_activate(struct gsm_bts_trx_ts *ts, int act); int rsl_ipacc_pdch_activate(struct gsm_bts_trx_ts *ts, int act);
int abis_rsl_rcvmsg(struct msgb *msg); int abis_rsl_rcvmsg(struct msgb *msg);
unsigned int get_paging_group(u_int64_t imsi, unsigned int bs_cc_chans, unsigned int get_paging_group(uint64_t imsi, unsigned int bs_cc_chans,
int n_pag_blocks); int n_pag_blocks);
unsigned int n_pag_blocks(int bs_ccch_sdcch_comb, unsigned int bs_ag_blks_res); unsigned int n_pag_blocks(int bs_ccch_sdcch_comb, unsigned int bs_ag_blks_res);
u_int64_t str_to_imsi(const char *imsi_str); uint64_t str_to_imsi(const char *imsi_str);
u_int8_t lchan2chan_nr(const struct gsm_lchan *lchan); uint8_t lchan2chan_nr(const struct gsm_lchan *lchan);
int rsl_release_request(struct gsm_lchan *lchan, u_int8_t link_id, u_int8_t reason); int rsl_release_request(struct gsm_lchan *lchan, uint8_t link_id, uint8_t reason);
int rsl_lchan_set_state(struct gsm_lchan *lchan, int); int rsl_lchan_set_state(struct gsm_lchan *lchan, int);
/* to be provided by external code */ /* to be provided by external code */
int abis_rsl_sendmsg(struct msgb *msg); int abis_rsl_sendmsg(struct msgb *msg);
int rsl_deact_sacch(struct gsm_lchan *lchan); int rsl_deact_sacch(struct gsm_lchan *lchan);
int rsl_lchan_rll_release(struct gsm_lchan *lchan, u_int8_t link_id); int rsl_lchan_rll_release(struct gsm_lchan *lchan, uint8_t link_id);
/* BCCH related code */ /* BCCH related code */
int rsl_ccch_conf_to_bs_cc_chans(int ccch_conf); int rsl_ccch_conf_to_bs_cc_chans(int ccch_conf);
int rsl_ccch_conf_to_bs_ccch_sdcch_comb(int ccch_conf); int rsl_ccch_conf_to_bs_ccch_sdcch_comb(int ccch_conf);
int rsl_number_of_paging_subchannels(struct gsm_bts *bts); int rsl_number_of_paging_subchannels(struct gsm_bts *bts);
int rsl_sacch_info_modify(struct gsm_lchan *lchan, u_int8_t type, int rsl_sacch_info_modify(struct gsm_lchan *lchan, uint8_t type,
const u_int8_t *data, int len); const uint8_t *data, int len);
int rsl_chan_bs_power_ctrl(struct gsm_lchan *lchan, unsigned int fpc, int db); int rsl_chan_bs_power_ctrl(struct gsm_lchan *lchan, unsigned int fpc, int db);
int rsl_chan_ms_power_ctrl(struct gsm_lchan *lchan, unsigned int fpc, int dbm); int rsl_chan_ms_power_ctrl(struct gsm_lchan *lchan, unsigned int fpc, int dbm);

View File

@ -10,10 +10,10 @@ enum bsc_rllr_ind {
BSC_RLLR_IND_TIMEOUT, BSC_RLLR_IND_TIMEOUT,
}; };
int rll_establish(struct gsm_lchan *lchan, u_int8_t link_id, int rll_establish(struct gsm_lchan *lchan, uint8_t link_id,
void (*cb)(struct gsm_lchan *, u_int8_t, void *, void (*cb)(struct gsm_lchan *, uint8_t, void *,
enum bsc_rllr_ind), enum bsc_rllr_ind),
void *data); void *data);
void rll_indication(struct gsm_lchan *lchan, u_int8_t link_id, u_int8_t type); void rll_indication(struct gsm_lchan *lchan, uint8_t link_id, uint8_t type);
#endif /* _BSC_RLL_H */ #endif /* _BSC_RLL_H */

View File

@ -3,6 +3,6 @@
#define INIT_CRC24 0xffffff #define INIT_CRC24 0xffffff
u_int32_t crc24_calc(u_int32_t fcs, u_int8_t *cp, unsigned int len); uint32_t crc24_calc(uint32_t fcs, uint8_t *cp, unsigned int len);
#endif #endif

View File

@ -44,7 +44,7 @@ struct gsm_subscriber *db_get_subscriber(struct gsm_network *net,
int db_sync_subscriber(struct gsm_subscriber *subscriber); int db_sync_subscriber(struct gsm_subscriber *subscriber);
int db_subscriber_alloc_tmsi(struct gsm_subscriber *subscriber); int db_subscriber_alloc_tmsi(struct gsm_subscriber *subscriber);
int db_subscriber_alloc_exten(struct gsm_subscriber *subscriber); int db_subscriber_alloc_exten(struct gsm_subscriber *subscriber);
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);
int db_subscriber_assoc_imei(struct gsm_subscriber *subscriber, char *imei); int db_subscriber_assoc_imei(struct gsm_subscriber *subscriber, char *imei);
int db_sync_equipment(struct gsm_equipment *equip); int db_sync_equipment(struct gsm_equipment *equip);
int db_subscriber_update(struct gsm_subscriber *subscriber); int db_subscriber_update(struct gsm_subscriber *subscriber);
@ -70,8 +70,8 @@ int db_sms_inc_deliver_attempts(struct gsm_sms *sms);
/* APDU blob storage */ /* APDU blob storage */
int db_apdu_blob_store(struct gsm_subscriber *subscr, int db_apdu_blob_store(struct gsm_subscriber *subscr,
u_int8_t apdu_id_flags, u_int8_t len, uint8_t apdu_id_flags, uint8_t len,
u_int8_t *apdu); uint8_t *apdu);
/* Statistics counter storage */ /* Statistics counter storage */
struct counter; struct counter;

View File

@ -37,12 +37,12 @@ struct e1inp_sign_link {
struct llist_head tx_list; struct llist_head tx_list;
/* SAPI and TEI on the E1 TS */ /* SAPI and TEI on the E1 TS */
u_int8_t sapi; uint8_t sapi;
u_int8_t tei; uint8_t tei;
union { union {
struct { struct {
u_int8_t channel; uint8_t channel;
} misdn; } misdn;
} driver; } driver;
}; };
@ -125,21 +125,21 @@ struct e1inp_driver *e1inp_driver_find(const char *name);
int e1inp_line_register(struct e1inp_line *line); int e1inp_line_register(struct e1inp_line *line);
/* get a line by its ID */ /* get a line by its ID */
struct e1inp_line *e1inp_line_get(u_int8_t e1_nr); struct e1inp_line *e1inp_line_get(uint8_t e1_nr);
/* create a line in the E1 input core */ /* create a line in the E1 input core */
struct e1inp_line *e1inp_line_create(u_int8_t e1_nr, const char *driver_name); struct e1inp_line *e1inp_line_create(uint8_t e1_nr, const char *driver_name);
/* find a sign_link for given TEI and SAPI in a TS */ /* find a sign_link for given TEI and SAPI in a TS */
struct e1inp_sign_link * struct e1inp_sign_link *
e1inp_lookup_sign_link(struct e1inp_ts *ts, u_int8_t tei, e1inp_lookup_sign_link(struct e1inp_ts *ts, uint8_t tei,
u_int8_t sapi); uint8_t sapi);
/* create a new signalling link in a E1 timeslot */ /* create a new signalling link in a E1 timeslot */
struct e1inp_sign_link * struct e1inp_sign_link *
e1inp_sign_link_create(struct e1inp_ts *ts, enum e1inp_sign_type type, e1inp_sign_link_create(struct e1inp_ts *ts, enum e1inp_sign_type type,
struct gsm_bts_trx *trx, u_int8_t tei, struct gsm_bts_trx *trx, uint8_t tei,
u_int8_t sapi); uint8_t sapi);
/* configure and initialize one e1inp_ts */ /* configure and initialize one e1inp_ts */
int e1inp_ts_config(struct e1inp_ts *ts, struct e1inp_line *line, int e1inp_ts_config(struct e1inp_ts *ts, struct e1inp_line *line,
@ -150,20 +150,20 @@ int e1inp_update_ts(struct e1inp_ts *ts);
/* Receive a packet from the E1 driver */ /* Receive a packet from the E1 driver */
int e1inp_rx_ts(struct e1inp_ts *ts, struct msgb *msg, int e1inp_rx_ts(struct e1inp_ts *ts, struct msgb *msg,
u_int8_t tei, u_int8_t sapi); uint8_t tei, uint8_t sapi);
/* called by driver if it wants to transmit on a given TS */ /* called by driver if it wants to transmit on a given TS */
struct msgb *e1inp_tx_ts(struct e1inp_ts *e1i_ts, struct msgb *e1inp_tx_ts(struct e1inp_ts *e1i_ts,
struct e1inp_sign_link **sign_link); struct e1inp_sign_link **sign_link);
/* called by driver in case some kind of link state event */ /* called by driver in case some kind of link state event */
int e1inp_event(struct e1inp_ts *ts, int evt, u_int8_t tei, u_int8_t sapi); int e1inp_event(struct e1inp_ts *ts, int evt, uint8_t tei, uint8_t sapi);
/* Write LAPD frames to the fd. */ /* Write LAPD frames to the fd. */
void e1_set_pcap_fd(int fd); void e1_set_pcap_fd(int fd);
/* called by TRAU muxer to obtain the destination mux entity */ /* called by TRAU muxer to obtain the destination mux entity */
struct subch_mux *e1inp_get_mux(u_int8_t e1_nr, u_int8_t ts_nr); struct subch_mux *e1inp_get_mux(uint8_t e1_nr, uint8_t ts_nr);
void e1inp_sign_link_destroy(struct e1inp_sign_link *link); void e1inp_sign_link_destroy(struct e1inp_sign_link *link);
int e1inp_line_update(struct e1inp_line *line); int e1inp_line_update(struct e1inp_line *line);

View File

@ -10,7 +10,7 @@
struct gbproxy_config { struct gbproxy_config {
/* parsed from config file */ /* parsed from config file */
u_int16_t nsip_sgsn_nsei; uint16_t nsip_sgsn_nsei;
/* misc */ /* misc */
struct gprs_ns_inst *nsi; struct gprs_ns_inst *nsi;

View File

@ -28,37 +28,37 @@ void gsm0408_clear_request(struct gsm_subscriber_connection *conn, uint32_t caus
void gsm0408_clear_all_trans(struct gsm_network *net, int protocol); void gsm0408_clear_all_trans(struct gsm_network *net, int protocol);
int gsm0408_dispatch(struct gsm_subscriber_connection *conn, struct msgb *msg); int gsm0408_dispatch(struct gsm_subscriber_connection *conn, struct msgb *msg);
int gsm0408_rcvmsg(struct msgb *msg, u_int8_t link_id); int gsm0408_rcvmsg(struct msgb *msg, uint8_t link_id);
int gsm0408_new_conn(struct gsm_subscriber_connection *conn); int gsm0408_new_conn(struct gsm_subscriber_connection *conn);
enum gsm_chan_t get_ctype_by_chreq(struct gsm_network *bts, u_int8_t ra); enum gsm_chan_t get_ctype_by_chreq(struct gsm_network *bts, uint8_t ra);
enum gsm_chreq_reason_t get_reason_by_chreq(u_int8_t ra, int neci); enum gsm_chreq_reason_t get_reason_by_chreq(uint8_t ra, int neci);
void gsm_net_update_ctype(struct gsm_network *net); void gsm_net_update_ctype(struct gsm_network *net);
int gsm48_tx_mm_info(struct gsm_subscriber_connection *conn); int gsm48_tx_mm_info(struct gsm_subscriber_connection *conn);
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);
int gsm48_tx_mm_auth_rej(struct gsm_subscriber_connection *conn); int gsm48_tx_mm_auth_rej(struct gsm_subscriber_connection *conn);
int gsm48_send_rr_release(struct gsm_lchan *lchan); int gsm48_send_rr_release(struct gsm_lchan *lchan);
int gsm48_send_rr_ciph_mode(struct gsm_lchan *lchan, int want_imeisv); int gsm48_send_rr_ciph_mode(struct gsm_lchan *lchan, int want_imeisv);
int gsm48_send_rr_app_info(struct gsm_subscriber_connection *conn, u_int8_t apdu_id, int gsm48_send_rr_app_info(struct gsm_subscriber_connection *conn, uint8_t apdu_id,
u_int8_t apdu_len, const u_int8_t *apdu); uint8_t apdu_len, const uint8_t *apdu);
int gsm48_send_rr_ass_cmd(struct gsm_lchan *dest_lchan, struct gsm_lchan *lchan, u_int8_t power_class); int gsm48_send_rr_ass_cmd(struct gsm_lchan *dest_lchan, struct gsm_lchan *lchan, uint8_t power_class);
int gsm48_send_ho_cmd(struct gsm_lchan *old_lchan, struct gsm_lchan *new_lchan, int gsm48_send_ho_cmd(struct gsm_lchan *old_lchan, struct gsm_lchan *new_lchan,
u_int8_t power_command, u_int8_t ho_ref); uint8_t power_command, uint8_t ho_ref);
int mncc_tx_to_cc(struct gsm_network *net, int msg_type, void *arg); int mncc_tx_to_cc(struct gsm_network *net, int msg_type, void *arg);
/* convert a ASCII phone number to call-control BCD */ /* convert a ASCII phone number to call-control BCD */
int encode_bcd_number(u_int8_t *bcd_lv, u_int8_t max_len, int encode_bcd_number(uint8_t *bcd_lv, uint8_t max_len,
int h_len, const char *input); int h_len, const char *input);
int decode_bcd_number(char *output, int output_len, const u_int8_t *bcd_lv, int decode_bcd_number(char *output, int output_len, const uint8_t *bcd_lv,
int h_len); int h_len);
int send_siemens_mrpci(struct gsm_lchan *lchan, u_int8_t *classmark2_lv); int send_siemens_mrpci(struct gsm_lchan *lchan, uint8_t *classmark2_lv);
int gsm48_extract_mi(uint8_t *classmark2, int length, char *mi_string, uint8_t *mi_type); int gsm48_extract_mi(uint8_t *classmark2, int length, char *mi_string, uint8_t *mi_type);
int gsm48_paging_extract_mi(struct gsm48_pag_resp *pag, int length, char *mi_string, u_int8_t *mi_type); int gsm48_paging_extract_mi(struct gsm48_pag_resp *pag, int length, char *mi_string, uint8_t *mi_type);
int gsm48_handle_paging_resp(struct gsm_subscriber_connection *conn, struct msgb *msg, struct gsm_subscriber *subscr); int gsm48_handle_paging_resp(struct gsm_subscriber_connection *conn, struct msgb *msg, struct gsm_subscriber *subscr);
int gsm48_lchan_modify(struct gsm_lchan *lchan, u_int8_t lchan_mode); int gsm48_lchan_modify(struct gsm_lchan *lchan, uint8_t lchan_mode);
int gsm48_rx_rr_modif_ack(struct msgb *msg); int gsm48_rx_rr_modif_ack(struct msgb *msg);
int gsm48_parse_meas_rep(struct gsm_meas_rep *rep, struct msgb *msg); int gsm48_parse_meas_rep(struct gsm_meas_rep *rep, struct msgb *msg);

View File

@ -7,20 +7,20 @@
/* SMS deliver PDU */ /* SMS deliver PDU */
struct sms_deliver { struct sms_deliver {
u_int8_t mti:2; /* message type indicator */ uint8_t mti:2; /* message type indicator */
u_int8_t mms:1; /* more messages to send */ uint8_t mms:1; /* more messages to send */
u_int8_t rp:1; /* reply path */ uint8_t rp:1; /* reply path */
u_int8_t udhi:1; /* user data header indicator */ uint8_t udhi:1; /* user data header indicator */
u_int8_t sri:1; /* status report indication */ uint8_t sri:1; /* status report indication */
u_int8_t *orig_addr; /* originating address */ uint8_t *orig_addr; /* originating address */
u_int8_t pid; /* protocol identifier */ uint8_t pid; /* protocol identifier */
u_int8_t dcs; /* data coding scheme */ uint8_t dcs; /* data coding scheme */
/* service centre time stamp */ /* service centre time stamp */
u_int8_t ud_len; /* user data length */ uint8_t ud_len; /* user data length */
u_int8_t *user_data; /* user data */ uint8_t *user_data; /* user data */
u_int8_t msg_ref; /* message reference */ uint8_t msg_ref; /* message reference */
u_int8_t *smsc; uint8_t *smsc;
}; };
struct msgb; struct msgb;

View File

@ -104,11 +104,11 @@ struct openbsc_msgb_cb {
unsigned char *bssgp_cell_id; unsigned char *bssgp_cell_id;
/* Identifiers of a BTS, equal to 'struct bssgp_bts_ctx' */ /* Identifiers of a BTS, equal to 'struct bssgp_bts_ctx' */
u_int16_t nsei; uint16_t nsei;
u_int16_t bvci; uint16_t bvci;
/* Identifier of a MS (inside BTS), equal to 'struct sgsn_mm_ctx' */ /* Identifier of a MS (inside BTS), equal to 'struct sgsn_mm_ctx' */
u_int32_t tlli; uint32_t tlli;
} __attribute__((packed)); } __attribute__((packed));
#define OBSC_MSGB_CB(__msgb) ((struct openbsc_msgb_cb *)&((__msgb)->cb[0])) #define OBSC_MSGB_CB(__msgb) ((struct openbsc_msgb_cb *)&((__msgb)->cb[0]))
#define msgb_tlli(__x) OBSC_MSGB_CB(__x)->tlli #define msgb_tlli(__x) OBSC_MSGB_CB(__x)->tlli
@ -144,15 +144,15 @@ enum gsm_auth_algo {
struct gsm_auth_info { struct gsm_auth_info {
enum gsm_auth_algo auth_algo; enum gsm_auth_algo auth_algo;
unsigned int a3a8_ki_len; unsigned int a3a8_ki_len;
u_int8_t a3a8_ki[16]; uint8_t a3a8_ki[16];
}; };
struct gsm_auth_tuple { struct gsm_auth_tuple {
int use_count; int use_count;
int key_seq; int key_seq;
u_int8_t rand[16]; uint8_t rand[16];
u_int8_t sres[4]; uint8_t sres[4];
u_int8_t kc[8]; uint8_t kc[8];
}; };
#define GSM_KEY_SEQ_INVAL 7 /* GSM 04.08 - 10.5.1.2 */ #define GSM_KEY_SEQ_INVAL 7 /* GSM 04.08 - 10.5.1.2 */
@ -165,9 +165,9 @@ struct bsc_api;
/* Network Management State */ /* Network Management State */
struct gsm_nm_state { struct gsm_nm_state {
u_int8_t operational; uint8_t operational;
u_int8_t administrative; uint8_t administrative;
u_int8_t availability; uint8_t availability;
}; };
/* /*
@ -208,11 +208,11 @@ struct gsm_anchor_operation {
/* processed neighbor measurements for one cell */ /* processed neighbor measurements for one cell */
struct neigh_meas_proc { struct neigh_meas_proc {
u_int16_t arfcn; uint16_t arfcn;
u_int8_t bsic; uint8_t bsic;
u_int8_t rxlev[MAX_WIN_NEIGH_AVG]; uint8_t rxlev[MAX_WIN_NEIGH_AVG];
unsigned int rxlev_cnt; unsigned int rxlev_cnt;
u_int8_t last_seen_nr; uint8_t last_seen_nr;
}; };
#define MAX_A5_KEY_LEN (128/8) #define MAX_A5_KEY_LEN (128/8)
@ -273,7 +273,7 @@ struct gsm_lchan {
/* The TS that we're part of */ /* The TS that we're part of */
struct gsm_bts_trx_ts *ts; struct gsm_bts_trx_ts *ts;
/* The logical subslot number in the TS */ /* The logical subslot number in the TS */
u_int8_t nr; uint8_t nr;
/* The logical channel type */ /* The logical channel type */
enum gsm_chan_t type; enum gsm_chan_t type;
/* RSL channel mode */ /* RSL channel mode */
@ -283,13 +283,13 @@ struct gsm_lchan {
/* State */ /* State */
enum gsm_lchan_state state; enum gsm_lchan_state state;
/* Power levels for MS and BTS */ /* Power levels for MS and BTS */
u_int8_t bs_power; uint8_t bs_power;
u_int8_t ms_power; uint8_t ms_power;
/* Encryption information */ /* Encryption information */
struct { struct {
u_int8_t alg_id; uint8_t alg_id;
u_int8_t key_len; uint8_t key_len;
u_int8_t key[MAX_A5_KEY_LEN]; uint8_t key[MAX_A5_KEY_LEN];
} encr; } encr;
struct timer_list T3101; struct timer_list T3101;
@ -300,7 +300,7 @@ struct gsm_lchan {
struct gsm48_multi_rate_conf mr_conf; struct gsm48_multi_rate_conf mr_conf;
/* Established data link layer services */ /* Established data link layer services */
u_int8_t sapis[8]; uint8_t sapis[8];
int sach_deact; int sach_deact;
int release_reason; int release_reason;
@ -316,14 +316,14 @@ struct gsm_lchan {
struct neigh_meas_proc neigh_meas[MAX_NEIGH_MEAS]; struct neigh_meas_proc neigh_meas[MAX_NEIGH_MEAS];
struct { struct {
u_int32_t bound_ip; uint32_t bound_ip;
u_int32_t connect_ip; uint32_t connect_ip;
u_int16_t bound_port; uint16_t bound_port;
u_int16_t connect_port; uint16_t connect_port;
u_int16_t conn_id; uint16_t conn_id;
u_int8_t rtp_payload; uint8_t rtp_payload;
u_int8_t rtp_payload2; uint8_t rtp_payload2;
u_int8_t speech_mode; uint8_t speech_mode;
struct rtp_socket *rtp_socket; struct rtp_socket *rtp_socket;
} abis_ip; } abis_ip;
@ -332,11 +332,11 @@ struct gsm_lchan {
struct gsm_e1_subslot { struct gsm_e1_subslot {
/* Number of E1 link */ /* Number of E1 link */
u_int8_t e1_nr; uint8_t e1_nr;
/* Number of E1 TS inside E1 link */ /* Number of E1 TS inside E1 link */
u_int8_t e1_ts; uint8_t e1_ts;
/* Sub-slot within the E1 TS, 0xff if full TS */ /* Sub-slot within the E1 TS, 0xff if full TS */
u_int8_t e1_ts_ss; uint8_t e1_ts_ss;
}; };
#define TS_F_PDCH_MODE 0x1000 #define TS_F_PDCH_MODE 0x1000
@ -344,26 +344,26 @@ struct gsm_e1_subslot {
struct gsm_bts_trx_ts { struct gsm_bts_trx_ts {
struct gsm_bts_trx *trx; struct gsm_bts_trx *trx;
/* number of this timeslot at the TRX */ /* number of this timeslot at the TRX */
u_int8_t nr; uint8_t nr;
enum gsm_phys_chan_config pchan; enum gsm_phys_chan_config pchan;
unsigned int flags; unsigned int flags;
struct gsm_nm_state nm_state; struct gsm_nm_state nm_state;
struct tlv_parsed nm_attr; struct tlv_parsed nm_attr;
u_int8_t nm_chan_comb; uint8_t nm_chan_comb;
struct { struct {
/* Parameters below are configured by VTY */ /* Parameters below are configured by VTY */
int enabled; int enabled;
u_int8_t maio; uint8_t maio;
u_int8_t hsn; uint8_t hsn;
struct bitvec arfcns; struct bitvec arfcns;
u_int8_t arfcns_data[1024/8]; uint8_t arfcns_data[1024/8];
/* This is the pre-computed MA for channel assignments */ /* This is the pre-computed MA for channel assignments */
struct bitvec ma; struct bitvec ma;
u_int8_t ma_len; /* part of ma_data that is used */ uint8_t ma_len; /* part of ma_data that is used */
u_int8_t ma_data[8]; /* 10.5.2.21: max 8 bytes value part */ uint8_t ma_data[8]; /* 10.5.2.21: max 8 bytes value part */
} hopping; } hopping;
/* To which E1 subslot are we connected */ /* To which E1 subslot are we connected */
@ -379,12 +379,12 @@ struct gsm_bts_trx {
struct gsm_bts *bts; struct gsm_bts *bts;
/* number of this TRX in the BTS */ /* number of this TRX in the BTS */
u_int8_t nr; uint8_t nr;
/* human readable name / description */ /* human readable name / description */
char *description; char *description;
/* how do we talk RSL with this TRX? */ /* how do we talk RSL with this TRX? */
struct gsm_e1_subslot rsl_e1_link; struct gsm_e1_subslot rsl_e1_link;
u_int8_t rsl_tei; uint8_t rsl_tei;
struct e1inp_sign_link *rsl_link; struct e1inp_sign_link *rsl_link;
/* Some BTS (specifically Ericsson RBS) have a per-TRX OML Link */ /* Some BTS (specifically Ericsson RBS) have a per-TRX OML Link */
struct e1inp_sign_link *oml_link; struct e1inp_sign_link *oml_link;
@ -395,7 +395,7 @@ struct gsm_bts_trx {
struct gsm_nm_state nm_state; struct gsm_nm_state nm_state;
} bb_transc; } bb_transc;
u_int16_t arfcn; uint16_t arfcn;
int nominal_power; /* in dBm */ int nominal_power; /* in dBm */
unsigned int max_power_red; /* in actual dB */ unsigned int max_power_red; /* in actual dB */
@ -410,7 +410,7 @@ struct gsm_bts_trx {
} bs11; } bs11;
struct { struct {
unsigned int test_state; unsigned int test_state;
u_int8_t test_nr; uint8_t test_nr;
struct rxlev_stats rxlev_stat; struct rxlev_stats rxlev_stat;
} ipaccess; } ipaccess;
}; };
@ -472,7 +472,7 @@ struct gsm_bts_paging_state {
int free_chans_need; int free_chans_need;
/* load */ /* load */
u_int16_t available_slots; uint16_t available_slots;
}; };
struct gsm_envabtse { struct gsm_envabtse {
@ -484,10 +484,10 @@ struct gsm_bts_gprs_nsvc {
/* data read via VTY config file, to configure the BTS /* data read via VTY config file, to configure the BTS
* via OML from BSC */ * via OML from BSC */
int id; int id;
u_int16_t nsvci; uint16_t nsvci;
u_int16_t local_port; /* on the BTS */ uint16_t local_port; /* on the BTS */
u_int16_t remote_port; /* on the SGSN */ uint16_t remote_port; /* on the SGSN */
u_int32_t remote_ip; /* on the SGSN */ uint32_t remote_ip; /* on the SGSN */
struct gsm_nm_state nm_state; struct gsm_nm_state nm_state;
}; };
@ -505,17 +505,17 @@ struct gsm_bts {
struct gsm_network *network; struct gsm_network *network;
/* number of ths BTS in network */ /* number of ths BTS in network */
u_int8_t nr; uint8_t nr;
/* human readable name / description */ /* human readable name / description */
char *description; char *description;
/* Cell Identity */ /* Cell Identity */
u_int16_t cell_identity; uint16_t cell_identity;
/* location area code of this BTS */ /* location area code of this BTS */
u_int16_t location_area_code; uint16_t location_area_code;
/* Training Sequence Code */ /* Training Sequence Code */
u_int8_t tsc; uint8_t tsc;
/* Base Station Identification Code (BSIC) */ /* Base Station Identification Code (BSIC) */
u_int8_t bsic; uint8_t bsic;
/* type of BTS */ /* type of BTS */
enum gsm_bts_type type; enum gsm_bts_type type;
struct gsm_bts_model *model; struct gsm_bts_model *model;
@ -528,7 +528,7 @@ struct gsm_bts {
/* how do we talk OML with this TRX? */ /* how do we talk OML with this TRX? */
struct gsm_e1_subslot oml_e1_link; struct gsm_e1_subslot oml_e1_link;
u_int8_t oml_tei; uint8_t oml_tei;
struct e1inp_sign_link *oml_link; struct e1inp_sign_link *oml_link;
/* Abis network management O&M handle */ /* Abis network management O&M handle */
@ -537,7 +537,7 @@ struct gsm_bts {
struct tlv_parsed nm_attr; struct tlv_parsed nm_attr;
/* number of this BTS on given E1 link */ /* number of this BTS on given E1 link */
u_int8_t bts_nr; uint8_t bts_nr;
/* paging state and control */ /* paging state and control */
struct gsm_bts_paging_state paging; struct gsm_bts_paging_state paging;
@ -553,7 +553,7 @@ struct gsm_bts {
/* parameters from which we build SYSTEM INFORMATION */ /* parameters from which we build SYSTEM INFORMATION */
struct { struct {
struct gsm48_rach_control rach_control; struct gsm48_rach_control rach_control;
u_int8_t ncc_permitted; uint8_t ncc_permitted;
struct gsm48_cell_sel_par cell_sel_par; struct gsm48_cell_sel_par cell_sel_par;
struct gsm48_si_selection_params cell_ro_sel_par; /* rest octet */ struct gsm48_si_selection_params cell_ro_sel_par; /* rest octet */
struct gsm48_cell_options cell_options; struct gsm48_cell_options cell_options;
@ -563,10 +563,10 @@ struct gsm_bts {
struct bitvec si5_neigh_list; struct bitvec si5_neigh_list;
struct { struct {
/* bitmask large enough for all possible ARFCN's */ /* bitmask large enough for all possible ARFCN's */
u_int8_t neigh_list[1024/8]; uint8_t neigh_list[1024/8];
u_int8_t cell_alloc[1024/8]; uint8_t cell_alloc[1024/8];
/* If the user wants a different neighbor list in SI5 than in SI2 */ /* If the user wants a different neighbor list in SI5 than in SI2 */
u_int8_t si5_neigh_list[1024/8]; uint8_t si5_neigh_list[1024/8];
} data; } data;
} si_common; } si_common;
@ -580,9 +580,9 @@ struct gsm_bts {
/* ip.accesss Unit ID's have Site/BTS/TRX layout */ /* ip.accesss Unit ID's have Site/BTS/TRX layout */
union { union {
struct { struct {
u_int16_t site_id; uint16_t site_id;
u_int16_t bts_id; uint16_t bts_id;
u_int32_t flags; uint32_t flags;
} ip_access; } ip_access;
struct { struct {
struct { struct {
@ -619,16 +619,16 @@ struct gsm_bts {
enum bts_gprs_mode mode; enum bts_gprs_mode mode;
struct { struct {
struct gsm_nm_state nm_state; struct gsm_nm_state nm_state;
u_int16_t nsei; uint16_t nsei;
uint8_t timer[7]; uint8_t timer[7];
} nse; } nse;
struct { struct {
struct gsm_nm_state nm_state; struct gsm_nm_state nm_state;
u_int16_t bvci; uint16_t bvci;
uint8_t timer[11]; uint8_t timer[11];
} cell; } cell;
struct gsm_bts_gprs_nsvc nsvc[2]; struct gsm_bts_gprs_nsvc nsvc[2];
u_int8_t rac; uint8_t rac;
} gprs; } gprs;
/* RACH NM values */ /* RACH NM values */
@ -707,8 +707,8 @@ enum gsm_auth_policy {
struct gsm_network { struct gsm_network {
/* global parameters */ /* global parameters */
u_int16_t country_code; uint16_t country_code;
u_int16_t network_code; uint16_t network_code;
char *name_long; char *name_long;
char *name_short; char *name_short;
enum gsm_auth_policy auth_policy; enum gsm_auth_policy auth_policy;
@ -788,25 +788,25 @@ struct gsm_sms {
struct gsm_subscriber *receiver; struct gsm_subscriber *receiver;
unsigned long validity_minutes; unsigned long validity_minutes;
u_int8_t reply_path_req; uint8_t reply_path_req;
u_int8_t status_rep_req; uint8_t status_rep_req;
u_int8_t ud_hdr_ind; uint8_t ud_hdr_ind;
u_int8_t protocol_id; uint8_t protocol_id;
u_int8_t data_coding_scheme; uint8_t data_coding_scheme;
u_int8_t msg_ref; uint8_t msg_ref;
char dest_addr[20+1]; /* DA LV is 12 bytes max, i.e. 10 bytes char dest_addr[20+1]; /* DA LV is 12 bytes max, i.e. 10 bytes
* BCD == 20 bytes string */ * BCD == 20 bytes string */
u_int8_t user_data_len; uint8_t user_data_len;
u_int8_t user_data[SMS_TEXT_SIZE]; uint8_t user_data[SMS_TEXT_SIZE];
char text[SMS_TEXT_SIZE]; char text[SMS_TEXT_SIZE];
}; };
struct gsm_network *gsm_network_init(u_int16_t country_code, u_int16_t network_code, struct gsm_network *gsm_network_init(uint16_t country_code, uint16_t network_code,
int (*mncc_recv)(struct gsm_network *, struct msgb *)); int (*mncc_recv)(struct gsm_network *, struct msgb *));
struct gsm_bts *gsm_bts_alloc(struct gsm_network *net, enum gsm_bts_type type, struct gsm_bts *gsm_bts_alloc(struct gsm_network *net, enum gsm_bts_type type,
u_int8_t tsc, u_int8_t bsic); uint8_t tsc, uint8_t bsic);
struct gsm_bts_trx *gsm_bts_trx_alloc(struct gsm_bts *bts); struct gsm_bts_trx *gsm_bts_trx_alloc(struct gsm_bts *bts);
int gsm_set_bts_type(struct gsm_bts *bts, enum gsm_bts_type type); int gsm_set_bts_type(struct gsm_bts *bts, enum gsm_bts_type type);
@ -814,7 +814,7 @@ struct gsm_bts *gsm_bts_num(struct gsm_network *net, int num);
/* Get reference to a neighbor cell on a given BCCH ARFCN */ /* Get reference to a neighbor cell on a given BCCH ARFCN */
struct gsm_bts *gsm_bts_neighbor(const struct gsm_bts *bts, struct gsm_bts *gsm_bts_neighbor(const struct gsm_bts *bts,
u_int16_t arfcn, u_int8_t bsic); uint16_t arfcn, uint8_t bsic);
struct gsm_bts_trx *gsm_bts_trx_num(struct gsm_bts *bts, int num); struct gsm_bts_trx *gsm_bts_trx_num(struct gsm_bts *bts, int num);
@ -827,8 +827,8 @@ char *gsm_ts_name(struct gsm_bts_trx_ts *ts);
char *gsm_lchan_name(struct gsm_lchan *lchan); char *gsm_lchan_name(struct gsm_lchan *lchan);
const char *gsm_lchans_name(enum gsm_lchan_state s); const char *gsm_lchans_name(enum gsm_lchan_state s);
void set_ts_e1link(struct gsm_bts_trx_ts *ts, u_int8_t e1_nr, void set_ts_e1link(struct gsm_bts_trx_ts *ts, uint8_t e1_nr,
u_int8_t e1_ts, u_int8_t e1_ts_ss); uint8_t e1_ts, uint8_t e1_ts_ss);
enum gsm_bts_type parse_btstype(const char *arg); enum gsm_bts_type parse_btstype(const char *arg);
const char *btstype2str(enum gsm_bts_type type); const char *btstype2str(enum gsm_bts_type type);
struct gsm_bts_trx *gsm_bts_trx_by_nr(struct gsm_bts *bts, int nr); struct gsm_bts_trx *gsm_bts_trx_by_nr(struct gsm_bts *bts, int nr);
@ -873,7 +873,7 @@ const char *bts_gprs_mode_name(enum bts_gprs_mode mode);
void gsm_trx_lock_rf(struct gsm_bts_trx *trx, int locked); void gsm_trx_lock_rf(struct gsm_bts_trx *trx, int locked);
int gsm48_ra_id_by_bts(u_int8_t *buf, struct gsm_bts *bts); int gsm48_ra_id_by_bts(uint8_t *buf, struct gsm_bts *bts);
void gprs_ra_id_by_bts(struct gprs_ra_id *raid, struct gsm_bts *bts); void gprs_ra_id_by_bts(struct gprs_ra_id *raid, struct gsm_bts *bts);
struct gsm_meas_rep *lchan_next_meas_rep(struct gsm_lchan *lchan); struct gsm_meas_rep *lchan_next_meas_rep(struct gsm_lchan *lchan);

View File

@ -24,24 +24,24 @@ struct gsm_equipment {
char name[GSM_NAME_LENGTH]; char name[GSM_NAME_LENGTH];
struct gsm48_classmark1 classmark1; struct gsm48_classmark1 classmark1;
u_int8_t classmark2_len; uint8_t classmark2_len;
u_int8_t classmark2[3]; uint8_t classmark2[3];
u_int8_t classmark3_len; uint8_t classmark3_len;
u_int8_t classmark3[14]; uint8_t classmark3[14];
}; };
struct gsm_subscriber { struct gsm_subscriber {
struct gsm_network *net; struct gsm_network *net;
long long unsigned int id; long long unsigned int id;
char imsi[GSM_IMSI_LENGTH]; char imsi[GSM_IMSI_LENGTH];
u_int32_t tmsi; uint32_t tmsi;
u_int16_t lac; uint16_t lac;
char name[GSM_NAME_LENGTH]; char name[GSM_NAME_LENGTH];
char extension[GSM_EXTENSION_LENGTH]; char extension[GSM_EXTENSION_LENGTH];
int authorized; int authorized;
/* Temporary field which is not stored in the DB/HLR */ /* Temporary field which is not stored in the DB/HLR */
u_int32_t flags; uint32_t flags;
/* Every user can only have one equipment in use at any given /* Every user can only have one equipment in use at any given
* point in time */ * point in time */
@ -72,7 +72,7 @@ enum gsm_subscriber_update_reason {
struct gsm_subscriber *subscr_get(struct gsm_subscriber *subscr); struct gsm_subscriber *subscr_get(struct gsm_subscriber *subscr);
struct gsm_subscriber *subscr_put(struct gsm_subscriber *subscr); struct gsm_subscriber *subscr_put(struct gsm_subscriber *subscr);
struct gsm_subscriber *subscr_get_by_tmsi(struct gsm_network *net, struct gsm_subscriber *subscr_get_by_tmsi(struct gsm_network *net,
u_int32_t tmsi); uint32_t tmsi);
struct gsm_subscriber *subscr_get_by_imsi(struct gsm_network *net, struct gsm_subscriber *subscr_get_by_imsi(struct gsm_network *net,
const char *imsi); const char *imsi);
struct gsm_subscriber *subscr_get_by_extension(struct gsm_network *net, struct gsm_subscriber *subscr_get_by_extension(struct gsm_network *net,

View File

@ -9,9 +9,9 @@
#define IPA_TCP_PORT_RSL 3003 #define IPA_TCP_PORT_RSL 3003
struct ipaccess_head { struct ipaccess_head {
u_int16_t len; /* network byte order */ uint16_t len; /* network byte order */
u_int8_t proto; uint8_t proto;
u_int8_t data[0]; uint8_t data[0];
} __attribute__ ((packed)); } __attribute__ ((packed));
struct ipaccess_head_ext { struct ipaccess_head_ext {
@ -81,7 +81,7 @@ int ipaccess_send_id_req(int fd);
const char *ipaccess_idtag_name(uint8_t tag); const char *ipaccess_idtag_name(uint8_t tag);
int ipaccess_idtag_parse(struct tlv_parsed *dec, unsigned char *buf, int len); int ipaccess_idtag_parse(struct tlv_parsed *dec, unsigned char *buf, int len);
int ipaccess_parse_unitid(const char *str, u_int16_t *site_id, u_int16_t *bts_id, u_int16_t *trx_id); int ipaccess_parse_unitid(const char *str, uint16_t *site_id, uint16_t *bts_id, uint16_t *trx_id);
int ipaccess_drop_oml(struct gsm_bts *bts); int ipaccess_drop_oml(struct gsm_bts *bts);
int ipaccess_drop_rsl(struct gsm_bts_trx *trx); int ipaccess_drop_rsl(struct gsm_bts_trx *trx);
@ -92,30 +92,30 @@ int ipaccess_drop_rsl(struct gsm_bts_trx *trx);
struct sdp_firmware { struct sdp_firmware {
char magic[4]; char magic[4];
char more_magic[2]; char more_magic[2];
u_int16_t more_more_magic; uint16_t more_more_magic;
u_int32_t header_length; uint32_t header_length;
u_int32_t file_length; uint32_t file_length;
char sw_part[20]; char sw_part[20];
char text1[64]; char text1[64];
char time[12]; char time[12];
char date[14]; char date[14];
char text2[10]; char text2[10];
char version[20]; char version[20];
u_int16_t table_offset; uint16_t table_offset;
/* stuff i don't know */ /* stuff i don't know */
} __attribute__((packed)); } __attribute__((packed));
struct sdp_header_entry { struct sdp_header_entry {
u_int16_t something1; uint16_t something1;
char text1[64]; char text1[64];
char time[12]; char time[12];
char date[14]; char date[14];
char text2[10]; char text2[10];
char version[20]; char version[20];
u_int32_t length; uint32_t length;
u_int32_t addr1; uint32_t addr1;
u_int32_t addr2; uint32_t addr2;
u_int32_t start; uint32_t start;
} __attribute__((packed)); } __attribute__((packed));
struct sdp_header_item { struct sdp_header_item {

View File

@ -1,21 +1,23 @@
#ifndef _MEAS_REP_H #ifndef _MEAS_REP_H
#define _MEAS_REP_H #define _MEAS_REP_H
#include <stdint.h>
#define MRC_F_PROCESSED 0x0001 #define MRC_F_PROCESSED 0x0001
/* extracted from a L3 measurement report IE */ /* extracted from a L3 measurement report IE */
struct gsm_meas_rep_cell { struct gsm_meas_rep_cell {
u_int8_t rxlev; uint8_t rxlev;
u_int8_t bsic; uint8_t bsic;
u_int8_t neigh_idx; uint8_t neigh_idx;
u_int16_t arfcn; uint16_t arfcn;
unsigned int flags; unsigned int flags;
}; };
/* RX Level and RX Quality */ /* RX Level and RX Quality */
struct gsm_rx_lev_qual { struct gsm_rx_lev_qual {
u_int8_t rx_lev; uint8_t rx_lev;
u_int8_t rx_qual; uint8_t rx_qual;
}; };
/* unidirectional measumrement report */ /* unidirectional measumrement report */
@ -38,7 +40,7 @@ struct gsm_meas_rep {
struct gsm_lchan *lchan; struct gsm_lchan *lchan;
/* number of the measurement report */ /* number of the measurement report */
u_int8_t nr; uint8_t nr;
/* flags, see MEAS_REP_F_* */ /* flags, see MEAS_REP_F_* */
unsigned int flags; unsigned int flags;
@ -46,11 +48,11 @@ struct gsm_meas_rep {
struct gsm_meas_rep_unidir ul; struct gsm_meas_rep_unidir ul;
struct gsm_meas_rep_unidir dl; struct gsm_meas_rep_unidir dl;
u_int8_t bs_power; uint8_t bs_power;
u_int8_t ms_timing_offset; uint8_t ms_timing_offset;
struct { struct {
int8_t pwr; /* MS power in dBm */ int8_t pwr; /* MS power in dBm */
u_int8_t ta; /* MS timing advance */ uint8_t ta; /* MS timing advance */
} ms_l1; } ms_l1;
/* neighbor measurement reports for up to 6 cells */ /* neighbor measurement reports for up to 6 cells */

View File

@ -66,6 +66,6 @@ void paging_request_stop(struct gsm_bts *bts, struct gsm_subscriber *subscr,
struct msgb *msg); struct msgb *msg);
/* update paging load */ /* update paging load */
void paging_update_buffer_space(struct gsm_bts *bts, u_int16_t); void paging_update_buffer_space(struct gsm_bts *bts, uint16_t);
#endif #endif

View File

@ -5,10 +5,10 @@
#include <openbsc/gsm_04_08.h> #include <openbsc/gsm_04_08.h>
/* generate SI1 rest octets */ /* generate SI1 rest octets */
int rest_octets_si1(u_int8_t *data, u_int8_t *nch_pos); int rest_octets_si1(uint8_t *data, uint8_t *nch_pos);
struct gsm48_si_selection_params { struct gsm48_si_selection_params {
u_int16_t penalty_time:5, uint16_t penalty_time:5,
temp_offs:3, temp_offs:3,
cell_resel_off:6, cell_resel_off:6,
cbq:1, cbq:1,
@ -16,18 +16,18 @@ struct gsm48_si_selection_params {
}; };
struct gsm48_si_power_offset { struct gsm48_si_power_offset {
u_int8_t power_offset:2, uint8_t power_offset:2,
present:1; present:1;
}; };
struct gsm48_si3_gprs_ind { struct gsm48_si3_gprs_ind {
u_int8_t si13_position:1, uint8_t si13_position:1,
ra_colour:3, ra_colour:3,
present:1; present:1;
}; };
struct gsm48_lsa_params { struct gsm48_lsa_params {
u_int32_t prio_thr:3, uint32_t prio_thr:3,
lsa_offset:3, lsa_offset:3,
mcc:12, mcc:12,
mnc:12; mnc:12;
@ -37,26 +37,26 @@ struct gsm48_lsa_params {
struct gsm48_si_ro_info { struct gsm48_si_ro_info {
struct gsm48_si_selection_params selection_params; struct gsm48_si_selection_params selection_params;
struct gsm48_si_power_offset power_offset; struct gsm48_si_power_offset power_offset;
u_int8_t si2ter_indicator; uint8_t si2ter_indicator;
u_int8_t early_cm_ctrl; uint8_t early_cm_ctrl;
struct { struct {
u_int8_t where:3, uint8_t where:3,
present:1; present:1;
} scheduling; } scheduling;
struct gsm48_si3_gprs_ind gprs_ind; struct gsm48_si3_gprs_ind gprs_ind;
/* SI 4 specific */ /* SI 4 specific */
struct gsm48_lsa_params lsa_params; struct gsm48_lsa_params lsa_params;
u_int16_t cell_id; uint16_t cell_id;
u_int8_t break_ind; /* do we have SI7 + SI8 ? */ uint8_t break_ind; /* do we have SI7 + SI8 ? */
}; };
/* Generate SI3 Rest Octests (Chapter 10.5.2.34 / Table 10.4.72) */ /* Generate SI3 Rest Octests (Chapter 10.5.2.34 / Table 10.4.72) */
int rest_octets_si3(u_int8_t *data, const struct gsm48_si_ro_info *si3); int rest_octets_si3(uint8_t *data, const struct gsm48_si_ro_info *si3);
/* Generate SI4 Rest Octets (Chapter 10.5.2.35) */ /* Generate SI4 Rest Octets (Chapter 10.5.2.35) */
int rest_octets_si4(u_int8_t *data, const struct gsm48_si_ro_info *si4); int rest_octets_si4(uint8_t *data, const struct gsm48_si_ro_info *si4);
enum pbcch_carrier_type { enum pbcch_carrier_type {
PBCCH_BCCH, PBCCH_BCCH,
@ -75,59 +75,59 @@ enum gprs_nmo {
struct gprs_cell_options { struct gprs_cell_options {
enum gprs_nmo nmo; enum gprs_nmo nmo;
/* T3168: wait for packet uplink assignment message */ /* T3168: wait for packet uplink assignment message */
u_int32_t t3168; /* in milliseconds */ uint32_t t3168; /* in milliseconds */
/* T3192: wait for release of the TBF after reception of the final block */ /* T3192: wait for release of the TBF after reception of the final block */
u_int32_t t3192; /* in milliseconds */ uint32_t t3192; /* in milliseconds */
u_int32_t drx_timer_max;/* in seconds */ uint32_t drx_timer_max;/* in seconds */
u_int32_t bs_cv_max; uint32_t bs_cv_max;
u_int8_t ext_info_present; uint8_t ext_info_present;
struct { struct {
u_int8_t egprs_supported; uint8_t egprs_supported;
u_int8_t use_egprs_p_ch_req; uint8_t use_egprs_p_ch_req;
u_int8_t bep_period; uint8_t bep_period;
u_int8_t pfc_supported; uint8_t pfc_supported;
u_int8_t dtm_supported; uint8_t dtm_supported;
u_int8_t bss_paging_coordination; uint8_t bss_paging_coordination;
} ext_info; } ext_info;
}; };
/* TS 04.60 Table 12.9.2 */ /* TS 04.60 Table 12.9.2 */
struct gprs_power_ctrl_pars { struct gprs_power_ctrl_pars {
u_int8_t alpha; uint8_t alpha;
u_int8_t t_avg_w; uint8_t t_avg_w;
u_int8_t t_avg_t; uint8_t t_avg_t;
u_int8_t pc_meas_chan; uint8_t pc_meas_chan;
u_int8_t n_avg_i; uint8_t n_avg_i;
}; };
struct gsm48_si13_info { struct gsm48_si13_info {
struct gprs_cell_options cell_opts; struct gprs_cell_options cell_opts;
struct gprs_power_ctrl_pars pwr_ctrl_pars; struct gprs_power_ctrl_pars pwr_ctrl_pars;
u_int8_t bcch_change_mark; uint8_t bcch_change_mark;
u_int8_t si_change_field; uint8_t si_change_field;
u_int8_t pbcch_present; uint8_t pbcch_present;
union { union {
struct { struct {
u_int8_t rac; uint8_t rac;
u_int8_t spgc_ccch_sup; uint8_t spgc_ccch_sup;
u_int8_t net_ctrl_ord; uint8_t net_ctrl_ord;
u_int8_t prio_acc_thr; uint8_t prio_acc_thr;
} no_pbcch; } no_pbcch;
struct { struct {
u_int8_t psi1_rep_per; uint8_t psi1_rep_per;
u_int8_t pb; uint8_t pb;
u_int8_t tsc; uint8_t tsc;
u_int8_t tn; uint8_t tn;
enum pbcch_carrier_type carrier_type; enum pbcch_carrier_type carrier_type;
u_int16_t arfcn; uint16_t arfcn;
u_int8_t maio; uint8_t maio;
} pbcch; } pbcch;
}; };
}; };
/* Generate SI13 Rest Octests (Chapter 10.5.2.37b) */ /* Generate SI13 Rest Octests (Chapter 10.5.2.37b) */
int rest_octets_si13(u_int8_t *data, const struct gsm48_si13_info *si13); int rest_octets_si13(uint8_t *data, const struct gsm48_si13_info *si13);
#endif /* _REST_OCTETS_H */ #endif /* _REST_OCTETS_H */

View File

@ -67,23 +67,23 @@ struct rtp_socket {
} proxy; } proxy;
struct { struct {
struct gsm_network *net; struct gsm_network *net;
u_int32_t callref; uint32_t callref;
} receive; } receive;
}; };
enum rtp_tx_action tx_action; enum rtp_tx_action tx_action;
struct { struct {
u_int16_t sequence; uint16_t sequence;
u_int32_t timestamp; uint32_t timestamp;
u_int32_t ssrc; uint32_t ssrc;
struct timeval last_tv; struct timeval last_tv;
} transmit; } transmit;
}; };
struct rtp_socket *rtp_socket_create(void); struct rtp_socket *rtp_socket_create(void);
int rtp_socket_bind(struct rtp_socket *rs, u_int32_t ip); int rtp_socket_bind(struct rtp_socket *rs, uint32_t ip);
int rtp_socket_connect(struct rtp_socket *rs, u_int32_t ip, u_int16_t port); int rtp_socket_connect(struct rtp_socket *rs, uint32_t ip, uint16_t port);
int rtp_socket_proxy(struct rtp_socket *this, struct rtp_socket *other); int rtp_socket_proxy(struct rtp_socket *this, struct rtp_socket *other);
int rtp_socket_upstream(struct rtp_socket *this, struct gsm_network *net, u_int32_t callref); int rtp_socket_upstream(struct rtp_socket *this, struct gsm_network *net, uint32_t callref);
int rtp_socket_free(struct rtp_socket *rs); int rtp_socket_free(struct rtp_socket *rs);
int rtp_send_frame(struct rtp_socket *rs, struct gsm_data_frame *frame); int rtp_send_frame(struct rtp_socket *rs, struct gsm_data_frame *frame);

View File

@ -170,14 +170,14 @@ struct scall_signal_data {
struct ipacc_ack_signal_data { struct ipacc_ack_signal_data {
struct gsm_bts_trx *trx; struct gsm_bts_trx *trx;
u_int8_t msg_type; uint8_t msg_type;
}; };
struct abis_om2k_mo; struct abis_om2k_mo;
struct nm_statechg_signal_data { struct nm_statechg_signal_data {
struct gsm_bts *bts; struct gsm_bts *bts;
u_int8_t obj_class; uint8_t obj_class;
void *obj; void *obj;
struct gsm_nm_state *old_state; struct gsm_nm_state *old_state;
struct gsm_nm_state *new_state; struct gsm_nm_state *new_state;

View File

@ -9,7 +9,7 @@
#endif #endif
int make_sock(struct bsc_fd *bfd, int proto, int make_sock(struct bsc_fd *bfd, int proto,
u_int32_t ip, u_int16_t port, int priv_nr, uint32_t ip, uint16_t port, int priv_nr,
int (*cb)(struct bsc_fd *fd, unsigned int what), void *data); int (*cb)(struct bsc_fd *fd, unsigned int what), void *data);
#endif /* _BSC_SOCKET_H */ #endif /* _BSC_SOCKET_H */

View File

@ -20,7 +20,7 @@
* *
*/ */
#include <sys/types.h> #include <stdint.h>
#include <osmocom/core/linuxlist.h> #include <osmocom/core/linuxlist.h>
#define NR_SUBCH 4 #define NR_SUBCH 4
@ -32,8 +32,8 @@
/***********************************************************************/ /***********************************************************************/
struct demux_subch { struct demux_subch {
u_int8_t out_bitbuf[TRAU_FRAME_BITS]; uint8_t out_bitbuf[TRAU_FRAME_BITS];
u_int16_t out_idx; /* next bit to be written in out_bitbuf */ uint16_t out_idx; /* next bit to be written in out_bitbuf */
/* number of consecutive zeros that we have received (for sync) */ /* number of consecutive zeros that we have received (for sync) */
unsigned int consecutive_zeros; unsigned int consecutive_zeros;
/* are we in TRAU frame sync or not? */ /* are we in TRAU frame sync or not? */
@ -42,12 +42,12 @@ struct demux_subch {
struct subch_demux { struct subch_demux {
/* bitmask of currently active subchannels */ /* bitmask of currently active subchannels */
u_int8_t chan_activ; uint8_t chan_activ;
/* one demux_subch struct for every subchannel */ /* one demux_subch struct for every subchannel */
struct demux_subch subch[NR_SUBCH]; struct demux_subch subch[NR_SUBCH];
/* callback to be called once we have received a complete /* callback to be called once we have received a complete
* frame on a given subchannel */ * frame on a given subchannel */
int (*out_cb)(struct subch_demux *dmx, int ch, u_int8_t *data, int len, int (*out_cb)(struct subch_demux *dmx, int ch, uint8_t *data, int len,
void *); void *);
/* user-provided data, transparently passed to out_cb() */ /* user-provided data, transparently passed to out_cb() */
void *data; void *data;
@ -57,7 +57,7 @@ struct subch_demux {
int subch_demux_init(struct subch_demux *dmx); int subch_demux_init(struct subch_demux *dmx);
/* feed 'len' number of muxed bytes into the demultiplexer */ /* feed 'len' number of muxed bytes into the demultiplexer */
int subch_demux_in(struct subch_demux *dmx, u_int8_t *data, int len); int subch_demux_in(struct subch_demux *dmx, uint8_t *data, int len);
/* activate decoding/processing for one subchannel */ /* activate decoding/processing for one subchannel */
int subch_demux_activate(struct subch_demux *dmx, int subch); int subch_demux_activate(struct subch_demux *dmx, int subch);
@ -76,7 +76,7 @@ struct subch_txq_entry {
unsigned int bit_len; /* total number of bits in 'bits' */ unsigned int bit_len; /* total number of bits in 'bits' */
unsigned int next_bit; /* next bit to be transmitted */ unsigned int next_bit; /* next bit to be transmitted */
u_int8_t bits[0]; /* one bit per byte */ uint8_t bits[0]; /* one bit per byte */
}; };
struct mux_subch { struct mux_subch {
@ -92,10 +92,10 @@ struct subch_mux {
int subchan_mux_init(struct subch_mux *mx); int subchan_mux_init(struct subch_mux *mx);
/* request the output of 'len' multiplexed bytes */ /* request the output of 'len' multiplexed bytes */
int subchan_mux_out(struct subch_mux *mx, u_int8_t *data, int len); int subchan_mux_out(struct subch_mux *mx, uint8_t *data, int len);
/* enqueue some data into one sub-channel of the muxer */ /* enqueue some data into one sub-channel of the muxer */
int subchan_mux_enqueue(struct subch_mux *mx, int s_nr, const u_int8_t *data, int subchan_mux_enqueue(struct subch_mux *mx, int s_nr, const uint8_t *data,
int len); int len);
#endif /* _SUBCH_DEMUX_H */ #endif /* _SUBCH_DEMUX_H */

View File

@ -35,7 +35,7 @@ enum osmo_sysinfo_type {
_MAX_SYSINFO_TYPE _MAX_SYSINFO_TYPE
}; };
typedef u_int8_t sysinfo_buf_t[GSM_MACBLOCK_LEN]; typedef uint8_t sysinfo_buf_t[GSM_MACBLOCK_LEN];
extern const struct value_string osmo_sitype_strs[_MAX_SYSINFO_TYPE]; extern const struct value_string osmo_sitype_strs[_MAX_SYSINFO_TYPE];
uint8_t gsm_sitype2rsl(enum osmo_sysinfo_type si_type); uint8_t gsm_sitype2rsl(enum osmo_sysinfo_type si_type);

View File

@ -12,10 +12,10 @@ struct gsm_trans {
struct llist_head entry; struct llist_head entry;
/* The protocol within which we live */ /* The protocol within which we live */
u_int8_t protocol; uint8_t protocol;
/* The current transaction ID */ /* The current transaction ID */
u_int8_t transaction_id; uint8_t transaction_id;
/* To whom we belong, unique identifier of remote MM entity */ /* To whom we belong, unique identifier of remote MM entity */
struct gsm_subscriber *subscr; struct gsm_subscriber *subscr;
@ -24,7 +24,7 @@ struct gsm_trans {
struct gsm_subscriber_connection *conn; struct gsm_subscriber_connection *conn;
/* reference from MNCC or other application */ /* reference from MNCC or other application */
u_int32_t callref; uint32_t callref;
/* if traffic channel receive was requested */ /* if traffic channel receive was requested */
int tch_recv; int tch_recv;
@ -45,7 +45,7 @@ struct gsm_trans {
struct gsm_mncc msg; /* stores setup/disconnect/release message */ struct gsm_mncc msg; /* stores setup/disconnect/release message */
} cc; } cc;
struct { struct {
u_int8_t link_id; /* RSL Link ID to be used for this trans */ uint8_t link_id; /* RSL Link ID to be used for this trans */
int is_mt; /* is this a MO (0) or MT (1) transfer */ int is_mt; /* is this a MO (0) or MT (1) transfer */
enum gsm411_cp_state cp_state; enum gsm411_cp_state cp_state;
struct timer_list cp_timer; struct timer_list cp_timer;
@ -60,16 +60,16 @@ struct gsm_trans {
struct gsm_trans *trans_find_by_id(struct gsm_subscriber *subscr, struct gsm_trans *trans_find_by_id(struct gsm_subscriber *subscr,
u_int8_t proto, u_int8_t trans_id); uint8_t proto, uint8_t trans_id);
struct gsm_trans *trans_find_by_callref(struct gsm_network *net, struct gsm_trans *trans_find_by_callref(struct gsm_network *net,
u_int32_t callref); uint32_t callref);
struct gsm_trans *trans_alloc(struct gsm_subscriber *subscr, struct gsm_trans *trans_alloc(struct gsm_subscriber *subscr,
u_int8_t protocol, u_int8_t trans_id, uint8_t protocol, uint8_t trans_id,
u_int32_t callref); uint32_t callref);
void trans_free(struct gsm_trans *trans); void trans_free(struct gsm_trans *trans);
int trans_assign_trans_id(struct gsm_subscriber *subscr, int trans_assign_trans_id(struct gsm_subscriber *subscr,
u_int8_t protocol, u_int8_t ti_flag); uint8_t protocol, uint8_t ti_flag);
#endif #endif

View File

@ -20,7 +20,7 @@
* *
*/ */
#include <sys/types.h> #include <stdint.h>
/* 21 for FR/EFR, 25 for AMR, 15 for OM, 15 for data, 13 for E-data, 21 idle */ /* 21 for FR/EFR, 25 for AMR, 15 for OM, 15 for data, 13 for E-data, 21 idle */
#define MAX_C_BITS 25 #define MAX_C_BITS 25
@ -34,11 +34,11 @@
#define MAX_M_BITS 2 #define MAX_M_BITS 2
struct decoded_trau_frame { struct decoded_trau_frame {
u_int8_t c_bits[MAX_C_BITS]; uint8_t c_bits[MAX_C_BITS];
u_int8_t d_bits[MAX_D_BITS]; uint8_t d_bits[MAX_D_BITS];
u_int8_t t_bits[MAX_T_BITS]; uint8_t t_bits[MAX_T_BITS];
u_int8_t s_bits[MAX_S_BITS]; uint8_t s_bits[MAX_S_BITS];
u_int8_t m_bits[MAX_M_BITS]; uint8_t m_bits[MAX_M_BITS];
}; };
#define TRAU_FT_FR_UP 0x02 /* 0 0 0 1 0 - 3.5.1.1.1 */ #define TRAU_FT_FR_UP 0x02 /* 0 0 0 1 0 - 3.5.1.1.1 */
@ -55,10 +55,10 @@ struct decoded_trau_frame {
#define TRAU_FT_IDLE_DOWN 0x0e /* 0 1 1 1 0 - 3.5.5 */ #define TRAU_FT_IDLE_DOWN 0x0e /* 0 1 1 1 0 - 3.5.5 */
int decode_trau_frame(struct decoded_trau_frame *fr, const u_int8_t *trau_bits); int decode_trau_frame(struct decoded_trau_frame *fr, const uint8_t *trau_bits);
int encode_trau_frame(u_int8_t *trau_bits, const struct decoded_trau_frame *fr); int encode_trau_frame(uint8_t *trau_bits, const struct decoded_trau_frame *fr);
int trau_frame_up2down(struct decoded_trau_frame *fr); int trau_frame_up2down(struct decoded_trau_frame *fr);
u_int8_t *trau_idle_frame(void); uint8_t *trau_idle_frame(void);
#endif /* _TRAU_FRAME_H */ #endif /* _TRAU_FRAME_H */

View File

@ -35,14 +35,14 @@ int trau_mux_map_lchan(const struct gsm_lchan *src,
const struct gsm_lchan *dst); const struct gsm_lchan *dst);
/* unmap a TRAU mux map entry */ /* unmap a TRAU mux map entry */
int trau_mux_unmap(const struct gsm_e1_subslot *ss, u_int32_t callref); int trau_mux_unmap(const struct gsm_e1_subslot *ss, uint32_t callref);
/* we get called by subchan_demux */ /* we get called by subchan_demux */
int trau_mux_input(struct gsm_e1_subslot *src_e1_ss, int trau_mux_input(struct gsm_e1_subslot *src_e1_ss,
const u_int8_t *trau_bits, int num_bits); const uint8_t *trau_bits, int num_bits);
/* add a trau receiver */ /* add a trau receiver */
int trau_recv_lchan(struct gsm_lchan *lchan, u_int32_t callref); int trau_recv_lchan(struct gsm_lchan *lchan, uint32_t callref);
/* send trau from application */ /* send trau from application */
int trau_send_frame(struct gsm_lchan *lchan, struct gsm_data_frame *frame); int trau_send_frame(struct gsm_lchan *lchan, struct gsm_data_frame *frame);

View File

@ -23,7 +23,7 @@
#include <openbsc/crc24.h> #include <openbsc/crc24.h>
/* CRC24 table - FCS */ /* CRC24 table - FCS */
static const u_int32_t tbl_crc24[256] = { static const uint32_t tbl_crc24[256] = {
0x00000000, 0x00d6a776, 0x00f64557, 0x0020e221, 0x00b78115, 0x00612663, 0x0041c442, 0x00976334, 0x00000000, 0x00d6a776, 0x00f64557, 0x0020e221, 0x00b78115, 0x00612663, 0x0041c442, 0x00976334,
0x00340991, 0x00e2aee7, 0x00c24cc6, 0x0014ebb0, 0x00838884, 0x00552ff2, 0x0075cdd3, 0x00a36aa5, 0x00340991, 0x00e2aee7, 0x00c24cc6, 0x0014ebb0, 0x00838884, 0x00552ff2, 0x0075cdd3, 0x00a36aa5,
0x00681322, 0x00beb454, 0x009e5675, 0x0048f103, 0x00df9237, 0x00093541, 0x0029d760, 0x00ff7016, 0x00681322, 0x00beb454, 0x009e5675, 0x0048f103, 0x00df9237, 0x00093541, 0x0029d760, 0x00ff7016,
@ -60,7 +60,7 @@ static const u_int32_t tbl_crc24[256] = {
#define INIT_CRC24 0xffffff #define INIT_CRC24 0xffffff
u_int32_t crc24_calc(u_int32_t fcs, u_int8_t *cp, unsigned int len) uint32_t crc24_calc(uint32_t fcs, uint8_t *cp, unsigned int len)
{ {
while (len--) while (len--)
fcs = (fcs >> 8) ^ tbl_crc24[(fcs ^ *cp++) & 0xff]; fcs = (fcs >> 8) ^ tbl_crc24[(fcs ^ *cp++) & 0xff];

View File

@ -75,7 +75,7 @@ extern struct gbprox_peer *gbprox_peer_sgsn;
/* call-back function for the NS protocol */ /* call-back function for the NS protocol */
static int proxy_ns_cb(enum gprs_ns_evt event, struct gprs_nsvc *nsvc, static int proxy_ns_cb(enum gprs_ns_evt event, struct gprs_nsvc *nsvc,
struct msgb *msg, u_int16_t bvci) struct msgb *msg, uint16_t bvci)
{ {
int rc = 0; int rc = 0;

View File

@ -81,7 +81,7 @@ struct sgsn_instance *sgsn = &sgsn_inst;
/* call-back function for the NS protocol */ /* call-back function for the NS protocol */
static int sgsn_ns_cb(enum gprs_ns_evt event, struct gprs_nsvc *nsvc, static int sgsn_ns_cb(enum gprs_ns_evt event, struct gprs_nsvc *nsvc,
struct msgb *msg, u_int16_t bvci) struct msgb *msg, uint16_t bvci)
{ {
int rc = 0; int rc = 0;

View File

@ -53,8 +53,8 @@ static int restart;
static char *prim_oml_ip; static char *prim_oml_ip;
static char *bts_ip_addr, *bts_ip_mask, *bts_ip_gw; static char *bts_ip_addr, *bts_ip_mask, *bts_ip_gw;
static char *unit_id; static char *unit_id;
static u_int16_t nv_flags; static uint16_t nv_flags;
static u_int16_t nv_mask; static uint16_t nv_mask;
static char *software = NULL; static char *software = NULL;
static int sw_load_state = 0; static int sw_load_state = 0;
static int oml_state = 0; static int oml_state = 0;
@ -64,11 +64,11 @@ static int found_trx = 0;
static int loop_tests = 0; static int loop_tests = 0;
struct sw_load { struct sw_load {
u_int8_t file_id[255]; uint8_t file_id[255];
u_int8_t file_id_len; uint8_t file_id_len;
u_int8_t file_version[255]; uint8_t file_version[255];
u_int8_t file_version_len; uint8_t file_version_len;
}; };
static void *tall_ctx_config = NULL; static void *tall_ctx_config = NULL;
@ -76,8 +76,8 @@ static struct sw_load *sw_load1 = NULL;
static struct sw_load *sw_load2 = NULL; static struct sw_load *sw_load2 = NULL;
/* /*
static u_int8_t prim_oml_attr[] = { 0x95, 0x00, 7, 0x88, 192, 168, 100, 11, 0x00, 0x00 }; static uint8_t prim_oml_attr[] = { 0x95, 0x00, 7, 0x88, 192, 168, 100, 11, 0x00, 0x00 };
static u_int8_t unit_id_attr[] = { 0x91, 0x00, 9, '2', '3', '4', '2', '/' , '0', '/', '0', 0x00 }; static uint8_t unit_id_attr[] = { 0x91, 0x00, 9, '2', '3', '4', '2', '/' , '0', '/', '0', 0x00 };
*/ */
/* /*
@ -87,7 +87,7 @@ static u_int8_t unit_id_attr[] = { 0x91, 0x00, 9, '2', '3', '4', '2', '/' , '0',
* result. The nanoBTS will send us a NACK when we did something the * result. The nanoBTS will send us a NACK when we did something the
* BTS didn't like. * BTS didn't like.
*/ */
static int ipacc_msg_nack(u_int8_t mt) static int ipacc_msg_nack(uint8_t mt)
{ {
fprintf(stderr, "Failure to set attribute. This seems fatal\n"); fprintf(stderr, "Failure to set attribute. This seems fatal\n");
exit(-1); exit(-1);
@ -103,7 +103,7 @@ static void check_restart_or_exit(struct gsm_bts_trx *trx)
} }
} }
static int ipacc_msg_ack(u_int8_t mt, struct gsm_bts_trx *trx) static int ipacc_msg_ack(uint8_t mt, struct gsm_bts_trx *trx)
{ {
if (sw_load_state == 1) { if (sw_load_state == 1) {
fprintf(stderr, "The new software is activaed.\n"); fprintf(stderr, "The new software is activaed.\n");
@ -182,7 +182,7 @@ static int nwl_sig_cb(unsigned int subsys, unsigned int signal,
return 0; return 0;
} }
static int nm_state_event(int evt, u_int8_t obj_class, void *obj, static int nm_state_event(int evt, uint8_t obj_class, void *obj,
struct gsm_nm_state *old_state, struct gsm_nm_state *new_state, struct gsm_nm_state *old_state, struct gsm_nm_state *new_state,
struct abis_om_obj_inst *obj_inst); struct abis_om_obj_inst *obj_inst);
@ -495,7 +495,7 @@ out_err:
msgb_free(nmsg); msgb_free(nmsg);
} }
static int nm_state_event(int evt, u_int8_t obj_class, void *obj, static int nm_state_event(int evt, uint8_t obj_class, void *obj,
struct gsm_nm_state *old_state, struct gsm_nm_state *new_state, struct gsm_nm_state *old_state, struct gsm_nm_state *new_state,
struct abis_om_obj_inst *obj_inst) struct abis_om_obj_inst *obj_inst)
{ {

View File

@ -105,9 +105,9 @@ static int bcast_find(int fd)
static int parse_response(unsigned char *buf, int len) static int parse_response(unsigned char *buf, int len)
{ {
u_int8_t t_len; uint8_t t_len;
u_int8_t t_tag; uint8_t t_tag;
u_int8_t *cur = buf; uint8_t *cur = buf;
while (cur < buf + len) { while (cur < buf + len) {
t_len = *cur++; t_len = *cur++;

View File

@ -41,8 +41,8 @@ int ipaccess_analyze_file(int fd, const unsigned int st_size, const unsigned int
struct sdp_header *header; struct sdp_header *header;
char buf[4096]; char buf[4096];
int rc, i; int rc, i;
u_int16_t table_size; uint16_t table_size;
u_int16_t table_offset; uint16_t table_offset;
off_t table_start; off_t table_start;

View File

@ -82,8 +82,8 @@ struct ipa_bts_conn {
struct ipa_proxy *ipp; struct ipa_proxy *ipp;
/* the unit ID as determined by CCM */ /* the unit ID as determined by CCM */
struct { struct {
u_int16_t site_id; uint16_t site_id;
u_int16_t bts_id; uint16_t bts_id;
} unit_id; } unit_id;
/* incoming connections from BTS */ /* incoming connections from BTS */
@ -106,7 +106,7 @@ struct ipa_bts_conn {
uint32_t gprs_orig_ip; uint32_t gprs_orig_ip;
char *id_tags[0xff]; char *id_tags[0xff];
u_int8_t *id_resp; uint8_t *id_resp;
unsigned int id_resp_len; unsigned int id_resp_len;
}; };
@ -131,8 +131,8 @@ static int gprs_ns_cb(struct bsc_fd *bfd, unsigned int what);
#define PROXY_ALLOC_SIZE 1200 #define PROXY_ALLOC_SIZE 1200
static struct ipa_bts_conn *find_bts_by_unitid(struct ipa_proxy *ipp, static struct ipa_bts_conn *find_bts_by_unitid(struct ipa_proxy *ipp,
u_int16_t site_id, uint16_t site_id,
u_int16_t bts_id) uint16_t bts_id)
{ {
struct ipa_bts_conn *ipbc; struct ipa_bts_conn *ipbc;
@ -189,7 +189,7 @@ static struct ipa_proxy_conn *connect_bsc(struct sockaddr_in *sa, int priv_nr, v
#define logp_ipbc_uid(ss, lvl, ipbc, trx_id) _logp_ipbc_uid(ss, lvl, __FILE__, __LINE__, ipbc, trx_id) #define logp_ipbc_uid(ss, lvl, ipbc, trx_id) _logp_ipbc_uid(ss, lvl, __FILE__, __LINE__, ipbc, trx_id)
static void _logp_ipbc_uid(unsigned int ss, unsigned int lvl, char *file, int line, static void _logp_ipbc_uid(unsigned int ss, unsigned int lvl, char *file, int line,
struct ipa_bts_conn *ipbc, u_int8_t trx_id) struct ipa_bts_conn *ipbc, uint8_t trx_id)
{ {
if (ipbc) if (ipbc)
logp2(ss, lvl, file, line, 0, "(%u/%u/%u) ", ipbc->unit_id.site_id, logp2(ss, lvl, file, line, 0, "(%u/%u/%u) ", ipbc->unit_id.site_id,
@ -312,12 +312,12 @@ static int udp_fd_cb(struct bsc_fd *bfd, unsigned int what)
static int ipbc_alloc_connect(struct ipa_proxy_conn *ipc, struct bsc_fd *bfd, static int ipbc_alloc_connect(struct ipa_proxy_conn *ipc, struct bsc_fd *bfd,
u_int16_t site_id, u_int16_t bts_id, uint16_t site_id, uint16_t bts_id,
u_int16_t trx_id, struct tlv_parsed *tlvp, uint16_t trx_id, struct tlv_parsed *tlvp,
struct msgb *msg) struct msgb *msg)
{ {
struct ipa_bts_conn *ipbc; struct ipa_bts_conn *ipbc;
u_int16_t udp_port; uint16_t udp_port;
int ret = 0; int ret = 0;
struct sockaddr_in sin; struct sockaddr_in sin;
@ -437,8 +437,8 @@ static int ipaccess_rcvmsg(struct ipa_proxy_conn *ipc, struct msgb *msg,
struct bsc_fd *bfd) struct bsc_fd *bfd)
{ {
struct tlv_parsed tlvp; struct tlv_parsed tlvp;
u_int8_t msg_type = *(msg->l2h); uint8_t msg_type = *(msg->l2h);
u_int16_t site_id, bts_id, trx_id; uint16_t site_id, bts_id, trx_id;
struct ipa_bts_conn *ipbc; struct ipa_bts_conn *ipbc;
int ret = 0; int ret = 0;
@ -452,7 +452,7 @@ static int ipaccess_rcvmsg(struct ipa_proxy_conn *ipc, struct msgb *msg,
case IPAC_MSGT_ID_RESP: case IPAC_MSGT_ID_RESP:
DEBUGP(DMI, "ID_RESP "); DEBUGP(DMI, "ID_RESP ");
/* parse tags, search for Unit ID */ /* parse tags, search for Unit ID */
ipaccess_idtag_parse(&tlvp, (u_int8_t *)msg->l2h + 2, ipaccess_idtag_parse(&tlvp, (uint8_t *)msg->l2h + 2,
msgb_l2len(msg)-2); msgb_l2len(msg)-2);
DEBUGP(DMI, "\n"); DEBUGP(DMI, "\n");
@ -749,16 +749,16 @@ static void patch_gprs_msg(struct ipa_bts_conn *ipbc, int priv_nr, struct msgb *
msg->l2h[2] == 0x00 && msg->l2h[3] == 0x15 && msg->l2h[2] == 0x00 && msg->l2h[3] == 0x15 &&
msg->l2h[18] == 0xf5 && msg->l2h[19] == 0xf2) { msg->l2h[18] == 0xf5 && msg->l2h[19] == 0xf2) {
nsvci = &msg->l2h[23]; nsvci = &msg->l2h[23];
ipbc->gprs_orig_port = *(u_int16_t *)(nsvci+8); ipbc->gprs_orig_port = *(uint16_t *)(nsvci+8);
ipbc->gprs_orig_ip = *(u_int32_t *)(nsvci+10); ipbc->gprs_orig_ip = *(uint32_t *)(nsvci+10);
*(u_int16_t *)(nsvci+8) = htons(ipbc->gprs_local_port); *(uint16_t *)(nsvci+8) = htons(ipbc->gprs_local_port);
*(u_int32_t *)(nsvci+10) = ipbc->ipp->listen_addr.s_addr; *(uint32_t *)(nsvci+10) = ipbc->ipp->listen_addr.s_addr;
} else if (msg->l2h[0] == 0x10 && msg->l2h[1] == 0x80 && } else if (msg->l2h[0] == 0x10 && msg->l2h[1] == 0x80 &&
msg->l2h[2] == 0x00 && msg->l2h[3] == 0x15 && msg->l2h[2] == 0x00 && msg->l2h[3] == 0x15 &&
msg->l2h[18] == 0xf6 && msg->l2h[19] == 0xf2) { msg->l2h[18] == 0xf6 && msg->l2h[19] == 0xf2) {
nsvci = &msg->l2h[23]; nsvci = &msg->l2h[23];
*(u_int16_t *)(nsvci+8) = ipbc->gprs_orig_port; *(uint16_t *)(nsvci+8) = ipbc->gprs_orig_port;
*(u_int32_t *)(nsvci+10) = ipbc->gprs_orig_ip; *(uint32_t *)(nsvci+10) = ipbc->gprs_orig_ip;
} }
} }

View File

@ -75,37 +75,37 @@ static void *tall_sigl_ctx;
#define PCAP_OUTPUT 1 #define PCAP_OUTPUT 1
struct pcap_hdr { struct pcap_hdr {
u_int32_t magic_number; uint32_t magic_number;
u_int16_t version_major; uint16_t version_major;
u_int16_t version_minor; uint16_t version_minor;
int32_t thiszone; int32_t thiszone;
u_int32_t sigfigs; uint32_t sigfigs;
u_int32_t snaplen; uint32_t snaplen;
u_int32_t network; uint32_t network;
} __attribute__((packed)); } __attribute__((packed));
struct pcaprec_hdr { struct pcaprec_hdr {
u_int32_t ts_sec; uint32_t ts_sec;
u_int32_t ts_usec; uint32_t ts_usec;
u_int32_t incl_len; uint32_t incl_len;
u_int32_t orig_len; uint32_t orig_len;
} __attribute__((packed)); } __attribute__((packed));
struct fake_linux_lapd_header { struct fake_linux_lapd_header {
u_int16_t pkttype; uint16_t pkttype;
u_int16_t hatype; uint16_t hatype;
u_int16_t halen; uint16_t halen;
u_int64_t addr; uint64_t addr;
int16_t protocol; int16_t protocol;
} __attribute__((packed)); } __attribute__((packed));
struct lapd_header { struct lapd_header {
u_int8_t ea1 : 1; uint8_t ea1 : 1;
u_int8_t cr : 1; uint8_t cr : 1;
u_int8_t sapi : 6; uint8_t sapi : 6;
u_int8_t ea2 : 1; uint8_t ea2 : 1;
u_int8_t tei : 7; uint8_t tei : 7;
u_int8_t control_foo; /* fake UM's ... */ uint8_t control_foo; /* fake UM's ... */
} __attribute__((packed)); } __attribute__((packed));
static_assert(offsetof(struct fake_linux_lapd_header, hatype) == 2, hatype_offset); static_assert(offsetof(struct fake_linux_lapd_header, hatype) == 2, hatype_offset);
@ -207,7 +207,7 @@ const char *e1inp_tstype_name(enum e1inp_ts_type tp)
} }
/* callback when a TRAU frame was received */ /* callback when a TRAU frame was received */
static int subch_cb(struct subch_demux *dmx, int ch, u_int8_t *data, int len, static int subch_cb(struct subch_demux *dmx, int ch, uint8_t *data, int len,
void *_priv) void *_priv)
{ {
struct e1inp_ts *e1i_ts = _priv; struct e1inp_ts *e1i_ts = _priv;
@ -324,7 +324,7 @@ int e1inp_ts_config(struct e1inp_ts *ts, struct e1inp_line *line,
return 0; return 0;
} }
struct e1inp_line *e1inp_line_get(u_int8_t e1_nr) struct e1inp_line *e1inp_line_get(uint8_t e1_nr)
{ {
struct e1inp_line *e1i_line; struct e1inp_line *e1i_line;
@ -336,7 +336,7 @@ struct e1inp_line *e1inp_line_get(u_int8_t e1_nr)
return NULL; return NULL;
} }
struct e1inp_line *e1inp_line_create(u_int8_t e1_nr, const char *driver_name) struct e1inp_line *e1inp_line_create(uint8_t e1_nr, const char *driver_name)
{ {
struct e1inp_driver *driver; struct e1inp_driver *driver;
struct e1inp_line *line; struct e1inp_line *line;
@ -373,7 +373,7 @@ struct e1inp_line *e1inp_line_create(u_int8_t e1_nr, const char *driver_name)
} }
#if 0 #if 0
struct e1inp_line *e1inp_line_get_create(u_int8_t e1_nr) struct e1inp_line *e1inp_line_get_create(uint8_t e1_nr)
{ {
struct e1inp_line *line; struct e1inp_line *line;
int i; int i;
@ -397,7 +397,7 @@ struct e1inp_line *e1inp_line_get_create(u_int8_t e1_nr)
} }
#endif #endif
static struct e1inp_ts *e1inp_ts_get(u_int8_t e1_nr, u_int8_t ts_nr) static struct e1inp_ts *e1inp_ts_get(uint8_t e1_nr, uint8_t ts_nr)
{ {
struct e1inp_line *e1i_line; struct e1inp_line *e1i_line;
@ -408,7 +408,7 @@ static struct e1inp_ts *e1inp_ts_get(u_int8_t e1_nr, u_int8_t ts_nr)
return &e1i_line->ts[ts_nr-1]; return &e1i_line->ts[ts_nr-1];
} }
struct subch_mux *e1inp_get_mux(u_int8_t e1_nr, u_int8_t ts_nr) struct subch_mux *e1inp_get_mux(uint8_t e1_nr, uint8_t ts_nr)
{ {
struct e1inp_ts *e1i_ts = e1inp_ts_get(e1_nr, ts_nr); struct e1inp_ts *e1i_ts = e1inp_ts_get(e1_nr, ts_nr);
@ -421,7 +421,7 @@ struct subch_mux *e1inp_get_mux(u_int8_t e1_nr, u_int8_t ts_nr)
/* Signalling Link */ /* Signalling Link */
struct e1inp_sign_link *e1inp_lookup_sign_link(struct e1inp_ts *e1i, struct e1inp_sign_link *e1inp_lookup_sign_link(struct e1inp_ts *e1i,
u_int8_t tei, u_int8_t sapi) uint8_t tei, uint8_t sapi)
{ {
struct e1inp_sign_link *link; struct e1inp_sign_link *link;
@ -437,8 +437,8 @@ struct e1inp_sign_link *e1inp_lookup_sign_link(struct e1inp_ts *e1i,
struct e1inp_sign_link * struct e1inp_sign_link *
e1inp_sign_link_create(struct e1inp_ts *ts, enum e1inp_sign_type type, e1inp_sign_link_create(struct e1inp_ts *ts, enum e1inp_sign_type type,
struct gsm_bts_trx *trx, u_int8_t tei, struct gsm_bts_trx *trx, uint8_t tei,
u_int8_t sapi) uint8_t sapi)
{ {
struct e1inp_sign_link *link; struct e1inp_sign_link *link;
@ -479,7 +479,7 @@ void e1inp_sign_link_destroy(struct e1inp_sign_link *link)
/* the E1 driver tells us he has received something on a TS */ /* the E1 driver tells us he has received something on a TS */
int e1inp_rx_ts(struct e1inp_ts *ts, struct msgb *msg, int e1inp_rx_ts(struct e1inp_ts *ts, struct msgb *msg,
u_int8_t tei, u_int8_t sapi) uint8_t tei, uint8_t sapi)
{ {
struct e1inp_sign_link *link; struct e1inp_sign_link *link;
struct gsm_bts *bts; struct gsm_bts *bts;
@ -562,7 +562,7 @@ struct msgb *e1inp_tx_ts(struct e1inp_ts *e1i_ts,
} }
/* called by driver in case some kind of link state event */ /* called by driver in case some kind of link state event */
int e1inp_event(struct e1inp_ts *ts, int evt, u_int8_t tei, u_int8_t sapi) int e1inp_event(struct e1inp_ts *ts, int evt, uint8_t tei, uint8_t sapi)
{ {
struct e1inp_sign_link *link; struct e1inp_sign_link *link;
struct input_signal_data isd; struct input_signal_data isd;

View File

@ -231,14 +231,14 @@ static int handle_ts1_write(struct bsc_fd *bfd)
static int invertbits = 1; static int invertbits = 1;
static u_int8_t flip_table[256]; static uint8_t flip_table[256];
static void init_flip_bits(void) static void init_flip_bits(void)
{ {
int i,k; int i,k;
for (i = 0 ; i < 256 ; i++) { for (i = 0 ; i < 256 ; i++) {
u_int8_t sample = 0 ; uint8_t sample = 0 ;
for (k = 0; k<8; k++) { for (k = 0; k<8; k++) {
if ( i & 1 << k ) sample |= 0x80 >> k; if ( i & 1 << k ) sample |= 0x80 >> k;
} }
@ -246,13 +246,13 @@ static void init_flip_bits(void)
} }
} }
static u_int8_t * flip_buf_bits ( u_int8_t * buf , int len) static uint8_t * flip_buf_bits ( uint8_t * buf , int len)
{ {
int i; int i;
u_int8_t * start = buf; uint8_t * start = buf;
for (i = 0 ; i < len; i++) { for (i = 0 ; i < len; i++) {
buf[i] = flip_table[(u_int8_t)buf[i]]; buf[i] = flip_table[(uint8_t)buf[i]];
} }
return start; return start;
@ -265,7 +265,7 @@ static int handle_tsX_write(struct bsc_fd *bfd)
struct e1inp_line *line = bfd->data; struct e1inp_line *line = bfd->data;
unsigned int ts_nr = bfd->priv_nr; unsigned int ts_nr = bfd->priv_nr;
struct e1inp_ts *e1i_ts = &line->ts[ts_nr-1]; struct e1inp_ts *e1i_ts = &line->ts[ts_nr-1];
u_int8_t tx_buf[D_BCHAN_TX_GRAN]; uint8_t tx_buf[D_BCHAN_TX_GRAN];
struct subch_mux *mx = &e1i_ts->trau.mux; struct subch_mux *mx = &e1i_ts->trau.mux;
int ret; int ret;

View File

@ -298,7 +298,7 @@ static int handle_ts1_write(struct bsc_fd *bfd)
struct e1inp_ts *e1i_ts = &line->ts[ts_nr-1]; struct e1inp_ts *e1i_ts = &line->ts[ts_nr-1];
struct e1inp_sign_link *sign_link; struct e1inp_sign_link *sign_link;
struct msgb *msg; struct msgb *msg;
u_int8_t proto; uint8_t proto;
int ret; int ret;
bfd->when &= ~BSC_FD_WRITE; bfd->when &= ~BSC_FD_WRITE;

View File

@ -68,15 +68,15 @@ static struct ia_e1_handle *e1h;
* - ID_REQUEST: first messages once OML has been established. * - ID_REQUEST: first messages once OML has been established.
* - ID_ACK: in reply to ID_ACK. * - ID_ACK: in reply to ID_ACK.
*/ */
const u_int8_t ipa_pong_msg[] = { const uint8_t ipa_pong_msg[] = {
0, 1, IPAC_PROTO_IPACCESS, IPAC_MSGT_PONG 0, 1, IPAC_PROTO_IPACCESS, IPAC_MSGT_PONG
}; };
const u_int8_t ipa_id_ack_msg[] = { const uint8_t ipa_id_ack_msg[] = {
0, 1, IPAC_PROTO_IPACCESS, IPAC_MSGT_ID_ACK 0, 1, IPAC_PROTO_IPACCESS, IPAC_MSGT_ID_ACK
}; };
const u_int8_t ipa_id_req_msg[] = { const uint8_t ipa_id_req_msg[] = {
0, 17, IPAC_PROTO_IPACCESS, IPAC_MSGT_ID_GET, 0, 17, IPAC_PROTO_IPACCESS, IPAC_MSGT_ID_GET,
0x01, IPAC_IDTAG_UNIT, 0x01, IPAC_IDTAG_UNIT,
0x01, IPAC_IDTAG_MACADDR, 0x01, IPAC_IDTAG_MACADDR,
@ -110,9 +110,9 @@ const char *ipaccess_idtag_name(uint8_t tag)
int ipaccess_idtag_parse(struct tlv_parsed *dec, unsigned char *buf, int len) int ipaccess_idtag_parse(struct tlv_parsed *dec, unsigned char *buf, int len)
{ {
u_int8_t t_len; uint8_t t_len;
u_int8_t t_tag; uint8_t t_tag;
u_int8_t *cur = buf; uint8_t *cur = buf;
memset(dec, 0, sizeof(*dec)); memset(dec, 0, sizeof(*dec));
@ -138,7 +138,7 @@ int ipaccess_idtag_parse(struct tlv_parsed *dec, unsigned char *buf, int len)
} }
struct gsm_bts *find_bts_by_unitid(struct gsm_network *net, struct gsm_bts *find_bts_by_unitid(struct gsm_network *net,
u_int16_t site_id, u_int16_t bts_id) uint16_t site_id, uint16_t bts_id)
{ {
struct gsm_bts *bts; struct gsm_bts *bts;
@ -155,8 +155,8 @@ struct gsm_bts *find_bts_by_unitid(struct gsm_network *net,
return NULL; return NULL;
} }
int ipaccess_parse_unitid(const char *str, u_int16_t *site_id, int ipaccess_parse_unitid(const char *str, uint16_t *site_id,
u_int16_t *bts_id, u_int16_t *trx_id) uint16_t *bts_id, uint16_t *trx_id)
{ {
unsigned long ul; unsigned long ul;
char *endptr; char *endptr;
@ -225,7 +225,7 @@ int ipaccess_send_id_req(int fd)
int ipaccess_rcvmsg_base(struct msgb *msg, int ipaccess_rcvmsg_base(struct msgb *msg,
struct bsc_fd *bfd) struct bsc_fd *bfd)
{ {
u_int8_t msg_type = *(msg->l2h); uint8_t msg_type = *(msg->l2h);
int ret = 0; int ret = 0;
switch (msg_type) { switch (msg_type) {
@ -247,8 +247,8 @@ static int ipaccess_rcvmsg(struct e1inp_line *line, struct msgb *msg,
struct bsc_fd *bfd) struct bsc_fd *bfd)
{ {
struct tlv_parsed tlvp; struct tlv_parsed tlvp;
u_int8_t msg_type = *(msg->l2h); uint8_t msg_type = *(msg->l2h);
u_int16_t site_id = 0, bts_id = 0, trx_id = 0; uint16_t site_id = 0, bts_id = 0, trx_id = 0;
struct gsm_bts *bts; struct gsm_bts *bts;
char *unitid; char *unitid;
int len, ret; int len, ret;
@ -260,7 +260,7 @@ static int ipaccess_rcvmsg(struct e1inp_line *line, struct msgb *msg,
case IPAC_MSGT_ID_RESP: case IPAC_MSGT_ID_RESP:
DEBUGP(DMI, "ID_RESP "); DEBUGP(DMI, "ID_RESP ");
/* parse tags, search for Unit ID */ /* parse tags, search for Unit ID */
ret = ipaccess_idtag_parse(&tlvp, (u_int8_t *)msg->l2h + 2, ret = ipaccess_idtag_parse(&tlvp, (uint8_t *)msg->l2h + 2,
msgb_l2len(msg)-2); msgb_l2len(msg)-2);
DEBUGP(DMI, "\n"); DEBUGP(DMI, "\n");
if (ret < 0) { if (ret < 0) {
@ -596,7 +596,7 @@ static int handle_ts1_write(struct bsc_fd *bfd)
struct e1inp_ts *e1i_ts = &line->ts[ts_nr-1]; struct e1inp_ts *e1i_ts = &line->ts[ts_nr-1];
struct e1inp_sign_link *sign_link; struct e1inp_sign_link *sign_link;
struct msgb *msg; struct msgb *msg;
u_int8_t proto; uint8_t proto;
int ret; int ret;
bfd->when &= ~BSC_FD_WRITE; bfd->when &= ~BSC_FD_WRITE;

View File

@ -210,7 +210,7 @@ static int handle_ts1_write(struct bsc_fd *bfd)
struct sockaddr_mISDN sa; struct sockaddr_mISDN sa;
struct msgb *msg; struct msgb *msg;
struct mISDNhead *hh; struct mISDNhead *hh;
u_int8_t *l2_data; uint8_t *l2_data;
int ret; int ret;
bfd->when &= ~BSC_FD_WRITE; bfd->when &= ~BSC_FD_WRITE;
@ -260,7 +260,7 @@ static int handle_tsX_write(struct bsc_fd *bfd)
unsigned int ts_nr = bfd->priv_nr; unsigned int ts_nr = bfd->priv_nr;
struct e1inp_ts *e1i_ts = &line->ts[ts_nr-1]; struct e1inp_ts *e1i_ts = &line->ts[ts_nr-1];
struct mISDNhead *hh; struct mISDNhead *hh;
u_int8_t tx_buf[BCHAN_TX_GRAN + sizeof(*hh)]; uint8_t tx_buf[BCHAN_TX_GRAN + sizeof(*hh)];
struct subch_mux *mx = &e1i_ts->trau.mux; struct subch_mux *mx = &e1i_ts->trau.mux;
int ret; int ret;

View File

@ -190,7 +190,7 @@ static const struct value_string nack_cause_names[] = {
{ 0, NULL } { 0, NULL }
}; };
static const char *nack_cause_name(u_int8_t cause) static const char *nack_cause_name(uint8_t cause)
{ {
return get_value_string(nack_cause_names, cause); return get_value_string(nack_cause_names, cause);
} }
@ -205,7 +205,7 @@ static const struct value_string event_type_names[] = {
{ 0, NULL } { 0, NULL }
}; };
static const char *event_type_name(u_int8_t cause) static const char *event_type_name(uint8_t cause)
{ {
return get_value_string(event_type_names, cause); return get_value_string(event_type_names, cause);
} }
@ -221,7 +221,7 @@ static const struct value_string severity_names[] = {
{ 0, NULL } { 0, NULL }
}; };
static const char *severity_name(u_int8_t cause) static const char *severity_name(uint8_t cause)
{ {
return get_value_string(severity_names, cause); return get_value_string(severity_names, cause);
} }
@ -343,7 +343,7 @@ int abis_nm_chcomb4pchan(enum gsm_phys_chan_config pchan)
return -EINVAL; return -EINVAL;
} }
int abis_nm_tlv_parse(struct tlv_parsed *tp, struct gsm_bts *bts, const u_int8_t *buf, int len) int abis_nm_tlv_parse(struct tlv_parsed *tp, struct gsm_bts *bts, const uint8_t *buf, int len)
{ {
if (!bts->model) if (!bts->model)
return -EIO; return -EIO;
@ -379,7 +379,7 @@ static int is_report(enum abis_nm_msgtype mt)
#define MT_ACK(x) (x+1) #define MT_ACK(x) (x+1)
#define MT_NACK(x) (x+2) #define MT_NACK(x) (x+2)
static void fill_om_hdr(struct abis_om_hdr *oh, u_int8_t len) static void fill_om_hdr(struct abis_om_hdr *oh, uint8_t len)
{ {
oh->mdisc = ABIS_OM_MDISC_FOM; oh->mdisc = ABIS_OM_MDISC_FOM;
oh->placement = ABIS_OM_PLACEMENT_ONLY; oh->placement = ABIS_OM_PLACEMENT_ONLY;
@ -387,9 +387,9 @@ static void fill_om_hdr(struct abis_om_hdr *oh, u_int8_t len)
oh->length = len; oh->length = len;
} }
static void fill_om_fom_hdr(struct abis_om_hdr *oh, u_int8_t len, static void fill_om_fom_hdr(struct abis_om_hdr *oh, uint8_t len,
u_int8_t msg_type, u_int8_t obj_class, uint8_t msg_type, uint8_t obj_class,
u_int8_t bts_nr, u_int8_t trx_nr, u_int8_t ts_nr) uint8_t bts_nr, uint8_t trx_nr, uint8_t ts_nr)
{ {
struct abis_om_fom_hdr *foh = struct abis_om_fom_hdr *foh =
(struct abis_om_fom_hdr *) oh->data; (struct abis_om_fom_hdr *) oh->data;
@ -459,12 +459,12 @@ const struct value_string abis_nm_obj_class_names[] = {
{ 0, NULL } { 0, NULL }
}; };
static const char *obj_class_name(u_int8_t oc) static const char *obj_class_name(uint8_t oc)
{ {
return get_value_string(abis_nm_obj_class_names, oc); return get_value_string(abis_nm_obj_class_names, oc);
} }
const char *nm_opstate_name(u_int8_t os) const char *nm_opstate_name(uint8_t os)
{ {
switch (os) { switch (os) {
case NM_OPSTATE_DISABLED: case NM_OPSTATE_DISABLED:
@ -492,7 +492,7 @@ static const struct value_string avail_names[] = {
{ 0, NULL } { 0, NULL }
}; };
const char *nm_avail_name(u_int8_t avail) const char *nm_avail_name(uint8_t avail)
{ {
return get_value_string(avail_names, avail); return get_value_string(avail_names, avail);
} }
@ -517,7 +517,7 @@ const struct value_string abis_nm_adm_state_names[] = {
{ 0, NULL } { 0, NULL }
}; };
const char *nm_adm_name(u_int8_t adm) const char *nm_adm_name(uint8_t adm)
{ {
return get_value_string(abis_nm_adm_state_names, adm); return get_value_string(abis_nm_adm_state_names, adm);
} }
@ -539,7 +539,7 @@ static void debugp_foh(struct abis_om_fom_hdr *foh)
/* obtain the gsm_nm_state data structure for a given object instance */ /* obtain the gsm_nm_state data structure for a given object instance */
static struct gsm_nm_state * static struct gsm_nm_state *
objclass2nmstate(struct gsm_bts *bts, u_int8_t obj_class, objclass2nmstate(struct gsm_bts *bts, uint8_t obj_class,
struct abis_om_obj_inst *obj_inst) struct abis_om_obj_inst *obj_inst)
{ {
struct gsm_bts_trx *trx; struct gsm_bts_trx *trx;
@ -623,7 +623,7 @@ objclass2nmstate(struct gsm_bts *bts, u_int8_t obj_class,
/* obtain the in-memory data structure of a given object instance */ /* obtain the in-memory data structure of a given object instance */
static void * static void *
objclass2obj(struct gsm_bts *bts, u_int8_t obj_class, objclass2obj(struct gsm_bts *bts, uint8_t obj_class,
struct abis_om_obj_inst *obj_inst) struct abis_om_obj_inst *obj_inst)
{ {
struct gsm_bts_trx *trx; struct gsm_bts_trx *trx;
@ -679,8 +679,8 @@ objclass2obj(struct gsm_bts *bts, u_int8_t obj_class,
/* Update the administrative state of a given object in our in-memory data /* Update the administrative state of a given object in our in-memory data
* structures and send an event to the higher layer */ * structures and send an event to the higher layer */
static int update_admstate(struct gsm_bts *bts, u_int8_t obj_class, static int update_admstate(struct gsm_bts *bts, uint8_t obj_class,
struct abis_om_obj_inst *obj_inst, u_int8_t adm_state) struct abis_om_obj_inst *obj_inst, uint8_t adm_state)
{ {
struct gsm_nm_state *nm_state, new_state; struct gsm_nm_state *nm_state, new_state;
struct nm_statechg_signal_data nsd; struct nm_statechg_signal_data nsd;
@ -816,7 +816,7 @@ static int rx_fail_evt_rep(struct msgb *mb)
static int abis_nm_rcvmsg_report(struct msgb *mb) static int abis_nm_rcvmsg_report(struct msgb *mb)
{ {
struct abis_om_fom_hdr *foh = msgb_l3(mb); struct abis_om_fom_hdr *foh = msgb_l3(mb);
u_int8_t mt = foh->msg_type; uint8_t mt = foh->msg_type;
debugp_foh(foh); debugp_foh(foh);
@ -848,13 +848,13 @@ static int abis_nm_rcvmsg_report(struct msgb *mb)
} }
/* Activate the specified software into the BTS */ /* Activate the specified software into the BTS */
static int ipacc_sw_activate(struct gsm_bts *bts, u_int8_t obj_class, u_int8_t i0, u_int8_t i1, static int ipacc_sw_activate(struct gsm_bts *bts, uint8_t obj_class, uint8_t i0, uint8_t i1,
u_int8_t i2, const u_int8_t *sw_desc, u_int8_t swdesc_len) uint8_t i2, const uint8_t *sw_desc, uint8_t swdesc_len)
{ {
struct abis_om_hdr *oh; struct abis_om_hdr *oh;
struct msgb *msg = nm_msgb_alloc(); struct msgb *msg = nm_msgb_alloc();
u_int8_t len = swdesc_len; uint8_t len = swdesc_len;
u_int8_t *trailer; uint8_t *trailer;
oh = (struct abis_om_hdr *) msgb_put(msg, ABIS_OM_FOM_HDR_SIZE); oh = (struct abis_om_hdr *) msgb_put(msg, ABIS_OM_FOM_HDR_SIZE);
fill_om_fom_hdr(oh, len, NM_MT_ACTIVATE_SW, obj_class, i0, i1, i2); fill_om_fom_hdr(oh, len, NM_MT_ACTIVATE_SW, obj_class, i0, i1, i2);
@ -865,7 +865,7 @@ static int ipacc_sw_activate(struct gsm_bts *bts, u_int8_t obj_class, u_int8_t i
return abis_nm_sendmsg(bts, msg); return abis_nm_sendmsg(bts, msg);
} }
static int abis_nm_parse_sw_descr(const u_int8_t *sw_descr, int sw_descr_len) static int abis_nm_parse_sw_descr(const uint8_t *sw_descr, int sw_descr_len)
{ {
static const struct tlv_definition sw_descr_def = { static const struct tlv_definition sw_descr_def = {
.def = { .def = {
@ -874,9 +874,9 @@ static int abis_nm_parse_sw_descr(const u_int8_t *sw_descr, int sw_descr_len)
}, },
}; };
u_int8_t tag; uint8_t tag;
u_int16_t tag_len; uint16_t tag_len;
const u_int8_t *val; const uint8_t *val;
int ofs = 0, len; int ofs = 0, len;
/* Classic TLV parsing doesn't work well with SW_DESCR because of it's /* Classic TLV parsing doesn't work well with SW_DESCR because of it's
@ -913,7 +913,7 @@ static int abis_nm_rx_sw_act_req(struct msgb *mb)
struct abis_om_hdr *oh = msgb_l2(mb); struct abis_om_hdr *oh = msgb_l2(mb);
struct abis_om_fom_hdr *foh = msgb_l3(mb); struct abis_om_fom_hdr *foh = msgb_l3(mb);
struct tlv_parsed tp; struct tlv_parsed tp;
const u_int8_t *sw_config; const uint8_t *sw_config;
int ret, sw_config_len, sw_descr_len; int ret, sw_config_len, sw_descr_len;
debugp_foh(foh); debugp_foh(foh);
@ -956,7 +956,7 @@ static int abis_nm_rx_chg_adm_state_ack(struct msgb *mb)
struct abis_om_hdr *oh = msgb_l2(mb); struct abis_om_hdr *oh = msgb_l2(mb);
struct abis_om_fom_hdr *foh = msgb_l3(mb); struct abis_om_fom_hdr *foh = msgb_l3(mb);
struct tlv_parsed tp; struct tlv_parsed tp;
u_int8_t adm_state; uint8_t adm_state;
abis_nm_tlv_parse(&tp, mb->trx->bts, foh->data, oh->length-sizeof(*foh)); abis_nm_tlv_parse(&tp, mb->trx->bts, foh->data, oh->length-sizeof(*foh));
if (!TLVP_PRESENT(&tp, NM_ATT_ADM_STATE)) if (!TLVP_PRESENT(&tp, NM_ATT_ADM_STATE))
@ -977,12 +977,12 @@ static int abis_nm_rx_lmt_event(struct msgb *mb)
abis_nm_tlv_parse(&tp, mb->trx->bts, foh->data, oh->length-sizeof(*foh)); abis_nm_tlv_parse(&tp, mb->trx->bts, foh->data, oh->length-sizeof(*foh));
if (TLVP_PRESENT(&tp, NM_ATT_BS11_LMT_LOGON_SESSION) && if (TLVP_PRESENT(&tp, NM_ATT_BS11_LMT_LOGON_SESSION) &&
TLVP_LEN(&tp, NM_ATT_BS11_LMT_LOGON_SESSION) >= 1) { TLVP_LEN(&tp, NM_ATT_BS11_LMT_LOGON_SESSION) >= 1) {
u_int8_t onoff = *TLVP_VAL(&tp, NM_ATT_BS11_LMT_LOGON_SESSION); uint8_t onoff = *TLVP_VAL(&tp, NM_ATT_BS11_LMT_LOGON_SESSION);
DEBUGPC(DNM, "LOG%s ", onoff ? "ON" : "OFF"); DEBUGPC(DNM, "LOG%s ", onoff ? "ON" : "OFF");
} }
if (TLVP_PRESENT(&tp, NM_ATT_BS11_LMT_USER_ACC_LEV) && if (TLVP_PRESENT(&tp, NM_ATT_BS11_LMT_USER_ACC_LEV) &&
TLVP_LEN(&tp, NM_ATT_BS11_LMT_USER_ACC_LEV) >= 1) { TLVP_LEN(&tp, NM_ATT_BS11_LMT_USER_ACC_LEV) >= 1) {
u_int8_t level = *TLVP_VAL(&tp, NM_ATT_BS11_LMT_USER_ACC_LEV); uint8_t level = *TLVP_VAL(&tp, NM_ATT_BS11_LMT_USER_ACC_LEV);
DEBUGPC(DNM, "Level=%u ", level); DEBUGPC(DNM, "Level=%u ", level);
} }
if (TLVP_PRESENT(&tp, NM_ATT_BS11_LMT_USER_NAME) && if (TLVP_PRESENT(&tp, NM_ATT_BS11_LMT_USER_NAME) &&
@ -1017,7 +1017,7 @@ static int abis_nm_rcvmsg_fom(struct msgb *mb)
{ {
struct abis_om_hdr *oh = msgb_l2(mb); struct abis_om_hdr *oh = msgb_l2(mb);
struct abis_om_fom_hdr *foh = msgb_l3(mb); struct abis_om_fom_hdr *foh = msgb_l3(mb);
u_int8_t mt = foh->msg_type; uint8_t mt = foh->msg_type;
int ret = 0; int ret = 0;
/* check for unsolicited message */ /* check for unsolicited message */
@ -1138,7 +1138,7 @@ int abis_nm_rcvmsg(struct msgb *msg)
return -EINVAL; return -EINVAL;
} }
#if 0 #if 0
unsigned int l2_len = msg->tail - (u_int8_t *)msgb_l2(msg); unsigned int l2_len = msg->tail - (uint8_t *)msgb_l2(msg);
unsigned int hlen = sizeof(*oh) + sizeof(struct abis_om_fom_hdr); unsigned int hlen = sizeof(*oh) + sizeof(struct abis_om_fom_hdr);
if (oh->length + hlen > l2_len) { if (oh->length + hlen > l2_len) {
LOGP(DNM, LOGL_ERROR, "ABIS OML truncated message (%u > %u)\n", LOGP(DNM, LOGL_ERROR, "ABIS OML truncated message (%u > %u)\n",
@ -1219,17 +1219,17 @@ struct abis_nm_sw {
int forced; int forced;
/* this will become part of the SW LOAD INITIATE */ /* this will become part of the SW LOAD INITIATE */
u_int8_t obj_class; uint8_t obj_class;
u_int8_t obj_instance[3]; uint8_t obj_instance[3];
u_int8_t file_id[255]; uint8_t file_id[255];
u_int8_t file_id_len; uint8_t file_id_len;
u_int8_t file_version[255]; uint8_t file_version[255];
u_int8_t file_version_len; uint8_t file_version_len;
u_int8_t window_size; uint8_t window_size;
u_int8_t seg_in_window; uint8_t seg_in_window;
int fd; int fd;
FILE *stream; FILE *stream;
@ -1260,7 +1260,7 @@ static int sw_load_init(struct abis_nm_sw *sw)
{ {
struct abis_om_hdr *oh; struct abis_om_hdr *oh;
struct msgb *msg = nm_msgb_alloc(); struct msgb *msg = nm_msgb_alloc();
u_int8_t len = 3*2 + sw->file_id_len + sw->file_version_len; uint8_t len = 3*2 + sw->file_id_len + sw->file_version_len;
oh = (struct abis_om_hdr *) msgb_put(msg, ABIS_OM_FOM_HDR_SIZE); oh = (struct abis_om_hdr *) msgb_put(msg, ABIS_OM_FOM_HDR_SIZE);
fill_om_fom_hdr(oh, len, NM_MT_LOAD_INIT, sw->obj_class, fill_om_fom_hdr(oh, len, NM_MT_LOAD_INIT, sw->obj_class,
@ -1297,7 +1297,7 @@ static int sw_load_segment(struct abis_nm_sw *sw)
char seg_buf[256]; char seg_buf[256];
char *line_buf = seg_buf+2; char *line_buf = seg_buf+2;
unsigned char *tlv; unsigned char *tlv;
u_int8_t len; uint8_t len;
oh = (struct abis_om_hdr *) msgb_put(msg, ABIS_OM_FOM_HDR_SIZE); oh = (struct abis_om_hdr *) msgb_put(msg, ABIS_OM_FOM_HDR_SIZE);
@ -1318,7 +1318,7 @@ static int sw_load_segment(struct abis_nm_sw *sw)
len = strlen(line_buf) + 2; len = strlen(line_buf) + 2;
tlv = msgb_put(msg, TLV_GROSS_LEN(len)); tlv = msgb_put(msg, TLV_GROSS_LEN(len));
tlv_put(tlv, NM_ATT_BS11_FILE_DATA, len, (u_int8_t *)seg_buf); tlv_put(tlv, NM_ATT_BS11_FILE_DATA, len, (uint8_t *)seg_buf);
/* BS11 wants CR + LF in excess of the TLV length !?! */ /* BS11 wants CR + LF in excess of the TLV length !?! */
tlv[1] -= 2; tlv[1] -= 2;
@ -1337,7 +1337,7 @@ static int sw_load_segment(struct abis_nm_sw *sw)
sw->last_seg = 1; sw->last_seg = 1;
++sw->seg_in_window; ++sw->seg_in_window;
msgb_tl16v_put(msg, NM_ATT_IPACC_FILE_DATA, len, (const u_int8_t *) seg_buf); msgb_tl16v_put(msg, NM_ATT_IPACC_FILE_DATA, len, (const uint8_t *) seg_buf);
len += 3; len += 3;
break; break;
} }
@ -1359,7 +1359,7 @@ static int sw_load_end(struct abis_nm_sw *sw)
{ {
struct abis_om_hdr *oh; struct abis_om_hdr *oh;
struct msgb *msg = nm_msgb_alloc(); struct msgb *msg = nm_msgb_alloc();
u_int8_t len = 2*2 + sw->file_id_len + sw->file_version_len; uint8_t len = 2*2 + sw->file_id_len + sw->file_version_len;
oh = (struct abis_om_hdr *) msgb_put(msg, ABIS_OM_FOM_HDR_SIZE); oh = (struct abis_om_hdr *) msgb_put(msg, ABIS_OM_FOM_HDR_SIZE);
fill_om_fom_hdr(oh, len, NM_MT_LOAD_END, sw->obj_class, fill_om_fom_hdr(oh, len, NM_MT_LOAD_END, sw->obj_class,
@ -1375,7 +1375,7 @@ static int sw_activate(struct abis_nm_sw *sw)
{ {
struct abis_om_hdr *oh; struct abis_om_hdr *oh;
struct msgb *msg = nm_msgb_alloc(); struct msgb *msg = nm_msgb_alloc();
u_int8_t len = 2*2 + sw->file_id_len + sw->file_version_len; uint8_t len = 2*2 + sw->file_id_len + sw->file_version_len;
oh = (struct abis_om_hdr *) msgb_put(msg, ABIS_OM_FOM_HDR_SIZE); oh = (struct abis_om_hdr *) msgb_put(msg, ABIS_OM_FOM_HDR_SIZE);
fill_om_fom_hdr(oh, len, NM_MT_ACTIVATE_SW, sw->obj_class, fill_om_fom_hdr(oh, len, NM_MT_ACTIVATE_SW, sw->obj_class,
@ -1675,7 +1675,7 @@ static int abis_nm_rcvmsg_sw(struct msgb *mb)
/* Load the specified software into the BTS */ /* Load the specified software into the BTS */
int abis_nm_software_load(struct gsm_bts *bts, int trx_nr, const char *fname, int abis_nm_software_load(struct gsm_bts *bts, int trx_nr, const char *fname,
u_int8_t win_size, int forced, uint8_t win_size, int forced,
gsm_cbfn *cbfn, void *cb_data) gsm_cbfn *cbfn, void *cb_data)
{ {
struct abis_nm_sw *sw = &g_sw; struct abis_nm_sw *sw = &g_sw;
@ -1776,8 +1776,8 @@ int abis_nm_software_activate(struct gsm_bts *bts, const char *fname,
return sw_activate(sw); return sw_activate(sw);
} }
static void fill_nm_channel(struct abis_nm_channel *ch, u_int8_t bts_port, static void fill_nm_channel(struct abis_nm_channel *ch, uint8_t bts_port,
u_int8_t ts_nr, u_int8_t subslot_nr) uint8_t ts_nr, uint8_t subslot_nr)
{ {
ch->attrib = NM_ATT_ABIS_CHANNEL; ch->attrib = NM_ATT_ABIS_CHANNEL;
ch->bts_port = bts_port; ch->bts_port = bts_port;
@ -1785,13 +1785,13 @@ static void fill_nm_channel(struct abis_nm_channel *ch, u_int8_t bts_port,
ch->subslot = subslot_nr; ch->subslot = subslot_nr;
} }
int abis_nm_establish_tei(struct gsm_bts *bts, u_int8_t trx_nr, int abis_nm_establish_tei(struct gsm_bts *bts, uint8_t trx_nr,
u_int8_t e1_port, u_int8_t e1_timeslot, u_int8_t e1_subslot, uint8_t e1_port, uint8_t e1_timeslot, uint8_t e1_subslot,
u_int8_t tei) uint8_t tei)
{ {
struct abis_om_hdr *oh; struct abis_om_hdr *oh;
struct abis_nm_channel *ch; struct abis_nm_channel *ch;
u_int8_t len = sizeof(*ch) + 2; uint8_t len = sizeof(*ch) + 2;
struct msgb *msg = nm_msgb_alloc(); struct msgb *msg = nm_msgb_alloc();
oh = (struct abis_om_hdr *) msgb_put(msg, ABIS_OM_FOM_HDR_SIZE); oh = (struct abis_om_hdr *) msgb_put(msg, ABIS_OM_FOM_HDR_SIZE);
@ -1808,7 +1808,7 @@ int abis_nm_establish_tei(struct gsm_bts *bts, u_int8_t trx_nr,
/* connect signalling of one (BTS,TRX) to a particular timeslot on the E1 */ /* connect signalling of one (BTS,TRX) to a particular timeslot on the E1 */
int abis_nm_conn_terr_sign(struct gsm_bts_trx *trx, int abis_nm_conn_terr_sign(struct gsm_bts_trx *trx,
u_int8_t e1_port, u_int8_t e1_timeslot, u_int8_t e1_subslot) uint8_t e1_port, uint8_t e1_timeslot, uint8_t e1_subslot)
{ {
struct gsm_bts *bts = trx->bts; struct gsm_bts *bts = trx->bts;
struct abis_om_hdr *oh; struct abis_om_hdr *oh;
@ -1833,8 +1833,8 @@ int abis_nm_disc_terr_sign(struct abis_nm_h *h, struct abis_om_obj_inst *inst,
#endif #endif
int abis_nm_conn_terr_traf(struct gsm_bts_trx_ts *ts, int abis_nm_conn_terr_traf(struct gsm_bts_trx_ts *ts,
u_int8_t e1_port, u_int8_t e1_timeslot, uint8_t e1_port, uint8_t e1_timeslot,
u_int8_t e1_subslot) uint8_t e1_subslot)
{ {
struct gsm_bts *bts = ts->trx->bts; struct gsm_bts *bts = ts->trx->bts;
struct abis_om_hdr *oh; struct abis_om_hdr *oh;
@ -1858,17 +1858,17 @@ int abis_nm_conn_terr_traf(struct gsm_bts_trx_ts *ts,
#if 0 #if 0
int abis_nm_disc_terr_traf(struct abis_nm_h *h, struct abis_om_obj_inst *inst, int abis_nm_disc_terr_traf(struct abis_nm_h *h, struct abis_om_obj_inst *inst,
struct abis_nm_abis_channel *chan, struct abis_nm_abis_channel *chan,
u_int8_t subchan) uint8_t subchan)
{ {
} }
#endif #endif
/* Chapter 8.6.1 */ /* Chapter 8.6.1 */
int abis_nm_set_bts_attr(struct gsm_bts *bts, u_int8_t *attr, int attr_len) int abis_nm_set_bts_attr(struct gsm_bts *bts, uint8_t *attr, int attr_len)
{ {
struct abis_om_hdr *oh; struct abis_om_hdr *oh;
struct msgb *msg = nm_msgb_alloc(); struct msgb *msg = nm_msgb_alloc();
u_int8_t *cur; uint8_t *cur;
DEBUGP(DNM, "Set BTS Attr (bts=%d)\n", bts->nr); DEBUGP(DNM, "Set BTS Attr (bts=%d)\n", bts->nr);
@ -1881,11 +1881,11 @@ int abis_nm_set_bts_attr(struct gsm_bts *bts, u_int8_t *attr, int attr_len)
} }
/* Chapter 8.6.2 */ /* Chapter 8.6.2 */
int abis_nm_set_radio_attr(struct gsm_bts_trx *trx, u_int8_t *attr, int attr_len) int abis_nm_set_radio_attr(struct gsm_bts_trx *trx, uint8_t *attr, int attr_len)
{ {
struct abis_om_hdr *oh; struct abis_om_hdr *oh;
struct msgb *msg = nm_msgb_alloc(); struct msgb *msg = nm_msgb_alloc();
u_int8_t *cur; uint8_t *cur;
DEBUGP(DNM, "Set TRX Attr (bts=%d,trx=%d)\n", trx->bts->nr, trx->nr); DEBUGP(DNM, "Set TRX Attr (bts=%d,trx=%d)\n", trx->bts->nr, trx->nr);
@ -1898,7 +1898,7 @@ int abis_nm_set_radio_attr(struct gsm_bts_trx *trx, u_int8_t *attr, int attr_len
return abis_nm_sendmsg(trx->bts, msg); return abis_nm_sendmsg(trx->bts, msg);
} }
static int verify_chan_comb(struct gsm_bts_trx_ts *ts, u_int8_t chan_comb) static int verify_chan_comb(struct gsm_bts_trx_ts *ts, uint8_t chan_comb)
{ {
int i; int i;
@ -2033,13 +2033,13 @@ static int verify_chan_comb(struct gsm_bts_trx_ts *ts, u_int8_t chan_comb)
} }
/* Chapter 8.6.3 */ /* Chapter 8.6.3 */
int abis_nm_set_channel_attr(struct gsm_bts_trx_ts *ts, u_int8_t chan_comb) int abis_nm_set_channel_attr(struct gsm_bts_trx_ts *ts, uint8_t chan_comb)
{ {
struct gsm_bts *bts = ts->trx->bts; struct gsm_bts *bts = ts->trx->bts;
struct abis_om_hdr *oh; struct abis_om_hdr *oh;
u_int8_t zero = 0x00; uint8_t zero = 0x00;
struct msgb *msg = nm_msgb_alloc(); struct msgb *msg = nm_msgb_alloc();
u_int8_t len = 2 + 2; uint8_t len = 2 + 2;
if (bts->type == GSM_BTS_TYPE_BS11) if (bts->type == GSM_BTS_TYPE_BS11)
len += 4 + 2 + 2 + 3; len += 4 + 2 + 2 + 3;
@ -2086,13 +2086,13 @@ int abis_nm_set_channel_attr(struct gsm_bts_trx_ts *ts, u_int8_t chan_comb)
return abis_nm_sendmsg(bts, msg); return abis_nm_sendmsg(bts, msg);
} }
int abis_nm_sw_act_req_ack(struct gsm_bts *bts, u_int8_t obj_class, u_int8_t i1, int abis_nm_sw_act_req_ack(struct gsm_bts *bts, uint8_t obj_class, uint8_t i1,
u_int8_t i2, u_int8_t i3, int nack, u_int8_t *attr, int att_len) uint8_t i2, uint8_t i3, int nack, uint8_t *attr, int att_len)
{ {
struct abis_om_hdr *oh; struct abis_om_hdr *oh;
struct msgb *msg = nm_msgb_alloc(); struct msgb *msg = nm_msgb_alloc();
u_int8_t msgtype = NM_MT_SW_ACT_REQ_ACK; uint8_t msgtype = NM_MT_SW_ACT_REQ_ACK;
u_int8_t len = att_len; uint8_t len = att_len;
if (nack) { if (nack) {
len += 2; len += 2;
@ -2103,7 +2103,7 @@ int abis_nm_sw_act_req_ack(struct gsm_bts *bts, u_int8_t obj_class, u_int8_t i1,
fill_om_fom_hdr(oh, att_len, msgtype, obj_class, i1, i2, i3); fill_om_fom_hdr(oh, att_len, msgtype, obj_class, i1, i2, i3);
if (attr) { if (attr) {
u_int8_t *ptr = msgb_put(msg, att_len); uint8_t *ptr = msgb_put(msg, att_len);
memcpy(ptr, attr, att_len); memcpy(ptr, attr, att_len);
} }
if (nack) if (nack)
@ -2112,11 +2112,11 @@ int abis_nm_sw_act_req_ack(struct gsm_bts *bts, u_int8_t obj_class, u_int8_t i1,
return abis_nm_sendmsg_direct(bts, msg); return abis_nm_sendmsg_direct(bts, msg);
} }
int abis_nm_raw_msg(struct gsm_bts *bts, int len, u_int8_t *rawmsg) int abis_nm_raw_msg(struct gsm_bts *bts, int len, uint8_t *rawmsg)
{ {
struct msgb *msg = nm_msgb_alloc(); struct msgb *msg = nm_msgb_alloc();
struct abis_om_hdr *oh; struct abis_om_hdr *oh;
u_int8_t *data; uint8_t *data;
oh = (struct abis_om_hdr *) msgb_put(msg, sizeof(*oh)); oh = (struct abis_om_hdr *) msgb_put(msg, sizeof(*oh));
fill_om_hdr(oh, len); fill_om_hdr(oh, len);
@ -2127,7 +2127,7 @@ int abis_nm_raw_msg(struct gsm_bts *bts, int len, u_int8_t *rawmsg)
} }
/* Siemens specific commands */ /* Siemens specific commands */
static int __simple_cmd(struct gsm_bts *bts, u_int8_t msg_type) static int __simple_cmd(struct gsm_bts *bts, uint8_t msg_type)
{ {
struct abis_om_hdr *oh; struct abis_om_hdr *oh;
struct msgb *msg = nm_msgb_alloc(); struct msgb *msg = nm_msgb_alloc();
@ -2140,7 +2140,7 @@ static int __simple_cmd(struct gsm_bts *bts, u_int8_t msg_type)
} }
/* Chapter 8.9.2 */ /* Chapter 8.9.2 */
int abis_nm_opstart(struct gsm_bts *bts, u_int8_t obj_class, u_int8_t i0, u_int8_t i1, u_int8_t i2) int abis_nm_opstart(struct gsm_bts *bts, uint8_t obj_class, uint8_t i0, uint8_t i1, uint8_t i2)
{ {
struct abis_om_hdr *oh; struct abis_om_hdr *oh;
struct msgb *msg = nm_msgb_alloc(); struct msgb *msg = nm_msgb_alloc();
@ -2155,8 +2155,8 @@ int abis_nm_opstart(struct gsm_bts *bts, u_int8_t obj_class, u_int8_t i0, u_int8
} }
/* Chapter 8.8.5 */ /* Chapter 8.8.5 */
int abis_nm_chg_adm_state(struct gsm_bts *bts, u_int8_t obj_class, u_int8_t i0, int abis_nm_chg_adm_state(struct gsm_bts *bts, uint8_t obj_class, uint8_t i0,
u_int8_t i1, u_int8_t i2, enum abis_nm_adm_state adm_state) uint8_t i1, uint8_t i2, enum abis_nm_adm_state adm_state)
{ {
struct abis_om_hdr *oh; struct abis_om_hdr *oh;
struct msgb *msg = nm_msgb_alloc(); struct msgb *msg = nm_msgb_alloc();
@ -2168,12 +2168,12 @@ int abis_nm_chg_adm_state(struct gsm_bts *bts, u_int8_t obj_class, u_int8_t i0,
return abis_nm_sendmsg(bts, msg); return abis_nm_sendmsg(bts, msg);
} }
int abis_nm_conn_mdrop_link(struct gsm_bts *bts, u_int8_t e1_port0, u_int8_t ts0, int abis_nm_conn_mdrop_link(struct gsm_bts *bts, uint8_t e1_port0, uint8_t ts0,
u_int8_t e1_port1, u_int8_t ts1) uint8_t e1_port1, uint8_t ts1)
{ {
struct abis_om_hdr *oh; struct abis_om_hdr *oh;
struct msgb *msg = nm_msgb_alloc(); struct msgb *msg = nm_msgb_alloc();
u_int8_t *attr; uint8_t *attr;
DEBUGP(DNM, "CONNECT MDROP LINK E1=(%u,%u) -> E1=(%u, %u)\n", DEBUGP(DNM, "CONNECT MDROP LINK E1=(%u,%u) -> E1=(%u, %u)\n",
e1_port0, ts0, e1_port1, ts1); e1_port0, ts0, e1_port1, ts1);
@ -2196,9 +2196,9 @@ int abis_nm_conn_mdrop_link(struct gsm_bts *bts, u_int8_t e1_port0, u_int8_t ts0
} }
/* Chapter 8.7.1 */ /* Chapter 8.7.1 */
int abis_nm_perform_test(struct gsm_bts *bts, u_int8_t obj_class, int abis_nm_perform_test(struct gsm_bts *bts, uint8_t obj_class,
u_int8_t bts_nr, u_int8_t trx_nr, u_int8_t ts_nr, uint8_t bts_nr, uint8_t trx_nr, uint8_t ts_nr,
u_int8_t test_nr, u_int8_t auton_report, struct msgb *msg) uint8_t test_nr, uint8_t auton_report, struct msgb *msg)
{ {
struct abis_om_hdr *oh; struct abis_om_hdr *oh;
@ -2241,12 +2241,12 @@ int abis_nm_bs11_restart(struct gsm_bts *bts)
struct bs11_date_time { struct bs11_date_time {
u_int16_t year; uint16_t year;
u_int8_t month; uint8_t month;
u_int8_t day; uint8_t day;
u_int8_t hour; uint8_t hour;
u_int8_t min; uint8_t min;
u_int8_t sec; uint8_t sec;
} __attribute__((packed)); } __attribute__((packed));
@ -2279,12 +2279,12 @@ int abis_nm_bs11_db_transmission(struct gsm_bts *bts, int begin)
} }
int abis_nm_bs11_create_object(struct gsm_bts *bts, int abis_nm_bs11_create_object(struct gsm_bts *bts,
enum abis_bs11_objtype type, u_int8_t idx, enum abis_bs11_objtype type, uint8_t idx,
u_int8_t attr_len, const u_int8_t *attr) uint8_t attr_len, const uint8_t *attr)
{ {
struct abis_om_hdr *oh; struct abis_om_hdr *oh;
struct msgb *msg = nm_msgb_alloc(); struct msgb *msg = nm_msgb_alloc();
u_int8_t *cur; uint8_t *cur;
oh = (struct abis_om_hdr *) msgb_put(msg, ABIS_OM_FOM_HDR_SIZE); oh = (struct abis_om_hdr *) msgb_put(msg, ABIS_OM_FOM_HDR_SIZE);
fill_om_fom_hdr(oh, attr_len, NM_MT_BS11_CREATE_OBJ, fill_om_fom_hdr(oh, attr_len, NM_MT_BS11_CREATE_OBJ,
@ -2296,7 +2296,7 @@ int abis_nm_bs11_create_object(struct gsm_bts *bts,
} }
int abis_nm_bs11_delete_object(struct gsm_bts *bts, int abis_nm_bs11_delete_object(struct gsm_bts *bts,
enum abis_bs11_objtype type, u_int8_t idx) enum abis_bs11_objtype type, uint8_t idx)
{ {
struct abis_om_hdr *oh; struct abis_om_hdr *oh;
struct msgb *msg = nm_msgb_alloc(); struct msgb *msg = nm_msgb_alloc();
@ -2308,11 +2308,11 @@ int abis_nm_bs11_delete_object(struct gsm_bts *bts,
return abis_nm_sendmsg(bts, msg); return abis_nm_sendmsg(bts, msg);
} }
int abis_nm_bs11_create_envaBTSE(struct gsm_bts *bts, u_int8_t idx) int abis_nm_bs11_create_envaBTSE(struct gsm_bts *bts, uint8_t idx)
{ {
struct abis_om_hdr *oh; struct abis_om_hdr *oh;
struct msgb *msg = nm_msgb_alloc(); struct msgb *msg = nm_msgb_alloc();
u_int8_t zero = 0x00; uint8_t zero = 0x00;
oh = (struct abis_om_hdr *) msgb_put(msg, ABIS_OM_FOM_HDR_SIZE); oh = (struct abis_om_hdr *) msgb_put(msg, ABIS_OM_FOM_HDR_SIZE);
fill_om_fom_hdr(oh, 3, NM_MT_BS11_CREATE_OBJ, fill_om_fom_hdr(oh, 3, NM_MT_BS11_CREATE_OBJ,
@ -2322,7 +2322,7 @@ int abis_nm_bs11_create_envaBTSE(struct gsm_bts *bts, u_int8_t idx)
return abis_nm_sendmsg(bts, msg); return abis_nm_sendmsg(bts, msg);
} }
int abis_nm_bs11_create_bport(struct gsm_bts *bts, u_int8_t idx) int abis_nm_bs11_create_bport(struct gsm_bts *bts, uint8_t idx)
{ {
struct abis_om_hdr *oh; struct abis_om_hdr *oh;
struct msgb *msg = nm_msgb_alloc(); struct msgb *msg = nm_msgb_alloc();
@ -2334,7 +2334,7 @@ int abis_nm_bs11_create_bport(struct gsm_bts *bts, u_int8_t idx)
return abis_nm_sendmsg(bts, msg); return abis_nm_sendmsg(bts, msg);
} }
int abis_nm_bs11_delete_bport(struct gsm_bts *bts, u_int8_t idx) int abis_nm_bs11_delete_bport(struct gsm_bts *bts, uint8_t idx)
{ {
struct abis_om_hdr *oh; struct abis_om_hdr *oh;
struct msgb *msg = nm_msgb_alloc(); struct msgb *msg = nm_msgb_alloc();
@ -2346,7 +2346,7 @@ int abis_nm_bs11_delete_bport(struct gsm_bts *bts, u_int8_t idx)
return abis_nm_sendmsg(bts, msg); return abis_nm_sendmsg(bts, msg);
} }
static const u_int8_t sm_attr[] = { NM_ATT_TEI, NM_ATT_ABIS_CHANNEL }; static const uint8_t sm_attr[] = { NM_ATT_TEI, NM_ATT_ABIS_CHANNEL };
int abis_nm_bs11_get_oml_tei_ts(struct gsm_bts *bts) int abis_nm_bs11_get_oml_tei_ts(struct gsm_bts *bts)
{ {
struct abis_om_hdr *oh; struct abis_om_hdr *oh;
@ -2361,9 +2361,9 @@ int abis_nm_bs11_get_oml_tei_ts(struct gsm_bts *bts)
} }
/* like abis_nm_conn_terr_traf + set_tei */ /* like abis_nm_conn_terr_traf + set_tei */
int abis_nm_bs11_conn_oml_tei(struct gsm_bts *bts, u_int8_t e1_port, int abis_nm_bs11_conn_oml_tei(struct gsm_bts *bts, uint8_t e1_port,
u_int8_t e1_timeslot, u_int8_t e1_subslot, uint8_t e1_timeslot, uint8_t e1_subslot,
u_int8_t tei) uint8_t tei)
{ {
struct abis_om_hdr *oh; struct abis_om_hdr *oh;
struct abis_nm_channel *ch; struct abis_nm_channel *ch;
@ -2380,7 +2380,7 @@ int abis_nm_bs11_conn_oml_tei(struct gsm_bts *bts, u_int8_t e1_port,
return abis_nm_sendmsg(bts, msg); return abis_nm_sendmsg(bts, msg);
} }
int abis_nm_bs11_set_trx_power(struct gsm_bts_trx *trx, u_int8_t level) int abis_nm_bs11_set_trx_power(struct gsm_bts_trx *trx, uint8_t level)
{ {
struct abis_om_hdr *oh; struct abis_om_hdr *oh;
struct msgb *msg = nm_msgb_alloc(); struct msgb *msg = nm_msgb_alloc();
@ -2397,7 +2397,7 @@ int abis_nm_bs11_get_trx_power(struct gsm_bts_trx *trx)
{ {
struct abis_om_hdr *oh; struct abis_om_hdr *oh;
struct msgb *msg = nm_msgb_alloc(); struct msgb *msg = nm_msgb_alloc();
u_int8_t attr = NM_ATT_BS11_TXPWR; uint8_t attr = NM_ATT_BS11_TXPWR;
oh = (struct abis_om_hdr *) msgb_put(msg, ABIS_OM_FOM_HDR_SIZE); oh = (struct abis_om_hdr *) msgb_put(msg, ABIS_OM_FOM_HDR_SIZE);
fill_om_fom_hdr(oh, 2+sizeof(attr), NM_MT_GET_ATTR, fill_om_fom_hdr(oh, 2+sizeof(attr), NM_MT_GET_ATTR,
@ -2411,7 +2411,7 @@ int abis_nm_bs11_get_pll_mode(struct gsm_bts *bts)
{ {
struct abis_om_hdr *oh; struct abis_om_hdr *oh;
struct msgb *msg = nm_msgb_alloc(); struct msgb *msg = nm_msgb_alloc();
u_int8_t attr[] = { NM_ATT_BS11_PLL_MODE }; uint8_t attr[] = { NM_ATT_BS11_PLL_MODE };
oh = (struct abis_om_hdr *) msgb_put(msg, ABIS_OM_FOM_HDR_SIZE); oh = (struct abis_om_hdr *) msgb_put(msg, ABIS_OM_FOM_HDR_SIZE);
fill_om_fom_hdr(oh, 2+sizeof(attr), NM_MT_GET_ATTR, fill_om_fom_hdr(oh, 2+sizeof(attr), NM_MT_GET_ATTR,
@ -2425,7 +2425,7 @@ int abis_nm_bs11_get_cclk(struct gsm_bts *bts)
{ {
struct abis_om_hdr *oh; struct abis_om_hdr *oh;
struct msgb *msg = nm_msgb_alloc(); struct msgb *msg = nm_msgb_alloc();
u_int8_t attr[] = { NM_ATT_BS11_CCLK_ACCURACY, uint8_t attr[] = { NM_ATT_BS11_CCLK_ACCURACY,
NM_ATT_BS11_CCLK_TYPE }; NM_ATT_BS11_CCLK_TYPE };
oh = (struct abis_om_hdr *) msgb_put(msg, ABIS_OM_FOM_HDR_SIZE); oh = (struct abis_om_hdr *) msgb_put(msg, ABIS_OM_FOM_HDR_SIZE);
@ -2437,7 +2437,7 @@ int abis_nm_bs11_get_cclk(struct gsm_bts *bts)
} }
//static const u_int8_t bs11_logon_c7[] = { 0x07, 0xd9, 0x01, 0x11, 0x0d, 0x10, 0x20 }; //static const uint8_t bs11_logon_c7[] = { 0x07, 0xd9, 0x01, 0x11, 0x0d, 0x10, 0x20 };
int abis_nm_bs11_factory_logon(struct gsm_bts *bts, int on) int abis_nm_bs11_factory_logon(struct gsm_bts *bts, int on)
{ {
@ -2449,7 +2449,7 @@ int abis_nm_bs11_infield_logon(struct gsm_bts *bts, int on)
return abis_nm_bs11_logon(bts, 0x03, "FIELD ", on); return abis_nm_bs11_logon(bts, 0x03, "FIELD ", on);
} }
int abis_nm_bs11_logon(struct gsm_bts *bts, u_int8_t level, const char *name, int on) int abis_nm_bs11_logon(struct gsm_bts *bts, uint8_t level, const char *name, int on)
{ {
struct abis_om_hdr *oh; struct abis_om_hdr *oh;
struct msgb *msg = nm_msgb_alloc(); struct msgb *msg = nm_msgb_alloc();
@ -2459,16 +2459,16 @@ int abis_nm_bs11_logon(struct gsm_bts *bts, u_int8_t level, const char *name, in
oh = (struct abis_om_hdr *) msgb_put(msg, ABIS_OM_FOM_HDR_SIZE); oh = (struct abis_om_hdr *) msgb_put(msg, ABIS_OM_FOM_HDR_SIZE);
if (on) { if (on) {
u_int8_t len = 3*2 + sizeof(bdt) uint8_t len = 3*2 + sizeof(bdt)
+ 1 + strlen(name); + 1 + strlen(name);
fill_om_fom_hdr(oh, len, NM_MT_BS11_LMT_LOGON, fill_om_fom_hdr(oh, len, NM_MT_BS11_LMT_LOGON,
NM_OC_BS11_BTSE, 0xff, 0xff, 0xff); NM_OC_BS11_BTSE, 0xff, 0xff, 0xff);
msgb_tlv_put(msg, NM_ATT_BS11_LMT_LOGIN_TIME, msgb_tlv_put(msg, NM_ATT_BS11_LMT_LOGIN_TIME,
sizeof(bdt), (u_int8_t *) &bdt); sizeof(bdt), (uint8_t *) &bdt);
msgb_tlv_put(msg, NM_ATT_BS11_LMT_USER_ACC_LEV, msgb_tlv_put(msg, NM_ATT_BS11_LMT_USER_ACC_LEV,
1, &level); 1, &level);
msgb_tlv_put(msg, NM_ATT_BS11_LMT_USER_NAME, msgb_tlv_put(msg, NM_ATT_BS11_LMT_USER_NAME,
strlen(name), (u_int8_t *)name); strlen(name), (uint8_t *)name);
} else { } else {
fill_om_fom_hdr(oh, 0, NM_MT_BS11_LMT_LOGOFF, fill_om_fom_hdr(oh, 0, NM_MT_BS11_LMT_LOGOFF,
NM_OC_BS11_BTSE, 0xff, 0xff, 0xff); NM_OC_BS11_BTSE, 0xff, 0xff, 0xff);
@ -2489,7 +2489,7 @@ int abis_nm_bs11_set_trx1_pw(struct gsm_bts *bts, const char *password)
oh = (struct abis_om_hdr *) msgb_put(msg, ABIS_OM_FOM_HDR_SIZE); oh = (struct abis_om_hdr *) msgb_put(msg, ABIS_OM_FOM_HDR_SIZE);
fill_om_fom_hdr(oh, 2+strlen(password), NM_MT_BS11_SET_ATTR, fill_om_fom_hdr(oh, 2+strlen(password), NM_MT_BS11_SET_ATTR,
NM_OC_BS11, BS11_OBJ_TRX1, 0x00, 0x00); NM_OC_BS11, BS11_OBJ_TRX1, 0x00, 0x00);
msgb_tlv_put(msg, NM_ATT_BS11_PASSWORD, 10, (const u_int8_t *)password); msgb_tlv_put(msg, NM_ATT_BS11_PASSWORD, 10, (const uint8_t *)password);
return abis_nm_sendmsg(bts, msg); return abis_nm_sendmsg(bts, msg);
} }
@ -2499,7 +2499,7 @@ int abis_nm_bs11_set_pll_locked(struct gsm_bts *bts, int locked)
{ {
struct abis_om_hdr *oh; struct abis_om_hdr *oh;
struct msgb *msg; struct msgb *msg;
u_int8_t tlv_value; uint8_t tlv_value;
msg = nm_msgb_alloc(); msg = nm_msgb_alloc();
oh = (struct abis_om_hdr *) msgb_put(msg, ABIS_OM_FOM_HDR_SIZE); oh = (struct abis_om_hdr *) msgb_put(msg, ABIS_OM_FOM_HDR_SIZE);
@ -2522,7 +2522,7 @@ int abis_nm_bs11_set_pll(struct gsm_bts *bts, int value)
{ {
struct abis_om_hdr *oh; struct abis_om_hdr *oh;
struct msgb *msg; struct msgb *msg;
u_int8_t tlv_value[2]; uint8_t tlv_value[2];
msg = nm_msgb_alloc(); msg = nm_msgb_alloc();
oh = (struct abis_om_hdr *) msgb_put(msg, ABIS_OM_FOM_HDR_SIZE); oh = (struct abis_om_hdr *) msgb_put(msg, ABIS_OM_FOM_HDR_SIZE);
@ -2549,7 +2549,7 @@ void *tall_fle_ctx;
struct abis_nm_bs11_sw { struct abis_nm_bs11_sw {
struct gsm_bts *bts; struct gsm_bts *bts;
char swl_fname[PATH_MAX]; char swl_fname[PATH_MAX];
u_int8_t win_size; uint8_t win_size;
int forced; int forced;
struct llist_head file_list; struct llist_head file_list;
gsm_cbfn *user_cb; /* specified by the user */ gsm_cbfn *user_cb; /* specified by the user */
@ -2675,7 +2675,7 @@ static int bs11_swload_cbfn(unsigned int hook, unsigned int event,
* files that are part of a software release. We need to upload first * files that are part of a software release. We need to upload first
* the list file, and then each file that is listed in the list file */ * the list file, and then each file that is listed in the list file */
int abis_nm_bs11_load_swl(struct gsm_bts *bts, const char *fname, int abis_nm_bs11_load_swl(struct gsm_bts *bts, const char *fname,
u_int8_t win_size, int forced, gsm_cbfn *cbfn) uint8_t win_size, int forced, gsm_cbfn *cbfn)
{ {
struct abis_nm_bs11_sw *bs11_sw = g_bs11_sw; struct abis_nm_bs11_sw *bs11_sw = g_bs11_sw;
struct file_list_entry *fle; struct file_list_entry *fle;
@ -2705,7 +2705,7 @@ int abis_nm_bs11_load_swl(struct gsm_bts *bts, const char *fname,
} }
#if 0 #if 0
static u_int8_t req_attr_btse[] = { static uint8_t req_attr_btse[] = {
NM_ATT_ADM_STATE, NM_ATT_BS11_LMT_LOGON_SESSION, NM_ATT_ADM_STATE, NM_ATT_BS11_LMT_LOGON_SESSION,
NM_ATT_BS11_LMT_LOGIN_TIME, NM_ATT_BS11_LMT_USER_ACC_LEV, NM_ATT_BS11_LMT_LOGIN_TIME, NM_ATT_BS11_LMT_USER_ACC_LEV,
NM_ATT_BS11_LMT_USER_NAME, NM_ATT_BS11_LMT_USER_NAME,
@ -2716,14 +2716,14 @@ static u_int8_t req_attr_btse[] = {
NM_ATT_BS11_SW_LOAD_STORED }; NM_ATT_BS11_SW_LOAD_STORED };
static u_int8_t req_attr_btsm[] = { static uint8_t req_attr_btsm[] = {
NM_ATT_ABIS_CHANNEL, NM_ATT_TEI, NM_ATT_BS11_ABIS_EXT_TIME, NM_ATT_ABIS_CHANNEL, NM_ATT_TEI, NM_ATT_BS11_ABIS_EXT_TIME,
NM_ATT_ADM_STATE, NM_ATT_AVAIL_STATUS, 0xce, NM_ATT_FILE_ID, NM_ATT_ADM_STATE, NM_ATT_AVAIL_STATUS, 0xce, NM_ATT_FILE_ID,
NM_ATT_FILE_VERSION, NM_ATT_OPER_STATE, 0xe8, NM_ATT_BS11_ALL_TEST_CATG, NM_ATT_FILE_VERSION, NM_ATT_OPER_STATE, 0xe8, NM_ATT_BS11_ALL_TEST_CATG,
NM_ATT_SW_DESCR, NM_ATT_GET_ARI }; NM_ATT_SW_DESCR, NM_ATT_GET_ARI };
#endif #endif
static u_int8_t req_attr[] = { static uint8_t req_attr[] = {
NM_ATT_ADM_STATE, NM_ATT_AVAIL_STATUS, 0xa8, NM_ATT_OPER_STATE, NM_ATT_ADM_STATE, NM_ATT_AVAIL_STATUS, 0xa8, NM_ATT_OPER_STATE,
0xd5, 0xa1, NM_ATT_BS11_ESN_FW_CODE_NO, NM_ATT_BS11_ESN_HW_CODE_NO, 0xd5, 0xa1, NM_ATT_BS11_ESN_FW_CODE_NO, NM_ATT_BS11_ESN_HW_CODE_NO,
0x42, NM_ATT_BS11_ESN_PCB_SERIAL, NM_ATT_BS11_PLL }; 0x42, NM_ATT_BS11_ESN_PCB_SERIAL, NM_ATT_BS11_PLL };
@ -2753,16 +2753,16 @@ int abis_nm_bs11_set_ext_time(struct gsm_bts *bts)
/* SiemensHW CCTRL object */ /* SiemensHW CCTRL object */
fill_om_fom_hdr(oh, 2+sizeof(aet), NM_MT_BS11_SET_ATTR, NM_OC_SITE_MANAGER, fill_om_fom_hdr(oh, 2+sizeof(aet), NM_MT_BS11_SET_ATTR, NM_OC_SITE_MANAGER,
0xff, 0xff, 0xff); 0xff, 0xff, 0xff);
msgb_tlv_put(msg, NM_ATT_BS11_ABIS_EXT_TIME, sizeof(aet), (u_int8_t *) &aet); msgb_tlv_put(msg, NM_ATT_BS11_ABIS_EXT_TIME, sizeof(aet), (uint8_t *) &aet);
return abis_nm_sendmsg(bts, msg); return abis_nm_sendmsg(bts, msg);
} }
int abis_nm_bs11_get_bport_line_cfg(struct gsm_bts *bts, u_int8_t bport) int abis_nm_bs11_get_bport_line_cfg(struct gsm_bts *bts, uint8_t bport)
{ {
struct abis_om_hdr *oh; struct abis_om_hdr *oh;
struct msgb *msg = nm_msgb_alloc(); struct msgb *msg = nm_msgb_alloc();
u_int8_t attr = NM_ATT_BS11_LINE_CFG; uint8_t attr = NM_ATT_BS11_LINE_CFG;
oh = (struct abis_om_hdr *) msgb_put(msg, ABIS_OM_FOM_HDR_SIZE); oh = (struct abis_om_hdr *) msgb_put(msg, ABIS_OM_FOM_HDR_SIZE);
fill_om_fom_hdr(oh, 2+sizeof(attr), NM_MT_GET_ATTR, fill_om_fom_hdr(oh, 2+sizeof(attr), NM_MT_GET_ATTR,
@ -2772,7 +2772,7 @@ int abis_nm_bs11_get_bport_line_cfg(struct gsm_bts *bts, u_int8_t bport)
return abis_nm_sendmsg(bts, msg); return abis_nm_sendmsg(bts, msg);
} }
int abis_nm_bs11_set_bport_line_cfg(struct gsm_bts *bts, u_int8_t bport, enum abis_bs11_line_cfg line_cfg) int abis_nm_bs11_set_bport_line_cfg(struct gsm_bts *bts, uint8_t bport, enum abis_bs11_line_cfg line_cfg)
{ {
struct abis_om_hdr *oh; struct abis_om_hdr *oh;
struct msgb *msg = nm_msgb_alloc(); struct msgb *msg = nm_msgb_alloc();
@ -2796,7 +2796,7 @@ static int abis_nm_rx_ipacc(struct msgb *msg)
struct in_addr addr; struct in_addr addr;
struct abis_om_hdr *oh = msgb_l2(msg); struct abis_om_hdr *oh = msgb_l2(msg);
struct abis_om_fom_hdr *foh; struct abis_om_fom_hdr *foh;
u_int8_t idstrlen = oh->data[0]; uint8_t idstrlen = oh->data[0];
struct tlv_parsed tp; struct tlv_parsed tp;
struct ipacc_ack_signal_data signal; struct ipacc_ack_signal_data signal;
@ -2823,7 +2823,7 @@ static int abis_nm_rx_ipacc(struct msgb *msg)
} }
if (TLVP_PRESENT(&tp, NM_ATT_IPACC_DST_IP_PORT)) if (TLVP_PRESENT(&tp, NM_ATT_IPACC_DST_IP_PORT))
DEBUGPC(DNM, "PORT=%u ", DEBUGPC(DNM, "PORT=%u ",
ntohs(*((u_int16_t *) ntohs(*((uint16_t *)
TLVP_VAL(&tp, NM_ATT_IPACC_DST_IP_PORT)))); TLVP_VAL(&tp, NM_ATT_IPACC_DST_IP_PORT))));
if (TLVP_PRESENT(&tp, NM_ATT_IPACC_STREAM_ID)) if (TLVP_PRESENT(&tp, NM_ATT_IPACC_STREAM_ID))
DEBUGPC(DNM, "STREAM=0x%02x ", DEBUGPC(DNM, "STREAM=0x%02x ",
@ -2900,15 +2900,15 @@ static int abis_nm_rx_ipacc(struct msgb *msg)
} }
/* send an ip-access manufacturer specific message */ /* send an ip-access manufacturer specific message */
int abis_nm_ipaccess_msg(struct gsm_bts *bts, u_int8_t msg_type, int abis_nm_ipaccess_msg(struct gsm_bts *bts, uint8_t msg_type,
u_int8_t obj_class, u_int8_t bts_nr, uint8_t obj_class, uint8_t bts_nr,
u_int8_t trx_nr, u_int8_t ts_nr, uint8_t trx_nr, uint8_t ts_nr,
u_int8_t *attr, int attr_len) uint8_t *attr, int attr_len)
{ {
struct msgb *msg = nm_msgb_alloc(); struct msgb *msg = nm_msgb_alloc();
struct abis_om_hdr *oh; struct abis_om_hdr *oh;
struct abis_om_fom_hdr *foh; struct abis_om_fom_hdr *foh;
u_int8_t *data; uint8_t *data;
/* construct the 12.21 OM header, observe the erroneous length */ /* construct the 12.21 OM header, observe the erroneous length */
oh = (struct abis_om_hdr *) msgb_put(msg, sizeof(*oh)); oh = (struct abis_om_hdr *) msgb_put(msg, sizeof(*oh));
@ -2937,7 +2937,7 @@ int abis_nm_ipaccess_msg(struct gsm_bts *bts, u_int8_t msg_type,
} }
/* set some attributes in NVRAM */ /* set some attributes in NVRAM */
int abis_nm_ipaccess_set_nvattr(struct gsm_bts_trx *trx, u_int8_t *attr, int abis_nm_ipaccess_set_nvattr(struct gsm_bts_trx *trx, uint8_t *attr,
int attr_len) int attr_len)
{ {
return abis_nm_ipaccess_msg(trx->bts, NM_MT_IPACC_SET_NVATTR, return abis_nm_ipaccess_msg(trx->bts, NM_MT_IPACC_SET_NVATTR,
@ -2946,10 +2946,10 @@ int abis_nm_ipaccess_set_nvattr(struct gsm_bts_trx *trx, u_int8_t *attr,
} }
int abis_nm_ipaccess_rsl_connect(struct gsm_bts_trx *trx, int abis_nm_ipaccess_rsl_connect(struct gsm_bts_trx *trx,
u_int32_t ip, u_int16_t port, u_int8_t stream) uint32_t ip, uint16_t port, uint8_t stream)
{ {
struct in_addr ia; struct in_addr ia;
u_int8_t attr[] = { NM_ATT_IPACC_STREAM_ID, 0, uint8_t attr[] = { NM_ATT_IPACC_STREAM_ID, 0,
NM_ATT_IPACC_DST_IP_PORT, 0, 0, NM_ATT_IPACC_DST_IP_PORT, 0, 0,
NM_ATT_IPACC_DST_IP, 0, 0, 0, 0 }; NM_ATT_IPACC_DST_IP, 0, 0, 0, 0 };
@ -2959,7 +2959,7 @@ int abis_nm_ipaccess_rsl_connect(struct gsm_bts_trx *trx,
attr[1] = stream; attr[1] = stream;
attr[3] = port >> 8; attr[3] = port >> 8;
attr[4] = port & 0xff; attr[4] = port & 0xff;
*(u_int32_t *)(attr+6) = ia.s_addr; *(uint32_t *)(attr+6) = ia.s_addr;
/* if ip == 0, we use the default IP */ /* if ip == 0, we use the default IP */
if (ip == 0) if (ip == 0)
@ -2986,21 +2986,21 @@ int abis_nm_ipaccess_restart(struct gsm_bts_trx *trx)
return abis_nm_sendmsg(trx->bts, msg); return abis_nm_sendmsg(trx->bts, msg);
} }
int abis_nm_ipaccess_set_attr(struct gsm_bts *bts, u_int8_t obj_class, int abis_nm_ipaccess_set_attr(struct gsm_bts *bts, uint8_t obj_class,
u_int8_t bts_nr, u_int8_t trx_nr, u_int8_t ts_nr, uint8_t bts_nr, uint8_t trx_nr, uint8_t ts_nr,
u_int8_t *attr, u_int8_t attr_len) uint8_t *attr, uint8_t attr_len)
{ {
return abis_nm_ipaccess_msg(bts, NM_MT_IPACC_SET_ATTR, return abis_nm_ipaccess_msg(bts, NM_MT_IPACC_SET_ATTR,
obj_class, bts_nr, trx_nr, ts_nr, obj_class, bts_nr, trx_nr, ts_nr,
attr, attr_len); attr, attr_len);
} }
void abis_nm_ipaccess_cgi(u_int8_t *buf, struct gsm_bts *bts) void abis_nm_ipaccess_cgi(uint8_t *buf, struct gsm_bts *bts)
{ {
/* we simply reuse the GSM48 function and overwrite the RAC /* we simply reuse the GSM48 function and overwrite the RAC
* with the Cell ID */ * with the Cell ID */
gsm48_ra_id_by_bts(buf, bts); gsm48_ra_id_by_bts(buf, bts);
*((u_int16_t *)(buf + 5)) = htons(bts->cell_identity); *((uint16_t *)(buf + 5)) = htons(bts->cell_identity);
} }
void gsm_trx_lock_rf(struct gsm_bts_trx *trx, int locked) void gsm_trx_lock_rf(struct gsm_bts_trx *trx, int locked)
@ -3025,12 +3025,12 @@ static const struct value_string ipacc_testres_names[] = {
{ 0, NULL } { 0, NULL }
}; };
const char *ipacc_testres_name(u_int8_t res) const char *ipacc_testres_name(uint8_t res)
{ {
return get_value_string(ipacc_testres_names, res); return get_value_string(ipacc_testres_names, res);
} }
void ipac_parse_cgi(struct cell_global_id *cid, const u_int8_t *buf) void ipac_parse_cgi(struct cell_global_id *cid, const uint8_t *buf)
{ {
cid->mcc = (buf[0] & 0xf) * 100; cid->mcc = (buf[0] & 0xf) * 100;
cid->mcc += (buf[0] >> 4) * 10; cid->mcc += (buf[0] >> 4) * 10;
@ -3045,15 +3045,15 @@ void ipac_parse_cgi(struct cell_global_id *cid, const u_int8_t *buf)
cid->mnc += (buf[1] >> 4) * 1; cid->mnc += (buf[1] >> 4) * 1;
} }
cid->lac = ntohs(*((u_int16_t *)&buf[3])); cid->lac = ntohs(*((uint16_t *)&buf[3]));
cid->ci = ntohs(*((u_int16_t *)&buf[5])); cid->ci = ntohs(*((uint16_t *)&buf[5]));
} }
/* parse BCCH information IEI from wire format to struct ipac_bcch_info */ /* parse BCCH information IEI from wire format to struct ipac_bcch_info */
int ipac_parse_bcch_info(struct ipac_bcch_info *binf, u_int8_t *buf) int ipac_parse_bcch_info(struct ipac_bcch_info *binf, uint8_t *buf)
{ {
u_int8_t *cur = buf; uint8_t *cur = buf;
u_int16_t len; uint16_t len;
memset(binf, 0, sizeof(*binf)); memset(binf, 0, sizeof(*binf));
@ -3061,10 +3061,10 @@ int ipac_parse_bcch_info(struct ipac_bcch_info *binf, u_int8_t *buf)
return -EINVAL; return -EINVAL;
cur++; cur++;
len = ntohs(*(u_int16_t *)cur); len = ntohs(*(uint16_t *)cur);
cur += 2; cur += 2;
binf->info_type = ntohs(*(u_int16_t *)cur); binf->info_type = ntohs(*(uint16_t *)cur);
cur += 2; cur += 2;
if (binf->info_type & IPAC_BINF_FREQ_ERR_QUAL) if (binf->info_type & IPAC_BINF_FREQ_ERR_QUAL)
@ -3082,15 +3082,15 @@ int ipac_parse_bcch_info(struct ipac_bcch_info *binf, u_int8_t *buf)
cur++; cur++;
if (binf->info_type & IPAC_BINF_FREQ_ERR_QUAL) if (binf->info_type & IPAC_BINF_FREQ_ERR_QUAL)
binf->freq_err = ntohs(*(u_int16_t *)cur); binf->freq_err = ntohs(*(uint16_t *)cur);
cur += 2; cur += 2;
if (binf->info_type & IPAC_BINF_FRAME_OFFSET) if (binf->info_type & IPAC_BINF_FRAME_OFFSET)
binf->frame_offset = ntohs(*(u_int16_t *)cur); binf->frame_offset = ntohs(*(uint16_t *)cur);
cur += 2; cur += 2;
if (binf->info_type & IPAC_BINF_FRAME_NR_OFFSET) if (binf->info_type & IPAC_BINF_FRAME_NR_OFFSET)
binf->frame_nr_offset = ntohl(*(u_int32_t *)cur); binf->frame_nr_offset = ntohl(*(uint32_t *)cur);
cur += 4; cur += 4;
#if 0 #if 0

View File

@ -63,12 +63,12 @@ enum ipa_embedded_att {
}; };
/* append an ip.access channel list to the given msgb */ /* append an ip.access channel list to the given msgb */
static int ipa_chan_list_append(struct msgb *msg, u_int8_t ie, static int ipa_chan_list_append(struct msgb *msg, uint8_t ie,
u_int16_t *arfcns, int arfcn_count) uint16_t *arfcns, int arfcn_count)
{ {
int i; int i;
u_int8_t *u8; uint8_t *u8;
u_int16_t *u16; uint16_t *u16;
/* tag */ /* tag */
u8 = msgb_push(msg, 1); u8 = msgb_push(msg, 1);

View File

@ -631,7 +631,7 @@ static struct msgb *om2k_msgb_alloc(void)
"OM2000"); "OM2000");
} }
static int abis_om2k_tlv_parse(struct tlv_parsed *tp, const u_int8_t *buf, int len) static int abis_om2k_tlv_parse(struct tlv_parsed *tp, const uint8_t *buf, int len)
{ {
return tlv_parse(tp, &om2k_att_tlvdef, buf, len, 0, 0); return tlv_parse(tp, &om2k_att_tlvdef, buf, len, 0, 0);
} }

View File

@ -59,7 +59,7 @@ static void send_lchan_signal(int sig_no, struct gsm_lchan *lchan,
dispatch_signal(SS_LCHAN, sig_no, &sig); dispatch_signal(SS_LCHAN, sig_no, &sig);
} }
static u_int8_t mdisc_by_msgtype(u_int8_t msg_type) static uint8_t mdisc_by_msgtype(uint8_t msg_type)
{ {
/* mask off the transparent bit ? */ /* mask off the transparent bit ? */
msg_type &= 0xfe; msg_type &= 0xfe;
@ -79,7 +79,7 @@ static u_int8_t mdisc_by_msgtype(u_int8_t msg_type)
} }
static inline void init_dchan_hdr(struct abis_rsl_dchan_hdr *dh, static inline void init_dchan_hdr(struct abis_rsl_dchan_hdr *dh,
u_int8_t msg_type) uint8_t msg_type)
{ {
dh->c.msg_discr = mdisc_by_msgtype(msg_type); dh->c.msg_discr = mdisc_by_msgtype(msg_type);
dh->c.msg_type = msg_type; dh->c.msg_type = msg_type;
@ -87,12 +87,12 @@ static inline void init_dchan_hdr(struct abis_rsl_dchan_hdr *dh,
} }
/* determine logical channel based on TRX and channel number IE */ /* determine logical channel based on TRX and channel number IE */
struct gsm_lchan *lchan_lookup(struct gsm_bts_trx *trx, u_int8_t chan_nr) struct gsm_lchan *lchan_lookup(struct gsm_bts_trx *trx, uint8_t chan_nr)
{ {
struct gsm_lchan *lchan; struct gsm_lchan *lchan;
u_int8_t ts_nr = chan_nr & 0x07; uint8_t ts_nr = chan_nr & 0x07;
u_int8_t cbits = chan_nr >> 3; uint8_t cbits = chan_nr >> 3;
u_int8_t lch_idx; uint8_t lch_idx;
struct gsm_bts_trx_ts *ts = &trx->ts[ts_nr]; struct gsm_bts_trx_ts *ts = &trx->ts[ts_nr];
if (cbits == 0x01) { if (cbits == 0x01) {
@ -138,9 +138,9 @@ struct gsm_lchan *lchan_lookup(struct gsm_bts_trx *trx, u_int8_t chan_nr)
} }
/* See Table 10.5.25 of GSM04.08 */ /* See Table 10.5.25 of GSM04.08 */
static u_int8_t ts2chan_nr(const struct gsm_bts_trx_ts *ts, uint8_t lchan_nr) static uint8_t ts2chan_nr(const struct gsm_bts_trx_ts *ts, uint8_t lchan_nr)
{ {
u_int8_t cbits, chan_nr; uint8_t cbits, chan_nr;
switch (ts->pchan) { switch (ts->pchan) {
case GSM_PCHAN_TCH_F: case GSM_PCHAN_TCH_F:
@ -171,15 +171,15 @@ static u_int8_t ts2chan_nr(const struct gsm_bts_trx_ts *ts, uint8_t lchan_nr)
return chan_nr; return chan_nr;
} }
u_int8_t lchan2chan_nr(const struct gsm_lchan *lchan) uint8_t lchan2chan_nr(const struct gsm_lchan *lchan)
{ {
return ts2chan_nr(lchan->ts, lchan->nr); return ts2chan_nr(lchan->ts, lchan->nr);
} }
/* As per TS 03.03 Section 2.2, the IMSI has 'not more than 15 digits' */ /* As per TS 03.03 Section 2.2, the IMSI has 'not more than 15 digits' */
u_int64_t str_to_imsi(const char *imsi_str) uint64_t str_to_imsi(const char *imsi_str)
{ {
u_int64_t ret; uint64_t ret;
ret = strtoull(imsi_str, NULL, 10); ret = strtoull(imsi_str, NULL, 10);
@ -196,14 +196,14 @@ unsigned int n_pag_blocks(int bs_ccch_sdcch_comb, unsigned int bs_ag_blks_res)
} }
/* Chapter 6.5.2 of TS 05.02 */ /* Chapter 6.5.2 of TS 05.02 */
unsigned int get_ccch_group(u_int64_t imsi, unsigned int bs_cc_chans, unsigned int get_ccch_group(uint64_t imsi, unsigned int bs_cc_chans,
unsigned int n_pag_blocks) unsigned int n_pag_blocks)
{ {
return (imsi % 1000) % (bs_cc_chans * n_pag_blocks) / n_pag_blocks; return (imsi % 1000) % (bs_cc_chans * n_pag_blocks) / n_pag_blocks;
} }
/* Chapter 6.5.2 of TS 05.02 */ /* Chapter 6.5.2 of TS 05.02 */
unsigned int get_paging_group(u_int64_t imsi, unsigned int bs_cc_chans, unsigned int get_paging_group(uint64_t imsi, unsigned int bs_cc_chans,
int n_pag_blocks) int n_pag_blocks)
{ {
return (imsi % 1000) % (bs_cc_chans * n_pag_blocks) % n_pag_blocks; return (imsi % 1000) % (bs_cc_chans * n_pag_blocks) % n_pag_blocks;
@ -216,7 +216,7 @@ static struct msgb *rsl_msgb_alloc(void)
} }
#define MACBLOCK_SIZE 23 #define MACBLOCK_SIZE 23
static void pad_macblock(u_int8_t *out, const u_int8_t *in, int len) static void pad_macblock(uint8_t *out, const uint8_t *in, int len)
{ {
memcpy(out, in, len); memcpy(out, in, len);
@ -225,7 +225,7 @@ static void pad_macblock(u_int8_t *out, const u_int8_t *in, int len)
} }
/* Chapter 9.3.7: Encryption Information */ /* Chapter 9.3.7: Encryption Information */
static int build_encr_info(u_int8_t *out, struct gsm_lchan *lchan) static int build_encr_info(uint8_t *out, struct gsm_lchan *lchan)
{ {
*out++ = lchan->encr.alg_id & 0xff; *out++ = lchan->encr.alg_id & 0xff;
if (lchan->encr.key_len) if (lchan->encr.key_len)
@ -233,7 +233,7 @@ static int build_encr_info(u_int8_t *out, struct gsm_lchan *lchan)
return lchan->encr.key_len + 1; return lchan->encr.key_len + 1;
} }
static void print_rsl_cause(int lvl, const u_int8_t *cause_v, u_int8_t cause_len) static void print_rsl_cause(int lvl, const uint8_t *cause_v, uint8_t cause_len)
{ {
int i; int i;
@ -244,8 +244,8 @@ static void print_rsl_cause(int lvl, const u_int8_t *cause_v, u_int8_t cause_len
} }
/* Send a BCCH_INFO message as per Chapter 8.5.1 */ /* Send a BCCH_INFO message as per Chapter 8.5.1 */
int rsl_bcch_info(struct gsm_bts_trx *trx, u_int8_t type, int rsl_bcch_info(struct gsm_bts_trx *trx, uint8_t type,
const u_int8_t *data, int len) const uint8_t *data, int len)
{ {
struct abis_rsl_dchan_hdr *dh; struct abis_rsl_dchan_hdr *dh;
struct msgb *msg = rsl_msgb_alloc(); struct msgb *msg = rsl_msgb_alloc();
@ -262,8 +262,8 @@ int rsl_bcch_info(struct gsm_bts_trx *trx, u_int8_t type,
return abis_rsl_sendmsg(msg); return abis_rsl_sendmsg(msg);
} }
int rsl_sacch_filling(struct gsm_bts_trx *trx, u_int8_t type, int rsl_sacch_filling(struct gsm_bts_trx *trx, uint8_t type,
const u_int8_t *data, int len) const uint8_t *data, int len)
{ {
struct abis_rsl_common_hdr *ch; struct abis_rsl_common_hdr *ch;
struct msgb *msg = rsl_msgb_alloc(); struct msgb *msg = rsl_msgb_alloc();
@ -280,12 +280,12 @@ int rsl_sacch_filling(struct gsm_bts_trx *trx, u_int8_t type,
return abis_rsl_sendmsg(msg); return abis_rsl_sendmsg(msg);
} }
int rsl_sacch_info_modify(struct gsm_lchan *lchan, u_int8_t type, int rsl_sacch_info_modify(struct gsm_lchan *lchan, uint8_t type,
const u_int8_t *data, int len) const uint8_t *data, int len)
{ {
struct abis_rsl_dchan_hdr *dh; struct abis_rsl_dchan_hdr *dh;
struct msgb *msg = rsl_msgb_alloc(); struct msgb *msg = rsl_msgb_alloc();
u_int8_t chan_nr = lchan2chan_nr(lchan); uint8_t chan_nr = lchan2chan_nr(lchan);
dh = (struct abis_rsl_dchan_hdr *) msgb_put(msg, sizeof(*dh)); dh = (struct abis_rsl_dchan_hdr *) msgb_put(msg, sizeof(*dh));
init_dchan_hdr(dh, RSL_MT_SACCH_INFO_MODIFY); init_dchan_hdr(dh, RSL_MT_SACCH_INFO_MODIFY);
@ -303,7 +303,7 @@ int rsl_chan_bs_power_ctrl(struct gsm_lchan *lchan, unsigned int fpc, int db)
{ {
struct abis_rsl_dchan_hdr *dh; struct abis_rsl_dchan_hdr *dh;
struct msgb *msg; struct msgb *msg;
u_int8_t chan_nr = lchan2chan_nr(lchan); uint8_t chan_nr = lchan2chan_nr(lchan);
db = abs(db); db = abs(db);
if (db > 30) if (db > 30)
@ -330,7 +330,7 @@ int rsl_chan_ms_power_ctrl(struct gsm_lchan *lchan, unsigned int fpc, int dbm)
{ {
struct abis_rsl_dchan_hdr *dh; struct abis_rsl_dchan_hdr *dh;
struct msgb *msg; struct msgb *msg;
u_int8_t chan_nr = lchan2chan_nr(lchan); uint8_t chan_nr = lchan2chan_nr(lchan);
int ctl_lvl; int ctl_lvl;
ctl_lvl = ms_pwr_ctl_lvl(lchan->ts->trx->bts->band, dbm); ctl_lvl = ms_pwr_ctl_lvl(lchan->ts->trx->bts->band, dbm);
@ -421,12 +421,12 @@ static int channel_mode_from_lchan(struct rsl_ie_chan_mode *cm,
/* Chapter 8.4.1 */ /* Chapter 8.4.1 */
#if 0 #if 0
int rsl_chan_activate(struct gsm_bts_trx *trx, u_int8_t chan_nr, int rsl_chan_activate(struct gsm_bts_trx *trx, uint8_t chan_nr,
u_int8_t act_type, uint8_t act_type,
struct rsl_ie_chan_mode *chan_mode, struct rsl_ie_chan_mode *chan_mode,
struct rsl_ie_chan_ident *chan_ident, struct rsl_ie_chan_ident *chan_ident,
u_int8_t bs_power, u_int8_t ms_power, uint8_t bs_power, uint8_t ms_power,
u_int8_t ta) uint8_t ta)
{ {
struct abis_rsl_dchan_hdr *dh; struct abis_rsl_dchan_hdr *dh;
struct msgb *msg = rsl_msgb_alloc(); struct msgb *msg = rsl_msgb_alloc();
@ -438,12 +438,12 @@ int rsl_chan_activate(struct gsm_bts_trx *trx, u_int8_t chan_nr,
msgb_tv_put(msg, RSL_IE_ACT_TYPE, act_type); msgb_tv_put(msg, RSL_IE_ACT_TYPE, act_type);
/* For compatibility with Phase 1 */ /* For compatibility with Phase 1 */
msgb_tlv_put(msg, RSL_IE_CHAN_MODE, sizeof(*chan_mode), msgb_tlv_put(msg, RSL_IE_CHAN_MODE, sizeof(*chan_mode),
(u_int8_t *) chan_mode); (uint8_t *) chan_mode);
msgb_tlv_put(msg, RSL_IE_CHAN_IDENT, 4, msgb_tlv_put(msg, RSL_IE_CHAN_IDENT, 4,
(u_int8_t *) chan_ident); (uint8_t *) chan_ident);
#if 0 #if 0
msgb_tlv_put(msg, RSL_IE_ENCR_INFO, 1, msgb_tlv_put(msg, RSL_IE_ENCR_INFO, 1,
(u_int8_t *) &encr_info); (uint8_t *) &encr_info);
#endif #endif
msgb_tv_put(msg, RSL_IE_BS_POWER, bs_power); msgb_tv_put(msg, RSL_IE_BS_POWER, bs_power);
msgb_tv_put(msg, RSL_IE_MS_POWER, ms_power); msgb_tv_put(msg, RSL_IE_MS_POWER, ms_power);
@ -455,15 +455,15 @@ int rsl_chan_activate(struct gsm_bts_trx *trx, u_int8_t chan_nr,
} }
#endif #endif
int rsl_chan_activate_lchan(struct gsm_lchan *lchan, u_int8_t act_type, int rsl_chan_activate_lchan(struct gsm_lchan *lchan, uint8_t act_type,
u_int8_t ta, u_int8_t ho_ref) uint8_t ta, uint8_t ho_ref)
{ {
struct abis_rsl_dchan_hdr *dh; struct abis_rsl_dchan_hdr *dh;
struct msgb *msg; struct msgb *msg;
int rc; int rc;
uint8_t *len; uint8_t *len;
u_int8_t chan_nr = lchan2chan_nr(lchan); uint8_t chan_nr = lchan2chan_nr(lchan);
struct rsl_ie_chan_mode cm; struct rsl_ie_chan_mode cm;
struct gsm48_chan_desc cd; struct gsm48_chan_desc cd;
@ -481,7 +481,7 @@ int rsl_chan_activate_lchan(struct gsm_lchan *lchan, u_int8_t act_type,
msgb_tv_put(msg, RSL_IE_ACT_TYPE, act_type); msgb_tv_put(msg, RSL_IE_ACT_TYPE, act_type);
msgb_tlv_put(msg, RSL_IE_CHAN_MODE, sizeof(cm), msgb_tlv_put(msg, RSL_IE_CHAN_MODE, sizeof(cm),
(u_int8_t *) &cm); (uint8_t *) &cm);
/* /*
* The Channel Identification is needed for Phase1 phones * The Channel Identification is needed for Phase1 phones
@ -505,7 +505,7 @@ int rsl_chan_activate_lchan(struct gsm_lchan *lchan, u_int8_t act_type,
*len = msgb_l3len(msg); *len = msgb_l3len(msg);
if (lchan->encr.alg_id > RSL_ENC_ALG_A5(0)) { if (lchan->encr.alg_id > RSL_ENC_ALG_A5(0)) {
u_int8_t encr_info[MAX_A5_KEY_LEN+2]; uint8_t encr_info[MAX_A5_KEY_LEN+2];
rc = build_encr_info(encr_info, lchan); rc = build_encr_info(encr_info, lchan);
if (rc > 0) if (rc > 0)
msgb_tlv_put(msg, RSL_IE_ENCR_INFO, rc, encr_info); msgb_tlv_put(msg, RSL_IE_ENCR_INFO, rc, encr_info);
@ -526,7 +526,7 @@ int rsl_chan_activate_lchan(struct gsm_lchan *lchan, u_int8_t act_type,
if (lchan->tch_mode == GSM48_CMODE_SPEECH_AMR) if (lchan->tch_mode == GSM48_CMODE_SPEECH_AMR)
msgb_tlv_put(msg, RSL_IE_MR_CONFIG, sizeof(lchan->mr_conf), msgb_tlv_put(msg, RSL_IE_MR_CONFIG, sizeof(lchan->mr_conf),
(u_int8_t *) &lchan->mr_conf); (uint8_t *) &lchan->mr_conf);
msg->trx = lchan->ts->trx; msg->trx = lchan->ts->trx;
@ -540,7 +540,7 @@ int rsl_chan_mode_modify_req(struct gsm_lchan *lchan)
struct msgb *msg; struct msgb *msg;
int rc; int rc;
u_int8_t chan_nr = lchan2chan_nr(lchan); uint8_t chan_nr = lchan2chan_nr(lchan);
struct rsl_ie_chan_mode cm; struct rsl_ie_chan_mode cm;
rc = channel_mode_from_lchan(&cm, lchan); rc = channel_mode_from_lchan(&cm, lchan);
@ -553,10 +553,10 @@ int rsl_chan_mode_modify_req(struct gsm_lchan *lchan)
dh->chan_nr = chan_nr; dh->chan_nr = chan_nr;
msgb_tlv_put(msg, RSL_IE_CHAN_MODE, sizeof(cm), msgb_tlv_put(msg, RSL_IE_CHAN_MODE, sizeof(cm),
(u_int8_t *) &cm); (uint8_t *) &cm);
if (lchan->encr.alg_id > RSL_ENC_ALG_A5(0)) { if (lchan->encr.alg_id > RSL_ENC_ALG_A5(0)) {
u_int8_t encr_info[MAX_A5_KEY_LEN+2]; uint8_t encr_info[MAX_A5_KEY_LEN+2];
rc = build_encr_info(encr_info, lchan); rc = build_encr_info(encr_info, lchan);
if (rc > 0) if (rc > 0)
msgb_tlv_put(msg, RSL_IE_ENCR_INFO, rc, encr_info); msgb_tlv_put(msg, RSL_IE_ENCR_INFO, rc, encr_info);
@ -564,7 +564,7 @@ int rsl_chan_mode_modify_req(struct gsm_lchan *lchan)
if (lchan->tch_mode == GSM48_CMODE_SPEECH_AMR) { if (lchan->tch_mode == GSM48_CMODE_SPEECH_AMR) {
msgb_tlv_put(msg, RSL_IE_MR_CONFIG, sizeof(lchan->mr_conf), msgb_tlv_put(msg, RSL_IE_MR_CONFIG, sizeof(lchan->mr_conf),
(u_int8_t *) &lchan->mr_conf); (uint8_t *) &lchan->mr_conf);
} }
msg->trx = lchan->ts->trx; msg->trx = lchan->ts->trx;
@ -577,9 +577,9 @@ int rsl_encryption_cmd(struct msgb *msg)
{ {
struct abis_rsl_dchan_hdr *dh; struct abis_rsl_dchan_hdr *dh;
struct gsm_lchan *lchan = msg->lchan; struct gsm_lchan *lchan = msg->lchan;
u_int8_t chan_nr = lchan2chan_nr(lchan); uint8_t chan_nr = lchan2chan_nr(lchan);
u_int8_t encr_info[MAX_A5_KEY_LEN+2]; uint8_t encr_info[MAX_A5_KEY_LEN+2];
u_int8_t l3_len = msg->len; uint8_t l3_len = msg->len;
int rc; int rc;
/* First push the L3 IE tag and length */ /* First push the L3 IE tag and length */
@ -704,8 +704,8 @@ static int rsl_rx_rf_chan_rel_ack(struct gsm_lchan *lchan)
return 0; return 0;
} }
int rsl_paging_cmd(struct gsm_bts *bts, u_int8_t paging_group, u_int8_t len, int rsl_paging_cmd(struct gsm_bts *bts, uint8_t paging_group, uint8_t len,
u_int8_t *ms_ident, u_int8_t chan_needed) uint8_t *ms_ident, uint8_t chan_needed)
{ {
struct abis_rsl_dchan_hdr *dh; struct abis_rsl_dchan_hdr *dh;
struct msgb *msg = rsl_msgb_alloc(); struct msgb *msg = rsl_msgb_alloc();
@ -723,7 +723,7 @@ int rsl_paging_cmd(struct gsm_bts *bts, u_int8_t paging_group, u_int8_t len,
return abis_rsl_sendmsg(msg); return abis_rsl_sendmsg(msg);
} }
int imsi_str2bcd(u_int8_t *bcd_out, const char *str_in) int imsi_str2bcd(uint8_t *bcd_out, const char *str_in)
{ {
int i, len = strlen(str_in); int i, len = strlen(str_in);
@ -741,11 +741,11 @@ int imsi_str2bcd(u_int8_t *bcd_out, const char *str_in)
} }
/* Chapter 8.5.6 */ /* Chapter 8.5.6 */
int rsl_imm_assign_cmd(struct gsm_bts *bts, u_int8_t len, u_int8_t *val) int rsl_imm_assign_cmd(struct gsm_bts *bts, uint8_t len, uint8_t *val)
{ {
struct msgb *msg = rsl_msgb_alloc(); struct msgb *msg = rsl_msgb_alloc();
struct abis_rsl_dchan_hdr *dh; struct abis_rsl_dchan_hdr *dh;
u_int8_t buf[MACBLOCK_SIZE]; uint8_t buf[MACBLOCK_SIZE];
dh = (struct abis_rsl_dchan_hdr *) msgb_put(msg, sizeof(*dh)); dh = (struct abis_rsl_dchan_hdr *) msgb_put(msg, sizeof(*dh));
init_dchan_hdr(dh, RSL_MT_IMMEDIATE_ASSIGN_CMD); init_dchan_hdr(dh, RSL_MT_IMMEDIATE_ASSIGN_CMD);
@ -777,10 +777,10 @@ int rsl_siemens_mrpci(struct gsm_lchan *lchan, struct rsl_mrpci *mrpci)
init_dchan_hdr(dh, RSL_MT_SIEMENS_MRPCI); init_dchan_hdr(dh, RSL_MT_SIEMENS_MRPCI);
dh->c.msg_discr = ABIS_RSL_MDISC_DED_CHAN; dh->c.msg_discr = ABIS_RSL_MDISC_DED_CHAN;
dh->chan_nr = lchan2chan_nr(lchan); dh->chan_nr = lchan2chan_nr(lchan);
msgb_tv_put(msg, RSL_IE_SIEMENS_MRPCI, *(u_int8_t *)mrpci); msgb_tv_put(msg, RSL_IE_SIEMENS_MRPCI, *(uint8_t *)mrpci);
DEBUGP(DRSL, "%s TX Siemens MRPCI 0x%02x\n", DEBUGP(DRSL, "%s TX Siemens MRPCI 0x%02x\n",
gsm_lchan_name(lchan), *(u_int8_t *)mrpci); gsm_lchan_name(lchan), *(uint8_t *)mrpci);
msg->trx = lchan->ts->trx; msg->trx = lchan->ts->trx;
@ -790,7 +790,7 @@ int rsl_siemens_mrpci(struct gsm_lchan *lchan, struct rsl_mrpci *mrpci)
/* Send "DATA REQUEST" message with given L3 Info payload */ /* Send "DATA REQUEST" message with given L3 Info payload */
/* Chapter 8.3.1 */ /* Chapter 8.3.1 */
int rsl_data_request(struct msgb *msg, u_int8_t link_id) int rsl_data_request(struct msgb *msg, uint8_t link_id)
{ {
if (msg->lchan == NULL) { if (msg->lchan == NULL) {
LOGP(DRSL, LOGL_ERROR, "cannot send DATA REQUEST to unknown lchan\n"); LOGP(DRSL, LOGL_ERROR, "cannot send DATA REQUEST to unknown lchan\n");
@ -807,7 +807,7 @@ int rsl_data_request(struct msgb *msg, u_int8_t link_id)
/* Send "ESTABLISH REQUEST" message with given L3 Info payload */ /* Send "ESTABLISH REQUEST" message with given L3 Info payload */
/* Chapter 8.3.1 */ /* Chapter 8.3.1 */
int rsl_establish_request(struct gsm_lchan *lchan, u_int8_t link_id) int rsl_establish_request(struct gsm_lchan *lchan, uint8_t link_id)
{ {
struct msgb *msg; struct msgb *msg;
@ -823,7 +823,7 @@ int rsl_establish_request(struct gsm_lchan *lchan, u_int8_t link_id)
RELEASE CONFIRM, which we in turn use to trigger RSL CHANNEL RELEASE, RELEASE CONFIRM, which we in turn use to trigger RSL CHANNEL RELEASE,
which in turn is acknowledged by RSL CHANNEL RELEASE ACK, which calls which in turn is acknowledged by RSL CHANNEL RELEASE ACK, which calls
lchan_free() */ lchan_free() */
int rsl_release_request(struct gsm_lchan *lchan, u_int8_t link_id, u_int8_t reason) int rsl_release_request(struct gsm_lchan *lchan, uint8_t link_id, uint8_t reason)
{ {
struct msgb *msg; struct msgb *msg;
@ -889,7 +889,7 @@ static int rsl_rx_chan_act_nack(struct msgb *msg)
rsl_tlv_parse(&tp, dh->data, msgb_l2len(msg)-sizeof(*dh)); rsl_tlv_parse(&tp, dh->data, msgb_l2len(msg)-sizeof(*dh));
if (TLVP_PRESENT(&tp, RSL_IE_CAUSE)) { if (TLVP_PRESENT(&tp, RSL_IE_CAUSE)) {
const u_int8_t *cause = TLVP_VAL(&tp, RSL_IE_CAUSE); const uint8_t *cause = TLVP_VAL(&tp, RSL_IE_CAUSE);
print_rsl_cause(LOGL_ERROR, cause, print_rsl_cause(LOGL_ERROR, cause,
TLVP_LEN(&tp, RSL_IE_CAUSE)); TLVP_LEN(&tp, RSL_IE_CAUSE));
if (*cause != RSL_ERR_RCH_ALR_ACTV_ALLOC) if (*cause != RSL_ERR_RCH_ALR_ACTV_ALLOC)
@ -982,8 +982,8 @@ static int rsl_rx_meas_res(struct msgb *msg)
struct abis_rsl_dchan_hdr *dh = msgb_l2(msg); struct abis_rsl_dchan_hdr *dh = msgb_l2(msg);
struct tlv_parsed tp; struct tlv_parsed tp;
struct gsm_meas_rep *mr = lchan_next_meas_rep(msg->lchan); struct gsm_meas_rep *mr = lchan_next_meas_rep(msg->lchan);
u_int8_t len; uint8_t len;
const u_int8_t *val; const uint8_t *val;
int rc; int rc;
/* check if this channel is actually active */ /* check if this channel is actually active */
@ -1034,7 +1034,7 @@ static int rsl_rx_meas_res(struct msgb *msg)
mr->ms_l1.ta = val[1]; mr->ms_l1.ta = val[1];
} }
if (TLVP_PRESENT(&tp, RSL_IE_L3_INFO)) { if (TLVP_PRESENT(&tp, RSL_IE_L3_INFO)) {
msg->l3h = (u_int8_t *) TLVP_VAL(&tp, RSL_IE_L3_INFO); msg->l3h = (uint8_t *) TLVP_VAL(&tp, RSL_IE_L3_INFO);
rc = gsm48_parse_meas_rep(mr, msg); rc = gsm48_parse_meas_rep(mr, msg);
if (rc < 0) if (rc < 0)
return rc; return rc;
@ -1247,11 +1247,11 @@ static int rsl_rx_chan_rqd(struct msgb *msg)
enum gsm_chan_t lctype; enum gsm_chan_t lctype;
enum gsm_chreq_reason_t chreq_reason; enum gsm_chreq_reason_t chreq_reason;
struct gsm_lchan *lchan; struct gsm_lchan *lchan;
u_int8_t rqd_ta; uint8_t rqd_ta;
int is_lu; int is_lu;
u_int16_t arfcn; uint16_t arfcn;
u_int8_t ts_number, subch; uint8_t ts_number, subch;
/* parse request reference to be used in immediate assign */ /* parse request reference to be used in immediate assign */
if (rqd_hdr->data[0] != RSL_IE_REQ_REFERENCE) if (rqd_hdr->data[0] != RSL_IE_REQ_REFERENCE)
@ -1329,7 +1329,7 @@ static int rsl_rx_chan_rqd(struct msgb *msg)
static int rsl_send_imm_assignment(struct gsm_lchan *lchan) static int rsl_send_imm_assignment(struct gsm_lchan *lchan)
{ {
struct gsm_bts *bts = lchan->ts->trx->bts; struct gsm_bts *bts = lchan->ts->trx->bts;
u_int8_t buf[GSM_MACBLOCK_LEN]; uint8_t buf[GSM_MACBLOCK_LEN];
struct gsm48_imm_ass *ia = (struct gsm48_imm_ass *) buf; struct gsm48_imm_ass *ia = (struct gsm48_imm_ass *) buf;
/* create IMMEDIATE ASSIGN 04.08 messge */ /* create IMMEDIATE ASSIGN 04.08 messge */
@ -1358,17 +1358,17 @@ static int rsl_send_imm_assignment(struct gsm_lchan *lchan)
bsc_schedule_timer(&lchan->T3101, bts->network->T3101, 0); bsc_schedule_timer(&lchan->T3101, bts->network->T3101, 0);
/* send IMMEDIATE ASSIGN CMD on RSL to BTS (to send on CCCH to MS) */ /* send IMMEDIATE ASSIGN CMD on RSL to BTS (to send on CCCH to MS) */
return rsl_imm_assign_cmd(bts, sizeof(*ia)+ia->mob_alloc_len, (u_int8_t *) ia); return rsl_imm_assign_cmd(bts, sizeof(*ia)+ia->mob_alloc_len, (uint8_t *) ia);
} }
/* MS has requested a channel on the RACH */ /* MS has requested a channel on the RACH */
static int rsl_rx_ccch_load(struct msgb *msg) static int rsl_rx_ccch_load(struct msgb *msg)
{ {
struct abis_rsl_dchan_hdr *rslh = msgb_l2(msg); struct abis_rsl_dchan_hdr *rslh = msgb_l2(msg);
u_int16_t pg_buf_space; uint16_t pg_buf_space;
u_int16_t rach_slot_count = -1; uint16_t rach_slot_count = -1;
u_int16_t rach_busy_count = -1; uint16_t rach_busy_count = -1;
u_int16_t rach_access_count = -1; uint16_t rach_access_count = -1;
switch (rslh->data[0]) { switch (rslh->data[0]) {
case RSL_IE_PAGING_LOAD: case RSL_IE_PAGING_LOAD:
@ -1428,7 +1428,7 @@ static int abis_rsl_rx_cchan(struct msgb *msg)
static int rsl_rx_rll_err_ind(struct msgb *msg) static int rsl_rx_rll_err_ind(struct msgb *msg)
{ {
struct abis_rsl_rll_hdr *rllh = msgb_l2(msg); struct abis_rsl_rll_hdr *rllh = msgb_l2(msg);
u_int8_t *rlm_cause = rllh->data; uint8_t *rlm_cause = rllh->data;
LOGP(DRLL, LOGL_ERROR, "%s ERROR INDICATION cause=%s\n", LOGP(DRLL, LOGL_ERROR, "%s ERROR INDICATION cause=%s\n",
gsm_lchan_name(msg->lchan), gsm_lchan_name(msg->lchan),
@ -1481,7 +1481,7 @@ static int abis_rsl_rx_rll(struct msgb *msg)
struct abis_rsl_rll_hdr *rllh = msgb_l2(msg); struct abis_rsl_rll_hdr *rllh = msgb_l2(msg);
int rc = 0; int rc = 0;
char *ts_name; char *ts_name;
u_int8_t sapi = rllh->link_id & 7; uint8_t sapi = rllh->link_id & 7;
msg->lchan = lchan_lookup(msg->trx, rllh->chan_nr); msg->lchan = lchan_lookup(msg->trx, rllh->chan_nr);
ts_name = gsm_lchan_name(msg->lchan); ts_name = gsm_lchan_name(msg->lchan);
@ -1546,7 +1546,7 @@ static int abis_rsl_rx_rll(struct msgb *msg)
return rc; return rc;
} }
static u_int8_t ipa_smod_s_for_lchan(struct gsm_lchan *lchan) static uint8_t ipa_smod_s_for_lchan(struct gsm_lchan *lchan)
{ {
switch (lchan->tch_mode) { switch (lchan->tch_mode) {
case GSM48_CMODE_SPEECH_V1: case GSM48_CMODE_SPEECH_V1:
@ -1583,7 +1583,7 @@ static u_int8_t ipa_smod_s_for_lchan(struct gsm_lchan *lchan)
return 0; return 0;
} }
static u_int8_t ipa_rtp_pt_for_lchan(struct gsm_lchan *lchan) static uint8_t ipa_rtp_pt_for_lchan(struct gsm_lchan *lchan)
{ {
struct gsm_network *net = lchan->ts->trx->bts->network; struct gsm_network *net = lchan->ts->trx->bts->network;
@ -1631,23 +1631,23 @@ static u_int8_t ipa_rtp_pt_for_lchan(struct gsm_lchan *lchan)
static void ipac_parse_rtp(struct gsm_lchan *lchan, struct tlv_parsed *tv) static void ipac_parse_rtp(struct gsm_lchan *lchan, struct tlv_parsed *tv)
{ {
struct in_addr ip; struct in_addr ip;
u_int16_t port, conn_id; uint16_t port, conn_id;
if (TLVP_PRESENT(tv, RSL_IE_IPAC_LOCAL_IP)) { if (TLVP_PRESENT(tv, RSL_IE_IPAC_LOCAL_IP)) {
ip.s_addr = *((u_int32_t *) TLVP_VAL(tv, RSL_IE_IPAC_LOCAL_IP)); ip.s_addr = *((uint32_t *) TLVP_VAL(tv, RSL_IE_IPAC_LOCAL_IP));
DEBUGPC(DRSL, "LOCAL_IP=%s ", inet_ntoa(ip)); DEBUGPC(DRSL, "LOCAL_IP=%s ", inet_ntoa(ip));
lchan->abis_ip.bound_ip = ntohl(ip.s_addr); lchan->abis_ip.bound_ip = ntohl(ip.s_addr);
} }
if (TLVP_PRESENT(tv, RSL_IE_IPAC_LOCAL_PORT)) { if (TLVP_PRESENT(tv, RSL_IE_IPAC_LOCAL_PORT)) {
port = *((u_int16_t *) TLVP_VAL(tv, RSL_IE_IPAC_LOCAL_PORT)); port = *((uint16_t *) TLVP_VAL(tv, RSL_IE_IPAC_LOCAL_PORT));
port = ntohs(port); port = ntohs(port);
DEBUGPC(DRSL, "LOCAL_PORT=%u ", port); DEBUGPC(DRSL, "LOCAL_PORT=%u ", port);
lchan->abis_ip.bound_port = port; lchan->abis_ip.bound_port = port;
} }
if (TLVP_PRESENT(tv, RSL_IE_IPAC_CONN_ID)) { if (TLVP_PRESENT(tv, RSL_IE_IPAC_CONN_ID)) {
conn_id = *((u_int16_t *) TLVP_VAL(tv, RSL_IE_IPAC_CONN_ID)); conn_id = *((uint16_t *) TLVP_VAL(tv, RSL_IE_IPAC_CONN_ID));
conn_id = ntohs(conn_id); conn_id = ntohs(conn_id);
DEBUGPC(DRSL, "CON_ID=%u ", conn_id); DEBUGPC(DRSL, "CON_ID=%u ", conn_id);
lchan->abis_ip.conn_id = conn_id; lchan->abis_ip.conn_id = conn_id;
@ -1668,13 +1668,13 @@ static void ipac_parse_rtp(struct gsm_lchan *lchan, struct tlv_parsed *tv)
} }
if (TLVP_PRESENT(tv, RSL_IE_IPAC_REMOTE_IP)) { if (TLVP_PRESENT(tv, RSL_IE_IPAC_REMOTE_IP)) {
ip.s_addr = *((u_int32_t *) TLVP_VAL(tv, RSL_IE_IPAC_REMOTE_IP)); ip.s_addr = *((uint32_t *) TLVP_VAL(tv, RSL_IE_IPAC_REMOTE_IP));
DEBUGPC(DRSL, "REMOTE_IP=%s ", inet_ntoa(ip)); DEBUGPC(DRSL, "REMOTE_IP=%s ", inet_ntoa(ip));
lchan->abis_ip.connect_ip = ntohl(ip.s_addr); lchan->abis_ip.connect_ip = ntohl(ip.s_addr);
} }
if (TLVP_PRESENT(tv, RSL_IE_IPAC_REMOTE_PORT)) { if (TLVP_PRESENT(tv, RSL_IE_IPAC_REMOTE_PORT)) {
port = *((u_int16_t *) TLVP_VAL(tv, RSL_IE_IPAC_REMOTE_PORT)); port = *((uint16_t *) TLVP_VAL(tv, RSL_IE_IPAC_REMOTE_PORT));
port = ntohs(port); port = ntohs(port);
DEBUGPC(DRSL, "REMOTE_PORT=%u ", port); DEBUGPC(DRSL, "REMOTE_PORT=%u ", port);
lchan->abis_ip.connect_port = port; lchan->abis_ip.connect_port = port;
@ -1706,12 +1706,12 @@ int rsl_ipacc_crcx(struct gsm_lchan *lchan)
return abis_rsl_sendmsg(msg); return abis_rsl_sendmsg(msg);
} }
int rsl_ipacc_mdcx(struct gsm_lchan *lchan, u_int32_t ip, u_int16_t port, int rsl_ipacc_mdcx(struct gsm_lchan *lchan, uint32_t ip, uint16_t port,
u_int8_t rtp_payload2) uint8_t rtp_payload2)
{ {
struct msgb *msg = rsl_msgb_alloc(); struct msgb *msg = rsl_msgb_alloc();
struct abis_rsl_dchan_hdr *dh; struct abis_rsl_dchan_hdr *dh;
u_int32_t *att_ip; uint32_t *att_ip;
struct in_addr ia; struct in_addr ia;
dh = (struct abis_rsl_dchan_hdr *) msgb_put(msg, sizeof(*dh)); dh = (struct abis_rsl_dchan_hdr *) msgb_put(msg, sizeof(*dh));
@ -1736,7 +1736,7 @@ int rsl_ipacc_mdcx(struct gsm_lchan *lchan, u_int32_t ip, u_int16_t port,
msgb_tv16_put(msg, RSL_IE_IPAC_CONN_ID, lchan->abis_ip.conn_id); msgb_tv16_put(msg, RSL_IE_IPAC_CONN_ID, lchan->abis_ip.conn_id);
msgb_v_put(msg, RSL_IE_IPAC_REMOTE_IP); msgb_v_put(msg, RSL_IE_IPAC_REMOTE_IP);
att_ip = (u_int32_t *) msgb_put(msg, sizeof(ip)); att_ip = (uint32_t *) msgb_put(msg, sizeof(ip));
*att_ip = ia.s_addr; *att_ip = ia.s_addr;
msgb_tv16_put(msg, RSL_IE_IPAC_REMOTE_PORT, port); msgb_tv16_put(msg, RSL_IE_IPAC_REMOTE_PORT, port);
msgb_tv_put(msg, RSL_IE_IPAC_SPEECH_MODE, lchan->abis_ip.speech_mode); msgb_tv_put(msg, RSL_IE_IPAC_SPEECH_MODE, lchan->abis_ip.speech_mode);
@ -1767,7 +1767,7 @@ int rsl_ipacc_pdch_activate(struct gsm_bts_trx_ts *ts, int act)
{ {
struct msgb *msg = rsl_msgb_alloc(); struct msgb *msg = rsl_msgb_alloc();
struct abis_rsl_dchan_hdr *dh; struct abis_rsl_dchan_hdr *dh;
u_int8_t msg_type; uint8_t msg_type;
if (act) if (act)
msg_type = RSL_MT_IPAC_PDCH_ACT; msg_type = RSL_MT_IPAC_PDCH_ACT;

View File

@ -47,9 +47,9 @@ static void handle_chan_ack(struct gsm_subscriber_connection *conn, struct bsc_a
static void handle_chan_nack(struct gsm_subscriber_connection *conn, struct bsc_api *bsc, struct gsm_lchan *lchan); static void handle_chan_nack(struct gsm_subscriber_connection *conn, struct bsc_api *bsc, struct gsm_lchan *lchan);
/* GSM 08.08 3.2.2.33 */ /* GSM 08.08 3.2.2.33 */
static u_int8_t lchan_to_chosen_channel(struct gsm_lchan *lchan) static uint8_t lchan_to_chosen_channel(struct gsm_lchan *lchan)
{ {
u_int8_t channel_mode = 0, channel = 0; uint8_t channel_mode = 0, channel = 0;
switch (lchan->tch_mode) { switch (lchan->tch_mode) {
case GSM48_CMODE_SPEECH_V1: case GSM48_CMODE_SPEECH_V1:
@ -95,7 +95,7 @@ static u_int8_t lchan_to_chosen_channel(struct gsm_lchan *lchan)
return channel_mode << 4 | channel; return channel_mode << 4 | channel;
} }
static u_int8_t chan_mode_to_speech(struct gsm_lchan *lchan) static uint8_t chan_mode_to_speech(struct gsm_lchan *lchan)
{ {
int mode = 0; int mode = 0;

View File

@ -254,6 +254,6 @@ struct msgb *bsc_msc_id_get_resp(const char *token)
msg->l2h = msgb_v_put(msg, IPAC_MSGT_ID_RESP); msg->l2h = msgb_v_put(msg, IPAC_MSGT_ID_RESP);
msgb_l16tv_put(msg, strlen(token) + 1, msgb_l16tv_put(msg, strlen(token) + 1,
IPAC_IDTAG_UNITNAME, (u_int8_t *) token); IPAC_IDTAG_UNITNAME, (uint8_t *) token);
return msg; return msg;
} }

View File

@ -37,9 +37,9 @@ struct bsc_rll_req {
struct timer_list timer; struct timer_list timer;
struct gsm_lchan *lchan; struct gsm_lchan *lchan;
u_int8_t link_id; uint8_t link_id;
void (*cb)(struct gsm_lchan *lchan, u_int8_t link_id, void (*cb)(struct gsm_lchan *lchan, uint8_t link_id,
void *data, enum bsc_rllr_ind); void *data, enum bsc_rllr_ind);
void *data; void *data;
}; };
@ -64,13 +64,13 @@ static void timer_cb(void *_rllr)
} }
/* establish a RLL connection with given SAPI / priority */ /* establish a RLL connection with given SAPI / priority */
int rll_establish(struct gsm_lchan *lchan, u_int8_t sapi, int rll_establish(struct gsm_lchan *lchan, uint8_t sapi,
void (*cb)(struct gsm_lchan *, u_int8_t, void *, void (*cb)(struct gsm_lchan *, uint8_t, void *,
enum bsc_rllr_ind), enum bsc_rllr_ind),
void *data) void *data)
{ {
struct bsc_rll_req *rllr = talloc_zero(tall_bsc_ctx, struct bsc_rll_req); struct bsc_rll_req *rllr = talloc_zero(tall_bsc_ctx, struct bsc_rll_req);
u_int8_t link_id; uint8_t link_id;
if (!rllr) if (!rllr)
return -ENOMEM; return -ENOMEM;
@ -100,7 +100,7 @@ int rll_establish(struct gsm_lchan *lchan, u_int8_t sapi,
/* Called from RSL code in case we have received an indication regarding /* Called from RSL code in case we have received an indication regarding
* any RLL link */ * any RLL link */
void rll_indication(struct gsm_lchan *lchan, u_int8_t link_id, u_int8_t type) void rll_indication(struct gsm_lchan *lchan, uint8_t link_id, uint8_t type)
{ {
struct bsc_rll_req *rllr, *rllr2; struct bsc_rll_req *rllr, *rllr2;

View File

@ -182,8 +182,8 @@ static void patch_32(uint8_t *data, const uint32_t val)
*/ */
static void patch_nm_tables(struct gsm_bts *bts) static void patch_nm_tables(struct gsm_bts *bts)
{ {
u_int8_t arfcn_low = bts->c0->arfcn & 0xff; uint8_t arfcn_low = bts->c0->arfcn & 0xff;
u_int8_t arfcn_high = (bts->c0->arfcn >> 8) & 0x0f; uint8_t arfcn_high = (bts->c0->arfcn >> 8) & 0x0f;
/* patch ARFCN into BTS Attributes */ /* patch ARFCN into BTS Attributes */
nanobts_attr_bts[42] &= 0xf0; nanobts_attr_bts[42] &= 0xf0;
@ -196,8 +196,8 @@ static void patch_nm_tables(struct gsm_bts *bts)
} }
if (bts->rach_ldavg_slots != -1) { if (bts->rach_ldavg_slots != -1) {
u_int8_t avg_high = bts->rach_ldavg_slots & 0xff; uint8_t avg_high = bts->rach_ldavg_slots & 0xff;
u_int8_t avg_low = (bts->rach_ldavg_slots >> 8) & 0x0f; uint8_t avg_low = (bts->rach_ldavg_slots >> 8) & 0x0f;
nanobts_attr_bts[35] = avg_high; nanobts_attr_bts[35] = avg_high;
nanobts_attr_bts[36] = avg_low; nanobts_attr_bts[36] = avg_low;
@ -249,7 +249,7 @@ static void patch_nm_tables(struct gsm_bts *bts)
/* Callback function to be called whenever we get a GSM 12.21 state change event */ /* Callback function to be called whenever we get a GSM 12.21 state change event */
static int nm_statechg_event(int evt, struct nm_statechg_signal_data *nsd) static int nm_statechg_event(int evt, struct nm_statechg_signal_data *nsd)
{ {
u_int8_t obj_class = nsd->obj_class; uint8_t obj_class = nsd->obj_class;
void *obj = nsd->obj; void *obj = nsd->obj;
struct gsm_nm_state *new_state = nsd->new_state; struct gsm_nm_state *new_state = nsd->new_state;

View File

@ -346,8 +346,8 @@ static unsigned char bs11_attr_radio[] =
*/ */
static void patch_nm_tables(struct gsm_bts *bts) static void patch_nm_tables(struct gsm_bts *bts)
{ {
u_int8_t arfcn_low = bts->c0->arfcn & 0xff; uint8_t arfcn_low = bts->c0->arfcn & 0xff;
u_int8_t arfcn_high = (bts->c0->arfcn >> 8) & 0x0f; uint8_t arfcn_high = (bts->c0->arfcn >> 8) & 0x0f;
/* patch ARFCN into BTS Attributes */ /* patch ARFCN into BTS Attributes */
bs11_attr_bts[69] &= 0xf0; bs11_attr_bts[69] &= 0xf0;
@ -364,8 +364,8 @@ static void patch_nm_tables(struct gsm_bts *bts)
bs11_attr_bts[33] = bts->rach_b_thresh & 0xff; bs11_attr_bts[33] = bts->rach_b_thresh & 0xff;
if (bts->rach_ldavg_slots != -1) { if (bts->rach_ldavg_slots != -1) {
u_int8_t avg_high = bts->rach_ldavg_slots & 0xff; uint8_t avg_high = bts->rach_ldavg_slots & 0xff;
u_int8_t avg_low = (bts->rach_ldavg_slots >> 8) & 0x0f; uint8_t avg_low = (bts->rach_ldavg_slots >> 8) & 0x0f;
bs11_attr_bts[35] = avg_high; bs11_attr_bts[35] = avg_high;
bs11_attr_bts[36] = avg_low; bs11_attr_bts[36] = avg_low;
@ -425,9 +425,9 @@ static void nm_reconfig_trx(struct gsm_bts_trx *trx)
abis_nm_set_radio_attr(trx, bs11_attr_radio, abis_nm_set_radio_attr(trx, bs11_attr_radio,
sizeof(bs11_attr_radio)); sizeof(bs11_attr_radio));
else { else {
u_int8_t trx1_attr_radio[sizeof(bs11_attr_radio)]; uint8_t trx1_attr_radio[sizeof(bs11_attr_radio)];
u_int8_t arfcn_low = trx->arfcn & 0xff; uint8_t arfcn_low = trx->arfcn & 0xff;
u_int8_t arfcn_high = (trx->arfcn >> 8) & 0x0f; uint8_t arfcn_high = (trx->arfcn >> 8) & 0x0f;
memcpy(trx1_attr_radio, bs11_attr_radio, memcpy(trx1_attr_radio, bs11_attr_radio,
sizeof(trx1_attr_radio)); sizeof(trx1_attr_radio));

View File

@ -143,7 +143,7 @@ void ts_free(struct gsm_bts_trx_ts *ts)
ts->pchan = GSM_PCHAN_NONE; ts->pchan = GSM_PCHAN_NONE;
} }
static const u_int8_t subslots_per_pchan[] = { static const uint8_t subslots_per_pchan[] = {
[GSM_PCHAN_NONE] = 0, [GSM_PCHAN_NONE] = 0,
[GSM_PCHAN_CCCH] = 0, [GSM_PCHAN_CCCH] = 0,
[GSM_PCHAN_CCCH_SDCCH4] = 4, [GSM_PCHAN_CCCH_SDCCH4] = 4,
@ -370,7 +370,7 @@ static int _lchan_release_next_sapi(struct gsm_lchan *lchan)
int sapi; int sapi;
for (sapi = 1; sapi < ARRAY_SIZE(lchan->sapis); ++sapi) { for (sapi = 1; sapi < ARRAY_SIZE(lchan->sapis); ++sapi) {
u_int8_t link_id; uint8_t link_id;
if (lchan->sapis[sapi] == LCHAN_SAPI_UNUSED) if (lchan->sapis[sapi] == LCHAN_SAPI_UNUSED)
continue; continue;
@ -401,7 +401,7 @@ static void _lchan_handle_release(struct gsm_lchan *lchan)
} }
/* called from abis rsl */ /* called from abis rsl */
int rsl_lchan_rll_release(struct gsm_lchan *lchan, u_int8_t link_id) int rsl_lchan_rll_release(struct gsm_lchan *lchan, uint8_t link_id)
{ {
if (lchan->state != LCHAN_S_REL_REQ) if (lchan->state != LCHAN_S_REL_REQ)
return -1; return -1;

View File

@ -52,8 +52,8 @@ static int gsm48_sendmsg(struct msgb *msg)
/* Section 9.1.8 / Table 9.9 */ /* Section 9.1.8 / Table 9.9 */
struct chreq { struct chreq {
u_int8_t val; uint8_t val;
u_int8_t mask; uint8_t mask;
enum chreq_type type; enum chreq_type type;
}; };
@ -166,7 +166,7 @@ void gsm_net_update_ctype(struct gsm_network *network)
} }
} }
enum gsm_chan_t get_ctype_by_chreq(struct gsm_network *network, u_int8_t ra) enum gsm_chan_t get_ctype_by_chreq(struct gsm_network *network, uint8_t ra)
{ {
int i; int i;
int length; int length;
@ -190,7 +190,7 @@ enum gsm_chan_t get_ctype_by_chreq(struct gsm_network *network, u_int8_t ra)
return GSM_LCHAN_SDCCH; return GSM_LCHAN_SDCCH;
} }
enum gsm_chreq_reason_t get_reason_by_chreq(u_int8_t ra, int neci) enum gsm_chreq_reason_t get_reason_by_chreq(uint8_t ra, int neci)
{ {
int i; int i;
int length; int length;
@ -218,7 +218,7 @@ int gsm48_send_rr_release(struct gsm_lchan *lchan)
{ {
struct msgb *msg = gsm48_msgb_alloc(); struct msgb *msg = gsm48_msgb_alloc();
struct gsm48_hdr *gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh)); struct gsm48_hdr *gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh));
u_int8_t *cause; uint8_t *cause;
msg->lchan = lchan; msg->lchan = lchan;
gh->proto_discr = GSM48_PDISC_RR; gh->proto_discr = GSM48_PDISC_RR;
@ -239,7 +239,7 @@ int gsm48_send_rr_release(struct gsm_lchan *lchan)
} }
int send_siemens_mrpci(struct gsm_lchan *lchan, int send_siemens_mrpci(struct gsm_lchan *lchan,
u_int8_t *classmark2_lv) uint8_t *classmark2_lv)
{ {
struct rsl_mrpci mrpci; struct rsl_mrpci mrpci;
@ -260,7 +260,7 @@ int gsm48_extract_mi(uint8_t *classmark2_lv, int length, char *mi_string, uint8_
if (length < 1 + *classmark2_lv) if (length < 1 + *classmark2_lv)
return -1; return -1;
u_int8_t *mi_lv = classmark2_lv + *classmark2_lv + 1; uint8_t *mi_lv = classmark2_lv + *classmark2_lv + 1;
if (length < 2 + *classmark2_lv + mi_lv[0]) if (length < 2 + *classmark2_lv + mi_lv[0])
return -2; return -2;
@ -269,11 +269,11 @@ int gsm48_extract_mi(uint8_t *classmark2_lv, int length, char *mi_string, uint8_
} }
int gsm48_paging_extract_mi(struct gsm48_pag_resp *resp, int length, int gsm48_paging_extract_mi(struct gsm48_pag_resp *resp, int length,
char *mi_string, u_int8_t *mi_type) char *mi_string, uint8_t *mi_type)
{ {
static const uint32_t classmark_offset = static const uint32_t classmark_offset =
offsetof(struct gsm48_pag_resp, classmark2); offsetof(struct gsm48_pag_resp, classmark2);
u_int8_t *classmark2_lv = (uint8_t *) &resp->classmark2; uint8_t *classmark2_lv = (uint8_t *) &resp->classmark2;
return gsm48_extract_mi(classmark2_lv, length - classmark_offset, return gsm48_extract_mi(classmark2_lv, length - classmark_offset,
mi_string, mi_type); mi_string, mi_type);
} }
@ -283,7 +283,7 @@ int gsm48_handle_paging_resp(struct gsm_subscriber_connection *conn,
{ {
struct gsm_bts *bts = msg->lchan->ts->trx->bts; struct gsm_bts *bts = msg->lchan->ts->trx->bts;
struct gsm48_hdr *gh = msgb_l3(msg); struct gsm48_hdr *gh = msgb_l3(msg);
u_int8_t *classmark2_lv = gh->data + 1; uint8_t *classmark2_lv = gh->data + 1;
if (is_siemens_bts(bts)) if (is_siemens_bts(bts))
send_siemens_mrpci(msg->lchan, classmark2_lv); send_siemens_mrpci(msg->lchan, classmark2_lv);
@ -312,7 +312,7 @@ int gsm48_send_rr_ciph_mode(struct gsm_lchan *lchan, int want_imeisv)
{ {
struct msgb *msg = gsm48_msgb_alloc(); struct msgb *msg = gsm48_msgb_alloc();
struct gsm48_hdr *gh; struct gsm48_hdr *gh;
u_int8_t ciph_mod_set; uint8_t ciph_mod_set;
msg->lchan = lchan; msg->lchan = lchan;
@ -343,7 +343,7 @@ static void gsm48_cell_desc(struct gsm48_cell_desc *cd,
void gsm48_lchan2chan_desc(struct gsm48_chan_desc *cd, void gsm48_lchan2chan_desc(struct gsm48_chan_desc *cd,
const struct gsm_lchan *lchan) const struct gsm_lchan *lchan)
{ {
u_int16_t arfcn = lchan->ts->trx->arfcn & 0x3ff; uint16_t arfcn = lchan->ts->trx->arfcn & 0x3ff;
cd->chan_nr = lchan2chan_nr(lchan); cd->chan_nr = lchan2chan_nr(lchan);
if (!lchan->ts->hopping.enabled) { if (!lchan->ts->hopping.enabled) {
@ -364,7 +364,7 @@ void gsm48_lchan2chan_desc(struct gsm48_chan_desc *cd,
/* Chapter 9.1.15: Handover Command */ /* Chapter 9.1.15: Handover Command */
int gsm48_send_ho_cmd(struct gsm_lchan *old_lchan, struct gsm_lchan *new_lchan, int gsm48_send_ho_cmd(struct gsm_lchan *old_lchan, struct gsm_lchan *new_lchan,
u_int8_t power_command, u_int8_t ho_ref) uint8_t power_command, uint8_t ho_ref)
{ {
struct msgb *msg = gsm48_msgb_alloc(); struct msgb *msg = gsm48_msgb_alloc();
struct gsm48_hdr *gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh)); struct gsm48_hdr *gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh));
@ -403,7 +403,7 @@ int gsm48_send_ho_cmd(struct gsm_lchan *old_lchan, struct gsm_lchan *new_lchan,
} }
/* Chapter 9.1.2: Assignment Command */ /* Chapter 9.1.2: Assignment Command */
int gsm48_send_rr_ass_cmd(struct gsm_lchan *dest_lchan, struct gsm_lchan *lchan, u_int8_t power_command) int gsm48_send_rr_ass_cmd(struct gsm_lchan *dest_lchan, struct gsm_lchan *lchan, uint8_t power_command)
{ {
struct msgb *msg = gsm48_msgb_alloc(); struct msgb *msg = gsm48_msgb_alloc();
struct gsm48_hdr *gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh)); struct gsm48_hdr *gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh));
@ -443,7 +443,7 @@ int gsm48_send_rr_ass_cmd(struct gsm_lchan *dest_lchan, struct gsm_lchan *lchan,
LOGP(DRR, LOGL_ERROR, "BUG: Using multirate codec " LOGP(DRR, LOGL_ERROR, "BUG: Using multirate codec "
"without multirate config.\n"); "without multirate config.\n");
} else { } else {
u_int8_t *data = msgb_put(msg, 4); uint8_t *data = msgb_put(msg, 4);
data[0] = GSM48_IE_MUL_RATE_CFG; data[0] = GSM48_IE_MUL_RATE_CFG;
data[1] = 0x2; data[1] = 0x2;
memcpy(&data[2], &lchan->mr_conf, 2); memcpy(&data[2], &lchan->mr_conf, 2);
@ -454,7 +454,7 @@ int gsm48_send_rr_ass_cmd(struct gsm_lchan *dest_lchan, struct gsm_lchan *lchan,
} }
/* 9.1.5 Channel mode modify: Modify the mode on the MS side */ /* 9.1.5 Channel mode modify: Modify the mode on the MS side */
int gsm48_tx_chan_mode_modify(struct gsm_lchan *lchan, u_int8_t mode) int gsm48_tx_chan_mode_modify(struct gsm_lchan *lchan, uint8_t mode)
{ {
struct msgb *msg = gsm48_msgb_alloc(); struct msgb *msg = gsm48_msgb_alloc();
struct gsm48_hdr *gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh)); struct gsm48_hdr *gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh));
@ -479,7 +479,7 @@ int gsm48_tx_chan_mode_modify(struct gsm_lchan *lchan, u_int8_t mode)
LOGP(DRR, LOGL_ERROR, "BUG: Using multirate codec " LOGP(DRR, LOGL_ERROR, "BUG: Using multirate codec "
"without multirate config.\n"); "without multirate config.\n");
} else { } else {
u_int8_t *data = msgb_put(msg, 4); uint8_t *data = msgb_put(msg, 4);
data[0] = GSM48_IE_MUL_RATE_CFG; data[0] = GSM48_IE_MUL_RATE_CFG;
data[1] = 0x2; data[1] = 0x2;
memcpy(&data[2], &lchan->mr_conf, 2); memcpy(&data[2], &lchan->mr_conf, 2);
@ -489,7 +489,7 @@ int gsm48_tx_chan_mode_modify(struct gsm_lchan *lchan, u_int8_t mode)
return gsm48_sendmsg(msg); return gsm48_sendmsg(msg);
} }
int gsm48_lchan_modify(struct gsm_lchan *lchan, u_int8_t lchan_mode) int gsm48_lchan_modify(struct gsm_lchan *lchan, uint8_t lchan_mode)
{ {
int rc; int rc;
@ -547,7 +547,7 @@ int gsm48_rx_rr_modif_ack(struct msgb *msg)
int gsm48_parse_meas_rep(struct gsm_meas_rep *rep, struct msgb *msg) int gsm48_parse_meas_rep(struct gsm_meas_rep *rep, struct msgb *msg)
{ {
struct gsm48_hdr *gh = msgb_l3(msg); struct gsm48_hdr *gh = msgb_l3(msg);
u_int8_t *data = gh->data; uint8_t *data = gh->data;
struct gsm_bts *bts = msg->lchan->ts->trx->bts; struct gsm_bts *bts = msg->lchan->ts->trx->bts;
struct bitvec *nbv = &bts->si_common.neigh_list; struct bitvec *nbv = &bts->si_common.neigh_list;
struct gsm_meas_rep_cell *mrc; struct gsm_meas_rep_cell *mrc;

View File

@ -35,7 +35,7 @@
/* issue handover to a cell identified by ARFCN and BSIC */ /* issue handover to a cell identified by ARFCN and BSIC */
static int handover_to_arfcn_bsic(struct gsm_lchan *lchan, static int handover_to_arfcn_bsic(struct gsm_lchan *lchan,
u_int16_t arfcn, u_int8_t bsic) uint16_t arfcn, uint8_t bsic)
{ {
struct gsm_bts *new_bts; struct gsm_bts *new_bts;
@ -53,7 +53,7 @@ static int handover_to_arfcn_bsic(struct gsm_lchan *lchan,
/* did we get a RXLEV for a given cell in the given report? */ /* did we get a RXLEV for a given cell in the given report? */
static int rxlev_for_cell_in_rep(struct gsm_meas_rep *mr, static int rxlev_for_cell_in_rep(struct gsm_meas_rep *mr,
u_int16_t arfcn, u_int8_t bsic) uint16_t arfcn, uint8_t bsic)
{ {
int i; int i;

View File

@ -49,7 +49,7 @@ struct bsc_handover {
struct timer_list T3103; struct timer_list T3103;
u_int8_t ho_ref; uint8_t ho_ref;
}; };
static LLIST_HEAD(bsc_handovers); static LLIST_HEAD(bsc_handovers);
@ -85,7 +85,7 @@ int bsc_handover_start(struct gsm_lchan *old_lchan, struct gsm_bts *bts)
{ {
struct gsm_lchan *new_lchan; struct gsm_lchan *new_lchan;
struct bsc_handover *ho; struct bsc_handover *ho;
static u_int8_t ho_ref; static uint8_t ho_ref;
int rc; int rc;
/* don't attempt multiple handovers for the same lchan at /* don't attempt multiple handovers for the same lchan at

View File

@ -81,7 +81,7 @@ static void paging_remove_request(struct gsm_bts_paging_state *paging_bts,
static void page_ms(struct gsm_paging_request *request) static void page_ms(struct gsm_paging_request *request)
{ {
u_int8_t mi[128]; uint8_t mi[128];
unsigned int mi_len; unsigned int mi_len;
unsigned int page_group; unsigned int page_group;
@ -387,7 +387,7 @@ void paging_request_stop(struct gsm_bts *_bts, struct gsm_subscriber *subscr,
} while (1); } while (1);
} }
void paging_update_buffer_space(struct gsm_bts *bts, u_int16_t free_slots) void paging_update_buffer_space(struct gsm_bts *bts, uint16_t free_slots)
{ {
bsc_del_timer(&bts->paging.credit_timer); bsc_del_timer(&bts->paging.credit_timer);
bts->paging.available_slots = free_slots; bts->paging.available_slots = free_slots;

View File

@ -30,7 +30,7 @@
#include <openbsc/rest_octets.h> #include <openbsc/rest_octets.h>
/* generate SI1 rest octets */ /* generate SI1 rest octets */
int rest_octets_si1(u_int8_t *data, u_int8_t *nch_pos) int rest_octets_si1(uint8_t *data, uint8_t *nch_pos)
{ {
struct bitvec bv; struct bitvec bv;
@ -88,7 +88,7 @@ static void append_gprs_ind(struct bitvec *bv,
/* Generate SI3 Rest Octests (Chapter 10.5.2.34 / Table 10.4.72) */ /* Generate SI3 Rest Octests (Chapter 10.5.2.34 / Table 10.4.72) */
int rest_octets_si3(u_int8_t *data, const struct gsm48_si_ro_info *si3) int rest_octets_si3(uint8_t *data, const struct gsm48_si_ro_info *si3)
{ {
struct bitvec bv; struct bitvec bv;
@ -136,7 +136,7 @@ static int append_lsa_params(struct bitvec *bv,
} }
/* Generate SI4 Rest Octets (Chapter 10.5.2.35) */ /* Generate SI4 Rest Octets (Chapter 10.5.2.35) */
int rest_octets_si4(u_int8_t *data, const struct gsm48_si_ro_info *si4) int rest_octets_si4(uint8_t *data, const struct gsm48_si_ro_info *si4)
{ {
struct bitvec bv; struct bitvec bv;
@ -366,7 +366,7 @@ static void append_gprs_pwr_ctrl_pars(struct bitvec *bv,
} }
/* Generate SI13 Rest Octests (04.08 Chapter 10.5.2.37b) */ /* Generate SI13 Rest Octests (04.08 Chapter 10.5.2.37b) */
int rest_octets_si13(u_int8_t *data, const struct gsm48_si13_info *si13) int rest_octets_si13(uint8_t *data, const struct gsm48_si13_info *si13)
{ {
struct bitvec bv; struct bitvec bv;

View File

@ -56,7 +56,7 @@ static_assert(sizeof(struct gsm48_system_information_type_13) == 3, _si13_size);
/* Frequency Lists as per TS 04.08 10.5.2.13 */ /* Frequency Lists as per TS 04.08 10.5.2.13 */
/* 10.5.2.13.2: Bit map 0 format */ /* 10.5.2.13.2: Bit map 0 format */
static int freq_list_bm0_set_arfcn(u_int8_t *chan_list, unsigned int arfcn) static int freq_list_bm0_set_arfcn(uint8_t *chan_list, unsigned int arfcn)
{ {
unsigned int byte, bit; unsigned int byte, bit;
@ -77,7 +77,7 @@ static int freq_list_bm0_set_arfcn(u_int8_t *chan_list, unsigned int arfcn)
} }
/* 10.5.2.13.7: Variable bit map format */ /* 10.5.2.13.7: Variable bit map format */
static int freq_list_bmrel_set_arfcn(u_int8_t *chan_list, unsigned int arfcn) static int freq_list_bmrel_set_arfcn(uint8_t *chan_list, unsigned int arfcn)
{ {
unsigned int byte, bit; unsigned int byte, bit;
unsigned int min_arfcn; unsigned int min_arfcn;
@ -110,7 +110,7 @@ static int freq_list_bmrel_set_arfcn(u_int8_t *chan_list, unsigned int arfcn)
} }
/* generate a cell channel list as per Section 10.5.2.1b of 04.08 */ /* generate a cell channel list as per Section 10.5.2.1b of 04.08 */
static int bitvec2freq_list(u_int8_t *chan_list, struct bitvec *bv, static int bitvec2freq_list(uint8_t *chan_list, struct bitvec *bv,
const struct gsm_bts *bts) const struct gsm_bts *bts)
{ {
int i, rc, min = 1024, max = -1; int i, rc, min = 1024, max = -1;
@ -171,7 +171,7 @@ static int bitvec2freq_list(u_int8_t *chan_list, struct bitvec *bv,
} }
/* generate a cell channel list as per Section 10.5.2.1b of 04.08 */ /* generate a cell channel list as per Section 10.5.2.1b of 04.08 */
static int generate_cell_chan_list(u_int8_t *chan_list, struct gsm_bts *bts) static int generate_cell_chan_list(uint8_t *chan_list, struct gsm_bts *bts)
{ {
struct gsm_bts_trx *trx; struct gsm_bts_trx *trx;
struct bitvec *bv = &bts->si_common.cell_alloc; struct bitvec *bv = &bts->si_common.cell_alloc;
@ -199,7 +199,7 @@ static int generate_cell_chan_list(u_int8_t *chan_list, struct gsm_bts *bts)
} }
/* generate a cell channel list as per Section 10.5.2.1b of 04.08 */ /* generate a cell channel list as per Section 10.5.2.1b of 04.08 */
static int generate_bcch_chan_list(u_int8_t *chan_list, struct gsm_bts *bts, int si5) static int generate_bcch_chan_list(uint8_t *chan_list, struct gsm_bts *bts, int si5)
{ {
struct gsm_bts *cur_bts; struct gsm_bts *cur_bts;
struct bitvec *bv; struct bitvec *bv;
@ -226,7 +226,7 @@ static int generate_bcch_chan_list(u_int8_t *chan_list, struct gsm_bts *bts, int
return bitvec2freq_list(chan_list, bv, bts); return bitvec2freq_list(chan_list, bv, bts);
} }
static int generate_si1(u_int8_t *output, struct gsm_bts *bts) static int generate_si1(uint8_t *output, struct gsm_bts *bts)
{ {
int rc; int rc;
struct gsm48_system_information_type_1 *si1 = struct gsm48_system_information_type_1 *si1 =
@ -251,7 +251,7 @@ static int generate_si1(u_int8_t *output, struct gsm_bts *bts)
return sizeof(*si1) + rc; return sizeof(*si1) + rc;
} }
static int generate_si2(u_int8_t *output, struct gsm_bts *bts) static int generate_si2(uint8_t *output, struct gsm_bts *bts)
{ {
int rc; int rc;
struct gsm48_system_information_type_2 *si2 = struct gsm48_system_information_type_2 *si2 =
@ -298,7 +298,7 @@ static struct gsm48_si_ro_info si_info = {
.break_ind = 0, .break_ind = 0,
}; };
static int generate_si3(u_int8_t *output, struct gsm_bts *bts) static int generate_si3(uint8_t *output, struct gsm_bts *bts)
{ {
int rc; int rc;
struct gsm48_system_information_type_3 *si3 = struct gsm48_system_information_type_3 *si3 =
@ -329,7 +329,7 @@ static int generate_si3(u_int8_t *output, struct gsm_bts *bts)
return sizeof(*si3) + rc; return sizeof(*si3) + rc;
} }
static int generate_si4(u_int8_t *output, struct gsm_bts *bts) static int generate_si4(uint8_t *output, struct gsm_bts *bts)
{ {
int rc; int rc;
struct gsm48_system_information_type_4 *si4 = struct gsm48_system_information_type_4 *si4 =
@ -362,7 +362,7 @@ static int generate_si4(u_int8_t *output, struct gsm_bts *bts)
return sizeof(*si4) + rc; return sizeof(*si4) + rc;
} }
static int generate_si5(u_int8_t *output, struct gsm_bts *bts) static int generate_si5(uint8_t *output, struct gsm_bts *bts)
{ {
struct gsm48_system_information_type_5 *si5; struct gsm48_system_information_type_5 *si5;
int rc, l2_plen = 18; int rc, l2_plen = 18;
@ -394,7 +394,7 @@ static int generate_si5(u_int8_t *output, struct gsm_bts *bts)
return l2_plen; return l2_plen;
} }
static int generate_si6(u_int8_t *output, struct gsm_bts *bts) static int generate_si6(uint8_t *output, struct gsm_bts *bts)
{ {
struct gsm48_system_information_type_6 *si6; struct gsm48_system_information_type_6 *si6;
int l2_plen = 11; int l2_plen = 11;
@ -468,7 +468,7 @@ static struct gsm48_si13_info si13_default = {
}, },
}; };
static int generate_si13(u_int8_t *output, struct gsm_bts *bts) static int generate_si13(uint8_t *output, struct gsm_bts *bts)
{ {
struct gsm48_system_information_type_13 *si13 = struct gsm48_system_information_type_13 *si13 =
(struct gsm48_system_information_type_13 *) output; (struct gsm48_system_information_type_13 *) output;

View File

@ -34,7 +34,7 @@ void *tall_trans_ctx;
void _gsm48_cc_trans_free(struct gsm_trans *trans); void _gsm48_cc_trans_free(struct gsm_trans *trans);
struct gsm_trans *trans_find_by_id(struct gsm_subscriber *subscr, struct gsm_trans *trans_find_by_id(struct gsm_subscriber *subscr,
u_int8_t proto, u_int8_t trans_id) uint8_t proto, uint8_t trans_id)
{ {
struct gsm_trans *trans; struct gsm_trans *trans;
struct gsm_network *net = subscr->net; struct gsm_network *net = subscr->net;
@ -49,7 +49,7 @@ struct gsm_trans *trans_find_by_id(struct gsm_subscriber *subscr,
} }
struct gsm_trans *trans_find_by_callref(struct gsm_network *net, struct gsm_trans *trans_find_by_callref(struct gsm_network *net,
u_int32_t callref) uint32_t callref)
{ {
struct gsm_trans *trans; struct gsm_trans *trans;
@ -61,8 +61,8 @@ struct gsm_trans *trans_find_by_callref(struct gsm_network *net,
} }
struct gsm_trans *trans_alloc(struct gsm_subscriber *subscr, struct gsm_trans *trans_alloc(struct gsm_subscriber *subscr,
u_int8_t protocol, u_int8_t trans_id, uint8_t protocol, uint8_t trans_id,
u_int32_t callref) uint32_t callref)
{ {
struct gsm_trans *trans; struct gsm_trans *trans;
@ -118,7 +118,7 @@ void trans_free(struct gsm_trans *trans)
/* allocate an unused transaction ID for the given subscriber /* allocate an unused transaction ID for the given subscriber
* in the given protocol using the ti_flag specified */ * in the given protocol using the ti_flag specified */
int trans_assign_trans_id(struct gsm_subscriber *subscr, int trans_assign_trans_id(struct gsm_subscriber *subscr,
u_int8_t protocol, u_int8_t ti_flag) uint8_t protocol, uint8_t ti_flag)
{ {
struct gsm_network *net = subscr->net; struct gsm_network *net = subscr->net;
struct gsm_trans *trans; struct gsm_trans *trans;

View File

@ -39,8 +39,8 @@ void *tall_bsc_ctx;
static LLIST_HEAD(bts_models); static LLIST_HEAD(bts_models);
void set_ts_e1link(struct gsm_bts_trx_ts *ts, u_int8_t e1_nr, void set_ts_e1link(struct gsm_bts_trx_ts *ts, uint8_t e1_nr,
u_int8_t e1_ts, u_int8_t e1_ts_ss) uint8_t e1_ts, uint8_t e1_ts_ss)
{ {
ts->e1_link.e1_nr = e1_nr; ts->e1_link.e1_nr = e1_nr;
ts->e1_link.e1_ts = e1_ts; ts->e1_link.e1_ts = e1_ts;
@ -184,7 +184,7 @@ static const uint8_t bts_cell_timer_default[] =
{ 3, 3, 3, 3, 3, 10, 3, 10, 3, 10, 3 }; { 3, 3, 3, 3, 3, 10, 3, 10, 3, 10, 3 };
struct gsm_bts *gsm_bts_alloc(struct gsm_network *net, enum gsm_bts_type type, struct gsm_bts *gsm_bts_alloc(struct gsm_network *net, enum gsm_bts_type type,
u_int8_t tsc, u_int8_t bsic) uint8_t tsc, uint8_t bsic)
{ {
struct gsm_bts *bts = talloc_zero(net, struct gsm_bts); struct gsm_bts *bts = talloc_zero(net, struct gsm_bts);
struct gsm_bts_model *model = bts_model_find(type); struct gsm_bts_model *model = bts_model_find(type);
@ -252,7 +252,7 @@ struct gsm_bts *gsm_bts_alloc(struct gsm_network *net, enum gsm_bts_type type,
return bts; return bts;
} }
struct gsm_network *gsm_network_init(u_int16_t country_code, u_int16_t network_code, struct gsm_network *gsm_network_init(uint16_t country_code, uint16_t network_code,
int (*mncc_recv)(struct gsm_network *, struct msgb *)) int (*mncc_recv)(struct gsm_network *, struct msgb *))
{ {
struct gsm_network *net; struct gsm_network *net;
@ -350,7 +350,7 @@ struct gsm_bts *gsm_bts_num(struct gsm_network *net, int num)
/* Get reference to a neighbor cell on a given BCCH ARFCN */ /* Get reference to a neighbor cell on a given BCCH ARFCN */
struct gsm_bts *gsm_bts_neighbor(const struct gsm_bts *bts, struct gsm_bts *gsm_bts_neighbor(const struct gsm_bts *bts,
u_int16_t arfcn, u_int8_t bsic) uint16_t arfcn, uint8_t bsic)
{ {
struct gsm_bts *neigh; struct gsm_bts *neigh;
/* FIXME: use some better heuristics here to determine which cell /* FIXME: use some better heuristics here to determine which cell
@ -493,7 +493,7 @@ void gprs_ra_id_by_bts(struct gprs_ra_id *raid, struct gsm_bts *bts)
raid->rac = bts->gprs.rac; raid->rac = bts->gprs.rac;
} }
int gsm48_ra_id_by_bts(u_int8_t *buf, struct gsm_bts *bts) int gsm48_ra_id_by_bts(uint8_t *buf, struct gsm_bts *bts)
{ {
struct gprs_ra_id raid; struct gprs_ra_id raid;

View File

@ -41,7 +41,7 @@
#include <osmocom/core/talloc.h> #include <osmocom/core/talloc.h>
int make_sock(struct bsc_fd *bfd, int proto, int make_sock(struct bsc_fd *bfd, int proto,
u_int32_t ip, u_int16_t port, int priv_nr, uint32_t ip, uint16_t port, int priv_nr,
int (*cb)(struct bsc_fd *fd, unsigned int what), void *data) int (*cb)(struct bsc_fd *fd, unsigned int what), void *data)
{ {
struct sockaddr_in addr; struct sockaddr_in addr;

View File

@ -737,7 +737,7 @@ int db_sync_equipment(struct gsm_equipment *equip)
dbi_result result; dbi_result result;
unsigned char *cm2, *cm3; unsigned char *cm2, *cm3;
char *q_imei; char *q_imei;
u_int8_t classmark1; uint8_t classmark1;
memcpy(&classmark1, &equip->classmark1, sizeof(classmark1)); memcpy(&classmark1, &equip->classmark1, sizeof(classmark1));
DEBUGP(DDB, "Sync Equipment IMEI=%s, classmark1=%02x", 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) int db_subscriber_alloc_exten(struct gsm_subscriber *subscriber)
{ {
dbi_result result = NULL; dbi_result result = NULL;
u_int32_t try; uint32_t try;
for (;;) { for (;;) {
try = (rand()%(GSM_MAX_EXTEN-GSM_MIN_EXTEN+1)+GSM_MIN_EXTEN); 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. * 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; dbi_result result;
u_int32_t try; uint32_t try;
for (;;) { for (;;) {
try = rand(); 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"); sms->user_data_len = dbi_result_get_field_length(result, "user_data");
user_data = dbi_result_get_binary(result, "user_data"); user_data = dbi_result_get_binary(result, "user_data");
if (sms->user_data_len > sizeof(sms->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); memcpy(sms->user_data, user_data, sms->user_data_len);
text = dbi_result_get_string(result, "text"); 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, int db_apdu_blob_store(struct gsm_subscriber *subscr,
u_int8_t apdu_id_flags, u_int8_t len, uint8_t apdu_id_flags, uint8_t len,
u_int8_t *apdu) uint8_t *apdu)
{ {
dbi_result result; dbi_result result;
unsigned char *q_apdu; unsigned char *q_apdu;

View File

@ -61,19 +61,19 @@
void *tall_locop_ctx; void *tall_locop_ctx;
void *tall_authciphop_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, 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 schedule_reject(struct gsm_subscriber_connection *conn);
static void release_anchor(struct gsm_subscriber_connection *conn); static void release_anchor(struct gsm_subscriber_connection *conn);
struct gsm_lai { struct gsm_lai {
u_int16_t mcc; uint16_t mcc;
u_int16_t mnc; uint16_t mnc;
u_int16_t lac; 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) 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 */ /* 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 gsm_bts *bts = conn->bts;
struct msgb *msg; 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 */ /* 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 gsm_bts *bts = conn->bts;
struct msgb *msg = gsm48_msgb_alloc(); struct msgb *msg = gsm48_msgb_alloc();
struct gsm48_hdr *gh; struct gsm48_hdr *gh;
struct gsm48_loc_area_id *lai; struct gsm48_loc_area_id *lai;
u_int8_t *mid; uint8_t *mid;
msg->lchan = conn->lchan; 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 */ /* 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 msgb *msg = gsm48_msgb_alloc();
struct gsm48_hdr *gh; 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_lchan *lchan = msg->lchan;
struct gsm_bts *bts = lchan->ts->trx->bts; struct gsm_bts *bts = lchan->ts->trx->bts;
struct gsm_network *net = bts->network; 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]; char mi_string[GSM48_MI_SIZE];
gsm48_mi_to_string(mi_string, sizeof(mi_string), &gh->data[1], gh->data[0]); 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); 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) { switch (type) {
case GSM48_LUPD_NORMAL: 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 gsm48_loc_upd_req *lu;
struct gsm_subscriber *subscr = NULL; struct gsm_subscriber *subscr = NULL;
struct gsm_bts *bts = conn->bts; struct gsm_bts *bts = conn->bts;
u_int8_t mi_type; uint8_t mi_type;
char mi_string[GSM48_MI_SIZE]; char mi_string[GSM48_MI_SIZE];
int rc; int rc;
@ -604,7 +604,7 @@ static int mm_rx_loc_upd_req(struct gsm_subscriber_connection *conn, struct msgb
} }
#if 0 #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); 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 msgb *msg = gsm48_msgb_alloc();
struct gsm48_hdr *gh; struct gsm48_hdr *gh;
struct gsm_network *net = conn->bts->network; struct gsm_network *net = conn->bts->network;
u_int8_t *ptr8; uint8_t *ptr8;
int name_len, name_pad; int name_len, name_pad;
#if 0 #if 0
time_t cur_t; 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[1] = name_len*2 +1;
ptr8[2] = 0x90; /* UCS2, no spare bits, no CI */ 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++) for (i = 0; i < name_len; i++)
ptr16[i] = htons(net->name_long[i]); ptr16[i] = htons(net->name_long[i]);
@ -665,12 +665,12 @@ int gsm48_tx_mm_info(struct gsm_subscriber_connection *conn)
#if 0 #if 0
name_len = strlen(net->name_short); name_len = strlen(net->name_short);
/* 10.5.3.5a */ /* 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[0] = GSM48_IE_NAME_SHORT;
ptr8[1] = name_len*2 + 1; ptr8[1] = name_len*2 + 1;
ptr8[2] = 0x90; /* UCS2, no spare bits, no CI */ 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++) for (i = 0; i < name_len; i++)
ptr16[i] = htons(net->name_short[i]); ptr16[i] = htons(net->name_short[i]);
#endif #endif
@ -679,7 +679,7 @@ int gsm48_tx_mm_info(struct gsm_subscriber_connection *conn)
if (name_pad > 0) if (name_pad > 0)
name_len++; name_len++;
/* 10.5.3.5a */ /* 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[0] = GSM48_IE_NAME_SHORT;
ptr8[1] = name_len +1; ptr8[1] = name_len +1;
ptr8[2] = 0x80 | name_pad; /* Cell Broadcast DCS, no CI */ 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 */ /* 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 msgb *msg = gsm48_msgb_alloc();
struct gsm48_hdr *gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh)); 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) 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]; char mi_string[GSM48_MI_SIZE];
struct gsm_bts *bts = conn->bts; 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 *req =
(struct gsm48_service_request *)gh->data; (struct gsm48_service_request *)gh->data;
/* unfortunately in Phase1 the classmark2 length is variable */ /* unfortunately in Phase1 the classmark2 length is variable */
u_int8_t classmark2_len = gh->data[1]; uint8_t classmark2_len = gh->data[1];
u_int8_t *classmark2 = gh->data+2; uint8_t *classmark2 = gh->data+2;
u_int8_t mi_len = *(classmark2 + classmark2_len); uint8_t mi_len = *(classmark2 + classmark2_len);
u_int8_t *mi = (classmark2 + classmark2_len + 1); uint8_t *mi = (classmark2 + classmark2_len + 1);
DEBUGP(DMM, "<- CM SERVICE REQUEST "); DEBUGP(DMM, "<- CM SERVICE REQUEST ");
if (msg->data_len < sizeof(struct gsm48_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_hdr *gh = msgb_l3(msg);
struct gsm48_imsi_detach_ind *idi = struct gsm48_imsi_detach_ind *idi =
(struct gsm48_imsi_detach_ind *) gh->data; (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]; char mi_string[GSM48_MI_SIZE];
struct gsm_subscriber *subscr = NULL; 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 gsm_bts *bts = conn->bts;
struct gsm48_hdr *gh = msgb_l3(msg); struct gsm48_hdr *gh = msgb_l3(msg);
struct gsm48_pag_resp *resp; struct gsm48_pag_resp *resp;
u_int8_t *classmark2_lv = gh->data + 1; uint8_t *classmark2_lv = gh->data + 1;
u_int8_t mi_type; uint8_t mi_type;
char mi_string[GSM48_MI_SIZE]; char mi_string[GSM48_MI_SIZE];
struct gsm_subscriber *subscr = NULL; struct gsm_subscriber *subscr = NULL;
int rc = 0; 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 gsm48_hdr *gh = msgb_l3(msg);
struct gsm_subscriber *subscr = conn->subscr; struct gsm_subscriber *subscr = conn->subscr;
unsigned int payload_len = msgb_l3len(msg) - sizeof(*gh); unsigned int payload_len = msgb_l3len(msg) - sizeof(*gh);
u_int8_t cm2_len, cm3_len = 0; uint8_t cm2_len, cm3_len = 0;
u_int8_t *cm2, *cm3 = NULL; uint8_t *cm2, *cm3 = NULL;
DEBUGP(DRR, "CLASSMARK CHANGE "); 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) static int gsm48_rx_rr_app_info(struct gsm_subscriber_connection *conn, struct msgb *msg)
{ {
struct gsm48_hdr *gh = msgb_l3(msg); struct gsm48_hdr *gh = msgb_l3(msg);
u_int8_t apdu_id_flags; uint8_t apdu_id_flags;
u_int8_t apdu_len; uint8_t apdu_len;
u_int8_t *apdu_data; uint8_t *apdu_data;
apdu_id_flags = gh->data[0]; apdu_id_flags = gh->data[0];
apdu_len = gh->data[1]; apdu_len = gh->data[1];
@ -1256,8 +1256,8 @@ static int gsm0408_rcv_rr(struct gsm_subscriber_connection *conn, struct msgb *m
return rc; return rc;
} }
int gsm48_send_rr_app_info(struct gsm_subscriber_connection *conn, u_int8_t apdu_id, int gsm48_send_rr_app_info(struct gsm_subscriber_connection *conn, uint8_t apdu_id,
u_int8_t apdu_len, const u_int8_t *apdu) uint8_t apdu_len, const uint8_t *apdu)
{ {
struct msgb *msg = gsm48_msgb_alloc(); struct msgb *msg = gsm48_msgb_alloc();
struct gsm48_hdr *gh; 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 msgb *msg = gsm48_msgb_alloc();
struct gsm48_hdr *gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh)); 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; 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, 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 msgb *msg = gsm48_msgb_alloc();
struct gsm48_hdr *gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh)); 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, 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; struct gsm_mncc rel;
@ -1475,7 +1475,7 @@ static int setup_trig_pag_evt(unsigned int hooknum, unsigned int event,
return 0; 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 */ /* handle audio path for handover */
static int handle_ho_signal(unsigned int subsys, unsigned int signal, 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 */ /* 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 *trans1 = trans_find_by_callref(net, refs[0]);
struct gsm_trans *trans2 = trans_find_by_callref(net, refs[1]); 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 */ /* 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_trans *trans;
struct gsm_lchan *lchan; 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) static int gsm48_cc_rx_setup(struct gsm_trans *trans, struct msgb *msg)
{ {
struct gsm48_hdr *gh = msgb_l3(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); unsigned int payload_len = msgb_l3len(msg) - sizeof(*gh);
struct tlv_parsed tp; struct tlv_parsed tp;
struct gsm_mncc setup; struct gsm_mncc setup;
@ -2882,7 +2882,7 @@ static int _gsm48_lchan_modify(struct gsm_trans *trans, void *arg)
} }
static struct downstate { static struct downstate {
u_int32_t states; uint32_t states;
int type; int type;
int (*rout) (struct gsm_trans *trans, void *arg); int (*rout) (struct gsm_trans *trans, void *arg);
} downstatelist[] = { } downstatelist[] = {
@ -3154,7 +3154,7 @@ int mncc_tx_to_cc(struct gsm_network *net, int msg_type, void *arg)
static struct datastate { static struct datastate {
u_int32_t states; uint32_t states;
int type; int type;
int (*rout) (struct gsm_trans *trans, struct msgb *msg); int (*rout) (struct gsm_trans *trans, struct msgb *msg);
} datastatelist[] = { } datastatelist[] = {
@ -3210,8 +3210,8 @@ static struct datastate {
static int gsm0408_rcv_cc(struct gsm_subscriber_connection *conn, struct msgb *msg) static int gsm0408_rcv_cc(struct gsm_subscriber_connection *conn, struct msgb *msg)
{ {
struct gsm48_hdr *gh = msgb_l3(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;
u_int8_t transaction_id = ((gh->proto_discr & 0xf0) ^ 0x80) >> 4; /* flip */ uint8_t transaction_id = ((gh->proto_discr & 0xf0) ^ 0x80) >> 4; /* flip */
struct gsm_trans *trans = NULL; struct gsm_trans *trans = NULL;
int i, rc = 0; 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) int gsm0408_dispatch(struct gsm_subscriber_connection *conn, struct msgb *msg)
{ {
struct gsm48_hdr *gh = msgb_l3(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; int rc = 0;
if (silent_call_reroute(conn, msg)) if (silent_call_reroute(conn, msg))

View File

@ -55,7 +55,7 @@
#define GSM411_ALLOC_HEADROOM 128 #define GSM411_ALLOC_HEADROOM 128
void *tall_gsms_ctx; 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[] = { static const struct value_string cp_cause_strs[] = {
{ GSM411_CP_CAUSE_NET_FAIL, "Network Failure" }, { GSM411_CP_CAUSE_NET_FAIL, "Network Failure" },
@ -173,7 +173,7 @@ struct msgb *gsm411_msgb_alloc(void)
"GSM 04.11"); "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)); DEBUGP(DSMS, "GSM4.11 TX %s\n", hexdump(msg->data, msg->len));
msg->l3h = msg->data; 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 */ /* Prefix msg with a 04.08/04.11 CP header */
static int gsm411_cp_sendmsg(struct msgb *msg, struct gsm_trans *trans, 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; 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 */ /* Prefix msg with a RP-DATA header and send as CP-DATA */
static int gsm411_rp_sendmsg(struct msgb *msg, struct gsm_trans *trans, 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; struct gsm411_rp_hdr *rp;
u_int8_t len = msg->len; uint8_t len = msg->len;
/* GSM 04.11 RP-DATA header */ /* GSM 04.11 RP-DATA header */
rp = (struct gsm411_rp_hdr *)msgb_push(msg, sizeof(*rp)); 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 */ /* 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;
ret |= (value % 10) << 4; 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 */ /* 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) if ((value & 0x0F) > 9 || (value >> 4) > 9)
LOGP(DSMS, LOGL_ERROR, LOGP(DSMS, LOGL_ERROR,
@ -269,7 +269,7 @@ static u_int8_t unbcdify(u_int8_t value)
} }
/* Generate 03.40 TP-SCTS */ /* 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); 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) */ /* 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; struct tm tm;
u_int8_t yr = unbcdify(*scts++); uint8_t yr = unbcdify(*scts++);
if (yr <= 80) if (yr <= 80)
tm.tm_year = 100 + yr; tm.tm_year = 100 + yr;
@ -315,10 +315,10 @@ static unsigned long gsm340_vp_default(void)
} }
/* Decode validity period format 'relative' */ /* 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 */ /* Chapter 9.2.3.12.1 */
u_int8_t vp; uint8_t vp;
unsigned long minutes; unsigned long minutes;
vp = *(sms_vp); vp = *(sms_vp);
@ -334,7 +334,7 @@ static unsigned long gsm340_vp_relative(u_int8_t *sms_vp)
} }
/* Decode validity period format 'absolute' */ /* 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 */ /* Chapter 9.2.3.12.2 */
time_t expires, now; 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' */ /* 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; unsigned long minutes;
vp = *(sms_vp); vp = *(sms_vp);
if (vp == 0) { 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' */ /* 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; unsigned long minutes;
minutes = unbcdify(*sms_vp++)*60; /* hours */ 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 */ /* 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) { switch (sms_vpf) {
case GSM340_TP_VPF_RELATIVE: 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 */ /* 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; enum sms_alphabet alpha = DCS_NONE;
if ((cgbits & 0xc) == 0) { 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 */ /* 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) struct gsm_subscriber *subscr)
{ {
int len_in_bytes; 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 */ * returns total size of TPDU */
static int gsm340_gen_tpdu(struct msgb *msg, struct gsm_sms *sms) static int gsm340_gen_tpdu(struct msgb *msg, struct gsm_sms *sms)
{ {
u_int8_t *smsp; uint8_t *smsp;
u_int8_t oa[12]; /* max len per 03.40 */ uint8_t oa[12]; /* max len per 03.40 */
u_int8_t oa_len = 0; uint8_t oa_len = 0;
u_int8_t octet_len; uint8_t octet_len;
unsigned int old_msg_len = msg->len; unsigned int old_msg_len = msg->len;
/* generate first octet with masked bits */ /* 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 */ * 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) 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; struct gsm_sms *gsms;
u_int8_t sms_mti, sms_mms, sms_vpf, sms_alphabet, sms_rp; uint8_t sms_mti, sms_mms, sms_vpf, sms_alphabet, sms_rp;
u_int8_t *sms_vp; uint8_t *sms_vp;
u_int8_t da_len_bytes; uint8_t da_len_bytes;
u_int8_t address_lv[12]; /* according to 03.40 / 9.1.2.5 */ uint8_t address_lv[12]; /* according to 03.40 / 9.1.2.5 */
int rc = 0; int rc = 0;
counter_inc(conn->bts->network->stats.sms.submitted); counter_inc(conn->bts->network->stats.sms.submitted);
@ -685,7 +685,7 @@ out:
return rc; 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(); 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, 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(); 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 */ /* Receive a 04.11 TPDU inside RP-DATA / user data */
static int gsm411_rx_rp_ud(struct msgb *msg, struct gsm_trans *trans, static int gsm411_rx_rp_ud(struct msgb *msg, struct gsm_trans *trans,
struct gsm411_rp_hdr *rph, struct gsm411_rp_hdr *rph,
u_int8_t src_len, u_int8_t *src, uint8_t src_len, uint8_t *src,
u_int8_t dst_len, u_int8_t *dst, uint8_t dst_len, uint8_t *dst,
u_int8_t tpdu_len, u_int8_t *tpdu) uint8_t tpdu_len, uint8_t *tpdu)
{ {
int rc = 0; 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, static int gsm411_rx_rp_data(struct msgb *msg, struct gsm_trans *trans,
struct gsm411_rp_hdr *rph) struct gsm411_rp_hdr *rph)
{ {
u_int8_t src_len, dst_len, rpud_len; uint8_t src_len, dst_len, rpud_len;
u_int8_t *src = NULL, *dst = NULL , *rp_ud = NULL; uint8_t *src = NULL, *dst = NULL , *rp_ud = NULL;
/* in the MO case, this should always be zero length */ /* in the MO case, this should always be zero length */
src_len = rph->data[0]; 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_network *net = trans->conn->bts->network;
struct gsm_sms *sms = trans->sms.sms; struct gsm_sms *sms = trans->sms.sms;
u_int8_t cause_len = rph->data[0]; uint8_t cause_len = rph->data[0];
u_int8_t cause = rph->data[1]; uint8_t cause = rph->data[1];
/* Error in response to MT RP_DATA, i.e. the MS did not /* Error in response to MT RP_DATA, i.e. the MS did not
* successfully receive the SMS. We need to investigate * 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 gsm_trans *trans)
{ {
struct gsm411_rp_hdr *rp_data = (struct gsm411_rp_hdr*)&gh->data; 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; int rc = 0;
switch (msg_type) { switch (msg_type) {
@ -936,10 +936,10 @@ static int gsm411_tx_cp_ack(struct gsm_trans *trans)
return rc; 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(); 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, LOGP(DSMS, LOGL_NOTICE, "TX CP-ERROR, cause %d (%s)\n", cause,
get_value_string(cp_cause_strs, 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 msgb *msg)
{ {
struct gsm48_hdr *gh = msgb_l3(msg); struct gsm48_hdr *gh = msgb_l3(msg);
u_int8_t msg_type = gh->msg_type; uint8_t msg_type = gh->msg_type;
u_int8_t transaction_id = ((gh->proto_discr >> 4) ^ 0x8); /* flip */ uint8_t transaction_id = ((gh->proto_discr >> 4) ^ 0x8); /* flip */
struct gsm_trans *trans; struct gsm_trans *trans;
int rc = 0; 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 msgb *msg = gsm411_msgb_alloc();
struct gsm_trans *trans; struct gsm_trans *trans;
u_int8_t *data, *rp_ud_len; uint8_t *data, *rp_ud_len;
u_int8_t msg_ref = 42; uint8_t msg_ref = 42;
int transaction_id; int transaction_id;
int rc; int rc;
@ -1108,7 +1108,7 @@ int gsm411_send_sms(struct gsm_subscriber_connection *conn, struct gsm_sms *sms)
trans->conn = conn; trans->conn = conn;
/* Hardcode SMSC Originating Address for now */ /* 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[0] = 0x07; /* originator length == 7 */
data[1] = 0x91; /* type of number: international, ISDN */ data[1] = 0x91; /* type of number: international, ISDN */
data[2] = 0x44; /* 447785016005 */ data[2] = 0x44; /* 447785016005 */
@ -1119,11 +1119,11 @@ int gsm411_send_sms(struct gsm_subscriber_connection *conn, struct gsm_sms *sms)
data[7] = 0x50; data[7] = 0x50;
/* Hardcoded Destination Address */ /* Hardcoded Destination Address */
data = (u_int8_t *)msgb_put(msg, 1); data = (uint8_t *)msgb_put(msg, 1);
data[0] = 0; /* destination length == 0 */ data[0] = 0; /* destination length == 0 */
/* obtain a pointer for the rp_ud_len, so we can fill it later */ /* 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 */ /* generate the 03.40 TPDU */
rc = gsm340_gen_tpdu(msg, sms); rc = gsm340_gen_tpdu(msg, sms);

View File

@ -39,7 +39,7 @@
#include <osmocom/core/msgb.h> #include <osmocom/core/msgb.h>
#include <osmocom/gsm/tlv.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); 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; return data;
} }
static inline unsigned char *msgb_push_TLV1(struct msgb *msgb, u_int8_t tag, static inline unsigned char *msgb_push_TLV1(struct msgb *msgb, uint8_t tag,
u_int8_t value) uint8_t value)
{ {
uint8_t *data = msgb_push(msgb, 3); 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 msgb *msg = gsm48_msgb_alloc();
struct gsm48_hdr *gh; struct gsm48_hdr *gh;
u_int8_t *ptr8; uint8_t *ptr8;
int response_len; int response_len;
/* First put the payload text into the message */ /* First put the payload text into the message */

View File

@ -266,7 +266,7 @@ void subscr_put_channel(struct gsm_subscriber *subscr)
struct gsm_subscriber *subscr_get_by_tmsi(struct gsm_network *net, struct gsm_subscriber *subscr_get_by_tmsi(struct gsm_network *net,
u_int32_t tmsi) uint32_t tmsi)
{ {
char tmsi_string[14]; char tmsi_string[14];
struct gsm_subscriber *subscr; struct gsm_subscriber *subscr;

View File

@ -40,7 +40,7 @@ void *tall_call_ctx;
static LLIST_HEAD(call_list); 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) 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; 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_mncc connect_ack, frame_recv;
struct gsm_network *net = call->net; struct gsm_network *net = call->net;
struct gsm_call *remote; struct gsm_call *remote;
u_int32_t refs[2]; uint32_t refs[2];
/* acknowledge connect */ /* acknowledge connect */
memset(&connect_ack, 0, sizeof(struct gsm_mncc)); memset(&connect_ack, 0, sizeof(struct gsm_mncc));

View File

@ -29,20 +29,20 @@
/* RRLP msPositionReq, nsBased, /* RRLP msPositionReq, nsBased,
* Accuracy=60, Method=gps, ResponseTime=2, oneSet */ * 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, /* RRLP msPositionReq, msBasedPref,
Accuracy=60, Method=gpsOrEOTD, ResponseTime=5, multipleSets */ 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, /* RRLP msPositionReq, msAssistedPref,
Accuracy=60, Method=gpsOrEOTD, ResponseTime=5, multipleSets */ 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) static int send_rrlp_req(struct gsm_subscriber_connection *conn)
{ {
struct gsm_network *net = conn->bts->network; struct gsm_network *net = conn->bts->network;
const u_int8_t *req; const uint8_t *req;
switch (net->rrlp.mode) { switch (net->rrlp.mode) {
case RRLP_MODE_MS_BASED: case RRLP_MODE_MS_BASED:

View File

@ -80,8 +80,8 @@ int silent_call_rx(struct gsm_subscriber_connection *conn, struct msgb *msg)
} }
struct msg_match { struct msg_match {
u_int8_t pdisc; uint8_t pdisc;
u_int8_t msg_type; uint8_t msg_type;
}; };
/* list of messages that are handled inside OpenBSC, even in a silent call */ /* 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) int silent_call_reroute(struct gsm_subscriber_connection *conn, struct msgb *msg)
{ {
struct gsm48_hdr *gh = msgb_l3(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; int i;
/* if we're not part of a silent call, never reroute */ /* if we're not part of a silent call, never reroute */

View File

@ -32,7 +32,7 @@
#define TOKEN_SMS_TEXT "HAR 2009 GSM. Register at http://har2009.gnumonks.org/ " \ #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." "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; char *sms_str;
unsigned int len; unsigned int len;
@ -63,7 +63,7 @@ static int token_subscr_cb(unsigned int subsys, unsigned int signal,
return 0; return 0;
if (subscr->flags & GSM_SUBSCRIBER_FIRST_CONTACT) { if (subscr->flags & GSM_SUBSCRIBER_FIRST_CONTACT) {
u_int32_t token; uint32_t token;
char *sms_str; char *sms_str;
/* we've seen this subscriber for the first time. */ /* we've seen this subscriber for the first time. */
@ -97,7 +97,7 @@ unauth:
if (rc) { if (rc) {
struct gsm_subscriber_connection *conn = connection_for_subscr(subscr); struct gsm_subscriber_connection *conn = connection_for_subscr(subscr);
if (conn) { if (conn) {
u_int8_t auth_rand[16]; uint8_t auth_rand[16];
/* kick the subscriber off the network */ /* kick the subscriber off the network */
gsm48_tx_mm_auth_req(conn, auth_rand, 0); gsm48_tx_mm_auth_req(conn, auth_rand, 0);
gsm48_tx_mm_auth_rej(conn); 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 sms_signal_data *sig = signal_data;
struct gsm_sms *sms = sig->sms;; struct gsm_sms *sms = sig->sms;;
struct gsm_subscriber_connection *conn; struct gsm_subscriber_connection *conn;
u_int8_t auth_rand[16]; uint8_t auth_rand[16];
if (signal != S_SMS_DELIVERED) if (signal != S_SMS_DELIVERED)

View File

@ -142,7 +142,7 @@ DEFUN(sms_send_pend,
} }
static int _send_sms_str(struct gsm_subscriber *receiver, char *str, static int _send_sms_str(struct gsm_subscriber *receiver, char *str,
u_int8_t tp_pid) uint8_t tp_pid)
{ {
struct gsm_sms *sms; struct gsm_sms *sms;

View File

@ -60,9 +60,9 @@ enum rtp_bfd_priv {
/* according to RFC 1889 */ /* according to RFC 1889 */
struct rtcp_hdr { struct rtcp_hdr {
u_int8_t byte0; uint8_t byte0;
u_int8_t type; uint8_t type;
u_int16_t length; uint16_t length;
} __attribute__((packed)); } __attribute__((packed));
#define RTCP_TYPE_SDES 202 #define RTCP_TYPE_SDES 202
@ -72,40 +72,40 @@ struct rtcp_hdr {
/* according to RFC 3550 */ /* according to RFC 3550 */
struct rtp_hdr { struct rtp_hdr {
#if __BYTE_ORDER == __LITTLE_ENDIAN #if __BYTE_ORDER == __LITTLE_ENDIAN
u_int8_t csrc_count:4, uint8_t csrc_count:4,
extension:1, extension:1,
padding:1, padding:1,
version:2; version:2;
u_int8_t payload_type:7, uint8_t payload_type:7,
marker:1; marker:1;
#elif __BYTE_ORDER == __BIG_ENDIAN #elif __BYTE_ORDER == __BIG_ENDIAN
u_int8_t version:2, uint8_t version:2,
padding:1, padding:1,
extension:1, extension:1,
csrc_count:4; csrc_count:4;
u_int8_t marker:1, uint8_t marker:1,
payload_type:7; payload_type:7;
#endif #endif
u_int16_t sequence; uint16_t sequence;
u_int32_t timestamp; uint32_t timestamp;
u_int32_t ssrc; uint32_t ssrc;
} __attribute__((packed)); } __attribute__((packed));
struct rtp_x_hdr { struct rtp_x_hdr {
u_int16_t by_profile; uint16_t by_profile;
u_int16_t length; uint16_t length;
} __attribute__((packed)); } __attribute__((packed));
#define RTP_VERSION 2 #define RTP_VERSION 2
/* decode an rtp frame and create a new buffer with payload */ /* decode an rtp frame and create a new buffer with payload */
static int rtp_decode(struct msgb *msg, u_int32_t callref, struct msgb **data) static int rtp_decode(struct msgb *msg, uint32_t callref, struct msgb **data)
{ {
struct msgb *new_msg; struct msgb *new_msg;
struct gsm_data_frame *frame; struct gsm_data_frame *frame;
struct rtp_hdr *rtph = (struct rtp_hdr *)msg->data; struct rtp_hdr *rtph = (struct rtp_hdr *)msg->data;
struct rtp_x_hdr *rtpxh; struct rtp_x_hdr *rtpxh;
u_int8_t *payload; uint8_t *payload;
int payload_len; int payload_len;
int msg_type; int msg_type;
int x_len; int x_len;
@ -286,11 +286,11 @@ int rtp_send_frame(struct rtp_socket *rs, struct gsm_data_frame *frame)
/* iterate over all chunks in one RTCP message, look for CNAME IEs and /* iterate over all chunks in one RTCP message, look for CNAME IEs and
* replace all of those with 'new_cname' */ * replace all of those with 'new_cname' */
static int rtcp_sdes_cname_mangle(struct msgb *msg, struct rtcp_hdr *rh, static int rtcp_sdes_cname_mangle(struct msgb *msg, struct rtcp_hdr *rh,
u_int16_t *rtcp_len, const char *new_cname) uint16_t *rtcp_len, const char *new_cname)
{ {
u_int8_t *rtcp_end; uint8_t *rtcp_end;
u_int8_t *cur = (u_int8_t *) rh; uint8_t *cur = (uint8_t *) rh;
u_int8_t tag, len = 0; uint8_t tag, len = 0;
rtcp_end = cur + *rtcp_len; rtcp_end = cur + *rtcp_len;
/* move cur to end of RTP header */ /* move cur to end of RTP header */
@ -343,7 +343,7 @@ static int rtcp_mangle(struct msgb *msg, struct rtp_socket *rs)
{ {
struct rtp_sub_socket *rss = &rs->rtcp; struct rtp_sub_socket *rss = &rs->rtcp;
struct rtcp_hdr *rtph; struct rtcp_hdr *rtph;
u_int16_t old_len; uint16_t old_len;
int rc; int rc;
if (!mangle_rtcp_cname) if (!mangle_rtcp_cname)
@ -572,8 +572,8 @@ out_free:
return NULL; return NULL;
} }
static int rtp_sub_socket_bind(struct rtp_sub_socket *rss, u_int32_t ip, static int rtp_sub_socket_bind(struct rtp_sub_socket *rss, uint32_t ip,
u_int16_t port) uint16_t port)
{ {
int rc; int rc;
socklen_t alen = sizeof(rss->sin_local); socklen_t alen = sizeof(rss->sin_local);
@ -598,7 +598,7 @@ static int rtp_sub_socket_bind(struct rtp_sub_socket *rss, u_int32_t ip,
static unsigned int next_udp_port = RTP_PORT_BASE; static unsigned int next_udp_port = RTP_PORT_BASE;
/* bind a RTP socket to a local address */ /* bind a RTP socket to a local address */
int rtp_socket_bind(struct rtp_socket *rs, u_int32_t ip) int rtp_socket_bind(struct rtp_socket *rs, uint32_t ip)
{ {
int rc = -EIO; int rc = -EIO;
struct in_addr ia; struct in_addr ia;
@ -630,7 +630,7 @@ int rtp_socket_bind(struct rtp_socket *rs, u_int32_t ip)
} }
static int rtp_sub_socket_connect(struct rtp_sub_socket *rss, static int rtp_sub_socket_connect(struct rtp_sub_socket *rss,
u_int32_t ip, u_int16_t port) uint32_t ip, uint16_t port)
{ {
int rc; int rc;
socklen_t alen = sizeof(rss->sin_local); socklen_t alen = sizeof(rss->sin_local);
@ -649,7 +649,7 @@ static int rtp_sub_socket_connect(struct rtp_sub_socket *rss,
} }
/* 'connect' a RTP socket to a remote peer */ /* 'connect' a RTP socket to a remote peer */
int rtp_socket_connect(struct rtp_socket *rs, u_int32_t ip, u_int16_t port) int rtp_socket_connect(struct rtp_socket *rs, uint32_t ip, uint16_t port)
{ {
int rc; int rc;
struct in_addr ia; struct in_addr ia;
@ -682,7 +682,7 @@ int rtp_socket_proxy(struct rtp_socket *this, struct rtp_socket *other)
/* bind RTP/RTCP socket to application */ /* bind RTP/RTCP socket to application */
int rtp_socket_upstream(struct rtp_socket *this, struct gsm_network *net, int rtp_socket_upstream(struct rtp_socket *this, struct gsm_network *net,
u_int32_t callref) uint32_t callref)
{ {
DEBUGP(DMUX, "rtp_socket_proxy(this=%p, callref=%u)\n", DEBUGP(DMUX, "rtp_socket_proxy(this=%p, callref=%u)\n",
this, callref); this, callref);

View File

@ -32,17 +32,17 @@
void *tall_tqe_ctx; void *tall_tqe_ctx;
static inline void append_bit(struct demux_subch *sch, u_int8_t bit) static inline void append_bit(struct demux_subch *sch, uint8_t bit)
{ {
sch->out_bitbuf[sch->out_idx++] = bit; sch->out_bitbuf[sch->out_idx++] = bit;
} }
#define SYNC_HDR_BITS 16 #define SYNC_HDR_BITS 16
static const u_int8_t nullbytes[SYNC_HDR_BITS]; static const uint8_t nullbytes[SYNC_HDR_BITS];
/* check if we have just completed the 16 bit zero sync header, /* check if we have just completed the 16 bit zero sync header,
* in accordance with GSM TS 08.60 Chapter 4.8.1 */ * in accordance with GSM TS 08.60 Chapter 4.8.1 */
static int sync_hdr_complete(struct demux_subch *sch, u_int8_t bit) static int sync_hdr_complete(struct demux_subch *sch, uint8_t bit)
{ {
if (bit == 0) if (bit == 0)
sch->consecutive_zeros++; sch->consecutive_zeros++;
@ -83,7 +83,7 @@ int subch_demux_init(struct subch_demux *dmx)
/* input some arbitrary (modulo 4) number of bytes of a 64k E1 channel, /* input some arbitrary (modulo 4) number of bytes of a 64k E1 channel,
* split it into the 16k subchannels */ * split it into the 16k subchannels */
int subch_demux_in(struct subch_demux *dmx, u_int8_t *data, int len) int subch_demux_in(struct subch_demux *dmx, uint8_t *data, int len)
{ {
int i, c; int i, c;
@ -92,12 +92,12 @@ int subch_demux_in(struct subch_demux *dmx, u_int8_t *data, int len)
return -EINVAL; return -EINVAL;
for (i = 0; i < len; i++) { for (i = 0; i < len; i++) {
u_int8_t inbyte = data[i]; uint8_t inbyte = data[i];
for (c = 0; c < NR_SUBCH; c++) { for (c = 0; c < NR_SUBCH; c++) {
struct demux_subch *sch = &dmx->subch[c]; struct demux_subch *sch = &dmx->subch[c];
u_int8_t inbits; uint8_t inbits;
u_int8_t bit; uint8_t bit;
/* ignore inactive subchannels */ /* ignore inactive subchannels */
if (!(dmx->chan_activ & (1 << c))) if (!(dmx->chan_activ & (1 << c)))
@ -171,7 +171,7 @@ static int alloc_add_idle_frame(struct subch_mux *mx, int sch_nr)
/* return the requested number of bits from the specified subchannel */ /* return the requested number of bits from the specified subchannel */
static int get_subch_bits(struct subch_mux *mx, int subch, static int get_subch_bits(struct subch_mux *mx, int subch,
u_int8_t *bits, int num_requested) uint8_t *bits, int num_requested)
{ {
struct mux_subch *sch = &mx->subch[subch]; struct mux_subch *sch = &mx->subch[subch];
int num_bits = 0; int num_bits = 0;
@ -215,9 +215,9 @@ static int get_subch_bits(struct subch_mux *mx, int subch,
} }
/* compact an array of 8 single-bit bytes into one byte of 8 bits */ /* compact an array of 8 single-bit bytes into one byte of 8 bits */
static u_int8_t compact_bits(const u_int8_t *bits) static uint8_t compact_bits(const uint8_t *bits)
{ {
u_int8_t ret = 0; uint8_t ret = 0;
int i; int i;
for (i = 0; i < 8; i++) for (i = 0; i < 8; i++)
@ -227,9 +227,9 @@ static u_int8_t compact_bits(const u_int8_t *bits)
} }
/* obtain a single output byte from the subchannel muxer */ /* obtain a single output byte from the subchannel muxer */
static int mux_output_byte(struct subch_mux *mx, u_int8_t *byte) static int mux_output_byte(struct subch_mux *mx, uint8_t *byte)
{ {
u_int8_t bits[8]; uint8_t bits[8];
int rc; int rc;
/* combine two bits of every subchan */ /* combine two bits of every subchan */
@ -244,7 +244,7 @@ static int mux_output_byte(struct subch_mux *mx, u_int8_t *byte)
} }
/* Request the output of some muxed bytes from the subchan muxer */ /* Request the output of some muxed bytes from the subchan muxer */
int subchan_mux_out(struct subch_mux *mx, u_int8_t *data, int len) int subchan_mux_out(struct subch_mux *mx, uint8_t *data, int len)
{ {
int i; int i;
@ -285,7 +285,7 @@ static void tx_queue_evict(struct mux_subch *sch, int num_evict)
} }
/* enqueue some data into the tx_queue of a given subchannel */ /* enqueue some data into the tx_queue of a given subchannel */
int subchan_mux_enqueue(struct subch_mux *mx, int s_nr, const u_int8_t *data, int subchan_mux_enqueue(struct subch_mux *mx, int s_nr, const uint8_t *data,
int len) int len)
{ {
struct mux_subch *sch = &mx->subch[s_nr]; struct mux_subch *sch = &mx->subch[s_nr];

View File

@ -28,10 +28,10 @@
#include <openbsc/subchan_demux.h> #include <openbsc/subchan_demux.h>
#include <openbsc/debug.h> #include <openbsc/debug.h>
static u_int32_t get_bits(const u_int8_t *bitbuf, int offset, int num) static uint32_t get_bits(const uint8_t *bitbuf, int offset, int num)
{ {
int i; int i;
u_int32_t ret = 0; uint32_t ret = 0;
for (i = offset; i < offset + num; i++) { for (i = offset; i < offset + num; i++) {
ret = ret << 1; ret = ret << 1;
@ -42,7 +42,7 @@ static u_int32_t get_bits(const u_int8_t *bitbuf, int offset, int num)
} }
/* Decode according to 3.1.1 */ /* Decode according to 3.1.1 */
static void decode_fr(struct decoded_trau_frame *fr, const u_int8_t *trau_bits) static void decode_fr(struct decoded_trau_frame *fr, const uint8_t *trau_bits)
{ {
int i; int i;
int d_idx = 0; int d_idx = 0;
@ -63,7 +63,7 @@ static void decode_fr(struct decoded_trau_frame *fr, const u_int8_t *trau_bits)
} }
/* Decode according to 3.1.2 */ /* Decode according to 3.1.2 */
static void decode_amr(struct decoded_trau_frame *fr, const u_int8_t *trau_bits) static void decode_amr(struct decoded_trau_frame *fr, const uint8_t *trau_bits)
{ {
int i; int i;
int d_idx = 0; int d_idx = 0;
@ -85,9 +85,9 @@ static void decode_amr(struct decoded_trau_frame *fr, const u_int8_t *trau_bits)
memcpy(fr->d_bits + d_idx, trau_bits + 305, 11); memcpy(fr->d_bits + d_idx, trau_bits + 305, 11);
} }
int decode_trau_frame(struct decoded_trau_frame *fr, const u_int8_t *trau_bits) int decode_trau_frame(struct decoded_trau_frame *fr, const uint8_t *trau_bits)
{ {
u_int8_t cbits5 = get_bits(trau_bits, 17, 5); uint8_t cbits5 = get_bits(trau_bits, 17, 5);
switch (cbits5) { switch (cbits5) {
case TRAU_FT_FR_UP: case TRAU_FT_FR_UP:
@ -120,13 +120,13 @@ int decode_trau_frame(struct decoded_trau_frame *fr, const u_int8_t *trau_bits)
return 0; return 0;
} }
const u_int8_t ft_fr_down_bits[] = { 1, 1, 1, 0, 0 }; const uint8_t ft_fr_down_bits[] = { 1, 1, 1, 0, 0 };
const u_int8_t ft_idle_down_bits[] = { 0, 1, 1, 1, 0 }; const uint8_t ft_idle_down_bits[] = { 0, 1, 1, 1, 0 };
/* modify an uplink TRAU frame so we can send it downlink */ /* modify an uplink TRAU frame so we can send it downlink */
int trau_frame_up2down(struct decoded_trau_frame *fr) int trau_frame_up2down(struct decoded_trau_frame *fr)
{ {
u_int8_t cbits5 = get_bits(fr->c_bits, 0, 5); uint8_t cbits5 = get_bits(fr->c_bits, 0, 5);
switch (cbits5) { switch (cbits5) {
case TRAU_FT_FR_UP: case TRAU_FT_FR_UP:
@ -178,7 +178,7 @@ int trau_frame_up2down(struct decoded_trau_frame *fr)
} }
static void encode_fr(u_int8_t *trau_bits, const struct decoded_trau_frame *fr) static void encode_fr(uint8_t *trau_bits, const struct decoded_trau_frame *fr)
{ {
int i; int i;
int d_idx = 0; int d_idx = 0;
@ -205,9 +205,9 @@ static void encode_fr(u_int8_t *trau_bits, const struct decoded_trau_frame *fr)
} }
int encode_trau_frame(u_int8_t *trau_bits, const struct decoded_trau_frame *fr) int encode_trau_frame(uint8_t *trau_bits, const struct decoded_trau_frame *fr)
{ {
u_int8_t cbits5 = get_bits(fr->c_bits, 0, 5); uint8_t cbits5 = get_bits(fr->c_bits, 0, 5);
/* 16 bits of sync header */ /* 16 bits of sync header */
memset(trau_bits, 0, 16); memset(trau_bits, 0, 16);
@ -245,10 +245,10 @@ static struct decoded_trau_frame fr_idle_frame = {
.c_bits = { 0, 1, 1, 1, 0 }, /* IDLE DOWNLINK 3.5.5 */ .c_bits = { 0, 1, 1, 1, 0 }, /* IDLE DOWNLINK 3.5.5 */
.t_bits = { 1, 1, 1, 1 }, .t_bits = { 1, 1, 1, 1 },
}; };
static u_int8_t encoded_idle_frame[TRAU_FRAME_BITS]; static uint8_t encoded_idle_frame[TRAU_FRAME_BITS];
static int dbits_initted; static int dbits_initted;
u_int8_t *trau_idle_frame(void) uint8_t *trau_idle_frame(void)
{ {
/* only initialize during the first call */ /* only initialize during the first call */
if (!dbits_initted) { if (!dbits_initted) {

View File

@ -31,7 +31,7 @@
#include <openbsc/debug.h> #include <openbsc/debug.h>
#include <osmocom/core/talloc.h> #include <osmocom/core/talloc.h>
u_int8_t gsm_fr_map[] = { uint8_t gsm_fr_map[] = {
6, 6, 5, 5, 4, 4, 3, 3, 6, 6, 5, 5, 4, 4, 3, 3,
7, 2, 2, 6, 3, 3, 3, 3, 7, 2, 2, 6, 3, 3, 3, 3,
3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
@ -53,7 +53,7 @@ struct upqueue_entry {
struct llist_head list; struct llist_head list;
struct gsm_network *net; struct gsm_network *net;
struct gsm_e1_subslot src; struct gsm_e1_subslot src;
u_int32_t callref; uint32_t callref;
}; };
static LLIST_HEAD(ss_map); static LLIST_HEAD(ss_map);
@ -102,7 +102,7 @@ int trau_mux_map_lchan(const struct gsm_lchan *src,
/* unmap one particular subslot from another subslot */ /* unmap one particular subslot from another subslot */
int trau_mux_unmap(const struct gsm_e1_subslot *ss, u_int32_t callref) int trau_mux_unmap(const struct gsm_e1_subslot *ss, uint32_t callref)
{ {
struct map_entry *me, *me2; struct map_entry *me, *me2;
struct upqueue_entry *ue, *ue2; struct upqueue_entry *ue, *ue2;
@ -156,14 +156,14 @@ lookup_trau_upqueue(const struct gsm_e1_subslot *src)
return NULL; return NULL;
} }
static const u_int8_t c_bits_check[] = { 0, 0, 0, 1, 0 }; static const uint8_t c_bits_check[] = { 0, 0, 0, 1, 0 };
/* we get called by subchan_demux */ /* we get called by subchan_demux */
int trau_mux_input(struct gsm_e1_subslot *src_e1_ss, int trau_mux_input(struct gsm_e1_subslot *src_e1_ss,
const u_int8_t *trau_bits, int num_bits) const uint8_t *trau_bits, int num_bits)
{ {
struct decoded_trau_frame tf; struct decoded_trau_frame tf;
u_int8_t trau_bits_out[TRAU_FRAME_BITS]; uint8_t trau_bits_out[TRAU_FRAME_BITS];
struct gsm_e1_subslot *dst_e1_ss = lookup_trau_mux_map(src_e1_ss); struct gsm_e1_subslot *dst_e1_ss = lookup_trau_mux_map(src_e1_ss);
struct subch_mux *mx; struct subch_mux *mx;
struct upqueue_entry *ue; struct upqueue_entry *ue;
@ -231,7 +231,7 @@ int trau_mux_input(struct gsm_e1_subslot *src_e1_ss,
} }
/* add receiver instance for lchan and callref */ /* add receiver instance for lchan and callref */
int trau_recv_lchan(struct gsm_lchan *lchan, u_int32_t callref) int trau_recv_lchan(struct gsm_lchan *lchan, uint32_t callref)
{ {
struct gsm_e1_subslot *src_ss; struct gsm_e1_subslot *src_ss;
struct upqueue_entry *ue; struct upqueue_entry *ue;
@ -260,7 +260,7 @@ int trau_recv_lchan(struct gsm_lchan *lchan, u_int32_t callref)
int trau_send_frame(struct gsm_lchan *lchan, struct gsm_data_frame *frame) int trau_send_frame(struct gsm_lchan *lchan, struct gsm_data_frame *frame)
{ {
u_int8_t trau_bits_out[TRAU_FRAME_BITS]; uint8_t trau_bits_out[TRAU_FRAME_BITS];
struct gsm_e1_subslot *dst_e1_ss = &lchan->ts->e1_link; struct gsm_e1_subslot *dst_e1_ss = &lchan->ts->e1_link;
struct subch_mux *mx; struct subch_mux *mx;
int i, j, k, l, o; int i, j, k, l, o;

View File

@ -53,22 +53,22 @@ static enum bs11cfg_state bs11cfg_state = STATE_NONE;
static char *command, *value; static char *command, *value;
struct timer_list status_timer; struct timer_list status_timer;
static const u_int8_t obj_li_attr[] = { static const uint8_t obj_li_attr[] = {
NM_ATT_BS11_BIT_ERR_THESH, 0x09, 0x00, NM_ATT_BS11_BIT_ERR_THESH, 0x09, 0x00,
NM_ATT_BS11_L1_PROT_TYPE, 0x00, NM_ATT_BS11_L1_PROT_TYPE, 0x00,
NM_ATT_BS11_LINE_CFG, 0x00, NM_ATT_BS11_LINE_CFG, 0x00,
}; };
static const u_int8_t obj_bbsig0_attr[] = { static const uint8_t obj_bbsig0_attr[] = {
NM_ATT_BS11_RSSI_OFFS, 0x02, 0x00, 0x00, NM_ATT_BS11_RSSI_OFFS, 0x02, 0x00, 0x00,
NM_ATT_BS11_DIVERSITY, 0x01, 0x00, NM_ATT_BS11_DIVERSITY, 0x01, 0x00,
}; };
static const u_int8_t obj_pa0_attr[] = { static const uint8_t obj_pa0_attr[] = {
NM_ATT_BS11_TXPWR, 0x01, BS11_TRX_POWER_GSM_30mW, NM_ATT_BS11_TXPWR, 0x01, BS11_TRX_POWER_GSM_30mW,
}; };
static const char *trx1_password = "1111111111"; static const char *trx1_password = "1111111111";
#define TEI_OML 25 #define TEI_OML 25
static const u_int8_t too_fast[] = { 0x12, 0x80, 0x00, 0x00, 0x02, 0x02 }; static const uint8_t too_fast[] = { 0x12, 0x80, 0x00, 0x00, 0x02, 0x02 };
static struct log_target *stderr_target; static struct log_target *stderr_target;
@ -113,8 +113,8 @@ static int create_objects(struct gsm_bts *bts)
static int create_trx1(struct gsm_bts *bts) static int create_trx1(struct gsm_bts *bts)
{ {
u_int8_t bbsig1_attr[sizeof(obj_bbsig0_attr)+12]; uint8_t bbsig1_attr[sizeof(obj_bbsig0_attr)+12];
u_int8_t *cur = bbsig1_attr; uint8_t *cur = bbsig1_attr;
struct gsm_bts_trx *trx = gsm_bts_trx_num(bts, 1); struct gsm_bts_trx *trx = gsm_bts_trx_num(bts, 1);
if (!trx) if (!trx)
@ -127,7 +127,7 @@ static int create_trx1(struct gsm_bts *bts)
sleep(1); sleep(1);
cur = tlv_put(cur, NM_ATT_BS11_PASSWORD, 10, cur = tlv_put(cur, NM_ATT_BS11_PASSWORD, 10,
(u_int8_t *)trx1_password); (uint8_t *)trx1_password);
memcpy(cur, obj_bbsig0_attr, sizeof(obj_bbsig0_attr)); memcpy(cur, obj_bbsig0_attr, sizeof(obj_bbsig0_attr));
abis_nm_bs11_create_object(bts, BS11_OBJ_BBSIG, 1, abis_nm_bs11_create_object(bts, BS11_OBJ_BBSIG, 1,
sizeof(bbsig1_attr), bbsig1_attr); sizeof(bbsig1_attr), bbsig1_attr);
@ -217,7 +217,7 @@ static const char *bs11_link_state[] = {
[0x02] = "Restoring", [0x02] = "Restoring",
}; };
static const char *linkstate_name(u_int8_t linkstate) static const char *linkstate_name(uint8_t linkstate)
{ {
if (linkstate > ARRAY_SIZE(bs11_link_state)) if (linkstate > ARRAY_SIZE(bs11_link_state))
return "Unknown"; return "Unknown";
@ -234,7 +234,7 @@ static const char *mbccu_load[] = {
[5] = "Load", [5] = "Load",
}; };
static const char *mbccu_load_name(u_int8_t linkstate) static const char *mbccu_load_name(uint8_t linkstate)
{ {
if (linkstate > ARRAY_SIZE(mbccu_load)) if (linkstate > ARRAY_SIZE(mbccu_load))
return "Unknown"; return "Unknown";
@ -242,7 +242,7 @@ static const char *mbccu_load_name(u_int8_t linkstate)
return mbccu_load[linkstate]; return mbccu_load[linkstate];
} }
static const char *bts_phase_name(u_int8_t phase) static const char *bts_phase_name(uint8_t phase)
{ {
switch (phase) { switch (phase) {
case BS11_STATE_WARM_UP: case BS11_STATE_WARM_UP:
@ -280,7 +280,7 @@ static const char *bts_phase_name(u_int8_t phase)
} }
} }
static const char *trx_power_name(u_int8_t pwr) static const char *trx_power_name(uint8_t pwr)
{ {
switch (pwr) { switch (pwr) {
case BS11_TRX_POWER_GSM_2W: case BS11_TRX_POWER_GSM_2W:
@ -304,7 +304,7 @@ static const char *trx_power_name(u_int8_t pwr)
} }
} }
static const char *pll_mode_name(u_int8_t mode) static const char *pll_mode_name(uint8_t mode)
{ {
switch (mode) { switch (mode) {
case BS11_LI_PLL_LOCKED: case BS11_LI_PLL_LOCKED:
@ -316,7 +316,7 @@ static const char *pll_mode_name(u_int8_t mode)
} }
} }
static const char *cclk_acc_name(u_int8_t acc) static const char *cclk_acc_name(uint8_t acc)
{ {
switch (acc) { switch (acc) {
case 0: case 0:
@ -330,7 +330,7 @@ static const char *cclk_acc_name(u_int8_t acc)
} }
} }
static const char *bport_lcfg_name(u_int8_t lcfg) static const char *bport_lcfg_name(uint8_t lcfg)
{ {
switch (lcfg) { switch (lcfg) {
case BS11_LINE_CFG_STAR: case BS11_LINE_CFG_STAR:
@ -378,7 +378,7 @@ static const char *obj_name(struct abis_om_fom_hdr *foh)
static void print_state(struct tlv_parsed *tp) static void print_state(struct tlv_parsed *tp)
{ {
if (TLVP_PRESENT(tp, NM_ATT_BS11_BTS_STATE)) { if (TLVP_PRESENT(tp, NM_ATT_BS11_BTS_STATE)) {
u_int8_t phase, mbccu; uint8_t phase, mbccu;
if (TLVP_LEN(tp, NM_ATT_BS11_BTS_STATE) >= 1) { if (TLVP_LEN(tp, NM_ATT_BS11_BTS_STATE) >= 1) {
phase = *TLVP_VAL(tp, NM_ATT_BS11_BTS_STATE); phase = *TLVP_VAL(tp, NM_ATT_BS11_BTS_STATE);
printf("PHASE: %u %-20s ", phase & 0xf, printf("PHASE: %u %-20s ", phase & 0xf,
@ -392,7 +392,7 @@ static void print_state(struct tlv_parsed *tp)
} }
if (TLVP_PRESENT(tp, NM_ATT_BS11_E1_STATE) && if (TLVP_PRESENT(tp, NM_ATT_BS11_E1_STATE) &&
TLVP_LEN(tp, NM_ATT_BS11_E1_STATE) >= 1) { TLVP_LEN(tp, NM_ATT_BS11_E1_STATE) >= 1) {
u_int8_t e1_state = *TLVP_VAL(tp, NM_ATT_BS11_E1_STATE); uint8_t e1_state = *TLVP_VAL(tp, NM_ATT_BS11_E1_STATE);
printf("Abis-link: %-9s ", linkstate_name(e1_state & 0xf)); printf("Abis-link: %-9s ", linkstate_name(e1_state & 0xf));
} }
printf("\n"); printf("\n");
@ -420,7 +420,7 @@ static int print_attr(struct tlv_parsed *tp)
#endif #endif
if (TLVP_PRESENT(tp, NM_ATT_ABIS_CHANNEL) && if (TLVP_PRESENT(tp, NM_ATT_ABIS_CHANNEL) &&
TLVP_LEN(tp, NM_ATT_ABIS_CHANNEL) >= 3) { TLVP_LEN(tp, NM_ATT_ABIS_CHANNEL) >= 3) {
const u_int8_t *chan = TLVP_VAL(tp, NM_ATT_ABIS_CHANNEL); const uint8_t *chan = TLVP_VAL(tp, NM_ATT_ABIS_CHANNEL);
printf("\tE1 Channel: Port=%u Timeslot=%u ", printf("\tE1 Channel: Port=%u Timeslot=%u ",
chan[0], chan[1]); chan[0], chan[1]);
if (chan[2] == 0xff) if (chan[2] == 0xff)
@ -442,23 +442,23 @@ static int print_attr(struct tlv_parsed *tp)
} }
if (TLVP_PRESENT(tp, NM_ATT_BS11_PLL) && if (TLVP_PRESENT(tp, NM_ATT_BS11_PLL) &&
TLVP_LEN(tp, NM_ATT_BS11_PLL) >= 4) { TLVP_LEN(tp, NM_ATT_BS11_PLL) >= 4) {
const u_int8_t *vp = TLVP_VAL(tp, NM_ATT_BS11_PLL); const uint8_t *vp = TLVP_VAL(tp, NM_ATT_BS11_PLL);
printf("\tPLL Set Value=%d, Work Value=%d\n", printf("\tPLL Set Value=%d, Work Value=%d\n",
vp[0] << 8 | vp[1], vp[2] << 8 | vp[3]); vp[0] << 8 | vp[1], vp[2] << 8 | vp[3]);
} }
if (TLVP_PRESENT(tp, NM_ATT_BS11_CCLK_ACCURACY) && if (TLVP_PRESENT(tp, NM_ATT_BS11_CCLK_ACCURACY) &&
TLVP_LEN(tp, NM_ATT_BS11_CCLK_ACCURACY) >= 1) { TLVP_LEN(tp, NM_ATT_BS11_CCLK_ACCURACY) >= 1) {
const u_int8_t *acc = TLVP_VAL(tp, NM_ATT_BS11_CCLK_ACCURACY); const uint8_t *acc = TLVP_VAL(tp, NM_ATT_BS11_CCLK_ACCURACY);
printf("\tCCLK Accuracy: %s (%d)\n", cclk_acc_name(*acc), *acc); printf("\tCCLK Accuracy: %s (%d)\n", cclk_acc_name(*acc), *acc);
} }
if (TLVP_PRESENT(tp, NM_ATT_BS11_CCLK_TYPE) && if (TLVP_PRESENT(tp, NM_ATT_BS11_CCLK_TYPE) &&
TLVP_LEN(tp, NM_ATT_BS11_CCLK_TYPE) >= 1) { TLVP_LEN(tp, NM_ATT_BS11_CCLK_TYPE) >= 1) {
const u_int8_t *acc = TLVP_VAL(tp, NM_ATT_BS11_CCLK_TYPE); const uint8_t *acc = TLVP_VAL(tp, NM_ATT_BS11_CCLK_TYPE);
printf("\tCCLK Type=%d\n", *acc); printf("\tCCLK Type=%d\n", *acc);
} }
if (TLVP_PRESENT(tp, NM_ATT_BS11_LINE_CFG) && if (TLVP_PRESENT(tp, NM_ATT_BS11_LINE_CFG) &&
TLVP_LEN(tp, NM_ATT_BS11_LINE_CFG) >= 1) { TLVP_LEN(tp, NM_ATT_BS11_LINE_CFG) >= 1) {
const u_int8_t *lcfg = TLVP_VAL(tp, NM_ATT_BS11_LINE_CFG); const uint8_t *lcfg = TLVP_VAL(tp, NM_ATT_BS11_LINE_CFG);
printf("\tLine Configuration: %s (%d)\n", printf("\tLine Configuration: %s (%d)\n",
bport_lcfg_name(*lcfg), *lcfg); bport_lcfg_name(*lcfg), *lcfg);
} }

View File

@ -57,7 +57,7 @@ static int handle_ser_write(struct bsc_fd *bfd);
int _abis_nm_sendmsg(struct msgb *msg, int to_trx_oml) int _abis_nm_sendmsg(struct msgb *msg, int to_trx_oml)
{ {
struct serial_handle *sh = ser_handle; struct serial_handle *sh = ser_handle;
u_int8_t *lapd; uint8_t *lapd;
unsigned int len; unsigned int len;
msg->l2h = msg->data; msg->l2h = msg->data;

View File

@ -70,8 +70,8 @@ static void test_mi_functionality(void)
{ {
const char *imsi_odd = "987654321098763"; const char *imsi_odd = "987654321098763";
const char *imsi_even = "9876543210987654"; const char *imsi_even = "9876543210987654";
const u_int32_t tmsi = 0xfabeacd0; const uint32_t tmsi = 0xfabeacd0;
u_int8_t mi[128]; uint8_t mi[128];
unsigned int mi_len; unsigned int mi_len;
char mi_parsed[GSM48_MI_SIZE]; char mi_parsed[GSM48_MI_SIZE];
@ -80,7 +80,7 @@ static void test_mi_functionality(void)
/* tmsi code */ /* tmsi code */
mi_len = gsm48_generate_mid_from_tmsi(mi, tmsi); mi_len = gsm48_generate_mid_from_tmsi(mi, tmsi);
gsm48_mi_to_string(mi_parsed, sizeof(mi_parsed), mi + 2, mi_len - 2); gsm48_mi_to_string(mi_parsed, sizeof(mi_parsed), mi + 2, mi_len - 2);
COMPARE((u_int32_t)strtoul(mi_parsed, NULL, 10), ==, tmsi); COMPARE((uint32_t)strtoul(mi_parsed, NULL, 10), ==, tmsi);
/* imsi code */ /* imsi code */
mi_len = gsm48_generate_mid_from_imsi(mi, imsi_odd); mi_len = gsm48_generate_mid_from_imsi(mi, imsi_odd);