1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-22 13:34:15 +03:00

librpc/ndr: add new ndr_compression_state

Signed-off-by: Aurelien Aptel <aaptel@suse.com>
Reviewed-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
Aurelien Aptel 2017-05-23 11:59:59 +02:00 committed by Jeremy Allison
parent a44bce6dfa
commit aa33aa6e64
2 changed files with 17 additions and 0 deletions

View File

@ -47,6 +47,8 @@ struct ndr_token_list {
uint32_t count;
};
struct ndr_compression_state;
/* this is the base structure passed to routines that
parse MSRPC formatted data
@ -71,6 +73,8 @@ struct ndr_pull {
struct ndr_token_list array_length_list;
struct ndr_token_list switch_list;
struct ndr_compression_state *cstate;
TALLOC_CTX *current_mem_ctx;
/* this is used to ensure we generate unique reference IDs
@ -97,6 +101,8 @@ struct ndr_push {
struct ndr_token_list dns_string_list;
struct ndr_token_list full_ptr_list;
struct ndr_compression_state *cstate;
/* this is used to ensure we generate unique reference IDs */
uint32_t ptr_count;
};

View File

@ -26,6 +26,17 @@
#include "../librpc/ndr/ndr_compression.h"
#include <zlib.h>
struct ndr_compression_state {
enum ndr_compression_alg type;
union {
struct {
struct z_stream_s *z;
uint8_t *dict;
size_t dict_size;
} mszip;
};
};
static voidpf ndr_zlib_alloc(voidpf opaque, uInt items, uInt size)
{
return talloc_zero_size(opaque, items * size);