From 4e92c7d1a3b543e48c2b09f8b78352a702c915aa Mon Sep 17 00:00:00 2001 From: John Terpstra Date: Fri, 21 Nov 1997 14:01:23 +0000 Subject: Added in mods for new smb.conf "remote browse sync" option as posted to the samba-1.9.17 tree moments ago. (This used to be commit 2ee25cd117a116d0304960780d6c197f39d25a3d) --- docs/manpages/smb.conf.5 | 31 +++++++++++++++++++++++++++++++ source3/include/proto.h | 2 ++ source3/nameannounce.c | 34 ++++++++++++++++++++++++++++++++++ source3/nmbd/nmbd.c | 1 + source3/param/loadparm.c | 3 +++ 5 files changed, 71 insertions(+) diff --git a/docs/manpages/smb.conf.5 b/docs/manpages/smb.conf.5 index 5de989aff5..e2c8d4d2a3 100644 --- a/docs/manpages/smb.conf.5 +++ b/docs/manpages/smb.conf.5 @@ -467,6 +467,8 @@ read size remote announce +remote browse sync + root root dir @@ -3001,6 +3003,35 @@ browse masters if your network config is that stable. This option replaces similar functionality from the nmbd lmhosts file. +.SS remote browse sync (G) + +This option allows you to setup nmbd to periodically request synchronisation +of browse lists with the master browser of a samba server that is on a remote +segment. This option will allow you to gain browse lists for multiple +workgroups across routed networks. This is done in a manner that does not work +with any non-samba servers. + +This is useful if you want your Samba server and all local clients +to appear in a remote workgroup for which the normal browse propagation +rules don't work. The remote workgroup can be anywhere that you can send IP +packets to. + +For example: + + remote browse sync = 192.168.2.255 192.168.4.255 + +the above line would cause nmbd to request the master browser on the +specified subnets or addresses to synchronise their browse lists with +the local server. + +The IP addresses you choose would normally be the broadcast addresses +of the remote networks, but can also be the IP addresses of known +browse masters if your network config is that stable. If a machine IP +address is given Samba makes NO attempt to validate that the remote +machine is available, is listening, nor that it is in fact the browse +master on it's segment. + + .SS revalidate (S) This options controls whether Samba will allow a previously validated diff --git a/source3/include/proto.h b/source3/include/proto.h index 9624116f82..090e9830a8 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -209,6 +209,7 @@ char *lp_logon_path(void); char *lp_logon_drive(void); char *lp_logon_home(void); char *lp_remote_announce(void); +char *lp_remote_browse_sync(void); char *lp_wins_server(void); char *lp_interfaces(void); char *lp_socket_address(void); @@ -426,6 +427,7 @@ void announce_host(time_t t); void reset_announce_timer(); void announce_master(time_t t); void announce_remote(time_t t); +void browse_sync_remote(time_t t); /*The following definitions come from namebrowse.c */ diff --git a/source3/nameannounce.c b/source3/nameannounce.c index 03fab914de..28ebe5da90 100644 --- a/source3/nameannounce.c +++ b/source3/nameannounce.c @@ -516,5 +516,39 @@ void announce_remote(time_t t) name,stype,comment); } } +} + +/**************************************************************************** + do all the "remote" browse synchronisation stuff. + These are used to put our browse lists into remote browse lists. + **************************************************************************/ +void browse_sync_remote(time_t t) +{ + char *s,*ptr; + static time_t last_time = 0; + pstring s2; + struct in_addr addr; + + if (last_time && t < last_time + REMOTE_ANNOUNCE_INTERVAL) + return; + + last_time = t; + s = lp_remote_browse_sync(); + if (!*s) return; + + for (ptr=s; next_token(&ptr,s2,NULL); ) + { + /* the entries are of the form a.b.c.d */ + int n; + + addr = *interpret_addr2(s2); + + /* Announce all our names including aliases */ + for (n=0; my_netbios_names[n]; n++) + { + char *name = my_netbios_names[n]; + do_announce_request(name, "*", ANN_MasterAnnouncement, 0x20, 0, addr); + } + } } diff --git a/source3/nmbd/nmbd.c b/source3/nmbd/nmbd.c index 5067a7efc8..1e4a2d9a79 100644 --- a/source3/nmbd/nmbd.c +++ b/source3/nmbd/nmbd.c @@ -312,6 +312,7 @@ static void process(void) announce_host(t); announce_master(t); announce_remote(t); + browse_sync_remote(t); query_refresh_names(t); diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 3b8a06f02e..43f0fe9208 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -141,6 +141,7 @@ typedef struct char *szWINSserver; char *szInterfaces; char *szRemoteAnnounce; + char *szRemoteBrowseSync; char *szSocketAddress; char *szNISHomeMapName; char *szAnnounceVersion; /* This is initialised in init_globals */ @@ -470,6 +471,7 @@ struct parm_struct {"logon drive", P_STRING, P_GLOBAL, &Globals.szLogonDrive, NULL}, {"logon home", P_STRING, P_GLOBAL, &Globals.szLogonHome, NULL}, {"remote announce", P_STRING, P_GLOBAL, &Globals.szRemoteAnnounce, NULL}, + {"remote browse sync", P_STRING, P_GLOBAL, &Globals.szRemoteBrowseSync, NULL}, {"socket address", P_STRING, P_GLOBAL, &Globals.szSocketAddress, NULL}, {"homedir map", P_STRING, P_GLOBAL, &Globals.szNISHomeMapName, NULL}, {"announce version", P_STRING, P_GLOBAL, &Globals.szAnnounceVersion, NULL}, @@ -873,6 +875,7 @@ FN_GLOBAL_STRING(lp_logon_path,&Globals.szLogonPath) FN_GLOBAL_STRING(lp_logon_drive,&Globals.szLogonDrive) FN_GLOBAL_STRING(lp_logon_home,&Globals.szLogonHome) FN_GLOBAL_STRING(lp_remote_announce,&Globals.szRemoteAnnounce) +FN_GLOBAL_STRING(lp_remote_browse_sync,&Globals.szRemoteBrowseSync) FN_GLOBAL_STRING(lp_wins_server,&Globals.szWINSserver) FN_GLOBAL_STRING(lp_interfaces,&Globals.szInterfaces) FN_GLOBAL_STRING(lp_socket_address,&Globals.szSocketAddress) -- cgit