libsmb: Put the "smb2_lease" struct into idl
authorVolker Lendecke <vl@samba.org>
Thu, 5 Jun 2014 10:57:36 +0000 (10:57 +0000)
committerJeremy Allison <jra@samba.org>
Thu, 12 Jun 2014 01:34:41 +0000 (03:34 +0200)
This will make it easier in the future to NDR_PRINT a lease and
a lease key

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Jun 12 03:34:41 CEST 2014 on sn-devel-104

libcli/smb/smb2_constants.h
libcli/smb/smb2_lease.h
libcli/smb/wscript
librpc/idl/smb2_lease_struct.idl [new file with mode: 0644]
librpc/idl/wscript_build
librpc/wscript_build
source4/libcli/raw/interfaces.h

index 40a63396afd3db9981d8416dd2ad2c5eef8efa1d..0b34723c75164a5885a88b952d7bab5602079129 100644 (file)
 
 /* SMB2 lease bits */
 #define SMB2_LEASE_NONE                                  0x00
-#define SMB2_LEASE_READ                                  0x01
-#define SMB2_LEASE_HANDLE                                0x02
-#define SMB2_LEASE_WRITE                                 0x04
 
 /* SMB2 lease flags */
 #define SMB2_LEASE_FLAG_BREAK_IN_PROGRESS                0x00000002
index 73f97acb75c034797210cc1d10c8fda9b7625aad..ba8178dba06d0b0a0747de475aff74b1ade84688 100644 (file)
 #ifndef _LIBCLI_SMB_SMB2_LEASE_H_
 #define _LIBCLI_SMB_SMB2_LEASE_H_
 
-/*
-  SMB2 lease structure (per MS-SMB2 2.2.13)
-*/
-struct smb2_lease_key {
-       uint64_t data[2];
-};
-
-struct smb2_lease {
-       struct smb2_lease_key lease_key;
-       uint32_t lease_state;
-       uint32_t lease_flags;
-       uint64_t lease_duration; /* should be 0 */
-       /* only for v2 */
-       struct smb2_lease_key parent_lease_key;
-       uint16_t lease_epoch;
-};
+#include "librpc/gen_ndr/smb2_lease_struct.h"
 
 /*
  * Parse a smb2 lease create context. Return -1 on error, buffer.length on
index f28b7454b473406c37d9d467e6ceb28f4cca98f0..17efc97b477db7df7ebf33c55a55f24137035bb0 100755 (executable)
@@ -40,7 +40,10 @@ def build(bld):
                smb2cli_echo.c
                 tstream_smbXcli_np.c
        ''',
-       deps='LIBCRYPTO errors gensec krb5samba smb_transport',
+       deps='''
+                LIBCRYPTO NDR_SMB2_LEASE_STRUCT errors gensec krb5samba
+                smb_transport
+        ''',
        public_deps='talloc samba-util',
        private_library=True,
        public_headers='''
diff --git a/librpc/idl/smb2_lease_struct.idl b/librpc/idl/smb2_lease_struct.idl
new file mode 100644 (file)
index 0000000..ea28548
--- /dev/null
@@ -0,0 +1,33 @@
+#include "idl_types.h"
+
+/*
+  miscellaneous IDL structures
+*/
+
+[
+       pointer_default(unique)
+]
+interface smb2_lease_struct
+{
+       /*
+        * SMB2 lease structure (per MS-SMB2 2.2.13)
+        */
+       typedef [public] struct {
+               hyper data[2];
+       } smb2_lease_key;
+
+       typedef [public,bitmap32bit] bitmap {
+               SMB2_LEASE_READ = 0x01,
+               SMB2_LEASE_WRITE = 0x02,
+               SMB2_LEASE_HANDLE = 0x04
+       } smb2_lease_state;
+
+       typedef [public] struct {
+               smb2_lease_key lease_key;
+               smb2_lease_state lease_state;
+               uint32 lease_flags;
+               uint32 lease_duration;  /* should be 0 */
+               smb2_lease_key parent_lease_key;
+               uint16 lease_epoch;
+       } smb2_lease;
+};
\ No newline at end of file
index d1484afcda5063aa6fbe53de55068a8df72a99df..1bac9a74d2b48d16762aebf902eeaecf1202feb0 100644 (file)
@@ -11,6 +11,7 @@ bld.SAMBA_PIDL_LIST('PIDL',
                        oxidresolver.idl samr.idl server_id.idl srvsvc.idl winreg.idl dcerpc.idl
                        drsblobs.idl efs.idl frstrans.idl mgmt.idl netlogon.idl
                        notify.idl
+                       smb2_lease_struct.idl
                        policyagent.idl scerpc.idl svcctl.idl wkssvc.idl eventlog6.idl backupkey.idl
                        fsrvp.idl witness.idl''',
                     options='--header --ndr-parser --samba3-ndr-server --server --client --python',
index 393f57979a627f2188aafaa099e98e27e4383755..b21619e244c1afee081e2f015423e34e94a977d4 100644 (file)
@@ -353,6 +353,12 @@ bld.SAMBA_SUBSYSTEM('NDR_XATTR',
     public_deps='ndr NDR_SECURITY'
     )
 
+bld.SAMBA_SUBSYSTEM('NDR_SMB2_LEASE_STRUCT',
+    source='gen_ndr/ndr_smb2_lease_struct.c',
+    public_deps='ndr',
+    public_headers='gen_ndr/smb2_lease_struct.h'
+    )
+
 bld.SAMBA_SUBSYSTEM('NDR_SCHANNEL',
     source='ndr/ndr_schannel.c gen_ndr/ndr_schannel.c',
     public_deps='ndr ndr_nbt'
index 7bc79cad2181fa2c4da7c17210ff7bde33a15a71..12c03774f55f6fb9b7c120cda8d75417b59d8353 100644 (file)
@@ -25,6 +25,7 @@
 #include "source4/libcli/raw/smb.h"
 #include "../libcli/smb/smb_common.h"
 #include "librpc/gen_ndr/misc.h" /* for struct GUID */
+#include "librpc/gen_ndr/smb2_lease_struct.h"
 
 /* this structure is just a wrapper for a string, the only reason we
    bother with this is that it allows us to check the length provided