X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fvlibmemory%2Fmemory_api.h;h=4cda04b3d9fbc068945b7c99a47b6d90b24b548e;hb=b384b543313b6b47a277c903e9d4fcd4343054fa;hp=58f47d1313a1ec8aa7a001ba938339dbbb3ee051;hpb=4e578068fc3fe8ba176d211123ddd88962dab315;p=vpp.git diff --git a/src/vlibmemory/memory_api.h b/src/vlibmemory/memory_api.h index 58f47d1313a..4cda04b3d9f 100644 --- a/src/vlibmemory/memory_api.h +++ b/src/vlibmemory/memory_api.h @@ -58,6 +58,13 @@ vl_msg_api_handle_from_index_and_epoch (u32 index, u32 epoch) return handle; } +static inline u8 +vl_msg_api_handle_is_valid (u32 handle, u32 restarts) +{ + u32 epoch = vl_msg_api_handle_get_epoch (handle); + return ((restarts & VL_API_EPOCH_MASK) == epoch); +} + #define VL_MEM_API_LOG_Q_LEN(fmt,qlen) \ if (TRACE_VLIB_MEMORY_QUEUE) \ do { \