aboutgitcodebugslistschat
path: root/flow.h
diff options
context:
space:
mode:
Diffstat (limited to 'flow.h')
-rw-r--r--flow.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/flow.h b/flow.h
index 29ef9f1..d1f49c6 100644
--- a/flow.h
+++ b/flow.h
@@ -177,6 +177,17 @@ static_assert(sizeof(flow_sidx_t) <= sizeof(uint32_t),
#define FLOW_SIDX_NONE ((flow_sidx_t){ .flow = FLOW_MAX })
/**
+ * flow_sidx_valid() - Test if a sidx is valid
+ * @sidx: sidx value
+ *
+ * Return: true if @sidx refers to a valid flow & side
+ */
+static inline bool flow_sidx_valid(flow_sidx_t sidx)
+{
+ return sidx.flow < FLOW_MAX;
+}
+
+/**
* flow_sidx_eq() - Test if two sidx values are equal
* @a, @b: sidx values
*