idl: add file_id idl.
authorGünther Deschner <gd@samba.org>
Tue, 25 Jan 2011 01:42:59 +0000 (02:42 +0100)
committerGünther Deschner <gd@samba.org>
Tue, 25 Jan 2011 11:27:00 +0000 (12:27 +0100)
Guenther

Autobuild-User: Günther Deschner <gd@samba.org>
Autobuild-Date: Tue Jan 25 12:27:00 CET 2011 on sn-devel-104

librpc/idl/file_id.idl [new file with mode: 0644]
librpc/idl/wscript_build
librpc/wscript_build
source3/Makefile.in
source3/include/locking.h
source3/include/proto.h
source3/librpc/idl/notify.idl
source3/librpc/ndr/util.c
source3/librpc/wscript_build

diff --git a/librpc/idl/file_id.idl b/librpc/idl/file_id.idl
new file mode 100644 (file)
index 0000000..cd1febe
--- /dev/null
@@ -0,0 +1,14 @@
+[
+       pointer_default(unique)
+]
+interface file_id
+{
+       typedef [public] struct {
+               /* we don't use SMB_DEV_T and SMB_INO_T as we want a fixed size here,
+                  and we may be using file system specific code to fill in something
+                  other than a dev_t for the device */
+               udlong devid;
+               udlong inode;
+               udlong extid; /* Support systems that use an extended id (e.g. snapshots). */
+       } file_id;
+}
index 2d65d748ee4773fad31a648f1e9230b5434df607..7342228e20707455f1ca5fc16f47b3f62b51478a 100644 (file)
@@ -3,7 +3,7 @@
 bld.SAMBA_PIDL_LIST('PIDL',
                     '''atsvc.idl drsuapi.idl epmapper.idl initshutdown.idl
                        misc.idl ntlmssp.idl schannel.idl trkwks.idl
-                       audiosrv.idl dfsblobs.idl dsbackup.idl eventlog.idl keysvc.idl
+                       audiosrv.idl dfsblobs.idl dsbackup.idl eventlog.idl file_id.idl keysvc.idl
                        msgsvc.idl ntsvcs.idl remact.idl security.idl unixinfo.idl wzcsvc.idl
                        browser.idl dfs.idl dssetup.idl frsapi.idl krb5pac.idl
                        named_pipe_auth.idl orpc.idl rot.idl spoolss.idl w32time.idl xattr.idl
index 9cbd9fa37c377a0488cf10c54449bc36669155ff..89d0980d852df18e1e4e4a3091ea71f115498e8c 100644 (file)
@@ -286,6 +286,11 @@ bld.SAMBA_SUBSYSTEM('NDR_BACKUPKEY',
        public_deps='ndr'
        )
 
+bld.SAMBA_SUBSYSTEM('NDR_FILE_ID',
+       source='../librpc/gen_ndr/ndr_file_id.c',
+       public_deps='ndr'
+       )
+
 bld.SAMBA_SUBSYSTEM('RPC_NDR_XATTR',
        source='../librpc/gen_ndr/ndr_xattr_c.c',
        public_deps='NDR_XATTR dcerpc'
index 0ce97b8ca3a74175ceb623feb1db714c60d42059..5a4435badbb810c136494a57b3e65c702f57bf9c 100644 (file)
@@ -769,7 +769,7 @@ OPLOCK_OBJ = smbd/oplock.o smbd/oplock_irix.o smbd/oplock_linux.o \
             smbd/oplock_onefs.o
 
 NOTIFY_OBJ = smbd/notify.o smbd/notify_inotify.o smbd/notify_internal.o \
-            librpc/gen_ndr/ndr_notify.o
+            librpc/gen_ndr/ndr_notify.o librpc/gen_ndr/ndr_file_id.o
 
 FNAME_UTIL_OBJ = smbd/filename_util.o
 
index 88104b0fefa4cb7e8c93f43d929f463e3973bf15..5504da6dc3214d35add032fc970e038e89e0dc12 100644 (file)
@@ -43,14 +43,7 @@ struct lock_context {
 
 struct files_struct;
 
-struct file_id {
-       /* we don't use SMB_DEV_T and SMB_INO_T as we want a fixed size here,
-          and we may be using file system specific code to fill in something
-          other than a dev_t for the device */
-       uint64_t devid;
-       uint64_t inode;
-       uint64_t extid; /* Support systems that use an extended id (e.g. snapshots). */
-};
+#include "../librpc/gen_ndr/file_id.h"
 
 struct byte_range_lock {
        struct files_struct *fsp;
index a3597cc2c809716b05d4cec98d479b2fb8ecab0d..29dbcc97635ab00b89dce93552daf12c228a513b 100644 (file)
@@ -1584,9 +1584,6 @@ unsigned wins_srv_count_tag(const char *tag);
 enum ndr_err_code ndr_push_server_id(struct ndr_push *ndr, int ndr_flags, const struct server_id *r);
 enum ndr_err_code ndr_pull_server_id(struct ndr_pull *ndr, int ndr_flags, struct server_id *r);
 void ndr_print_server_id(struct ndr_print *ndr, const char *name, const struct server_id *r);
-enum ndr_err_code ndr_push_file_id(struct ndr_push *ndr, int ndr_flags, const struct file_id *r);
-enum ndr_err_code ndr_pull_file_id(struct ndr_pull *ndr, int ndr_flags, struct file_id *r);
-void ndr_print_file_id(struct ndr_print *ndr, const char *name, const struct file_id *r);
 _PUBLIC_ void ndr_print_sockaddr_storage(struct ndr_print *ndr, const char *name, const struct sockaddr_storage *ss);
 const char *ndr_errstr(enum ndr_err_code err);
 extern const struct ndr_syntax_id null_ndr_syntax_id;
index 040f661b338a192915356d6f415f1cfee2ade546..e776d5d715e13f383d455b8c8231b215ba5135ed 100644 (file)
@@ -1,5 +1,7 @@
 #include "idl_types.h"
 
+import "file_id.idl";
+
 /*
    IDL structures for notify change code
 
index 225d520ca6d31662f62278569b6814cdd3792156..ed24f87387554ae4f4ba414aa57c9959bf2110a7 100644 (file)
@@ -161,45 +161,6 @@ void ndr_print_server_id(struct ndr_print *ndr, const char *name, const struct s
        ndr->depth--;
 }
 
-enum ndr_err_code ndr_push_file_id(struct ndr_push *ndr, int ndr_flags, const struct file_id *r)
-{
-       if (ndr_flags & NDR_SCALARS) {
-               NDR_CHECK(ndr_push_align(ndr, 4));
-               NDR_CHECK(ndr_push_udlong(ndr, NDR_SCALARS,
-                                         (uint64_t)r->devid));
-               NDR_CHECK(ndr_push_udlong(ndr, NDR_SCALARS,
-                                         (uint64_t)r->inode));
-               NDR_CHECK(ndr_push_udlong(ndr, NDR_SCALARS,
-                                         (uint64_t)r->extid));
-       }
-       if (ndr_flags & NDR_BUFFERS) {
-       }
-       return NDR_ERR_SUCCESS;
-}
-
-enum ndr_err_code ndr_pull_file_id(struct ndr_pull *ndr, int ndr_flags, struct file_id *r)
-{
-       if (ndr_flags & NDR_SCALARS) {
-               NDR_CHECK(ndr_pull_align(ndr, 4));
-               NDR_CHECK(ndr_pull_udlong(ndr, NDR_SCALARS, &r->devid));
-               NDR_CHECK(ndr_pull_udlong(ndr, NDR_SCALARS, &r->inode));
-               NDR_CHECK(ndr_pull_udlong(ndr, NDR_SCALARS, &r->extid));
-       }
-       if (ndr_flags & NDR_BUFFERS) {
-       }
-       return NDR_ERR_SUCCESS;
-}
-
-void ndr_print_file_id(struct ndr_print *ndr, const char *name, const struct file_id *r)
-{
-       ndr_print_struct(ndr, name, "file_id");
-       ndr->depth++;
-       ndr_print_udlong(ndr, "devid", (uint64_t)r->devid);
-       ndr_print_udlong(ndr, "inode", (uint64_t)r->inode);
-       ndr_print_udlong(ndr, "extid", (uint64_t)r->extid);
-       ndr->depth--;
-}
-
 _PUBLIC_ void ndr_print_sockaddr_storage(struct ndr_print *ndr, const char *name, const struct sockaddr_storage *ss)
 {
        char addr[INET6_ADDRSTRLEN];
index 5b305075bd3250efc4eb48b10aad36b5557a95c7..adf7f70c49b26ccd63a30e191687d44c4a669ea7 100644 (file)
@@ -17,7 +17,7 @@ bld.SAMBA_SUBSYSTEM('NDR_MESSAGING',
 
 bld.SAMBA_SUBSYSTEM('NDR_NOTIFY',
        source='gen_ndr/ndr_notify.c',
-       public_deps='ndr'
+       public_deps='ndr NDR_FILE_ID'
        )
 
 bld.SAMBA_SUBSYSTEM('NDR_PREG',