diff options
author | Stefan Metzmacher <metze@samba.org> | 2005-12-31 10:41:59 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:49:34 -0500 |
commit | 706ef631f7d456de93078b8d0dca2c22e39d7ad1 (patch) | |
tree | 8a13357d6d8cf31466fbf5bbb505c702a2730ae5 /source4/nbt_server | |
parent | 93a3e9e2b615f041f13dff8f77891f52d274a19f (diff) | |
download | samba-706ef631f7d456de93078b8d0dca2c22e39d7ad1.tar.gz samba-706ef631f7d456de93078b8d0dca2c22e39d7ad1.tar.bz2 samba-706ef631f7d456de93078b8d0dca2c22e39d7ad1.zip |
r12644: prepare the dns proxy feature for the wins server
metze
(This used to be commit 48842cd9abcff744851ad1481309fb901be3a73b)
Diffstat (limited to 'source4/nbt_server')
-rw-r--r-- | source4/nbt_server/config.mk | 3 | ||||
-rw-r--r-- | source4/nbt_server/wins/wins_dns_proxy.c | 40 | ||||
-rw-r--r-- | source4/nbt_server/wins/winsserver.c | 11 |
3 files changed, 52 insertions, 2 deletions
diff --git a/source4/nbt_server/config.mk b/source4/nbt_server/config.mk index 60c338d0fc..bc415516ad 100644 --- a/source4/nbt_server/config.mk +++ b/source4/nbt_server/config.mk @@ -17,7 +17,8 @@ REQUIRED_SUBSYSTEMS = \ OBJ_FILES = \ wins/winsserver.o \ wins/winsclient.o \ - wins/winswack.o + wins/winswack.o \ + wins/wins_dns_proxy.o PRIVATE_PROTO_HEADER = wins/winsserver_proto.h REQUIRED_SUBSYSTEMS = \ LIBCLI_NBT WINSDB diff --git a/source4/nbt_server/wins/wins_dns_proxy.c b/source4/nbt_server/wins/wins_dns_proxy.c new file mode 100644 index 0000000000..8fb6396f87 --- /dev/null +++ b/source4/nbt_server/wins/wins_dns_proxy.c @@ -0,0 +1,40 @@ +/* + Unix SMB/CIFS implementation. + + wins server dns proxy + + 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. +*/ + +#include "includes.h" +#include "nbt_server/nbt_server.h" +#include "nbt_server/wins/winsdb.h" +#include "nbt_server/wins/winsserver.h" +#include "system/time.h" +#include "libcli/composite/composite.h" +#include "smbd/service_task.h" + +/* + dns proxy query a name +*/ +void nbtd_wins_dns_proxy_query(struct nbt_name_socket *nbtsock, + struct nbt_name_packet *packet, + const struct nbt_peer_socket *src) +{ + /* TODO: add a real implementation here */ + nbtd_negative_name_query_reply(nbtsock, packet, src); +} diff --git a/source4/nbt_server/wins/winsserver.c b/source4/nbt_server/wins/winsserver.c index 3eddfb7639..449a11f4fc 100644 --- a/source4/nbt_server/wins/winsserver.c +++ b/source4/nbt_server/wins/winsserver.c @@ -583,7 +583,16 @@ static void nbtd_winsserver_query(struct nbt_name_socket *nbtsock, status = winsdb_lookup(winssrv->wins_db, name, packet, &rec); if (!NT_STATUS_IS_OK(status)) { - goto notfound; + if (!lp_wins_dns_proxy()) { + goto notfound; + } + + if (name->type != NBT_NAME_CLIENT && name->type != NBT_NAME_SERVER) { + goto notfound; + } + + nbtd_wins_dns_proxy_query(nbtsock, packet, src); + return; } /* |