summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
Diffstat (limited to 'source3')
-rw-r--r--source3/include/proto.h2
-rw-r--r--source3/nameannounce.c34
-rw-r--r--source3/nmbd/nmbd.c1
-rw-r--r--source3/param/loadparm.c3
4 files changed, 40 insertions, 0 deletions
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)