svn commit: samba r12644 - in branches/SAMBA_4_0/source: nbt_server
nbt_server/wins param
metze at samba.org
metze at samba.org
Sat Dec 31 10:42:00 GMT 2005
Author: metze
Date: 2005-12-31 10:41:59 +0000 (Sat, 31 Dec 2005)
New Revision: 12644
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=12644
Log:
prepare the dns proxy feature for the wins server
metze
Added:
branches/SAMBA_4_0/source/nbt_server/wins/wins_dns_proxy.c
Modified:
branches/SAMBA_4_0/source/nbt_server/config.mk
branches/SAMBA_4_0/source/nbt_server/wins/winsserver.c
branches/SAMBA_4_0/source/param/loadparm.c
Changeset:
Modified: branches/SAMBA_4_0/source/nbt_server/config.mk
===================================================================
--- branches/SAMBA_4_0/source/nbt_server/config.mk 2005-12-31 10:04:11 UTC (rev 12643)
+++ branches/SAMBA_4_0/source/nbt_server/config.mk 2005-12-31 10:41:59 UTC (rev 12644)
@@ -17,7 +17,8 @@
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
Added: branches/SAMBA_4_0/source/nbt_server/wins/wins_dns_proxy.c
===================================================================
--- branches/SAMBA_4_0/source/nbt_server/wins/wins_dns_proxy.c 2005-12-31 10:04:11 UTC (rev 12643)
+++ branches/SAMBA_4_0/source/nbt_server/wins/wins_dns_proxy.c 2005-12-31 10:41:59 UTC (rev 12644)
@@ -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);
+}
Modified: branches/SAMBA_4_0/source/nbt_server/wins/winsserver.c
===================================================================
--- branches/SAMBA_4_0/source/nbt_server/wins/winsserver.c 2005-12-31 10:04:11 UTC (rev 12643)
+++ branches/SAMBA_4_0/source/nbt_server/wins/winsserver.c 2005-12-31 10:41:59 UTC (rev 12644)
@@ -583,7 +583,16 @@
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;
}
/*
Modified: branches/SAMBA_4_0/source/param/loadparm.c
===================================================================
--- branches/SAMBA_4_0/source/param/loadparm.c 2005-12-31 10:04:11 UTC (rev 12643)
+++ branches/SAMBA_4_0/source/param/loadparm.c 2005-12-31 10:41:59 UTC (rev 12644)
@@ -164,6 +164,7 @@
int web_port;
char *socket_options;
BOOL bWINSsupport;
+ BOOL bWINSdnsProxy;
BOOL bLocalMaster;
BOOL bPreferredMaster;
BOOL bEncryptPasswords;
@@ -519,6 +520,7 @@
{"wins server", P_LIST, P_GLOBAL, &Globals.szWINSservers, NULL, NULL, FLAG_BASIC | FLAG_ADVANCED | FLAG_WIZARD | FLAG_DEVELOPER},
{"wins support", P_BOOL, P_GLOBAL, &Globals.bWINSsupport, NULL, NULL, FLAG_BASIC | FLAG_ADVANCED | FLAG_WIZARD | FLAG_DEVELOPER},
+ {"dns proxy", P_BOOL, P_GLOBAL, &Globals.bWINSdnsProxy, NULL, NULL, FLAG_BASIC | FLAG_ADVANCED | FLAG_WIZARD | FLAG_DEVELOPER},
{"Locking Options", P_SEP, P_SEPARATOR},
@@ -672,7 +674,8 @@
do_parameter("PreferredMaster", "Auto", NULL);
do_parameter("LocalMaster", "True", NULL);
- do_parameter("WINSsupport", "False", NULL);
+ do_parameter("wins support", "False", NULL);
+ do_parameter("dns proxy", "False", NULL);
do_parameter("winbind separator", "\\", NULL);
do_parameter("winbind sealed pipes", "True", NULL);
@@ -847,6 +850,7 @@
FN_GLOBAL_BOOL(lp_disable_netbios, &Globals.bDisableNetbios)
FN_GLOBAL_BOOL(lp_wins_support, &Globals.bWINSsupport)
+FN_GLOBAL_BOOL(lp_wins_dns_proxy, &Globals.bWINSdnsProxy)
FN_GLOBAL_BOOL(lp_local_master, &Globals.bLocalMaster)
FN_GLOBAL_BOOL(lp_readraw, &Globals.bReadRaw)
FN_GLOBAL_BOOL(lp_large_readwrite, &Globals.bLargeReadwrite)
More information about the samba-cvs
mailing list