aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2010-07-31 04:38:17 +0800
committerHolger Hans Peter Freyther <zecke@selfish.org>2010-07-31 04:38:17 +0800
commit585f3d90d17745418e162b26e76f92d6c36cf3a0 (patch)
treea29d6763fae57a058703639c16156464b36bf5b0
parent5aa17014deace6d91a5cbb9784a9c05521ba19c8 (diff)
u_int16_t -> uint16_t
-rw-r--r--include/ipaccess.h2
-rw-r--r--include/mtp_level3.h10
-rw-r--r--include/openbsc_nat/tlv.h26
-rw-r--r--src/mgcp/mgcp_network.c2
-rw-r--r--src/openbsc_nat/tlv_parser.c4
-rw-r--r--src/pcap.c4
-rw-r--r--tests/mtp/mtp_parse_test.c2
7 files changed, 25 insertions, 25 deletions
diff --git a/include/ipaccess.h b/include/ipaccess.h
index c6c4739..ca12eed 100644
--- a/include/ipaccess.h
+++ b/include/ipaccess.h
@@ -7,7 +7,7 @@
#define IPA_TCP_PORT_RSL 3003
struct ipaccess_head {
- u_int16_t len; /* network byte order */
+ uint16_t len; /* network byte order */
uint8_t proto;
uint8_t data[0];
} __attribute__ ((packed));
diff --git a/include/mtp_level3.h b/include/mtp_level3.h
index 9c64e5c..881cee3 100644
--- a/include/mtp_level3.h
+++ b/include/mtp_level3.h
@@ -77,7 +77,7 @@ static inline u_int32_t c_swap_32(u_int32_t in)
((in & 0x00ff0000) >> 8) |
((in & 0xff000000) >> 24));
}
-static inline u_int16_t c_swap_16(u_int16_t in)
+static inline uint16_t c_swap_16(uint16_t in)
{
return (((in & 0x00ff) << 8) |
(in & 0xff00) >> 8);
@@ -97,8 +97,8 @@ static inline u_int16_t c_swap_16(u_int16_t in)
* not the on wire address...
*/
struct mtp_addr {
- u_int16_t dpc;
- u_int16_t opc;
+ uint16_t dpc;
+ uint16_t opc;
uint8_t link;
} __attribute__((packed));
@@ -145,13 +145,13 @@ struct mtp_level_3_mng {
struct mtp_level_3_prohib {
struct mtp_level_3_cmn cmn;
- u_int16_t apoc;
+ uint16_t apoc;
} __attribute__((packed));
struct sccp_con_ctrl_prt_mgt {
uint8_t sst;
uint8_t assn; /* affected sub system number */
- u_int16_t apoc;
+ uint16_t apoc;
#if __BYTE_ORDER == __LITTLE_ENDIAN
uint8_t mul_ind : 2,
spare : 6;
diff --git a/include/openbsc_nat/tlv.h b/include/openbsc_nat/tlv.h
index a6ad48b..88bd9af 100644
--- a/include/openbsc_nat/tlv.h
+++ b/include/openbsc_nat/tlv.h
@@ -26,7 +26,7 @@
#define TVLV_MAX_ONEBYTE 0x7f
-static inline u_int16_t TVLV_GROSS_LEN(u_int16_t len)
+static inline uint16_t TVLV_GROSS_LEN(uint16_t len)
{
if (len <= TVLV_MAX_ONEBYTE)
return TLV_GROSS_LEN(len);
@@ -54,7 +54,7 @@ static inline uint8_t *tlv_put(uint8_t *buf, uint8_t tag, uint8_t len,
}
static inline uint8_t *tlv16_put(uint8_t *buf, uint8_t tag, uint8_t len,
- const u_int16_t *val)
+ const uint16_t *val)
{
*buf++ = tag;
*buf++ = len;
@@ -62,7 +62,7 @@ static inline uint8_t *tlv16_put(uint8_t *buf, uint8_t tag, uint8_t len,
return buf + len*2;
}
-static inline uint8_t *tl16v_put(uint8_t *buf, uint8_t tag, u_int16_t len,
+static inline uint8_t *tl16v_put(uint8_t *buf, uint8_t tag, uint16_t len,
const uint8_t *val)
{
*buf++ = tag;
@@ -72,7 +72,7 @@ static inline uint8_t *tl16v_put(uint8_t *buf, uint8_t tag, u_int16_t len,
return buf + len*2;
}
-static inline uint8_t *tvlv_put(uint8_t *buf, uint8_t tag, u_int16_t len,
+static inline uint8_t *tvlv_put(uint8_t *buf, uint8_t tag, uint16_t len,
const uint8_t *val)
{
uint8_t *ret;
@@ -86,27 +86,27 @@ static inline uint8_t *tvlv_put(uint8_t *buf, uint8_t tag, u_int16_t len,
return ret;
}
-static inline uint8_t *msgb_tlv16_put(struct msgb *msg, uint8_t tag, uint8_t len, const u_int16_t *val)
+static inline uint8_t *msgb_tlv16_put(struct msgb *msg, uint8_t tag, uint8_t len, const uint16_t *val)
{
uint8_t *buf = msgb_put(msg, TLV16_GROSS_LEN(len));
return tlv16_put(buf, tag, len, val);
}
-static inline uint8_t *msgb_tl16v_put(struct msgb *msg, uint8_t tag, u_int16_t len,
+static inline uint8_t *msgb_tl16v_put(struct msgb *msg, uint8_t tag, uint16_t len,
const uint8_t *val)
{
uint8_t *buf = msgb_put(msg, TL16V_GROSS_LEN(len));
return tl16v_put(buf, tag, len, val);
}
-static inline uint8_t *msgb_tvlv_put(struct msgb *msg, uint8_t tag, u_int16_t len,
+static inline uint8_t *msgb_tvlv_put(struct msgb *msg, uint8_t tag, uint16_t len,
const uint8_t *val)
{
uint8_t *buf = msgb_put(msg, TVLV_GROSS_LEN(len));
return tvlv_put(buf, tag, len, val);
}
-static inline uint8_t *msgb_l16tv_put(struct msgb *msg, u_int16_t len, uint8_t tag,
+static inline uint8_t *msgb_l16tv_put(struct msgb *msg, uint16_t len, uint8_t tag,
const uint8_t *val)
{
uint8_t *buf = msgb_put(msg, L16TV_GROSS_LEN(len));
@@ -134,7 +134,7 @@ static inline uint8_t *tv_put(uint8_t *buf, uint8_t tag,
/* 'val' is still in host byte order! */
static inline uint8_t *tv16_put(uint8_t *buf, uint8_t tag,
- u_int16_t val)
+ uint16_t val)
{
*buf++ = tag;
*buf++ = val >> 8;
@@ -166,7 +166,7 @@ static inline uint8_t *msgb_v_put(struct msgb *msg, uint8_t val)
return v_put(buf, val);
}
-static inline uint8_t *msgb_tv16_put(struct msgb *msg, uint8_t tag, u_int16_t val)
+static inline uint8_t *msgb_tv16_put(struct msgb *msg, uint8_t tag, uint16_t val)
{
uint8_t *buf = msgb_put(msg, 3);
return tv16_put(buf, tag, val);
@@ -184,7 +184,7 @@ static inline uint8_t *msgb_tv_push(struct msgb *msg, uint8_t tag, uint8_t val)
return tv_put(buf, tag, val);
}
-static inline uint8_t *msgb_tv16_push(struct msgb *msg, uint8_t tag, u_int16_t val)
+static inline uint8_t *msgb_tv16_push(struct msgb *msg, uint8_t tag, uint16_t val)
{
uint8_t *buf = msgb_push(msg, 3);
return tv16_put(buf, tag, val);
@@ -193,7 +193,7 @@ static inline uint8_t *msgb_tv16_push(struct msgb *msg, uint8_t tag, u_int16_t v
/* TLV parsing */
struct tlv_p_entry {
- u_int16_t len;
+ uint16_t len;
const uint8_t *val;
};
@@ -221,7 +221,7 @@ struct tlv_parsed {
extern struct tlv_definition tvlv_att_def;
-int tlv_parse_one(uint8_t *o_tag, u_int16_t *o_len, const uint8_t **o_val,
+int tlv_parse_one(uint8_t *o_tag, uint16_t *o_len, const uint8_t **o_val,
const struct tlv_definition *def,
const uint8_t *buf, int buf_len);
int tlv_parse(struct tlv_parsed *dec, const struct tlv_definition *def,
diff --git a/src/mgcp/mgcp_network.c b/src/mgcp/mgcp_network.c
index 3a8381d..4951088 100644
--- a/src/mgcp/mgcp_network.c
+++ b/src/mgcp/mgcp_network.c
@@ -58,7 +58,7 @@ struct rtp_hdr {
uint8_t marker:1,
payload_type:7;
#endif
- u_int16_t sequence;
+ uint16_t sequence;
u_int32_t timestamp;
u_int32_t ssrc;
} __attribute__((packed));
diff --git a/src/openbsc_nat/tlv_parser.c b/src/openbsc_nat/tlv_parser.c
index 9255fed..9b38b9f 100644
--- a/src/openbsc_nat/tlv_parser.c
+++ b/src/openbsc_nat/tlv_parser.c
@@ -28,7 +28,7 @@ int tlv_dump(struct tlv_parsed *dec)
*
* Also, returns the number of bytes consumed by the TLV entry
*/
-int tlv_parse_one(uint8_t *o_tag, u_int16_t *o_len, const uint8_t **o_val,
+int tlv_parse_one(uint8_t *o_tag, uint16_t *o_len, const uint8_t **o_val,
const struct tlv_definition *def,
const uint8_t *buf, int buf_len)
{
@@ -107,7 +107,7 @@ int tlv_parse(struct tlv_parsed *dec, const struct tlv_definition *def,
uint8_t lv_tag2)
{
int ofs = 0, num_parsed = 0;
- u_int16_t len;
+ uint16_t len;
memset(dec, 0, sizeof(*dec));
diff --git a/src/pcap.c b/src/pcap.c
index de6f77c..ac29dee 100644
--- a/src/pcap.c
+++ b/src/pcap.c
@@ -34,8 +34,8 @@
*/
struct pcap_hdr {
u_int32_t magic_number;
- u_int16_t version_major;
- u_int16_t version_minor;
+ uint16_t version_major;
+ uint16_t version_minor;
int32_t thiszone;
u_int32_t sigfigs;
u_int32_t snaplen;
diff --git a/tests/mtp/mtp_parse_test.c b/tests/mtp/mtp_parse_test.c
index 8e4f533..eb97ad6 100644
--- a/tests/mtp/mtp_parse_test.c
+++ b/tests/mtp/mtp_parse_test.c
@@ -11,7 +11,7 @@
struct mtp_test {
const uint8_t *input;
- const u_int16_t length;
+ const uint16_t length;
struct mtp_level_3_hdr hdr;
int has_mng;