From ab8cd4470c392e04e458eed378b857db00e97f13 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Fri, 30 Dec 2005 12:43:11 +0000 Subject: r12607: fix the build metze (This used to be commit 5cc955bf5400a415e462853cff47a69ef206a548) --- source4/nbt_server/config.mk | 2 +- source4/nbt_server/defense.c | 1 + source4/nbt_server/interfaces.c | 1 + source4/nbt_server/irpc.c | 2 +- source4/nbt_server/nbt_server.c | 2 +- source4/nbt_server/query.c | 21 ++++++++++++-------- source4/nbt_server/register.c | 1 + source4/nbt_server/wins/winsclient.c | 1 + source4/nbt_server/wins/winsserver.c | 2 +- source4/nbt_server/wins/winsserver.h | 37 ++++++++++++++++++++++++++++++++++++ source4/nbt_server/wins/winswack.c | 2 +- source4/nbt_server/wins/winswack.h | 37 ------------------------------------ 12 files changed, 59 insertions(+), 50 deletions(-) create mode 100644 source4/nbt_server/wins/winsserver.h delete mode 100644 source4/nbt_server/wins/winswack.h diff --git a/source4/nbt_server/config.mk b/source4/nbt_server/config.mk index ac342840ac..a8aab7b2ad 100644 --- a/source4/nbt_server/config.mk +++ b/source4/nbt_server/config.mk @@ -17,7 +17,7 @@ OBJ_FILES = \ wins/winsserver.o \ wins/winsclient.o \ wins/winswack.o -PRIVATE_PROTO_HEADER = wins/winswack_proto.h +PRIVATE_PROTO_HEADER = wins/winsserver_proto.h REQUIRED_SUBSYSTEMS = \ LIBCLI_NBT WINSDB # End SUBSYSTEM NBTD_WINS diff --git a/source4/nbt_server/defense.c b/source4/nbt_server/defense.c index 0819fd4f2f..7811c254c0 100644 --- a/source4/nbt_server/defense.c +++ b/source4/nbt_server/defense.c @@ -24,6 +24,7 @@ #include "dlinklist.h" #include "system/network.h" #include "nbt_server/nbt_server.h" +#include "nbt_server/wins/winsserver.h" /* diff --git a/source4/nbt_server/interfaces.c b/source4/nbt_server/interfaces.c index 344d1b57d3..41a27fdeb0 100644 --- a/source4/nbt_server/interfaces.c +++ b/source4/nbt_server/interfaces.c @@ -25,6 +25,7 @@ #include "nbt_server/nbt_server.h" #include "smbd/service_task.h" #include "lib/socket/socket.h" +#include "nbt_server/wins/winsserver.h" /* diff --git a/source4/nbt_server/irpc.c b/source4/nbt_server/irpc.c index 2e72b8146c..b3b168a8c0 100644 --- a/source4/nbt_server/irpc.c +++ b/source4/nbt_server/irpc.c @@ -24,7 +24,7 @@ #include "includes.h" #include "smbd/service_task.h" #include "nbt_server/nbt_server.h" - +#include "nbt_server/wins/winsserver.h" /* serve out the nbt statistics diff --git a/source4/nbt_server/nbt_server.c b/source4/nbt_server/nbt_server.c index 3ba06c7df9..5e8d8fb073 100644 --- a/source4/nbt_server/nbt_server.c +++ b/source4/nbt_server/nbt_server.c @@ -24,7 +24,7 @@ #include "lib/events/events.h" #include "smbd/service_task.h" #include "nbt_server/nbt_server.h" - +#include "nbt_server/wins/winsserver.h" /* startup the nbtd task diff --git a/source4/nbt_server/query.c b/source4/nbt_server/query.c index f71d7b99ed..39300f6e01 100644 --- a/source4/nbt_server/query.c +++ b/source4/nbt_server/query.c @@ -24,7 +24,7 @@ #include "dlinklist.h" #include "system/network.h" #include "nbt_server/nbt_server.h" - +#include "nbt_server/wins/winsserver.h" /* answer a name query @@ -54,25 +54,30 @@ void nbtd_request_query(struct nbt_name_socket *nbtsock, /* see if we have the requested name on this interface */ name = &packet->questions[0].name; - if (!(packet->operation & NBT_FLAG_BROADCAST) && - (packet->operation & NBT_FLAG_RECURSION_DESIRED)) { - nbtd_winsserver_request(nbtsock, packet, src); - return; - } - iname = nbtd_find_iname(iface, name, 0); - if (iname == NULL) { /* don't send negative replies to broadcast queries */ if (packet->operation & NBT_FLAG_BROADCAST) { return; } + if (packet->operation & NBT_FLAG_RECURSION_DESIRED) { + nbtd_winsserver_request(nbtsock, packet, src); + return; + } + /* otherwise send a negative reply */ nbtd_negative_name_query_reply(nbtsock, packet, src); return; } + if (!(packet->operation & NBT_FLAG_BROADCAST) && + (packet->operation & NBT_FLAG_RECURSION_DESIRED) && + (iname->nb_flags & NBT_NM_GROUP)) { + nbtd_winsserver_request(nbtsock, packet, src); + return; + } + /* if the name is not yet active and its a broadcast query then ignore it for now */ if (!(iname->nb_flags & NBT_NM_ACTIVE) && diff --git a/source4/nbt_server/register.c b/source4/nbt_server/register.c index 74f664ba40..a18e3f4412 100644 --- a/source4/nbt_server/register.c +++ b/source4/nbt_server/register.c @@ -27,6 +27,7 @@ #include "smbd/service_task.h" #include "libcli/composite/composite.h" #include "librpc/gen_ndr/ndr_samr.h" +#include "nbt_server/wins/winsserver.h" static void nbtd_start_refresh_timer(struct nbtd_iface_name *iname); diff --git a/source4/nbt_server/wins/winsclient.c b/source4/nbt_server/wins/winsclient.c index 6bf328d146..2538105fb8 100644 --- a/source4/nbt_server/wins/winsclient.c +++ b/source4/nbt_server/wins/winsclient.c @@ -22,6 +22,7 @@ #include "includes.h" #include "nbt_server/nbt_server.h" +#include "nbt_server/wins/winsserver.h" #include "libcli/composite/composite.h" #include "lib/events/events.h" #include "smbd/service_task.h" diff --git a/source4/nbt_server/wins/winsserver.c b/source4/nbt_server/wins/winsserver.c index a456ed06d5..c01ab9a19b 100644 --- a/source4/nbt_server/wins/winsserver.c +++ b/source4/nbt_server/wins/winsserver.c @@ -24,7 +24,7 @@ #include "includes.h" #include "nbt_server/nbt_server.h" #include "nbt_server/wins/winsdb.h" -#include "nbt_server/wins/winswack.h" +#include "nbt_server/wins/winsserver.h" #include "system/time.h" #include "libcli/composite/composite.h" #include "smbd/service_task.h" diff --git a/source4/nbt_server/wins/winsserver.h b/source4/nbt_server/wins/winsserver.h new file mode 100644 index 0000000000..0ac40e7501 --- /dev/null +++ b/source4/nbt_server/wins/winsserver.h @@ -0,0 +1,37 @@ +/* + Unix SMB/CIFS implementation. + + wins server WACK processing + + Copyright (C) Stefan Metzmacher 2005 + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + +struct wins_challenge_io { + struct { + struct nbtd_server *nbtd_server; + struct event_context *event_ctx; + struct nbt_name *name; + uint32_t num_addresses; + const char **addresses; + } in; + struct { + uint32_t num_addresses; + const char **addresses; + } out; +}; + +#include "nbt_server/wins/winsserver_proto.h" diff --git a/source4/nbt_server/wins/winswack.c b/source4/nbt_server/wins/winswack.c index 9e41d14e45..2da73fa9cf 100644 --- a/source4/nbt_server/wins/winswack.c +++ b/source4/nbt_server/wins/winswack.c @@ -24,7 +24,7 @@ #include "includes.h" #include "nbt_server/nbt_server.h" #include "nbt_server/wins/winsdb.h" -#include "nbt_server/wins/winswack.h" +#include "nbt_server/wins/winsserver.h" #include "system/time.h" #include "libcli/composite/composite.h" diff --git a/source4/nbt_server/wins/winswack.h b/source4/nbt_server/wins/winswack.h deleted file mode 100644 index 42105f08ff..0000000000 --- a/source4/nbt_server/wins/winswack.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - Unix SMB/CIFS implementation. - - wins server WACK processing - - Copyright (C) Stefan Metzmacher 2005 - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -*/ - -struct wins_challenge_io { - struct { - struct nbtd_server *nbtd_server; - struct event_context *event_ctx; - struct nbt_name *name; - uint32_t num_addresses; - const char **addresses; - } in; - struct { - uint32_t num_addresses; - const char **addresses; - } out; -}; - -#include "nbt_server/wins/winswack_proto.h" -- cgit