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

This was done with sed on the files.
diff --git a/openbsc/doc/e1-data-model.txt b/openbsc/doc/e1-data-model.txt
index 8594fe4..9286d5f 100644
--- a/openbsc/doc/e1-data-model.txt
+++ b/openbsc/doc/e1-data-model.txt
@@ -52,10 +52,10 @@
 	signal some event (such as layer 1 connect/disconnect) from the
 	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)
 
-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
 
 Intrface by Input Core for Input Plugins
@@ -112,8 +112,8 @@
 	struct llist_head tx_list;
 
 	/* SAPI and TEI on the E1 TS */
-	u_int8_t sapi;
-	u_int8_t tei;
+	uint8_t sapi;
+	uint8_t tei;
 }
 
 enum e1inp_ts_type {
@@ -160,7 +160,7 @@
 
 /* Receive a packet from the E1 driver */
 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 */
 int e1driver_tx_ts(struct e1inp_ts *ts, struct msgb *msg)
diff --git a/openbsc/doc/gsm-hopping.txt b/openbsc/doc/gsm-hopping.txt
index 5910939..c964963 100644
--- a/openbsc/doc/gsm-hopping.txt
+++ b/openbsc/doc/gsm-hopping.txt
@@ -12,7 +12,7 @@
 
 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,
 	  0,  64,  25,  81,  76,  59, 124,  23, 104, 100,
 	101,  47, 118,  85,  18,  56,  96,  86,  54,   2,
@@ -29,15 +29,15 @@
 /* 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,
-		     u_int8_t t1, u_int8_t t2, u_int8_t t3_)
+uint8_t hopping_mai(uint8_t hsn, uint32_t fn, uint8_t maio,
+		     uint8_t t1, uint8_t t2, uint8_t t3_)
 {
-	u_int8_t mai;
+	uint8_t mai;
 
 	if (hsn == 0) /* cyclic hopping */
 		mai = (fn + maio) % n;
 	else {
-		u_int32_t m, m_, t_, s;
+		uint32_t m, m_, t_, s;
 
 		m = t2 + rntable[(hsn xor (t1 % 64)) + t3];
 		m_ = m % (2^NBIN);
diff --git a/openbsc/include/openbsc/abis_nm.h b/openbsc/include/openbsc/abis_nm.h
index ebe20d2..4ea1792 100644
--- a/openbsc/include/openbsc/abis_nm.h
+++ b/openbsc/include/openbsc/abis_nm.h
@@ -27,10 +27,10 @@
 #include <osmocom/gsm/protocol/gsm_12_21.h>
 
 struct cell_global_id {
-	u_int16_t mcc;
-	u_int16_t mnc;
-	u_int16_t lac;
-	u_int16_t ci;
+	uint16_t mcc;
+	uint16_t mnc;
+	uint16_t lac;
+	uint16_t ci;
 };
 
 /* The BCCH info from an ip.access test, in host byte order
@@ -38,20 +38,20 @@
 struct ipac_bcch_info {
 	struct llist_head list;
 
-	u_int16_t info_type;
-	u_int8_t freq_qual;
-	u_int16_t arfcn;
-	u_int8_t rx_lev;
-	u_int8_t rx_qual;
+	uint16_t info_type;
+	uint8_t freq_qual;
+	uint16_t arfcn;
+	uint8_t rx_lev;
+	uint8_t rx_qual;
 	int16_t freq_err;
-	u_int16_t frame_offset;
-	u_int32_t frame_nr_offset;
-	u_int8_t bsic;
+	uint16_t frame_offset;
+	uint32_t frame_nr_offset;
+	uint8_t bsic;
 	struct cell_global_id cgi;
-	u_int8_t ba_list_si2[16];
-	u_int8_t ba_list_si2bis[16];
-	u_int8_t ba_list_si2ter[16];
-	u_int8_t ca_list_si1[16];
+	uint8_t ba_list_si2[16];
+	uint8_t ba_list_si2bis[16];
+	uint8_t ba_list_si2ter[16];
+	uint8_t ca_list_si1[16];
 };
 
 extern const struct value_string abis_nm_adm_state_names[];
@@ -72,40 +72,40 @@
 
 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_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_chg_adm_state(struct gsm_bts *bts, u_int8_t obj_class, u_int8_t i0,
-			  u_int8_t i1, u_int8_t i2, enum abis_nm_adm_state adm_state);
-int abis_nm_establish_tei(struct gsm_bts *bts, u_int8_t trx_nr,
-			  u_int8_t e1_port, u_int8_t e1_timeslot, u_int8_t e1_subslot,
-			  u_int8_t tei);
+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, uint8_t obj_class, uint8_t i0,
+			  uint8_t i1, uint8_t i2, enum abis_nm_adm_state adm_state);
+int abis_nm_establish_tei(struct gsm_bts *bts, uint8_t trx_nr,
+			  uint8_t e1_port, uint8_t e1_timeslot, uint8_t e1_subslot,
+			  uint8_t tei);
 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,
-			   u_int8_t e1_port, u_int8_t e1_timeslot,
-			   u_int8_t e1_subslot);
-int abis_nm_set_bts_attr(struct gsm_bts *bts, u_int8_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_channel_attr(struct gsm_bts_trx_ts *ts, u_int8_t chan_comb);
-int abis_nm_sw_act_req_ack(struct gsm_bts *bts, u_int8_t obj_class, u_int8_t i1,
-			u_int8_t i2, u_int8_t i3, int nack, u_int8_t *attr, int att_len);
-int abis_nm_raw_msg(struct gsm_bts *bts, int len, u_int8_t *msg);
+			   uint8_t e1_port, uint8_t e1_timeslot,
+			   uint8_t e1_subslot);
+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, uint8_t *attr, int attr_len);
+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, uint8_t obj_class, uint8_t i1,
+			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, uint8_t *msg);
 int abis_nm_event_reports(struct gsm_bts *bts, int on);
 int abis_nm_reset_resource(struct gsm_bts *bts);
 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);
 int abis_nm_software_load_status(struct gsm_bts *bts);
 int abis_nm_software_activate(struct gsm_bts *bts, const char *fname,
 			      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,
-			    u_int8_t e1_port1, u_int8_t ts1);
+int abis_nm_conn_mdrop_link(struct gsm_bts *bts, uint8_t e1_port0, uint8_t ts0,
+			    uint8_t e1_port1, uint8_t ts1);
 
-int abis_nm_perform_test(struct gsm_bts *bts, u_int8_t obj_class,
-			 u_int8_t bts_nr, u_int8_t trx_nr, u_int8_t ts_nr,
-			 u_int8_t test_nr, u_int8_t auton_report, struct msgb *msg);
+int abis_nm_perform_test(struct gsm_bts *bts, uint8_t obj_class,
+			 uint8_t bts_nr, uint8_t trx_nr, uint8_t ts_nr,
+			 uint8_t test_nr, uint8_t auton_report, struct msgb *msg);
 
 int abis_nm_chcomb4pchan(enum gsm_phys_chan_config pchan);
 
@@ -113,19 +113,19 @@
 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_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);
-int abis_nm_bs11_create_envaBTSE(struct gsm_bts *bts, u_int8_t idx);
-int abis_nm_bs11_create_bport(struct gsm_bts *bts, u_int8_t idx);
+			  uint8_t idx, uint8_t attr_len, const uint8_t *attr);
+int abis_nm_bs11_create_envaBTSE(struct gsm_bts *bts, uint8_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,
-				enum abis_bs11_objtype type, u_int8_t idx);
-int abis_nm_bs11_delete_bport(struct gsm_bts *bts, u_int8_t idx);
-int abis_nm_bs11_conn_oml_tei(struct gsm_bts *bts, u_int8_t e1_port,
-			  u_int8_t e1_timeslot, u_int8_t e1_subslot, u_int8_t tei);
+				enum abis_bs11_objtype type, uint8_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, uint8_t e1_port,
+			  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_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_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_infield_logon(struct gsm_bts *bts, int on);
 int abis_nm_bs11_set_trx1_pw(struct gsm_bts *bts, const char *password);
@@ -135,33 +135,33 @@
 int abis_nm_bs11_get_cclk(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,
-			  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_get_bport_line_cfg(struct gsm_bts *bts, u_int8_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_get_bport_line_cfg(struct gsm_bts *bts, uint8_t bport);
+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_restart(struct gsm_bts *bts);
 
 /* ip.access nanoBTS specific commands */
-int abis_nm_ipaccess_msg(struct gsm_bts *bts, u_int8_t msg_type,
-			 u_int8_t obj_class, u_int8_t bts_nr,
-			 u_int8_t trx_nr, u_int8_t ts_nr,
-			 u_int8_t *attr, int attr_len);
-int abis_nm_ipaccess_set_nvattr(struct gsm_bts_trx *trx, u_int8_t *attr,
+int abis_nm_ipaccess_msg(struct gsm_bts *bts, uint8_t msg_type,
+			 uint8_t obj_class, uint8_t bts_nr,
+			 uint8_t trx_nr, uint8_t ts_nr,
+			 uint8_t *attr, int attr_len);
+int abis_nm_ipaccess_set_nvattr(struct gsm_bts_trx *trx, uint8_t *attr,
 				int attr_len);
 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,
-				u_int8_t bts_nr, u_int8_t trx_nr, u_int8_t ts_nr,
-				u_int8_t *attr, u_int8_t attr_len);
+int abis_nm_ipaccess_set_attr(struct gsm_bts *bts, uint8_t obj_class,
+				uint8_t bts_nr, uint8_t trx_nr, uint8_t ts_nr,
+				uint8_t *attr, uint8_t attr_len);
 int abis_nm_ipaccess_rsl_connect(struct gsm_bts_trx *trx, 
-				 u_int32_t ip, u_int16_t port, u_int8_t stream);
-void abis_nm_ipaccess_cgi(u_int8_t *buf, struct gsm_bts *bts);
-int ipac_parse_bcch_info(struct ipac_bcch_info *binf, u_int8_t *buf);
-const char *ipacc_testres_name(u_int8_t res);
+				 uint32_t ip, uint16_t port, uint8_t stream);
+void abis_nm_ipaccess_cgi(uint8_t *buf, struct gsm_bts *bts);
+int ipac_parse_bcch_info(struct ipac_bcch_info *binf, uint8_t *buf);
+const char *ipacc_testres_name(uint8_t res);
 
 /* Functions calling into other code parts */
-const char *nm_opstate_name(u_int8_t os);
-const char *nm_avail_name(u_int8_t avail);
+const char *nm_opstate_name(uint8_t os);
+const char *nm_avail_name(uint8_t avail);
 int nm_is_running(struct gsm_nm_state *s);
 
 int abis_nm_vty_init(void);
diff --git a/openbsc/include/openbsc/abis_rsl.h b/openbsc/include/openbsc/abis_rsl.h
index e5f38c9..04a591d 100644
--- a/openbsc/include/openbsc/abis_rsl.h
+++ b/openbsc/include/openbsc/abis_rsl.h
@@ -32,61 +32,61 @@
 struct gsm_bts_trx_ts;
 
 
-int rsl_bcch_info(struct gsm_bts_trx *trx, u_int8_t type,
-		  const u_int8_t *data, int len);
-int rsl_sacch_filling(struct gsm_bts_trx *trx, u_int8_t type, 
-		      const u_int8_t *data, int len);
-int rsl_chan_activate(struct gsm_bts_trx *trx, u_int8_t chan_nr,
-		      u_int8_t act_type,
+int rsl_bcch_info(struct gsm_bts_trx *trx, uint8_t type,
+		  const uint8_t *data, int len);
+int rsl_sacch_filling(struct gsm_bts_trx *trx, uint8_t type,
+		      const uint8_t *data, int len);
+int rsl_chan_activate(struct gsm_bts_trx *trx, uint8_t chan_nr,
+		      uint8_t act_type,
 		      struct rsl_ie_chan_mode *chan_mode,
 		      struct rsl_ie_chan_ident *chan_ident,
-		      u_int8_t bs_power, u_int8_t ms_power,
-		      u_int8_t ta);
-int rsl_chan_activate_lchan(struct gsm_lchan *lchan, u_int8_t act_type, 
-			    u_int8_t ta, u_int8_t ho_ref);
+		      uint8_t bs_power, uint8_t ms_power,
+		      uint8_t ta);
+int rsl_chan_activate_lchan(struct gsm_lchan *lchan, uint8_t act_type,
+			    uint8_t ta, uint8_t ho_ref);
 int rsl_chan_mode_modify_req(struct gsm_lchan *ts);
 int rsl_encryption_cmd(struct msgb *msg);
-int rsl_paging_cmd(struct gsm_bts *bts, u_int8_t paging_group, u_int8_t len,
-		   u_int8_t *ms_ident, u_int8_t chan_needed);
-int rsl_imm_assign_cmd(struct gsm_bts *bts, u_int8_t len, u_int8_t *val);
+int rsl_paging_cmd(struct gsm_bts *bts, uint8_t paging_group, uint8_t len,
+		   uint8_t *ms_ident, uint8_t chan_needed);
+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_establish_request(struct gsm_lchan *lchan, u_int8_t link_id);
-int rsl_relase_request(struct gsm_lchan *lchan, u_int8_t link_id);
+int rsl_data_request(struct msgb *msg, uint8_t link_id);
+int rsl_establish_request(struct gsm_lchan *lchan, uint8_t link_id);
+int rsl_relase_request(struct gsm_lchan *lchan, uint8_t link_id);
 
 /* Siemens vendor-specific RSL extensions */
 int rsl_siemens_mrpci(struct gsm_lchan *lchan, struct rsl_mrpci *mrpci);
 
 /* ip.access specfic RSL extensions */
 int rsl_ipacc_crcx(struct gsm_lchan *lchan);
-int rsl_ipacc_mdcx(struct gsm_lchan *lchan, u_int32_t ip,
-		   u_int16_t port, u_int8_t rtp_payload2);
+int rsl_ipacc_mdcx(struct gsm_lchan *lchan, uint32_t ip,
+		   uint16_t port, uint8_t rtp_payload2);
 int rsl_ipacc_mdcx_to_rtpsock(struct gsm_lchan *lchan);
 int rsl_ipacc_pdch_activate(struct gsm_bts_trx_ts *ts, int act);
 
 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);
 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);
-u_int8_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);
+uint64_t str_to_imsi(const char *imsi_str);
+uint8_t lchan2chan_nr(const struct gsm_lchan *lchan);
+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);
 
 /* to be provided by external code */
 int abis_rsl_sendmsg(struct msgb *msg);
 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 */
 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_number_of_paging_subchannels(struct gsm_bts *bts);
 
-int rsl_sacch_info_modify(struct gsm_lchan *lchan, u_int8_t type,
-			  const u_int8_t *data, int len);
+int rsl_sacch_info_modify(struct gsm_lchan *lchan, uint8_t type,
+			  const uint8_t *data, int len);
 
 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);
diff --git a/openbsc/include/openbsc/bsc_rll.h b/openbsc/include/openbsc/bsc_rll.h
index b2898d1..729ba60 100644
--- a/openbsc/include/openbsc/bsc_rll.h
+++ b/openbsc/include/openbsc/bsc_rll.h
@@ -10,10 +10,10 @@
 	BSC_RLLR_IND_TIMEOUT,
 };
 
-int rll_establish(struct gsm_lchan *lchan, u_int8_t link_id,
-		  void (*cb)(struct gsm_lchan *, u_int8_t, void *,
+int rll_establish(struct gsm_lchan *lchan, uint8_t link_id,
+		  void (*cb)(struct gsm_lchan *, uint8_t, void *,
 			     enum bsc_rllr_ind),
 		  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 */
diff --git a/openbsc/include/openbsc/crc24.h b/openbsc/include/openbsc/crc24.h
index 358fcb5..74c253f 100644
--- a/openbsc/include/openbsc/crc24.h
+++ b/openbsc/include/openbsc/crc24.h
@@ -3,6 +3,6 @@
 
 #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
diff --git a/openbsc/include/openbsc/db.h b/openbsc/include/openbsc/db.h
index fd9181e..b6ea9d2 100644
--- a/openbsc/include/openbsc/db.h
+++ b/openbsc/include/openbsc/db.h
@@ -44,7 +44,7 @@
 int db_sync_subscriber(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_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_sync_equipment(struct gsm_equipment *equip);
 int db_subscriber_update(struct gsm_subscriber *subscriber);
@@ -70,8 +70,8 @@
 
 /* APDU blob storage */
 int db_apdu_blob_store(struct gsm_subscriber *subscr, 
-			u_int8_t apdu_id_flags, u_int8_t len,
-			u_int8_t *apdu);
+			uint8_t apdu_id_flags, uint8_t len,
+			uint8_t *apdu);
 
 /* Statistics counter storage */
 struct counter;
diff --git a/openbsc/include/openbsc/e1_input.h b/openbsc/include/openbsc/e1_input.h
index 40ceedf..8a966ad 100644
--- a/openbsc/include/openbsc/e1_input.h
+++ b/openbsc/include/openbsc/e1_input.h
@@ -37,12 +37,12 @@
 	struct llist_head tx_list;
 
 	/* SAPI and TEI on the E1 TS */
-	u_int8_t sapi;
-	u_int8_t tei;
+	uint8_t sapi;
+	uint8_t tei;
 
 	union {
 		struct {
-			u_int8_t channel;
+			uint8_t channel;
 		} misdn;
 	} driver;
 };
@@ -125,21 +125,21 @@
 int e1inp_line_register(struct e1inp_line *line);
 
 /* 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 */
-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 */
 struct e1inp_sign_link *
-e1inp_lookup_sign_link(struct e1inp_ts *ts, u_int8_t tei,
-			u_int8_t sapi);
+e1inp_lookup_sign_link(struct e1inp_ts *ts, uint8_t tei,
+			uint8_t sapi);
 
 /* create a new signalling link in a E1 timeslot */
 struct e1inp_sign_link *
 e1inp_sign_link_create(struct e1inp_ts *ts, enum e1inp_sign_type type,
-			struct gsm_bts_trx *trx, u_int8_t tei,
-			u_int8_t sapi);
+			struct gsm_bts_trx *trx, uint8_t tei,
+			uint8_t sapi);
 
 /* configure and initialize one e1inp_ts */
 int e1inp_ts_config(struct e1inp_ts *ts, struct e1inp_line *line,
@@ -150,20 +150,20 @@
 
 /* Receive a packet from the E1 driver */
 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 */
 struct msgb *e1inp_tx_ts(struct e1inp_ts *e1i_ts,
 			 struct e1inp_sign_link **sign_link);
 
 /* 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. */
 void e1_set_pcap_fd(int fd);
 
 /* 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);
 int e1inp_line_update(struct e1inp_line *line);
diff --git a/openbsc/include/openbsc/gb_proxy.h b/openbsc/include/openbsc/gb_proxy.h
index 8a7911c..3c9ebe0 100644
--- a/openbsc/include/openbsc/gb_proxy.h
+++ b/openbsc/include/openbsc/gb_proxy.h
@@ -10,7 +10,7 @@
 
 struct gbproxy_config {
 	/* parsed from config file */
-	u_int16_t nsip_sgsn_nsei;
+	uint16_t nsip_sgsn_nsei;
 
 	/* misc */
 	struct gprs_ns_inst *nsi;
diff --git a/openbsc/include/openbsc/gsm_04_08.h b/openbsc/include/openbsc/gsm_04_08.h
index 5e0a45b..b9b89e6 100644
--- a/openbsc/include/openbsc/gsm_04_08.h
+++ b/openbsc/include/openbsc/gsm_04_08.h
@@ -28,37 +28,37 @@
 void gsm0408_clear_all_trans(struct gsm_network *net, int protocol);
 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);
-enum gsm_chan_t get_ctype_by_chreq(struct gsm_network *bts, u_int8_t ra);
-enum gsm_chreq_reason_t get_reason_by_chreq(u_int8_t ra, int neci);
+enum gsm_chan_t get_ctype_by_chreq(struct gsm_network *bts, uint8_t ra);
+enum gsm_chreq_reason_t get_reason_by_chreq(uint8_t ra, int neci);
 void gsm_net_update_ctype(struct gsm_network *net);
 
 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_send_rr_release(struct gsm_lchan *lchan);
 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,
-			   u_int8_t apdu_len, const u_int8_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_app_info(struct gsm_subscriber_connection *conn, uint8_t apdu_id,
+			   uint8_t apdu_len, const uint8_t *apdu);
+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,
-		      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);
 
 /* 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 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 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_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_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_parse_meas_rep(struct gsm_meas_rep *rep, struct msgb *msg);
 
diff --git a/openbsc/include/openbsc/gsm_04_11.h b/openbsc/include/openbsc/gsm_04_11.h
index 5f400ff..2abe3e2 100644
--- a/openbsc/include/openbsc/gsm_04_11.h
+++ b/openbsc/include/openbsc/gsm_04_11.h
@@ -7,20 +7,20 @@
 
 /* SMS deliver PDU */
 struct sms_deliver {
-	u_int8_t mti:2;		/* message type indicator */
-	u_int8_t mms:1;		/* more messages to send */
-	u_int8_t rp:1;		/* reply path */
-	u_int8_t udhi:1;	/* user data header indicator */
-	u_int8_t sri:1;		/* status report indication */
-	u_int8_t *orig_addr;	/* originating address */
-	u_int8_t pid;		/* protocol identifier */
-	u_int8_t dcs;		/* data coding scheme */
+	uint8_t mti:2;		/* message type indicator */
+	uint8_t mms:1;		/* more messages to send */
+	uint8_t rp:1;		/* reply path */
+	uint8_t udhi:1;	/* user data header indicator */
+	uint8_t sri:1;		/* status report indication */
+	uint8_t *orig_addr;	/* originating address */
+	uint8_t pid;		/* protocol identifier */
+	uint8_t dcs;		/* data coding scheme */
 				/* service centre time stamp */
-	u_int8_t ud_len;	/* user data length */
-	u_int8_t *user_data;	/* user data */
+	uint8_t ud_len;	/* user data length */
+	uint8_t *user_data;	/* user data */
 
-	u_int8_t msg_ref;	/* message reference */
-	u_int8_t *smsc;
+	uint8_t msg_ref;	/* message reference */
+	uint8_t *smsc;
 };
 
 struct msgb;
diff --git a/openbsc/include/openbsc/gsm_data.h b/openbsc/include/openbsc/gsm_data.h
index 4b3ec93..9fef13a 100644
--- a/openbsc/include/openbsc/gsm_data.h
+++ b/openbsc/include/openbsc/gsm_data.h
@@ -104,11 +104,11 @@
 	unsigned char *bssgp_cell_id;
 
 	/* Identifiers of a BTS, equal to 'struct bssgp_bts_ctx' */
-	u_int16_t nsei;
-	u_int16_t bvci;
+	uint16_t nsei;
+	uint16_t bvci;
 
 	/* Identifier of a MS (inside BTS), equal to 'struct sgsn_mm_ctx' */
