summaryrefslogtreecommitdiff
path: root/librpc/ndr
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2016-09-20 00:20:18 +0200
committerAndreas Schneider <asn@cryptomilk.org>2016-11-24 20:24:26 +0100
commite91895f41158a40c09bf145234b0cf45df0ea8c5 (patch)
tree75cec4d8434724efea0ded06014c31649939a0f6 /librpc/ndr
parent983dac44f282cc570fb4a576416bd851c18eddd0 (diff)
downloadsamba-e91895f41158a40c09bf145234b0cf45df0ea8c5.tar.gz
librpc: Add ndr_cab_get_compression() for Cabinet compression evaluation
Guenther Signed-off-by: Guenther Deschner <gd@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
Diffstat (limited to 'librpc/ndr')
-rw-r--r--librpc/ndr/ndr_cab.c9
-rw-r--r--librpc/ndr/ndr_cab.h1
2 files changed, 10 insertions, 0 deletions
diff --git a/librpc/ndr/ndr_cab.c b/librpc/ndr/ndr_cab.c
index 3923aece6d0..0d2b36b3249 100644
--- a/librpc/ndr/ndr_cab.c
+++ b/librpc/ndr/ndr_cab.c
@@ -138,6 +138,15 @@ static uint32_t ndr_size_cab_file(const struct cab_file *r)
return size;
}
+enum cf_compress_type ndr_cab_get_compression(const struct cab_file *r)
+{
+ if (r->cfheader.cFolders == 0) {
+ return CF_COMPRESS_NONE;
+ }
+
+ return r->cffolders[0].typeCompress;
+}
+
_PUBLIC_ enum ndr_err_code ndr_push_cab_file(struct ndr_push *ndr, int ndr_flags, const struct cab_file *r)
{
uint32_t cntr_cffolders_0;
diff --git a/librpc/ndr/ndr_cab.h b/librpc/ndr/ndr_cab.h
index 59dbc991442..79871530eb9 100644
--- a/librpc/ndr/ndr_cab.h
+++ b/librpc/ndr/ndr_cab.h
@@ -21,3 +21,4 @@
uint32_t ndr_count_cfdata(const struct cab_file *r);
uint32_t ndr_cab_generate_checksum(const struct CFDATA *r);
+enum cf_compress_type ndr_cab_get_compression(const struct cab_file *r);