From b2c62d639d7fd565d39a999d500018b290b5279f Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Tue, 4 Jan 2011 17:12:17 +0100 Subject: s3: Basic infrastructure for /tmp/.nmbd/unexpected This provides the framework to replace the unexpected.tdb file. Nmbd will listen on /tmp/.nmbd/unexpected. A client interested in unexpected packets connects there. It sends a nb_packet_query plus a potential mailslot name for dgram packets. It waits for a single ack byte to avoid races. After that has happened, nmbd will pass down all matching packets through that socket. nb_packet_server_create and nb_packet_dispatch are the nmbd routines, nb_packet_reader_send/recv and nb_packet_read_send/recv are the client ones. --- source3/include/proto.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 385a5371be..6f18ee08e6 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -2933,6 +2933,28 @@ void clear_unexpected(time_t t); struct packet_struct *receive_unexpected(enum packet_type packet_type, int id, const char *mailslot_name); +struct nb_packet_server; +struct nb_packet_reader; + +NTSTATUS nb_packet_server_create(TALLOC_CTX *mem_ctx, + struct tevent_context *ev, + int max_clients, + struct nb_packet_server **presult); +void nb_packet_dispatch(struct nb_packet_server *server, + struct packet_struct *p); +struct tevent_req *nb_packet_reader_send(TALLOC_CTX *mem_ctx, + struct tevent_context *ev, + enum packet_type type, + int trn_id, + const char *mailslot_name); +NTSTATUS nb_packet_reader_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx, + struct nb_packet_reader **preader); +struct tevent_req *nb_packet_read_send(TALLOC_CTX *mem_ctx, + struct tevent_context *ev, + struct nb_packet_reader *reader); +NTSTATUS nb_packet_read_recv(struct tevent_req *req, + struct packet_struct **ppacket); + /* The following definitions come from locking/brlock.c */ bool brl_same_context(const struct lock_context *ctx1, -- cgit