convert from u_int*_t to u_int*_t (stdint.h format)
diff --git a/libosmocore/include/osmocore/gsmtap.h b/libosmocore/include/osmocore/gsmtap.h
index 360f362..81b9cc0 100644
--- a/libosmocore/include/osmocore/gsmtap.h
+++ b/libosmocore/include/osmocore/gsmtap.h
@@ -3,7 +3,7 @@
 
 /* gsmtap header, pseudo-header in front of the actua GSM payload*/
 
-#include <sys/types.h>
+#include <stdint.h>
 
 #define GSMTAP_VERSION		0x01
 
@@ -25,20 +25,20 @@
 #define GSMTAP_UDP_PORT                 4729
 
 struct gsmtap_hdr {
-	u_int8_t version;		/* version, set to 0x01 currently */
-	u_int8_t hdr_len;		/* length in number of 32bit words */
-	u_int8_t type;			/* see GSMTAP_TYPE_* */
-	u_int8_t timeslot;		/* timeslot (0..7 on Um) */
+	uint8_t version;		/* version, set to 0x01 currently */
+	uint8_t hdr_len;		/* length in number of 32bit words */
+	uint8_t type;			/* see GSMTAP_TYPE_* */
+	uint8_t timeslot;		/* timeslot (0..7 on Um) */
 
-	u_int16_t arfcn;		/* ARFCN (frequency) */
-	u_int8_t noise_db;		/* noise figure in dB */
-	u_int8_t signal_db;		/* signal level in dB */
+	uint16_t arfcn;			/* ARFCN (frequency) */
+	uint8_t noise_db;		/* noise figure in dB */
+	uint8_t signal_db;		/* signal level in dB */
 
-	u_int32_t frame_number;		/* GSM Frame Number (FN) */
+	uint32_t frame_number;		/* GSM Frame Number (FN) */
 
-	u_int8_t burst_type;		/* Type of burst, see above */
-	u_int8_t antenna_nr;		/* Antenna Number */
-	u_int16_t res;			/* reserved for future use (RFU) */
+	uint8_t burst_type;		/* Type of burst, see above */
+	uint8_t antenna_nr;		/* Antenna Number */
+	uint16_t res;			/* reserved for future use (RFU) */
 
 } __attribute__((packed));
 
@@ -55,8 +55,8 @@
 
 struct pcap_sf_pkthdr {
 	struct pcap_timeval ts;		/* time stamp */
-	u_int32_t caplen;		/* lenght of portion present */
-	u_int32_t len;			/* length of this packet */
+	uint32_t caplen;		/* lenght of portion present */
+	uint32_t len;			/* length of this packet */
 };
 
 #endif /* _GSMTAP_H */
diff --git a/libosmocore/include/osmocore/protocol/gsm_04_08.h b/libosmocore/include/osmocore/protocol/gsm_04_08.h
index 1a479db..801b9b5 100644
--- a/libosmocore/include/osmocore/protocol/gsm_04_08.h
+++ b/libosmocore/include/osmocore/protocol/gsm_04_08.h
@@ -1,11 +1,13 @@
 #ifndef PROTO_GSM_04_08_H
 #define PROTO_GSM_04_08_H
 
