summaryrefslogtreecommitdiffstats
path: root/src/vlibapi/api.h
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2022-05-18 22:16:11 +0200
committerDamjan Marion <damarion@cisco.com>2022-05-19 18:32:23 +0200
commitcada9eb7894117db898f7c4def92cba5511baa4f (patch)
tree4cf552e2ad9e67b8bbc144eb5c6cb9aad0a8424b /src/vlibapi/api.h
parentbf95e3efde3402cf2f7beaf6d70433646cc68280 (diff)
api: refactor api data storage
single struct to hold all api handler, flags, etc. Provide functions to toggle flags instead of writing directly to internal data. Type: refactor Change-Id: I4730d7290e57489de8eda34a72211527e015b721 Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/vlibapi/api.h')
-rw-r--r--src/vlibapi/api.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/vlibapi/api.h b/src/vlibapi/api.h
index d290301f8d4..f838a80cf71 100644
--- a/src/vlibapi/api.h
+++ b/src/vlibapi/api.h
@@ -124,6 +124,30 @@ typedef int (*vl_msg_traverse_trace_fn) (u8 *, void *);
int vl_msg_traverse_trace (vl_api_trace_t *tp, vl_msg_traverse_trace_fn fn,
void *ctx);
+always_inline void
+vl_api_increase_msg_trace_size (api_main_t *am, u32 msg_id, u32 inc)
+{
+ am->msg_data[msg_id].trace_size += inc;
+}
+
+always_inline void
+vl_api_set_msg_thread_safe (api_main_t *am, u32 msg_id, int v)
+{
+ am->msg_data[msg_id].is_mp_safe = v != 0;
+}
+
+always_inline void
+vl_api_set_msg_autoendian (api_main_t *am, u32 msg_id, int v)
+{
+ am->msg_data[msg_id].is_autoendian = v != 0;
+}
+
+always_inline void
+vl_api_allow_msg_replay (api_main_t *am, u32 msg_id, int v)
+{
+ am->msg_data[msg_id].replay_allowed = v != 0;
+}
+
#endif /* included_api_h */
/*
* fd.io coding-style-patch-verification: ON