diff options
author | Andrew Tridgell <tridge@samba.org> | 2005-04-08 08:57:09 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:11:28 -0500 |
commit | b0ca8ed4559efae38933f49a638e7b51ae8bf0c8 (patch) | |
tree | fa82e983cbc010caf5af97315d7cdb99c482f367 /source4/nbt_server/interfaces.c | |
parent | 866c62f26d110439c8d5cb584f60d24564d6a79c (diff) | |
download | samba-b0ca8ed4559efae38933f49a638e7b51ae8bf0c8.tar.gz samba-b0ca8ed4559efae38933f49a638e7b51ae8bf0c8.tar.xz samba-b0ca8ed4559efae38933f49a638e7b51ae8bf0c8.zip |
r6247: added the server side code for receiving mailslot requests, and
parsing incoming netlogon requests. No replies are sent yet.
(This used to be commit 3b34df6a674cd2aeddc354cdadae3f0e1c000d45)
Diffstat (limited to 'source4/nbt_server/interfaces.c')
-rw-r--r-- | source4/nbt_server/interfaces.c | 44 |
1 files changed, 6 insertions, 38 deletions
diff --git a/source4/nbt_server/interfaces.c b/source4/nbt_server/interfaces.c index dfd4538321..b77e692e10 100644 --- a/source4/nbt_server/interfaces.c +++ b/source4/nbt_server/interfaces.c @@ -64,17 +64,6 @@ static void nbtd_request_handler(struct nbt_name_socket *nbtsock, /* - receive an incoming dgram request -*/ -static void dgram_request_handler(struct nbt_dgram_socket *dgmsock, - struct nbt_dgram_packet *packet, - const char *src_address, int src_port) -{ -} - - - -/* find a registered name on an interface */ struct nbtd_iface_name *nbtd_find_iname(struct nbtd_interface *iface, @@ -123,7 +112,6 @@ static NTSTATUS nbtd_add_socket(struct nbtd_server *nbtsrv, if (strcmp(netmask, "0.0.0.0") != 0) { struct nbt_name_socket *bcast_nbtsock; - struct nbt_dgram_socket *bcast_dgmsock; /* listen for broadcasts on port 137 */ bcast_nbtsock = nbt_name_socket_init(iface, nbtsrv->task->event_ctx); @@ -138,21 +126,6 @@ static NTSTATUS nbtd_add_socket(struct nbtd_server *nbtsrv, } nbt_set_incoming_handler(bcast_nbtsock, nbtd_request_handler, iface); - - - /* listen for broadcasts on port 138 */ - bcast_dgmsock = nbt_dgram_socket_init(iface, nbtsrv->task->event_ctx); - NT_STATUS_HAVE_NO_MEMORY(bcast_dgmsock); - - status = socket_listen(bcast_dgmsock->sock, bcast, lp_dgram_port(), 0, 0); - if (!NT_STATUS_IS_OK(status)) { - DEBUG(0,("Failed to bind to %s:%d - %s\n", - bcast, lp_dgram_port(), nt_errstr(status))); - talloc_free(iface); - return status; - } - - dgram_set_incoming_handler(bcast_dgmsock, dgram_request_handler, iface); } /* listen for unicasts on port 137 */ @@ -162,26 +135,21 @@ static NTSTATUS nbtd_add_socket(struct nbtd_server *nbtsrv, status = socket_listen(iface->nbtsock->sock, bind_address, lp_nbt_port(), 0, 0); if (!NT_STATUS_IS_OK(status)) { DEBUG(0,("Failed to bind to %s:%d - %s\n", - address, lp_nbt_port(), nt_errstr(status))); + bind_address, lp_nbt_port(), nt_errstr(status))); talloc_free(iface); return status; } nbt_set_incoming_handler(iface->nbtsock, nbtd_request_handler, iface); - - /* listen for unicasts on port 138 */ - iface->dgmsock = nbt_dgram_socket_init(iface, nbtsrv->task->event_ctx); - NT_STATUS_HAVE_NO_MEMORY(iface->dgmsock); - - status = socket_listen(iface->dgmsock->sock, bind_address, lp_dgram_port(), 0, 0); + /* also setup the datagram listeners */ + status = nbtd_dgram_setup(iface, bind_address); if (!NT_STATUS_IS_OK(status)) { - DEBUG(0,("Failed to bind to %s:%d - %s\n", - address, lp_dgram_port(), nt_errstr(status))); + DEBUG(0,("Failed to setup dgram listen on %s - %s\n", + bind_address, nt_errstr(status))); talloc_free(iface); return status; } - dgram_set_incoming_handler(iface->dgmsock, dgram_request_handler, iface); - + if (strcmp(netmask, "0.0.0.0") == 0) { DLIST_ADD(nbtsrv->bcast_interface, iface); } else { |