X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fvnet%2Ftcp%2Ftcp_syn_filter4.c;h=d151eb77c3c4983384e4ad0132d7502519cfa343;hb=e10d167bfe8aec76cee138cbe33166ba89423c8c;hp=9b2a8ac7c8755c580098bb37541c96427b2819df;hpb=e9f929b52ddb741ec1e4cb2d92c6be1e798933a0;p=vpp.git diff --git a/src/vnet/tcp/tcp_syn_filter4.c b/src/vnet/tcp/tcp_syn_filter4.c index 9b2a8ac7c87..d151eb77c3c 100644 --- a/src/vnet/tcp/tcp_syn_filter4.c +++ b/src/vnet/tcp/tcp_syn_filter4.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016 Cisco and/or its affiliates. + * Copyright (c) 2016-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: @@ -52,7 +52,7 @@ format_syn_filter4_trace (u8 * s, va_list * args) return s; } -static vlib_node_registration_t syn_filter4_node; +extern vlib_node_registration_t syn_filter4_node; #define foreach_syn_filter_error \ _(THROTTLED, "TCP SYN packet throttle drops") \ @@ -80,9 +80,9 @@ typedef enum extern vnet_feature_arc_registration_t vnet_feat_arc_ip4_local; -static uword -syn_filter4_node_fn (vlib_main_t * vm, - vlib_node_runtime_t * node, vlib_frame_t * frame) +VLIB_NODE_FN (syn_filter4_node) (vlib_main_t * vm, + vlib_node_runtime_t * node, + vlib_frame_t * frame) { u32 n_left_from, *from, *to_next; syn_filter_next_t next_index; @@ -101,7 +101,7 @@ syn_filter4_node_fn (vlib_main_t * vm, if (now > rt->next_reset) { - memset (rt->syn_counts, 0, vec_len (rt->syn_counts)); + clib_memset (rt->syn_counts, 0, vec_len (rt->syn_counts)); rt->next_reset = now + rt->reset_interval; } @@ -400,9 +400,8 @@ syn_filter4_node_fn (vlib_main_t * vm, } /* *INDENT-OFF* */ -VLIB_REGISTER_NODE (syn_filter4_node, static) = +VLIB_REGISTER_NODE (syn_filter4_node) = { - .function = syn_filter4_node_fn, .name = "syn-filter-4", .vector_size = sizeof (u32), .format_trace = format_syn_filter4_trace, @@ -421,8 +420,6 @@ VLIB_REGISTER_NODE (syn_filter4_node, static) = }; /* *INDENT-ON* */ -VLIB_NODE_FUNCTION_MULTIARCH (syn_filter4_node, syn_filter4_node_fn); - /* *INDENT-OFF* */ VNET_FEATURE_INIT (syn_filter_4, static) = { @@ -432,6 +429,7 @@ VNET_FEATURE_INIT (syn_filter_4, static) = }; /* *INDENT-ON* */ +#ifndef CLIB_MARCH_VARIANT int syn_filter_enable_disable (u32 sw_if_index, int enable_disable) { @@ -535,6 +533,7 @@ VLIB_CLI_COMMAND (sr_content_command, static) = .function = syn_filter_enable_disable_command_fn, }; /* *INDENT-ON* */ +#endif /* CLIB_MARCH_VARIANT */ /* * fd.io coding-style-patch-verification: ON