r6129: - add our own MSZIP decompression implementation
[bbaumbach/samba-autobuild/.git] / source4 / librpc / ndr / libndr.h
index 4880df43bdfc9a94b944f03e28474b35e5ac70b2..15ac1b2d4c5ba4ac30b9df8391837ca443e0bf33 100644 (file)
@@ -49,6 +49,7 @@ struct ndr_pull {
        struct ndr_token_list *relative_list;
        struct ndr_token_list *array_size_list;
        struct ndr_token_list *array_length_list;
+       struct ndr_token_list *switch_list;
 
        /* this is used to ensure we generate unique reference IDs
           between request and reply */
@@ -68,6 +69,7 @@ struct ndr_push {
        uint32_t alloc_size;
        uint32_t offset;
 
+       struct ndr_token_list *switch_list;
        struct ndr_token_list *relative_list;
 
        /* this is used to ensure we generate unique reference IDs */
@@ -130,9 +132,11 @@ struct ndr_print {
 /* set if an object uuid will be present */
 #define LIBNDR_FLAG_OBJECT_PRESENT    (1<<30)
 
+/* set to avoid recursion in ndr_size_*() calculation */
+#define LIBNDR_FLAG_NO_NDR_SIZE                (1<<31)
+
 /* useful macro for debugging */
 #define NDR_PRINT_DEBUG(type, p) ndr_print_debug((ndr_print_fn_t)ndr_print_ ##type, #p, p)
-#define NDR_PRINT_UNION_DEBUG(type, level, p) ndr_print_union_debug((ndr_print_union_fn_t)ndr_print_ ##type, #p, level, p)
 #define NDR_PRINT_FUNCTION_DEBUG(type, flags, p) ndr_print_function_debug((ndr_print_function_t)ndr_print_ ##type, #type, flags, p)
 #define NDR_PRINT_BOTH_DEBUG(type, p) NDR_PRINT_FUNCTION_DEBUG(type, NDR_BOTH, p)
 #define NDR_PRINT_OUT_DEBUG(type, p) NDR_PRINT_FUNCTION_DEBUG(type, NDR_OUT, p)
@@ -148,6 +152,7 @@ enum ndr_err_code {
        NDR_ERR_CHARCNV,
        NDR_ERR_LENGTH,
        NDR_ERR_SUBCONTEXT,
+       NDR_ERR_COMPRESSION,
        NDR_ERR_STRING,
        NDR_ERR_VALIDATE,
        NDR_ERR_BUFSIZE,
@@ -156,6 +161,10 @@ enum ndr_err_code {
        NDR_ERR_TOKEN
 };
 
+enum ndr_compression_alg {
+       NDR_COMPRESSION_MSZIP
+};
+
 /*
   flags passed to control parse flow
 */
@@ -237,8 +246,6 @@ enum ndr_err_code {
 typedef NTSTATUS (*ndr_push_flags_fn_t)(struct ndr_push *, int ndr_flags, void *);
 typedef NTSTATUS (*ndr_push_const_fn_t)(struct ndr_push *, int ndr_flags, const void *);
 typedef NTSTATUS (*ndr_pull_flags_fn_t)(struct ndr_pull *, int ndr_flags, void *);
-typedef NTSTATUS (*ndr_push_union_fn_t)(struct ndr_push *, int ndr_flags, uint32_t, void *);
-typedef NTSTATUS (*ndr_pull_union_fn_t)(struct ndr_pull *, int ndr_flags, uint32_t, void *);
 typedef void (*ndr_print_fn_t)(struct ndr_print *, const char *, void *);
 typedef void (*ndr_print_function_t)(struct ndr_print *, const char *, int, void *);
 typedef void (*ndr_print_union_fn_t)(struct ndr_print *, const char *, uint32_t, void *);