From 5aa17014deace6d91a5cbb9784a9c05521ba19c8 Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Sat, 31 Jul 2010 04:37:26 +0800 Subject: u_int8_t -> uint8_t --- include/bsc_data.h | 2 +- include/ipaccess.h | 4 +- include/mgcp_ss7.h | 4 +- include/mtp_data.h | 4 +- include/mtp_level3.h | 26 ++++++------ include/mtp_pcap.h | 2 +- include/openbsc_nat/bssap.h | 26 ++++++------ include/openbsc_nat/tlv.h | 92 +++++++++++++++++++++--------------------- src/bss_patch.c | 14 +++---- src/bssap_sccp.c | 2 +- src/input/ipaccess.c | 8 ++-- src/main.c | 6 +-- src/mgcp/mgcp_network.c | 8 ++-- src/mgcp_ss7.c | 6 +-- src/msc_conn.c | 6 +-- src/mtp_layer3.c | 10 ++--- src/openbsc_nat/tlv_parser.c | 14 +++---- src/pcap.c | 2 +- tests/mtp/mtp_parse_test.c | 12 +++--- tests/patching/patching_test.c | 30 +++++++------- 20 files changed, 139 insertions(+), 139 deletions(-) diff --git a/include/bsc_data.h b/include/bsc_data.h index 6d61a22..9b5bbfd 100644 --- a/include/bsc_data.h +++ b/include/bsc_data.h @@ -126,6 +126,6 @@ int link_c7_init(struct link_data *data); int link_udp_init(struct link_data *data, int src_port, const char *dest_ip, int port); /* MGCP */ -void mgcp_forward(struct bsc_data *bsc, const u_int8_t *data, unsigned int length); +void mgcp_forward(struct bsc_data *bsc, const uint8_t *data, unsigned int length); #endif diff --git a/include/ipaccess.h b/include/ipaccess.h index 345ed3c..c6c4739 100644 --- a/include/ipaccess.h +++ b/include/ipaccess.h @@ -8,8 +8,8 @@ struct ipaccess_head { u_int16_t len; /* network byte order */ - u_int8_t proto; - u_int8_t data[0]; + uint8_t proto; + uint8_t data[0]; } __attribute__ ((packed)); enum ipaccess_proto { diff --git a/include/mgcp_ss7.h b/include/mgcp_ss7.h index 04eeb5e..d3fae18 100644 --- a/include/mgcp_ss7.h +++ b/include/mgcp_ss7.h @@ -54,12 +54,12 @@ enum { struct mgcp_ss7_cmd { struct llist_head entry; - u_int8_t type; + uint8_t type; u_int32_t port; u_int32_t param; }; -void mgcp_ss7_exec(struct mgcp_ss7 *mgcp, u_int8_t type, u_int32_t port, u_int32_t param); +void mgcp_ss7_exec(struct mgcp_ss7 *mgcp, uint8_t type, u_int32_t port, u_int32_t param); struct mgcp_ss7 *mgcp_ss7_init(int endpoints, const char *local_ip, const char *mgw_ip, int base_port, int payload); void mgcp_ss7_reset(struct mgcp_ss7 *mgcp); diff --git a/include/mtp_data.h b/include/mtp_data.h index d8cdff3..7006953 100644 --- a/include/mtp_data.h +++ b/include/mtp_data.h @@ -45,7 +45,7 @@ struct mtp_link { int sccp_up; /* misc data */ - u_int8_t test_ptrn[14]; + uint8_t test_ptrn[14]; int sltm_pending; struct llist_head pending_msgs; @@ -68,7 +68,7 @@ struct mtp_link *mtp_link_alloc(void); void mtp_link_stop(struct mtp_link *link); void mtp_link_reset(struct mtp_link *link); int mtp_link_data(struct mtp_link *link, struct msgb *msg); -int mtp_link_submit_sccp_data(struct mtp_link *link, int sls, const u_int8_t *data, unsigned int length); +int mtp_link_submit_sccp_data(struct mtp_link *link, int sls, const uint8_t *data, unsigned int length); /* one time init function */ diff --git a/include/mtp_level3.h b/include/mtp_level3.h index 46cde40..9c64e5c 100644 --- a/include/mtp_level3.h +++ b/include/mtp_level3.h @@ -99,7 +99,7 @@ static inline u_int16_t c_swap_16(u_int16_t in) struct mtp_addr { u_int16_t dpc; u_int16_t opc; - u_int8_t link; + uint8_t link; } __attribute__((packed)); /* @@ -108,24 +108,24 @@ struct mtp_addr { */ struct mtp_level_3_hdr { #if __BYTE_ORDER == __LITTLE_ENDIAN - u_int8_t ser_ind : 4, + uint8_t ser_ind : 4, spare : 2, ni : 2; #elif __BYTE_ORDER == __BIG_ENDIAN - u_int8_t ni : 2, + uint8_t ni : 2, spare : 2, ser_ind : 4; #endif u_int32_t addr; - u_int8_t data[0]; + uint8_t data[0]; } __attribute__((packed)); struct mtp_level_3_cmn { #if __BYTE_ORDER == __LITTLE_ENDIAN - u_int8_t h0 : 4, + uint8_t h0 : 4, h1 : 4; #elif __BYTE_ORDER == __BIG_ENDIAN - u_int8_t h1 : 4, + uint8_t h1 : 4, h0 : 4; #endif } __attribute__((packed)); @@ -133,13 +133,13 @@ struct mtp_level_3_cmn { struct mtp_level_3_mng { struct mtp_level_3_cmn cmn; #if __BYTE_ORDER == __LITTLE_ENDIAN - u_int8_t spare : 4, + uint8_t spare : 4, length : 4; #elif __BYTE_ORDER == __BIG_ENDIAN - u_int8_t length : 4, + uint8_t length : 4, spare : 4; #endif - u_int8_t data[0]; + uint8_t data[0]; } __attribute__((packed)); struct mtp_level_3_prohib { @@ -149,14 +149,14 @@ struct mtp_level_3_prohib { } __attribute__((packed)); struct sccp_con_ctrl_prt_mgt { - u_int8_t sst; - u_int8_t assn; /* affected sub system number */ + uint8_t sst; + uint8_t assn; /* affected sub system number */ u_int16_t apoc; #if __BYTE_ORDER == __LITTLE_ENDIAN - u_int8_t mul_ind : 2, + uint8_t mul_ind : 2, spare : 6; #elif __BYTE_ORDER == __BIG_ENDIAN - u_int8_t spare : 6, + uint8_t spare : 6, mul_ind : 2; #endif } __attribute__((packed)); diff --git a/include/mtp_pcap.h b/include/mtp_pcap.h index 9334393..1b7334a 100644 --- a/include/mtp_pcap.h +++ b/include/mtp_pcap.h @@ -24,6 +24,6 @@ #include int mtp_pcap_write_header(int fd); -int mtp_pcap_write_msu(int fd, const u_int8_t *data, int length); +int mtp_pcap_write_msu(int fd, const uint8_t *data, int length); #endif diff --git a/include/openbsc_nat/bssap.h b/include/openbsc_nat/bssap.h index 8c785bb..4986f9d 100644 --- a/include/openbsc_nat/bssap.h +++ b/include/openbsc_nat/bssap.h @@ -36,14 +36,14 @@ enum BSSAP_MSG_TYPE { }; struct bssmap_header { - u_int8_t type; - u_int8_t length; + uint8_t type; + uint8_t length; } __attribute__((packed)); struct dtap_header { - u_int8_t type; - u_int8_t link_id; - u_int8_t length; + uint8_t type; + uint8_t link_id; + uint8_t length; } __attribute__((packed)); @@ -313,17 +313,17 @@ struct msgb *bssmap_create_layer3(struct msgb *msg); struct msgb *bssmap_create_reset(void); struct msgb *bssmap_create_clear_complete(void); struct msgb *bssmap_create_cipher_complete(struct msgb *layer3); -struct msgb *bssmap_create_cipher_reject(u_int8_t cause); -struct msgb *bssmap_create_sapi_reject(u_int8_t link_id); -struct msgb *bssmap_create_assignment_completed(struct gsm_lchan *lchan, u_int8_t rr_cause); -struct msgb *bssmap_create_assignment_failure(u_int8_t cause, u_int8_t *rr_cause); -struct msgb *bssmap_create_classmark_update(const u_int8_t *classmark, u_int8_t length); +struct msgb *bssmap_create_cipher_reject(uint8_t cause); +struct msgb *bssmap_create_sapi_reject(uint8_t link_id); +struct msgb *bssmap_create_assignment_completed(struct gsm_lchan *lchan, uint8_t rr_cause); +struct msgb *bssmap_create_assignment_failure(uint8_t cause, uint8_t *rr_cause); +struct msgb *bssmap_create_classmark_update(const uint8_t *classmark, uint8_t length); -void gsm0808_send_assignment_failure(struct gsm_lchan *l, u_int8_t cause, u_int8_t *rr_value); -void gsm0808_send_assignment_compl(struct gsm_lchan *l, u_int8_t rr_value); +void gsm0808_send_assignment_failure(struct gsm_lchan *l, uint8_t cause, uint8_t *rr_value); +void gsm0808_send_assignment_compl(struct gsm_lchan *l, uint8_t rr_value); int dtap_rcvmsg(struct gsm_lchan *lchan, struct msgb *msg, unsigned int length); -struct msgb *dtap_create_msg(struct msgb *msg_l3, u_int8_t link_id); +struct msgb *dtap_create_msg(struct msgb *msg_l3, uint8_t link_id); void bsc_queue_connection_write(struct sccp_connection *conn, struct msgb *msg); void bsc_free_queued(struct sccp_connection *conn); diff --git a/include/openbsc_nat/tlv.h b/include/openbsc_nat/tlv.h index 0fa8e40..a6ad48b 100644 --- a/include/openbsc_nat/tlv.h +++ b/include/openbsc_nat/tlv.h @@ -36,16 +36,16 @@ static inline u_int16_t TVLV_GROSS_LEN(u_int16_t len) /* TLV generation */ -static inline u_int8_t *lv_put(u_int8_t *buf, u_int8_t len, - const u_int8_t *val) +static inline uint8_t *lv_put(uint8_t *buf, uint8_t len, + const uint8_t *val) { *buf++ = len; memcpy(buf, val, len); return buf + len; } -static inline u_int8_t *tlv_put(u_int8_t *buf, u_int8_t tag, u_int8_t len, - const u_int8_t *val) +static inline uint8_t *tlv_put(uint8_t *buf, uint8_t tag, uint8_t len, + const uint8_t *val) { *buf++ = tag; *buf++ = len; @@ -53,7 +53,7 @@ static inline u_int8_t *tlv_put(u_int8_t *buf, u_int8_t tag, u_int8_t len, return buf + len; } -static inline u_int8_t *tlv16_put(u_int8_t *buf, u_int8_t tag, u_int8_t len, +static inline uint8_t *tlv16_put(uint8_t *buf, uint8_t tag, uint8_t len, const u_int16_t *val) { *buf++ = tag; @@ -62,8 +62,8 @@ static inline u_int8_t *tlv16_put(u_int8_t *buf, u_int8_t tag, u_int8_t len, return buf + len*2; } -static inline u_int8_t *tl16v_put(u_int8_t *buf, u_int8_t tag, u_int16_t len, - const u_int8_t *val) +static inline uint8_t *tl16v_put(uint8_t *buf, uint8_t tag, u_int16_t len, + const uint8_t *val) { *buf++ = tag; *buf++ = len >> 8; @@ -72,10 +72,10 @@ static inline u_int8_t *tl16v_put(u_int8_t *buf, u_int8_t tag, u_int16_t len, return buf + len*2; } -static inline u_int8_t *tvlv_put(u_int8_t *buf, u_int8_t tag, u_int16_t len, - const u_int8_t *val) +static inline uint8_t *tvlv_put(uint8_t *buf, uint8_t tag, u_int16_t len, + const uint8_t *val) { - u_int8_t *ret; + uint8_t *ret; if (len <= TVLV_MAX_ONEBYTE) { ret = tlv_put(buf, tag, len, val); @@ -86,30 +86,30 @@ static inline u_int8_t *tvlv_put(u_int8_t *buf, u_int8_t tag, u_int16_t len, return ret; } -static inline u_int8_t *msgb_tlv16_put(struct msgb *msg, u_int8_t tag, u_int8_t len, const u_int16_t *val) +static inline uint8_t *msgb_tlv16_put(struct msgb *msg, uint8_t tag, uint8_t len, const u_int16_t *val) { - u_int8_t *buf = msgb_put(msg, TLV16_GROSS_LEN(len)); + uint8_t *buf = msgb_put(msg, TLV16_GROSS_LEN(len)); return tlv16_put(buf, tag, len, val); } -static inline u_int8_t *msgb_tl16v_put(struct msgb *msg, u_int8_t tag, u_int16_t len, - const u_int8_t *val) +static inline uint8_t *msgb_tl16v_put(struct msgb *msg, uint8_t tag, u_int16_t len, + const uint8_t *val) { - u_int8_t *buf = msgb_put(msg, TL16V_GROSS_LEN(len)); + uint8_t *buf = msgb_put(msg, TL16V_GROSS_LEN(len)); return tl16v_put(buf, tag, len, val); } -static inline u_int8_t *msgb_tvlv_put(struct msgb *msg, u_int8_t tag, u_int16_t len, - const u_int8_t *val) +static inline uint8_t *msgb_tvlv_put(struct msgb *msg, uint8_t tag, u_int16_t len, + const uint8_t *val) { - u_int8_t *buf = msgb_put(msg, TVLV_GROSS_LEN(len)); + uint8_t *buf = msgb_put(msg, TVLV_GROSS_LEN(len)); return tvlv_put(buf, tag, len, val); } -static inline u_int8_t *msgb_l16tv_put(struct msgb *msg, u_int16_t len, u_int8_t tag, - const u_int8_t *val) +static inline uint8_t *msgb_l16tv_put(struct msgb *msg, u_int16_t len, uint8_t tag, + const uint8_t *val) { - u_int8_t *buf = msgb_put(msg, L16TV_GROSS_LEN(len)); + uint8_t *buf = msgb_put(msg, L16TV_GROSS_LEN(len)); *buf++ = len >> 8; *buf++ = len & 0xff; @@ -118,14 +118,14 @@ static inline u_int8_t *msgb_l16tv_put(struct msgb *msg, u_int16_t len, u_int8_t return buf + len; } -static inline u_int8_t *v_put(u_int8_t *buf, u_int8_t val) +static inline uint8_t *v_put(uint8_t *buf, uint8_t val) { *buf++ = val; return buf; } -static inline u_int8_t *tv_put(u_int8_t *buf, u_int8_t tag, - u_int8_t val) +static inline uint8_t *tv_put(uint8_t *buf, uint8_t tag, + uint8_t val) { *buf++ = tag; *buf++ = val; @@ -133,7 +133,7 @@ static inline u_int8_t *tv_put(u_int8_t *buf, u_int8_t tag, } /* 'val' is still in host byte order! */ -static inline u_int8_t *tv16_put(u_int8_t *buf, u_int8_t tag, +static inline uint8_t *tv16_put(uint8_t *buf, uint8_t tag, u_int16_t val) { *buf++ = tag; @@ -142,51 +142,51 @@ static inline u_int8_t *tv16_put(u_int8_t *buf, u_int8_t tag, return buf; } -static inline u_int8_t *msgb_lv_put(struct msgb *msg, u_int8_t len, const u_int8_t *val) +static inline uint8_t *msgb_lv_put(struct msgb *msg, uint8_t len, const uint8_t *val) { - u_int8_t *buf = msgb_put(msg, LV_GROSS_LEN(len)); + uint8_t *buf = msgb_put(msg, LV_GROSS_LEN(len)); return lv_put(buf, len, val); } -static inline u_int8_t *msgb_tlv_put(struct msgb *msg, u_int8_t tag, u_int8_t len, const u_int8_t *val) +static inline uint8_t *msgb_tlv_put(struct msgb *msg, uint8_t tag, uint8_t len, const uint8_t *val) { - u_int8_t *buf = msgb_put(msg, TLV_GROSS_LEN(len)); + uint8_t *buf = msgb_put(msg, TLV_GROSS_LEN(len)); return tlv_put(buf, tag, len, val); } -static inline u_int8_t *msgb_tv_put(struct msgb *msg, u_int8_t tag, u_int8_t val) +static inline uint8_t *msgb_tv_put(struct msgb *msg, uint8_t tag, uint8_t val) { - u_int8_t *buf = msgb_put(msg, 2); + uint8_t *buf = msgb_put(msg, 2); return tv_put(buf, tag, val); } -static inline u_int8_t *msgb_v_put(struct msgb *msg, u_int8_t val) +static inline uint8_t *msgb_v_put(struct msgb *msg, uint8_t val) { - u_int8_t *buf = msgb_put(msg, 1); + uint8_t *buf = msgb_put(msg, 1); return v_put(buf, val); } -static inline u_int8_t *msgb_tv16_put(struct msgb *msg, u_int8_t tag, u_int16_t val) +static inline uint8_t *msgb_tv16_put(struct msgb *msg, uint8_t tag, u_int16_t val) { - u_int8_t *buf = msgb_put(msg, 3); + uint8_t *buf = msgb_put(msg, 3); return tv16_put(buf, tag, val); } -static inline u_int8_t *msgb_tlv_push(struct msgb *msg, u_int8_t tag, u_int8_t len, const u_int8_t *val) +static inline uint8_t *msgb_tlv_push(struct msgb *msg, uint8_t tag, uint8_t len, const uint8_t *val) { - u_int8_t *buf = msgb_push(msg, TLV_GROSS_LEN(len)); + uint8_t *buf = msgb_push(msg, TLV_GROSS_LEN(len)); return tlv_put(buf, tag, len, val); } -static inline u_int8_t *msgb_tv_push(struct msgb *msg, u_int8_t tag, u_int8_t val) +static inline uint8_t *msgb_tv_push(struct msgb *msg, uint8_t tag, uint8_t val) { - u_int8_t *buf = msgb_push(msg, 2); + uint8_t *buf = msgb_push(msg, 2); return tv_put(buf, tag, val); } -static inline u_int8_t *msgb_tv16_push(struct msgb *msg, u_int8_t tag, u_int16_t val) +static inline uint8_t *msgb_tv16_push(struct msgb *msg, uint8_t tag, u_int16_t val) { - u_int8_t *buf = msgb_push(msg, 3); + uint8_t *buf = msgb_push(msg, 3); return tv16_put(buf, tag, val); } @@ -194,7 +194,7 @@ static inline u_int8_t *msgb_tv16_push(struct msgb *msg, u_int8_t tag, u_int16_t struct tlv_p_entry { u_int16_t len; - const u_int8_t *val; + const uint8_t *val; }; enum tlv_type { @@ -208,7 +208,7 @@ enum tlv_type { struct tlv_def { enum tlv_type type; - u_int8_t fixed_len; + uint8_t fixed_len; }; struct tlv_definition { @@ -221,11 +221,11 @@ struct tlv_parsed { extern struct tlv_definition tvlv_att_def; -int tlv_parse_one(u_int8_t *o_tag, u_int16_t *o_len, const u_int8_t **o_val, +int tlv_parse_one(uint8_t *o_tag, u_int16_t *o_len, const uint8_t **o_val, const struct tlv_definition *def, - const u_int8_t *buf, int buf_len); + const uint8_t *buf, int buf_len); int tlv_parse(struct tlv_parsed *dec, const struct tlv_definition *def, - const u_int8_t *buf, int buf_len, u_int8_t lv_tag, u_int8_t lv_tag2); + const uint8_t *buf, int buf_len, uint8_t lv_tag, uint8_t lv_tag2); #define TLVP_PRESENT(x, y) ((x)->lv[y].val) #define TLVP_LEN(x, y) (x)->lv[y].len diff --git a/src/bss_patch.c b/src/bss_patch.c index d8d5405..2fa39a7 100644 --- a/src/bss_patch.c +++ b/src/bss_patch.c @@ -34,7 +34,7 @@ static void patch_ass_rqst(struct msgb *msg, int length) { struct tlv_parsed tp; - u_int8_t *data, audio; + uint8_t *data, audio; int len; tlv_parse(&tp, gsm0808_att_tlvdef(), msg->l3h + 1, length - 1, 0, 0); @@ -42,7 +42,7 @@ static void patch_ass_rqst(struct msgb *msg, int length) if (len < 3) return; - data = (u_int8_t *) TLVP_VAL(&tp, GSM0808_IE_CHANNEL_TYPE); + data = (uint8_t *) TLVP_VAL(&tp, GSM0808_IE_CHANNEL_TYPE); /* no speech... ignore */ if ((data[0] & 0xf) != 0x1) return; @@ -58,7 +58,7 @@ static void patch_ass_rqst(struct msgb *msg, int length) static void patch_ass_cmpl(struct msgb *msg, int length) { struct tlv_parsed tp; - u_int8_t *data; + uint8_t *data; tlv_parse(&tp, gsm0808_att_tlvdef(), msg->l3h + 1, length - 1, 0, 0); if (!TLVP_PRESENT(&tp, GSM0808_IE_CHOSEN_CHANNEL)) { @@ -72,10 +72,10 @@ static void patch_ass_cmpl(struct msgb *msg, int length) } /* claim to have a TCH/H with no mode indication */ - data = (u_int8_t *) TLVP_VAL(&tp, GSM0808_IE_CHOSEN_CHANNEL); + data = (uint8_t *) TLVP_VAL(&tp, GSM0808_IE_CHOSEN_CHANNEL); data[0] = 0x09; - data = (u_int8_t *) TLVP_VAL(&tp, GSM0808_IE_SPEECH_VERSION); + data = (uint8_t *) TLVP_VAL(&tp, GSM0808_IE_SPEECH_VERSION); data[0] = GSM0808_PERM_HR3; } @@ -244,8 +244,8 @@ void bss_rewrite_header_for_msc(int rc, struct msgb *target, struct msgb *inpt, static int patch_address(u_int32_t offset, int pc, struct msgb *msg) { struct sccp_called_party_address *party; - u_int8_t *the_pc; - u_int8_t pc_low, pc_high; + uint8_t *the_pc; + uint8_t pc_low, pc_high; party = (struct sccp_called_party_address *)(msg->l2h + offset + 1); the_pc = &party->data[0]; diff --git a/src/bssap_sccp.c b/src/bssap_sccp.c index 72e24ae..e6b7271 100644 --- a/src/bssap_sccp.c +++ b/src/bssap_sccp.c @@ -130,7 +130,7 @@ struct msgb *create_sccp_refuse(struct sccp_source_reference *dest_ref) struct msgb *create_reset() { - static const u_int8_t reset[] = { + static const uint8_t reset[] = { 0x09, 0x00, 0x03, 0x05, 0x07, 0x02, 0x42, 0xfe, 0x02, 0x42, 0xfe, 0x06, 0x00, 0x04, 0x30, 0x04, 0x01, 0x20 diff --git a/src/input/ipaccess.c b/src/input/ipaccess.c index b679476..b603015 100644 --- a/src/input/ipaccess.c +++ b/src/input/ipaccess.c @@ -44,9 +44,9 @@ #define TS1_ALLOC_SIZE 4096 -static const u_int8_t pong[] = { 0, 1, IPAC_PROTO_IPACCESS, IPAC_MSGT_PONG }; -static const u_int8_t id_ack[] = { 0, 1, IPAC_PROTO_IPACCESS, IPAC_MSGT_ID_ACK }; -static const u_int8_t id_req[] = { 0, 17, IPAC_PROTO_IPACCESS, IPAC_MSGT_ID_GET, +static const uint8_t pong[] = { 0, 1, IPAC_PROTO_IPACCESS, IPAC_MSGT_PONG }; +static const uint8_t id_ack[] = { 0, 1, IPAC_PROTO_IPACCESS, IPAC_MSGT_ID_ACK }; +static const uint8_t id_req[] = { 0, 17, IPAC_PROTO_IPACCESS, IPAC_MSGT_ID_GET, 0x01, IPAC_IDTAG_UNIT, 0x01, IPAC_IDTAG_MACADDR, 0x01, IPAC_IDTAG_LOCATION1, @@ -92,7 +92,7 @@ int ipaccess_send_id_req(int fd) 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) { diff --git a/src/main.c b/src/main.c index 7bba82e..cb78653 100644 --- a/src/main.c +++ b/src/main.c @@ -110,7 +110,7 @@ static void mgcp_reset(struct bsc_data *bsc) "RSIP 1 13@mgw MGCP 1.0\r\n" }; - mgcp_forward(bsc, (const u_int8_t *) mgcp_reset, strlen(mgcp_reset)); + mgcp_forward(bsc, (const uint8_t *) mgcp_reset, strlen(mgcp_reset)); } /* @@ -663,7 +663,7 @@ static void send_local_rlsd(struct mtp_link *link, struct sccp_parse_result *res static void send_reset_ack(struct mtp_link *link, int sls) { - static const u_int8_t reset_ack[] = { + static const uint8_t reset_ack[] = { 0x09, 0x00, 0x03, 0x05, 0x7, 0x02, 0x42, 0xfe, 0x02, 0x42, 0xfe, 0x03, 0x00, 0x01, 0x31 @@ -675,7 +675,7 @@ static void send_reset_ack(struct mtp_link *link, int sls) static void start_flood() { static unsigned int i = 0; - static const u_int8_t paging_cmd[] = { + static const uint8_t paging_cmd[] = { 0x09, 0x00, 0x03, 0x07, 0x0b, 0x04, 0x43, 0x0a, 0x00, 0xfe, 0x04, 0x43, 0x5c, 0x00, 0xfe, 0x10, 0x00, 0x0e, 0x52, 0x08, 0x08, 0x29, 0x80, 0x10, diff --git a/src/mgcp/mgcp_network.c b/src/mgcp/mgcp_network.c index fbbfbf2..3a8381d 100644 --- a/src/mgcp/mgcp_network.c +++ b/src/mgcp/mgcp_network.c @@ -44,18 +44,18 @@ /* according to rtp_proxy.c 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; diff --git a/src/mgcp_ss7.c b/src/mgcp_ss7.c index b273c31..cea6881 100644 --- a/src/mgcp_ss7.c +++ b/src/mgcp_ss7.c @@ -76,7 +76,7 @@ struct mgcp_ss7_endpoint { }; static void mgcp_ss7_endp_free(struct mgcp_ss7* ss7, int endp); -static void mgcp_ss7_do_exec(struct mgcp_ss7 *mgcp, u_int8_t type, u_int32_t port, u_int32_t param); +static void mgcp_ss7_do_exec(struct mgcp_ss7 *mgcp, uint8_t type, u_int32_t port, u_int32_t param); static void mgcp_mgw_vty_init(); static void check_exit(int status) @@ -371,7 +371,7 @@ static void allocate_endp(struct mgcp_ss7 *ss7, int endp_no) } #endif -static void mgcp_ss7_do_exec(struct mgcp_ss7 *mgcp, u_int8_t type, u_int32_t port, u_int32_t param) +static void mgcp_ss7_do_exec(struct mgcp_ss7 *mgcp, uint8_t type, u_int32_t port, u_int32_t param) { #ifndef NO_UNIPORTE struct mgcp_ss7_endpoint *mgw_endp = &mgcp->mgw_end[port]; @@ -404,7 +404,7 @@ static void mgcp_ss7_do_exec(struct mgcp_ss7 *mgcp, u_int8_t type, u_int32_t por #endif } -void mgcp_ss7_exec(struct mgcp_ss7 *mgcp, u_int8_t type, u_int32_t port, u_int32_t param) +void mgcp_ss7_exec(struct mgcp_ss7 *mgcp, uint8_t type, u_int32_t port, u_int32_t param) { struct mgcp_ss7_cmd *cmd = malloc(sizeof(*cmd)); memset(cmd, 0, sizeof(*cmd)); diff --git a/src/msc_conn.c b/src/msc_conn.c index 1e3357d..75b981b 100644 --- a/src/msc_conn.c +++ b/src/msc_conn.c @@ -204,7 +204,7 @@ static int ipaccess_a_fd_cb(struct bsc_fd *bfd) /* we can not forward it right now */ if (link->sltm_pending) { LOGP(DMSC, LOGL_NOTICE, "Queueing msg for pending SLTM.\n"); - msg->l3h = (u_int8_t *) sls; + msg->l3h = (uint8_t *) sls; msgb_enqueue(&link->pending_msgs, msg); return 0; } @@ -430,7 +430,7 @@ static int mgcp_do_read(struct bsc_fd *fd) return 0; } -void mgcp_forward(struct bsc_data *bsc, const u_int8_t *data, unsigned int length) +void mgcp_forward(struct bsc_data *bsc, const uint8_t *data, unsigned int length) { struct msgb *mgcp; @@ -569,7 +569,7 @@ static void msc_send_id_response(struct bsc_data *bsc) msg = msgb_alloc_headroom(4096, 128, "id resp"); msg->l2h = msgb_v_put(msg, IPAC_MSGT_ID_RESP); msgb_l16tv_put(msg, strlen(bsc->token) + 1, - IPAC_IDTAG_UNITNAME, (u_int8_t *) bsc->token); + IPAC_IDTAG_UNITNAME, (uint8_t *) bsc->token); msc_send(bsc, msg, IPAC_PROTO_IPACCESS); } diff --git a/src/mtp_layer3.c b/src/mtp_layer3.c index ef067e5..446e0e9 100644 --- a/src/mtp_layer3.c +++ b/src/mtp_layer3.c @@ -50,11 +50,11 @@ static struct msgb *mtp_msg_alloc(struct mtp_link *link) static struct msgb *mtp_create_sltm(struct mtp_link *link) { - const u_int8_t test_ptrn[14] = { 'G', 'S', 'M', 'M', 'M', 'S', }; + const uint8_t test_ptrn[14] = { 'G', 'S', 'M', 'M', 'M', 'S', }; struct mtp_level_3_hdr *hdr; struct mtp_level_3_mng *mng; struct msgb *msg = mtp_msg_alloc(link); - u_int8_t *data; + uint8_t *data; if (!msg) return NULL; @@ -140,7 +140,7 @@ static struct msgb *mtp_sccp_alloc_ssa(struct mtp_link *link, int sls) struct sccp_data_unitdata *udt; struct sccp_con_ctrl_prt_mgt *prt; struct mtp_level_3_hdr *hdr; - u_int8_t *data; + uint8_t *data; struct msgb *out = mtp_msg_alloc(link); @@ -479,9 +479,9 @@ int mtp_link_data(struct mtp_link *link, struct msgb *msg) return rc; } -int mtp_link_submit_sccp_data(struct mtp_link *link, int sls, const u_int8_t *data, unsigned int length) +int mtp_link_submit_sccp_data(struct mtp_link *link, int sls, const uint8_t *data, unsigned int length) { - u_int8_t *put_ptr; + uint8_t *put_ptr; struct mtp_level_3_hdr *hdr; struct msgb *msg; diff --git a/src/openbsc_nat/tlv_parser.c b/src/openbsc_nat/tlv_parser.c index e44b3a1..9255fed 100644 --- a/src/openbsc_nat/tlv_parser.c +++ b/src/openbsc_nat/tlv_parser.c @@ -28,11 +28,11 @@ int tlv_dump(struct tlv_parsed *dec) * * Also, returns the number of bytes consumed by the TLV entry */ -int tlv_parse_one(u_int8_t *o_tag, u_int16_t *o_len, const u_int8_t **o_val, +int tlv_parse_one(uint8_t *o_tag, u_int16_t *o_len, const uint8_t **o_val, const struct tlv_definition *def, - const u_int8_t *buf, int buf_len) + const uint8_t *buf, int buf_len) { - u_int8_t tag; + uint8_t tag; int len; tag = *buf; @@ -103,8 +103,8 @@ int tlv_parse_one(u_int8_t *o_tag, u_int16_t *o_len, const u_int8_t **o_val, * lv_tag2: input: a second initial LV tag following lv_tag */ int tlv_parse(struct tlv_parsed *dec, const struct tlv_definition *def, - const u_int8_t *buf, int buf_len, u_int8_t lv_tag, - u_int8_t lv_tag2) + const uint8_t *buf, int buf_len, uint8_t lv_tag, + uint8_t lv_tag2) { int ofs = 0, num_parsed = 0; u_int16_t len; @@ -136,8 +136,8 @@ int tlv_parse(struct tlv_parsed *dec, const struct tlv_definition *def, while (ofs < buf_len) { int rv; - u_int8_t tag; - const u_int8_t *val; + uint8_t tag; + const uint8_t *val; rv = tlv_parse_one(&tag, &len, &val, def, &buf[ofs], buf_len-ofs); diff --git a/src/pcap.c b/src/pcap.c index 549afa9..de6f77c 100644 --- a/src/pcap.c +++ b/src/pcap.c @@ -64,7 +64,7 @@ int mtp_pcap_write_header(int fd) return write(fd, &hdr, sizeof(hdr)); } -int mtp_pcap_write_msu(int fd, const u_int8_t *data, int length) +int mtp_pcap_write_msu(int fd, const uint8_t *data, int length) { int rc_h, rc_d; struct timeval tv; diff --git a/tests/mtp/mtp_parse_test.c b/tests/mtp/mtp_parse_test.c index f1f218b..8e4f533 100644 --- a/tests/mtp/mtp_parse_test.c +++ b/tests/mtp/mtp_parse_test.c @@ -10,7 +10,7 @@ #define ARRAY_SIZE(a) (sizeof(a)/sizeof(a[0])) struct mtp_test { - const u_int8_t *input; + const uint8_t *input; const u_int16_t length; struct mtp_level_3_hdr hdr; @@ -522,7 +522,7 @@ static struct mtp_test tests[] = { } }; -static void check_hdr(const u_int8_t *data, const struct mtp_level_3_hdr *t_hdr) +static void check_hdr(const uint8_t *data, const struct mtp_level_3_hdr *t_hdr) { struct mtp_level_3_hdr *hdr; hdr = (struct mtp_level_3_hdr *) data; @@ -542,7 +542,7 @@ static void check_hdr(const u_int8_t *data, const struct mtp_level_3_hdr *t_hdr) abort(); } -static void check_mng(const u_int8_t *data, const struct mtp_level_3_mng *t_mng) +static void check_mng(const uint8_t *data, const struct mtp_level_3_mng *t_mng) { struct mtp_level_3_hdr *hdr = (struct mtp_level_3_hdr *) data; struct mtp_level_3_mng *mng = (struct mtp_level_3_mng *) &hdr->data[0]; @@ -560,7 +560,7 @@ static void check_mng(const u_int8_t *data, const struct mtp_level_3_mng *t_mng) abort(); } -static void check_prohib(const u_int8_t *data, const struct mtp_level_3_prohib *t_prohib) +static void check_prohib(const uint8_t *data, const struct mtp_level_3_prohib *t_prohib) { struct mtp_level_3_hdr *hdr = (struct mtp_level_3_hdr *) data; struct mtp_level_3_prohib *prohib = (struct mtp_level_3_prohib *) &hdr->data[0]; @@ -606,9 +606,9 @@ int main(int argc, char **argv) .mul_ind = 1, }; - u_int8_t data[] = { 0x03, 0xfe, 0x5b, 0x00, 0x01 }; + uint8_t data[] = { 0x03, 0xfe, 0x5b, 0x00, 0x01 }; if (memcmp(&prt, data, 5) != 0) { - u_int8_t *d = (u_int8_t *) &prt; + uint8_t *d = (uint8_t *) &prt; fprintf(stderr, "GOT: 0x%.2x 0x%.2x 0x%.2x 0x%.2x 0x%.2x\n", d[0], d[1], d[2], d[3], d[4]); abort(); diff --git a/tests/patching/patching_test.c b/tests/patching/patching_test.c index 8bd0d17..ecbad83 100644 --- a/tests/patching/patching_test.c +++ b/tests/patching/patching_test.c @@ -5,39 +5,39 @@ #include #include -u_int8_t pkt125[] = { +uint8_t pkt125[] = { 0x06, 0x01, 0x04, 0x00, 0x00, 0x01, 0x0b, 0x00, 0x09, 0x01, 0x0b, 0x03, 0x01, 0x0b, 0x25, 0x01, 0x00, 0x02 }; -u_int8_t pkt125_res[] = { +uint8_t pkt125_res[] = { 0x06, 0x01, 0x04, 0x00, 0x00, 0x01, 0x0b, 0x00, 0x09, 0x01, 0x0b, 0x03, 0x01, 0x0a, 0x11, 0x01, 0x00, 0x02 }; -u_int8_t pkt28[] = { +uint8_t pkt28[] = { 0x06, 0x01, 0x05, 0x2b, 0x00, 0x01, 0x09, 0x00, 0x07, 0x02, 0x21, 0x08, 0x2c, 0x02, 0x40, 0x11 }; -u_int8_t pkt28_res[] = { +uint8_t pkt28_res[] = { 0x06, 0x01, 0x05, 0x2b, 0x00, 0x01, 0x09, 0x00, 0x07, 0x02, 0x21, 0x09, 0x2c, 0x02, 0x40, 0x25 }; -u_int8_t reset_ack[] = { +uint8_t reset_ack[] = { 0x09, 0x00, 0x03, 0x07, 0x0b, 0x04, 0x43, 0x0a, 0x00, 0xfe, 0x04, 0x43, 0x5c, 0x00, 0xfe, 0x03, 0x00, 0x01, 0x31 }; -u_int8_t cc[] = { +uint8_t cc[] = { 0x02, 0x01, 0x04, 0x00, 0x01, 0x01, 0xb4, 0x02, 0x01, 0x00 }; struct result { - u_int8_t *input; + uint8_t *input; int inp_len; - const u_int8_t *expected; + const uint8_t *expected; int exp_len; int result; }; @@ -75,14 +75,14 @@ static struct result results[] = { }, }; -static u_int8_t udt_with_poi[] = { +static uint8_t udt_with_poi[] = { 0x09, 0x00, 0x03, 0x07, 0x0b, 0x04, 0x43, 0x0a, 0x00, 0xfe, 0x04, 0x43, 0x5c, 0x00, 0xfe, 0x10, 0x00, 0x0e, 0x44, 0x04, 0x01, 0x00, 0x01, 0x00, 0x01, 0x1e, 0x05, 0x1e, 0x00, 0x00, 0x00, 0x40 }; -static const u_int8_t udt_without_poi[] = { +static const uint8_t udt_without_poi[] = { 0x09, 0x00, 0x03, 0x05, 0x07, 0x02, 0x42, 0xfe, 0x02, 0x42, 0xfe, @@ -90,7 +90,7 @@ static const u_int8_t udt_without_poi[] = { 0x04, 0x01, 0x00, 0x01, 0x00, 0x01, 0x1e, 0x05, 0x1e, 0x00, 0x00, 0x00, 0x40 }; -static u_int8_t cr_with_poi [] = { +static uint8_t cr_with_poi [] = { 0x01, 0x01, 0x04, 0x00, 0x02, 0x02, 0x06, 0x04, 0xc3, 0x5c, 0x00, 0xfe, 0x0f, 0x21, 0x00, 0x1f, 0x57, 0x05, 0x08, @@ -99,7 +99,7 @@ static u_int8_t cr_with_poi [] = { 0x81, 0x08, 0x29, 0x47, 0x80, 0x00, 0x00, 0x00, 0x00, 0x80, 0x21, 0x01, 0x00 }; -static const u_int8_t cr_without_poi [] = { +static const uint8_t cr_without_poi [] = { 0x01, 0x01, 0x04, 0x00, 0x02, 0x02, 0x04, 0x02, 0x42, 0xfe, 0x0f, 0x21, 0x00, 0x1f, 0x57, 0x05, 0x08, @@ -108,7 +108,7 @@ static const u_int8_t cr_without_poi [] = { 0x81, 0x08, 0x29, 0x47, 0x80, 0x00, 0x00, 0x00, 0x00, 0x80, 0x21, 0x01, 0x00 }; -static u_int8_t cr2_without_poi[] = { +static uint8_t cr2_without_poi[] = { 0x01, 0x00, 0x00, 0x03, 0x02, 0x02, 0x04, 0x02, 0x42, 0xfe, 0x0f, 0x1f, 0x00, 0x1d, 0x57, 0x05, 0x08, 0x00, 0x72, 0xf4, 0x80, 0x20, 0x1d, 0xc3, @@ -140,12 +140,12 @@ static struct result rewrite_results_to_msc[] = { }; -u_int8_t paging_cmd[] = { +uint8_t paging_cmd[] = { 0x09, 0x00, 0x03, 0x07, 0x0b, 0x04, 0x43, 0x0a, 0x00, 0xfe, 0x04, 0x43, 0x5c, 0x00, 0xfe, 0x10, 0x00, 0x0e, 0x52, 0x08, 0x08, 0x29, 0x80, 0x10, 0x76, 0x10, 0x77, 0x46, 0x05, 0x1a, 0x01, 0x06 }; -u_int8_t paging_cmd_patched[] = { +uint8_t paging_cmd_patched[] = { 0x09, 0x00, 0x03, 0x07, 0x0b, 0x04, 0x43, 0x02, 0x00, 0xfe, 0x04, 0x43, 0x01, 0x00, 0xfe, 0x10, 0x00, 0x0e, 0x52, 0x08, 0x08, 0x29, 0x80, 0x10, -- cgit v1.2.3