-	u_int32_t tlli;
+	uint32_t tlli;
 } __attribute__((packed));
 #define OBSC_MSGB_CB(__msgb)	((struct openbsc_msgb_cb *)&((__msgb)->cb[0]))
 #define msgb_tlli(__x)		OBSC_MSGB_CB(__x)->tlli
@@ -144,15 +144,15 @@
 struct gsm_auth_info {
 	enum gsm_auth_algo auth_algo;
 	unsigned int a3a8_ki_len;
-	u_int8_t a3a8_ki[16];
+	uint8_t a3a8_ki[16];
 };
 
 struct gsm_auth_tuple {
 	int use_count;
 	int key_seq;
-	u_int8_t rand[16];
-	u_int8_t sres[4];
-	u_int8_t kc[8];
+	uint8_t rand[16];
+	uint8_t sres[4];
+	uint8_t kc[8];
 };
 #define GSM_KEY_SEQ_INVAL	7	/* GSM 04.08 - 10.5.1.2 */
 
@@ -165,9 +165,9 @@
 
 /* Network Management State */
 struct gsm_nm_state {
-	u_int8_t operational;
-	u_int8_t administrative;
-	u_int8_t availability;
+	uint8_t operational;
+	uint8_t administrative;
+	uint8_t availability;
 };
 
 /*
@@ -208,11 +208,11 @@
 
 /* processed neighbor measurements for one cell */
 struct neigh_meas_proc {
-	u_int16_t arfcn;
-	u_int8_t bsic;
-	u_int8_t rxlev[MAX_WIN_NEIGH_AVG];
+	uint16_t arfcn;
+	uint8_t bsic;
+	uint8_t rxlev[MAX_WIN_NEIGH_AVG];
 	unsigned int rxlev_cnt;
-	u_int8_t last_seen_nr;
+	uint8_t last_seen_nr;
 };
 
 #define MAX_A5_KEY_LEN	(128/8)
@@ -273,7 +273,7 @@
 	/* The TS that we're part of */
 	struct gsm_bts_trx_ts *ts;
 	/* The logical subslot number in the TS */
-	u_int8_t nr;
+	uint8_t nr;
 	/* The logical channel type */
 	enum gsm_chan_t type;
 	/* RSL channel mode */
@@ -283,13 +283,13 @@
 	/* State */
 	enum gsm_lchan_state state;
 	/* Power levels for MS and BTS */
-	u_int8_t bs_power;
-	u_int8_t ms_power;
+	uint8_t bs_power;
+	uint8_t ms_power;
 	/* Encryption information */
 	struct {
-		u_int8_t alg_id;
-		u_int8_t key_len;
-		u_int8_t key[MAX_A5_KEY_LEN];
+		uint8_t alg_id;
+		uint8_t key_len;
+		uint8_t key[MAX_A5_KEY_LEN];
 	} encr;
 
 	struct timer_list T3101;
@@ -300,7 +300,7 @@
 	struct gsm48_multi_rate_conf mr_conf;
 	
 	/* Established data link layer services */
-	u_int8_t sapis[8];
+	uint8_t sapis[8];
 	int sach_deact;
 	int release_reason;
 
@@ -316,14 +316,14 @@
 	struct neigh_meas_proc neigh_meas[MAX_NEIGH_MEAS];
 
 	struct {
-		u_int32_t bound_ip;
-		u_int32_t connect_ip;
-		u_int16_t bound_port;
-		u_int16_t connect_port;
-		u_int16_t conn_id;
-		u_int8_t rtp_payload;
-		u_int8_t rtp_payload2;
-		u_int8_t speech_mode;
+		uint32_t bound_ip;
+		uint32_t connect_ip;
+		uint16_t bound_port;
+		uint16_t connect_port;
+		uint16_t conn_id;
+		uint8_t rtp_payload;
+		uint8_t rtp_payload2;
+		uint8_t speech_mode;
 		struct rtp_socket *rtp_socket;
 	} abis_ip;
 
@@ -332,11 +332,11 @@
 
 struct gsm_e1_subslot {
 	/* Number of E1 link */
-	u_int8_t	e1_nr;
+	uint8_t	e1_nr;
 	/* 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 */
-	u_int8_t	e1_ts_ss;
+	uint8_t	e1_ts_ss;
 };
 
 #define TS_F_PDCH_MODE	0x1000
@@ -344,26 +344,26 @@
 struct gsm_bts_trx_ts {
 	struct gsm_bts_trx *trx;
 	/* number of this timeslot at the TRX */
-	u_int8_t nr;
+	uint8_t nr;
 
 	enum gsm_phys_chan_config pchan;
 
 	unsigned int flags;
 	struct gsm_nm_state nm_state;
 	struct tlv_parsed nm_attr;
-	u_int8_t nm_chan_comb;
+	uint8_t nm_chan_comb;
 
 	struct {
 		/* Parameters below are configured by VTY */
 		int enabled;
-		u_int8_t maio;
-		u_int8_t hsn;
+		uint8_t maio;
+		uint8_t hsn;
 		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 */
 		struct bitvec ma;
-		u_int8_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_len;	/* part of ma_data that is used */
+		uint8_t ma_data[8];	/* 10.5.2.21: max 8 bytes value part */
 	} hopping;
 
 	/* To which E1 subslot are we connected */
@@ -379,12 +379,12 @@
 
 	struct gsm_bts *bts;
 	/* number of this TRX in the BTS */
-	u_int8_t nr;
+	uint8_t nr;
 	/* human readable name / description */
 	char *description;
 	/* how do we talk RSL with this TRX? */
 	struct gsm_e1_subslot rsl_e1_link;
-	u_int8_t rsl_tei;
+	uint8_t rsl_tei;
 	struct e1inp_sign_link *rsl_link;
 	/* Some BTS (specifically Ericsson RBS) have a per-TRX OML Link */
 	struct e1inp_sign_link *oml_link;
@@ -395,7 +395,7 @@
 		struct gsm_nm_state nm_state;
 	} bb_transc;
 
-	u_int16_t arfcn;
+	uint16_t arfcn;
 	int nominal_power;		/* in dBm */
 	unsigned int max_power_red;	/* in actual dB */
 
@@ -410,7 +410,7 @@
 		} bs11;
 		struct {
 			unsigned int test_state;
-			u_int8_t test_nr;
+			uint8_t test_nr;
 			struct rxlev_stats rxlev_stat;
 		} ipaccess;
 	};
@@ -472,7 +472,7 @@
 	int free_chans_need;
 
 	/* load */
-	u_int16_t available_slots;
+	uint16_t available_slots;
 };
 
 struct gsm_envabtse {
@@ -484,10 +484,10 @@
 	/* data read via VTY config file, to configure the BTS
 	 * via OML from BSC */
 	int id;
-	u_int16_t nsvci;
-	u_int16_t local_port;	/* on the BTS */
-	u_int16_t remote_port;	/* on the SGSN */
-	u_int32_t remote_ip;	/* on the SGSN */
+	uint16_t nsvci;
+	uint16_t local_port;	/* on the BTS */
+	uint16_t remote_port;	/* on the SGSN */
+	uint32_t remote_ip;	/* on the SGSN */
 
 	struct gsm_nm_state nm_state;
 };
@@ -505,17 +505,17 @@
 
 	struct gsm_network *network;
 	/* number of ths BTS in network */
-	u_int8_t nr;
+	uint8_t nr;
 	/* human readable name / description */
 	char *description;
 	/* Cell Identity */
-	u_int16_t cell_identity;
+	uint16_t cell_identity;
 	/* location area code of this BTS */
-	u_int16_t location_area_code;
+	uint16_t location_area_code;
 	/* Training Sequence Code */
-	u_int8_t tsc;
+	uint8_t tsc;
 	/* Base Station Identification Code (BSIC) */
-	u_int8_t bsic;
+	uint8_t bsic;
 	/* type of BTS */
 	enum gsm_bts_type type;
 	struct gsm_bts_model *model;
@@ -528,7 +528,7 @@
 
 	/* how do we talk OML with this TRX? */
 	struct gsm_e1_subslot oml_e1_link;
-	u_int8_t oml_tei;
+	uint8_t oml_tei;
 	struct e1inp_sign_link *oml_link;
 
 	/* Abis network management O&M handle */
@@ -537,7 +537,7 @@
 	struct tlv_parsed nm_attr;
 
 	/* number of this BTS on given E1 link */
-	u_int8_t bts_nr;
+	uint8_t bts_nr;
 
 	/* paging state and control */
 	struct gsm_bts_paging_state paging;
@@ -553,7 +553,7 @@
 	/* parameters from which we build SYSTEM INFORMATION */
 	struct {
 		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_si_selection_params cell_ro_sel_par; /* rest octet */
 		struct gsm48_cell_options cell_options;
@@ -563,10 +563,10 @@
 		struct bitvec si5_neigh_list;
 		struct {
 			/* bitmask large enough for all possible ARFCN's */
-			u_int8_t neigh_list[1024/8];
-			u_int8_t cell_alloc[1024/8];
+			uint8_t neigh_list[1024/8];
+			uint8_t cell_alloc[1024/8];
 			/* 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;
 	} si_common;
 
@@ -580,9 +580,9 @@
 	/* ip.accesss Unit ID's have Site/BTS/TRX layout */
 	union {
 		struct {
-			u_int16_t site_id;
-			u_int16_t bts_id;
-			u_int32_t flags;
+			uint16_t site_id;
+			uint16_t bts_id;
+			uint32_t flags;
 		} ip_access;
 		struct {
 			struct {
@@ -619,16 +619,16 @@
 		enum bts_gprs_mode mode;
 		struct {
 			struct gsm_nm_state nm_state;
-			u_int16_t nsei;
+			uint16_t nsei;
 			uint8_t timer[7];
 		} nse;
 		struct {
 			struct gsm_nm_state nm_state;
-			u_int16_t bvci;
+			uint16_t bvci;
 			uint8_t timer[11];
 		} cell;
 		struct gsm_bts_gprs_nsvc nsvc[2];
-		u_int8_t rac;
+		uint8_t rac;
 	} gprs;
 
 	/* RACH NM values */
@@ -707,8 +707,8 @@
 
 struct gsm_network {
 	/* global parameters */
-	u_int16_t country_code;
-	u_int16_t network_code;
+	uint16_t country_code;
+	uint16_t network_code;
 	char *name_long;
 	char *name_short;
 	enum gsm_auth_policy auth_policy;
@@ -788,25 +788,25 @@
 	struct gsm_subscriber *receiver;
 
 	unsigned long validity_minutes;
-	u_int8_t reply_path_req;
-	u_int8_t status_rep_req;
-	u_int8_t ud_hdr_ind;
-	u_int8_t protocol_id;
-	u_int8_t data_coding_scheme;
-	u_int8_t msg_ref;
+	uint8_t reply_path_req;
+	uint8_t status_rep_req;
+	uint8_t ud_hdr_ind;
+	uint8_t protocol_id;
+	uint8_t data_coding_scheme;
+	uint8_t msg_ref;
 	char dest_addr[20+1];	/* DA LV is 12 bytes max, i.e. 10 bytes
 				 * BCD == 20 bytes string */
-	u_int8_t user_data_len;
-	u_int8_t user_data[SMS_TEXT_SIZE];
+	uint8_t user_data_len;
+	uint8_t user_data[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 *));
 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);
 int gsm_set_bts_type(struct gsm_bts *bts, enum gsm_bts_type type);
 
@@ -814,7 +814,7 @@
 
 /* Get reference to a neighbor cell on a given BCCH ARFCN */
 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);
 
@@ -827,8 +827,8 @@
 char *gsm_lchan_name(struct gsm_lchan *lchan);
 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,
-		   u_int8_t e1_ts, u_int8_t e1_ts_ss);
+void set_ts_e1link(struct gsm_bts_trx_ts *ts, uint8_t e1_nr,
+		   uint8_t e1_ts, uint8_t e1_ts_ss);
 enum gsm_bts_type parse_btstype(const char *arg);
 const char *btstype2str(enum gsm_bts_type type);
 struct gsm_bts_trx *gsm_bts_trx_by_nr(struct gsm_bts *bts, int nr);
@@ -873,7 +873,7 @@
 
 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);
 struct gsm_meas_rep *lchan_next_meas_rep(struct gsm_lchan *lchan);
 
diff --git a/openbsc/include/openbsc/gsm_subscriber.h b/openbsc/include/openbsc/gsm_subscriber.h
index 79476d3..9ffc3e9 100644
--- a/openbsc/include/openbsc/gsm_subscriber.h
+++ b/openbsc/include/openbsc/gsm_subscriber.h
@@ -24,24 +24,24 @@
 	char name[GSM_NAME_LENGTH];
 
 	struct gsm48_classmark1 classmark1;
-	u_int8_t classmark2_len;
-	u_int8_t classmark2[3];
-	u_int8_t classmark3_len;
-	u_int8_t classmark3[14];
+	uint8_t classmark2_len;
+	uint8_t classmark2[3];
+	uint8_t classmark3_len;
+	uint8_t classmark3[14];
 };
 
 struct gsm_subscriber {
 	struct gsm_network *net;
 	long long unsigned int id;
 	char imsi[GSM_IMSI_LENGTH];
-	u_int32_t tmsi;
-	u_int16_t lac;
+	uint32_t tmsi;
+	uint16_t lac;
 	char name[GSM_NAME_LENGTH];
 	char extension[GSM_EXTENSION_LENGTH];
 	int authorized;
 
 	/* 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
 	 * point in time */
@@ -72,7 +72,7 @@
 struct gsm_subscriber *subscr_get(struct gsm_subscriber *subscr);
 struct gsm_subscriber *subscr_put(struct gsm_subscriber *subscr);
 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,
 					  const char *imsi);
 struct gsm_subscriber *subscr_get_by_extension(struct gsm_network *net,
diff --git a/openbsc/include/openbsc/ipaccess.h b/openbsc/include/openbsc/ipaccess.h
index 0edd81d..d965aea 100644
--- a/openbsc/include/openbsc/ipaccess.h
+++ b/openbsc/include/openbsc/ipaccess.h
@@ -9,9 +9,9 @@
 #define IPA_TCP_PORT_RSL	3003
 
 struct ipaccess_head {
-	u_int16_t len;	/* network byte order */
-	u_int8_t proto;
-	u_int8_t data[0];
+	uint16_t len;	/* network byte order */
+	uint8_t proto;
+	uint8_t data[0];
 } __attribute__ ((packed));
 
 struct ipaccess_head_ext {
@@ -81,7 +81,7 @@
 
 const char *ipaccess_idtag_name(uint8_t tag);
 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_rsl(struct gsm_bts_trx *trx);
@@ -92,30 +92,30 @@
 struct sdp_firmware {
 	char magic[4];
 	char more_magic[2];
-	u_int16_t more_more_magic;
-	u_int32_t header_length;
-	u_int32_t file_length;
+	uint16_t more_more_magic;
+	uint32_t header_length;
+	uint32_t file_length;
 	char sw_part[20];
 	char text1[64];
 	char time[12];
 	char date[14];
 	char text2[10];
 	char version[20];
-	u_int16_t table_offset;
+	uint16_t table_offset;
 	/* stuff i don't know */
 } __attribute__((packed));
 
 struct sdp_header_entry {
-	u_int16_t something1;
+	uint16_t something1;
 	char text1[64];
 	char time[12];
 	char date[14];
 	char text2[10];
 	char version[20];
-	u_int32_t length;
-	u_int32_t addr1;
-	u_int32_t addr2;
-	u_int32_t start;
+	uint32_t length;
+	uint32_t addr1;
+	uint32_t addr2;
+	uint32_t start;
 } __attribute__((packed));
 
 struct sdp_header_item {
diff --git a/openbsc/include/openbsc/meas_rep.h b/openbsc/include/openbsc/meas_rep.h
index 3c2c8d1..f235df6 100644
--- a/openbsc/include/openbsc/meas_rep.h
+++ b/openbsc/include/openbsc/meas_rep.h
@@ -1,21 +1,23 @@
 #ifndef _MEAS_REP_H
 #define _MEAS_REP_H
 
+#include <stdint.h>
+
 #define MRC_F_PROCESSED	0x0001
 
 /* extracted from a L3 measurement report IE */
 struct gsm_meas_rep_cell {
-	u_int8_t rxlev;
-	u_int8_t bsic;
-	u_int8_t neigh_idx;
-	u_int16_t arfcn;
+	uint8_t rxlev;
+	uint8_t bsic;
+	uint8_t neigh_idx;
+	uint16_t arfcn;
 	unsigned int flags;
 };
 
 /* RX Level and RX Quality */
 struct gsm_rx_lev_qual {
-	u_int8_t rx_lev;
-	u_int8_t rx_qual;
+	uint8_t rx_lev;
+	uint8_t rx_qual;
 };
 
 /* unidirectional measumrement report */
@@ -38,7 +40,7 @@
 	struct gsm_lchan *lchan;
 
 	/* number of the measurement report */
-	u_int8_t nr;
+	uint8_t nr;
 	/* flags, see MEAS_REP_F_* */
 	unsigned int flags;
 
@@ -46,11 +48,11 @@
 	struct gsm_meas_rep_unidir ul;
 	struct gsm_meas_rep_unidir dl;
 
-	u_int8_t bs_power;
-	u_int8_t ms_timing_offset;
+	uint8_t bs_power;
+	uint8_t ms_timing_offset;
 	struct {
 		int8_t pwr;	/* MS power in dBm */
-		u_int8_t ta;	/* MS timing advance */
+		uint8_t ta;	/* MS timing advance */
 	} ms_l1;
 
 	/* neighbor measurement reports for up to 6 cells */
diff --git a/openbsc/include/openbsc/paging.h b/openbsc/include/openbsc/paging.h
index 13d611a..e858547 100644
--- a/openbsc/include/openbsc/paging.h
+++ b/openbsc/include/openbsc/paging.h
@@ -66,6 +66,6 @@
 			 struct msgb *msg);
 
 /* 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
diff --git a/openbsc/include/openbsc/rest_octets.h b/openbsc/include/openbsc/rest_octets.h
index 6d90119..5ad5908 100644
--- a/openbsc/include/openbsc/rest_octets.h
+++ b/openbsc/include/openbsc/rest_octets.h
@@ -5,10 +5,10 @@
 #include <openbsc/gsm_04_08.h>
 
 /* 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 {
-	u_int16_t penalty_time:5,
+	uint16_t penalty_time:5,
 		  temp_offs:3,
 		  cell_resel_off:6,
 		  cbq:1,
@@ -16,18 +16,18 @@
 };
 
 struct gsm48_si_power_offset {
-	u_int8_t power_offset:2,
+	uint8_t power_offset:2,
 		 present:1;
 };
 
 struct gsm48_si3_gprs_ind {
-	u_int8_t si13_position:1,
+	uint8_t si13_position:1,
 		 ra_colour:3,
 		 present:1;
 };
 
 struct gsm48_lsa_params {
-	u_int32_t prio_thr:3,
+	uint32_t prio_thr:3,
 		 lsa_offset:3,
 		 mcc:12,
 		 mnc:12;
@@ -37,26 +37,26 @@
 struct gsm48_si_ro_info {
 	struct gsm48_si_selection_params selection_params;
 	struct gsm48_si_power_offset power_offset;
-	u_int8_t si2ter_indicator;
-	u_int8_t early_cm_ctrl;
+	uint8_t si2ter_indicator;
+	uint8_t early_cm_ctrl;
 	struct {
-		u_int8_t where:3,
+		uint8_t where:3,
 			 present:1;
 	} scheduling;
 	struct gsm48_si3_gprs_ind gprs_ind;
 
 	/* SI 4 specific */
 	struct gsm48_lsa_params lsa_params;
-	u_int16_t cell_id;
-	u_int8_t break_ind;	/* do we have SI7 + SI8 ? */
+	uint16_t cell_id;
+	uint8_t break_ind;	/* do we have SI7 + SI8 ? */
 };
 
 
 /* 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) */
-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 {
 	PBCCH_BCCH,
@@ -75,59 +75,59 @@
 struct gprs_cell_options {
 	enum gprs_nmo nmo;
 	/* 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 */
-	u_int32_t t3192;	/* in milliseconds */
-	u_int32_t drx_timer_max;/* in seconds */
-	u_int32_t bs_cv_max;
+	uint32_t t3192;	/* in milliseconds */
+	uint32_t drx_timer_max;/* in seconds */
+	uint32_t bs_cv_max;
 
-	u_int8_t ext_info_present;
+	uint8_t ext_info_present;
 	struct {
-		u_int8_t egprs_supported;
-			u_int8_t use_egprs_p_ch_req;
-			u_int8_t bep_period;
-		u_int8_t pfc_supported;
-		u_int8_t dtm_supported;
-		u_int8_t bss_paging_coordination;
+		uint8_t egprs_supported;
+			uint8_t use_egprs_p_ch_req;
+			uint8_t bep_period;
+		uint8_t pfc_supported;
+		uint8_t dtm_supported;
+		uint8_t bss_paging_coordination;
 	} ext_info;
 };
 
 /* TS 04.60 Table 12.9.2 */
 struct gprs_power_ctrl_pars {
-	u_int8_t alpha;
-	u_int8_t t_avg_w;
-	u_int8_t t_avg_t;
-	u_int8_t pc_meas_chan;
-	u_int8_t n_avg_i;
+	uint8_t alpha;
+	uint8_t t_avg_w;
+	uint8_t t_avg_t;
+	uint8_t pc_meas_chan;
+	uint8_t n_avg_i;
 };
 
 struct gsm48_si13_info {
 	struct gprs_cell_options cell_opts;
 	struct gprs_power_ctrl_pars pwr_ctrl_pars;
-	u_int8_t bcch_change_mark;
-	u_int8_t si_change_field;
-	u_int8_t pbcch_present;
+	uint8_t bcch_change_mark;
+	uint8_t si_change_field;
+	uint8_t pbcch_present;
 
 	union {
 		struct {
-			u_int8_t rac;
-			u_int8_t spgc_ccch_sup;
-			u_int8_t net_ctrl_ord;
-			u_int8_t prio_acc_thr;
+			uint8_t rac;
+			uint8_t spgc_ccch_sup;
+			uint8_t net_ctrl_ord;
+			uint8_t prio_acc_thr;
 		} no_pbcch;
 		struct {
-			u_int8_t psi1_rep_per;
-			u_int8_t pb;
-			u_int8_t tsc;
-			u_int8_t tn;
+			uint8_t psi1_rep_per;
+			uint8_t pb;
+			uint8_t tsc;
+			uint8_t tn;
 			enum pbcch_carrier_type carrier_type;
-			u_int16_t arfcn;
-			u_int8_t maio;
+			uint16_t arfcn;
+			uint8_t maio;
 		} pbcch;
 	};
 };
 
 /* 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 */
diff --git a/openbsc/include/openbsc/rtp_proxy.h b/openbsc/include/openbsc/rtp_proxy.h
index 2e4f278..8ad3636 100644
--- a/openbsc/include/openbsc/rtp_proxy.h
+++ b/openbsc/include/openbsc/rtp_proxy.h
@@ -67,23 +67,23 @@
 		} proxy;
 		struct {
 			struct gsm_network *net;
-			u_int32_t callref;
+			uint32_t callref;
 		} receive;
 	};
 	enum rtp_tx_action tx_action;
 	struct {
-		u_int16_t sequence;
-		u_int32_t timestamp;
-		u_int32_t ssrc;
+		uint16_t sequence;
+		uint32_t timestamp;
+		uint32_t ssrc;
 		struct timeval last_tv;
 	} transmit;
 };
 
 struct rtp_socket *rtp_socket_create(void);
