s4:kdc: Add helper functions to create optional int64 values
authorJoseph Sutton <josephsutton@catalyst.net.nz>
Wed, 14 Jun 2023 22:18:38 +0000 (10:18 +1200)
committerAndrew Bartlett <abartlet@samba.org>
Thu, 15 Jun 2023 05:29:28 +0000 (05:29 +0000)
These values will be used to represent TGT lifetimes, which might or
might not be present.

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
auth/authn_policy_impl.h

index 87a13253835ad53f74830446c055a2791bb94f5b..121c6cbad46898fb98b632119b0b41da1f54faad 100644 (file)
@@ -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