aboutsummaryrefslogtreecommitdiffstats
path: root/hicn-plugin/includes
diff options
context:
space:
mode:
authorMauro Sardara <msardara@cisco.com>2020-03-24 17:34:14 +0000
committerMauro Sardara <msardara@cisco.com>2020-09-14 17:31:15 +0000
commit88509fe353767cbde707c3e3b1f29392957819f3 (patch)
treecccd51bac7966cd3138c525e8075d90341184a66 /hicn-plugin/includes
parentd875ae92a7fa1eaab3bc2616aeeedfc64a81fea4 (diff)
[HICN-574] Host stack plugin for VPP.
Signed-off-by: Mauro Sardara <msardara@cisco.com> Change-Id: I8d8fdffef31a7013265d6529c5f52f3d5ec70d18 Signed-off-by: Mauro Sardara <msardara@cisco.com> Signed-off-by: Mauro <you@example.com> Signed-off-by: Mauro Sardara <msardara@cisco.com>
Diffstat (limited to 'hicn-plugin/includes')
-rw-r--r--hicn-plugin/includes/vpp_plugins/hicn/CMakeLists.txt34
-rw-r--r--hicn-plugin/includes/vpp_plugins/hicn/error.h101
-rw-r--r--hicn-plugin/includes/vpp_plugins/hicn/hicn_all_api_h.h22
-rw-r--r--hicn-plugin/includes/vpp_plugins/hicn/hicn_api.h38
-rw-r--r--hicn-plugin/includes/vpp_plugins/hicn/hicn_msg_enum.h39
5 files changed, 234 insertions, 0 deletions
diff --git a/hicn-plugin/includes/vpp_plugins/hicn/CMakeLists.txt b/hicn-plugin/includes/vpp_plugins/hicn/CMakeLists.txt
new file mode 100644
index 000000000..bea6c9136
--- /dev/null
+++ b/hicn-plugin/includes/vpp_plugins/hicn/CMakeLists.txt
@@ -0,0 +1,34 @@
+# Copyright (c) 2020 Cisco and/or its affiliates.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at:
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+cmake_minimum_required(VERSION 3.5 FATAL_ERROR)
+
+include(GNUInstallDirs)
+
+set(ASIO_STANDALONE 1)
+
+set(HICNPLUGIN_INCLUDE_DIRS
+ ${CMAKE_CURRENT_SOURCE_DIR}/../.. ""
+ ${CMAKE_CURRENT_BUILD_DIR}/ ""
+ CACHE INTERNAL
+ "" FORCE
+)
+
+set(HICNPLUGIN_TO_INSTALL_HEADER_FILES
+ ${CMAKE_CURRENT_SOURCE_DIR}/error.h
+ ${CMAKE_CURRENT_SOURCE_DIR}/hicn_all_api_h.h
+ ${CMAKE_CURRENT_SOURCE_DIR}/hicn_api.h
+ ${CMAKE_CURRENT_SOURCE_DIR}/hicn_msg_enum.h ""
+ CACHE INTERNAL
+ "" FORCE
+) \ No newline at end of file
diff --git a/hicn-plugin/includes/vpp_plugins/hicn/error.h b/hicn-plugin/includes/vpp_plugins/hicn/error.h
new file mode 100644
index 000000000..59ebce61c
--- /dev/null
+++ b/hicn-plugin/includes/vpp_plugins/hicn/error.h
@@ -0,0 +1,101 @@
+/*
+ * Copyright (c) 2017-2020 Cisco and/or its affiliates.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at:
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef __HICN_ERROR_H__
+#define __HICN_ERROR_H__
+
+/**
+ * @file error.h
+ *
+ * Error codes for the hICN plugin.
+ */
+
+
+#define foreach_hicn_error \
+ _(NONE, 0, "Ok") \
+ _(UNSPECIFIED, -128, "Unspecified Error") \
+ _(FACE_NOT_FOUND, -129, "Face not found in Face table") \
+ _(FACE_NULL, -130, "Face null") \
+ _(FACE_IP_ADJ_NOT_FOUND, -131, "Ip adjacecny for face not found") \
+ _(FACE_HW_INT_NOT_FOUND, -132, "Hardware interface not found") \
+ _(FACE_NOMEM, -133, "Face table is full") \
+ _(FACE_NO_GLOBAL_IP, -134, "No global ip address for face") \
+ _(FACE_NOT_FOUND_IN_ENTRY, -135, "Face not found in entry") \
+ _(FACE_ALREADY_DELETED, -136, "Face alredy deleted") \
+ _(FACE_ALREADY_CREATED, -137, "Face alredy created") \
+ _(FWD_NOT_ENABLED, -138, "hICN forwarder not enabled") \
+ _(FWD_ALREADY_ENABLED, -139, "hICN forwarder alredy enabled") \
+ _(PARSER_UNSUPPORTED_PROTO, -140, "Unsupported protocol") \
+ _(PARSER_PKT_INVAL, -141, "Packet null") \
+ _(PIT_CONFIG_MINLT_OOB, -142, "Min lifetime ouf of bounds") \
+ _(PIT_CONFIG_MAXLT_OOB, -143, "Max lifetime ouf of bounds") \
+ _(PIT_CONFIG_MINMAXLT, -144, "Min lifetime grater than max lifetime") \
+ _(PIT_CONFIG_DFTLT_OOB, -145, "Default lifetime ouf of bounds") \
+ _(PIT_CONFIG_SIZE_OOB, -146, "Pit size ouf of bounds") \
+ _(CS_CONFIG_SIZE_OOB, -147, "CS size ouf of bounds") \
+ _(CS_CONFIG_RESERVED_OOB, -148, "Reseved CS must be between 0 and 100 (excluded)") \
+ _(DPO_CTX_NHOPS_NS, -149, "No space for additional next hop") \
+ _(DPO_CTX_NHOPS_EXISTS, -150, "Next hop already in the route") \
+ _(DPO_CTX_NOT_FOUND, -151, "Dpo context not found") \
+ _(DPO_MGR_ID_NOT_VALID, -152, "Dpo id for strategy and context not valid") \
+ _(HASHTB_HASH_NOT_FOUND, -153, "Hash not found in hash table") \
+ _(HASHTB_HASH_INVAL, -154, "Error while calculating the hash") \
+ _(HASHTB_NOMEM, -155, "Unable to allocate new buckets or nodes") \
+ _(HASHTB_INVAL, -156, "Invalid argument") \
+ _(HASHTB_KEY_INVAL, -157, "Invalid hashtb key") \
+ _(HASHTB_EXIST, -158, "Hash already in hashtable") \
+ _(ROUTE_INVAL, -159, "Invalid face id and weight") \
+ _(ROUTE_NO_LD, -160, "Expected load balance dpo") \
+ _(ROUTE_MLT_LD, -161, "Unexpected mulitple buckets in load balance dpo") \
+ _(ROUTE_NO_INSERT, -162, "Unable to insert a new FIB entry") \
+ _(ROUTE_DPO_NO_HICN, -163, "Dpo is not of type hICN") \
+ _(ROUTE_NOT_FOUND, -164, "Route not found in FIB") \
+ _(ROUTE_NOT_UPDATED, -165, "Unable to update route") \
+ _(ROUTE_ALREADY_EXISTS, -166, "Route already in FIB") \
+ _(CLI_INVAL, -167, "Invalid input") \
+ _(IPS_ADDR_TYPE_NONUNIFORM, -168, "Src and dst addr have different ip types") \
+ _(FACE_TYPE_EXISTS, -169, "Face type already registered") \
+ _(NO_BUFFERS, -170, "No vlib_buffer available for packet cloning.") \
+ _(NOT_IMPLEMENTED, -171, "Function not yet implemented") \
+ _(IFACE_IP_ADJ_NOT_FOUND, -172, "IP adjacency on incomplete face not available") \
+ _(APPFACE_ALREADY_ENABLED, -173, "Application face already enabled on interface") \
+ _(APPFACE_FEATURE, -174, "Error while enabling app face feature") \
+ _(APPFACE_NOT_FOUND, -175, "Application face not found") \
+ _(APPFACE_PROD_PREFIX_NULL, -176, "Prefix must not be null for producer face") \
+ _(STRATEGY_NH_NOT_FOUND, -177, "Next hop not found") \
+ _(MW_STRATEGY_SET, -178, "Error while setting weight for next hop") \
+ _(STRATEGY_NOT_FOUND, -179, "Strategy not found") \
+ _(UDP_TUNNEL_NOT_FOUND, -180, "Udp tunnel not found") \
+ _(UDP_TUNNEL_SRC_DST_TYPE, -181, "Src and dst addresses have different type (ipv4 and ipv6)")
+
+typedef enum
+{
+#define _(a,b,c) HICN_ERROR_##a = (b),
+ foreach_hicn_error
+#undef _
+ HICN_N_ERROR,
+} hicn_error_t;
+
+extern const char *HICN_ERROR_STRING[];
+
+#define get_error_string(errno) (char *)(errno ? HICN_ERROR_STRING[(-errno) - 127] : HICN_ERROR_STRING[errno])
+
+#endif /* //__HICN_ERROR_H__ */
+
+/*
+ * fd.io coding-style-patch-verification: ON
+ *
+ * Local Variables: eval: (c-set-style "gnu") End:
+ */
diff --git a/hicn-plugin/includes/vpp_plugins/hicn/hicn_all_api_h.h b/hicn-plugin/includes/vpp_plugins/hicn/hicn_all_api_h.h
new file mode 100644
index 000000000..c4b19b393
--- /dev/null
+++ b/hicn-plugin/includes/vpp_plugins/hicn/hicn_all_api_h.h
@@ -0,0 +1,22 @@
+/*
+ * Copyright (c) 2017-2019 Cisco and/or its affiliates.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at:
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <vpp_plugins/hicn/hicn.api.h>
+
+/*
+ * fd.io coding-style-patch-verification: ON
+ *
+ * Local Variables: eval: (c-set-style "gnu") End:
+ */
diff --git a/hicn-plugin/includes/vpp_plugins/hicn/hicn_api.h b/hicn-plugin/includes/vpp_plugins/hicn/hicn_api.h
new file mode 100644
index 000000000..ddaa914a7
--- /dev/null
+++ b/hicn-plugin/includes/vpp_plugins/hicn/hicn_api.h
@@ -0,0 +1,38 @@
+/*
+ * Copyright (c) 2017-2020 Cisco and/or its affiliates.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at:
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef __HICN_API_H__
+#define __HICN_API_H__
+
+/**
+ * @file
+ */
+
+
+#define HICN_STRATEGY_NULL ~0
+#define HICN_FIB_TABLE 10
+
+/* define message structures */
+#define vl_typedefs
+#include <vpp_plugins/hicn/hicn_all_api_h.h>
+#undef vl_typedefs
+
+#endif /* // __HICN_API_H___ */
+
+/*
+ * fd.io coding-style-patch-verification: ON
+ *
+ * Local Variables: eval: (c-set-style "gnu") End:
+ */
diff --git a/hicn-plugin/includes/vpp_plugins/hicn/hicn_msg_enum.h b/hicn-plugin/includes/vpp_plugins/hicn/hicn_msg_enum.h
new file mode 100644
index 000000000..7b4582dbc
--- /dev/null
+++ b/hicn-plugin/includes/vpp_plugins/hicn/hicn_msg_enum.h
@@ -0,0 +1,39 @@
+/*
+ * Copyright (c) 2017-2019 Cisco and/or its affiliates.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at:
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef __HICN_MSG_ENUM_H__
+#define __HICN_MSG_ENUM_H__
+
+#include <vppinfra/byte_order.h>
+
+/**
+ * @file
+ */
+#define vl_msg_id(n, h) n,
+typedef enum
+{
+#include <vpp_plugins/hicn/hicn_all_api_h.h>
+ /* We'll want to know how many messages IDs we need... */
+ VL_MSG_FIRST_AVAILABLE,
+} vl_msg_id_t;
+#undef vl_msg_id
+
+#endif /* __HICN_MSG_ENUM_H__ */
+
+/*
+ * fd.io coding-style-patch-verification: ON
+ *
+ * Local Variables: eval: (c-set-style "gnu") End:
+ */