-int rtp_socket_bind(struct rtp_socket *rs, u_int32_t ip);
-int rtp_socket_connect(struct rtp_socket *rs, u_int32_t ip, u_int16_t port);
+int rtp_socket_bind(struct rtp_socket *rs, uint32_t ip);
+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_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_send_frame(struct rtp_socket *rs, struct gsm_data_frame *frame);
 
diff --git a/openbsc/include/openbsc/signal.h b/openbsc/include/openbsc/signal.h
index ea76a40..2991cfa 100644
--- a/openbsc/include/openbsc/signal.h
+++ b/openbsc/include/openbsc/signal.h
@@ -170,14 +170,14 @@
 
 struct ipacc_ack_signal_data {
 	struct gsm_bts_trx *trx;
-	u_int8_t msg_type;	
+	uint8_t msg_type;
 };
 
 struct abis_om2k_mo;
 
 struct nm_statechg_signal_data {
 	struct gsm_bts *bts;
-	u_int8_t obj_class;
+	uint8_t obj_class;
 	void *obj;
 	struct gsm_nm_state *old_state;
 	struct gsm_nm_state *new_state;
diff --git a/openbsc/include/openbsc/socket.h b/openbsc/include/openbsc/socket.h
index dac4ca7..1976913 100644
--- a/openbsc/include/openbsc/socket.h
+++ b/openbsc/include/openbsc/socket.h
@@ -9,7 +9,7 @@
 #endif
 
 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);
 
 #endif /* _BSC_SOCKET_H */
diff --git a/openbsc/include/openbsc/subchan_demux.h b/openbsc/include/openbsc/subchan_demux.h
index f7f0fba..b71c856 100644
--- a/openbsc/include/openbsc/subchan_demux.h
+++ b/openbsc/include/openbsc/subchan_demux.h
@@ -20,7 +20,7 @@
  *
  */
 
-#include <sys/types.h>
+#include <stdint.h>
 #include <osmocom/core/linuxlist.h>
 
 #define NR_SUBCH	4
@@ -32,8 +32,8 @@
 /***********************************************************************/
 
 struct demux_subch {
-	u_int8_t out_bitbuf[TRAU_FRAME_BITS];
-	u_int16_t out_idx; /* next bit to be written in out_bitbuf */
+	uint8_t out_bitbuf[TRAU_FRAME_BITS];
+	uint16_t out_idx; /* next bit to be written in out_bitbuf */
 	/* number of consecutive zeros that we have received (for sync) */
 	unsigned int consecutive_zeros;
 	/* are we in TRAU frame sync or not? */
@@ -42,12 +42,12 @@
 
 struct subch_demux {
 	/* bitmask of currently active subchannels */
-	u_int8_t chan_activ;
+	uint8_t chan_activ;
 	/* one demux_subch struct for every subchannel */
 	struct demux_subch subch[NR_SUBCH];
 	/* callback to be called once we have received a complete
 	 * 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 *);
 	/* user-provided data, transparently passed to out_cb() */
 	void *data;
@@ -57,7 +57,7 @@
 int subch_demux_init(struct subch_demux *dmx);
 
 /* 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 */
 int subch_demux_activate(struct subch_demux *dmx, int subch);
@@ -76,7 +76,7 @@
 	unsigned int bit_len;	/* total number of bits in 'bits' */
 	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 {
@@ -92,10 +92,10 @@
 int subchan_mux_init(struct subch_mux *mx);
 
 /* 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 */
-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);
 
 #endif /* _SUBCH_DEMUX_H */
diff --git a/openbsc/include/openbsc/system_information.h b/openbsc/include/openbsc/system_information.h
index 5f183e0..becb80a 100644
--- a/openbsc/include/openbsc/system_information.h
+++ b/openbsc/include/openbsc/system_information.h
@@ -35,7 +35,7 @@
 	_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];
 uint8_t gsm_sitype2rsl(enum osmo_sysinfo_type si_type);
diff --git a/openbsc/include/openbsc/transaction.h b/openbsc/include/openbsc/transaction.h
index 721630b..5f11ef2 100644
--- a/openbsc/include/openbsc/transaction.h
+++ b/openbsc/include/openbsc/transaction.h
@@ -12,10 +12,10 @@
 	struct llist_head entry;
 
 	/* The protocol within which we live */
-	u_int8_t protocol;
+	uint8_t protocol;
 
 	/* The current transaction ID */
-	u_int8_t transaction_id;
+	uint8_t transaction_id;
 	
 	/* To whom we belong, unique identifier of remote MM entity */
 	struct gsm_subscriber *subscr;
@@ -24,7 +24,7 @@
 	struct gsm_subscriber_connection *conn;
 
 	/* reference from MNCC or other application */
-	u_int32_t callref;
+	uint32_t callref;
 
 	/* if traffic channel receive was requested */
 	int tch_recv;
@@ -45,7 +45,7 @@
 			struct gsm_mncc msg;	/* stores setup/disconnect/release message */
 		} cc;
 		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 */
 			enum gsm411_cp_state cp_state;
 			struct timer_list cp_timer;
@@ -60,16 +60,16 @@
 
 
 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,
-					u_int32_t callref);
+					uint32_t callref);
 
 struct gsm_trans *trans_alloc(struct gsm_subscriber *subscr,
-			      u_int8_t protocol, u_int8_t trans_id,
-			      u_int32_t callref);
+			      uint8_t protocol, uint8_t trans_id,
+			      uint32_t callref);
 void trans_free(struct gsm_trans *trans);
 
 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
diff --git a/openbsc/include/openbsc/trau_frame.h b/openbsc/include/openbsc/trau_frame.h
index c594c38..c15e24b 100644
--- a/openbsc/include/openbsc/trau_frame.h
+++ b/openbsc/include/openbsc/trau_frame.h
@@ -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 */
 #define MAX_C_BITS	25
@@ -34,11 +34,11 @@
 #define MAX_M_BITS	2
 
 struct decoded_trau_frame {
-	u_int8_t c_bits[MAX_C_BITS];
-	u_int8_t d_bits[MAX_D_BITS];
-	u_int8_t t_bits[MAX_T_BITS];
-	u_int8_t s_bits[MAX_S_BITS];
-	u_int8_t m_bits[MAX_M_BITS];
+	uint8_t c_bits[MAX_C_BITS];
+	uint8_t d_bits[MAX_D_BITS];
+	uint8_t t_bits[MAX_T_BITS];
+	uint8_t s_bits[MAX_S_BITS];
+	uint8_t m_bits[MAX_M_BITS];
 };
 
 #define TRAU_FT_FR_UP		0x02	/* 0 0 0 1 0 - 3.5.1.1.1 */
@@ -55,10 +55,10 @@
 #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 encode_trau_frame(u_int8_t *trau_bits, const struct decoded_trau_frame *fr);
+int decode_trau_frame(struct decoded_trau_frame *fr, const uint8_t *trau_bits);
+int encode_trau_frame(uint8_t *trau_bits, const 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 */
diff --git a/openbsc/include/openbsc/trau_mux.h b/openbsc/include/openbsc/trau_mux.h
index dcf33ee..0149cee 100644
--- a/openbsc/include/openbsc/trau_mux.h
+++ b/openbsc/include/openbsc/trau_mux.h
@@ -35,14 +35,14 @@
 			const struct gsm_lchan *dst);
 
 /* 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 */
 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 */
-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 */
 int trau_send_frame(struct gsm_lchan *lchan, struct gsm_data_frame *frame);
diff --git a/openbsc/src/gprs/crc24.c b/openbsc/src/gprs/crc24.c
index 4d65e6e..aa48dd3 100644
--- a/openbsc/src/gprs/crc24.c
+++ b/openbsc/src/gprs/crc24.c
@@ -23,7 +23,7 @@
 #include <openbsc/crc24.h>
 
 /* 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,
 	0x00340991, 0x00e2aee7, 0x00c24cc6, 0x0014ebb0, 0x00838884, 0x00552ff2, 0x0075cdd3, 0x00a36aa5,
 	0x00681322, 0x00beb454, 0x009e5675, 0x0048f103, 0x00df9237, 0x00093541, 0x0029d760, 0x00ff7016,
@@ -60,7 +60,7 @@
 
 #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--)
 		fcs = (fcs >> 8) ^ tbl_crc24[(fcs ^ *cp++) & 0xff];
diff --git a/openbsc/src/gprs/gb_proxy_main.c b/openbsc/src/gprs/gb_proxy_main.c
index bd18b2f..3e87f08 100644
--- a/openbsc/src/gprs/gb_proxy_main.c
+++ b/openbsc/src/gprs/gb_proxy_main.c
@@ -75,7 +75,7 @@
 
 /* call-back function for the NS protocol */
 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;
 
diff --git a/openbsc/src/gprs/sgsn_main.c b/openbsc/src/gprs/sgsn_main.c
index 8ec74cf..1967de7 100644
--- a/openbsc/src/gprs/sgsn_main.c
+++ b/openbsc/src/gprs/sgsn_main.c
@@ -81,7 +81,7 @@
 
 /* call-back function for the NS protocol */
 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;
 
diff --git a/openbsc/src/ipaccess/ipaccess-config.c b/openbsc/src/ipaccess/ipaccess-config.c
index 49a0531..65fe9f2 100644
--- a/openbsc/src/ipaccess/ipaccess-config.c
+++ b/openbsc/src/ipaccess/ipaccess-config.c
@@ -53,8 +53,8 @@
 static char *prim_oml_ip;
 static char *bts_ip_addr, *bts_ip_mask, *bts_ip_gw;
 static char *unit_id;
-static u_int16_t nv_flags;
-static u_int16_t nv_mask;
+static uint16_t nv_flags;
+static uint16_t nv_mask;
 static char *software = NULL;
 static int sw_load_state = 0;
 static int oml_state = 0;
@@ -64,11 +64,11 @@
 static int loop_tests = 0;
 
 struct sw_load {
-	u_int8_t file_id[255];
-	u_int8_t file_id_len;
+	uint8_t file_id[255];
+	uint8_t file_id_len;
 
-	u_int8_t file_version[255];
-	u_int8_t file_version_len;
+	uint8_t file_version[255];
+	uint8_t file_version_len;
 };
 
 static void *tall_ctx_config = NULL;
@@ -76,8 +76,8 @@
 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 u_int8_t unit_id_attr[] = { 0x91, 0x00, 9, '2', '3', '4', '2', '/' , '0', '/', '0', 0x00 };
+static uint8_t prim_oml_attr[] = { 0x95, 0x00, 7, 0x88, 192, 168, 100, 11, 0x00, 0x00 };
+static uint8_t unit_id_attr[] = { 0x91, 0x00, 9, '2', '3', '4', '2', '/' , '0', '/', '0', 0x00 };
 */
 
 /*
@@ -87,7 +87,7 @@
  * result. The nanoBTS will send us a NACK when we did something the
  * 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");
 	exit(-1);
@@ -103,7 +103,7 @@
 	}
 }
 
-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) {
 		fprintf(stderr, "The new software is activaed.\n");
@@ -182,7 +182,7 @@
 	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 abis_om_obj_inst *obj_inst);
 
@@ -495,7 +495,7 @@
 	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 abis_om_obj_inst *obj_inst)
 {
diff --git a/openbsc/src/ipaccess/ipaccess-find.c b/openbsc/src/ipaccess/ipaccess-find.c
index 987e35c..5a0058d 100644
--- a/openbsc/src/ipaccess/ipaccess-find.c
+++ b/openbsc/src/ipaccess/ipaccess-find.c
@@ -105,9 +105,9 @@
 
 static int parse_response(unsigned char *buf, int len)
 {
-	u_int8_t t_len;
-	u_int8_t t_tag;
-	u_int8_t *cur = buf;
+	uint8_t t_len;
+	uint8_t t_tag;
+	uint8_t *cur = buf;
 
 	while (cur < buf + len) {
 		t_len = *cur++;
diff --git a/openbsc/src/ipaccess/ipaccess-firmware.c b/openbsc/src/ipaccess/ipaccess-firmware.c
index 971db9d..a01e61b 100644
--- a/openbsc/src/ipaccess/ipaccess-firmware.c
+++ b/openbsc/src/ipaccess/ipaccess-firmware.c
@@ -41,8 +41,8 @@
 	struct sdp_header *header;
 	char buf[4096];
 	int rc, i;
-	u_int16_t table_size;
-	u_int16_t table_offset;
+	uint16_t table_size;
+	uint16_t table_offset;
 	off_t table_start;
 
 
diff --git a/openbsc/src/ipaccess/ipaccess-proxy.c b/openbsc/src/ipaccess/ipaccess-proxy.c
index 5254959..daa9094 100644
--- a/openbsc/src/ipaccess/ipaccess-proxy.c
+++ b/openbsc/src/ipaccess/ipaccess-proxy.c
@@ -82,8 +82,8 @@
 	struct ipa_proxy *ipp;
 	/* the unit ID as determined by CCM */
 	struct {
-		u_int16_t site_id;
-		u_int16_t bts_id;
+		uint16_t site_id;
+		uint16_t bts_id;
 	} unit_id;
 
 	/* incoming connections from BTS */
@@ -106,7 +106,7 @@
 	uint32_t gprs_orig_ip;
 
 	char *id_tags[0xff];
-	u_int8_t *id_resp;
+	uint8_t *id_resp;
 	unsigned int id_resp_len;
 };
 
@@ -131,8 +131,8 @@
 #define PROXY_ALLOC_SIZE	1200
 
 static struct ipa_bts_conn *find_bts_by_unitid(struct ipa_proxy *ipp,
-						u_int16_t site_id,
-						u_int16_t bts_id)
+						uint16_t site_id,
+						uint16_t bts_id)
 {
 	struct ipa_bts_conn *ipbc;
 
@@ -189,7 +189,7 @@
 #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,
-			   struct ipa_bts_conn *ipbc, u_int8_t trx_id)
+			   struct ipa_bts_conn *ipbc, uint8_t trx_id)
 {
 	if (ipbc)
 		logp2(ss, lvl, file, line, 0, "(%u/%u/%u) ", ipbc->unit_id.site_id,
@@ -312,12 +312,12 @@
 
 
 static int ipbc_alloc_connect(struct ipa_proxy_conn *ipc, struct bsc_fd *bfd,
-			      u_int16_t site_id, u_int16_t bts_id,
-			      u_int16_t trx_id, struct tlv_parsed *tlvp,
+			      uint16_t site_id, uint16_t bts_id,
+			      uint16_t trx_id, struct tlv_parsed *tlvp,
 			      struct msgb *msg)
 {
 	struct ipa_bts_conn *ipbc;
-	u_int16_t udp_port;
+	uint16_t udp_port;
 	int ret = 0;
 	struct sockaddr_in sin;
 
@@ -437,8 +437,8 @@
 			   struct bsc_fd *bfd)
 {
 	struct tlv_parsed tlvp;
-	u_int8_t msg_type = *(msg->l2h);
-	u_int16_t site_id, bts_id, trx_id;
+	uint8_t msg_type = *(msg->l2h);
+	uint16_t site_id, bts_id, trx_id;
 	struct ipa_bts_conn *ipbc;
 	int ret = 0;
 
@@ -452,7 +452,7 @@
 	case IPAC_MSGT_ID_RESP:
 		DEBUGP(DMI, "ID_RESP ");
 		/* 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);
 		DEBUGP(DMI, "\n");
 
@@ -749,16 +749,16 @@
 	    msg->l2h[2] == 0x00 && msg->l2h[3] == 0x15 &&
 	    msg->l2h[18] == 0xf5 && msg->l2h[19] == 0xf2) {
 		nsvci = &msg->l2h[23];
-		ipbc->gprs_orig_port =  *(u_int16_t *)(nsvci+8);
-		ipbc->gprs_orig_ip = *(u_int32_t *)(nsvci+10);
-		*(u_int16_t *)(nsvci+8) = htons(ipbc->gprs_local_port);
-		*(u_int32_t *)(nsvci+10) = ipbc->ipp->listen_addr.s_addr;
+		ipbc->gprs_orig_port =  *(uint16_t *)(nsvci+8);
+		ipbc->gprs_orig_ip = *(uint32_t *)(nsvci+10);
+		*(uint16_t *)(nsvci+8) = htons(ipbc->gprs_local_port);
+		*(uint32_t *)(nsvci+10) = ipbc->ipp->listen_addr.s_addr;
 	} else if (msg->l2h[0] == 0x10 && msg->l2h[1] == 0x80 &&
 	    msg->l2h[2] == 0x00 && msg->l2h[3] == 0x15 &&
 	    msg->l2h[18] == 0xf6 && msg->l2h[19] == 0xf2) {
 		nsvci = &msg->l2h[23];
-		*(u_int16_t *)(nsvci+8) = ipbc->gprs_orig_port;
-		*(u_int32_t *)(nsvci+10) = ipbc->gprs_orig_ip;
+		*(uint16_t *)(nsvci+8) = ipbc->gprs_orig_port;
+		*(uint32_t *)(nsvci+10) = ipbc->gprs_orig_ip;
 	}
 }
 
diff --git a/openbsc/src/libabis/e1_input.c b/openbsc/src/libabis/e1_input.c
index eea1abe..7444bc7 100644
--- a/openbsc/src/libabis/e1_input.c
+++ b/openbsc/src/libabis/e1_input.c
@@ -75,37 +75,37 @@
 #define PCAP_OUTPUT		1
 
 struct pcap_hdr {
-	u_int32_t magic_number;
-	u_int16_t version_major;
-	u_int16_t version_minor;
+	uint32_t magic_number;
+	uint16_t version_major;
+	uint16_t version_minor;
 	int32_t  thiszone;
-	u_int32_t sigfigs;
-	u_int32_t snaplen;
-	u_int32_t network;
+	uint32_t sigfigs;
+	uint32_t snaplen;
+	uint32_t network;
 } __attribute__((packed));
 
 struct pcaprec_hdr {
-	u_int32_t ts_sec;
-	u_int32_t ts_usec;
-	u_int32_t incl_len;
-	u_int32_t orig_len;
+	uint32_t ts_sec;
+	uint32_t ts_usec;
+	uint32_t incl_len;
+	uint32_t orig_len;
 } __attribute__((packed));
 
 struct fake_linux_lapd_header {
-        u_int16_t pkttype;
-	u_int16_t hatype;
-	u_int16_t halen;
-	u_int64_t addr;
+        uint16_t pkttype;
+	uint16_t hatype;
+	uint16_t halen;
+	uint64_t addr;
 	int16_t protocol;
 } __attribute__((packed));
 
 struct lapd_header {
-	u_int8_t ea1 : 1;
-	u_int8_t cr : 1;
-	u_int8_t sapi : 6;
-	u_int8_t ea2 : 1;
-	u_int8_t tei : 7;
-	u_int8_t control_foo; /* fake UM's ... */
+	uint8_t ea1 : 1;
+	uint8_t cr : 1;
+	uint8_t sapi : 6;
+	uint8_t ea2 : 1;
+	uint8_t tei : 7;
+	uint8_t control_foo; /* fake UM's ... */
 } __attribute__((packed));
 
 static_assert(offsetof(struct fake_linux_lapd_header, hatype) == 2,    hatype_offset);
@@ -207,7 +207,7 @@
 }
 
 /* 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)
 {
 	struct e1inp_ts *e1i_ts = _priv;
@@ -324,7 +324,7 @@
 	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;
 
@@ -336,7 +336,7 @@
 	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_line *line;
@@ -373,7 +373,7 @@
 }
 
 #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;
 	int i;
@@ -397,7 +397,7 @@
 }
 #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;
 
@@ -408,7 +408,7 @@
 	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);
 
@@ -421,7 +421,7 @@
 /* Signalling Link */
 
 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;
 
@@ -437,8 +437,8 @@
 
 struct e1inp_sign_link *
 e1inp_sign_link_create(struct e1inp_ts *ts, enum e1inp_sign_type type,
-			struct gsm_bts_trx *trx, u_int8_t tei,
-			u_int8_t sapi)
+			struct gsm_bts_trx *trx, uint8_t tei,
+			uint8_t sapi)
 {
 	struct e1inp_sign_link *link;
 
@@ -479,7 +479,7 @@
 
 /* the E1 driver tells us he has received something on a TS */
 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 gsm_bts *bts;
@@ -562,7 +562,7 @@
 }
 
 /* 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 input_signal_data isd;
diff --git a/openbsc/src/libabis/input/dahdi.c b/openbsc/src/libabis/input/dahdi.c
index 2754944..22c9655 100644
--- a/openbsc/src/libabis/input/dahdi.c
+++ b/openbsc/src/libabis/input/dahdi.c
@@ -231,14 +231,14 @@
 
 static int invertbits = 1;
 
-static u_int8_t flip_table[256];
+static uint8_t flip_table[256];
 
 static void init_flip_bits(void)
 {
         int i,k;
 
         for (i = 0 ; i < 256 ; i++) {
-                u_int8_t sample = 0 ;
+                uint8_t sample = 0 ;
                 for (k = 0; k<8; k++) {
                         if ( i & 1 << k ) sample |= 0x80 >>  k;
                 }
@@ -246,13 +246,13 @@
         }
 }
 
-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;
-        u_int8_t * start = buf;
+        uint8_t * start = buf;
 
         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;
@@ -265,7 +265,7 @@
 	struct e1inp_line *line = bfd->data;
 	unsigned int ts_nr = bfd->priv_nr;
 	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;
 	int ret;
 
diff --git a/openbsc/src/libabis/input/hsl.c b/openbsc/src/libabis/input/hsl.c
index 2b9ab1d..c53fd0f 100644
--- a/openbsc/src/libabis/input/hsl.c
+++ b/openbsc/src/libabis/input/hsl.c
@@ -298,7 +298,7 @@
 	struct e1inp_ts *e1i_ts = &line->ts[ts_nr-1];
 	struct e1inp_sign_link *sign_link;
 	struct msgb *msg;
-	u_int8_t proto;
+	uint8_t proto;
 	int ret;
 
 	bfd->when &= ~BSC_FD_WRITE;
diff --git a/openbsc/src/libabis/input/ipaccess.c b/openbsc/src/libabis/input/ipaccess.c
index cba03a0..f4f95f2 100644
--- a/openbsc/src/libabis/input/ipaccess.c
+++ b/openbsc/src/libabis/input/ipaccess.c
@@ -68,15 +68,15 @@
  *	- ID_REQUEST: first messages once OML has been established.
  *	- 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
 };
 
-const u_int8_t ipa_id_ack_msg[] = {
+const uint8_t ipa_id_ack_msg[] = {
         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,
         0x01, IPAC_IDTAG_UNIT,
         0x01, IPAC_IDTAG_MACADDR,
@@ -110,9 +110,9 @@
 
 int ipaccess_idtag_parse(struct tlv_parsed *dec, unsigned char *buf, int len)
 {
-	u_int8_t t_len;
-	u_int8_t t_tag;
-	u_int8_t *cur = buf;
+	uint8_t t_len;
+	uint8_t t_tag;
+	uint8_t *cur = buf;
 
 	memset(dec, 0, sizeof(*dec));
 
@@ -138,7 +138,7 @@
 }
 
 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;
 
@@ -155,8 +155,8 @@
 	return NULL;
 }
 
-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)
 {
 	unsigned long ul;
 	char *endptr;
@@ -225,7 +225,7 @@
 int ipaccess_rcvmsg_base(struct msgb *msg,
 			 struct bsc_fd *bfd)
 {
-	u_int8_t msg_type = *(msg->l2h);
+	uint8_t msg_type = *(msg->l2h);
 	int ret = 0;
 
 	switch (msg_type) {
@@ -247,8 +247,8 @@
 			   struct bsc_fd *bfd)
 {
 	struct tlv_parsed tlvp;
-	u_int8_t msg_type = *(msg->l2h);
-	u_int16_t site_id = 0, bts_id = 0, trx_id = 0;
+	uint8_t msg_type = *(msg->l2h);
+	uint16_t site_id = 0, bts_id = 0, trx_id = 0;
 	struct gsm_bts *bts;
 	char *unitid;
 	int len, ret;
@@ -260,7 +260,7 @@
 	case IPAC_MSGT_ID_RESP:
 		DEBUGP(DMI, "ID_RESP ");
 		/* 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);
 		DEBUGP(DMI, "\n");
 		if (ret < 0) {
@@ -596,7 +596,7 @@
 	struct e1inp_ts *e1i_ts = &line->ts[ts_nr-1];
 	struct e1inp_sign_link *sign_link;
 	struct msgb *msg;
-	u_int8_t proto;
+	uint8_t proto;
 	int ret;
 
 	bfd->when &= ~BSC_FD_WRITE;
diff --git a/openbsc/src/libabis/input/misdn.c b/openbsc/src/libabis/input/misdn.c
index e111c13..5928990 100644
--- a/openbsc/src/libabis/input/misdn.c
+++ b/openbsc/src/libabis/input/misdn.c
@@ -210,7 +210,7 @@
 	struct sockaddr_mISDN sa;
 	struct msgb *msg;
 	struct mISDNhead *hh;
-	u_int8_t *l2_data;
+	uint8_t *l2_data;
 	int ret;
 
 	bfd->when &= ~BSC_FD_WRITE;
@@ -260,7 +260,7 @@
 	unsigned int ts_nr = bfd->priv_nr;
 	struct e1inp_ts *e1i_ts = &line->ts[ts_nr-1];
 	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;
 	int ret;
 
diff --git a/openbsc/src/libbsc/abis_nm.c b/openbsc/src/libbsc/abis_nm.c
index 1d86ffa..408d56e 100644
--- a/openbsc/src/libbsc/abis_nm.c
+++ b/openbsc/src/libbsc/abis_nm.c
@@ -190,7 +190,7 @@
 	{ 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);
 }
@@ -205,7 +205,7 @@
 	{ 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);
 }
@@ -221,7 +221,7 @@
 	{ 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);
 }
@@ -343,7 +343,7 @@
 	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)
 		return -EIO;
@@ -379,7 +379,7 @@
 #define MT_ACK(x)	(x+1)
 #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->placement = ABIS_OM_PLACEMENT_ONLY;
@@ -387,9 +387,9 @@
 	oh->length = len;
 }
 
-static void fill_om_fom_hdr(struct abis_om_hdr *oh, u_int8_t len,
-			    u_int8_t msg_type, u_int8_t obj_class,
-			    u_int8_t bts_nr, u_int8_t trx_nr, u_int8_t ts_nr)
+static void fill_om_fom_hdr(struct abis_om_hdr *oh, uint8_t len,
+			    uint8_t msg_type, uint8_t obj_class,
+			    uint8_t bts_nr, uint8_t trx_nr, uint8_t ts_nr)
 {
 	struct abis_om_fom_hdr *foh =
 			(struct abis_om_fom_hdr *) oh->data;
@@ -459,12 +459,12 @@
 	{ 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);
 }
 
-const char *nm_opstate_name(u_int8_t os)
+const char *nm_opstate_name(uint8_t os)
 {
 	switch (os) {
 	case NM_OPSTATE_DISABLED:
@@ -492,7 +492,7 @@
 	{ 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);
 }
@@ -517,7 +517,7 @@
 	{ 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);
 }
@@ -539,7 +539,7 @@
 
 /* obtain the gsm_nm_state data structure for a given object instance */
 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 gsm_bts_trx *trx;
