diff mbox series

[API-NEXT,v3,5/14] example: switch to using odp_packet_l3_type_set()

Message ID 1518008409-31750-6-git-send-email-odpbot@yandex.ru
State New
Headers show
Series [API-NEXT,v3,1/14] linux-gen: packet: implement packet l3/l4 proto types | expand

Commit Message

Github ODP bot Feb. 7, 2018, 1 p.m. UTC
From: Dmitry Eremin-Solenikov <dmitry.ereminsolenikov@linaro.org>


Use odp_packet_l3_type_set() instead of calling
odp_packet_has_ipv4_set() or odp_packet_has_ipv6_set().

Signed-off-by: Dmitry Eremin-Solenikov <dmitry.ereminsolenikov@linaro.org>

---
/** Email created from pull request 457 (lumag:packet-types)
 ** https://github.com/Linaro/odp/pull/457
 ** Patch: https://github.com/Linaro/odp/pull/457.patch
 ** Base sha: e1175d5a69c65bb465022c9f1381c40fdb5c4069
 ** Merge commit sha: 86fcf3650d33f5dd82712dda131fb8ca66a3bdf8
 **/
 example/generator/odp_generator.c             | 2 +-
 example/ipfragreass/odp_ipfragreass_helpers.c | 2 +-
 example/ipsec/odp_ipsec_stream.c              | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/example/generator/odp_generator.c b/example/generator/odp_generator.c
index 8ac4dade3..c34457643 100644
--- a/example/generator/odp_generator.c
+++ b/example/generator/odp_generator.c
@@ -324,7 +324,7 @@  static odp_packet_t setup_udp_pkt_ref(odp_pool_t pool,
 
 	/* ip */
 	odp_packet_l3_offset_set(pkt, ODPH_ETHHDR_LEN);
-	odp_packet_has_ipv4_set(pkt, 1);
+	odp_packet_l3_type_set(pkt, ODP_PROTO_L3_TYPE_IPV4);
 	ip = (odph_ipv4hdr_t *)(buf + ODPH_ETHHDR_LEN);
 	ip->dst_addr = odp_cpu_to_be_32(args->appl.dstip);
 	ip->src_addr = odp_cpu_to_be_32(args->appl.srcip);
diff --git a/example/ipfragreass/odp_ipfragreass_helpers.c b/example/ipfragreass/odp_ipfragreass_helpers.c
index e7755f242..7a7960cde 100644
--- a/example/ipfragreass/odp_ipfragreass_helpers.c
+++ b/example/ipfragreass/odp_ipfragreass_helpers.c
@@ -58,7 +58,7 @@  odp_packet_t pack_udp_ipv4_packet(odp_pool_t pool, odp_u16be_t ip_id,
 	header_len = WORDS_TO_BYTES(header_len_words);
 	assert(header_len >= IP_HDR_LEN_MIN && header_len <= IP_HDR_LEN_MAX);
 	odp_packet_l3_offset_set(result, 0);
-	odp_packet_has_ipv4_set(result, 1);
+	odp_packet_l3_type_set(result, ODP_PROTO_L3_TYPE_IPV4);
 	buffer = odp_packet_data(result);
 	header = (odph_ipv4hdr_t *)buffer;
 	ipv4hdr_init(header);
diff --git a/example/ipsec/odp_ipsec_stream.c b/example/ipsec/odp_ipsec_stream.c
index 7487dddf6..45038211a 100644
--- a/example/ipsec/odp_ipsec_stream.c
+++ b/example/ipsec/odp_ipsec_stream.c
@@ -202,7 +202,7 @@  odp_packet_t create_ipv4_packet(stream_db_entry_t *stream,
 	eth->type = odp_cpu_to_be_16(ODPH_ETHTYPE_IPV4);
 
 	/* IPv4 */
-	odp_packet_has_ipv4_set(pkt, 1);
+	odp_packet_l3_type_set(pkt, ODP_PROTO_L3_TYPE_IPV4);
 	ip = (odph_ipv4hdr_t *)data;
 	data += sizeof(*ip);