aboutsummaryrefslogtreecommitdiff
path: root/helper
diff options
context:
space:
mode:
authorChristophe Milard <christophe.milard@linaro.org>2016-01-27 15:59:41 +0100
committerMaxim Uvarov <maxim.uvarov@linaro.org>2016-02-08 20:45:24 +0300
commit2c4f0006c83a17ab910ff275f3fbe8a468be6e5c (patch)
treee3b5574567b3f51fc209c02cf1e945b65a9ca218 /helper
parent6538ae64a15cc2c9467ca3c577c28ce2c655297b (diff)
api: endian: rename endian types with odp_ prefix
The following types: uint16le_t, uint16be_t, uint32le_t, uint32be_t, uint64le_t, uint64be_t, uint16sum_t, uint32sum_t defined in the api and in platform/linux-generic/include/odp/plat/byteorder_types.h were not odp_* prefixed and could create name clash with an applications. This patch prefixes those with odp_*, suppressing "int" for shortness. e.g. uint16le_t becomes odp_u16le_t Also modifies files using these types, of course. Signed-off-by: Christophe Milard <christophe.milard@linaro.org> Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
Diffstat (limited to 'helper')
-rw-r--r--helper/include/odp/helper/chksum.h4
-rw-r--r--helper/include/odp/helper/eth.h6
-rw-r--r--helper/include/odp/helper/icmp.h12
-rw-r--r--helper/include/odp/helper/ip.h22
-rw-r--r--helper/include/odp/helper/ipsec.h10
-rw-r--r--helper/include/odp/helper/tcp.h64
-rw-r--r--helper/include/odp/helper/udp.h8
7 files changed, 63 insertions, 63 deletions
diff --git a/helper/include/odp/helper/chksum.h b/helper/include/odp/helper/chksum.h
index edb1c98cd..215917cc9 100644
--- a/helper/include/odp/helper/chksum.h
+++ b/helper/include/odp/helper/chksum.h
@@ -27,7 +27,7 @@ extern "C" {
*
* @return checksum value in host cpu order
*/
-static inline uint16sum_t odp_chksum(void *buffer, int len)
+static inline odp_u16sum_t odp_chksum(void *buffer, int len)
{
uint16_t *buf = buffer;
uint32_t sum = 0;
@@ -43,7 +43,7 @@ static inline uint16sum_t odp_chksum(void *buffer, int len)
sum += (sum >> 16);
result = ~sum;
- return (__odp_force uint16sum_t) result;
+ return (__odp_force odp_u16sum_t) result;
}
#ifdef __cplusplus
diff --git a/helper/include/odp/helper/eth.h b/helper/include/odp/helper/eth.h
index f1c164d67..7c9c7287a 100644
--- a/helper/include/odp/helper/eth.h
+++ b/helper/include/odp/helper/eth.h
@@ -51,7 +51,7 @@ _ODP_STATIC_ASSERT(sizeof(odph_ethaddr_t) == ODPH_ETHADDR_LEN, "ODPH_ETHADDR_T__
typedef struct ODP_PACKED {
odph_ethaddr_t dst; /**< Destination address */
odph_ethaddr_t src; /**< Source address */
- uint16be_t type; /**< Type */
+ odp_u16be_t type; /**< Type */
} odph_ethhdr_t;
/** @internal Compile time assert */
@@ -63,8 +63,8 @@ _ODP_STATIC_ASSERT(sizeof(odph_ethhdr_t) == ODPH_ETHHDR_LEN, "ODPH_ETHHDR_T__SIZ
* @todo Check usage of tpid vs ethertype. Check outer VLAN TPID.
*/
typedef struct ODP_PACKED {
- uint16be_t tpid; /**< Tag protocol ID (located after ethhdr.src) */
- uint16be_t tci; /**< Priority / CFI / VLAN ID */
+ odp_u16be_t tpid; /**< Tag protocol ID (located after ethhdr.src) */
+ odp_u16be_t tci; /**< Priority / CFI / VLAN ID */
} odph_vlanhdr_t;
/** @internal Compile time assert */
diff --git a/helper/include/odp/helper/icmp.h b/helper/include/odp/helper/icmp.h
index abcf81808..7f5097ba8 100644
--- a/helper/include/odp/helper/icmp.h
+++ b/helper/include/odp/helper/icmp.h
@@ -33,16 +33,16 @@ extern "C" {
typedef struct ODP_PACKED {
uint8_t type; /**< message type */
uint8_t code; /**< type sub-code */
- uint16sum_t chksum; /**< checksum of icmp header */
+ odp_u16sum_t chksum; /**< checksum of icmp header */
union {
struct {
- uint16be_t id;
- uint16be_t sequence;
+ odp_u16be_t id;
+ odp_u16be_t sequence;
} echo; /**< echo datagram */
- uint32be_t gateway; /**< gateway address */
+ odp_u32be_t gateway; /**< gateway address */
struct {
- uint16be_t __unused;
- uint16be_t mtu;
+ odp_u16be_t __unused;
+ odp_u16be_t mtu;
} frag; /**< path mtu discovery */
} un; /**< icmp sub header */
} odph_icmphdr_t;
diff --git a/helper/include/odp/helper/ip.h b/helper/include/odp/helper/ip.h
index 41408a3d4..2fa4aae47 100644
--- a/helper/include/odp/helper/ip.h
+++ b/helper/include/odp/helper/ip.h
@@ -61,14 +61,14 @@ extern "C" {
typedef struct ODP_PACKED {
uint8_t ver_ihl; /**< Version / Header length */
uint8_t tos; /**< Type of service */
- uint16be_t tot_len; /**< Total length */
- uint16be_t id; /**< ID */
- uint16be_t frag_offset; /**< Fragmentation offset */
+ odp_u16be_t tot_len; /**< Total length */
+ odp_u16be_t id; /**< ID */
+ odp_u16be_t frag_offset;/**< Fragmentation offset */
uint8_t ttl; /**< Time to live */
uint8_t proto; /**< Protocol */
- uint16sum_t chksum; /**< Checksum */
- uint32be_t src_addr; /**< Source address */
- uint32be_t dst_addr; /**< Destination address */
+ odp_u16sum_t chksum; /**< Checksum */
+ odp_u32be_t src_addr; /**< Source address */
+ odp_u32be_t dst_addr; /**< Destination address */
} odph_ipv4hdr_t;
/** @internal Compile time assert */
@@ -83,11 +83,11 @@ _ODP_STATIC_ASSERT(sizeof(odph_ipv4hdr_t) == ODPH_IPV4HDR_LEN, "ODPH_IPV4HDR_T__
*/
static inline int odph_ipv4_csum_valid(odp_packet_t pkt)
{
- uint16be_t res = 0;
+ odp_u16be_t res = 0;
uint16_t *w;
int nleft = sizeof(odph_ipv4hdr_t);
odph_ipv4hdr_t ip;
- uint16be_t chksum;
+ odp_u16be_t chksum;
if (!odp_packet_l3_offset(pkt))
return 0;
@@ -113,7 +113,7 @@ static inline int odph_ipv4_csum_valid(odp_packet_t pkt)
*
* @return IPv4 checksum in host cpu order, or 0 on failure
*/
-static inline uint16sum_t odph_ipv4_csum_update(odp_packet_t pkt)
+static inline odp_u16sum_t odph_ipv4_csum_update(odp_packet_t pkt)
{
uint16_t *w;
odph_ipv4hdr_t *ip;
@@ -138,8 +138,8 @@ static inline uint16sum_t odph_ipv4_csum_update(odp_packet_t pkt)
* IPv6 header
*/
typedef struct ODP_PACKED {
- uint32be_t ver_tc_flow; /**< Version / Traffic class / Flow label */
- uint16be_t payload_len; /**< Payload length */
+ odp_u32be_t ver_tc_flow; /**< Version / Traffic class / Flow label */
+ odp_u16be_t payload_len; /**< Payload length */
uint8_t next_hdr; /**< Next header */
uint8_t hop_limit; /**< Hop limit */
uint8_t src_addr[16]; /**< Source address */
diff --git a/helper/include/odp/helper/ipsec.h b/helper/include/odp/helper/ipsec.h
index 2565f74b4..2cc2403f4 100644
--- a/helper/include/odp/helper/ipsec.h
+++ b/helper/include/odp/helper/ipsec.h
@@ -35,8 +35,8 @@ extern "C" {
* IPSec ESP header
*/
typedef struct ODP_PACKED {
- uint32be_t spi; /**< Security Parameter Index */
- uint32be_t seq_no; /**< Sequence Number */
+ odp_u32be_t spi; /**< Security Parameter Index */
+ odp_u32be_t seq_no; /**< Sequence Number */
uint8_t iv[0]; /**< Initialization vector */
} odph_esphdr_t;
@@ -61,9 +61,9 @@ _ODP_STATIC_ASSERT(sizeof(odph_esptrl_t) == ODPH_ESPTRL_LEN, "ODPH_ESPTRL_T__SIZ
typedef struct ODP_PACKED {
uint8_t next_header; /**< Next header protocol */
uint8_t ah_len; /**< AH header length */
- uint16be_t pad; /**< Padding (must be 0) */
- uint32be_t spi; /**< Security Parameter Index */
- uint32be_t seq_no; /**< Sequence Number */
+ odp_u16be_t pad; /**< Padding (must be 0) */
+ odp_u32be_t spi; /**< Security Parameter Index */
+ odp_u32be_t seq_no; /**< Sequence Number */
uint8_t icv[0]; /**< Integrity Check Value */
} odph_ahhdr_t;
diff --git a/helper/include/odp/helper/tcp.h b/helper/include/odp/helper/tcp.h
index 42f0cbe1f..eb0a268b2 100644
--- a/helper/include/odp/helper/tcp.h
+++ b/helper/include/odp/helper/tcp.h
@@ -30,54 +30,54 @@ extern "C" {
/** TCP header */
typedef struct ODP_PACKED {
- uint16be_t src_port; /**< Source port */
- uint16be_t dst_port; /**< Destination port */
- uint32be_t seq_no; /**< Sequence number */
- uint32be_t ack_no; /**< Acknowledgment number */
+ odp_u16be_t src_port; /**< Source port */
+ odp_u16be_t dst_port; /**< Destination port */
+ odp_u32be_t seq_no; /**< Sequence number */
+ odp_u32be_t ack_no; /**< Acknowledgment number */
union {
- uint16be_t doffset_flags;
+ odp_u16be_t doffset_flags;
#if defined(ODP_BIG_ENDIAN_BITFIELD)
struct {
- uint16be_t rsvd1:8;
- uint16be_t flags:8; /**< TCP flags as a byte */
+ odp_u16be_t rsvd1:8;
+ odp_u16be_t flags:8; /**< TCP flags as a byte */
};
struct {
- uint16be_t hl:4; /**< Hdr len, in words */
- uint16be_t rsvd3:4; /**< Reserved */
- uint16be_t cwr:1;
- uint16be_t ece:1;
- uint16be_t urg:1;
- uint16be_t ack:1;
- uint16be_t psh:1;
- uint16be_t rst:1;
- uint16be_t syn:1;
- uint16be_t fin:1;
+ odp_u16be_t hl:4; /**< Hdr len, in words */
+ odp_u16be_t rsvd3:4; /**< Reserved */
+ odp_u16be_t cwr:1;
+ odp_u16be_t ece:1;
+ odp_u16be_t urg:1;
+ odp_u16be_t ack:1;
+ odp_u16be_t psh:1;
+ odp_u16be_t rst:1;
+ odp_u16be_t syn:1;
+ odp_u16be_t fin:1;
};
#elif defined(ODP_LITTLE_ENDIAN_BITFIELD)
struct {
- uint16be_t flags:8;
- uint16be_t rsvd1:8; /**< TCP flags as a byte */
+ odp_u16be_t flags:8;
+ odp_u16be_t rsvd1:8; /**< TCP flags as a byte */
};
struct {
- uint16be_t rsvd3:4; /**< Reserved */
- uint16be_t hl:4; /**< Hdr len, in words */
- uint16be_t fin:1;
- uint16be_t syn:1;
- uint16be_t rst:1;
- uint16be_t psh:1;
- uint16be_t ack:1;
- uint16be_t urg:1;
- uint16be_t ece:1;
- uint16be_t cwr:1;
+ odp_u16be_t rsvd3:4; /**< Reserved */
+ odp_u16be_t hl:4; /**< Hdr len, in words */
+ odp_u16be_t fin:1;
+ odp_u16be_t syn:1;
+ odp_u16be_t rst:1;
+ odp_u16be_t psh:1;
+ odp_u16be_t ack:1;
+ odp_u16be_t urg:1;
+ odp_u16be_t ece:1;
+ odp_u16be_t cwr:1;
};
#else
#error "Endian BitField order not defined!"
#endif
};
- uint16be_t window; /**< Window size */
- uint16be_t cksm; /**< Checksum */
- uint16be_t urgptr; /**< Urgent pointer */
+ odp_u16be_t window; /**< Window size */
+ odp_u16be_t cksm; /**< Checksum */
+ odp_u16be_t urgptr; /**< Urgent pointer */
} odph_tcphdr_t;
/**
diff --git a/helper/include/odp/helper/udp.h b/helper/include/odp/helper/udp.h
index 93b342df3..88a77f858 100644
--- a/helper/include/odp/helper/udp.h
+++ b/helper/include/odp/helper/udp.h
@@ -30,10 +30,10 @@ extern "C" {
/** UDP header */
typedef struct ODP_PACKED {
- uint16be_t src_port; /**< Source port */
- uint16be_t dst_port; /**< Destination port */
- uint16be_t length; /**< UDP datagram length in bytes (header+data) */
- uint16be_t chksum; /**< UDP header and data checksum (0 if not used)*/
+ odp_u16be_t src_port; /**< Source port */
+ odp_u16be_t dst_port; /**< Destination port */
+ odp_u16be_t length; /**< UDP datagram length in bytes (header+data) */
+ odp_u16be_t chksum; /**< UDP header and data checksum (0 if not used)*/
} odph_udphdr_t;
/**