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

This was done with sed on the files.
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);