1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-26 21:57:41 +03:00

libcli/nbt: add nbt_set_unexpected_handler()

metze
(from samba4wins tree 74232901d1e7ea9ebcb3bd8d584dda36fac37223)
This commit is contained in:
Stefan Metzmacher 2009-01-17 18:15:24 +01:00
parent c97df0d892
commit 26c48098e6
2 changed files with 17 additions and 0 deletions

View File

@ -324,6 +324,10 @@ NTSTATUS nbt_set_incoming_handler(struct nbt_name_socket *nbtsock,
void (*handler)(struct nbt_name_socket *, struct nbt_name_packet *,
struct socket_address *),
void *private_data);
NTSTATUS nbt_set_unexpected_handler(struct nbt_name_socket *nbtsock,
void (*handler)(struct nbt_name_socket *, struct nbt_name_packet *,
struct socket_address *),
void *private);
NTSTATUS nbt_name_reply_send(struct nbt_name_socket *nbtsock,
struct socket_address *dest,
struct nbt_name_packet *request);

View File

@ -509,6 +509,19 @@ _PUBLIC_ NTSTATUS nbt_set_incoming_handler(struct nbt_name_socket *nbtsock,
return NT_STATUS_OK;
}
/*
setup a handler for unexpected requests
*/
NTSTATUS nbt_set_unexpected_handler(struct nbt_name_socket *nbtsock,
void (*handler)(struct nbt_name_socket *, struct nbt_name_packet *,
struct socket_address *),
void *private)
{
nbtsock->unexpected.handler = handler;
nbtsock->unexpected.private_data = private;
EVENT_FD_READABLE(nbtsock->fde);
return NT_STATUS_OK;
}
/*
turn a NBT rcode into a NTSTATUS