+#include <stdint.h>
+
 /* GSM TS 04.08  definitions */
 struct gsm_lchan;
 
 struct gsm48_classmark1 {
-	u_int8_t spare:1,
+	uint8_t spare:1,
 		 rev_level:2,
 		 es_ind:1,
 		 a5_1:1,
@@ -14,33 +16,33 @@
 
 /* Chapter 10.5.2.5 */
 struct gsm48_chan_desc {
-	u_int8_t chan_nr;
+	uint8_t chan_nr;
 	union {
 		struct {
-			u_int8_t maio_high:4,
+			uint8_t maio_high:4,
 				 h:1,
 				 tsc:3;
-			u_int8_t hsn:6,
+			uint8_t hsn:6,
 				 maio_low:2;
 		} h1;
 		struct {
-			u_int8_t arfcn_high:2,
+			uint8_t arfcn_high:2,
 				 spare:2,
 				 h:1,
 				 tsc:3;
-			u_int8_t arfcn_low;
+			uint8_t arfcn_low;
 		} h0;
 	};
 } __attribute__ ((packed));
 
 /* Chapter 10.5.2.21aa */
 struct gsm48_multi_rate_conf {
-	u_int8_t smod : 2,
+	uint8_t smod : 2,
 		 spare: 1,
 		 icmi : 1,
 		 nscb : 1,
 		 ver : 3;
-	u_int8_t m4_75 : 1,
+	uint8_t m4_75 : 1,
 		 m5_15 : 1,
 		 m5_90 : 1,
 		 m6_70 : 1,
@@ -52,10 +54,10 @@
 
 /* Chapter 10.5.2.30 */
 struct gsm48_req_ref {
-	u_int8_t ra;
-	u_int8_t t3_high:3,
+	uint8_t ra;
+	uint8_t t3_high:3,
 		 t1_:5;
-	u_int8_t t2:5,
+	uint8_t t2:5,
 		 t3_low:3;
 } __attribute__ ((packed));
 
@@ -66,7 +68,7 @@
  */
 struct gsm48_chan_mode_modify {
 	struct gsm48_chan_desc chan_desc;
-	u_int8_t mode;
+	uint8_t mode;
 } __attribute__ ((packed));
 
 enum gsm48_chan_mode {
@@ -84,109 +86,109 @@
 struct gsm48_ass_cmd {
 	/* Semantic is from 10.5.2.5a */
 	struct gsm48_chan_desc chan_desc;
-	u_int8_t power_command;
-	u_int8_t data[0];
+	uint8_t power_command;
+	uint8_t data[0];
 } __attribute__((packed));
 
 /* Chapter 10.5.2.2 */
 struct gsm48_cell_desc {
-	u_int8_t bcc:3,
+	uint8_t bcc:3,
 		 ncc:3,
 		 arfcn_hi:2;
-	u_int8_t arfcn_lo;
+	uint8_t arfcn_lo;
 } __attribute__((packed));
 
 /* Chapter 9.1.15 */
 struct gsm48_ho_cmd {
 	struct gsm48_cell_desc cell_desc;
 	struct gsm48_chan_desc chan_desc;
-	u_int8_t ho_ref;
-	u_int8_t power_command;
-	u_int8_t data[0];
+	uint8_t ho_ref;
+	uint8_t power_command;
+	uint8_t data[0];
 } __attribute__((packed));
 
 /* Chapter 9.1.18 */
 struct gsm48_imm_ass {
-	u_int8_t l2_plen;
-	u_int8_t proto_discr;
-	u_int8_t msg_type;
-	u_int8_t page_mode;
+	uint8_t l2_plen;
+	uint8_t proto_discr;
+	uint8_t msg_type;
+	uint8_t page_mode;
 	struct gsm48_chan_desc chan_desc;
 	struct gsm48_req_ref req_ref;
-	u_int8_t timing_advance;
-	u_int8_t mob_alloc_len;
-	u_int8_t mob_alloc[0];
+	uint8_t timing_advance;
+	uint8_t mob_alloc_len;
+	uint8_t mob_alloc[0];
 } __attribute__ ((packed));
 
 /* Chapter 10.5.1.3 */
 struct gsm48_loc_area_id {
-	u_int8_t digits[3];	/* BCD! */
-	u_int16_t lac;
+	uint8_t digits[3];	/* BCD! */
+	uint16_t lac;
 } __attribute__ ((packed));
 
 /* Section 9.2.2 */
 struct gsm48_auth_req {
-	u_int8_t key_seq:4,
+	uint8_t key_seq:4,
 	         spare:4;
-	u_int8_t rand[16];
+	uint8_t rand[16];
 } __attribute__ ((packed));
 
 /* Section 9.2.15 */
 struct gsm48_loc_upd_req {
-	u_int8_t type:4,
+	uint8_t type:4,
 		 key_seq:4;
 	struct gsm48_loc_area_id lai;
 	struct gsm48_classmark1 classmark1;
-	u_int8_t mi_len;
-	u_int8_t mi[0];
+	uint8_t mi_len;
+	uint8_t mi[0];
 } __attribute__ ((packed));
 
 /* Section 10.1 */
 struct gsm48_hdr {
-	u_int8_t proto_discr;
-	u_int8_t msg_type;
-	u_int8_t data[0];
+	uint8_t proto_discr;
+	uint8_t msg_type;
+	uint8_t data[0];
 } __attribute__ ((packed));
 
 /* Section 9.1.3x System information Type header */
 struct gsm48_system_information_type_header {
-	u_int8_t l2_plen;
-	u_int8_t rr_protocol_discriminator :4,
+	uint8_t l2_plen;
+	uint8_t rr_protocol_discriminator :4,
 		skip_indicator:4; 
-	u_int8_t system_information;
+	uint8_t system_information;
 } __attribute__ ((packed));
 
 struct gsm48_rach_control {
-	u_int8_t re :1,
+	uint8_t re :1,
 		 cell_bar :1,
 		 tx_integer :4,
 		 max_trans :2;
-	u_int8_t t2;
-	u_int8_t t3;
+	uint8_t t2;
+	uint8_t t3;
 } __attribute__ ((packed));
 
 /* Section 10.5.2.4 Cell Selection Parameters */
 struct gsm48_cell_sel_par {
-	u_int8_t ms_txpwr_max_ccch:5,	/* GSM 05.08 MS-TXPWR-MAX-CCCH */
+	uint8_t ms_txpwr_max_ccch:5,	/* GSM 05.08 MS-TXPWR-MAX-CCCH */
 		 cell_resel_hyst:3;	/* GSM 05.08 CELL-RESELECT-HYSTERESIS */
-	u_int8_t rxlev_acc_min:6,	/* GSM 05.08 RXLEV-ACCESS-MIN */
+	uint8_t rxlev_acc_min:6,	/* GSM 05.08 RXLEV-ACCESS-MIN */
 		 neci:1,
 		 acs:1;
 } __attribute__ ((packed));
 
 /* Section 10.5.2.11 Control Channel Description , Figure 10.5.33 */
 struct gsm48_control_channel_descr {
-	u_int8_t ccch_conf :3,
+	uint8_t ccch_conf :3,
 		bs_ag_blks_res :3,
 		att :1,
 		spare1 :1;
-	u_int8_t bs_pa_mfrms : 3,
+	uint8_t bs_pa_mfrms : 3,
 		spare2 :5;
-	u_int8_t t3212;
+	uint8_t t3212;
 } __attribute__ ((packed));
 
 struct gsm48_cell_options {
-	u_int8_t radio_link_timeout:4,
+	uint8_t radio_link_timeout:4,
 		 dtx:2,
 		 pwrc:1,
 		 spare:1;
@@ -194,41 +196,41 @@
 
 /* Section 9.2.9 CM service request */
 struct gsm48_service_request {
-	u_int8_t cm_service_type : 4,
+	uint8_t cm_service_type : 4,
 		 cipher_key_seq  : 4;
 	/* length + 3 bytes */
-	u_int32_t classmark;
-	u_int8_t mi_len;
-	u_int8_t mi[0];
+	uint32_t classmark;
+	uint8_t mi_len;
+	uint8_t mi[0];
 	/* optional priority level */
 } __attribute__ ((packed));
 
 /* Section 9.1.31 System information Type 1 */
 struct gsm48_system_information_type_1 {
 	struct gsm48_system_information_type_header header;
-	u_int8_t cell_channel_description[16];
+	uint8_t cell_channel_description[16];
 	struct gsm48_rach_control rach_control;
-	u_int8_t rest_octets[0]; /* NCH position on the CCCH */
+	uint8_t rest_octets[0]; /* NCH position on the CCCH */
 } __attribute__ ((packed));
 
 /* Section 9.1.32 System information Type 2 */
 struct gsm48_system_information_type_2 {
 	struct gsm48_system_information_type_header header;
-	u_int8_t bcch_frequency_list[16];
-	u_int8_t ncc_permitted;
+	uint8_t bcch_frequency_list[16];
+	uint8_t ncc_permitted;
 	struct gsm48_rach_control rach_control;
 } __attribute__ ((packed));
 
 /* Section 9.1.35 System information Type 3 */
 struct gsm48_system_information_type_3 {
 	struct gsm48_system_information_type_header header;
-	u_int16_t cell_identity;
+	uint16_t cell_identity;
 	struct gsm48_loc_area_id lai;
 	struct gsm48_control_channel_descr control_channel_desc;
 	struct gsm48_cell_options cell_options;
 	struct gsm48_cell_sel_par cell_sel_par;
 	struct gsm48_rach_control rach_control;
-	u_int8_t rest_octets[0];
+	uint8_t rest_octets[0];
 } __attribute__ ((packed));
 
 /* Section 9.1.36 System information Type 4 */
@@ -240,40 +242,40 @@
 	/*	optional CBCH conditional CBCH... followed by
 		mandantory SI 4 Reset Octets
 	 */
-	u_int8_t data[0];
+	uint8_t data[0];
 } __attribute__ ((packed));
 
 /* Section 9.1.37 System information Type 5 */
 struct gsm48_system_information_type_5 {
-	u_int8_t rr_protocol_discriminator :4,
+	uint8_t rr_protocol_discriminator :4,
 		skip_indicator:4; 
-	u_int8_t system_information;
-	u_int8_t bcch_frequency_list[16];
+	uint8_t system_information;
+	uint8_t bcch_frequency_list[16];
 } __attribute__ ((packed));
 
 /* Section 9.1.40 System information Type 6 */
 struct gsm48_system_information_type_6 {
-	u_int8_t rr_protocol_discriminator :4,
+	uint8_t rr_protocol_discriminator :4,
 		skip_indicator:4; 
-	u_int8_t system_information;
-	u_int16_t cell_identity;
+	uint8_t system_information;
+	uint16_t cell_identity;
 	struct gsm48_loc_area_id lai;
 	struct gsm48_cell_options cell_options;
-	u_int8_t ncc_permitted;
-	u_int8_t rest_octets[0];
+	uint8_t ncc_permitted;
+	uint8_t rest_octets[0];
 } __attribute__ ((packed));
 
 /* Section 9.1.43a System Information type 13 */
 struct gsm48_system_information_type_13 {
 	struct gsm48_system_information_type_header header;
-	u_int8_t rest_octets[0];
+	uint8_t rest_octets[0];
 } __attribute__ ((packed));
 
 /* Section 9.2.12 IMSI Detach Indication */
 struct gsm48_imsi_detach_ind {
 	struct gsm48_classmark1 classmark1;
-	u_int8_t mi_len;
-	u_int8_t mi[0];
+	uint8_t mi_len;
+	uint8_t mi[0];
 } __attribute__ ((packed));
 
 /* Section 10.2 + GSM 04.07 12.2.3.1.1 */
diff --git a/libosmocore/include/osmocore/protocol/gsm_04_11.h b/libosmocore/include/osmocore/protocol/gsm_04_11.h
index 9fce0d7..c6a2b19 100644
--- a/libosmocore/include/osmocore/protocol/gsm_04_11.h
+++ b/libosmocore/include/osmocore/protocol/gsm_04_11.h
@@ -1,6 +1,8 @@
 #ifndef PROTO_GSM_04_11_H
 #define PROTO_GSM_04_11_H
 
+#include <stdint.h>
+
 /* GSM TS 04.11  definitions */
 
 /* Chapter 5.2.3: SMC-CS states at the network side */
@@ -97,10 +99,10 @@
 
 /* Chapter 8.2.1 */
 struct gsm411_rp_hdr {
-	u_int8_t len;
-	u_int8_t msg_type;
-	u_int8_t msg_ref;
-	u_int8_t data[0];
+	uint8_t len;
+	uint8_t msg_type;
+	uint8_t msg_ref;
+	uint8_t data[0];
 } __attribute__ ((packed));
 
 /* our own enum, not related to on-air protocol */
diff --git a/libosmocore/include/osmocore/protocol/gsm_08_58.h b/libosmocore/include/osmocore/protocol/gsm_08_58.h
index 4e8b3c3..ca9398f 100644
--- a/libosmocore/include/osmocore/protocol/gsm_08_58.h
+++ b/libosmocore/include/osmocore/protocol/gsm_08_58.h
@@ -23,28 +23,30 @@
  *
  */
 
+#include <stdint.h>
+
 struct abis_rsl_common_hdr {
-	u_int8_t	msg_discr;
-	u_int8_t	msg_type;
-	u_int8_t	data[0];
+	uint8_t	msg_discr;
+	uint8_t	msg_type;
+	uint8_t	data[0];
 } __attribute__ ((packed));
 
 /* Chapter 8.3 */
 struct abis_rsl_rll_hdr {
 	struct abis_rsl_common_hdr c;
-	u_int8_t	ie_chan;
-	u_int8_t	chan_nr;
-	u_int8_t	ie_link_id;
-	u_int8_t	link_id;
-	u_int8_t	data[0];
+	uint8_t	ie_chan;
+	uint8_t	chan_nr;
+	uint8_t	ie_link_id;
+	uint8_t	link_id;
+	uint8_t	data[0];
 } __attribute__ ((packed));
 
 /* Chapter 8.3 and 8.4 */
 struct abis_rsl_dchan_hdr {
 	struct abis_rsl_common_hdr c;
-	u_int8_t	ie_chan;
-	u_int8_t	chan_nr;
-	u_int8_t	data[0];
+	uint8_t	ie_chan;
+	uint8_t	chan_nr;
+	uint8_t	data[0];
 } __attribute__ ((packed));
 
 
@@ -289,10 +291,10 @@
 
 /* Chapter 9.3.6 */
 struct rsl_ie_chan_mode {
-	u_int8_t dtx_dtu;
-	u_int8_t spd_ind;
-	u_int8_t chan_rt;
-	u_int8_t chan_rate;
+	uint8_t dtx_dtu;
+	uint8_t spd_ind;
+	uint8_t chan_rt;
+	uint8_t chan_rate;
 } __attribute__ ((packed));
 #define RSL_CMOD_DTXu		0x01	/* uplink */
 #define RSL_CMOD_DTXd		0x02	/* downlink */
@@ -318,15 +320,15 @@
 struct rsl_ie_chan_ident {
 	/* GSM 04.08 10.5.2.5 */
 	struct {
-		u_int8_t iei;
-		u_int8_t chan_nr;	/* enc_chan_nr */
-		u_int8_t oct3;
-		u_int8_t oct4;
+		uint8_t iei;
+		uint8_t chan_nr;	/* enc_chan_nr */
+		uint8_t oct3;
+		uint8_t oct4;
 	} chan_desc;
 #if 0	/* spec says we need this but Abissim doesn't use it */
 	struct {
-		u_int8_t tag;
-		u_int8_t len;
+		uint8_t tag;
+		uint8_t len;
 	} mobile_alloc;
 #endif
 } __attribute__ ((packed));
@@ -486,7 +488,7 @@
 
 /* Siemens vendor-specific RSL extensions */
 struct rsl_mrpci {
-	u_int8_t power_class:3,
+	uint8_t power_class:3,
 		 vgcs_capable:1,
 		 vbs_capable:1,
 		 gsm_phase:2;
diff --git a/libosmocore/include/osmocore/protocol/gsm_12_21.h b/libosmocore/include/osmocore/protocol/gsm_12_21.h
index 1453b21..ac6db4b 100644
--- a/libosmocore/include/osmocore/protocol/gsm_12_21.h
+++ b/libosmocore/include/osmocore/protocol/gsm_12_21.h
@@ -23,16 +23,16 @@
  *
  */
 
-#include <sys/types.h>
+#include <stdint.h>
 #include <osmocore/tlv.h>
 
 /* generic header in front of every OML message according to TS 08.59 */
 struct abis_om_hdr {
-	u_int8_t	mdisc;
-	u_int8_t	placement;
-	u_int8_t	sequence;
-	u_int8_t	length;
-	u_int8_t	data[0];
+	uint8_t	mdisc;
+	uint8_t	placement;
+	uint8_t	sequence;
+	uint8_t	length;
+	uint8_t	data[0];
 } __attribute__ ((packed));
 
 #define ABIS_OM_MDISC_FOM		0x80
@@ -45,16 +45,16 @@
 #define ABIS_OM_PLACEMENT_LAST		0x10
 
 struct abis_om_obj_inst {
-	u_int8_t	bts_nr;
-	u_int8_t	trx_nr;
-	u_int8_t	ts_nr;
+	uint8_t	bts_nr;
+	uint8_t	trx_nr;
+	uint8_t	ts_nr;
 } __attribute__ ((packed));
 
 struct abis_om_fom_hdr {
-	u_int8_t	msg_type;
-	u_int8_t	obj_class;
+	uint8_t	msg_type;
+	uint8_t	obj_class;
 	struct abis_om_obj_inst	obj_inst;
-	u_int8_t	data[0];
+	uint8_t	data[0];
 } __attribute__ ((packed));
 
 #define ABIS_OM_FOM_HDR_SIZE	(sizeof(struct abis_om_hdr) + sizeof(struct abis_om_fom_hdr))
@@ -578,10 +578,10 @@
 
 /* Section 9.4.1 */
 struct abis_nm_channel {
-	u_int8_t	attrib;
-	u_int8_t	bts_port;
-	u_int8_t	timeslot;
-	u_int8_t	subslot;
+	uint8_t	attrib;
+	uint8_t	bts_port;
+	uint8_t	timeslot;
+	uint8_t	subslot;
 } __attribute__ ((packed));
 
 /* Siemens BS-11 specific objects in the SienemsHW (0xA5) object class */