diff options
author | John Terpstra <jht@samba.org> | 1997-11-21 14:01:23 +0000 |
---|---|---|
committer | John Terpstra <jht@samba.org> | 1997-11-21 14:01:23 +0000 |
commit | 2ee25cd117a116d0304960780d6c197f39d25a3d (patch) | |
tree | a815f897e31a56aa7064e4c4a2628ffce6fbbbfb | |
parent | 30b84bb68bfbfb022decc36c1b4869a39a06e556 (diff) | |
download | samba-2ee25cd117a116d0304960780d6c197f39d25a3d.tar.gz samba-2ee25cd117a116d0304960780d6c197f39d25a3d.tar.xz samba-2ee25cd117a116d0304960780d6c197f39d25a3d.zip |
Added in mods for new smb.conf "remote browse sync" option as posted to
the samba-1.9.17 tree moments ago.
-rw-r--r-- | docs/manpages/smb.conf.5 | 31 | ||||
-rw-r--r-- | source/include/proto.h | 2 | ||||
-rw-r--r-- | source/nameannounce.c | 34 | ||||
-rw-r--r-- | source/nmbd/nmbd.c | 1 | ||||
-rw-r--r-- | source/param/loadparm.c | 3 |
5 files changed, 71 insertions, 0 deletions
diff --git a/docs/manpages/smb.conf.5 b/docs/manpages/smb.conf.5 index 5de989aff56..e2c8d4d2a38 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/source/include/proto.h b/source/include/proto.h index 9624116f824..090e9830a8e 100644 --- a/source/include/proto.h +++ b/source/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/source/nameannounce.c b/source/nameannounce.c index 03fab914deb..28ebe5da90c 100644 --- a/source/nameannounce.c +++ b/source/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/source/nmbd/nmbd.c b/source/nmbd/nmbd.c index 5067a7efc88..1e4a2d9a790 100644 --- a/source/nmbd/nmbd.c +++ b/source/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/source/param/loadparm.c b/source/param/loadparm.c index 3b8a06f02e7..43f0fe92088 100644 --- a/source/param/loadparm.c +++ b/source/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) |