From: Joseph Sutton Date: Wed, 14 Jun 2023 22:18:38 +0000 (+1200) Subject: s4:kdc: Add helper functions to create optional int64 values X-Git-Tag: talloc-2.4.1~369 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9585bf9bb723d58dd0fc07ae65de071cd189817f;p=thirdparty%2Fsamba.git 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 --- 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