diff options
author | Stefan Metzmacher <metze@samba.org> | 2009-02-24 16:49:26 +0100 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2009-02-24 17:55:41 +0100 |
commit | f6b0a99cefaedfa7642af31f8fcc4457bacb07a3 (patch) | |
tree | fcf642d55c047b01fab265695912c28eb7e8f024 /libcli/ldap/ldap_message.h | |
parent | 7b1c5c94f6a08108d90a73ba78a91df661d68064 (diff) | |
download | samba-f6b0a99cefaedfa7642af31f8fcc4457bacb07a3.tar.gz |
libcli/ldap: move generic ldap control encoding code to ldap_message.c
As they can we static there, we pass the specific handlers as parameter
where we need to support controls.
metze
Diffstat (limited to 'libcli/ldap/ldap_message.h')
-rw-r--r-- | libcli/ldap/ldap_message.h | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/libcli/ldap/ldap_message.h b/libcli/ldap/ldap_message.h index d2ce14445d5..c50018465c8 100644 --- a/libcli/ldap/ldap_message.h +++ b/libcli/ldap/ldap_message.h @@ -207,11 +207,21 @@ struct ldap_message { bool *controls_decoded; }; +struct ldap_control_handler { + const char *oid; + bool (*decode)(void *mem_ctx, DATA_BLOB in, void *_out); + bool (*encode)(void *mem_ctx, void *in, DATA_BLOB *out); +}; + struct asn1_data; struct ldap_message *new_ldap_message(TALLOC_CTX *mem_ctx); -NTSTATUS ldap_decode(struct asn1_data *data, struct ldap_message *msg); -bool ldap_encode(struct ldap_message *msg, DATA_BLOB *result, TALLOC_CTX *mem_ctx); +NTSTATUS ldap_decode(struct asn1_data *data, + const struct ldap_control_handler *control_handlers, + struct ldap_message *msg); +bool ldap_encode(struct ldap_message *msg, + const struct ldap_control_handler *control_handlers, + DATA_BLOB *result, TALLOC_CTX *mem_ctx); NTSTATUS ldap_full_packet(void *private_data, DATA_BLOB blob, size_t *packet_size); bool asn1_read_OctetString_talloc(TALLOC_CTX *mem_ctx, |