aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--MAINTAINERS5
-rw-r--r--src/plugins/ping/CMakeLists.txt17
-rwxr-xr-xsrc/plugins/ping/ping.c (renamed from src/vnet/ip/ping.c)16
-rw-r--r--src/plugins/ping/ping.h (renamed from src/vnet/ip/ping.h)6
-rw-r--r--src/vnet/CMakeLists.txt1
-rw-r--r--src/vnet/ip/icmp4.c9
-rw-r--r--src/vnet/ip/icmp4.h16
-rw-r--r--src/vnet/ip/ip4.h3
8 files changed, 50 insertions, 23 deletions
diff --git a/MAINTAINERS b/MAINTAINERS
index 7e1b65b3522..99e792d7e36 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -376,6 +376,11 @@ I: pppoe
M: Hongjun Ni <hongjun.ni@intel.com>
F: src/plugins/pppoe/
+Plugin - Ping
+I: ping
+M: Andrew Yourtchenko <ayourtch@gmail.com>
+F: src/plugins/ping
+
Plugin - IPv6 Segment Routing Dynamic Proxy
I: srv6-ad
M: Francois Clad <fclad@cisco.com>
diff --git a/src/plugins/ping/CMakeLists.txt b/src/plugins/ping/CMakeLists.txt
new file mode 100644
index 00000000000..2828f769fcc
--- /dev/null
+++ b/src/plugins/ping/CMakeLists.txt
@@ -0,0 +1,17 @@
+# Copyright (c) 2018 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(ping
+ SOURCES
+ ping.c
+)
diff --git a/src/vnet/ip/ping.c b/src/plugins/ping/ping.c
index 3847d837962..7d503774a30 100755
--- a/src/vnet/ip/ping.c
+++ b/src/plugins/ping/ping.c
@@ -14,11 +14,16 @@
*/
#include <stddef.h>
-#include <vnet/ip/ping.h>
+
+#include <vlib/vlib.h>
#include <vnet/fib/ip6_fib.h>
#include <vnet/fib/ip4_fib.h>
#include <vnet/fib/fib_entry.h>
-#include <vlib/vlib.h>
+#include <vnet/plugin/plugin.h>
+#include <vpp/app/version.h>
+
+#include <vnet/ip/icmp4.h>
+#include <ping/ping.h>
ping_main_t ping_main;
@@ -1252,6 +1257,13 @@ ping_cli_init (vlib_main_t * vm)
VLIB_INIT_FUNCTION (ping_cli_init);
+/* *INDENT-OFF* */
+VLIB_PLUGIN_REGISTER () = {
+ .version = VPP_BUILD_VER,
+ .description = "Ping (ping)",
+};
+/* *INDENT-ON* */
+
/*
* fd.io coding-style-patch-verification: ON
*
diff --git a/src/vnet/ip/ping.h b/src/plugins/ping/ping.h
index f1faa998f7d..7826945ea8b 100644
--- a/src/vnet/ip/ping.h
+++ b/src/plugins/ping/ping.h
@@ -12,8 +12,8 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-#ifndef included_vnet_ping_h
-#define included_vnet_ping_h
+#ifndef included_ping_ping_h
+#define included_ping_ping_h
#include <vnet/ip/ip.h>
@@ -88,4 +88,4 @@ typedef enum
ICMP46_ECHO_REPLY_N_NEXT,
} icmp46_echo_reply_next_t;
-#endif /* included_vnet_ping_h */
+#endif /* included_ping_ping_h */
diff --git a/src/vnet/CMakeLists.txt b/src/vnet/CMakeLists.txt
index b107365a105..9c1bceb5753 100644
--- a/src/vnet/CMakeLists.txt
+++ b/src/vnet/CMakeLists.txt
@@ -454,7 +454,6 @@ list(APPEND VNET_SOURCES
ip/ip_in_out_acl.c
ip/ip_punt_drop.c
ip/lookup.c
- ip/ping.c
ip/punt_api.c
ip/punt.c
ip/punt_node.c
diff --git a/src/vnet/ip/icmp4.c b/src/vnet/ip/icmp4.c
index 1cf6a93be50..1fab6471d2a 100644
--- a/src/vnet/ip/icmp4.c
+++ b/src/vnet/ip/icmp4.c
@@ -41,7 +41,6 @@
#include <vnet/ip/ip.h>
#include <vnet/pg/pg.h>
-
static char *icmp_error_strings[] = {
#define _(f,s) s,
foreach_icmp4_error
@@ -422,14 +421,6 @@ typedef enum
IP4_ICMP_ERROR_N_NEXT,
} ip4_icmp_error_next_t;
-void
-icmp4_error_set_vnet_buffer (vlib_buffer_t * b, u8 type, u8 code, u32 data)
-{
- vnet_buffer (b)->ip.icmp.type = type;
- vnet_buffer (b)->ip.icmp.code = code;
- vnet_buffer (b)->ip.icmp.data = data;
-}
-
static u8
icmp4_icmp_type_to_error (u8 type)
{
diff --git a/src/vnet/ip/icmp4.h b/src/vnet/ip/icmp4.h
index ae805148c89..73bd1f40efd 100644
--- a/src/vnet/ip/icmp4.h
+++ b/src/vnet/ip/icmp4.h
@@ -26,9 +26,9 @@
_ (OPTION_WITH_ZERO_LENGTH, "option has zero length") \
_ (ECHO_REPLIES_SENT, "echo replies sent") \
_ (DST_LOOKUP_MISS, "icmp6 dst address lookup misses") \
- _ (DEST_UNREACH_SENT, "destination unreachable response sent") \
- _ (TTL_EXPIRE_SENT, "hop limit exceeded response sent") \
- _ (PARAM_PROBLEM_SENT, "parameter problem response sent") \
+ _ (DEST_UNREACH_SENT, "destination unreachable response sent") \
+ _ (TTL_EXPIRE_SENT, "hop limit exceeded response sent") \
+ _ (PARAM_PROBLEM_SENT, "parameter problem response sent") \
_ (DROP, "error message dropped")
typedef enum
@@ -46,8 +46,14 @@ typedef struct
format_function_t format_icmp4_input_trace;
void ip4_icmp_register_type (vlib_main_t * vm, icmp4_type_t type,
u32 node_index);
-void icmp4_error_set_vnet_buffer (vlib_buffer_t * b, u8 type, u8 code,
- u32 data);
+
+static_always_inline void
+icmp4_error_set_vnet_buffer (vlib_buffer_t * b, u8 type, u8 code, u32 data)
+{
+ vnet_buffer (b)->ip.icmp.type = type;
+ vnet_buffer (b)->ip.icmp.code = code;
+ vnet_buffer (b)->ip.icmp.data = data;
+}
#endif /* included_vnet_icmp4_h */
diff --git a/src/vnet/ip/ip4.h b/src/vnet/ip/ip4.h
index 9da5926e13f..2a3743febb3 100644
--- a/src/vnet/ip/ip4.h
+++ b/src/vnet/ip/ip4.h
@@ -281,9 +281,6 @@ uword
ip4_udp_register_listener (vlib_main_t * vm,
u16 dst_port, u32 next_node_index);
-void
-ip4_icmp_register_type (vlib_main_t * vm, icmp4_type_t type, u32 node_index);
-
u16 ip4_tcp_udp_compute_checksum (vlib_main_t * vm, vlib_buffer_t * p0,
ip4_header_t * ip0);