Ignore:
Timestamp:
Nov 27, 2012, 4:43:17 PM (13 years ago)
Author:
Silvan Scherrer
Message:

Samba Server: updated trunk to 3.6.0

Location:
trunk/server
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/server

  • trunk/server/librpc/ndr/libndr.h

    r590 r745  
    6161        uint32_t offset;
    6262
    63         struct smb_iconv_convenience *iconv_convenience;
    64 
     63        uint32_t relative_highest_offset;
    6564        uint32_t relative_base_offset;
     65        uint32_t relative_rap_convert;
    6666        struct ndr_token_list *relative_base_list;
    6767
     
    9393        struct ndr_token_list *relative_begin_list;
    9494        struct ndr_token_list *nbt_string_list;
     95        struct ndr_token_list *dns_string_list;
    9596        struct ndr_token_list *full_ptr_list;
    9697
    9798        /* this is used to ensure we generate unique reference IDs */
    9899        uint32_t ptr_count;
    99 
    100         struct smb_iconv_convenience *iconv_convenience;
    101100};
    102101
     
    106105        uint32_t depth;
    107106        struct ndr_token_list *switch_list;
    108         struct smb_iconv_convenience *iconv_convenience;
    109107        void (*print)(struct ndr_print *, const char *, ...) PRINTF_ATTRIBUTE(2,3);
    110108        void *private_data;
     109        bool no_newline;
    111110};
    112111
     
    192191        NDR_ERR_TOKEN,
    193192        NDR_ERR_IPV4ADDRESS,
     193        NDR_ERR_IPV6ADDRESS,
    194194        NDR_ERR_INVALID_POINTER,
    195195        NDR_ERR_UNREAD_BYTES,
     
    329329extern const struct ndr_syntax_id ndr_transfer_syntax;
    330330extern const struct ndr_syntax_id ndr64_transfer_syntax;
     331extern const struct ndr_syntax_id null_ndr_syntax_id;
     332
     333struct ndr_interface_call_pipe {
     334        const char *name;
     335        const char *chunk_struct_name;
     336        size_t chunk_struct_size;
     337        ndr_push_flags_fn_t ndr_push;
     338        ndr_pull_flags_fn_t ndr_pull;
     339        ndr_print_fn_t ndr_print;
     340};
     341
     342struct ndr_interface_call_pipes {
     343        uint32_t num_pipes;
     344        const struct ndr_interface_call_pipe *pipes;
     345};
    331346
    332347struct ndr_interface_call {
     
    336351        ndr_pull_flags_fn_t ndr_pull;
    337352        ndr_print_function_t ndr_print;
    338         bool async;
     353        struct ndr_interface_call_pipes in_pipes;
     354        struct ndr_interface_call_pipes out_pipes;
    339355};
    340356
     
    364380NTSTATUS ndr_map_error2ntstatus(enum ndr_err_code ndr_err);
    365381const char *ndr_map_error2string(enum ndr_err_code ndr_err);
     382#define ndr_errstr ndr_map_error2string
    366383
    367384/* FIXME: Use represent_as instead */
     
    378395void ndr_print_dom_sid0(struct ndr_print *ndr, const char *name, const struct dom_sid *sid);
    379396size_t ndr_size_dom_sid0(const struct dom_sid *sid, int flags);
    380 void ndr_print_ipv4_addr(struct ndr_print *ndr, const char *name, const struct in_addr *_ip);
    381397void ndr_print_GUID(struct ndr_print *ndr, const char *name, const struct GUID *guid);
    382398bool ndr_syntax_id_equal(const struct ndr_syntax_id *i1, const struct ndr_syntax_id *i2);
    383 enum ndr_err_code ndr_push_struct_blob(DATA_BLOB *blob, TALLOC_CTX *mem_ctx, struct smb_iconv_convenience *iconv_convenience, const void *p, ndr_push_flags_fn_t fn);
    384 enum ndr_err_code ndr_push_union_blob(DATA_BLOB *blob, TALLOC_CTX *mem_ctx, struct smb_iconv_convenience *iconv_convenience, void *p, uint32_t level, ndr_push_flags_fn_t fn);
    385 size_t ndr_size_struct(const void *p, int flags, ndr_push_flags_fn_t push, struct smb_iconv_convenience *);
    386 size_t ndr_size_union(const void *p, int flags, uint32_t level, ndr_push_flags_fn_t push, struct smb_iconv_convenience *);
     399enum ndr_err_code ndr_push_struct_blob(DATA_BLOB *blob, TALLOC_CTX *mem_ctx, const void *p, ndr_push_flags_fn_t fn);
     400enum ndr_err_code ndr_push_union_blob(DATA_BLOB *blob, TALLOC_CTX *mem_ctx, void *p, uint32_t level, ndr_push_flags_fn_t fn);
     401size_t ndr_size_struct(const void *p, int flags, ndr_push_flags_fn_t push);
     402size_t ndr_size_union(const void *p, int flags, uint32_t level, ndr_push_flags_fn_t push);
    387403uint32_t ndr_push_get_relative_base_offset(struct ndr_push *ndr);
    388404void ndr_push_restore_relative_base_offset(struct ndr_push *ndr, uint32_t offset);
     
    390406enum ndr_err_code ndr_push_setup_relative_base_offset2(struct ndr_push *ndr, const void *p);
    391407enum ndr_err_code ndr_push_relative_ptr1(struct ndr_push *ndr, const void *p);
     408enum ndr_err_code ndr_push_short_relative_ptr1(struct ndr_push *ndr, const void *p);
    392409enum ndr_err_code ndr_push_relative_ptr2_start(struct ndr_push *ndr, const void *p);
    393410enum ndr_err_code ndr_push_relative_ptr2_end(struct ndr_push *ndr, const void *p);
     411enum ndr_err_code ndr_push_short_relative_ptr2(struct ndr_push *ndr, const void *p);
    394412uint32_t ndr_pull_get_relative_base_offset(struct ndr_pull *ndr);
    395413void ndr_pull_restore_relative_base_offset(struct ndr_pull *ndr, uint32_t offset);
     
    398416enum ndr_err_code ndr_pull_relative_ptr1(struct ndr_pull *ndr, const void *p, uint32_t rel_offset);
    399417enum ndr_err_code ndr_pull_relative_ptr2(struct ndr_pull *ndr, const void *p);
     418enum ndr_err_code ndr_pull_relative_ptr_short(struct ndr_pull *ndr, uint16_t *v);
    400419size_t ndr_align_size(uint32_t offset, size_t n);
    401 struct ndr_pull *ndr_pull_init_blob(const DATA_BLOB *blob, TALLOC_CTX *mem_ctx, struct smb_iconv_convenience *iconv_convenience);
     420struct ndr_pull *ndr_pull_init_blob(const DATA_BLOB *blob, TALLOC_CTX *mem_ctx);
    402421enum ndr_err_code ndr_pull_advance(struct ndr_pull *ndr, uint32_t size);
    403 struct ndr_push *ndr_push_init_ctx(TALLOC_CTX *mem_ctx, struct smb_iconv_convenience *iconv_convenience);
     422struct ndr_push *ndr_push_init_ctx(TALLOC_CTX *mem_ctx);
    404423DATA_BLOB ndr_push_blob(struct ndr_push *ndr);
    405424enum ndr_err_code ndr_push_expand(struct ndr_push *ndr, uint32_t extra_size);
    406425void ndr_print_debug_helper(struct ndr_print *ndr, const char *format, ...) PRINTF_ATTRIBUTE(2,3);
     426void ndr_print_printf_helper(struct ndr_print *ndr, const char *format, ...) PRINTF_ATTRIBUTE(2,3);
    407427void ndr_print_string_helper(struct ndr_print *ndr, const char *format, ...) PRINTF_ATTRIBUTE(2,3);
    408428void ndr_print_debug(ndr_print_fn_t fn, const char *name, void *ptr);
     
    441461                         const void *key,
    442462                         uint32_t value);
    443 enum ndr_err_code ndr_token_retrieve_cmp_fn(struct ndr_token_list **list, const void *key, uint32_t *v, comparison_fn_t _cmp_fn, bool _remove_tok);
     463enum ndr_err_code ndr_token_retrieve_cmp_fn(struct ndr_token_list **list, const void *key, uint32_t *v, int(*_cmp_fn)(const void*,const void*), bool _remove_tok);
    444464enum ndr_err_code ndr_token_retrieve(struct ndr_token_list **list, const void *key, uint32_t *v);
    445465uint32_t ndr_token_peek(struct ndr_token_list **list, const void *key);
     
    450470uint32_t ndr_get_array_length(struct ndr_pull *ndr, const void *p);
    451471enum ndr_err_code ndr_check_array_length(struct ndr_pull *ndr, void *p, uint32_t length);
     472enum ndr_err_code ndr_push_pipe_chunk_trailer(struct ndr_push *ndr, int ndr_flags, uint32_t count);
     473enum ndr_err_code ndr_check_pipe_chunk_trailer(struct ndr_pull *ndr, int ndr_flags, uint32_t count);
    452474enum ndr_err_code ndr_push_set_switch_value(struct ndr_push *ndr, const void *p, uint32_t val);
    453475enum ndr_err_code ndr_pull_set_switch_value(struct ndr_pull *ndr, const void *p, uint32_t val);
     
    456478uint32_t ndr_pull_get_switch_value(struct ndr_pull *ndr, const void *p);
    457479uint32_t ndr_print_get_switch_value(struct ndr_print *ndr, const void *p);
    458 enum ndr_err_code ndr_pull_struct_blob(const DATA_BLOB *blob, TALLOC_CTX *mem_ctx, struct smb_iconv_convenience *iconv_convenience, void *p, ndr_pull_flags_fn_t fn);
    459 enum ndr_err_code ndr_pull_struct_blob_all(const DATA_BLOB *blob, TALLOC_CTX *mem_ctx, struct smb_iconv_convenience *iconv_convenience, void *p, ndr_pull_flags_fn_t fn);
    460 enum ndr_err_code ndr_pull_union_blob(const DATA_BLOB *blob, TALLOC_CTX *mem_ctx, struct smb_iconv_convenience *iconv_convenience, void *p, uint32_t level, ndr_pull_flags_fn_t fn);
    461 enum ndr_err_code ndr_pull_union_blob_all(const DATA_BLOB *blob, TALLOC_CTX *mem_ctx, struct smb_iconv_convenience *iconv_convenience, void *p, uint32_t level, ndr_pull_flags_fn_t fn);
     480enum ndr_err_code ndr_pull_struct_blob(const DATA_BLOB *blob, TALLOC_CTX *mem_ctx, void *p, ndr_pull_flags_fn_t fn);
     481enum ndr_err_code ndr_pull_struct_blob_all(const DATA_BLOB *blob, TALLOC_CTX *mem_ctx, void *p, ndr_pull_flags_fn_t fn);
     482enum ndr_err_code ndr_pull_union_blob(const DATA_BLOB *blob, TALLOC_CTX *mem_ctx, void *p, uint32_t level, ndr_pull_flags_fn_t fn);
     483enum ndr_err_code ndr_pull_union_blob_all(const DATA_BLOB *blob, TALLOC_CTX *mem_ctx, void *p, uint32_t level, ndr_pull_flags_fn_t fn);
    462484
    463485/* from libndr_basic.h */
     
    487509NDR_SCALAR_PROTO(pointer, void *)
    488510NDR_SCALAR_PROTO(time_t, time_t)
     511NDR_SCALAR_PROTO(uid_t, uid_t)
     512NDR_SCALAR_PROTO(gid_t, gid_t)
    489513NDR_SCALAR_PROTO(NTSTATUS, NTSTATUS)
    490514NDR_SCALAR_PROTO(WERROR, WERROR)
     
    494518NDR_SCALAR_PROTO(DATA_BLOB, DATA_BLOB)
    495519NDR_SCALAR_PROTO(ipv4address, const char *)
     520NDR_SCALAR_PROTO(ipv6address, const char *)
    496521NDR_SCALAR_PROTO(string, const char *)
    497522NDR_SCALAR_PROTO(double, double)
     
    500525enum ndr_err_code ndr_push_policy_handle(struct ndr_push *ndr, int ndr_flags, const struct policy_handle *r);
    501526void ndr_print_policy_handle(struct ndr_print *ndr, const char *name, const struct policy_handle *r);
    502 bool policy_handle_empty(struct policy_handle *h);
     527bool policy_handle_empty(const struct policy_handle *h);
     528bool is_valid_policy_hnd(const struct policy_handle *hnd);
     529bool policy_handle_equal(const struct policy_handle *hnd1,
     530                         const struct policy_handle *hnd2);
    503531
    504532void ndr_check_padding(struct ndr_pull *ndr, size_t n);
     
    520548enum ndr_err_code ndr_push_ref_ptr(struct ndr_push *ndr);
    521549void ndr_print_struct(struct ndr_print *ndr, const char *name, const char *type);
     550void ndr_print_null(struct ndr_print *ndr);
    522551void ndr_print_enum(struct ndr_print *ndr, const char *name, const char *type, const char *val, uint32_t value);
    523552void ndr_print_bitmap_flag(struct ndr_print *ndr, size_t size, const char *flag_name, uint32_t flag, uint32_t value);
     
    544573/* GUIDs */
    545574bool GUID_equal(const struct GUID *u1, const struct GUID *u2);
     575NTSTATUS GUID_to_ndr_blob(const struct GUID *guid, TALLOC_CTX *mem_ctx, DATA_BLOB *b);
    546576NTSTATUS GUID_from_ndr_blob(const DATA_BLOB *b, struct GUID *guid);
    547577NTSTATUS GUID_from_data_blob(const DATA_BLOB *s, struct GUID *guid);
     
    566596_PUBLIC_ enum ndr_err_code ndr_push_enum_uint1632(struct ndr_push *ndr, int ndr_flags, uint16_t v);
    567597
     598_PUBLIC_ void ndr_print_bool(struct ndr_print *ndr, const char *name, const bool b);
     599
    568600#endif /* __LIBNDR_H__ */
Note: See TracChangeset for help on using the changeset viewer.