@@ -623,7 +623,7 @@
 
 /* obtain the in-memory data structure of a given object instance */
 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 gsm_bts_trx *trx;
@@ -679,8 +679,8 @@
 
 /* Update the administrative state of a given object in our in-memory data
  * structures and send an event to the higher layer */
-static int update_admstate(struct gsm_bts *bts, u_int8_t obj_class,
-			   struct abis_om_obj_inst *obj_inst, u_int8_t adm_state)
+static int update_admstate(struct gsm_bts *bts, uint8_t obj_class,
+			   struct abis_om_obj_inst *obj_inst, uint8_t adm_state)
 {
 	struct gsm_nm_state *nm_state, new_state;
 	struct nm_statechg_signal_data nsd;
@@ -816,7 +816,7 @@
 static int abis_nm_rcvmsg_report(struct msgb *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);
 
@@ -848,13 +848,13 @@
 }
 
 /* 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,
-			     u_int8_t i2, const u_int8_t *sw_desc, u_int8_t swdesc_len)
+static int ipacc_sw_activate(struct gsm_bts *bts, uint8_t obj_class, uint8_t i0, uint8_t i1,
+			     uint8_t i2, const uint8_t *sw_desc, uint8_t swdesc_len)
 {
 	struct abis_om_hdr *oh;
 	struct msgb *msg = nm_msgb_alloc();
-	u_int8_t len = swdesc_len;
-	u_int8_t *trailer;
+	uint8_t len = swdesc_len;
+	uint8_t *trailer;
 
 	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);
@@ -865,7 +865,7 @@
 	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 = {
 		.def = {
@@ -874,9 +874,9 @@
 		},
 	};
 
-	u_int8_t tag;
-	u_int16_t tag_len;
-	const u_int8_t *val;
+	uint8_t tag;
+	uint16_t tag_len;
+	const uint8_t *val;
 	int ofs = 0, len;
 
 	/* Classic TLV parsing doesn't work well with SW_DESCR because of it's
@@ -913,7 +913,7 @@
 	struct abis_om_hdr *oh = msgb_l2(mb);
 	struct abis_om_fom_hdr *foh = msgb_l3(mb);
 	struct tlv_parsed tp;
-	const u_int8_t *sw_config;
+	const uint8_t *sw_config;
 	int ret, sw_config_len, sw_descr_len;
 
 	debugp_foh(foh);
@@ -956,7 +956,7 @@
 	struct abis_om_hdr *oh = msgb_l2(mb);
 	struct abis_om_fom_hdr *foh = msgb_l3(mb);
 	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));
 	if (!TLVP_PRESENT(&tp, NM_ATT_ADM_STATE))
@@ -977,12 +977,12 @@
 	abis_nm_tlv_parse(&tp, mb->trx->bts, foh->data, oh->length-sizeof(*foh));
 	if (TLVP_PRESENT(&tp, NM_ATT_BS11_LMT_LOGON_SESSION) &&
 	    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");
 	}
 	if (TLVP_PRESENT(&tp, NM_ATT_BS11_LMT_USER_ACC_LEV) &&
 	    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);
 	}
 	if (TLVP_PRESENT(&tp, NM_ATT_BS11_LMT_USER_NAME) &&
@@ -1017,7 +1017,7 @@
 {
 	struct abis_om_hdr *oh = msgb_l2(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;
 
 	/* check for unsolicited message */
@@ -1138,7 +1138,7 @@
 		return -EINVAL;
 	}
 #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);
 	if (oh->length + hlen > l2_len) {
 		LOGP(DNM, LOGL_ERROR, "ABIS OML truncated message (%u > %u)\n",
@@ -1219,17 +1219,17 @@
 	int forced;
 
 	/* this will become part of the SW LOAD INITIATE */
-	u_int8_t obj_class;
-	u_int8_t obj_instance[3];
+	uint8_t obj_class;
+	uint8_t obj_instance[3];
 
-	u_int8_t file_id[255];
-	u_int8_t file_id_len;
+	uint8_t file_id[255];
+	uint8_t file_id_len;
 
-	u_int8_t file_version[255];
-	u_int8_t file_version_len;
+	uint8_t file_version[255];
+	uint8_t file_version_len;
 
-	u_int8_t window_size;
-	u_int8_t seg_in_window;
+	uint8_t window_size;
+	uint8_t seg_in_window;
 
 	int fd;
 	FILE *stream;
@@ -1260,7 +1260,7 @@
 {
 	struct abis_om_hdr *oh;
 	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);
 	fill_om_fom_hdr(oh, len, NM_MT_LOAD_INIT, sw->obj_class,
@@ -1297,7 +1297,7 @@
 	char seg_buf[256];
 	char *line_buf = seg_buf+2;
 	unsigned char *tlv;
-	u_int8_t len;
+	uint8_t len;
 
 	oh = (struct abis_om_hdr *) msgb_put(msg, ABIS_OM_FOM_HDR_SIZE);
 
@@ -1318,7 +1318,7 @@
 
 		len = strlen(line_buf) + 2;
 		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 !?! */
 		tlv[1] -= 2;
 
@@ -1337,7 +1337,7 @@
 			sw->last_seg = 1;
 
 		++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;
 		break;
 	}
@@ -1359,7 +1359,7 @@
 {
 	struct abis_om_hdr *oh;
 	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);
 	fill_om_fom_hdr(oh, len, NM_MT_LOAD_END, sw->obj_class,
@@ -1375,7 +1375,7 @@
 {
 	struct abis_om_hdr *oh;
 	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);
 	fill_om_fom_hdr(oh, len, NM_MT_ACTIVATE_SW, sw->obj_class,
@@ -1675,7 +1675,7 @@
 
 /* Load the specified software into the BTS */
 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)
 {
 	struct abis_nm_sw *sw = &g_sw;
@@ -1776,8 +1776,8 @@
 	return sw_activate(sw);
 }
 
-static void fill_nm_channel(struct abis_nm_channel *ch, u_int8_t bts_port,
-		       u_int8_t ts_nr, u_int8_t subslot_nr)
+static void fill_nm_channel(struct abis_nm_channel *ch, uint8_t bts_port,
+		       uint8_t ts_nr, uint8_t subslot_nr)
 {
 	ch->attrib = NM_ATT_ABIS_CHANNEL;
 	ch->bts_port = bts_port;
@@ -1785,13 +1785,13 @@
 	ch->subslot = subslot_nr;	
 }
 
-int abis_nm_establish_tei(struct gsm_bts *bts, u_int8_t trx_nr,
-			  u_int8_t e1_port, u_int8_t e1_timeslot, u_int8_t e1_subslot,
-			  u_int8_t tei)
+int abis_nm_establish_tei(struct gsm_bts *bts, uint8_t trx_nr,
+			  uint8_t e1_port, uint8_t e1_timeslot, uint8_t e1_subslot,
+			  uint8_t tei)
 {
 	struct abis_om_hdr *oh;
 	struct abis_nm_channel *ch;
-	u_int8_t len = sizeof(*ch) + 2;
+	uint8_t len = sizeof(*ch) + 2;
 	struct msgb *msg = nm_msgb_alloc();
 
 	oh = (struct abis_om_hdr *) msgb_put(msg, ABIS_OM_FOM_HDR_SIZE);
@@ -1808,7 +1808,7 @@
 
 /* connect signalling of one (BTS,TRX) to a particular timeslot on the E1 */
 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 abis_om_hdr *oh;
@@ -1833,8 +1833,8 @@
 #endif
 
 int abis_nm_conn_terr_traf(struct gsm_bts_trx_ts *ts,
-			   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 = ts->trx->bts;
 	struct abis_om_hdr *oh;
@@ -1858,17 +1858,17 @@
 #if 0
 int abis_nm_disc_terr_traf(struct abis_nm_h *h, struct abis_om_obj_inst *inst,
 			   struct abis_nm_abis_channel *chan,
-			   u_int8_t subchan)
+			   uint8_t subchan)
 {
 }
 #endif
 
 /* 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 msgb *msg = nm_msgb_alloc();
-	u_int8_t *cur;
+	uint8_t *cur;
 
 	DEBUGP(DNM, "Set BTS Attr (bts=%d)\n", bts->nr);
 
@@ -1881,11 +1881,11 @@
 }
 
 /* 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 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);
 
@@ -1898,7 +1898,7 @@
 	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;
 
@@ -2033,13 +2033,13 @@
 }
 
 /* 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 abis_om_hdr *oh;
-	u_int8_t zero = 0x00;
+	uint8_t zero = 0x00;
 	struct msgb *msg = nm_msgb_alloc();
-	u_int8_t len = 2 + 2;
+	uint8_t len = 2 + 2;
 
 	if (bts->type == GSM_BTS_TYPE_BS11)
 		len += 4 + 2 + 2 + 3;
@@ -2086,13 +2086,13 @@
 	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,
-			u_int8_t i2, u_int8_t i3, int nack, u_int8_t *attr, int att_len)
+int abis_nm_sw_act_req_ack(struct gsm_bts *bts, uint8_t obj_class, uint8_t i1,
+			uint8_t i2, uint8_t i3, int nack, uint8_t *attr, int att_len)
 {
 	struct abis_om_hdr *oh;
 	struct msgb *msg = nm_msgb_alloc();
-	u_int8_t msgtype = NM_MT_SW_ACT_REQ_ACK;
-	u_int8_t len = att_len;
+	uint8_t msgtype = NM_MT_SW_ACT_REQ_ACK;
+	uint8_t len = att_len;
 
 	if (nack) {
 		len += 2;
@@ -2103,7 +2103,7 @@
 	fill_om_fom_hdr(oh, att_len, msgtype, obj_class, i1, i2, i3);
 
 	if (attr) {
-		u_int8_t *ptr = msgb_put(msg, att_len);
+		uint8_t *ptr = msgb_put(msg, att_len);
 		memcpy(ptr, attr, att_len);
 	}
 	if (nack)
@@ -2112,11 +2112,11 @@
 	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 abis_om_hdr *oh;
-	u_int8_t *data;
+	uint8_t *data;
 
 	oh = (struct abis_om_hdr *) msgb_put(msg, sizeof(*oh));
 	fill_om_hdr(oh, len);
@@ -2127,7 +2127,7 @@
 }
 
 /* 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 msgb *msg = nm_msgb_alloc();
@@ -2140,7 +2140,7 @@
 }
 
 /* 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 msgb *msg = nm_msgb_alloc();
@@ -2155,8 +2155,8 @@
 }
 
 /* Chapter 8.8.5 */
-int abis_nm_chg_adm_state(struct gsm_bts *bts, u_int8_t obj_class, u_int8_t i0,
-			  u_int8_t i1, u_int8_t i2, enum abis_nm_adm_state adm_state)
+int abis_nm_chg_adm_state(struct gsm_bts *bts, uint8_t obj_class, uint8_t i0,
+			  uint8_t i1, uint8_t i2, enum abis_nm_adm_state adm_state)
 {
 	struct abis_om_hdr *oh;
 	struct msgb *msg = nm_msgb_alloc();
@@ -2168,12 +2168,12 @@
 	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,
-			    u_int8_t e1_port1, u_int8_t ts1)
+int abis_nm_conn_mdrop_link(struct gsm_bts *bts, uint8_t e1_port0, uint8_t ts0,
+			    uint8_t e1_port1, uint8_t ts1)
 {
 	struct abis_om_hdr *oh;
 	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",
 		e1_port0, ts0, e1_port1, ts1);
@@ -2196,9 +2196,9 @@
 }
 
 /* Chapter 8.7.1 */
-int abis_nm_perform_test(struct gsm_bts *bts, u_int8_t obj_class,
-			 u_int8_t bts_nr, u_int8_t trx_nr, u_int8_t ts_nr,
-			 u_int8_t test_nr, u_int8_t auton_report, struct msgb *msg)
+int abis_nm_perform_test(struct gsm_bts *bts, uint8_t obj_class,
+			 uint8_t bts_nr, uint8_t trx_nr, uint8_t ts_nr,
+			 uint8_t test_nr, uint8_t auton_report, struct msgb *msg)
 {
 	struct abis_om_hdr *oh;
 
@@ -2241,12 +2241,12 @@
 
 
 struct bs11_date_time {
-	u_int16_t	year;
-	u_int8_t	month;
-	u_int8_t	day;
-	u_int8_t	hour;
-	u_int8_t	min;
-	u_int8_t	sec;
+	uint16_t	year;
+	uint8_t	month;
+	uint8_t	day;
+	uint8_t	hour;
+	uint8_t	min;
+	uint8_t	sec;
 } __attribute__((packed));
 
 
@@ -2279,12 +2279,12 @@
 }
 
 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)
+				enum abis_bs11_objtype type, uint8_t idx,
+				uint8_t attr_len, const uint8_t *attr)
 {
 	struct abis_om_hdr *oh;
 	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);
 	fill_om_fom_hdr(oh, attr_len, NM_MT_BS11_CREATE_OBJ,
@@ -2296,7 +2296,7 @@
 }
 
 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 msgb *msg = nm_msgb_alloc();
@@ -2308,11 +2308,11 @@
 	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 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);
 	fill_om_fom_hdr(oh, 3, NM_MT_BS11_CREATE_OBJ,
@@ -2322,7 +2322,7 @@
 	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 msgb *msg = nm_msgb_alloc();
@@ -2334,7 +2334,7 @@
 	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 msgb *msg = nm_msgb_alloc();
@@ -2346,7 +2346,7 @@
 	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)
 {
 	struct abis_om_hdr *oh;
@@ -2361,9 +2361,9 @@
 }
 
 /* like abis_nm_conn_terr_traf + set_tei */
-int abis_nm_bs11_conn_oml_tei(struct gsm_bts *bts, u_int8_t e1_port,
-			  u_int8_t e1_timeslot, u_int8_t e1_subslot,
-			  u_int8_t tei)
+int abis_nm_bs11_conn_oml_tei(struct gsm_bts *bts, uint8_t e1_port,
+			  uint8_t e1_timeslot, uint8_t e1_subslot,
+			  uint8_t tei)
 {
 	struct abis_om_hdr *oh;
 	struct abis_nm_channel *ch;
@@ -2380,7 +2380,7 @@
 	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 msgb *msg = nm_msgb_alloc();
@@ -2397,7 +2397,7 @@
 {
 	struct abis_om_hdr *oh;
 	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);
 	fill_om_fom_hdr(oh, 2+sizeof(attr), NM_MT_GET_ATTR,
@@ -2411,7 +2411,7 @@
 {
 	struct abis_om_hdr *oh;
 	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);
 	fill_om_fom_hdr(oh, 2+sizeof(attr), NM_MT_GET_ATTR,
@@ -2425,7 +2425,7 @@
 {
 	struct abis_om_hdr *oh;
 	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 };
 
 	oh = (struct abis_om_hdr *) msgb_put(msg, ABIS_OM_FOM_HDR_SIZE);
@@ -2437,7 +2437,7 @@
 
 }
 
-//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)
 {
@@ -2449,7 +2449,7 @@
 	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 msgb *msg = nm_msgb_alloc();
@@ -2459,16 +2459,16 @@
 
 	oh = (struct abis_om_hdr *) msgb_put(msg, ABIS_OM_FOM_HDR_SIZE);
 	if (on) {
-		u_int8_t len = 3*2 + sizeof(bdt)
+		uint8_t len = 3*2 + sizeof(bdt)
 				+ 1 + strlen(name);
 		fill_om_fom_hdr(oh, len, NM_MT_BS11_LMT_LOGON,
 				NM_OC_BS11_BTSE, 0xff, 0xff, 0xff);
 		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,
 			     1, &level);
 		msgb_tlv_put(msg, NM_ATT_BS11_LMT_USER_NAME,
-			     strlen(name), (u_int8_t *)name);
+			     strlen(name), (uint8_t *)name);
 	} else {
 		fill_om_fom_hdr(oh, 0, NM_MT_BS11_LMT_LOGOFF,
 				NM_OC_BS11_BTSE, 0xff, 0xff, 0xff);
@@ -2489,7 +2489,7 @@
 	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,
 			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);
 }
@@ -2499,7 +2499,7 @@
 {
 	struct abis_om_hdr *oh;
 	struct msgb *msg;
-	u_int8_t tlv_value;
+	uint8_t tlv_value;
 	
 	msg = nm_msgb_alloc();
 	oh = (struct abis_om_hdr *) msgb_put(msg, ABIS_OM_FOM_HDR_SIZE);
@@ -2522,7 +2522,7 @@
 {
 	struct abis_om_hdr *oh;
 	struct msgb *msg;
-	u_int8_t tlv_value[2];
+	uint8_t tlv_value[2];
 
 	msg = nm_msgb_alloc();
 	oh = (struct abis_om_hdr *) msgb_put(msg, ABIS_OM_FOM_HDR_SIZE);
@@ -2549,7 +2549,7 @@
 struct abis_nm_bs11_sw {
 	struct gsm_bts *bts;
 	char swl_fname[PATH_MAX];
-	u_int8_t win_size;
+	uint8_t win_size;
 	int forced;
 	struct llist_head file_list;
 	gsm_cbfn *user_cb;	/* specified by the user */
@@ -2675,7 +2675,7 @@
  * 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 */
 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 file_list_entry *fle;
@@ -2705,7 +2705,7 @@
 }
 
 #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_BS11_LMT_LOGIN_TIME, NM_ATT_BS11_LMT_USER_ACC_LEV,
 	NM_ATT_BS11_LMT_USER_NAME,
@@ -2716,14 +2716,14 @@
 
 	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_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_SW_DESCR, NM_ATT_GET_ARI };
 #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,
 	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 };
