aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/ip/punt.c
diff options
context:
space:
mode:
authorFilip Tehlar <ftehlar@cisco.com>2019-03-11 05:30:21 -0700
committerDamjan Marion <dmarion@me.com>2019-03-12 19:08:33 +0000
commit26ea14eeade802b8b4993f60506f2b5c9b976433 (patch)
tree22c0b7ad6ebd26d99daff1df4becfdf0d6301cb1 /src/vnet/ip/punt.c
parent44f0f71b6b1e6dac466452664817abc388662efd (diff)
ip: migrate old MULTIARCH macros to VLIB_NODE_FN
Change-Id: Id55ec87724e421d5b722314f9302c6ade7545306 Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
Diffstat (limited to 'src/vnet/ip/punt.c')
-rw-r--r--src/vnet/ip/punt.c38
1 files changed, 21 insertions, 17 deletions
diff --git a/src/vnet/ip/punt.c b/src/vnet/ip/punt.c
index e1c13f62aff..831ece25415 100644
--- a/src/vnet/ip/punt.c
+++ b/src/vnet/ip/punt.c
@@ -60,12 +60,15 @@ enum punt_socket_rx_next_e
#define punt_next_punt(is_ip4) (is_ip4 ? PUNT_NEXT_PUNT4 : PUNT_NEXT_PUNT6)
-vlib_node_registration_t udp4_punt_node;
-vlib_node_registration_t udp6_punt_node;
-vlib_node_registration_t udp4_punt_socket_node;
-vlib_node_registration_t udp6_punt_socket_node;
+extern vlib_node_registration_t udp4_punt_node;
+extern vlib_node_registration_t udp6_punt_node;
+extern vlib_node_registration_t udp4_punt_socket_node;
+extern vlib_node_registration_t udp6_punt_socket_node;
static vlib_node_registration_t punt_socket_rx_node;
+extern punt_main_t punt_main;
+
+#ifndef CLIB_MARCH_VARIANT
punt_main_t punt_main;
char *
@@ -74,6 +77,7 @@ vnet_punt_get_server_pathname (void)
punt_main_t *pm = &punt_main;
return pm->sun_path;
}
+#endif /* CLIB_MARCH_VARIANT */
/** @brief IPv4/IPv6 UDP punt node main loop.
@@ -159,9 +163,9 @@ static char *punt_error_strings[] = {
<em>Next Index:</em>
- Dispatches the packet to the "error-punt" node
*/
-static uword
-udp4_punt (vlib_main_t * vm,
- vlib_node_runtime_t * node, vlib_frame_t * from_frame)
+VLIB_NODE_FN (udp4_punt_node) (vlib_main_t * vm,
+ vlib_node_runtime_t * node,
+ vlib_frame_t * from_frame)
{
return udp46_punt_inline (vm, node, from_frame, 1 /* is_ip4 */ );
}
@@ -187,16 +191,15 @@ udp4_punt (vlib_main_t * vm,
<em>Next Index:</em>
- Dispatches the packet to the "error-punt" node
*/
-static uword
-udp6_punt (vlib_main_t * vm,
- vlib_node_runtime_t * node, vlib_frame_t * from_frame)
+VLIB_NODE_FN (udp6_punt_node) (vlib_main_t * vm,
+ vlib_node_runtime_t * node,
+ vlib_frame_t * from_frame)
{
return udp46_punt_inline (vm, node, from_frame, 0 /* is_ip4 */ );
}
/* *INDENT-OFF* */
VLIB_REGISTER_NODE (udp4_punt_node) = {
- .function = udp4_punt,
.name = "ip4-udp-punt",
/* Takes a vector of packets. */
.vector_size = sizeof (u32),
@@ -212,10 +215,7 @@ VLIB_REGISTER_NODE (udp4_punt_node) = {
},
};
-VLIB_NODE_FUNCTION_MULTIARCH (udp4_punt_node, udp4_punt);
-
VLIB_REGISTER_NODE (udp6_punt_node) = {
- .function = udp6_punt,
.name = "ip6-udp-punt",
/* Takes a vector of packets. */
.vector_size = sizeof (u32),
@@ -231,8 +231,6 @@ VLIB_REGISTER_NODE (udp6_punt_node) = {
},
};
-VLIB_NODE_FUNCTION_MULTIARCH (udp6_punt_node, udp6_punt);;
-
/* *INDENT-ON* */
static punt_client_t *
@@ -259,6 +257,7 @@ punt_socket_get (bool is_ip4, u16 port)
return NULL;
}
+#ifndef CLIB_MARCH_VARIANT
static int
punt_socket_register (bool is_ip4, u8 protocol, u16 port,
char *client_pathname)
@@ -288,6 +287,7 @@ punt_socket_unregister (bool is_ip4, u8 protocol, u16 port)
{
return;
}
+#endif /* CLIB_MARCH_VARIANT */
typedef struct
{
@@ -295,7 +295,7 @@ typedef struct
u8 is_midchain;
} udp_punt_trace_t;
-u8 *
+static u8 *
format_udp_punt_trace (u8 * s, va_list * args)
{
CLIB_UNUSED (vlib_main_t * vm) = va_arg (*args, vlib_main_t *);
@@ -637,6 +637,7 @@ punt_socket_read_ready (clib_file_t * uf)
return 0;
}
+#ifndef CLIB_MARCH_VARIANT
clib_error_t *
vnet_punt_socket_add (vlib_main_t * vm, u32 header_version,
bool is_ip4, u8 protocol, u16 port,
@@ -772,6 +773,7 @@ vnet_punt_add_del (vlib_main_t * vm, u8 ipv, u8 protocol, u16 port,
return 0;
}
}
+#endif /* CLIB_MARCH_VARIANT */
static clib_error_t *
punt_cli (vlib_main_t * vm,
@@ -841,6 +843,7 @@ VLIB_CLI_COMMAND (punt_command, static) = {
};
/* *INDENT-ON* */
+#ifndef CLIB_MARCH_VARIANT
static clib_error_t *
punt_socket_register_cmd (vlib_main_t * vm,
unformat_input_t * input, vlib_cli_command_t * cmd)
@@ -1075,6 +1078,7 @@ punt_init (vlib_main_t * vm)
}
VLIB_INIT_FUNCTION (punt_init);
+#endif /* CLIB_MARCH_VARIANT */
static clib_error_t *
punt_config (vlib_main_t * vm, unformat_input_t * input)