summaryrefslogtreecommitdiffstats
path: root/source/nameannounce.c
diff options
context:
space:
mode:
authorSamba Release Account <samba-bugs@samba.org>1996-07-02 15:31:33 +0000
committerSamba Release Account <samba-bugs@samba.org>1996-07-02 15:31:33 +0000
commita66417ebe871a1c1366c395ea4c7099852975e65 (patch)
tree7e74586e29a938e8f09cab360d2b868f8d467196 /source/nameannounce.c
parent96d242826d618f7dcdb1a1adf50d484df7e2a5c0 (diff)
downloadsamba-a66417ebe871a1c1366c395ea4c7099852975e65.tar.gz
samba-a66417ebe871a1c1366c395ea4c7099852975e65.tar.xz
samba-a66417ebe871a1c1366c395ea4c7099852975e65.zip
as a result of the writing of namework.doc, namework.c has been tidied up,
some bugs fixed / documented and some discrepancies noted down (in namework.c as well as namework.doc) namebrowse.c and namelogon.c contain functions that were inappropriately placed in namework.c. namebrowse.c contains browse sync queue management functions that were inappropriately placed in namedb.c the 'cmd_type' member of response_record has been renamed to 'state' because that more accurately reflects it purpose (not entirely. sigh). fixed a bug in nameserv.c that meant the previous version wouldn't compile. there's probably a bit more... lkcl
Diffstat (limited to 'source/nameannounce.c')
-rw-r--r--source/nameannounce.c40
1 files changed, 29 insertions, 11 deletions
diff --git a/source/nameannounce.c b/source/nameannounce.c
index 5163c4aea9a..0fad2fe7ecc 100644
--- a/source/nameannounce.c
+++ b/source/nameannounce.c
@@ -50,8 +50,6 @@ extern int workgroup_count;
/* what server type are we currently */
-#define BROWSE_MAILSLOT "\\MAILSLOT\\BROWSE"
-
/****************************************************************************
send a announce request to the local net
**************************************************************************/
@@ -109,6 +107,26 @@ void do_announce_request(char *info, char *to_name, int announce_type,
myname,to_name,from,to,dest_ip,*iface_ip(dest_ip));
}
+
+/****************************************************************************
+ find a server responsible for a workgroup, and sync browse lists
+ control ends up back here via response_name_query.
+ **************************************************************************/
+void sync_server(enum state_type state, char *serv_name, char *work_name,
+ int name_type,
+ struct in_addr ip)
+{
+ add_browser_entry(serv_name, name_type, work_name, 0, ip);
+
+ if (state == NAME_QUERY_MST_SRV_CHK)
+ {
+ /* announce ourselves as a master browser to serv_name */
+ do_announce_request(myname, serv_name, ANN_MasterAnnouncement,
+ 0x20, 0, ip);
+ }
+}
+
+
/****************************************************************************
construct a host announcement unicast
**************************************************************************/
@@ -294,8 +312,8 @@ void announce_host(void)
if (work->needannounce) {
/* drop back to a max 3 minute announce - this is to prevent a
single lost packet from stuffing things up for too long */
- work->announce_interval = MIN(work->announce_interval,
- CHECK_TIME_MIN_HOST_ANNCE*60);
+ work->announce_interval = MIN(work->announce_interval,
+ CHECK_TIME_MIN_HOST_ANNCE*60);
work->lastannounce_time = t - (work->announce_interval+1);
}
@@ -323,18 +341,18 @@ void announce_host(void)
}
if (announce)
- {
+ {
announce_server(d,work,my_name,comment,work->announce_interval,stype);
- }
+ }
if (work->needannounce)
- {
+ {
work->needannounce = False;
break;
/* sorry: can't do too many announces. do some more later */
- }
+ }
}
- }
+ }
}
@@ -356,8 +374,8 @@ void announce_master(void)
time_t t = time(NULL);
BOOL am_master = False; /* are we a master of some sort? :-) */
- if (last && (t-last < CHECK_TIME_MST_ANNOUNCE * 60))
- return;
+ if (last && (t-last < CHECK_TIME_MST_ANNOUNCE * 60))
+ return;
last = t;