From 9585bf9bb723d58dd0fc07ae65de071cd189817f Mon Sep 17 00:00:00 2001 From: Joseph Sutton Date: Thu, 15 Jun 2023 10:18:38 +1200 Subject: [PATCH] s4:kdc: Add helper functions to create optional int64 values These values will be used to represent TGT lifetimes, which might or might not be present. Signed-off-by: Joseph Sutton Reviewed-by: Andrew Bartlett --- auth/authn_policy_impl.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/auth/authn_policy_impl.h b/auth/authn_policy_impl.h index 87a13253835..121c6cbad46 100644 --- a/auth/authn_policy_impl.h +++ b/auth/authn_policy_impl.h @@ -64,4 +64,19 @@ struct authn_audit_info { struct authn_int64_optional tgt_lifetime_raw; }; +static inline struct authn_int64_optional authn_int64_some(const int64_t val) +{ + return (struct authn_int64_optional) { + .is_present = true, + .val = val, + }; +} + +static inline struct authn_int64_optional authn_int64_none(void) +{ + return (struct authn_int64_optional) { + .is_present = false, + }; +} + #endif