From c7ded5ab0accc54a28df4d43cb923e6c808ff347 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 30 Jan 2005 10:24:36 +0000 Subject: r5108: the beginnings of a nbtd server for Samba4. Currently just displays the packets it receives, but it at least shows how the server structure will work. To implement it I extended the libcli/nbt/ library to allow for an incoming packet handler to be registered. That allows the nbt client library to be used for low level processing of the nbtd server packets. Other changes: - made the socket library always set SO_REUSEADDR when binding to an interface, to ensure that restarts of a server don't have to wait for a couple of minutes. - made the nbt port configurable. Defaults to 137, but other ports will be useful for testing. (This used to be commit 2fedca6adfd4df9e85cc86896dfa79630777a917) --- source4/libcli/nbt/namequery.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source4/libcli/nbt/namequery.c') diff --git a/source4/libcli/nbt/namequery.c b/source4/libcli/nbt/namequery.c index 05d5e55491..6f549e6241 100644 --- a/source4/libcli/nbt/namequery.c +++ b/source4/libcli/nbt/namequery.c @@ -52,7 +52,7 @@ struct nbt_name_request *nbt_name_query_send(struct nbt_name_socket *nbtsock, packet->questions[0].question_type = NBT_QTYPE_NETBIOS; packet->questions[0].question_class = NBT_QCLASS_IP; - req = nbt_name_request_send(nbtsock, io->in.dest_addr, NBT_NAME_SERVICE_PORT, packet, + req = nbt_name_request_send(nbtsock, io->in.dest_addr, lp_nbt_port(), packet, timeval_current_ofs(io->in.timeout, 0), False); if (req == NULL) goto failed; @@ -142,7 +142,7 @@ struct nbt_name_request *nbt_name_status_send(struct nbt_name_socket *nbtsock, packet->questions[0].question_type = NBT_QTYPE_STATUS; packet->questions[0].question_class = NBT_QCLASS_IP; - req = nbt_name_request_send(nbtsock, io->in.dest_addr, NBT_NAME_SERVICE_PORT, packet, + req = nbt_name_request_send(nbtsock, io->in.dest_addr, lp_nbt_port(), packet, timeval_current_ofs(io->in.timeout, 0), False); if (req == NULL) goto failed; -- cgit