Fix bug #8373 - Can't join XP Pro workstations to 3.6.1 DC.
[ddiss/samba.git] / librpc / ndr / libndr.h
index 67b537291185bd61d4c84c7ea562edc6f29c6258..1e40779c4b7e66c5dc963232f7f89be2de17de7f 100644 (file)
@@ -136,7 +136,13 @@ struct ndr_print {
 #define LIBNDR_FLAG_ALIGN4       (1<<23)
 #define LIBNDR_FLAG_ALIGN8       (1<<24)
 
-#define LIBNDR_ALIGN_FLAGS (LIBNDR_FLAG_ALIGN2|LIBNDR_FLAG_ALIGN4|LIBNDR_FLAG_ALIGN8)
+#define LIBNDR_ALIGN_FLAGS ( 0        | \
+               LIBNDR_FLAG_NOALIGN   | \
+               LIBNDR_FLAG_REMAINING | \
+               LIBNDR_FLAG_ALIGN2    | \
+               LIBNDR_FLAG_ALIGN4    | \
+               LIBNDR_FLAG_ALIGN8    | \
+               0)
 
 #define LIBNDR_PRINT_ARRAY_HEX   (1<<25)
 #define LIBNDR_PRINT_SET_VALUES  (1<<26)
@@ -330,12 +336,28 @@ extern const struct ndr_syntax_id ndr_transfer_syntax;
 extern const struct ndr_syntax_id ndr64_transfer_syntax;
 extern const struct ndr_syntax_id null_ndr_syntax_id;
 
+struct ndr_interface_call_pipe {
+       const char *name;
+       const char *chunk_struct_name;
+       size_t chunk_struct_size;
+       ndr_push_flags_fn_t ndr_push;
+       ndr_pull_flags_fn_t ndr_pull;
+       ndr_print_fn_t ndr_print;
+};
+
+struct ndr_interface_call_pipes {
+       uint32_t num_pipes;
+       const struct ndr_interface_call_pipe *pipes;
+};
+
 struct ndr_interface_call {
        const char *name;
        size_t struct_size;
        ndr_push_flags_fn_t ndr_push;
        ndr_pull_flags_fn_t ndr_pull;
        ndr_print_function_t ndr_print;
+       struct ndr_interface_call_pipes in_pipes;
+       struct ndr_interface_call_pipes out_pipes;
 };
 
 struct ndr_interface_string_array {
@@ -378,7 +400,6 @@ enum ndr_err_code ndr_push_dom_sid0(struct ndr_push *ndr, int ndr_flags, const s
 enum ndr_err_code ndr_pull_dom_sid0(struct ndr_pull *ndr, int ndr_flags, struct dom_sid *sid);
 void ndr_print_dom_sid0(struct ndr_print *ndr, const char *name, const struct dom_sid *sid);
 size_t ndr_size_dom_sid0(const struct dom_sid *sid, int flags);
-void ndr_print_ipv4_addr(struct ndr_print *ndr, const char *name, const struct in_addr *_ip);
 void ndr_print_GUID(struct ndr_print *ndr, const char *name, const struct GUID *guid);
 bool ndr_syntax_id_equal(const struct ndr_syntax_id *i1, const struct ndr_syntax_id *i2); 
 enum ndr_err_code ndr_push_struct_blob(DATA_BLOB *blob, TALLOC_CTX *mem_ctx, const void *p, ndr_push_flags_fn_t fn);
@@ -454,6 +475,8 @@ enum ndr_err_code ndr_check_array_size(struct ndr_pull *ndr, void *p, uint32_t s
 enum ndr_err_code ndr_pull_array_length(struct ndr_pull *ndr, const void *p);
 uint32_t ndr_get_array_length(struct ndr_pull *ndr, const void *p);
 enum ndr_err_code ndr_check_array_length(struct ndr_pull *ndr, void *p, uint32_t length);
+enum ndr_err_code ndr_push_pipe_chunk_trailer(struct ndr_push *ndr, int ndr_flags, uint32_t count);
+enum ndr_err_code ndr_check_pipe_chunk_trailer(struct ndr_pull *ndr, int ndr_flags, uint32_t count);
 enum ndr_err_code ndr_push_set_switch_value(struct ndr_push *ndr, const void *p, uint32_t val);
 enum ndr_err_code ndr_pull_set_switch_value(struct ndr_pull *ndr, const void *p, uint32_t val);
 enum ndr_err_code ndr_print_set_switch_value(struct ndr_print *ndr, const void *p, uint32_t val);
@@ -491,6 +514,8 @@ NDR_SCALAR_PROTO(dlong, int64_t)
 NDR_SCALAR_PROTO(hyper, uint64_t)
 NDR_SCALAR_PROTO(pointer, void *)
 NDR_SCALAR_PROTO(time_t, time_t)
+NDR_SCALAR_PROTO(uid_t, uid_t)
+NDR_SCALAR_PROTO(gid_t, gid_t)
 NDR_SCALAR_PROTO(NTSTATUS, NTSTATUS)
 NDR_SCALAR_PROTO(WERROR, WERROR)
 NDR_SCALAR_PROTO(NTTIME, NTTIME)
@@ -549,6 +574,7 @@ size_t ndr_size_string_array(const char **a, uint32_t count, int flags);
 uint32_t ndr_string_length(const void *_var, uint32_t element_size);
 enum ndr_err_code ndr_check_string_terminator(struct ndr_pull *ndr, uint32_t count, uint32_t element_size);
 enum ndr_err_code ndr_pull_charset(struct ndr_pull *ndr, int ndr_flags, const char **var, uint32_t length, uint8_t byte_mul, charset_t chset);
+enum ndr_err_code ndr_pull_charset_to_null(struct ndr_pull *ndr, int ndr_flags, const char **var, uint32_t length, uint8_t byte_mul, charset_t chset);
 enum ndr_err_code ndr_push_charset(struct ndr_push *ndr, int ndr_flags, const char *var, uint32_t length, uint8_t byte_mul, charset_t chset);
 
 /* GUIDs */