libcli/smb: Add smb2_lease_equal() which compares client_guids and keys.
authorJeremy Allison <jra@samba.org>
Wed, 5 Nov 2014 05:44:45 +0000 (21:44 -0800)
committerJeremy Allison <jra@samba.org>
Fri, 7 Nov 2014 21:41:47 +0000 (22:41 +0100)
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Nov  7 22:41:47 CET 2014 on sn-devel-104

libcli/smb/smb2_lease.c
libcli/smb/smb2_lease.h

index 41eafc99c6a2c1022703bb24277b6e4e0e75c48a..770525683d5140b02204888c580bc453555f0b88 100644 (file)
@@ -93,3 +93,11 @@ bool smb2_lease_key_equal(const struct smb2_lease_key *k1,
 {
        return ((k1->data[0] == k2->data[0]) && (k1->data[1] == k2->data[1]));
 }
+
+bool smb2_lease_equal(const struct GUID *g1,
+                     const struct smb2_lease_key *k1,
+                     const struct GUID *g2,
+                     const struct smb2_lease_key *k2)
+{
+       return GUID_equal(g1, g2) && smb2_lease_key_equal(k1, k2);
+}
index 9db239d0f5f2bf648f7e48d504b914426886610c..2e6faf798124ebf50553dd9831c0d570d0487f09 100644 (file)
@@ -23,6 +23,7 @@
 #ifndef _LIBCLI_SMB_SMB2_LEASE_H_
 #define _LIBCLI_SMB_SMB2_LEASE_H_
 
+#include "librpc/gen_ndr/ndr_misc.h"
 #include "librpc/gen_ndr/smb2_lease_struct.h"
 
 /*
@@ -34,5 +35,9 @@ ssize_t smb2_lease_pull(const uint8_t *buf, size_t len,
 bool smb2_lease_push(const struct smb2_lease *lease, uint8_t *buf, size_t len);
 bool smb2_lease_key_equal(const struct smb2_lease_key *k1,
                          const struct smb2_lease_key *k2);
+bool smb2_lease_equal(const struct GUID *g1,
+                     const struct smb2_lease_key *k1,
+                     const struct GUID *g2,
+                     const struct smb2_lease_key *k2);
 
 #endif /* _LIBCLI_SMB_SMB2_LEASE_H_ */