Changeset 740 for vendor/current/librpc/ndr/libndr.h
- Timestamp:
- Nov 14, 2012, 12:59:34 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
vendor/current/librpc/ndr/libndr.h
r587 r740 61 61 uint32_t offset; 62 62 63 struct smb_iconv_convenience *iconv_convenience; 64 63 uint32_t relative_highest_offset; 65 64 uint32_t relative_base_offset; 65 uint32_t relative_rap_convert; 66 66 struct ndr_token_list *relative_base_list; 67 67 … … 93 93 struct ndr_token_list *relative_begin_list; 94 94 struct ndr_token_list *nbt_string_list; 95 struct ndr_token_list *dns_string_list; 95 96 struct ndr_token_list *full_ptr_list; 96 97 97 98 /* this is used to ensure we generate unique reference IDs */ 98 99 uint32_t ptr_count; 99 100 struct smb_iconv_convenience *iconv_convenience;101 100 }; 102 101 … … 106 105 uint32_t depth; 107 106 struct ndr_token_list *switch_list; 108 struct smb_iconv_convenience *iconv_convenience;109 107 void (*print)(struct ndr_print *, const char *, ...) PRINTF_ATTRIBUTE(2,3); 110 108 void *private_data; 109 bool no_newline; 111 110 }; 112 111 … … 192 191 NDR_ERR_TOKEN, 193 192 NDR_ERR_IPV4ADDRESS, 193 NDR_ERR_IPV6ADDRESS, 194 194 NDR_ERR_INVALID_POINTER, 195 195 NDR_ERR_UNREAD_BYTES, … … 329 329 extern const struct ndr_syntax_id ndr_transfer_syntax; 330 330 extern const struct ndr_syntax_id ndr64_transfer_syntax; 331 extern const struct ndr_syntax_id null_ndr_syntax_id; 332 333 struct 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 342 struct ndr_interface_call_pipes { 343 uint32_t num_pipes; 344 const struct ndr_interface_call_pipe *pipes; 345 }; 331 346 332 347 struct ndr_interface_call { … … 336 351 ndr_pull_flags_fn_t ndr_pull; 337 352 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; 339 355 }; 340 356 … … 364 380 NTSTATUS ndr_map_error2ntstatus(enum ndr_err_code ndr_err); 365 381 const char *ndr_map_error2string(enum ndr_err_code ndr_err); 382 #define ndr_errstr ndr_map_error2string 366 383 367 384 /* FIXME: Use represent_as instead */ … … 378 395 void ndr_print_dom_sid0(struct ndr_print *ndr, const char *name, const struct dom_sid *sid); 379 396 size_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);381 397 void ndr_print_GUID(struct ndr_print *ndr, const char *name, const struct GUID *guid); 382 398 bool 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 *);399 enum ndr_err_code ndr_push_struct_blob(DATA_BLOB *blob, TALLOC_CTX *mem_ctx, const void *p, ndr_push_flags_fn_t fn); 400 enum 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); 401 size_t ndr_size_struct(const void *p, int flags, ndr_push_flags_fn_t push); 402 size_t ndr_size_union(const void *p, int flags, uint32_t level, ndr_push_flags_fn_t push); 387 403 uint32_t ndr_push_get_relative_base_offset(struct ndr_push *ndr); 388 404 void ndr_push_restore_relative_base_offset(struct ndr_push *ndr, uint32_t offset); … … 390 406 enum ndr_err_code ndr_push_setup_relative_base_offset2(struct ndr_push *ndr, const void *p); 391 407 enum ndr_err_code ndr_push_relative_ptr1(struct ndr_push *ndr, const void *p); 408 enum ndr_err_code ndr_push_short_relative_ptr1(struct ndr_push *ndr, const void *p); 392 409 enum ndr_err_code ndr_push_relative_ptr2_start(struct ndr_push *ndr, const void *p); 393 410 enum ndr_err_code ndr_push_relative_ptr2_end(struct ndr_push *ndr, const void *p); 411 enum ndr_err_code ndr_push_short_relative_ptr2(struct ndr_push *ndr, const void *p); 394 412 uint32_t ndr_pull_get_relative_base_offset(struct ndr_pull *ndr); 395 413 void ndr_pull_restore_relative_base_offset(struct ndr_pull *ndr, uint32_t offset); … … 398 416 enum ndr_err_code ndr_pull_relative_ptr1(struct ndr_pull *ndr, const void *p, uint32_t rel_offset); 399 417 enum ndr_err_code ndr_pull_relative_ptr2(struct ndr_pull *ndr, const void *p); 418 enum ndr_err_code ndr_pull_relative_ptr_short(struct ndr_pull *ndr, uint16_t *v); 400 419 size_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);420 struct ndr_pull *ndr_pull_init_blob(const DATA_BLOB *blob, TALLOC_CTX *mem_ctx); 402 421 enum 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);422 struct ndr_push *ndr_push_init_ctx(TALLOC_CTX *mem_ctx); 404 423 DATA_BLOB ndr_push_blob(struct ndr_push *ndr); 405 424 enum ndr_err_code ndr_push_expand(struct ndr_push *ndr, uint32_t extra_size); 406 425 void ndr_print_debug_helper(struct ndr_print *ndr, const char *format, ...) PRINTF_ATTRIBUTE(2,3); 426 void ndr_print_printf_helper(struct ndr_print *ndr, const char *format, ...) PRINTF_ATTRIBUTE(2,3); 407 427 void ndr_print_string_helper(struct ndr_print *ndr, const char *format, ...) PRINTF_ATTRIBUTE(2,3); 408 428 void ndr_print_debug(ndr_print_fn_t fn, const char *name, void *ptr); … … 441 461 const void *key, 442 462 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);463 enum 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); 444 464 enum ndr_err_code ndr_token_retrieve(struct ndr_token_list **list, const void *key, uint32_t *v); 445 465 uint32_t ndr_token_peek(struct ndr_token_list **list, const void *key); … … 450 470 uint32_t ndr_get_array_length(struct ndr_pull *ndr, const void *p); 451 471 enum ndr_err_code ndr_check_array_length(struct ndr_pull *ndr, void *p, uint32_t length); 472 enum ndr_err_code ndr_push_pipe_chunk_trailer(struct ndr_push *ndr, int ndr_flags, uint32_t count); 473 enum ndr_err_code ndr_check_pipe_chunk_trailer(struct ndr_pull *ndr, int ndr_flags, uint32_t count); 452 474 enum ndr_err_code ndr_push_set_switch_value(struct ndr_push *ndr, const void *p, uint32_t val); 453 475 enum ndr_err_code ndr_pull_set_switch_value(struct ndr_pull *ndr, const void *p, uint32_t val); … … 456 478 uint32_t ndr_pull_get_switch_value(struct ndr_pull *ndr, const void *p); 457 479 uint32_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);480 enum ndr_err_code ndr_pull_struct_blob(const DATA_BLOB *blob, TALLOC_CTX *mem_ctx, void *p, ndr_pull_flags_fn_t fn); 481 enum ndr_err_code ndr_pull_struct_blob_all(const DATA_BLOB *blob, TALLOC_CTX *mem_ctx, void *p, ndr_pull_flags_fn_t fn); 482 enum 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); 483 enum 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); 462 484 463 485 /* from libndr_basic.h */ … … 487 509 NDR_SCALAR_PROTO(pointer, void *) 488 510 NDR_SCALAR_PROTO(time_t, time_t) 511 NDR_SCALAR_PROTO(uid_t, uid_t) 512 NDR_SCALAR_PROTO(gid_t, gid_t) 489 513 NDR_SCALAR_PROTO(NTSTATUS, NTSTATUS) 490 514 NDR_SCALAR_PROTO(WERROR, WERROR) … … 494 518 NDR_SCALAR_PROTO(DATA_BLOB, DATA_BLOB) 495 519 NDR_SCALAR_PROTO(ipv4address, const char *) 520 NDR_SCALAR_PROTO(ipv6address, const char *) 496 521 NDR_SCALAR_PROTO(string, const char *) 497 522 NDR_SCALAR_PROTO(double, double) … … 500 525 enum ndr_err_code ndr_push_policy_handle(struct ndr_push *ndr, int ndr_flags, const struct policy_handle *r); 501 526 void 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); 527 bool policy_handle_empty(const struct policy_handle *h); 528 bool is_valid_policy_hnd(const struct policy_handle *hnd); 529 bool policy_handle_equal(const struct policy_handle *hnd1, 530 const struct policy_handle *hnd2); 503 531 504 532 void ndr_check_padding(struct ndr_pull *ndr, size_t n); … … 520 548 enum ndr_err_code ndr_push_ref_ptr(struct ndr_push *ndr); 521 549 void ndr_print_struct(struct ndr_print *ndr, const char *name, const char *type); 550 void ndr_print_null(struct ndr_print *ndr); 522 551 void ndr_print_enum(struct ndr_print *ndr, const char *name, const char *type, const char *val, uint32_t value); 523 552 void ndr_print_bitmap_flag(struct ndr_print *ndr, size_t size, const char *flag_name, uint32_t flag, uint32_t value); … … 544 573 /* GUIDs */ 545 574 bool GUID_equal(const struct GUID *u1, const struct GUID *u2); 575 NTSTATUS GUID_to_ndr_blob(const struct GUID *guid, TALLOC_CTX *mem_ctx, DATA_BLOB *b); 546 576 NTSTATUS GUID_from_ndr_blob(const DATA_BLOB *b, struct GUID *guid); 547 577 NTSTATUS GUID_from_data_blob(const DATA_BLOB *s, struct GUID *guid); … … 566 596 _PUBLIC_ enum ndr_err_code ndr_push_enum_uint1632(struct ndr_push *ndr, int ndr_flags, uint16_t v); 567 597 598 _PUBLIC_ void ndr_print_bool(struct ndr_print *ndr, const char *name, const bool b); 599 568 600 #endif /* __LIBNDR_H__ */
Note:
See TracChangeset
for help on using the changeset viewer.