aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/acl/dataplane_node.c
diff options
context:
space:
mode:
authorAndrew Yourtchenko <ayourtch@gmail.com>2018-05-15 17:25:50 +0200
committerDave Barach <openvpp@barachs.net>2018-06-20 13:37:21 +0000
commit22f9fb1286d2469819cfcef68ffdc258f4d52c24 (patch)
treeed8b86ab0fedcb78c9cc83f98f417f61747736bc /src/plugins/acl/dataplane_node.c
parent285434a858d2b53b15c572ad491b9ca3b40fcef3 (diff)
acl-plugin: acl-as-a-service: VPP-1248: fix the error if exports.h included in more than one C file
Including the exports.h from multiple .c files belonging to a single plugin results in an error. Rework the approach to require the table of function pointers to be filled in by the initialization function. Since the inline functions are compiled in the "caller" context, there is no knowledge about the acl_main structure used by the ACL plugin. To help with that, the signature of inline functions is slightly different, taking the p_acl_main pointer as the first parameter. That pointer is filled into the .p_acl_main field of the method table during the initialization - since the calling of non-inline variants would have required filling the method table, this should give minimal headaches during the use and switch between the two methods. Change-Id: Icb70695efa23579c46c716944838766cebc8573e Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
Diffstat (limited to 'src/plugins/acl/dataplane_node.c')
-rw-r--r--src/plugins/acl/dataplane_node.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/plugins/acl/dataplane_node.c b/src/plugins/acl/dataplane_node.c
index a6c7b981ad5..499ad163699 100644
--- a/src/plugins/acl/dataplane_node.c
+++ b/src/plugins/acl/dataplane_node.c
@@ -136,8 +136,8 @@ acl_fa_node_fn (vlib_main_t * vm,
* Extract the L3/L4 matching info into a 5-tuple structure.
*/
- acl_plugin_fill_5tuple_inline (lc_index0, b[0], is_ip6, is_input,
- is_l2_path,
+ acl_plugin_fill_5tuple_inline (&acl_main, lc_index0, b[0], is_ip6,
+ is_input, is_l2_path,
(fa_5tuple_opaque_t *) & fa_5tuple);
fa_5tuple.l4.lsb_of_sw_if_index = sw_if_index0 & 0xffff;
fa_5tuple.pkt.mask_type_index_lsb = ~0;
@@ -234,7 +234,7 @@ acl_fa_node_fn (vlib_main_t * vm,
if (acl_check_needed)
{
action = 0; /* deny by default */
- acl_plugin_match_5tuple_inline (lc_index0,
+ acl_plugin_match_5tuple_inline (&acl_main, lc_index0,
(fa_5tuple_opaque_t *) &
fa_5tuple, is_ip6, &action,
&match_acl_pos,