Added in mods for new smb.conf "remote browse sync" option as posted to
authorJohn Terpstra <jht@samba.org>
Fri, 21 Nov 1997 14:01:23 +0000 (14:01 +0000)
committerJohn Terpstra <jht@samba.org>
Fri, 21 Nov 1997 14:01:23 +0000 (14:01 +0000)
the samba-1.9.17 tree moments ago.
(This used to be commit 2ee25cd117a116d0304960780d6c197f39d25a3d)

docs/manpages/smb.conf.5
source3/include/proto.h
source3/nameannounce.c
source3/nmbd/nmbd.c
source3/param/loadparm.c

index 5de989aff56173ed7901266a5a5b359c54428e3d..e2c8d4d2a380a721798bc3b0e95c41541736fd10 100644 (file)
@@ -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
index 9624116f824608362f63da178c173d7ead43addd..090e9830a8e6dad1ddbbe2d44660bd97d2a56739 100644 (file)
@@ -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  */
 
index 03fab914debdc2f2efc95a5d0bae4e62dfb14d2f..28ebe5da90ca3c506e59c3f7af6406aa29356612 100644 (file)
@@ -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);
+    }
+  }
 }
index 5067a7efc88cab1c4b82628e3b499a43107d8793..1e4a2d9a7900b97129d7c982446610423fabcbc1 100644 (file)
@@ -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);
 
index 3b8a06f02e702160aad469a54cba0279a3246f6b..43f0fe920880e2746963ac08edd621101c9a494e 100644 (file)
@@ -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)