@@ -2753,16 +2753,16 @@
 	/* SiemensHW CCTRL object */
 	fill_om_fom_hdr(oh, 2+sizeof(aet), NM_MT_BS11_SET_ATTR, NM_OC_SITE_MANAGER,
 			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);
 }
 
-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 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);
 	fill_om_fom_hdr(oh, 2+sizeof(attr), NM_MT_GET_ATTR,
@@ -2772,7 +2772,7 @@
 	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 msgb *msg = nm_msgb_alloc();
@@ -2796,7 +2796,7 @@
 	struct in_addr addr;
 	struct abis_om_hdr *oh = msgb_l2(msg);
 	struct abis_om_fom_hdr *foh;
-	u_int8_t idstrlen = oh->data[0];
+	uint8_t idstrlen = oh->data[0];
 	struct tlv_parsed tp;
 	struct ipacc_ack_signal_data signal;
 
@@ -2823,7 +2823,7 @@
 		}
 		if (TLVP_PRESENT(&tp, NM_ATT_IPACC_DST_IP_PORT))
 			DEBUGPC(DNM, "PORT=%u ",
-				ntohs(*((u_int16_t *)
+				ntohs(*((uint16_t *)
 					TLVP_VAL(&tp, NM_ATT_IPACC_DST_IP_PORT))));
 		if (TLVP_PRESENT(&tp, NM_ATT_IPACC_STREAM_ID))
 			DEBUGPC(DNM, "STREAM=0x%02x ",
@@ -2900,15 +2900,15 @@
 }
 
 /* send an ip-access manufacturer specific message */
-int abis_nm_ipaccess_msg(struct gsm_bts *bts, u_int8_t msg_type,
-			 u_int8_t obj_class, u_int8_t bts_nr,
-			 u_int8_t trx_nr, u_int8_t ts_nr,
-			 u_int8_t *attr, int attr_len)
+int abis_nm_ipaccess_msg(struct gsm_bts *bts, uint8_t msg_type,
+			 uint8_t obj_class, uint8_t bts_nr,
+			 uint8_t trx_nr, uint8_t ts_nr,
+			 uint8_t *attr, int attr_len)
 {
 	struct msgb *msg = nm_msgb_alloc();
 	struct abis_om_hdr *oh;
 	struct abis_om_fom_hdr *foh;
-	u_int8_t *data;
+	uint8_t *data;
 
 	/* construct the 12.21 OM header, observe the erroneous length */
 	oh = (struct abis_om_hdr *) msgb_put(msg, sizeof(*oh));
@@ -2937,7 +2937,7 @@
 }
 
 /* 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)
 {
 	return abis_nm_ipaccess_msg(trx->bts, NM_MT_IPACC_SET_NVATTR,
@@ -2946,10 +2946,10 @@
 }
 
 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;
-	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, 0, 0, 0, 0 };
 
@@ -2959,7 +2959,7 @@
 	attr[1] = stream;
 	attr[3] = port >> 8;
 	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)
@@ -2986,21 +2986,21 @@
 	return abis_nm_sendmsg(trx->bts, msg);
 }
 
-int abis_nm_ipaccess_set_attr(struct gsm_bts *bts, u_int8_t obj_class,
-				u_int8_t bts_nr, u_int8_t trx_nr, u_int8_t ts_nr,
-				u_int8_t *attr, u_int8_t attr_len)
+int abis_nm_ipaccess_set_attr(struct gsm_bts *bts, uint8_t obj_class,
+				uint8_t bts_nr, uint8_t trx_nr, uint8_t ts_nr,
+				uint8_t *attr, uint8_t attr_len)
 {
 	return abis_nm_ipaccess_msg(bts, NM_MT_IPACC_SET_ATTR,
 				    obj_class, bts_nr, trx_nr, ts_nr,
 				     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
 	 * with the Cell ID */
 	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)
@@ -3025,12 +3025,12 @@
 	{ 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);
 }
 
-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] >> 4) *  10;
@@ -3045,15 +3045,15 @@
 		cid->mnc += (buf[1] >> 4) *   1;
 	}
 
-	cid->lac = ntohs(*((u_int16_t *)&buf[3]));
-	cid->ci = ntohs(*((u_int16_t *)&buf[5]));
+	cid->lac = ntohs(*((uint16_t *)&buf[3]));
+	cid->ci = ntohs(*((uint16_t *)&buf[5]));
 }
 
 /* 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;
-	u_int16_t len;
+	uint8_t *cur = buf;
+	uint16_t len;
 
 	memset(binf, 0, sizeof(*binf));
 
@@ -3061,10 +3061,10 @@
 		return -EINVAL;
 	cur++;
 
-	len = ntohs(*(u_int16_t *)cur);
+	len = ntohs(*(uint16_t *)cur);
 	cur += 2;
 
-	binf->info_type = ntohs(*(u_int16_t *)cur);
+	binf->info_type = ntohs(*(uint16_t *)cur);
 	cur += 2;
 
 	if (binf->info_type & IPAC_BINF_FREQ_ERR_QUAL)
@@ -3082,15 +3082,15 @@
 	cur++;
 
 	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;
 
 	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;
 
 	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;
 
 #if 0
diff --git a/openbsc/src/libbsc/abis_nm_ipaccess.c b/openbsc/src/libbsc/abis_nm_ipaccess.c
index 754efe2..b822538 100644
--- a/openbsc/src/libbsc/abis_nm_ipaccess.c
+++ b/openbsc/src/libbsc/abis_nm_ipaccess.c
@@ -63,12 +63,12 @@
 };
 
 /* append an ip.access channel list to the given msgb */
-static int ipa_chan_list_append(struct msgb *msg, u_int8_t ie,
-				u_int16_t *arfcns, int arfcn_count)
+static int ipa_chan_list_append(struct msgb *msg, uint8_t ie,
+				uint16_t *arfcns, int arfcn_count)
 {
 	int i;
-	u_int8_t *u8;
-	u_int16_t *u16;
+	uint8_t *u8;
+	uint16_t *u16;
 
 	/* tag */
 	u8 = msgb_push(msg, 1);
diff --git a/openbsc/src/libbsc/abis_om2000.c b/openbsc/src/libbsc/abis_om2000.c
index c1aef9f..7743cd8 100644
--- a/openbsc/src/libbsc/abis_om2000.c
+++ b/openbsc/src/libbsc/abis_om2000.c
@@ -631,7 +631,7 @@
 				   "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);
 }
diff --git a/openbsc/src/libbsc/abis_rsl.c b/openbsc/src/libbsc/abis_rsl.c
index 8cac832..70a4e99 100644
--- a/openbsc/src/libbsc/abis_rsl.c
+++ b/openbsc/src/libbsc/abis_rsl.c
@@ -59,7 +59,7 @@
 	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 ? */
 	msg_type &= 0xfe;
@@ -79,7 +79,7 @@
 }
 
 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_type = msg_type;
@@ -87,12 +87,12 @@
 }
 
 /* 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;
-	u_int8_t ts_nr = chan_nr & 0x07;
-	u_int8_t cbits = chan_nr >> 3;
-	u_int8_t lch_idx;
+	uint8_t ts_nr = chan_nr & 0x07;
+	uint8_t cbits = chan_nr >> 3;
+	uint8_t lch_idx;
 	struct gsm_bts_trx_ts *ts = &trx->ts[ts_nr];
 
 	if (cbits == 0x01) {
@@ -138,9 +138,9 @@
 }
 
 /* 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) {
 	case GSM_PCHAN_TCH_F:
@@ -171,15 +171,15 @@
 	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);
 }
 
 /* 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);
 
@@ -196,14 +196,14 @@
 }
 
 /* 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)
 {
 	return (imsi % 1000) % (bs_cc_chans * n_pag_blocks) / n_pag_blocks;
 }
 
 /* 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)
 {
 	return (imsi % 1000) % (bs_cc_chans * n_pag_blocks) % n_pag_blocks;
@@ -216,7 +216,7 @@
 }
 
 #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);
 
@@ -225,7 +225,7 @@
 }
 
 /* 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;
 	if (lchan->encr.key_len)
@@ -233,7 +233,7 @@
 	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;
 
@@ -244,8 +244,8 @@
 }
 
 /* Send a BCCH_INFO message as per Chapter 8.5.1 */
-int rsl_bcch_info(struct gsm_bts_trx *trx, u_int8_t type,
-		  const u_int8_t *data, int len)
+int rsl_bcch_info(struct gsm_bts_trx *trx, uint8_t type,
+		  const uint8_t *data, int len)
 {
 	struct abis_rsl_dchan_hdr *dh;
 	struct msgb *msg = rsl_msgb_alloc();
@@ -262,8 +262,8 @@
 	return abis_rsl_sendmsg(msg);
 }
 
-int rsl_sacch_filling(struct gsm_bts_trx *trx, u_int8_t type,
-		      const u_int8_t *data, int len)
+int rsl_sacch_filling(struct gsm_bts_trx *trx, uint8_t type,
+		      const uint8_t *data, int len)
 {
 	struct abis_rsl_common_hdr *ch;
 	struct msgb *msg = rsl_msgb_alloc();
@@ -280,12 +280,12 @@
 	return abis_rsl_sendmsg(msg);
 }
 
-int rsl_sacch_info_modify(struct gsm_lchan *lchan, u_int8_t type,
-			  const u_int8_t *data, int len)
+int rsl_sacch_info_modify(struct gsm_lchan *lchan, uint8_t type,
+			  const uint8_t *data, int len)
 {
 	struct abis_rsl_dchan_hdr *dh;
 	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));
 	init_dchan_hdr(dh, RSL_MT_SACCH_INFO_MODIFY);
@@ -303,7 +303,7 @@
 {
 	struct abis_rsl_dchan_hdr *dh;
 	struct msgb *msg;
-	u_int8_t chan_nr = lchan2chan_nr(lchan);
+	uint8_t chan_nr = lchan2chan_nr(lchan);
 
 	db = abs(db);
 	if (db > 30)
@@ -330,7 +330,7 @@
 {
 	struct abis_rsl_dchan_hdr *dh;
 	struct msgb *msg;
-	u_int8_t chan_nr = lchan2chan_nr(lchan);
+	uint8_t chan_nr = lchan2chan_nr(lchan);
 	int ctl_lvl;
 
 	ctl_lvl = ms_pwr_ctl_lvl(lchan->ts->trx->bts->band, dbm);
@@ -421,12 +421,12 @@
 
 /* Chapter 8.4.1 */
 #if 0
-int rsl_chan_activate(struct gsm_bts_trx *trx, u_int8_t chan_nr,
-		      u_int8_t act_type,
+int rsl_chan_activate(struct gsm_bts_trx *trx, uint8_t chan_nr,
+		      uint8_t act_type,
 		      struct rsl_ie_chan_mode *chan_mode,
 		      struct rsl_ie_chan_ident *chan_ident,
-		      u_int8_t bs_power, u_int8_t ms_power,
-		      u_int8_t ta)
+		      uint8_t bs_power, uint8_t ms_power,
+		      uint8_t ta)
 {
 	struct abis_rsl_dchan_hdr *dh;
 	struct msgb *msg = rsl_msgb_alloc();
@@ -438,12 +438,12 @@
 	msgb_tv_put(msg, RSL_IE_ACT_TYPE, act_type);
 	/* For compatibility with Phase 1 */
 	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,
-		     (u_int8_t *) chan_ident);
+		     (uint8_t *) chan_ident);
 #if 0
 	msgb_tlv_put(msg, RSL_IE_ENCR_INFO, 1,
-		     (u_int8_t *) &encr_info);
+		     (uint8_t *) &encr_info);
 #endif
 	msgb_tv_put(msg, RSL_IE_BS_POWER, bs_power);
 	msgb_tv_put(msg, RSL_IE_MS_POWER, ms_power);
@@ -455,15 +455,15 @@
 }
 #endif
 
-int rsl_chan_activate_lchan(struct gsm_lchan *lchan, u_int8_t act_type,
-			    u_int8_t ta, u_int8_t ho_ref)
+int rsl_chan_activate_lchan(struct gsm_lchan *lchan, uint8_t act_type,
+			    uint8_t ta, uint8_t ho_ref)
 {
 	struct abis_rsl_dchan_hdr *dh;
 	struct msgb *msg;
 	int rc;
 	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 gsm48_chan_desc cd;
 
@@ -481,7 +481,7 @@
 
 	msgb_tv_put(msg, RSL_IE_ACT_TYPE, act_type);
 	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
@@ -505,7 +505,7 @@
 	*len = msgb_l3len(msg);
 
 	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);
 		if (rc > 0)
 			msgb_tlv_put(msg, RSL_IE_ENCR_INFO, rc, encr_info);
@@ -526,7 +526,7 @@
 
 	if (lchan->tch_mode == GSM48_CMODE_SPEECH_AMR)
 		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;
 
@@ -540,7 +540,7 @@
 	struct msgb *msg;
 	int rc;
 
-	u_int8_t chan_nr = lchan2chan_nr(lchan);
+	uint8_t chan_nr = lchan2chan_nr(lchan);
 	struct rsl_ie_chan_mode cm;
 
 	rc = channel_mode_from_lchan(&cm, lchan);
@@ -553,10 +553,10 @@
 	dh->chan_nr = chan_nr;
 
 	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)) {
-		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);
 		if (rc > 0)
 			msgb_tlv_put(msg, RSL_IE_ENCR_INFO, rc, encr_info);
@@ -564,7 +564,7 @@
 
 	if (lchan->tch_mode == GSM48_CMODE_SPEECH_AMR) {
 		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;
@@ -577,9 +577,9 @@
 {
 	struct abis_rsl_dchan_hdr *dh;
 	struct gsm_lchan *lchan = msg->lchan;
-	u_int8_t chan_nr = lchan2chan_nr(lchan);
-	u_int8_t encr_info[MAX_A5_KEY_LEN+2];
-	u_int8_t l3_len = msg->len;
+	uint8_t chan_nr = lchan2chan_nr(lchan);
+	uint8_t encr_info[MAX_A5_KEY_LEN+2];
+	uint8_t l3_len = msg->len;
 	int rc;
 
 	/* First push the L3 IE tag and length */
@@ -704,8 +704,8 @@
 	return 0;
 }
 
-int rsl_paging_cmd(struct gsm_bts *bts, u_int8_t paging_group, u_int8_t len,
-		   u_int8_t *ms_ident, u_int8_t chan_needed)
+int rsl_paging_cmd(struct gsm_bts *bts, uint8_t paging_group, uint8_t len,
+		   uint8_t *ms_ident, uint8_t chan_needed)
 {
 	struct abis_rsl_dchan_hdr *dh;
 	struct msgb *msg = rsl_msgb_alloc();
@@ -723,7 +723,7 @@
 	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);
 
@@ -741,11 +741,11 @@
 }
 
 /* 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 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));
 	init_dchan_hdr(dh, RSL_MT_IMMEDIATE_ASSIGN_CMD);
@@ -777,10 +777,10 @@
 	init_dchan_hdr(dh, RSL_MT_SIEMENS_MRPCI);
 	dh->c.msg_discr = ABIS_RSL_MDISC_DED_CHAN;
 	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",
-		gsm_lchan_name(lchan), *(u_int8_t *)mrpci);
+		gsm_lchan_name(lchan), *(uint8_t *)mrpci);
 
 	msg->trx = lchan->ts->trx;
 
@@ -790,7 +790,7 @@
 
 /* Send "DATA REQUEST" message with given L3 Info payload */
 /* 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) {
 		LOGP(DRSL, LOGL_ERROR, "cannot send DATA REQUEST to unknown lchan\n");
@@ -807,7 +807,7 @@
 
 /* Send "ESTABLISH REQUEST" message with given L3 Info payload */
 /* 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;
 
@@ -823,7 +823,7 @@
    RELEASE CONFIRM, which we in turn use to trigger RSL CHANNEL RELEASE,
    which in turn is acknowledged by RSL CHANNEL RELEASE ACK, which calls
    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;
@@ -889,7 +889,7 @@
 
 	rsl_tlv_parse(&tp, dh->data, msgb_l2len(msg)-sizeof(*dh));
 	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,
 				TLVP_LEN(&tp, RSL_IE_CAUSE));
 		if (*cause != RSL_ERR_RCH_ALR_ACTV_ALLOC)
@@ -982,8 +982,8 @@
 	struct abis_rsl_dchan_hdr *dh = msgb_l2(msg);
 	struct tlv_parsed tp;
 	struct gsm_meas_rep *mr = lchan_next_meas_rep(msg->lchan);
-	u_int8_t len;
-	const u_int8_t *val;
+	uint8_t len;
+	const uint8_t *val;
 	int rc;
 
 	/* check if this channel is actually active */
@@ -1034,7 +1034,7 @@
 		mr->ms_l1.ta = val[1];
 	}
 	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);
 		if (rc < 0)
 			return rc;
@@ -1247,11 +1247,11 @@
 	enum gsm_chan_t lctype;
 	enum gsm_chreq_reason_t chreq_reason;
 	struct gsm_lchan *lchan;
-	u_int8_t rqd_ta;
+	uint8_t rqd_ta;
 	int is_lu;
 
-	u_int16_t arfcn;
-	u_int8_t ts_number, subch;
+	uint16_t arfcn;
+	uint8_t ts_number, subch;
 
 	/* parse request reference to be used in immediate assign */
 	if (rqd_hdr->data[0] != RSL_IE_REQ_REFERENCE)
@@ -1329,7 +1329,7 @@
 static int rsl_send_imm_assignment(struct gsm_lchan *lchan)
 {
 	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;
 
 	/* create IMMEDIATE ASSIGN 04.08 messge */
@@ -1358,17 +1358,17 @@
 	bsc_schedule_timer(&lchan->T3101, bts->network->T3101, 0);
 
 	/* 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 */
 static int rsl_rx_ccch_load(struct msgb *msg)
 {
 	struct abis_rsl_dchan_hdr *rslh = msgb_l2(msg);
-	u_int16_t pg_buf_space;
-	u_int16_t rach_slot_count = -1;
-	u_int16_t rach_busy_count = -1;
-	u_int16_t rach_access_count = -1;
+	uint16_t pg_buf_space;
+	uint16_t rach_slot_count = -1;
+	uint16_t rach_busy_count = -1;
+	uint16_t rach_access_count = -1;
 
 	switch (rslh->data[0]) {
 	case RSL_IE_PAGING_LOAD:
@@ -1428,7 +1428,7 @@
 static int rsl_rx_rll_err_ind(struct msgb *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",
 		gsm_lchan_name(msg->lchan),
@@ -1481,7 +1481,7 @@
 	struct abis_rsl_rll_hdr *rllh = msgb_l2(msg);
 	int rc = 0;
 	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);
 	ts_name = gsm_lchan_name(msg->lchan);
@@ -1546,7 +1546,7 @@
 	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) {
 	case GSM48_CMODE_SPEECH_V1:
@@ -1583,7 +1583,7 @@
 	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;
 
@@ -1631,23 +1631,23 @@
 static void ipac_parse_rtp(struct gsm_lchan *lchan, struct tlv_parsed *tv)
 {
 	struct in_addr ip;
-	u_int16_t port, conn_id;
+	uint16_t port, conn_id;
 
 	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));
 		lchan->abis_ip.bound_ip = ntohl(ip.s_addr);
 	}
 
 	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);
 		DEBUGPC(DRSL, "LOCAL_PORT=%u ", port);
 		lchan->abis_ip.bound_port = port;
 	}
 
 	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);
 		DEBUGPC(DRSL, "CON_ID=%u ", conn_id);
 		lchan->abis_ip.conn_id = conn_id;
@@ -1668,13 +1668,13 @@
 	}
 
 	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));
 		lchan->abis_ip.connect_ip = ntohl(ip.s_addr);
 	}
 
 	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);
 		DEBUGPC(DRSL, "REMOTE_PORT=%u ", port);
 		lchan->abis_ip.connect_port = port;
@@ -1706,12 +1706,12 @@
 	return abis_rsl_sendmsg(msg);
 }
 
-int rsl_ipacc_mdcx(struct gsm_lchan *lchan, u_int32_t ip, u_int16_t port,
-		   u_int8_t rtp_payload2)
+int rsl_ipacc_mdcx(struct gsm_lchan *lchan, uint32_t ip, uint16_t port,
+		   uint8_t rtp_payload2)
 {
 	struct msgb *msg = rsl_msgb_alloc();
 	struct abis_rsl_dchan_hdr *dh;
-	u_int32_t *att_ip;
+	uint32_t *att_ip;
 	struct in_addr ia;
 
 	dh = (struct abis_rsl_dchan_hdr *) msgb_put(msg, sizeof(*dh));
@@ -1736,7 +1736,7 @@
 
 	msgb_tv16_put(msg, RSL_IE_IPAC_CONN_ID, lchan->abis_ip.conn_id);
 	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;
 	msgb_tv16_put(msg, RSL_IE_IPAC_REMOTE_PORT, port);
 	msgb_tv_put(msg, RSL_IE_IPAC_SPEECH_MODE, lchan->abis_ip.speech_mode);
@@ -1767,7 +1767,7 @@
 {
 	struct msgb *msg = rsl_msgb_alloc();
 	struct abis_rsl_dchan_hdr *dh;
-	u_int8_t msg_type;
+	uint8_t msg_type;
 
 	if (act)
 		msg_type = RSL_MT_IPAC_PDCH_ACT;
diff --git a/openbsc/src/libbsc/bsc_api.c b/openbsc/src/libbsc/bsc_api.c
index bbd9b58..4b48ec6 100644
--- a/openbsc/src/libbsc/bsc_api.c
+++ b/openbsc/src/libbsc/bsc_api.c
@@ -47,9 +47,9 @@
 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 */
-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) {
 	case GSM48_CMODE_SPEECH_V1:
@@ -95,7 +95,7 @@
 	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;
 
diff --git a/openbsc/src/libbsc/bsc_msc.c b/openbsc/src/libbsc/bsc_msc.c
index e9a5113..aa084b8 100644
--- a/openbsc/src/libbsc/bsc_msc.c
+++ b/openbsc/src/libbsc/bsc_msc.c
@@ -254,6 +254,6 @@
 
 	msg->l2h = msgb_v_put(msg, IPAC_MSGT_ID_RESP);
 	msgb_l16tv_put(msg, strlen(token) + 1,
-			IPAC_IDTAG_UNITNAME, (u_int8_t *) token);
+			IPAC_IDTAG_UNITNAME, (uint8_t *) token);
 	return msg;
 }
diff --git a/openbsc/src/libbsc/bsc_rll.c b/openbsc/src/libbsc/bsc_rll.c
index f3eef99..b02394a 100644
--- a/openbsc/src/libbsc/bsc_rll.c
+++ b/openbsc/src/libbsc/bsc_rll.c
@@ -37,9 +37,9 @@
 	struct timer_list timer;
 
 	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;
 };
