diff options
author | Samba Release Account <samba-bugs@samba.org> | 1996-07-07 12:36:18 +0000 |
---|---|---|
committer | Samba Release Account <samba-bugs@samba.org> | 1996-07-07 12:36:18 +0000 |
commit | b338bce94f47780c74b2db3608a767c5b957b61a (patch) | |
tree | ad4a664ed44df79f85c0955befa0335d09f7e129 /source3/nameelect.c | |
parent | 4d314a96e76670f65bcd885d7bddfd7a137a4116 (diff) | |
download | samba-b338bce94f47780c74b2db3608a767c5b957b61a.tar.gz samba-b338bce94f47780c74b2db3608a767c5b957b61a.tar.bz2 samba-b338bce94f47780c74b2db3608a767c5b957b61a.zip |
tidied up: code shuffling and documentation.
created namedb*.c nameservresp.c nameservreply.c and namepacket.c
added modules to Makefile, downloading dan's current version first :-)
shuffled docs to match source
created more docs
fixed bug in announce_backup() discovered when going nameannounce.doc:
backup list requests to the master browser should be used when samba is
not a master browser; backup list requests to the primary domain
controller should be used when samba is not a primary domain controller.
fixed bug in sync_server: it would never send MasterAnnounce packets.
removed the code that ignored special browser names: these should only
be ignored (except 0x1b names) when broadcasted name queries are sent,
not when directed registration or directed queries are sent samba as a
WINS server. (note: exactly what's going on is still uncertain).
renamed NAME_QUERY_MST_SRV_CHK to NAME_QUERY_PDC_SRV_CHK (more accurate).
renamed NAME_STATUS_MST_SRV_CHK to NAME_STATUS_PDC_SRV_CHK (more accurate).
added secured WINS name registration: a new 'state' NAME_REGISTER_CHALLENGE;
functions send_name_response(), response_name_query_register(); added
sending of WAIT ACKNOWLEDGEMENT packet; added a reply_to_ip field to
the response record structure so that after the name query challenge,
you know who to inform of the outcome of that challenge.
note: these are all currently untested modifications (yikes!)
lkcl
(This used to be commit b50ff657ddc29b81b4aa02a597e5affab197e4f2)
Diffstat (limited to 'source3/nameelect.c')
-rw-r--r-- | source3/nameelect.c | 35 |
1 files changed, 25 insertions, 10 deletions
diff --git a/source3/nameelect.c b/source3/nameelect.c index bb219415b8..386e7b0bab 100644 --- a/source3/nameelect.c +++ b/source3/nameelect.c @@ -2,7 +2,7 @@ Unix SMB/Netbios implementation. Version 1.9. NBT netbios routines and daemon - version 2 - Copyright (C) Andrew Tridgell 1994-1995 + Copyright (C) Andrew Tridgell 1994-1996 This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -18,11 +18,17 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + Module name: nameelect.c + Revision History: 14 jan 96: lkcl@pires.co.uk added multiple workgroup domain master support + 04 jul 96: lkcl@pires.co.uk + added system to become a master browser by stages. + + */ #include "includes.h" @@ -75,7 +81,7 @@ void check_master_browser(void) { queue_netbios_packet(d,ClientNMB,NMB_QUERY,NAME_QUERY_MST_CHK, work->work_group,0x1d,0,0, - True,False,d->bcast_ip); + True,False,d->bcast_ip,d->bcast_ip); } } } @@ -134,7 +140,7 @@ void send_election(struct subnet_record *d, char *group,uint32 criterion, bzero(outbuf,sizeof(outbuf)); p = outbuf; - CVAL(p,0) = 8; /* election */ + CVAL(p,0) = ANN_Election; /* election */ p++; CVAL(p,0) = (criterion == 0 && timeup == 0) ? 0 : ELECTION_VERSION; @@ -166,13 +172,13 @@ void name_unregister_work(struct subnet_record *d, char *name, int name_type) if (!(work = find_workgroupstruct(d, name, False))) return; - if (special_browser_name(name, name_type) || + if (ms_browser_name(name, name_type) || (AM_MASTER(work) && strequal(name, lp_workgroup()) == 0 && (name_type == 0x1d || name_type == 0x1b))) { int remove_type = 0; - if (special_browser_name(name, name_type)) + if (ms_browser_name(name, name_type)) remove_type = SV_TYPE_MASTER_BROWSER|SV_TYPE_DOMAIN_MASTER; if (name_type == 0x1d) remove_type = SV_TYPE_MASTER_BROWSER; @@ -247,7 +253,7 @@ void become_master(struct subnet_record *d, struct work_record *work) { case MST_NONE: /* while we were nothing but a server... */ { - work->state = MST_WON; /* election win was successful */ + work->state = MST_WON; /* ... an election win was successful */ work->ElectionCriterion |= 0x5; @@ -264,7 +270,7 @@ void become_master(struct subnet_record *d, struct work_record *work) } case MST_WON: /* while nothing had happened except we won an election... */ { - work->state = MST_MSB; /* registering MSBROWSE was successful */ + work->state = MST_MSB; /* ... registering MSBROWSE was successful */ /* add server entry on successful registration of MSBROWSE */ add_server_entry(d,work,work->work_group,domain_type,0,myname,True); @@ -276,9 +282,9 @@ void become_master(struct subnet_record *d, struct work_record *work) break; } - case MST_MSB: /* while we were still only registered MSBROWSE state */ + case MST_MSB: /* while we were still only registered MSBROWSE state... */ { - work->state = MST_BROWSER; /* registering WORKGROUP(1d) was successful */ + work->state = MST_BROWSER; /* ... registering WORKGROUP(1d) succeeded */ /* update our server status */ work->ServerType |= SV_TYPE_MASTER_BROWSER; @@ -296,12 +302,16 @@ void become_master(struct subnet_record *d, struct work_record *work) /* add domain master name */ add_my_name_entry(d,work->work_group,0x1b,NB_ACTIVE ); } + else + { + DEBUG(2,("samba not configured as a domain master: no third stage.\n")); + } break; } case MST_BROWSER: /* while we were still a master browser... */ { - work->state = MST_DOMAIN; /* registering WORKGROUP(1b) was successful */ + work->state = MST_DOMAIN; /* ... registering WORKGROUP(1b) succeeded */ /* update our server status */ if (lp_domain_master()) @@ -513,6 +523,11 @@ void process_election(struct packet_struct *p,char *buf) /**************************************************************************** checks whether a browser election is to be run on any workgroup + + this function really ought to return the time between election + packets (which depends on whether samba intends to be a domain + master or a master browser) in milliseconds. + ***************************************************************************/ BOOL check_elections(void) { |