aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorScott Hutton <schutton@cisco.com>2024-05-03 07:40:42 -0700
committerDamjan Marion <dmarion@0xa5.net>2024-05-14 07:53:35 +0000
commit182d8b2ddba098f99029ed82e44960f3dfd18987 (patch)
tree5e6207f795dba2e2be150c1b3ca4c150106e5c3a /src
parent9850d301b0dc87cadf05999cf210f1f7b731a327 (diff)
sr: move srmpls to a plugin
Move sr_mpls folder under vnet to the plugin folder, update cmake configuration and header paths, and add plugin.c to register plugin. JIRA: VPP-2054 Type: improvement Change-Id: I1ad6f287f67eb0c35588c339bcd51218fadf5f8e Signed-off-by: Scott Hutton <schutton@cisco.com>
Diffstat (limited to 'src')
-rw-r--r--src/plugins/srmpls/CMakeLists.txt30
-rw-r--r--src/plugins/srmpls/FEATURE.yaml (renamed from src/vnet/srmpls/FEATURE.yaml)0
-rw-r--r--src/plugins/srmpls/dir.dox (renamed from src/vnet/srmpls/dir.dox)0
-rw-r--r--src/plugins/srmpls/plugin.c26
-rw-r--r--src/plugins/srmpls/sr_doc.rst (renamed from src/vnet/srmpls/sr_doc.rst)0
-rw-r--r--src/plugins/srmpls/sr_mpls.api (renamed from src/vnet/srmpls/sr_mpls.api)0
-rw-r--r--src/plugins/srmpls/sr_mpls.h (renamed from src/vnet/srmpls/sr_mpls.h)0
-rw-r--r--src/plugins/srmpls/sr_mpls_api.c (renamed from src/vnet/srmpls/sr_mpls_api.c)17
-rw-r--r--src/plugins/srmpls/sr_mpls_policy.c (renamed from src/vnet/srmpls/sr_mpls_policy.c)2
-rw-r--r--src/plugins/srmpls/sr_mpls_steering.c (renamed from src/vnet/srmpls/sr_mpls_steering.c)2
-rw-r--r--src/plugins/srmpls/sr_mpls_test.c (renamed from src/vnet/srmpls/sr_mpls_test.c)8
-rw-r--r--src/vnet/CMakeLists.txt19
12 files changed, 70 insertions, 34 deletions
diff --git a/src/plugins/srmpls/CMakeLists.txt b/src/plugins/srmpls/CMakeLists.txt
new file mode 100644
index 00000000000..25905d31e1b
--- /dev/null
+++ b/src/plugins/srmpls/CMakeLists.txt
@@ -0,0 +1,30 @@
+# Copyright (c) 2024 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.
+
+add_vpp_plugin(srmpls
+ SOURCES
+ sr_mpls_policy.c
+ sr_mpls_steering.c
+ sr_mpls_api.c
+ plugin.c
+
+ INSTALL_HEADERS
+ sr_mpls.h
+
+ API_FILES
+ sr_mpls.api
+
+ # This might need to be VAT_AUTO_TEST? Not documented
+ API_TEST_SOURCES
+ sr_mpls_test.c
+)
diff --git a/src/vnet/srmpls/FEATURE.yaml b/src/plugins/srmpls/FEATURE.yaml
index c5b958224c7..c5b958224c7 100644
--- a/src/vnet/srmpls/FEATURE.yaml
+++ b/src/plugins/srmpls/FEATURE.yaml
diff --git a/src/vnet/srmpls/dir.dox b/src/plugins/srmpls/dir.dox
index 76ec1d6a41b..76ec1d6a41b 100644
--- a/src/vnet/srmpls/dir.dox
+++ b/src/plugins/srmpls/dir.dox
diff --git a/src/plugins/srmpls/plugin.c b/src/plugins/srmpls/plugin.c
new file mode 100644
index 00000000000..af87607764f
--- /dev/null
+++ b/src/plugins/srmpls/plugin.c
@@ -0,0 +1,26 @@
+/*
+ * plugin.c: srmpls
+ *
+ * Copyright (c) 2024 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 <vlib/vlib.h>
+#include <vnet/plugin/plugin.h>
+#include <vpp/app/version.h>
+
+// register a plugin
+VLIB_PLUGIN_REGISTER () = {
+ .version = VPP_BUILD_VER,
+ .description = "Segment Routing for MPLS plugin",
+};
diff --git a/src/vnet/srmpls/sr_doc.rst b/src/plugins/srmpls/sr_doc.rst
index ed847fa0d42..ed847fa0d42 100644
--- a/src/vnet/srmpls/sr_doc.rst
+++ b/src/plugins/srmpls/sr_doc.rst
diff --git a/src/vnet/srmpls/sr_mpls.api b/src/plugins/srmpls/sr_mpls.api
index 742f135d493..742f135d493 100644
--- a/src/vnet/srmpls/sr_mpls.api
+++ b/src/plugins/srmpls/sr_mpls.api
diff --git a/src/vnet/srmpls/sr_mpls.h b/src/plugins/srmpls/sr_mpls.h
index a8f9494428f..a8f9494428f 100644
--- a/src/vnet/srmpls/sr_mpls.h
+++ b/src/plugins/srmpls/sr_mpls.h
diff --git a/src/vnet/srmpls/sr_mpls_api.c b/src/plugins/srmpls/sr_mpls_api.c
index 920856acff6..3e89017dbc1 100644
--- a/src/vnet/srmpls/sr_mpls_api.c
+++ b/src/plugins/srmpls/sr_mpls_api.c
@@ -17,7 +17,7 @@
*/
#include <vnet/vnet.h>
-#include <vnet/srmpls/sr_mpls.h>
+#include "sr_mpls.h"
#include <vlibmemory/api.h>
#include <vnet/interface.h>
@@ -26,28 +26,27 @@
#include <vnet/ip/ip_types_api.h>
#include <vnet/format_fns.h>
-#include <vnet/srmpls/sr_mpls.api_enum.h>
-#include <vnet/srmpls/sr_mpls.api_types.h>
-
+#include <plugins/srmpls/sr_mpls.api_enum.h>
+#include <plugins/srmpls/sr_mpls.api_types.h>
#define vl_api_version(n, v) static u32 api_version = v;
-#include <vnet/srmpls/sr_mpls.api.h>
+#include <plugins/srmpls/sr_mpls.api.h>
#undef vl_api_version
#define vl_endianfun
-#include <vnet/srmpls/sr_mpls.api.h>
+#include <plugins/srmpls/sr_mpls.api.h>
#undef vl_endianfun
#define vl_calcsizefun
-#include <vnet/srmpls/sr_mpls.api.h>
+#include <plugins/srmpls/sr_mpls.api.h>
#undef vl_calcsizefun
#define vl_printfun
-#include <vnet/srmpls/sr_mpls.api.h>
+#include <plugins/srmpls/sr_mpls.api.h>
#undef vl_printfun
#define vl_msg_name_crc_list
-#include <vnet/srmpls/sr_mpls.api.h>
+#include <plugins/srmpls/sr_mpls.api.h>
#undef vl_msg_name_crc_list
#define REPLY_MSG_ID_BASE msg_id_base
diff --git a/src/vnet/srmpls/sr_mpls_policy.c b/src/plugins/srmpls/sr_mpls_policy.c
index 41cb71601e9..af24acd8cf6 100644
--- a/src/vnet/srmpls/sr_mpls_policy.c
+++ b/src/plugins/srmpls/sr_mpls_policy.c
@@ -31,7 +31,7 @@
#include <vlib/vlib.h>
#include <vnet/vnet.h>
-#include <vnet/srmpls/sr_mpls.h>
+#include "sr_mpls.h"
#include <vnet/fib/mpls_fib.h>
#include <vnet/dpo/dpo.h>
#include <vnet/ip/ip.h>
diff --git a/src/vnet/srmpls/sr_mpls_steering.c b/src/plugins/srmpls/sr_mpls_steering.c
index e8920df542b..24c8b0e2d9f 100644
--- a/src/vnet/srmpls/sr_mpls_steering.c
+++ b/src/plugins/srmpls/sr_mpls_steering.c
@@ -31,7 +31,7 @@
#include <vlib/vlib.h>
#include <vnet/vnet.h>
-#include <vnet/srmpls/sr_mpls.h>
+#include "sr_mpls.h"
#include <vnet/ip/ip4_packet.h>
#include <vnet/ip/ip6_packet.h>
#include <vnet/fib/mpls_fib.h>
diff --git a/src/vnet/srmpls/sr_mpls_test.c b/src/plugins/srmpls/sr_mpls_test.c
index e5d68462443..7aff4c32b06 100644
--- a/src/vnet/srmpls/sr_mpls_test.c
+++ b/src/plugins/srmpls/sr_mpls_test.c
@@ -25,11 +25,11 @@
/* Declare message IDs */
#include <vnet/format_fns.h>
-#include <vnet/srmpls/sr_mpls.api_enum.h>
-#include <vnet/srmpls/sr_mpls.api_types.h>
+#include <plugins/srmpls/sr_mpls.api_enum.h>
+#include <plugins/srmpls/sr_mpls.api_types.h>
#define vl_endianfun /* define message structures */
-#include <vnet/srmpls/sr_mpls.api.h>
+#include <plugins/srmpls/sr_mpls.api.h>
#undef vl_endianfun
typedef struct
@@ -163,7 +163,7 @@ api_sr_mpls_policy_del (vat_main_t *vam)
return ret;
}
-#include <vnet/srmpls/sr_mpls.api_test.c>
+#include <plugins/srmpls/sr_mpls.api_test.c>
/*
* fd.io coding-style-patch-verification: ON
diff --git a/src/vnet/CMakeLists.txt b/src/vnet/CMakeLists.txt
index fb8d294009d..ad5f44846cc 100644
--- a/src/vnet/CMakeLists.txt
+++ b/src/vnet/CMakeLists.txt
@@ -813,24 +813,6 @@ list(APPEND VNET_API_FILES
)
##############################################################################
-# mpls segment routing
-##############################################################################
-
-list(APPEND VNET_SOURCES
- srmpls/sr_mpls_policy.c
- srmpls/sr_mpls_steering.c
- srmpls/sr_mpls_api.c
-)
-
-list(APPEND VNET_HEADERS
- srmpls/sr_mpls.h
-)
-
-list(APPEND VNET_API_FILES
- srmpls/sr_mpls.api
-)
-
-##############################################################################
# IPFIX / netflow v10
##############################################################################
list(APPEND VNET_SOURCES
@@ -1460,7 +1442,6 @@ add_vat_test_library(vnet
ip/ip_test.c
arp/arp_test.c
ip6-nd/ip6_nd_test.c
- srmpls/sr_mpls_test.c
session/session_test.c
l2/l2_test.c
ipsec/ipsec_test.c