aboutsummaryrefslogtreecommitdiff
path: root/helper/include
diff options
context:
space:
mode:
authorMike Holmes <mike.holmes@linaro.org>2017-01-23 14:46:06 -0500
committerMaxim Uvarov <maxim.uvarov@linaro.org>2017-01-25 19:25:50 +0300
commit88ed645e7378b955c580ec2b8ce9b846a5fb48f0 (patch)
treedd8c3f5aec50744f946b176a5b3dd60fed91d7db /helper/include
parent722fd6f8286722d30d50c00769fa4fcad5935dd2 (diff)
helper: use odph_api.h for test include for unexported files
Adding the previously missing table functions to the public helper api allows the tests to use just odph_api.h Signed-off-by: Mike Holmes <mike.holmes@linaro.org> Reviewed-by: Christophe Milard <christophe.milard@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
Diffstat (limited to 'helper/include')
-rw-r--r--helper/include/odp/helper/odph_api.h4
-rw-r--r--helper/include/odp/helper/odph_cuckootable.h82
-rw-r--r--helper/include/odp/helper/odph_hashtable.h40
-rw-r--r--helper/include/odp/helper/odph_iplookuptable.h58
-rw-r--r--helper/include/odp/helper/odph_lineartable.h40
5 files changed, 224 insertions, 0 deletions
diff --git a/helper/include/odp/helper/odph_api.h b/helper/include/odp/helper/odph_api.h
index ae6e77bd5..7ed0e7786 100644
--- a/helper/include/odp/helper/odph_api.h
+++ b/helper/include/odp/helper/odph_api.h
@@ -19,10 +19,14 @@ extern "C" {
#endif
#include <odp/helper/chksum.h>
+#include <odp/helper/odph_cuckootable.h>
#include <odp/helper/eth.h>
+#include <odp/helper/odph_hashtable.h>
#include <odp/helper/icmp.h>
#include <odp/helper/ip.h>
#include <odp/helper/ipsec.h>
+#include <odp/helper/odph_lineartable.h>
+#include <odp/helper/odph_iplookuptable.h>
#include <odp/helper/strong_types.h>
#include <odp/helper/tcp.h>
#include <odp/helper/table.h>
diff --git a/helper/include/odp/helper/odph_cuckootable.h b/helper/include/odp/helper/odph_cuckootable.h
new file mode 100644
index 000000000..d56998078
--- /dev/null
+++ b/helper/include/odp/helper/odph_cuckootable.h
@@ -0,0 +1,82 @@
+/* Copyright (c) 2016, Linaro Limited
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+/*-
+ * BSD LICENSE
+ *
+ * Copyright(c) 2010-2016 Intel Corporation. All rights reserved.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Intel Corporation nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef ODPH_CUCKOO_TABLE_H_
+#define ODPH_CUCKOO_TABLE_H_
+
+#include <odp/helper/table.h>
+
+/**
+ * @file
+ *
+ * ODP Cuckoo Hash Table
+ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+odph_table_t odph_cuckoo_table_create(
+ const char *name,
+ uint32_t capacity,
+ uint32_t key_size,
+ uint32_t value_size);
+
+odph_table_t odph_cuckoo_table_lookup(const char *name);
+
+int odph_cuckoo_table_destroy(odph_table_t table);
+
+int odph_cuckoo_table_put_value(
+ odph_table_t table,
+ void *key, void *value);
+
+int odph_cuckoo_table_get_value(
+ odph_table_t table,
+ void *key, void *buffer,
+ uint32_t buffer_size);
+
+int odph_cuckoo_table_remove_value(odph_table_t table, void *key);
+
+extern odph_table_ops_t odph_cuckoo_table_ops;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* ODPH_CUCKOO_TABLE_H_ */
diff --git a/helper/include/odp/helper/odph_hashtable.h b/helper/include/odp/helper/odph_hashtable.h
new file mode 100644
index 000000000..bb75cb9fa
--- /dev/null
+++ b/helper/include/odp/helper/odph_hashtable.h
@@ -0,0 +1,40 @@
+/* Copyright (c) 2015, Linaro Limited
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+/**
+ * @file
+ *
+ * ODP Hash Table
+ */
+
+#ifndef ODPH_HASH_TABLE_H_
+#define ODPH_HASH_TABLE_H_
+
+#include <odp/helper/table.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+odph_table_t odph_hash_table_create(const char *name,
+ uint32_t capacity,
+ uint32_t key_size,
+ uint32_t value_size);
+odph_table_t odph_hash_table_lookup(const char *name);
+int odph_hash_table_destroy(odph_table_t table);
+int odph_hash_put_value(odph_table_t table, void *key, void *value);
+int odph_hash_get_value(odph_table_t table, void *key, void *buffer,
+ uint32_t buffer_size);
+int odph_hash_remove_value(odph_table_t table, void *key);
+
+extern odph_table_ops_t odph_hash_table_ops;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+
diff --git a/helper/include/odp/helper/odph_iplookuptable.h b/helper/include/odp/helper/odph_iplookuptable.h
new file mode 100644
index 000000000..0ae6b3762
--- /dev/null
+++ b/helper/include/odp/helper/odph_iplookuptable.h
@@ -0,0 +1,58 @@
+/* Copyright (c) 2016, Linaro Limited
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+/**
+ * @file
+ *
+ * ODP IP Lookup Table
+ *
+ * This is an implementation of the IP lookup table. The key of
+ * this table is IPv4 address (32 bits), and the value can be
+ * defined by user. This table uses the 16,8,8 ip lookup (longest
+ * prefix matching) algorithm.
+ */
+
+#ifndef ODPH_IPLOOKUP_TABLE_H_
+#define ODPH_IPLOOKUP_TABLE_H_
+
+#include <odp/helper/table.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef struct {
+ uint32_t ip;
+ uint8_t cidr;
+} odph_iplookup_prefix_t;
+
+odph_table_t odph_iplookup_table_create(
+ const char *name,
+ uint32_t ODP_IGNORED_1,
+ uint32_t ODP_IGNORED_2,
+ uint32_t value_size);
+
+odph_table_t odph_iplookup_table_lookup(const char *name);
+
+int odph_iplookup_table_destroy(odph_table_t table);
+
+int odph_iplookup_table_put_value(
+ odph_table_t table, void *key, void *value);
+
+int odph_iplookup_table_get_value(
+ odph_table_t table, void *key,
+ void *buffer, uint32_t buffer_size);
+
+int odph_iplookup_table_remove_value(
+ odph_table_t table, void *key);
+
+extern odph_table_ops_t odph_iplookup_table_ops;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* ODPH_IPLOOKUP_TABLE_H_ */
diff --git a/helper/include/odp/helper/odph_lineartable.h b/helper/include/odp/helper/odph_lineartable.h
new file mode 100644
index 000000000..0b56b7fab
--- /dev/null
+++ b/helper/include/odp/helper/odph_lineartable.h
@@ -0,0 +1,40 @@
+/* Copyright (c) 2015, Linaro Limited
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+/**
+ * @file
+ *
+ * ODP Linear Table
+ */
+
+#ifndef ODPH_LINEAR_TABLE_H_
+#define ODPH_LINEAR_TABLE_H_
+
+#include <stdint.h>
+#include <odp/helper/table.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+odph_table_t odph_linear_table_create(const char *name,
+ uint32_t capacity,
+ uint32_t ODP_IGNORED,
+ uint32_t value_size);
+odph_table_t odph_linear_table_lookup(const char *name);
+int odph_linear_table_destroy(odph_table_t table);
+int odph_linear_put_value(odph_table_t table, void *key, void *value);
+int odph_linear_get_value(odph_table_t table, void *key, void *buffer,
+ uint32_t buffer_size);
+
+extern odph_table_ops_t odph_linear_table_ops;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+