@@ -64,13 +64,13 @@
 }
 
 /* establish a RLL connection with given SAPI / priority */
-int rll_establish(struct gsm_lchan *lchan, u_int8_t sapi,
-		  void (*cb)(struct gsm_lchan *, u_int8_t, void *,
+int rll_establish(struct gsm_lchan *lchan, uint8_t sapi,
+		  void (*cb)(struct gsm_lchan *, uint8_t, void *,
 			     enum bsc_rllr_ind),
 		  void *data)
 {
 	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)
 		return -ENOMEM;
 
@@ -100,7 +100,7 @@
 
 /* Called from RSL code in case we have received an indication regarding
  * 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;
 
diff --git a/openbsc/src/libbsc/bts_ipaccess_nanobts.c b/openbsc/src/libbsc/bts_ipaccess_nanobts.c
index e4d9a04..c579c75 100644
--- a/openbsc/src/libbsc/bts_ipaccess_nanobts.c
+++ b/openbsc/src/libbsc/bts_ipaccess_nanobts.c
@@ -182,8 +182,8 @@
  */
 static void patch_nm_tables(struct gsm_bts *bts)
 {
-	u_int8_t arfcn_low = bts->c0->arfcn & 0xff;
-	u_int8_t arfcn_high = (bts->c0->arfcn >> 8) & 0x0f;
+	uint8_t arfcn_low = bts->c0->arfcn & 0xff;
+	uint8_t arfcn_high = (bts->c0->arfcn >> 8) & 0x0f;
 
 	/* patch ARFCN into BTS Attributes */
 	nanobts_attr_bts[42] &= 0xf0;
@@ -196,8 +196,8 @@
 	}
 
 	if (bts->rach_ldavg_slots != -1) {
-		u_int8_t avg_high = bts->rach_ldavg_slots & 0xff;
-		u_int8_t avg_low = (bts->rach_ldavg_slots >> 8) & 0x0f;
+		uint8_t avg_high = bts->rach_ldavg_slots & 0xff;
+		uint8_t avg_low = (bts->rach_ldavg_slots >> 8) & 0x0f;
 
 		nanobts_attr_bts[35] = avg_high;
 		nanobts_attr_bts[36] = avg_low;
@@ -249,7 +249,7 @@
 /* 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)
 {
-	u_int8_t obj_class = nsd->obj_class;
+	uint8_t obj_class = nsd->obj_class;
 	void *obj = nsd->obj;
 	struct gsm_nm_state *new_state = nsd->new_state;
 
diff --git a/openbsc/src/libbsc/bts_siemens_bs11.c b/openbsc/src/libbsc/bts_siemens_bs11.c
index 0ab42e8..0a4c247 100644
--- a/openbsc/src/libbsc/bts_siemens_bs11.c
+++ b/openbsc/src/libbsc/bts_siemens_bs11.c
@@ -346,8 +346,8 @@
  */
 static void patch_nm_tables(struct gsm_bts *bts)
 {
-	u_int8_t arfcn_low = bts->c0->arfcn & 0xff;
-	u_int8_t arfcn_high = (bts->c0->arfcn >> 8) & 0x0f;
+	uint8_t arfcn_low = bts->c0->arfcn & 0xff;
+	uint8_t arfcn_high = (bts->c0->arfcn >> 8) & 0x0f;
 
 	/* patch ARFCN into BTS Attributes */
 	bs11_attr_bts[69] &= 0xf0;
@@ -364,8 +364,8 @@
 		bs11_attr_bts[33] = bts->rach_b_thresh & 0xff;
 
 	if (bts->rach_ldavg_slots != -1) {
-		u_int8_t avg_high = bts->rach_ldavg_slots & 0xff;
-		u_int8_t avg_low = (bts->rach_ldavg_slots >> 8) & 0x0f;
+		uint8_t avg_high = bts->rach_ldavg_slots & 0xff;
+		uint8_t avg_low = (bts->rach_ldavg_slots >> 8) & 0x0f;
 
 		bs11_attr_bts[35] = avg_high;
 		bs11_attr_bts[36] = avg_low;
@@ -425,9 +425,9 @@
 			abis_nm_set_radio_attr(trx, bs11_attr_radio,
 					       sizeof(bs11_attr_radio));
 		else {
-			u_int8_t trx1_attr_radio[sizeof(bs11_attr_radio)];
-			u_int8_t arfcn_low = trx->arfcn & 0xff;
-			u_int8_t arfcn_high = (trx->arfcn >> 8) & 0x0f;
+			uint8_t trx1_attr_radio[sizeof(bs11_attr_radio)];
+			uint8_t arfcn_low = trx->arfcn & 0xff;
+			uint8_t arfcn_high = (trx->arfcn >> 8) & 0x0f;
 			memcpy(trx1_attr_radio, bs11_attr_radio,
 				sizeof(trx1_attr_radio));
 
diff --git a/openbsc/src/libbsc/chan_alloc.c b/openbsc/src/libbsc/chan_alloc.c
index f12e21b..b794132 100644
--- a/openbsc/src/libbsc/chan_alloc.c
+++ b/openbsc/src/libbsc/chan_alloc.c
@@ -143,7 +143,7 @@
 	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_CCCH] = 0,
 	[GSM_PCHAN_CCCH_SDCCH4] = 4,
@@ -370,7 +370,7 @@
 	int 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)
 			continue;
 
@@ -401,7 +401,7 @@
 }
 
 /* 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)
 		return -1;
diff --git a/openbsc/src/libbsc/gsm_04_08_utils.c b/openbsc/src/libbsc/gsm_04_08_utils.c
index 1aab2ee..1cff1d9 100644
--- a/openbsc/src/libbsc/gsm_04_08_utils.c
+++ b/openbsc/src/libbsc/gsm_04_08_utils.c
@@ -52,8 +52,8 @@
 
 /* Section 9.1.8 / Table 9.9 */
 struct chreq {
-	u_int8_t val;
-	u_int8_t mask;
+	uint8_t val;
+	uint8_t mask;
 	enum chreq_type type;
 };
 
@@ -166,7 +166,7 @@
 	}
 }
 
-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 length;
@@ -190,7 +190,7 @@
 	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 length;
@@ -218,7 +218,7 @@
 {
 	struct msgb *msg = gsm48_msgb_alloc();
 	struct gsm48_hdr *gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh));
-	u_int8_t *cause;
+	uint8_t *cause;
 
 	msg->lchan = lchan;
 	gh->proto_discr = GSM48_PDISC_RR;
@@ -239,7 +239,7 @@
 }
 
 int send_siemens_mrpci(struct gsm_lchan *lchan,
-		       u_int8_t *classmark2_lv)
+		       uint8_t *classmark2_lv)
 {
 	struct rsl_mrpci mrpci;
 
@@ -260,7 +260,7 @@
 	if (length < 1 + *classmark2_lv)
 		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])
 		return -2;
 
@@ -269,11 +269,11 @@
 }
 
 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 =
 		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,
 				mi_string, mi_type);
 }
@@ -283,7 +283,7 @@
 {
 	struct gsm_bts *bts = msg->lchan->ts->trx->bts;
 	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))
 		send_siemens_mrpci(msg->lchan, classmark2_lv);
@@ -312,7 +312,7 @@
 {
 	struct msgb *msg = gsm48_msgb_alloc();
 	struct gsm48_hdr *gh;
-	u_int8_t ciph_mod_set;
+	uint8_t ciph_mod_set;
 
 	msg->lchan = lchan;
 
@@ -343,7 +343,7 @@
 void gsm48_lchan2chan_desc(struct gsm48_chan_desc *cd,
 			   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);
 	if (!lchan->ts->hopping.enabled) {
@@ -364,7 +364,7 @@
 
 /* Chapter 9.1.15: Handover Command */
 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 gsm48_hdr *gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh));
@@ -403,7 +403,7 @@
 }
 
 /* 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 gsm48_hdr *gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh));
@@ -443,7 +443,7 @@
 			LOGP(DRR, LOGL_ERROR, "BUG: Using multirate codec "
 				"without multirate config.\n");
 		} else {
-			u_int8_t *data = msgb_put(msg, 4);
+			uint8_t *data = msgb_put(msg, 4);
 			data[0] = GSM48_IE_MUL_RATE_CFG;
 			data[1] = 0x2;
 			memcpy(&data[2], &lchan->mr_conf, 2);
@@ -454,7 +454,7 @@
 }
 
 /* 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 gsm48_hdr *gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh));
@@ -479,7 +479,7 @@
 			LOGP(DRR, LOGL_ERROR, "BUG: Using multirate codec "
 				"without multirate config.\n");
 		} else {
-			u_int8_t *data = msgb_put(msg, 4);
+			uint8_t *data = msgb_put(msg, 4);
 			data[0] = GSM48_IE_MUL_RATE_CFG;
 			data[1] = 0x2;
 			memcpy(&data[2], &lchan->mr_conf, 2);
@@ -489,7 +489,7 @@
 	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;
 
@@ -547,7 +547,7 @@
 int gsm48_parse_meas_rep(struct gsm_meas_rep *rep, struct msgb *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 bitvec *nbv = &bts->si_common.neigh_list;
 	struct gsm_meas_rep_cell *mrc;
diff --git a/openbsc/src/libbsc/handover_decision.c b/openbsc/src/libbsc/handover_decision.c
index 3b81dde..31fd610 100644
--- a/openbsc/src/libbsc/handover_decision.c
+++ b/openbsc/src/libbsc/handover_decision.c
@@ -35,7 +35,7 @@
 
 /* issue handover to a cell identified by ARFCN and BSIC */
 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;
 
@@ -53,7 +53,7 @@
 
 /* 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,
-				 u_int16_t arfcn, u_int8_t bsic)
+				 uint16_t arfcn, uint8_t bsic)
 {
 	int i;
 
diff --git a/openbsc/src/libbsc/handover_logic.c b/openbsc/src/libbsc/handover_logic.c
index ad79f8a..976a7fd 100644
--- a/openbsc/src/libbsc/handover_logic.c
+++ b/openbsc/src/libbsc/handover_logic.c
@@ -49,7 +49,7 @@
 
 	struct timer_list T3103;
 
-	u_int8_t ho_ref;
+	uint8_t ho_ref;
 };
 
 static LLIST_HEAD(bsc_handovers);
@@ -85,7 +85,7 @@
 {
 	struct gsm_lchan *new_lchan;
 	struct bsc_handover *ho;
-	static u_int8_t ho_ref;
+	static uint8_t ho_ref;
 	int rc;
 
 	/* don't attempt multiple handovers for the same lchan at
diff --git a/openbsc/src/libbsc/paging.c b/openbsc/src/libbsc/paging.c
index c542544..2de098b 100644
--- a/openbsc/src/libbsc/paging.c
+++ b/openbsc/src/libbsc/paging.c
@@ -81,7 +81,7 @@
 
 static void page_ms(struct gsm_paging_request *request)
 {
-	u_int8_t mi[128];
+	uint8_t mi[128];
 	unsigned int mi_len;
 	unsigned int page_group;
 
@@ -387,7 +387,7 @@
 	} 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);
 	bts->paging.available_slots = free_slots;
diff --git a/openbsc/src/libbsc/rest_octets.c b/openbsc/src/libbsc/rest_octets.c
index c040d26..0545426 100644
--- a/openbsc/src/libbsc/rest_octets.c
+++ b/openbsc/src/libbsc/rest_octets.c
@@ -30,7 +30,7 @@
 #include <openbsc/rest_octets.h>
 
 /* 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;
 
@@ -88,7 +88,7 @@
 
 
 /* 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;
 
@@ -136,7 +136,7 @@
 }
 
 /* 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;
 
@@ -366,7 +366,7 @@
 }
 
 /* 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;
 
diff --git a/openbsc/src/libbsc/system_information.c b/openbsc/src/libbsc/system_information.c
index 1cbbcc9..0cae716 100644
--- a/openbsc/src/libbsc/system_information.c
+++ b/openbsc/src/libbsc/system_information.c
@@ -56,7 +56,7 @@
 /* Frequency Lists as per TS 04.08 10.5.2.13 */
 
 /* 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;
 
@@ -77,7 +77,7 @@
 }
 
 /* 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 min_arfcn;
@@ -110,7 +110,7 @@
 }
 
 /* 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)
 {
 	int i, rc, min = 1024, max = -1;
@@ -171,7 +171,7 @@
 }
 
 /* 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 bitvec *bv = &bts->si_common.cell_alloc;
@@ -199,7 +199,7 @@
 }
 
 /* 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 bitvec *bv;
@@ -226,7 +226,7 @@
 	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;
 	struct gsm48_system_information_type_1 *si1 =
@@ -251,7 +251,7 @@
 	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;
 	struct gsm48_system_information_type_2 *si2 =
@@ -298,7 +298,7 @@
 	.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;
 	struct gsm48_system_information_type_3 *si3 =
@@ -329,7 +329,7 @@
 	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;
 	struct gsm48_system_information_type_4 *si4 =
@@ -362,7 +362,7 @@
 	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;
 	int rc, l2_plen = 18;
@@ -394,7 +394,7 @@
 	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;
 	int l2_plen = 11;
@@ -468,7 +468,7 @@
 	},
 };
 
-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 *) output;
diff --git a/openbsc/src/libbsc/transaction.c b/openbsc/src/libbsc/transaction.c
index 180f9f9..0c72c03 100644
--- a/openbsc/src/libbsc/transaction.c
+++ b/openbsc/src/libbsc/transaction.c
@@ -34,7 +34,7 @@
 void _gsm48_cc_trans_free(struct gsm_trans *trans);
 
 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_network *net = subscr->net;
@@ -49,7 +49,7 @@
 }
 
 struct gsm_trans *trans_find_by_callref(struct gsm_network *net,
-					u_int32_t callref)
+					uint32_t callref)
 {
 	struct gsm_trans *trans;
 
@@ -61,8 +61,8 @@
 }
 
 struct gsm_trans *trans_alloc(struct gsm_subscriber *subscr,
-			      u_int8_t protocol, u_int8_t trans_id,
-			      u_int32_t callref)
+			      uint8_t protocol, uint8_t trans_id,
+			      uint32_t callref)
 {
 	struct gsm_trans *trans;
 
@@ -118,7 +118,7 @@
 /* allocate an unused transaction ID for the given subscriber
  * in the given protocol using the ti_flag specified */
 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_trans *trans;
diff --git a/openbsc/src/libcommon/gsm_data.c b/openbsc/src/libcommon/gsm_data.c
index cab1e4a..081605f 100644
--- a/openbsc/src/libcommon/gsm_data.c
+++ b/openbsc/src/libcommon/gsm_data.c
@@ -39,8 +39,8 @@
 
 static LLIST_HEAD(bts_models);
 
-void set_ts_e1link(struct gsm_bts_trx_ts *ts, u_int8_t e1_nr,
-		   u_int8_t e1_ts, u_int8_t e1_ts_ss)
+void set_ts_e1link(struct gsm_bts_trx_ts *ts, uint8_t e1_nr,
+		   uint8_t e1_ts, uint8_t e1_ts_ss)
 {
 	ts->e1_link.e1_nr = e1_nr;
 	ts->e1_link.e1_ts = e1_ts;
@@ -184,7 +184,7 @@
 				{ 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,
-			      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_model *model = bts_model_find(type);
@@ -252,7 +252,7 @@
 	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 *))
 {
 	struct gsm_network *net;
@@ -350,7 +350,7 @@
 
 /* Get reference to a neighbor cell on a given BCCH ARFCN */
 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;
 	/* FIXME: use some better heuristics here to determine which cell
@@ -493,7 +493,7 @@
 	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;
 
diff --git a/openbsc/src/libcommon/socket.c b/openbsc/src/libcommon/socket.c
index 5ca7ec9..bbe50d5 100644
--- a/openbsc/src/libcommon/socket.c
+++ b/openbsc/src/libcommon/socket.c
@@ -41,7 +41,7 @@
 #include <osmocom/core/talloc.h>
 
 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)
 {
 	struct sockaddr_in addr;
diff --git a/openbsc/src/libmsc/db.c b/openbsc/src/libmsc/db.c
index 3de6830..f08fb79 100644
--- a/openbsc/src/libmsc/db.c
+++ b/openbsc/src/libmsc/db.c
@@ -737,7 +737,7 @@
 	dbi_result result;
 	unsigned char *cm2, *cm3;
 	char *q_imei;
-	u_int8_t classmark1;
+	uint8_t classmark1;
 
 	memcpy(&classmark1, &equip->classmark1, sizeof(classmark1));
 	DEBUGP(DDB, "Sync Equipment IMEI=%s, classmark1=%02x",
@@ -821,7 +821,7 @@
 int db_subscriber_alloc_exten(struct gsm_subscriber *subscriber)
 {
 	dbi_result result = NULL;
-	u_int32_t try;
+	uint32_t try;
 
 	for (;;) {
 		try = (rand()%(GSM_MAX_EXTEN-GSM_MIN_EXTEN+1)+GSM_MIN_EXTEN);
@@ -855,10 +855,10 @@
  * an error.
  */
 
-int db_subscriber_alloc_token(struct gsm_subscriber *subscriber, u_int32_t *token)
+int db_subscriber_alloc_token(struct gsm_subscriber *subscriber, uint32_t *token)
 {
 	dbi_result result;
-	u_int32_t try;
+	uint32_t try;
 
 	for (;;) {
 		try = rand();
@@ -1060,7 +1060,7 @@
 	sms->user_data_len = dbi_result_get_field_length(result, "user_data");
 	user_data = dbi_result_get_binary(result, "user_data");
 	if (sms->user_data_len > sizeof(sms->user_data))
-		sms->user_data_len = (u_int8_t) sizeof(sms->user_data);
+		sms->user_data_len = (uint8_t) sizeof(sms->user_data);
 	memcpy(sms->user_data, user_data, sms->user_data_len);
 
 	text = dbi_result_get_string(result, "text");
@@ -1219,8 +1219,8 @@
 }
 
 int db_apdu_blob_store(struct gsm_subscriber *subscr,
-			u_int8_t apdu_id_flags, u_int8_t len,
-			u_int8_t *apdu)
+			uint8_t apdu_id_flags, uint8_t len,
+			uint8_t *apdu)
 {
 	dbi_result result;
 	unsigned char *q_apdu;
diff --git a/openbsc/src/libmsc/gsm_04_08.c b/openbsc/src/libmsc/gsm_04_08.c
index 138e26c..7d6580a 100644
--- a/openbsc/src/libmsc/gsm_04_08.c
+++ b/openbsc/src/libmsc/gsm_04_08.c
@@ -61,19 +61,19 @@
 void *tall_locop_ctx;
 void *tall_authciphop_ctx;
 
-int gsm0408_loc_upd_acc(struct gsm_subscriber_connection *conn, u_int32_t tmsi);
+int gsm0408_loc_upd_acc(struct gsm_subscriber_connection *conn, uint32_t tmsi);
 static int gsm48_tx_simple(struct gsm_subscriber_connection *conn,
-			   u_int8_t pdisc, u_int8_t msg_type);
+			   uint8_t pdisc, uint8_t msg_type);
 static void schedule_reject(struct gsm_subscriber_connection *conn);
 static void release_anchor(struct gsm_subscriber_connection *conn);
 
 struct gsm_lai {
-	u_int16_t mcc;
-	u_int16_t mnc;
-	u_int16_t lac;
+	uint16_t mcc;
+	uint16_t mnc;
+	uint16_t lac;
 };
 
-static u_int32_t new_callref = 0x80000001;
+static uint32_t new_callref = 0x80000001;
 
 void cc_tx_to_mncc(struct gsm_network *net, struct msgb *msg)
 {
@@ -356,7 +356,7 @@
 }
 
 /* Chapter 9.2.14 : Send LOCATION UPDATING REJECT */
-int gsm0408_loc_upd_rej(struct gsm_subscriber_connection *conn, u_int8_t cause)
+int gsm0408_loc_upd_rej(struct gsm_subscriber_connection *conn, uint8_t cause)
 {
 	struct gsm_bts *bts = conn->bts;
 	struct msgb *msg;
@@ -380,13 +380,13 @@
 }
 
 /* Chapter 9.2.13 : Send LOCATION UPDATE ACCEPT */
-int gsm0408_loc_upd_acc(struct gsm_subscriber_connection *conn, u_int32_t tmsi)
+int gsm0408_loc_upd_acc(struct gsm_subscriber_connection *conn, uint32_t tmsi)
 {
 	struct gsm_bts *bts = conn->bts;
 	struct msgb *msg = gsm48_msgb_alloc();
 	struct gsm48_hdr *gh;
 	struct gsm48_loc_area_id *lai;
-	u_int8_t *mid;
+	uint8_t *mid;
 	
 	msg->lchan = conn->lchan;
 
@@ -409,7 +409,7 @@
 }
 
 /* Transmit Chapter 9.2.10 Identity Request */
-static int mm_tx_identity_req(struct gsm_subscriber_connection *conn, u_int8_t id_type)
+static int mm_tx_identity_req(struct gsm_subscriber_connection *conn, uint8_t id_type)
 {
 	struct msgb *msg = gsm48_msgb_alloc();
 	struct gsm48_hdr *gh;
@@ -432,7 +432,7 @@
 	struct gsm_lchan *lchan = msg->lchan;
 	struct gsm_bts *bts = lchan->ts->trx->bts;
 	struct gsm_network *net = bts->network;
-	u_int8_t mi_type = gh->data[1] & GSM_MI_TYPE_MASK;
+	uint8_t mi_type = gh->data[1] & GSM_MI_TYPE_MASK;
 	char mi_string[GSM48_MI_SIZE];
 
 	gsm48_mi_to_string(mi_string, sizeof(mi_string), &gh->data[1], gh->data[0]);
@@ -486,7 +486,7 @@
 	bsc_schedule_timer(&conn->loc_operation->updating_timer, 5, 0);
 }
 
-static const char *lupd_name(u_int8_t type)
+static const char *lupd_name(uint8_t type)
 {
 	switch (type) {
 	case GSM48_LUPD_NORMAL:
@@ -507,7 +507,7 @@
 	struct gsm48_loc_upd_req *lu;
 	struct gsm_subscriber *subscr = NULL;
 	struct gsm_bts *bts = conn->bts;
-	u_int8_t mi_type;
+	uint8_t mi_type;
 	char mi_string[GSM48_MI_SIZE];
 	int rc;
 
@@ -604,7 +604,7 @@
 }
 
 #if 0
-static u_int8_t to_bcd8(u_int8_t val)
+static uint8_t to_bcd8(uint8_t val)
 {
        return ((val / 10) << 4) | (val % 10);
 }
@@ -616,7 +616,7 @@
 	struct msgb *msg = gsm48_msgb_alloc();
 	struct gsm48_hdr *gh;
 	struct gsm_network *net = conn->bts->network;
-	u_int8_t *ptr8;
+	uint8_t *ptr8;
 	int name_len, name_pad;
 #if 0
 	time_t cur_t;
@@ -639,7 +639,7 @@
 		ptr8[1] = name_len*2 +1;
 		ptr8[2] = 0x90; /* UCS2, no spare bits, no CI */
 
-		ptr16 = (u_int16_t *) msgb_put(msg, name_len*2);
+		ptr16 = (uint16_t *) msgb_put(msg, name_len*2);
 		for (i = 0; i < name_len; i++)
 			ptr16[i] = htons(net->name_long[i]);
 
@@ -665,12 +665,12 @@
 #if 0
 		name_len = strlen(net->name_short);
 		/* 10.5.3.5a */
-		ptr8 = (u_int8_t *) msgb_put(msg, 3);
+		ptr8 = (uint8_t *) msgb_put(msg, 3);
 		ptr8[0] = GSM48_IE_NAME_SHORT;
 		ptr8[1] = name_len*2 + 1;
 		ptr8[2] = 0x90; /* UCS2, no spare bits, no CI */
 
-		ptr16 = (u_int16_t *) msgb_put(msg, name_len*2);
+		ptr16 = (uint16_t *) msgb_put(msg, name_len*2);
 		for (i = 0; i < name_len; i++)
 			ptr16[i] = htons(net->name_short[i]);
 #endif
@@ -679,7 +679,7 @@
 		if (name_pad > 0)
 			name_len++;
 		/* 10.5.3.5a */
-		ptr8 = (u_int8_t *) msgb_put(msg, 3);
+		ptr8 = (uint8_t *) msgb_put(msg, 3);
 		ptr8[0] = GSM48_IE_NAME_SHORT;
 		ptr8[1] = name_len +1;
 		ptr8[2] = 0x80 | name_pad; /* Cell Broadcast DCS, no CI */
@@ -714,7 +714,7 @@
 }
 
 /* Section 9.2.2 */
-int gsm48_tx_mm_auth_req(struct gsm_subscriber_connection *conn, u_int8_t *rand, int key_seq)
+int gsm48_tx_mm_auth_req(struct gsm_subscriber_connection *conn, uint8_t *rand, int key_seq)
 {
 	struct msgb *msg = gsm48_msgb_alloc();
 	struct gsm48_hdr *gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh));
@@ -804,7 +804,7 @@
  */
 static int gsm48_rx_mm_serv_req(struct gsm_subscriber_connection *conn, struct msgb *msg)
 {
-	u_int8_t mi_type;
+	uint8_t mi_type;
 	char mi_string[GSM48_MI_SIZE];
 
 	struct gsm_bts *bts = conn->bts;
@@ -813,10 +813,10 @@
 	struct gsm48_service_request *req =
 			(struct gsm48_service_request *)gh->data;
 	/* unfortunately in Phase1 the classmark2 length is variable */
-	u_int8_t classmark2_len = gh->data[1];
-	u_int8_t *classmark2 = gh->data+2;
-	u_int8_t mi_len = *(classmark2 + classmark2_len);
-	u_int8_t *mi = (classmark2 + classmark2_len + 1);
+	uint8_t classmark2_len = gh->data[1];
+	uint8_t *classmark2 = gh->data+2;
+	uint8_t mi_len = *(classmark2 + classmark2_len);
+	uint8_t *mi = (classmark2 + classmark2_len + 1);
 
 	DEBUGP(DMM, "<- CM SERVICE REQUEST ");
 	if (msg->data_len < sizeof(struct gsm48_service_request*)) {
@@ -878,7 +878,7 @@
 	struct gsm48_hdr *gh = msgb_l3(msg);
 	struct gsm48_imsi_detach_ind *idi =
 				(struct gsm48_imsi_detach_ind *) gh->data;
-	u_int8_t mi_type = idi->mi[0] & GSM_MI_TYPE_MASK;
+	uint8_t mi_type = idi->mi[0] & GSM_MI_TYPE_MASK;
 	char mi_string[GSM48_MI_SIZE];
 	struct gsm_subscriber *subscr = NULL;
 
@@ -1025,8 +1025,8 @@
 	struct gsm_bts *bts = conn->bts;
 	struct gsm48_hdr *gh = msgb_l3(msg);
 	struct gsm48_pag_resp *resp;
-	u_int8_t *classmark2_lv = gh->data + 1;
-	u_int8_t mi_type;
+	uint8_t *classmark2_lv = gh->data + 1;
+	uint8_t mi_type;
 	char mi_string[GSM48_MI_SIZE];
 	struct gsm_subscriber *subscr = NULL;
 	int rc = 0;
@@ -1068,8 +1068,8 @@
 	struct gsm48_hdr *gh = msgb_l3(msg);
 	struct gsm_subscriber *subscr = conn->subscr;
 	unsigned int payload_len = msgb_l3len(msg) - sizeof(*gh);
-	u_int8_t cm2_len, cm3_len = 0;
-	u_int8_t *cm2, *cm3 = NULL;
+	uint8_t cm2_len, cm3_len = 0;
+	uint8_t *cm2, *cm3 = NULL;
 
 	DEBUGP(DRR, "CLASSMARK CHANGE ");
 
@@ -1136,9 +1136,9 @@
 static int gsm48_rx_rr_app_info(struct gsm_subscriber_connection *conn, struct msgb *msg)
 {
 	struct gsm48_hdr *gh = msgb_l3(msg);
-	u_int8_t apdu_id_flags;
-	u_int8_t apdu_len;
-	u_int8_t *apdu_data;
+	uint8_t apdu_id_flags;
+	uint8_t apdu_len;
+	uint8_t *apdu_data;
 
 	apdu_id_flags = gh->data[0];
 	apdu_len = gh->data[1];
@@ -1256,8 +1256,8 @@
 	return rc;
 }
 
-int gsm48_send_rr_app_info(struct gsm_subscriber_connection *conn, u_int8_t apdu_id,
-			   u_int8_t apdu_len, const u_int8_t *apdu)
+int gsm48_send_rr_app_info(struct gsm_subscriber_connection *conn, uint8_t apdu_id,
+			   uint8_t apdu_len, const uint8_t *apdu)
 {
 	struct msgb *msg = gsm48_msgb_alloc();
 	struct gsm48_hdr *gh;
@@ -1300,7 +1300,7 @@
 {
 	struct msgb *msg = gsm48_msgb_alloc();
 	struct gsm48_hdr *gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh));
-	u_int8_t *cause, *call_state;
+	uint8_t *cause, *call_state;
 
 	gh->msg_type = GSM48_MT_CC_STATUS;
 
@@ -1316,7 +1316,7 @@
 }
 
 static int gsm48_tx_simple(struct gsm_subscriber_connection *conn,
-			   u_int8_t pdisc, u_int8_t msg_type)
+			   uint8_t pdisc, uint8_t msg_type)
 {
 	struct msgb *msg = gsm48_msgb_alloc();
 	struct gsm48_hdr *gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh));
@@ -1377,7 +1377,7 @@
 }
 
 int mncc_release_ind(struct gsm_network *net, struct gsm_trans *trans,
-		     u_int32_t callref, int location, int value)
+		     uint32_t callref, int location, int value)
 {
 	struct gsm_mncc rel;
 
@@ -1475,7 +1475,7 @@
 	return 0;
 }
 
-static int tch_recv_mncc(struct gsm_network *net, u_int32_t callref, int enable);
+static int tch_recv_mncc(struct gsm_network *net, uint32_t callref, int enable);
 
 /* handle audio path for handover */
 static int handle_ho_signal(unsigned int subsys, unsigned int signal,
@@ -1645,7 +1645,7 @@
 }
 
 /* bridge channels of two transactions */
-static int tch_bridge(struct gsm_network *net, u_int32_t *refs)
+static int tch_bridge(struct gsm_network *net, uint32_t *refs)
 {
 	struct gsm_trans *trans1 = trans_find_by_callref(net, refs[0]);
 	struct gsm_trans *trans2 = trans_find_by_callref(net, refs[1]);
@@ -1661,7 +1661,7 @@
 }
 
 /* enable receive of channels to MNCC upqueue */
