aboutsummaryrefslogtreecommitdiff
path: root/helper
diff options
context:
space:
mode:
authorBill Fischofer <bill.fischofer@linaro.org>2014-12-16 14:30:34 +0200
committerMaxim Uvarov <maxim.uvarov@linaro.org>2014-12-16 19:03:39 +0300
commit8822ad6c22f6d135c43829e043c675a779bbd005 (patch)
treeabbef5ec4bddbe90bbcbb964009e668e8bcf9822 /helper
parent57408e45ba64d287d402da8bd212edc9aa56d1ba (diff)
api: packet: move helper functions to public API
Signed-off-by: Bill Fischofer <bill.fischofer@linaro.org> Signed-off-by: Taras Kondratiuk <taras.kondratiuk@linaro.org> Reviewed-and-tested-by: Bill Fischofer <bill.fischofer@linaro.org> Reviewed-by: Petri Savolainen <petri.savolainen@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
Diffstat (limited to 'helper')
-rw-r--r--helper/include/odph_packet.h97
1 files changed, 0 insertions, 97 deletions
diff --git a/helper/include/odph_packet.h b/helper/include/odph_packet.h
deleted file mode 100644
index 3d53593..0000000
--- a/helper/include/odph_packet.h
+++ /dev/null
@@ -1,97 +0,0 @@
-/* Copyright (c) 2014, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- */
-
-
-/**
- * @file
- *
- * Optional ODP packet helper functions
- */
-
-#ifndef ODPH_PACKET_HELPER_H_
-#define ODPH_PACKET_HELPER_H_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <odp.h>
-
-/**
- * Helper: Tests if packet is valid
- *
- * Allows for more thorough checking than "if (pkt == ODP_PACKET_INVALID)"
- *
- * @param pkt Packet handle
- *
- * @return 1 if valid, otherwise 0
- */
-static inline int odph_packet_is_valid(odp_packet_t pkt)
-{
- odp_buffer_t buf = odp_packet_to_buffer(pkt);
-
- return odp_buffer_is_valid(buf);
-}
-
-/**
- * Helper: Allocate and initialize a packet buffer from a packet pool
- *
- * @param pool_id Pool handle
- *
- * @note The pool must have been created with 'buf_type=ODP_BUFFER_TYPE_PACKET'
- *
- * @return Packet handle or ODP_PACKET_INVALID
- */
-static inline odp_packet_t odph_packet_alloc(odp_buffer_pool_t pool_id)
-{
- odp_packet_t pkt;
- odp_buffer_t buf;
-
- buf = odp_buffer_alloc(pool_id);
- if (odp_unlikely(!odp_buffer_is_valid(buf)))
- return ODP_PACKET_INVALID;
-
- pkt = odp_packet_from_buffer(buf);
- odp_packet_init(pkt);
-
- return pkt;
-}
-
-/**
- * Helper: Free a packet buffer back into the packet pool
- *
- * @param pkt Packet handle
- */
-static inline void odph_packet_free(odp_packet_t pkt)
-{
- odp_buffer_t buf = odp_packet_to_buffer(pkt);
-
- odp_buffer_free(buf);
-}
-
-/**
- * Helper: Packet buffer maximum data size
- *
- * @note odp_packet_buf_size(pkt) != odp_packet_get_len(pkt), the former returns
- * the max length of the buffer, the latter the size of a received packet.
- *
- * @param pkt Packet handle
- *
- * @return Packet buffer maximum data size
- */
-static inline size_t odph_packet_buf_size(odp_packet_t pkt)
-{
- odp_buffer_t buf = odp_packet_to_buffer(pkt);
-
- return odp_buffer_size(buf);
-}
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif