summaryrefslogtreecommitdiffstats
path: root/src/plugins/ikev2/ikev2.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/ikev2/ikev2.h')
-rw-r--r--src/plugins/ikev2/ikev2.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/plugins/ikev2/ikev2.h b/src/plugins/ikev2/ikev2.h
index 47c301f33a1..893d9544aa8 100644
--- a/src/plugins/ikev2/ikev2.h
+++ b/src/plugins/ikev2/ikev2.h
@@ -44,6 +44,11 @@ typedef CLIB_PACKED (struct {
}) ike_header_t;
/* *INDENT-ON* */
+#define ike_hdr_is_response(_h) ((_h)->flags & IKEV2_HDR_FLAG_RESPONSE)
+#define ike_hdr_is_request(_h) (!ike_hdr_is_response(_h))
+#define ike_hdr_is_initiator(_h) ((_h)->flags & IKEV2_HDR_FLAG_INITIATOR)
+#define ike_hdr_is_responder(_h) (!(ike_hdr_is_initiator(_h)))
+
/* *INDENT-OFF* */
typedef CLIB_PACKED (struct {
u8 nextpayload;