[SCM] Samba Shared Repository - branch master updated
Matthieu Patou
mat at samba.org
Thu Oct 2 06:28:01 MDT 2014
The branch, master has been updated
via 7f242d0 idl: declare frstrans_VersionVector public so that we can dump it to blob and vice versa
via c768433 idl: frstrans.idl add frstrans_RdcClose
via c67468d idl: improve frsrpc by adding missing flag, fixing typo (W -> VV) and making needed structure public
via c396660 idl: Add frs blobs for dumping of frs related blobs with ndrdump
via a5701c2 idl: Add compression_guid
via 51e7f76 idl: frsrpc depends on bkupblobs.idl and fscc.idl
via 4cc86bb idl: add fscc needed by frsrpc
via f1d03e7 idl: add nt backup blobs format
via 7bc3b37 idl: frsrpc we don't need NDR_REMAINING as size of the blob is one the wire
via 15ab764 idl: frsrpc cleaning, opnum 4->10 didn't exists
via 072bf22 lib: Use GUID_buf_string in GUID_string
via 82c7ab2 Create talloc-less functions for formating GUID
from 47f307d swrap: Bump version to 1.1.2.
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit 7f242d035778d581ef90d26fe02537d5955e655d
Author: Matthieu Patou <mat at matws.net>
Date: Sun Sep 28 21:22:27 2014 -0700
idl: declare frstrans_VersionVector public so that we can dump it to blob and vice versa
Change-Id: Ica8dbe899eb257603ce6f7b2ea224c6533bdea46
Reviewed-by: Matthieu Patou <mat at matws.net>
Signed-off-by: Matthieu Patou <mat at matws.net>
Reviewed-by: Stefan Metzmacher <metze at samba.org>
Autobuild-User(master): Matthieu Patou <mat at samba.org>
Autobuild-Date(master): Thu Oct 2 14:27:02 CEST 2014 on sn-devel-104
commit c76843361bbcebd93f608f3932ed0150c528e40c
Author: Matthieu Patou <mat at matws.net>
Date: Wed Sep 25 23:53:21 2013 -0700
idl: frstrans.idl add frstrans_RdcClose
Change-Id: I32e88f542da7df21e253cfbf8c2b3cc17043c6c7
Signed-off-by: Matthieu Patou <mat at matws.net>
Reviewed-by: Stefan Metzmacher <metze at samba.org>
commit c67468d43b4c93ec2a7dc727a3192e339eb5528c
Author: Matthieu Patou <mat at matws.net>
Date: Fri Sep 23 18:09:48 2011 -0700
idl: improve frsrpc by adding missing flag, fixing typo (W -> VV) and making needed structure public
Change-Id: Ia507b5f627464ab78a145e54b276fc8d64ee3c14
Signed-off-by: Matthieu Patou <mat at matws.net>
Reviewed-by: Stefan Metzmacher <metze at samba.org>
commit c396660f06bae80a652c228895eb7102f7e1658a
Author: Matthieu Patou <mat at matws.net>
Date: Wed Jul 18 09:02:06 2012 -0700
idl: Add frs blobs for dumping of frs related blobs with ndrdump
Change-Id: I5f8375fee663e452c26f264d73f637beffb1f209
Signed-off-by: Matthieu Patou <mat at matws.net>
Reviewed-by: Stefan Metzmacher <metze at samba.org>
commit a5701c298f308908ebd580aa8c1b9a9066296def
Author: Matthieu Patou <mat at matws.net>
Date: Fri Sep 2 00:36:03 2011 +0200
idl: Add compression_guid
Change-Id: I3cfe3c8f4a405fcf9a54092b03e87f00e7abd2fb
Signed-off-by: Matthieu Patou <mat at matws.net>
Reviewed-by: Stefan Metzmacher <metze at samba.org>
commit 51e7f769e2cfb0b16b5466d9461358593ca87667
Author: Matthieu Patou <mat at matws.net>
Date: Wed Jul 18 08:55:26 2012 -0700
idl: frsrpc depends on bkupblobs.idl and fscc.idl
Change-Id: I6ce1f4b28752765e7bc59c9eb7474ebd68d9b399
Signed-off-by: Matthieu Patou <mat at matws.net>
Reviewed-by: Stefan Metzmacher <metze at samba.org>
commit 4cc86bb5051c7bf6d29e8aea03ec973c901b4bf2
Author: Matthieu Patou <mat at matws.net>
Date: Thu Aug 18 19:07:40 2011 +0200
idl: add fscc needed by frsrpc
Change-Id: Ib44a57b38a194e727242267a4821c88a15219eab
Signed-off-by: Matthieu Patou <mat at matws.net>
Reviewed-by: Stefan Metzmacher <metze at samba.org>
commit f1d03e78370c735d6fc8418bc356ed52b0fdf75f
Author: Matthieu Patou <mat at matws.net>
Date: Thu Aug 18 19:07:14 2011 +0200
idl: add nt backup blobs format
Change-Id: I4a43e1fe5fcebf2a4647ea2fbc9985663c0d7af2
Reviewed-by: Stefan Metzmacher <metze at samba.org>
Signed-off-by: Matthieu Patou <mat at matws.net>
commit 7bc3b372cab0294605e22098d04636e5ece81ffe
Author: Matthieu Patou <mat at matws.net>
Date: Sun Aug 7 09:41:00 2011 +0400
idl: frsrpc we don't need NDR_REMAINING as size of the blob is one the wire
Change-Id: Ia3f1a16668e97ae7b45a8d9ee4d0539c2652eb82
Reviewed-by: Stefan Metzmacher <metze at samba.org>
Signed-off-by: Matthieu Patou <mat at matws.net>
commit 15ab764f91f22c8c08c630af110d78d578bb3429
Author: Matthieu Patou <mat at matws.net>
Date: Mon Aug 1 13:53:32 2011 +0400
idl: frsrpc cleaning, opnum 4->10 didn't exists
Change-Id: I6b45ffdead170e9f83deb8d16082cc9bb0366d47
Reviewed-by: Stefan Metzmacher <metze at samba.org>
Signed-off-by: Matthieu Patou <mat at matws.net>
commit 072bf227a76ff0683aa4a32255ce89db2107829e
Author: Volker Lendecke <vl at samba.org>
Date: Tue Sep 30 06:32:36 2014 +0000
lib: Use GUID_buf_string in GUID_string
Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Matthieu Patou <mat at matws.net>
commit 82c7ab22665d621ea5df0450638cb5dc0f40bff8
Author: Matthieu Patou <mat at matws.net>
Date: Thu Sep 25 01:14:27 2014 -0700
Create talloc-less functions for formating GUID
Signed-off-by: Matthieu Patou <mat at matws.net>
Reviewed-by: Volker Lendecke <vl at samba.org>
Change-Id: I84adc45d2476dd225315bfc7dbb313f1b36b31e7
-----------------------------------------------------------------------
Summary of changes:
librpc/ABI/{ndr-0.0.3.sigs => ndr-0.0.4.sigs} | 1 +
librpc/idl/bkupblobs.idl | 54 +++++++++++++++++++++
librpc/idl/frsblobs.idl | 31 ++++++++++++
librpc/idl/frsrpc.idl | 62 +++++++++++++++++++-----
librpc/idl/frstrans.idl | 6 ++-
librpc/idl/fscc.idl | 47 +++++++++++++++++++
librpc/idl/wscript_build | 2 +-
librpc/ndr/libndr.h | 6 ++
librpc/ndr/{ndr_frsrpc.c => ndr_bkupblobs.c} | 50 ++++++++------------
librpc/ndr/uuid.c | 33 ++++++++++----
librpc/wscript_build | 22 ++++++++-
source4/librpc/wscript_build | 3 +-
12 files changed, 260 insertions(+), 57 deletions(-)
copy librpc/ABI/{ndr-0.0.3.sigs => ndr-0.0.4.sigs} (99%)
create mode 100644 librpc/idl/bkupblobs.idl
create mode 100644 librpc/idl/frsblobs.idl
create mode 100644 librpc/idl/fscc.idl
copy librpc/ndr/{ndr_frsrpc.c => ndr_bkupblobs.c} (59%)
Changeset truncated at 500 lines:
diff --git a/librpc/ABI/ndr-0.0.3.sigs b/librpc/ABI/ndr-0.0.4.sigs
similarity index 99%
copy from librpc/ABI/ndr-0.0.3.sigs
copy to librpc/ABI/ndr-0.0.4.sigs
index d9c76f0..c1b880f 100644
--- a/librpc/ABI/ndr-0.0.3.sigs
+++ b/librpc/ABI/ndr-0.0.4.sigs
@@ -1,4 +1,5 @@
GUID_all_zero: bool (const struct GUID *)
+GUID_buf_string: char *(const struct GUID *, struct GUID_txt_buf *)
GUID_compare: int (const struct GUID *, const struct GUID *)
GUID_equal: bool (const struct GUID *, const struct GUID *)
GUID_from_data_blob: NTSTATUS (const DATA_BLOB *, struct GUID *)
diff --git a/librpc/idl/bkupblobs.idl b/librpc/idl/bkupblobs.idl
new file mode 100644
index 0000000..d1ec4a5
--- /dev/null
+++ b/librpc/idl/bkupblobs.idl
@@ -0,0 +1,54 @@
+#include "idl_types.h"
+
+import "misc.idl";
+import "security.idl";
+import "fscc.idl";
+/* bkup blobs interface definition */
+
+
+[
+ pointer_default(unique),
+ helpstring("bkup blobs")
+]
+
+
+interface bkup
+{
+ typedef [v1_enum] enum {
+ STREAM_ID_DATA = 1,
+ STREAM_ID_EX_DATA = 2,
+ STREAM_ID_SECURITY_DATA = 3,
+ STREAM_ID_ALTERNATE_DATA = 4,
+ STREAM_ID_LINK = 5,
+ STREAM_ID_OBJECTID = 7,
+ STREAM_ID_REPARSE_DATA = 8,
+ STREAM_ID_SPARSE_BLOCK = 9,
+ STREAM_ID_TXFS_DATA = 10
+ } bkup_StreamId;
+
+ typedef [v1_enum] enum {
+ STREAM_ATTRIBUTE_NORMAL = 0,
+ STREAM_ATTRIBUTE_SECURITY = 2,
+ STREAM_ATTRIBUTE_SPARSE = 8
+ } bkup_StreamAttribute;
+
+ typedef [nodiscriminant] union {
+ [default] DATA_BLOB blob;
+ [flag(NDR_ALIGN2),case(STREAM_ID_SECURITY_DATA)] security_descriptor sd;
+ [case(STREAM_ID_OBJECTID)] fscc_FileObjectIdBuffer_2 object;
+ } bkup_StreamData;
+
+ typedef [public] struct {
+ bkup_StreamId id;
+ bkup_StreamAttribute attribute;
+ hyper size;
+ uint32 stream_name_size;
+ [charset(UTF16),flag(STR_NOTERM)] uint16 stream_name[stream_name_size];
+ [subcontext(0), subcontext_size(size), switch_is(id)] [flag(NDR_REMAINING)] bkup_StreamData data;
+ } bkup_Win32StreamId;
+
+ typedef [nopush, nopull, flag(NDR_NOALIGN), public] struct {
+ uint32 num_stream;
+ bkup_Win32StreamId streams[num_stream];
+ } bkup_NTBackupFile;
+}
diff --git a/librpc/idl/frsblobs.idl b/librpc/idl/frsblobs.idl
new file mode 100644
index 0000000..e5f0f93
--- /dev/null
+++ b/librpc/idl/frsblobs.idl
@@ -0,0 +1,31 @@
+#include "idl_types.h"
+
+import "misc.idl";
+import "security.idl";
+import "frsrpc.idl";
+import "bkupblobs.idl";
+import "fscc.idl";
+/* frs related blobs decoding. Used for debug/dump of FRS related structures */
+
+[
+ pointer_default(unique),
+ helpstring("bkup blobs"),
+ uuid("12345777-1234-abcd-0001-00000004")
+]
+
+interface frsblobs
+{
+
+ void decode_nt_backup_file(
+ [in] bkup_NTBackupFile file
+ );
+
+ void decode_frsrpc_StageHeader(
+ [in] frsrpc_StageHeader header,
+ [in] bkup_NTBackupFile data
+ );
+
+ void decode_FileNetworkOpenInformation(
+ [in] fscc_FileNetworkOpenInformation data
+ );
+}
diff --git a/librpc/idl/frsrpc.idl b/librpc/idl/frsrpc.idl
index a235702..016095f 100644
--- a/librpc/idl/frsrpc.idl
+++ b/librpc/idl/frsrpc.idl
@@ -1,6 +1,8 @@
#include "idl_types.h"
import "misc.idl";
+import "fscc.idl";
+import "bkupblobs.idl";
[
uuid("f5cc59b4-4264-101a-8c59-08002b2f8426"),
@@ -12,6 +14,7 @@ import "misc.idl";
]
interface frsrpc
{
+
/*****************/
/* Function 0x00 */
@@ -33,6 +36,7 @@ interface frsrpc
FRSRPC_CO_FLAG_ONLIST = 0x00000010,
FRSRPC_CO_FLAG_LOCALCO = 0x00000020,
FRSRPC_CO_FLAG_RETRY = 0x00000040,
+ FRSRPC_CO_FLAG_INST_INCOMPLETE = 0x00000080,
FRSRPC_CO_FLAG_OUT_OF_ORDER = 0x00000200,
FRSRPC_CO_FLAG_NEW_FILE = 0x00000400,
FRSRPC_CO_FLAG_CONTROL = 0x00001000,
@@ -48,6 +52,9 @@ interface frsrpc
const uint32 FRSRPC_CO_IFLAG_NONE = 0x0000000;
+ const string FRSRPC_COMPRESSION_GUID = "64d2f7d2-2695-436d-8830-8d3c58701e15";
+
+
typedef [bitmap32bit,flag(NDR_PAHEX)] bitmap {
FRSRPC_CO_IFLAG_VVRETIRE_EXEC = 0x00000001,
FRSRPC_CO_IFLAG_CO_ABORT = 0x00000002,
@@ -115,7 +122,7 @@ interface frsrpc
FRSRPC_CO_LOCATION_DIR_NO_CMD = 0x0000000e | 0x00000001
} frsrpc_CommPktCoCmdLocationCmd;
- typedef struct {
+ [public] typedef struct {
uint32 sequence_number;
frsrpc_CommPktCoCmdFlags flags;
frsrpc_CommPktCoCmdIFlags iflags;
@@ -202,7 +209,7 @@ interface frsrpc
frsrpc_CommPktCoRecordExtensionMajor major;
[value(0x0002)] uint16 offset_count;
[value(0x00000018)] uint32 offset0;
- [value(0x00000030)] uint32 offset1;/*TODO: is this correct??? */
+ [value(0x00000030)] uint32 offset1;
[value(0)] uint32 offset_last;
[value(0)] uint32 not_used;
frsrpc_CommPktDataExtensionChecksum data_checksum;
@@ -220,7 +227,7 @@ interface frsrpc
FRSRPC_COMMAND_JOINING = 0x00000130,
FRSRPC_COMMAND_JOINED = 0x00000128,
FRSRPC_COMMAND_UNJOIN_REMOTE = 0x00000148,
- FRSRPC_COMMAND_WJOIN_DONE = 0x00000136,
+ FRSRPC_COMMAND_VVJOIN_DONE = 0x00000136,
FRSRPC_COMMAND_SEND_STAGE = 0x00000228
} frsrpc_CommPktCommand;
@@ -281,7 +288,7 @@ interface frsrpc
[case(FRSRPC_COMM_PKT_CHUNK_COMPRESSION_GUID)]
GUID compression_guid;
[case(FRSRPC_COMM_PKT_CHUNK_BLOCK)]
- [flag(NDR_REMAINING)] DATA_BLOB block;
+ DATA_BLOB block;
[case(FRSRPC_COMM_PKT_CHUNK_BLOCK_SIZE)]
hyper block_size;
[case(FRSRPC_COMM_PKT_CHUNK_FILE_SIZE)]
@@ -293,7 +300,7 @@ interface frsrpc
[case(FRSRPC_COMM_PKT_CHUNK_CO_GUID)][subcontext(4)]
GUID co_guid;
[case(FRSRPC_COMM_PKT_CHUNK_CO_SEQUENCE_NUMBER)]
- uint32 co_sequnence_number;
+ uint32 co_sequence_number;
[case(FRSRPC_COMM_PKT_CHUNK_REMOTE_CO)][subcontext(4)]
frsrpc_CommPktChangeOrderCommand remote_co;
[case(FRSRPC_COMM_PKT_CHUNK_CO_EXT_WIN2K)][subcontext(4)]
@@ -331,7 +338,7 @@ interface frsrpc
FRSRPC_COMM_PKT_MINOR_9 = 0x00000009
} frsrpc_CommPktMinor;
- typedef struct {
+ [public] typedef struct {
frsrpc_CommPktMajor major;
frsrpc_CommPktMinor minor;
[value(1)] uint32 cs_id;
@@ -388,35 +395,64 @@ interface frsrpc
GUID *parent_guid
);
+ typedef [public,flag(NDR_NOALIGN)] struct {
+ uint32 major;
+ uint32 minor;
+ uint32 dataHigh;
+ uint32 dataLow;
+ uint16 compression;
+ uint8 unused[6];
+ fscc_FileNetworkOpenInformation attributes;
+ frsrpc_CommPktChangeOrderCommand command;
+ fscc_FileObjectIdBuffer_2 fileObjId;
+ frsrpc_CommPktCoRecordExtensionWin2k cocExt;
+ GUID compressionGuid;
+ uint32 encDataHigh;
+ uint32 encDataLow;
+ hyper dataSize;
+ uint32 reparseDataPresent;
+ uint32 reparseDataHigh;
+ uint32 reparseDataLow;
+ uint32 padding2;
+ } frsrpc_StageHeader;
+
/*****************/
/* Function 0x03 */
WERROR frsrpc_FrsNOP();
+ /*
+ *For Op from 4 to 10 Microsoft use
+ *the notation OpnumxxNotUsedOnWire
+ *where xx is the number of the OP.
+ *They are only declared in the IDL of MS-FRS1.pdf.
+ *Not in the core of the document.
+ */
+
/*****************/
/* Function 0x04 */
- [todo] void FRSRPC_BACKUP_COMPLETE();
+ /*[todo] void FRSRPC_BACKUP_COMPLETE();*/
/*****************/
/* Function 0x05 */
- [todo] void FRSRPC_BACKUP_COMPLETE_5();
+ /*[todo] void FRSRPC_BACKUP_COMPLETE_5();*/
/*****************/
/* Function 0x06 */
- [todo] void FRSRPC_BACKUP_COMPLETE_6();
+ /*[todo] void FRSRPC_BACKUP_COMPLETE_6();*/
/*****************/
/* Function 0x07 */
- [todo] void FRSRPC_BACKUP_COMPLETE_7();
+ /*[todo] void FRSRPC_BACKUP_COMPLETE_7();*/
/*****************/
/* Function 0x08 */
- [todo] void FRSRPC_BACKUP_COMPLETE_8();
+ /*[todo] void FRSRPC_BACKUP_COMPLETE_8();*/
/*****************/
/* Function 0x09 */
- [todo] void FRSRPC_BACKUP_COMPLETE_9();
+ /*[todo] void FRSRPC_BACKUP_COMPLETE_9();*/
/*****************/
/* Function 0x0a */
- [todo] void FRSRPC_VERIFY_PROMOTION_PARENT_EX();
+ /*[todo] void FRSRPC_VERIFY_PROMOTION_PARENT_EX();*/
}
diff --git a/librpc/idl/frstrans.idl b/librpc/idl/frstrans.idl
index caf6e42..ed5b105 100644
--- a/librpc/idl/frstrans.idl
+++ b/librpc/idl/frstrans.idl
@@ -58,7 +58,7 @@ interface frstrans
FRSTRANS_UPDATE_STATUS_MORE = 0x0003
} frstrans_UpdateStatus;
- typedef struct {
+ typedef [public] struct {
GUID db_guid;
hyper low;
hyper high;
@@ -185,7 +185,9 @@ interface frstrans
/*****************/
/* Function 0x0c */
- [todo] void FRSTRANS_RDC_CLOSE();
+ WERROR frstrans_RdcClose(
+ [in,out,ref] policy_handle *server_context
+ );
/*****************/
/* Function 0x0d */
diff --git a/librpc/idl/fscc.idl b/librpc/idl/fscc.idl
new file mode 100644
index 0000000..9947dcc
--- /dev/null
+++ b/librpc/idl/fscc.idl
@@ -0,0 +1,47 @@
+#include "idl_types.h"
+
+import "misc.idl";
+/* fscc structures */
+
+[
+ pointer_default(unique),
+ helpstring("fscc structures")
+]
+
+
+interface fscc
+{
+ typedef [public] struct {
+ GUID id;
+ GUID birthVolumeId;
+ GUID initialObjectId;
+ GUID domainId;
+ } fscc_FileObjectIdBuffer_2;
+
+ typedef [bitmap32bit,flag(NDR_PAHEX)] bitmap{
+ FSCC_FILE_ATTRIBUTE_READONLY = 0x00000001,
+ FSCC_FILE_ATTRIBUTE_HIDDEN = 0x00000002,
+ FSCC_FILE_ATTRIBUTE_SYSTEM = 0x00000004,
+ FSCC_FILE_ATTRIBUTE_NORMAL = 0x00000008,
+ FSCC_FILE_ATTRIBUTE_DIRECTORY = 0x00000010,
+ FSCC_FILE_ATTRIBUTE_ARCHIVE = 0x00000020,
+ FSCC_FILE_ATTRIBUTE_TEMPORARY = 0x00000100,
+ FSCC_FILE_ATTRIBUTE_SPARSE_FILE = 0x00000200,
+ FSCC_FILE_ATTRIBUTE_REPARSE_POINT = 0x00000400,
+ FSCC_FILE_ATTRIBUTE_COMPRESSED = 0x00000800,
+ FSCC_FILE_ATTRIBUTE_OFFLINE = 0x00001000,
+ FSCC_FILE_ATTRIBUTE_NOT_CONTENT_INDEXED = 0x00002000,
+ FSCC_FILE_ATTRIBUTE_ENCRYPTED = 0x00004000
+ } fscc_FileAttributes;
+
+ typedef [public] struct {
+ hyper creationTime;
+ hyper lastAccessTime;
+ hyper lastWriteTime;
+ hyper changeTime;
+ hyper allocSize;
+ hyper endOfFile;
+ fscc_FileAttributes fileAttribute;
+ uint32 reserved;
+ } fscc_FileNetworkOpenInformation;
+}
diff --git a/librpc/idl/wscript_build b/librpc/idl/wscript_build
index 1bac9a7..ad6664f 100644
--- a/librpc/idl/wscript_build
+++ b/librpc/idl/wscript_build
@@ -13,7 +13,7 @@ bld.SAMBA_PIDL_LIST('PIDL',
notify.idl
smb2_lease_struct.idl
policyagent.idl scerpc.idl svcctl.idl wkssvc.idl eventlog6.idl backupkey.idl
- fsrvp.idl witness.idl''',
+ fsrvp.idl bkupblobs.idl fscc.idl frsblobs.idl witness.idl''',
options='--header --ndr-parser --samba3-ndr-server --server --client --python',
output_dir='../gen_ndr')
diff --git a/librpc/ndr/libndr.h b/librpc/ndr/libndr.h
index 115e10a..76b58bb 100644
--- a/librpc/ndr/libndr.h
+++ b/librpc/ndr/libndr.h
@@ -653,6 +653,12 @@ char *GUID_string2(TALLOC_CTX *mem_ctx, const struct GUID *guid);
char *GUID_hexstring(TALLOC_CTX *mem_ctx, const struct GUID *guid);
struct GUID GUID_random(void);
+/* Format is "%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x" */
+ /* 32 chars + 4 ' ' + \0 + 2 for adding {} */
+struct GUID_txt_buf { char buf[39]; };
+_PUBLIC_ char* GUID_buf_string(const struct GUID *guid,
+ struct GUID_txt_buf *dst);
+
_PUBLIC_ enum ndr_err_code ndr_pull_enum_uint8(struct ndr_pull *ndr, int ndr_flags, uint8_t *v);
_PUBLIC_ enum ndr_err_code ndr_pull_enum_uint16(struct ndr_pull *ndr, int ndr_flags, uint16_t *v);
_PUBLIC_ enum ndr_err_code ndr_pull_enum_uint32(struct ndr_pull *ndr, int ndr_flags, uint32_t *v);
diff --git a/librpc/ndr/ndr_frsrpc.c b/librpc/ndr/ndr_bkupblobs.c
similarity index 59%
copy from librpc/ndr/ndr_frsrpc.c
copy to librpc/ndr/ndr_bkupblobs.c
index 96d3468..9335664 100644
--- a/librpc/ndr/ndr_frsrpc.c
+++ b/librpc/ndr/ndr_bkupblobs.c
@@ -1,9 +1,9 @@
/*
Unix SMB/CIFS implementation.
- helper routines for FRSRPC marshalling
+ helper routines for BKUP Blobs marshalling
- Copyright (C) Stefan (metze) Metzmacher 2009
+ Copyright (C) Matthieu Patou <mat at matws.net> 2011
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -20,21 +20,21 @@
*/
#include "includes.h"
-#include "librpc/gen_ndr/ndr_frsrpc.h"
+#include "librpc/gen_ndr/ndr_bkupblobs.h"
-enum ndr_err_code ndr_push_frsrpc_CommPktChunkCtr(struct ndr_push *ndr,
- int ndr_flags,
- const struct frsrpc_CommPktChunkCtr *r)
+
+_PUBLIC_ enum ndr_err_code ndr_push_bkup_NTBackupFile(struct ndr_push *ndr, int ndr_flags, const struct bkup_NTBackupFile *r)
{
- uint32_t cntr_chunks_0;
+ uint32_t cntr_streams_0;
{
uint32_t _flags_save_STRUCT = ndr->flags;
ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN);
if (ndr_flags & NDR_SCALARS) {
NDR_CHECK(ndr_push_align(ndr, 2));
- for (cntr_chunks_0 = 0; cntr_chunks_0 < r->num_chunks; cntr_chunks_0++) {
- NDR_CHECK(ndr_push_frsrpc_CommPktChunk(ndr, NDR_SCALARS, &r->chunks[cntr_chunks_0]));
+ for (cntr_streams_0 = 0; cntr_streams_0 < r->num_stream; cntr_streams_0++) {
+ NDR_CHECK(ndr_push_bkup_Win32StreamId(ndr, NDR_SCALARS, &r->streams[cntr_streams_0]));
}
+ NDR_CHECK(ndr_push_trailer_align(ndr, 8));
}
if (ndr_flags & NDR_BUFFERS) {
}
@@ -53,26 +53,24 @@ enum ndr_err_code ndr_push_frsrpc_CommPktChunkCtr(struct ndr_push *ndr,
} \
} while (0)
-enum ndr_err_code ndr_pull_frsrpc_CommPktChunkCtr(struct ndr_pull *ndr,
- int ndr_flags,
- struct frsrpc_CommPktChunkCtr *r)
+_PUBLIC_ enum ndr_err_code ndr_pull_bkup_NTBackupFile(struct ndr_pull *ndr, int ndr_flags, struct bkup_NTBackupFile *r)
{
- uint32_t cntr_chunks_0;
+ uint32_t cntr_streams_0;
{
uint32_t _flags_save_STRUCT = ndr->flags;
ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN);
if (ndr_flags & NDR_SCALARS) {
uint32_t remaining = ndr->data_size - ndr->offset;
- r->num_chunks = 0;
- r->chunks = NULL;
- for (cntr_chunks_0 = 0; remaining > 0; cntr_chunks_0++) {
- r->num_chunks += 1;
- _TMP_PULL_REALLOC_N(ndr, r->chunks,
- struct frsrpc_CommPktChunk,
- r->num_chunks);
- NDR_CHECK(ndr_pull_frsrpc_CommPktChunk(ndr,
+ r->num_stream = 0;
+ r->streams = NULL;
+ for (cntr_streams_0 = 0; remaining > 0; cntr_streams_0++) {
+ r->num_stream += 1;
+ _TMP_PULL_REALLOC_N(ndr, r->streams,
+ struct bkup_Win32StreamId,
+ r->num_stream);
+ NDR_CHECK(ndr_pull_bkup_Win32StreamId(ndr,
NDR_SCALARS,
- &r->chunks[cntr_chunks_0]));
+ &r->streams[cntr_streams_0]));
remaining = ndr->data_size - ndr->offset;
}
}
@@ -82,11 +80,3 @@ enum ndr_err_code ndr_pull_frsrpc_CommPktChunkCtr(struct ndr_pull *ndr,
}
return NDR_ERR_SUCCESS;
}
-
-size_t ndr_size_frsrpc_CommPktChunkCtr(const struct frsrpc_CommPktChunkCtr *r,
- int flags)
-{
- flags |= LIBNDR_FLAG_NOALIGN;
- return ndr_size_struct(r, flags,
- (ndr_push_flags_fn_t)ndr_push_frsrpc_CommPktChunkCtr);
-}
diff --git a/librpc/ndr/uuid.c b/librpc/ndr/uuid.c
index 5558cb6..654bebd 100644
--- a/librpc/ndr/uuid.c
+++ b/librpc/ndr/uuid.c
@@ -230,15 +230,30 @@ _PUBLIC_ int GUID_compare(const struct GUID *u1, const struct GUID *u2)
*/
_PUBLIC_ char *GUID_string(TALLOC_CTX *mem_ctx, const struct GUID *guid)
{
- return talloc_asprintf(mem_ctx,
- "%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x",
- guid->time_low, guid->time_mid,
- guid->time_hi_and_version,
- guid->clock_seq[0],
- guid->clock_seq[1],
- guid->node[0], guid->node[1],
- guid->node[2], guid->node[3],
- guid->node[4], guid->node[5]);
+ struct GUID_txt_buf buf;
+ return talloc_strdup(mem_ctx, GUID_buf_string(guid, &buf));
+}
--
Samba Shared Repository
More information about the samba-cvs
mailing list