summaryrefslogtreecommitdiffstats
path: root/src/plugins/acl/fa_node.h
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/fa_node.h
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/fa_node.h')
-rw-r--r--src/plugins/acl/fa_node.h9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/plugins/acl/fa_node.h b/src/plugins/acl/fa_node.h
index 102922c2807..e41dd0ad6fd 100644
--- a/src/plugins/acl/fa_node.h
+++ b/src/plugins/acl/fa_node.h
@@ -5,6 +5,8 @@
#include <vppinfra/bihash_16_8.h>
#include <vppinfra/bihash_40_8.h>
+#include <plugins/acl/exported_types.h>
+
// #define FA_NODE_VERBOSE_DEBUG 3
#define TCP_FLAG_FIN 0x01
@@ -78,11 +80,6 @@ typedef union {
} fa_5tuple_t;
typedef struct {
- u8 opaque[sizeof(fa_5tuple_t)];
-} fa_5tuple_opaque_t;
-
-
-typedef struct {
fa_5tuple_t info; /* (5+1)*8 = 48 bytes */
u64 last_active_time; /* +8 bytes = 56 */
u32 sw_if_index; /* +4 bytes = 60 */
@@ -139,6 +136,8 @@ CT_ASSERT_EQUAL(fa_session_t_size_is_128, sizeof(fa_session_t), 128);
/* Session ID MUST be the same as u64 */
CT_ASSERT_EQUAL(fa_full_session_id_size_is_64, sizeof(fa_full_session_id_t), sizeof(u64));
+
+CT_ASSERT_EQUAL(fa_5tuple_opaque_t_must_match_5tuple, sizeof(fa_5tuple_opaque_t), sizeof(fa_5tuple_t));
#undef CT_ASSERT_EQUAL
#define FA_SESSION_BOGUS_INDEX ~0