return NT_STATUS_OK if a blob has enough bytes in it to be a full
ldap packet. Set packet_size if true.
*/
-NTSTATUS ldap_full_packet(void *private_data, DATA_BLOB blob, size_t *packet_size)
+NTSTATUS ldap_full_packet(struct tstream_context *stream,
+ void *private_data,
+ DATA_BLOB blob,
+ size_t *packet_size)
{
int ret;
};
struct asn1_data;
+struct tstream_context;
struct ldap_message *new_ldap_message(TALLOC_CTX *mem_ctx);
NTSTATUS ldap_decode(struct asn1_data *data,
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);
+NTSTATUS ldap_full_packet(struct tstream_context *stream,
+ void *private_data,
+ DATA_BLOB blob,
+ size_t *packet_size);
bool asn1_read_OctetString_talloc(TALLOC_CTX *mem_ctx,
struct asn1_data *data,
return;
}
- status = state->caller.full_fn(state->caller.full_private,
+ status = state->caller.full_fn(state->caller.stream,
+ state->caller.full_private,
state->pdu_blob, &pdu_size);
if (NT_STATUS_IS_OK(status)) {
tevent_req_done(req);
/**
* @brief The function which will report the size of the full pdu.
*
+ * @param[in] stream The tstream_context to operate on
+ *
* @param[in] private_data Some private data which could be used.
*
* @param[in] blob The received blob to get the size from.
* @return NT_STATUS_OK on success, STATUS_MORE_ENTRIES if there
* are more entries.
*/
-typedef NTSTATUS tstream_read_pdu_blob_full_fn_t(void *private_data,
+typedef NTSTATUS tstream_read_pdu_blob_full_fn_t(struct tstream_context *stream,
+ void *private_data,
DATA_BLOB blob,
size_t *packet_size);
/*
* The dns tcp pdu's has the length as 2 byte (initial_read_size),
- * packet_full_request_u16 provides the pdu length then.
+ * tstream_full_request_u16 provides the pdu length then.
*/
subreq = tstream_read_pdu_blob_send(dns_conn,
dns_conn->conn->event.ctx,
dns_conn->tstream,
2, /* initial_read_size */
- packet_full_request_u16,
+ tstream_full_request_u16,
dns_conn);
if (subreq == NULL) {
dns_tcp_terminate_connection(dns_conn, "dns_tcp_call_loop: "
/*
* The dns tcp pdu's has the length as 2 byte (initial_read_size),
- * packet_full_request_u16 provides the pdu length then.
+ * tstream_full_request_u16 provides the pdu length then.
*/
subreq = tstream_read_pdu_blob_send(dns_conn,
dns_conn->conn->event.ctx,
dns_conn->tstream,
2, /* initial_read_size */
- packet_full_request_u16,
+ tstream_full_request_u16,
dns_conn);
if (subreq == NULL) {
dns_tcp_terminate_connection(dns_conn, "dns_tcp_accept: "
state->ev,
state->proxy.stream,
4, /* initial_read_size */
- packet_full_request_u32,
+ tstream_full_request_u32,
req);
if (tevent_req_nomem(subreq, req)) {
return;
/*
* The krb5 tcp pdu's has the length as 4 byte (initial_read_size),
- * packet_full_request_u32 provides the pdu length then.
+ * tstream_full_request_u32 provides the pdu length then.
*/
subreq = tstream_read_pdu_blob_send(kdc_conn,
kdc_conn->conn->event.ctx,
kdc_conn->tstream,
4, /* initial_read_size */
- packet_full_request_u32,
+ tstream_full_request_u32,
kdc_conn);
if (subreq == NULL) {
kdc_tcp_terminate_connection(kdc_conn, "kdc_tcp_call_loop: "
/*
* The krb5 tcp pdu's has the length as 4 byte (initial_read_size),
- * packet_full_request_u32 provides the pdu length then.
+ * tstream_full_request_u32 provides the pdu length then.
*/
subreq = tstream_read_pdu_blob_send(kdc_conn,
kdc_conn->conn->event.ctx,
kdc_conn->tstream,
4, /* initial_read_size */
- packet_full_request_u32,
+ tstream_full_request_u32,
kdc_conn);
if (subreq == NULL) {
kdc_tcp_terminate_connection(kdc_conn, "kdc_tcp_call_proxy_done: "
/*
* The krb5 tcp pdu's has the length as 4 byte (initial_read_size),
- * packet_full_request_u32 provides the pdu length then.
+ * tstream_full_request_u32 provides the pdu length then.
*/
subreq = tstream_read_pdu_blob_send(kdc_conn,
kdc_conn->conn->event.ctx,
kdc_conn->tstream,
4, /* initial_read_size */
- packet_full_request_u32,
+ tstream_full_request_u32,
kdc_conn);
if (subreq == NULL) {
kdc_tcp_terminate_connection(kdc_conn, "kdc_tcp_accept: "
static void ldapsrv_call_read_done(struct tevent_req *subreq);
static NTSTATUS ldapsrv_packet_check(
+ struct tstream_context *stream,
void *private_data,
DATA_BLOB blob,
size_t *packet_size);
*
*/
static NTSTATUS ldapsrv_packet_check(
+ struct tstream_context *stream,
void *private_data,
DATA_BLOB blob,
size_t *packet_size)
struct ldapsrv_connection *conn = private_data;
int result = LDB_SUCCESS;
- ret = ldap_full_packet(private_data, blob, packet_size);
+ ret = ldap_full_packet(stream, private_data, blob, packet_size);
if (!NT_STATUS_IS_OK(ret)) {
return ret;
}
state->caller.ev,
state->caller.wrepl_socket->stream,
4, /* initial_read_size */
- packet_full_request_u32,
+ tstream_full_request_u32,
NULL);
if (tevent_req_nomem(subreq, req)) {
return;
/*
* The NTP tcp pdu's has the length as 4 byte (initial_read_size),
- * packet_full_request_u32 provides the pdu length then.
+ * tstream_full_request_u32 provides the pdu length then.
*/
subreq = tstream_read_pdu_blob_send(ntp_signd_conn,
ntp_signd_conn->conn->event.ctx,
ntp_signd_conn->tstream,
4, /* initial_read_size */
- packet_full_request_u32,
+ tstream_full_request_u32,
ntp_signd_conn);
if (subreq == NULL) {
ntp_signd_terminate_connection(ntp_signd_conn, "ntp_signd_call_loop: "
/*
* The NTP tcp pdu's has the length as 4 byte (initial_read_size),
- * packet_full_request_u32 provides the pdu length then.
+ * tstream_full_request_u32 provides the pdu length then.
*/
subreq = tstream_read_pdu_blob_send(ntp_signd_conn,
ntp_signd_conn->conn->event.ctx,
ntp_signd_conn->tstream,
4, /* initial_read_size */
- packet_full_request_u32,
+ tstream_full_request_u32,
ntp_signd_conn);
if (subreq == NULL) {
ntp_signd_terminate_connection(ntp_signd_conn,
tctx->ev,
signd_client->tstream,
4, /*initial_read_size */
- packet_full_request_u32,
+ tstream_full_request_u32,
NULL);
torture_assert(tctx, req != NULL,
"Failed to setup a read for pdu_blob.");
/*
* The wrepl pdu's has the length as 4 byte (initial_read_size),
- * packet_full_request_u32 provides the pdu length then.
+ * tstream_full_request_u32 provides the pdu length then.
*/
subreq = tstream_read_pdu_blob_send(wrepl_conn,
wrepl_conn->conn->event.ctx,
wrepl_conn->tstream,
4, /* initial_read_size */
- packet_full_request_u32,
+ tstream_full_request_u32,
wrepl_conn);
if (subreq == NULL) {
wreplsrv_terminate_in_connection(wrepl_conn, "wrepl_accept: "
wrepl_conn->conn->event.ctx,
wrepl_conn->tstream,
4, /* initial_read_size */
- packet_full_request_u32,
+ tstream_full_request_u32,
wrepl_conn);
if (subreq == NULL) {
wreplsrv_terminate_in_connection(wrepl_conn, "wreplsrv_call_loop: "
/*
* The wrepl pdu's has the length as 4 byte (initial_read_size),
- * packet_full_request_u32 provides the pdu length then.
+ * tstream_full_request_u32 provides the pdu length then.
*/
subreq = tstream_read_pdu_blob_send(wrepl_in,
wrepl_in->conn->event.ctx,
wrepl_in->tstream,
4, /* initial_read_size */
- packet_full_request_u32,
+ tstream_full_request_u32,
wrepl_in);
if (subreq == NULL) {
wreplsrv_terminate_in_connection(wrepl_in, "wreplsrv_in_connection_merge: "