-static int tch_recv_mncc(struct gsm_network *net, u_int32_t callref, int enable)
+static int tch_recv_mncc(struct gsm_network *net, uint32_t callref, int enable)
 {
 	struct gsm_trans *trans;
 	struct gsm_lchan *lchan;
@@ -1823,7 +1823,7 @@
 static int gsm48_cc_rx_setup(struct gsm_trans *trans, struct msgb *msg)
 {
 	struct gsm48_hdr *gh = msgb_l3(msg);
-	u_int8_t msg_type = gh->msg_type & 0xbf;
+	uint8_t msg_type = gh->msg_type & 0xbf;
 	unsigned int payload_len = msgb_l3len(msg) - sizeof(*gh);
 	struct tlv_parsed tp;
 	struct gsm_mncc setup;
@@ -2882,7 +2882,7 @@
 }
 
 static struct downstate {
-	u_int32_t	states;
+	uint32_t	states;
 	int		type;
 	int		(*rout) (struct gsm_trans *trans, void *arg);
 } downstatelist[] = {
@@ -3154,7 +3154,7 @@
 
 
 static struct datastate {
-	u_int32_t	states;
+	uint32_t	states;
 	int		type;
 	int		(*rout) (struct gsm_trans *trans, struct msgb *msg);
 } datastatelist[] = {
@@ -3210,8 +3210,8 @@
 static int gsm0408_rcv_cc(struct gsm_subscriber_connection *conn, struct msgb *msg)
 {
 	struct gsm48_hdr *gh = msgb_l3(msg);
-	u_int8_t msg_type = gh->msg_type & 0xbf;
-	u_int8_t transaction_id = ((gh->proto_discr & 0xf0) ^ 0x80) >> 4; /* flip */
+	uint8_t msg_type = gh->msg_type & 0xbf;
+	uint8_t transaction_id = ((gh->proto_discr & 0xf0) ^ 0x80) >> 4; /* flip */
 	struct gsm_trans *trans = NULL;
 	int i, rc = 0;
 
@@ -3298,7 +3298,7 @@
 int gsm0408_dispatch(struct gsm_subscriber_connection *conn, struct msgb *msg)
 {
 	struct gsm48_hdr *gh = msgb_l3(msg);
-	u_int8_t pdisc = gh->proto_discr & 0x0f;
+	uint8_t pdisc = gh->proto_discr & 0x0f;
 	int rc = 0;
 
 	if (silent_call_reroute(conn, msg))
diff --git a/openbsc/src/libmsc/gsm_04_11.c b/openbsc/src/libmsc/gsm_04_11.c
index 0f8d7c2..c7ac8f4 100644
--- a/openbsc/src/libmsc/gsm_04_11.c
+++ b/openbsc/src/libmsc/gsm_04_11.c
@@ -55,7 +55,7 @@
 #define GSM411_ALLOC_HEADROOM	128
 
 void *tall_gsms_ctx;
-static u_int32_t new_callref = 0x40000001;
+static uint32_t new_callref = 0x40000001;
 
 static const struct value_string cp_cause_strs[] = {
 	{ GSM411_CP_CAUSE_NET_FAIL,	"Network Failure" },
@@ -173,7 +173,7 @@
 				   "GSM 04.11");
 }
 
-static int gsm411_sendmsg(struct gsm_subscriber_connection *conn, struct msgb *msg, u_int8_t link_id)
+static int gsm411_sendmsg(struct gsm_subscriber_connection *conn, struct msgb *msg, uint8_t link_id)
 {
 	DEBUGP(DSMS, "GSM4.11 TX %s\n", hexdump(msg->data, msg->len));
 	msg->l3h = msg->data;
@@ -192,7 +192,7 @@
 
 /* Prefix msg with a 04.08/04.11 CP header */
 static int gsm411_cp_sendmsg(struct msgb *msg, struct gsm_trans *trans,
-			     u_int8_t msg_type)
+			     uint8_t msg_type)
 {
 	struct gsm48_hdr *gh;
 
@@ -228,10 +228,10 @@
 
 /* Prefix msg with a RP-DATA header and send as CP-DATA */
 static int gsm411_rp_sendmsg(struct msgb *msg, struct gsm_trans *trans,
-			     u_int8_t rp_msg_type, u_int8_t rp_msg_ref)
+			     uint8_t rp_msg_type, uint8_t rp_msg_ref)
 {
 	struct gsm411_rp_hdr *rp;
-	u_int8_t len = msg->len;
+	uint8_t len = msg->len;
 
 	/* GSM 04.11 RP-DATA header */
 	rp = (struct gsm411_rp_hdr *)msgb_push(msg, sizeof(*rp));
@@ -243,9 +243,9 @@
 }
 
 /* Turn int into semi-octet representation: 98 => 0x89 */
-static u_int8_t bcdify(u_int8_t value)
+static uint8_t bcdify(uint8_t value)
 {
-	u_int8_t ret;
+	uint8_t ret;
 
 	ret = value / 10;
 	ret |= (value % 10) << 4;
@@ -254,9 +254,9 @@
 }
 
 /* Turn semi-octet representation into int: 0x89 => 98 */
-static u_int8_t unbcdify(u_int8_t value)
+static uint8_t unbcdify(uint8_t value)
 {
-	u_int8_t ret;
+	uint8_t ret;
 
 	if ((value & 0x0F) > 9 || (value >> 4) > 9)
 		LOGP(DSMS, LOGL_ERROR,
@@ -269,7 +269,7 @@
 }
 
 /* Generate 03.40 TP-SCTS */
-static void gsm340_gen_scts(u_int8_t *scts, time_t time)
+static void gsm340_gen_scts(uint8_t *scts, time_t time)
 {
 	struct tm *tm = localtime(&time);
 
@@ -283,11 +283,11 @@
 }
 
 /* Decode 03.40 TP-SCTS (into utc/gmt timestamp) */
-static time_t gsm340_scts(u_int8_t *scts)
+static time_t gsm340_scts(uint8_t *scts)
 {
 	struct tm tm;
 
-	u_int8_t yr = unbcdify(*scts++);
+	uint8_t yr = unbcdify(*scts++);
 
 	if (yr <= 80)
 		tm.tm_year = 100 + yr;
@@ -315,10 +315,10 @@
 }
 
 /* Decode validity period format 'relative' */
-static unsigned long gsm340_vp_relative(u_int8_t *sms_vp)
+static unsigned long gsm340_vp_relative(uint8_t *sms_vp)
 {
 	/* Chapter 9.2.3.12.1 */
-	u_int8_t vp;
+	uint8_t vp;
 	unsigned long minutes;
 
 	vp = *(sms_vp);
@@ -334,7 +334,7 @@
 }
 
 /* Decode validity period format 'absolute' */
-static unsigned long gsm340_vp_absolute(u_int8_t *sms_vp)
+static unsigned long gsm340_vp_absolute(uint8_t *sms_vp)
 {
 	/* Chapter 9.2.3.12.2 */
 	time_t expires, now;
@@ -350,9 +350,9 @@
 }
 
 /* Decode validity period format 'relative in integer representation' */
-static unsigned long gsm340_vp_relative_integer(u_int8_t *sms_vp)
+static unsigned long gsm340_vp_relative_integer(uint8_t *sms_vp)
 {
-	u_int8_t vp;
+	uint8_t vp;
 	unsigned long minutes;
 	vp = *(sms_vp);
 	if (vp == 0) {
@@ -365,7 +365,7 @@
 }
 
 /* Decode validity period format 'relative in semi-octet representation' */
-static unsigned long gsm340_vp_relative_semioctet(u_int8_t *sms_vp)
+static unsigned long gsm340_vp_relative_semioctet(uint8_t *sms_vp)
 {
 	unsigned long minutes;
 	minutes = unbcdify(*sms_vp++)*60;  /* hours */
@@ -375,9 +375,9 @@
 }
 
 /* decode validity period. return minutes */
-static unsigned long gsm340_validity_period(u_int8_t sms_vpf, u_int8_t *sms_vp)
+static unsigned long gsm340_validity_period(uint8_t sms_vpf, uint8_t *sms_vp)
 {
-	u_int8_t fi; /* functionality indicator */
+	uint8_t fi; /* functionality indicator */
 
 	switch (sms_vpf) {
 	case GSM340_TP_VPF_RELATIVE:
@@ -413,9 +413,9 @@
 }
 
 /* determine coding alphabet dependent on GSM 03.38 Section 4 DCS */
-enum sms_alphabet gsm338_get_sms_alphabet(u_int8_t dcs)
+enum sms_alphabet gsm338_get_sms_alphabet(uint8_t dcs)
 {
-	u_int8_t cgbits = dcs >> 4;
+	uint8_t cgbits = dcs >> 4;
 	enum sms_alphabet alpha = DCS_NONE;
 
 	if ((cgbits & 0xc) == 0) {
@@ -463,7 +463,7 @@
 }
 
 /* generate a TPDU address field compliant with 03.40 sec. 9.1.2.5 */
-static int gsm340_gen_oa(u_int8_t *oa, unsigned int oa_len,
+static int gsm340_gen_oa(uint8_t *oa, unsigned int oa_len,
 			 struct gsm_subscriber *subscr)
 {
 	int len_in_bytes;
@@ -482,10 +482,10 @@
  * returns total size of TPDU */
 static int gsm340_gen_tpdu(struct msgb *msg, struct gsm_sms *sms)
 {
-	u_int8_t *smsp;
-	u_int8_t oa[12];	/* max len per 03.40 */
-	u_int8_t oa_len = 0;
-	u_int8_t octet_len;
+	uint8_t *smsp;
+	uint8_t oa[12];	/* max len per 03.40 */
+	uint8_t oa_len = 0;
+	uint8_t octet_len;
 	unsigned int old_msg_len = msg->len;
 
 	/* generate first octet with masked bits */
@@ -552,12 +552,12 @@
  * return value > 0: RP CAUSE for ERROR; < 0: silent error; 0 = success */
 static int gsm340_rx_tpdu(struct gsm_subscriber_connection *conn, struct msgb *msg)
 {
-	u_int8_t *smsp = msgb_sms(msg);
+	uint8_t *smsp = msgb_sms(msg);
 	struct gsm_sms *gsms;
-	u_int8_t sms_mti, sms_mms, sms_vpf, sms_alphabet, sms_rp;
-	u_int8_t *sms_vp;
-	u_int8_t da_len_bytes;
-	u_int8_t address_lv[12]; /* according to 03.40 / 9.1.2.5 */
+	uint8_t sms_mti, sms_mms, sms_vpf, sms_alphabet, sms_rp;
+	uint8_t *sms_vp;
+	uint8_t da_len_bytes;
+	uint8_t address_lv[12]; /* according to 03.40 / 9.1.2.5 */
 	int rc = 0;
 
 	counter_inc(conn->bts->network->stats.sms.submitted);
@@ -685,7 +685,7 @@
 	return rc;
 }
 
-static int gsm411_send_rp_ack(struct gsm_trans *trans, u_int8_t msg_ref)
+static int gsm411_send_rp_ack(struct gsm_trans *trans, uint8_t msg_ref)
 {
 	struct msgb *msg = gsm411_msgb_alloc();
 
@@ -695,7 +695,7 @@
 }
 
 static int gsm411_send_rp_error(struct gsm_trans *trans,
-				u_int8_t msg_ref, u_int8_t cause)
+				uint8_t msg_ref, uint8_t cause)
 {
 	struct msgb *msg = gsm411_msgb_alloc();
 
@@ -710,9 +710,9 @@
 /* Receive a 04.11 TPDU inside RP-DATA / user data */
 static int gsm411_rx_rp_ud(struct msgb *msg, struct gsm_trans *trans,
 			  struct gsm411_rp_hdr *rph,
-			  u_int8_t src_len, u_int8_t *src,
-			  u_int8_t dst_len, u_int8_t *dst,
-			  u_int8_t tpdu_len, u_int8_t *tpdu)
+			  uint8_t src_len, uint8_t *src,
+			  uint8_t dst_len, uint8_t *dst,
+			  uint8_t tpdu_len, uint8_t *tpdu)
 {
 	int rc = 0;
 
@@ -743,8 +743,8 @@
 static int gsm411_rx_rp_data(struct msgb *msg, struct gsm_trans *trans,
 			     struct gsm411_rp_hdr *rph)
 {
-	u_int8_t src_len, dst_len, rpud_len;
-	u_int8_t *src = NULL, *dst = NULL , *rp_ud = NULL;
+	uint8_t src_len, dst_len, rpud_len;
+	uint8_t *src = NULL, *dst = NULL , *rp_ud = NULL;
 
 	/* in the MO case, this should always be zero length */
 	src_len = rph->data[0];
@@ -812,8 +812,8 @@
 {
 	struct gsm_network *net = trans->conn->bts->network;
 	struct gsm_sms *sms = trans->sms.sms;
-	u_int8_t cause_len = rph->data[0];
-	u_int8_t cause = rph->data[1];
+	uint8_t cause_len = rph->data[0];
+	uint8_t cause = rph->data[1];
 
 	/* Error in response to MT RP_DATA, i.e. the MS did not
 	 * successfully receive the SMS.  We need to investigate
@@ -886,7 +886,7 @@
 			     struct gsm_trans *trans)
 {
 	struct gsm411_rp_hdr *rp_data = (struct gsm411_rp_hdr*)&gh->data;
-	u_int8_t msg_type =  rp_data->msg_type & 0x07;
+	uint8_t msg_type =  rp_data->msg_type & 0x07;
 	int rc = 0;
 
 	switch (msg_type) {
@@ -936,10 +936,10 @@
 	return rc;
 }
 
-static int gsm411_tx_cp_error(struct gsm_trans *trans, u_int8_t cause)
+static int gsm411_tx_cp_error(struct gsm_trans *trans, uint8_t cause)
 {
 	struct msgb *msg = gsm411_msgb_alloc();
-	u_int8_t *causep;
+	uint8_t *causep;
 
 	LOGP(DSMS, LOGL_NOTICE, "TX CP-ERROR, cause %d (%s)\n", cause,
 		get_value_string(cp_cause_strs, cause));
@@ -955,8 +955,8 @@
 		    struct msgb *msg)
 {
 	struct gsm48_hdr *gh = msgb_l3(msg);
-	u_int8_t msg_type = gh->msg_type;
-	u_int8_t transaction_id = ((gh->proto_discr >> 4) ^ 0x8); /* flip */
+	uint8_t msg_type = gh->msg_type;
+	uint8_t transaction_id = ((gh->proto_discr >> 4) ^ 0x8); /* flip */
 	struct gsm_trans *trans;
 	int rc = 0;
 
@@ -1074,8 +1074,8 @@
 {
 	struct msgb *msg = gsm411_msgb_alloc();
 	struct gsm_trans *trans;
-	u_int8_t *data, *rp_ud_len;
-	u_int8_t msg_ref = 42;
+	uint8_t *data, *rp_ud_len;
+	uint8_t msg_ref = 42;
 	int transaction_id;
 	int rc;
 
@@ -1108,7 +1108,7 @@
 	trans->conn = conn;
 
 	/* Hardcode SMSC Originating Address for now */
-	data = (u_int8_t *)msgb_put(msg, 8);
+	data = (uint8_t *)msgb_put(msg, 8);
 	data[0] = 0x07;	/* originator length == 7 */
 	data[1] = 0x91; /* type of number: international, ISDN */
 	data[2] = 0x44; /* 447785016005 */
@@ -1119,11 +1119,11 @@
 	data[7] = 0x50;
 
 	/* Hardcoded Destination Address */
-	data = (u_int8_t *)msgb_put(msg, 1);
+	data = (uint8_t *)msgb_put(msg, 1);
 	data[0] = 0;	/* destination length == 0 */
 
 	/* obtain a pointer for the rp_ud_len, so we can fill it later */
-	rp_ud_len = (u_int8_t *)msgb_put(msg, 1);
+	rp_ud_len = (uint8_t *)msgb_put(msg, 1);
 
 	/* generate the 03.40 TPDU */
 	rc = gsm340_gen_tpdu(msg, sms);
diff --git a/openbsc/src/libmsc/gsm_04_80.c b/openbsc/src/libmsc/gsm_04_80.c
index 240bfb3..39738a5 100644
--- a/openbsc/src/libmsc/gsm_04_80.c
+++ b/openbsc/src/libmsc/gsm_04_80.c
@@ -39,7 +39,7 @@
 #include <osmocom/core/msgb.h>
 #include <osmocom/gsm/tlv.h>
 
-static inline unsigned char *msgb_wrap_with_TL(struct msgb *msgb, u_int8_t tag)
+static inline unsigned char *msgb_wrap_with_TL(struct msgb *msgb, uint8_t tag)
 {
 	uint8_t *data = msgb_push(msgb, 2);
 
@@ -48,8 +48,8 @@
 	return data;
 }
 
-static inline unsigned char *msgb_push_TLV1(struct msgb *msgb, u_int8_t tag,
-					    u_int8_t value)
+static inline unsigned char *msgb_push_TLV1(struct msgb *msgb, uint8_t tag,
+					    uint8_t value)
 {
 	uint8_t *data = msgb_push(msgb, 3);
 
@@ -67,7 +67,7 @@
 {
 	struct msgb *msg = gsm48_msgb_alloc();
 	struct gsm48_hdr *gh;
-	u_int8_t *ptr8;
+	uint8_t *ptr8;
 	int response_len;
 
 	/* First put the payload text into the message */
diff --git a/openbsc/src/libmsc/gsm_subscriber.c b/openbsc/src/libmsc/gsm_subscriber.c
index ff4a647..f0372af 100644
--- a/openbsc/src/libmsc/gsm_subscriber.c
+++ b/openbsc/src/libmsc/gsm_subscriber.c
@@ -266,7 +266,7 @@
 
 
 struct gsm_subscriber *subscr_get_by_tmsi(struct gsm_network *net,
-					  u_int32_t tmsi)
+					  uint32_t tmsi)
 {
 	char tmsi_string[14];
 	struct gsm_subscriber *subscr;
diff --git a/openbsc/src/libmsc/mncc_builtin.c b/openbsc/src/libmsc/mncc_builtin.c
index 11355fb..96b7290 100644
--- a/openbsc/src/libmsc/mncc_builtin.c
+++ b/openbsc/src/libmsc/mncc_builtin.c
@@ -40,7 +40,7 @@
 
 static LLIST_HEAD(call_list);
 
-static u_int32_t new_callref = 0x00000001;
+static uint32_t new_callref = 0x00000001;
 
 static void free_call(struct gsm_call *call)
 {
@@ -50,7 +50,7 @@
 }
 
 
-static struct gsm_call *get_call_ref(u_int32_t callref)
+static struct gsm_call *get_call_ref(uint32_t callref)
 {
 	struct gsm_call *callt;
 
@@ -168,7 +168,7 @@
 	struct gsm_mncc connect_ack, frame_recv;
 	struct gsm_network *net = call->net;
 	struct gsm_call *remote;
-	u_int32_t refs[2];
+	uint32_t refs[2];
 
 	/* acknowledge connect */
 	memset(&connect_ack, 0, sizeof(struct gsm_mncc));
diff --git a/openbsc/src/libmsc/rrlp.c b/openbsc/src/libmsc/rrlp.c
index ae5ca47..37f7f3e 100644
--- a/openbsc/src/libmsc/rrlp.c
+++ b/openbsc/src/libmsc/rrlp.c
@@ -29,20 +29,20 @@
 
 /* RRLP msPositionReq, nsBased,
  *	Accuracy=60, Method=gps, ResponseTime=2, oneSet */
-static const u_int8_t ms_based_pos_req[] = { 0x40, 0x01, 0x78, 0xa8 };
+static const uint8_t ms_based_pos_req[] = { 0x40, 0x01, 0x78, 0xa8 };
 
 /* RRLP msPositionReq, msBasedPref,
 	Accuracy=60, Method=gpsOrEOTD, ResponseTime=5, multipleSets */
-static const u_int8_t ms_pref_pos_req[]  = { 0x40, 0x02, 0x79, 0x50 };
+static const uint8_t ms_pref_pos_req[]  = { 0x40, 0x02, 0x79, 0x50 };
 
 /* RRLP msPositionReq, msAssistedPref,
 	Accuracy=60, Method=gpsOrEOTD, ResponseTime=5, multipleSets */
-static const u_int8_t ass_pref_pos_req[] = { 0x40, 0x03, 0x79, 0x50 };
+static const uint8_t ass_pref_pos_req[] = { 0x40, 0x03, 0x79, 0x50 };
 
 static int send_rrlp_req(struct gsm_subscriber_connection *conn)
 {
 	struct gsm_network *net = conn->bts->network;
-	const u_int8_t *req;
+	const uint8_t *req;
 
 	switch (net->rrlp.mode) {
 	case RRLP_MODE_MS_BASED:
diff --git a/openbsc/src/libmsc/silent_call.c b/openbsc/src/libmsc/silent_call.c
index 83e27a9..9e9b72d 100644
--- a/openbsc/src/libmsc/silent_call.c
+++ b/openbsc/src/libmsc/silent_call.c
@@ -80,8 +80,8 @@
 }
 
 struct msg_match {
-	u_int8_t pdisc;
-	u_int8_t msg_type;
+	uint8_t pdisc;
+	uint8_t msg_type;
 };
 
 /* list of messages that are handled inside OpenBSC, even in a silent call */
@@ -94,7 +94,7 @@
 int silent_call_reroute(struct gsm_subscriber_connection *conn, struct msgb *msg)
 {
 	struct gsm48_hdr *gh = msgb_l3(msg);
-	u_int8_t pdisc = gh->proto_discr & 0x0f;
+	uint8_t pdisc = gh->proto_discr & 0x0f;
 	int i;
 
 	/* if we're not part of a silent call, never reroute */
diff --git a/openbsc/src/libmsc/token_auth.c b/openbsc/src/libmsc/token_auth.c
index 4a62e8d..b9e481d 100644
--- a/openbsc/src/libmsc/token_auth.c
+++ b/openbsc/src/libmsc/token_auth.c
@@ -32,7 +32,7 @@
 #define TOKEN_SMS_TEXT "HAR 2009 GSM.  Register at http://har2009.gnumonks.org/ " \
 			"Your IMSI is %s, auth token is %08X, phone no is %s."
 
-static char *build_sms_string(struct gsm_subscriber *subscr, u_int32_t token)
+static char *build_sms_string(struct gsm_subscriber *subscr, uint32_t token)
 {
 	char *sms_str;
 	unsigned int len;
@@ -63,7 +63,7 @@
 		return 0;
 
 	if (subscr->flags & GSM_SUBSCRIBER_FIRST_CONTACT) {
-		u_int32_t token;
+		uint32_t token;
 		char *sms_str;
 
 		/* we've seen this subscriber for the first time. */
@@ -97,7 +97,7 @@
 		if (rc) {
 			struct gsm_subscriber_connection *conn = connection_for_subscr(subscr);
 			if (conn) {
-				u_int8_t auth_rand[16];
+				uint8_t auth_rand[16];
 				/* kick the subscriber off the network */
 				gsm48_tx_mm_auth_req(conn, auth_rand, 0);
 				gsm48_tx_mm_auth_rej(conn);
@@ -116,7 +116,7 @@
 	struct sms_signal_data *sig = signal_data;
 	struct gsm_sms *sms = sig->sms;;
 	struct gsm_subscriber_connection *conn;
-	u_int8_t auth_rand[16];
+	uint8_t auth_rand[16];
 
 
 	if (signal != S_SMS_DELIVERED)
diff --git a/openbsc/src/libmsc/vty_interface_layer3.c b/openbsc/src/libmsc/vty_interface_layer3.c
index 8d6109b..503bee4 100644
--- a/openbsc/src/libmsc/vty_interface_layer3.c
+++ b/openbsc/src/libmsc/vty_interface_layer3.c
@@ -142,7 +142,7 @@
 }
 
 static int _send_sms_str(struct gsm_subscriber *receiver, char *str,
-			 u_int8_t tp_pid)
+			 uint8_t tp_pid)
 {
 	struct gsm_sms *sms;
 
diff --git a/openbsc/src/libtrau/rtp_proxy.c b/openbsc/src/libtrau/rtp_proxy.c
index 75f8256..97284ae 100644
--- a/openbsc/src/libtrau/rtp_proxy.c
+++ b/openbsc/src/libtrau/rtp_proxy.c
@@ -60,9 +60,9 @@
 
 /* according to RFC 1889 */
 struct rtcp_hdr {
-	u_int8_t byte0;
-	u_int8_t type;
-	u_int16_t length;
+	uint8_t byte0;
+	uint8_t type;
+	uint16_t length;
 } __attribute__((packed));
 
 #define RTCP_TYPE_SDES	202
@@ -72,40 +72,40 @@
 /* according to RFC 3550 */
 struct rtp_hdr {
 #if __BYTE_ORDER == __LITTLE_ENDIAN
-	u_int8_t  csrc_count:4,
+	uint8_t  csrc_count:4,
 		  extension:1,
 		  padding:1,
 		  version:2;
-	u_int8_t  payload_type:7,
+	uint8_t  payload_type:7,
 		  marker:1;
 #elif __BYTE_ORDER == __BIG_ENDIAN
-	u_int8_t  version:2,
+	uint8_t  version:2,
 		  padding:1,
 		  extension:1,
 		  csrc_count:4;
-	u_int8_t  marker:1,
+	uint8_t  marker:1,
 		  payload_type:7;
 #endif
-	u_int16_t sequence;
-	u_int32_t timestamp;
-	u_int32_t ssrc;
+	uint16_t sequence;
+	uint32_t timestamp;
+	uint32_t ssrc;
 } __attribute__((packed));
 
 struct rtp_x_hdr {
-	u_int16_t by_profile;
-	u_int16_t length;
+	uint16_t by_profile;
+	uint16_t length;
 } __attribute__((packed));
 
 #define RTP_VERSION	2
 
 /* 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 gsm_data_frame *frame;
 	struct rtp_hdr *rtph = (struct rtp_hdr *)msg->data;
 	struct rtp_x_hdr *rtpxh;
-	u_int8_t *payload;
+	uint8_t *payload;
 	int payload_len;
 	int msg_type;
 	int x_len;
@@ -286,11 +286,11 @@
 /* iterate over all chunks in one RTCP message, look for CNAME IEs and
  * replace all of those with 'new_cname' */
 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;
-	u_int8_t *cur = (u_int8_t *) rh;
-	u_int8_t tag, len = 0;
+	uint8_t *rtcp_end;
+	uint8_t *cur = (uint8_t *) rh;
+	uint8_t tag, len = 0;
 
 	rtcp_end = cur + *rtcp_len;
 	/* move cur to end of RTP header */
@@ -343,7 +343,7 @@
 {
 	struct rtp_sub_socket *rss = &rs->rtcp;
 	struct rtcp_hdr *rtph;
-	u_int16_t old_len;
+	uint16_t old_len;
 	int rc;
 
 	if (!mangle_rtcp_cname)
@@ -572,8 +572,8 @@
 	return NULL;
 }
 
-static int rtp_sub_socket_bind(struct rtp_sub_socket *rss, u_int32_t ip,
-				u_int16_t port)
+static int rtp_sub_socket_bind(struct rtp_sub_socket *rss, uint32_t ip,
+				uint16_t port)
 {
 	int rc;
 	socklen_t alen = sizeof(rss->sin_local);
@@ -598,7 +598,7 @@
 static unsigned int next_udp_port = RTP_PORT_BASE;
 
 /* 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;
 	struct in_addr ia;
@@ -630,7 +630,7 @@
 }
 
 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;
 	socklen_t alen = sizeof(rss->sin_local);
@@ -649,7 +649,7 @@
 }
 
 /* '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;
 	struct in_addr ia;
@@ -682,7 +682,7 @@
 
 /* bind RTP/RTCP socket to application */
 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",
 		this, callref);
diff --git a/openbsc/src/libtrau/subchan_demux.c b/openbsc/src/libtrau/subchan_demux.c
index ee62d41..740d2ca 100644
--- a/openbsc/src/libtrau/subchan_demux.c
+++ b/openbsc/src/libtrau/subchan_demux.c
@@ -32,17 +32,17 @@
 
 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;
 }
 
 #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,
  * 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)
 		sch->consecutive_zeros++;
@@ -83,7 +83,7 @@
 
 /* input some arbitrary (modulo 4) number of bytes of a 64k E1 channel,
  * 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;
 
@@ -92,12 +92,12 @@
 		return -EINVAL;
 
 	for (i = 0; i < len; i++) {
-		u_int8_t inbyte = data[i];
+		uint8_t inbyte = data[i];
 
 		for (c = 0; c < NR_SUBCH; c++) {
 			struct demux_subch *sch = &dmx->subch[c];
-			u_int8_t inbits;
-			u_int8_t bit;
+			uint8_t inbits;
+			uint8_t bit;
 
 			/* ignore inactive subchannels */
 			if (!(dmx->chan_activ & (1 << c)))
@@ -171,7 +171,7 @@
 
 /* return the requested number of bits from the specified subchannel */
 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];
 	int num_bits = 0;
@@ -215,9 +215,9 @@
 }
 
 /* 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;
 
 	for (i = 0; i < 8; i++)
@@ -227,9 +227,9 @@
 }
 
 /* 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;
 
 	/* combine two bits of every subchan */
@@ -244,7 +244,7 @@
 }
 
 /* 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;
 
@@ -285,7 +285,7 @@
 }
 
 /* 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)
 {
 	struct mux_subch *sch = &mx->subch[s_nr];
diff --git a/openbsc/src/libtrau/trau_frame.c b/openbsc/src/libtrau/trau_frame.c
index d4d6447..15cbe4f 100644
--- a/openbsc/src/libtrau/trau_frame.c
+++ b/openbsc/src/libtrau/trau_frame.c
@@ -28,10 +28,10 @@
 #include <openbsc/subchan_demux.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;
-	u_int32_t ret = 0;
+	uint32_t ret = 0;
 
 	for (i = offset; i < offset + num; i++) {
 		ret = ret << 1;
@@ -42,7 +42,7 @@
 }
 
 /* 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 d_idx = 0;
@@ -63,7 +63,7 @@
 }
 
 /* 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 d_idx = 0;
@@ -85,9 +85,9 @@
 	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) {
 	case TRAU_FT_FR_UP:
@@ -120,13 +120,13 @@
 	return 0;
 }
 
-const u_int8_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_fr_down_bits[] = { 1, 1, 1, 0, 0 };
+const uint8_t ft_idle_down_bits[] = { 0, 1, 1, 1, 0 };
 
 /* modify an uplink TRAU frame so we can send it downlink */
 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) {
 	case TRAU_FT_FR_UP:
@@ -178,7 +178,7 @@
 
 }
 
-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 d_idx = 0;
@@ -205,9 +205,9 @@
 }
 
 
-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 */
 	memset(trau_bits, 0, 16);
@@ -245,10 +245,10 @@
 	.c_bits = { 0, 1, 1, 1, 0 },	/* IDLE DOWNLINK 3.5.5 */
 	.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;
 
-u_int8_t *trau_idle_frame(void)
+uint8_t *trau_idle_frame(void)
 {
 	/* only initialize during the first call */
 	if (!dbits_initted) {
diff --git a/openbsc/src/libtrau/trau_mux.c b/openbsc/src/libtrau/trau_mux.c
index 6451554..82813b3 100644
--- a/openbsc/src/libtrau/trau_mux.c
+++ b/openbsc/src/libtrau/trau_mux.c
@@ -31,7 +31,7 @@
 #include <openbsc/debug.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,
 	7, 2, 2, 6, 3, 3, 3, 3,
 	3, 3, 3, 3, 3, 3, 3, 3,
@@ -53,7 +53,7 @@
 	struct llist_head list;
 	struct gsm_network *net;
 	struct gsm_e1_subslot src;
-	u_int32_t callref;
+	uint32_t callref;
 };
 
 static LLIST_HEAD(ss_map);
@@ -102,7 +102,7 @@
 
 
 /* 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 upqueue_entry *ue, *ue2;
@@ -156,14 +156,14 @@
 	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 */
 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;
-	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 subch_mux *mx;
 	struct upqueue_entry *ue;
@@ -231,7 +231,7 @@
 }
 
 /* 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 upqueue_entry *ue;
@@ -260,7 +260,7 @@
 
 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 subch_mux *mx;
 	int i, j, k, l, o;
diff --git a/openbsc/src/utils/bs11_config.c b/openbsc/src/utils/bs11_config.c
index 110d337..0047a92 100644
--- a/openbsc/src/utils/bs11_config.c
+++ b/openbsc/src/utils/bs11_config.c
@@ -53,22 +53,22 @@
 static char *command, *value;
 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_L1_PROT_TYPE, 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_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,
 };
 static const char *trx1_password = "1111111111";
 #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;
 
@@ -113,8 +113,8 @@
 
 static int create_trx1(struct gsm_bts *bts)
 {
-	u_int8_t bbsig1_attr[sizeof(obj_bbsig0_attr)+12];
-	u_int8_t *cur = bbsig1_attr;
+	uint8_t bbsig1_attr[sizeof(obj_bbsig0_attr)+12];
+	uint8_t *cur = bbsig1_attr;
 	struct gsm_bts_trx *trx = gsm_bts_trx_num(bts, 1);
 
 	if (!trx)
@@ -127,7 +127,7 @@
 	sleep(1);
 
 	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));
 	abis_nm_bs11_create_object(bts, BS11_OBJ_BBSIG, 1,
 				   sizeof(bbsig1_attr), bbsig1_attr);
@@ -217,7 +217,7 @@
 	[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))
 		return "Unknown";
@@ -234,7 +234,7 @@
 	[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))
 		return "Unknown";
@@ -242,7 +242,7 @@
 	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) {
 	case BS11_STATE_WARM_UP:
@@ -280,7 +280,7 @@
 	}
 }
 
-static const char *trx_power_name(u_int8_t pwr)
+static const char *trx_power_name(uint8_t pwr)
 {
 	switch (pwr) {
 	case BS11_TRX_POWER_GSM_2W:	
@@ -304,7 +304,7 @@
 	}
 }
 
-static const char *pll_mode_name(u_int8_t mode)
+static const char *pll_mode_name(uint8_t mode)
 {
 	switch (mode) {
 	case BS11_LI_PLL_LOCKED:
@@ -316,7 +316,7 @@
 	}
 }
 
-static const char *cclk_acc_name(u_int8_t acc)
+static const char *cclk_acc_name(uint8_t acc)
 {
 	switch (acc) {
 	case 0:
@@ -330,7 +330,7 @@
 	}
 }
 
-static const char *bport_lcfg_name(u_int8_t lcfg)
+static const char *bport_lcfg_name(uint8_t lcfg)
 {
 	switch (lcfg) {
 	case BS11_LINE_CFG_STAR:
@@ -378,7 +378,7 @@
 static void print_state(struct tlv_parsed *tp)
 {
 	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) {
 			phase = *TLVP_VAL(tp, NM_ATT_BS11_BTS_STATE);
 			printf("PHASE: %u %-20s ", phase & 0xf,
@@ -392,7 +392,7 @@
 	}
 	if (TLVP_PRESENT(tp, NM_ATT_BS11_E1_STATE) &&
 	    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("\n");
@@ -420,7 +420,7 @@
 #endif
 	if (TLVP_PRESENT(tp, NM_ATT_ABIS_CHANNEL) &&
 	    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 ",
 			chan[0], chan[1]);
 		if (chan[2] == 0xff)
@@ -442,23 +442,23 @@
 	}
 	if (TLVP_PRESENT(tp, NM_ATT_BS11_PLL) &&
 	    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",
 			vp[0] << 8 | vp[1], vp[2] << 8 | vp[3]);
 	}
 	if (TLVP_PRESENT(tp, NM_ATT_BS11_CCLK_ACCURACY) &&
 	    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);
 	}
 	if (TLVP_PRESENT(tp, NM_ATT_BS11_CCLK_TYPE) &&
 	    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);
 	}
 	if (TLVP_PRESENT(tp, NM_ATT_BS11_LINE_CFG) &&
 	    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",
 			bport_lcfg_name(*lcfg), *lcfg);
 	}
diff --git a/openbsc/src/utils/rs232.c b/openbsc/src/utils/rs232.c
index 5c20531..43b0dc4 100644
--- a/openbsc/src/utils/rs232.c
+++ b/openbsc/src/utils/rs232.c
@@ -57,7 +57,7 @@
 int _abis_nm_sendmsg(struct msgb *msg, int to_trx_oml)
 {
 	struct serial_handle *sh = ser_handle;
-	u_int8_t *lapd;
+	uint8_t *lapd;
 	unsigned int len;
 
 	msg->l2h = msg->data;
diff --git a/openbsc/tests/gsm0408/gsm0408_test.c b/openbsc/tests/gsm0408/gsm0408_test.c
index e8998c3..46e93b8 100644
--- a/openbsc/tests/gsm0408/gsm0408_test.c
+++ b/openbsc/tests/gsm0408/gsm0408_test.c
@@ -70,8 +70,8 @@
 {
 	const char *imsi_odd  = "987654321098763";
 	const char *imsi_even = "9876543210987654";
-	const u_int32_t tmsi = 0xfabeacd0;
-	u_int8_t mi[128];
+	const uint32_t tmsi = 0xfabeacd0;
+	uint8_t mi[128];
 	unsigned int mi_len;
 	char mi_parsed[GSM48_MI_SIZE];
 
@@ -80,7 +80,7 @@
 	/* tmsi code */
 	mi_len = gsm48_generate_mid_from_tmsi(mi, tmsi);
 	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 */
 	mi_len = gsm48_generate_mid_from_imsi(mi, imsi_odd);