source: vendor/3.6.0/source4/lib/stream/packet.h

Last change on this file was 740, checked in by Silvan Scherrer, 13 years ago

Samba Server: update vendor to 3.6.0

File size: 2.8 KB
Line 
1/*
2 Unix SMB/CIFS mplementation.
3
4 helper layer for breaking up streams into discrete requests
5
6 Copyright (C) Andrew Tridgell 2005
7
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 3 of the License, or
11 (at your option) any later version.
12
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
17
18 You should have received a copy of the GNU General Public License
19 along with this program. If not, see <http://www.gnu.org/licenses/>.
20
21*/
22
23struct packet_context;
24struct tevent_context;
25struct tevent_fd;
26struct socket_context;
27
28typedef NTSTATUS (*packet_full_request_fn_t)(void *private_data,
29 DATA_BLOB blob, size_t *packet_size);
30typedef NTSTATUS (*packet_callback_fn_t)(void *private_data, DATA_BLOB blob);
31
32/* Used to notify that a packet has been sent, and is on the wire */
33typedef void (*packet_send_callback_fn_t)(void *private_data);
34typedef void (*packet_error_handler_fn_t)(void *private_data, NTSTATUS status);
35
36
37
38struct packet_context *packet_init(TALLOC_CTX *mem_ctx);
39void packet_set_callback(struct packet_context *pc, packet_callback_fn_t callback);
40void packet_set_error_handler(struct packet_context *pc, packet_error_handler_fn_t handler);
41void packet_set_private(struct packet_context *pc, void *private_data);
42void packet_set_full_request(struct packet_context *pc, packet_full_request_fn_t callback);
43void packet_set_socket(struct packet_context *pc, struct socket_context *sock);
44void packet_set_event_context(struct packet_context *pc, struct tevent_context *ev);
45void packet_set_fde(struct packet_context *pc, struct tevent_fd *fde);
46void packet_set_serialise(struct packet_context *pc);
47void packet_set_initial_read(struct packet_context *pc, uint32_t initial_read);
48void packet_set_nofree(struct packet_context *pc);
49void packet_recv(struct packet_context *pc);
50void packet_recv_disable(struct packet_context *pc);
51void packet_recv_enable(struct packet_context *pc);
52void packet_set_unreliable_select(struct packet_context *pc);
53NTSTATUS packet_send(struct packet_context *pc, DATA_BLOB blob);
54NTSTATUS packet_send_callback(struct packet_context *pc, DATA_BLOB blob,
55 packet_send_callback_fn_t send_callback,
56 void *private_data);
57void packet_queue_run(struct packet_context *pc);
58
59/*
60 pre-canned handlers
61*/
62NTSTATUS packet_full_request_nbt(void *private_data, DATA_BLOB blob, size_t *size);
63NTSTATUS packet_full_request_u32(void *private_data, DATA_BLOB blob, size_t *size);
64
65
Note: See TracBrowser for help on using the repository browser.