summaryrefslogtreecommitdiffstats
path: root/src/vnet/ip/ip6_punt_drop.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/vnet/ip/ip6_punt_drop.c')
-rw-r--r--src/vnet/ip/ip6_punt_drop.c66
1 files changed, 31 insertions, 35 deletions
diff --git a/src/vnet/ip/ip6_punt_drop.c b/src/vnet/ip/ip6_punt_drop.c
index 3c839ffdd74..d1145fbf82e 100644
--- a/src/vnet/ip/ip6_punt_drop.c
+++ b/src/vnet/ip/ip6_punt_drop.c
@@ -32,7 +32,11 @@ VNET_FEATURE_ARC_INIT (ip6_drop) =
};
/* *INDENT-ON* */
+extern ip_punt_policer_t ip6_punt_policer_cfg;
+
+#ifndef CLIB_MARCH_VARIANT
ip_punt_policer_t ip6_punt_policer_cfg;
+#endif /* CLIB_MARCH_VARIANT */
static char *ip6_punt_policer_error_strings[] = {
#define _(sym,string) string,
@@ -40,9 +44,9 @@ static char *ip6_punt_policer_error_strings[] = {
#undef _
};
-static uword
-ip6_punt_policer (vlib_main_t * vm,
- vlib_node_runtime_t * node, vlib_frame_t * frame)
+VLIB_NODE_FN (ip6_punt_policer_node) (vlib_main_t * vm,
+ vlib_node_runtime_t * node,
+ vlib_frame_t * frame)
{
return (ip_punt_policer (vm, node, frame,
vnet_feat_arc_ip6_punt.feature_arc_index,
@@ -52,8 +56,7 @@ ip6_punt_policer (vlib_main_t * vm,
/* *INDENT-OFF* */
-VLIB_REGISTER_NODE (ip6_punt_policer_node, static) = {
- .function = ip6_punt_policer,
+VLIB_REGISTER_NODE (ip6_punt_policer_node) = {
.name = "ip6-punt-policer",
.vector_size = sizeof (u32),
.n_next_nodes = IP_PUNT_POLICER_N_NEXT,
@@ -67,9 +70,6 @@ VLIB_REGISTER_NODE (ip6_punt_policer_node, static) = {
},
};
-VLIB_NODE_FUNCTION_MULTIARCH (ip6_punt_policer_node,
- ip6_punt_policer);
-
VNET_FEATURE_INIT (ip6_punt_policer_node, static) = {
.arc_name = "ip6-punt",
.node_name = "ip6-punt-policer",
@@ -77,8 +77,8 @@ VNET_FEATURE_INIT (ip6_punt_policer_node, static) = {
};
/* *INDENT-ON* */
-static uword
-ip6_drop (vlib_main_t * vm, vlib_node_runtime_t * node, vlib_frame_t * frame)
+VLIB_NODE_FN (ip6_drop_node) (vlib_main_t * vm, vlib_node_runtime_t * node,
+ vlib_frame_t * frame)
{
if (node->flags & VLIB_NODE_FLAG_TRACE)
ip6_forward_next_trace (vm, node, frame, VLIB_TX);
@@ -88,9 +88,9 @@ ip6_drop (vlib_main_t * vm, vlib_node_runtime_t * node, vlib_frame_t * frame)
}
-static uword
-ip6_not_enabled (vlib_main_t * vm,
- vlib_node_runtime_t * node, vlib_frame_t * frame)
+VLIB_NODE_FN (ip6_not_enabled_node) (vlib_main_t * vm,
+ vlib_node_runtime_t * node,
+ vlib_frame_t * frame)
{
if (node->flags & VLIB_NODE_FLAG_TRACE)
ip6_forward_next_trace (vm, node, frame, VLIB_TX);
@@ -100,8 +100,8 @@ ip6_not_enabled (vlib_main_t * vm,
}
-static uword
-ip6_punt (vlib_main_t * vm, vlib_node_runtime_t * node, vlib_frame_t * frame)
+VLIB_NODE_FN (ip6_punt_node) (vlib_main_t * vm, vlib_node_runtime_t * node,
+ vlib_frame_t * frame)
{
if (node->flags & VLIB_NODE_FLAG_TRACE)
ip6_forward_next_trace (vm, node, frame, VLIB_TX);
@@ -111,9 +111,8 @@ ip6_punt (vlib_main_t * vm, vlib_node_runtime_t * node, vlib_frame_t * frame)
}
/* *INDENT-OFF* */
-VLIB_REGISTER_NODE (ip6_drop_node, static) =
+VLIB_REGISTER_NODE (ip6_drop_node) =
{
- .function = ip6_drop,
.name = "ip6-drop",
.vector_size = sizeof (u32),
.format_trace = format_ip6_forward_next_trace,
@@ -123,11 +122,8 @@ VLIB_REGISTER_NODE (ip6_drop_node, static) =
},
};
-VLIB_NODE_FUNCTION_MULTIARCH (ip6_drop_node, ip6_drop);
-
-VLIB_REGISTER_NODE (ip6_not_enabled_node, static) =
+VLIB_REGISTER_NODE (ip6_not_enabled_node) =
{
- .function = ip6_not_enabled,
.name = "ip6-not-enabled",
.vector_size = sizeof (u32),
.format_trace = format_ip6_forward_next_trace,
@@ -137,11 +133,8 @@ VLIB_REGISTER_NODE (ip6_not_enabled_node, static) =
},
};
-VLIB_NODE_FUNCTION_MULTIARCH (ip6_not_enabled_node, ip6_not_enabled);
-
-VLIB_REGISTER_NODE (ip6_punt_node, static) =
+VLIB_REGISTER_NODE (ip6_punt_node) =
{
- .function = ip6_punt,
.name = "ip6-punt",
.vector_size = sizeof (u32),
.format_trace = format_ip6_forward_next_trace,
@@ -151,8 +144,6 @@ VLIB_REGISTER_NODE (ip6_punt_node, static) =
},
};
-VLIB_NODE_FUNCTION_MULTIARCH (ip6_punt_node, ip6_punt);
-
VNET_FEATURE_INIT (ip6_punt_end_of_arc, static) = {
.arc_name = "ip6-punt",
.node_name = "error-punt",
@@ -166,6 +157,7 @@ VNET_FEATURE_INIT (ip6_drop_end_of_arc, static) = {
};
/* *INDENT-ON */
+#ifndef CLIB_MARCH_VARIANT
void
ip6_punt_policer_add_del (u8 is_add, u32 policer_index)
{
@@ -174,6 +166,7 @@ ip6_punt_policer_add_del (u8 is_add, u32 policer_index)
vnet_feature_enable_disable ("ip6-punt", "ip6-punt-policer",
0, is_add, 0, 0);
}
+#endif /* CLIB_MARCH_VARIANT */
static clib_error_t *
ip6_punt_police_cmd (vlib_main_t * vm,
@@ -234,13 +227,16 @@ VLIB_CLI_COMMAND (ip6_punt_policer_command, static) =
.short_help = "ip6 punt policer [add|del] <index>",
};
+extern ip_punt_redirect_t ip6_punt_redirect_cfg;
+#ifndef CLIB_MARCH_VARIANT
ip_punt_redirect_t ip6_punt_redirect_cfg = {
.any_rx_sw_if_index = {
.tx_sw_if_index = ~0,
.adj_index = ADJ_INDEX_INVALID,
},
};
+#endif /* CLIB_MARCH_VARIANT */
/* *INDENT-ON* */
#define foreach_ip6_punt_redirect_error \
@@ -260,9 +256,9 @@ static char *ip6_punt_redirect_error_strings[] = {
#undef _
};
-static uword
-ip6_punt_redirect (vlib_main_t * vm,
- vlib_node_runtime_t * node, vlib_frame_t * frame)
+VLIB_NODE_FN (ip6_punt_redirect_node) (vlib_main_t * vm,
+ vlib_node_runtime_t * node,
+ vlib_frame_t * frame)
{
return (ip_punt_redirect (vm, node, frame,
vnet_feat_arc_ip6_punt.feature_arc_index,
@@ -270,8 +266,7 @@ ip6_punt_redirect (vlib_main_t * vm,
}
/* *INDENT-OFF* */
-VLIB_REGISTER_NODE (ip6_punt_redirect_node, static) = {
- .function = ip6_punt_redirect,
+VLIB_REGISTER_NODE (ip6_punt_redirect_node) = {
.name = "ip6-punt-redirect",
.vector_size = sizeof (u32),
.n_next_nodes = IP_PUNT_REDIRECT_N_NEXT,
@@ -287,9 +282,6 @@ VLIB_REGISTER_NODE (ip6_punt_redirect_node, static) = {
},
};
-VLIB_NODE_FUNCTION_MULTIARCH (ip6_punt_redirect_node,
- ip6_punt_redirect);
-
VNET_FEATURE_INIT (ip6_punt_redirect_node, static) = {
.arc_name = "ip6-punt",
.node_name = "ip6-punt-redirect",
@@ -297,6 +289,7 @@ VNET_FEATURE_INIT (ip6_punt_redirect_node, static) = {
};
/* *INDENT-ON* */
+#ifndef CLIB_MARCH_VARIANT
void
ip6_punt_redirect_add (u32 rx_sw_if_index,
u32 tx_sw_if_index, ip46_address_t * nh)
@@ -319,6 +312,7 @@ ip6_punt_redirect_del (u32 rx_sw_if_index)
ip_punt_redirect_del (&ip6_punt_redirect_cfg, rx_sw_if_index);
}
+#endif /* CLIB_MARCH_VARIANT */
static clib_error_t *
ip6_punt_redirect_cmd (vlib_main_t * vm,
@@ -399,6 +393,7 @@ VLIB_CLI_COMMAND (ip6_punt_redirect_command, static) =
};
/* *INDENT-ON* */
+#ifndef CLIB_MARCH_VARIANT
ip_punt_redirect_detail_t *
ip6_punt_redirect_entries (u32 sw_if_index)
{
@@ -438,6 +433,7 @@ ip6_punt_redirect_entries (u32 sw_if_index)
return prs;
}
+#endif /* CLIB_MARCH_VARIANT */
static clib_error_t *
ip6_punt_redirect_show_cmd (vlib_main_t * vm,