From b581d0324098f12a5bcb1941e698339a84e44a93 Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Sun, 9 Mar 1997 14:58:22 +0000 Subject: 1) updated ipc.c NetUserGetInfo - load \\%L\%U instead of \\%L\HOMES because the share must be browseable by a w95 client 2) send_mailslot_reply - unique or group datagram argument added. 3) netlogon.c - rewrote response packet to do the right thing for w95. 4) server.c reply_nt1() - added OEMDomainstring to the end. 5) (deep breath) reworked the nmbd-browsing code a little bit. i discovered two months ago that becoming a primary domain controller (and domain master browser) is done independently of becoming a backup domain controller (logon server) is done independently of becoming a local master browser. therefore, three sets of state-machines (instead of just one) are in place - each of which is responsible for taking samba through the required stages to become: a logon server; a domain master browser; and a local master browser. each of these three things can occur independently on each interface, _including_ the wins pseudo-interface. the only slight caveat is that the wins pseudo-interface, by virtue of _not_ being a broadcast interface, does _not_ register as a local master browser with the wins server, as this doesn't make sense. lkcl (This used to be commit 88c6a00c3c1b430307f512986185b5ed7aea7181) --- source3/include/nameserv.h | 41 +++++++++++++++++++++++++++++++---------- source3/include/proto.h | 14 +++++++++++--- source3/include/smb.h | 15 +++++++++++++++ 3 files changed, 57 insertions(+), 13 deletions(-) (limited to 'source3/include') diff --git a/source3/include/nameserv.h b/source3/include/nameserv.h index 7302f09e5d..75461ce5e6 100644 --- a/source3/include/nameserv.h +++ b/source3/include/nameserv.h @@ -73,7 +73,8 @@ /* server type identifiers */ #define AM_MASTER(work) (work->ServerType & SV_TYPE_MASTER_BROWSER) #define AM_BACKUP(work) (work->ServerType & SV_TYPE_BACKUP_BROWSER) -#define AM_DOMCTL(work) (work->ServerType & SV_TYPE_DOMAIN_CTRL) +#define AM_DOMMST(work) (work->ServerType & SV_TYPE_DOMAIN_MASTER) +#define AM_DOMMEM(work) (work->ServerType & SV_TYPE_DOMAIN_MEMBER) /* microsoft browser NetBIOS name */ #define MSBROWSE "\001\002__MSBROWSE__\002" @@ -85,16 +86,27 @@ enum name_source {STATUS_QUERY, LMHOSTS, REGISTER, SELF, DNS, DNSFAIL}; enum node_type {B_NODE=0, P_NODE=1, M_NODE=2, NBDD_NODE=3}; enum packet_type {NMB_PACKET, DGRAM_PACKET}; + enum master_state { - MST_NONE, - MST_WON, + MST_POTENTIAL, + MST_BACK, MST_MSB, - MST_BROWSER, - MST_DOMAIN_NONE, - MST_DOMAIN_MEM, - MST_DOMAIN_TST, - MST_DOMAIN + MST_BROWSER +}; + +enum domain_state +{ + DOMAIN_NONE, + DOMAIN_WAIT, + DOMAIN_MST +}; + +enum logon_state +{ + LOGON_NONE, + LOGON_WAIT, + LOGON_SRV }; enum state_type @@ -179,8 +191,14 @@ struct work_record struct server_record *serverlist; - /* stage of development from non-master to master browser / domain master */ - enum master_state state; + /* stage of development from non-local-master up to local-master browser */ + enum master_state mst_state; + + /* stage of development from non-domain-master to domain master browser */ + enum domain_state dom_state; + + /* stage of development from non-logon-server to logon server */ + enum logon_state log_state; /* work group info */ fstring work_group; @@ -367,6 +385,9 @@ struct packet_struct /* broadcast packet announcement intervals, in minutes */ +/* attempt to add domain logon and domain master names */ +#define CHECK_TIME_ADD_DOM_NAMES 5 + /* search for master browsers of workgroups samba knows about, except default */ #define CHECK_TIME_MST_BROWSE 5 diff --git a/source3/include/proto.h b/source3/include/proto.h index 2cd8cfe2a8..bbfcad78f9 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -411,8 +411,14 @@ void send_election(struct subnet_record *d, char *group,uint32 criterion, void name_unregister_work(struct subnet_record *d, char *name, int name_type); void name_register_work(struct subnet_record *d, char *name, int name_type, int nb_flags, time_t ttl, struct in_addr ip, BOOL bcast); -void become_master(struct subnet_record *d, struct work_record *work); -void become_nonmaster(struct subnet_record *d, struct work_record *work, +void become_local_master(struct subnet_record *d, struct work_record *work); +void become_domain_master(struct subnet_record *d, struct work_record *work); +void become_logon_server(struct subnet_record *d, struct work_record *work); +void unbecome_local_master(struct subnet_record *d, struct work_record *work, + int remove_type); +void unbecome_domain_master(struct subnet_record *d, struct work_record *work, + int remove_type); +void unbecome_logon_server(struct subnet_record *d, struct work_record *work, int remove_type); void run_elections(time_t t); void process_election(struct packet_struct *p,char *buf); @@ -436,7 +442,8 @@ void reply_netbios_packet(struct packet_struct *p1,int trn_id, void queue_packet(struct packet_struct *packet); void run_packet_queue(); void listen_for_packets(BOOL run_election); -BOOL send_mailslot_reply(char *mailslot,int fd,char *buf,int len,char *srcname, +BOOL send_mailslot_reply(BOOL unique, char *mailslot,int fd, + char *buf,int len,char *srcname, char *dstname,int src_type,int dest_type, struct in_addr dest_ip,struct in_addr src_ip); @@ -469,6 +476,7 @@ struct response_record *queue_netbios_packet(struct subnet_record *d, void remove_name_entry(struct subnet_record *d, char *name,int type); void add_my_name_entry(struct subnet_record *d,char *name,int type,int nb_flags); +void add_domain_names(time_t t); void add_my_names(void); void remove_my_names(); void refresh_my_names(time_t t); diff --git a/source3/include/smb.h b/source3/include/smb.h index eea5b5bc8c..e9d74befc2 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -797,6 +797,21 @@ char *Strstr(char *s, char *p); /* what server type are we currently */ +/* Capabilities. see ftp.microsoft.com/developr/drg/cifs/cifs/cifs4.txt */ + +#define CAP_RAW_MODE 0x0001 +#define CAP_MPX_MODE 0x0002 +#define CAP_UNICODE 0x0004 +#define CAP_LARGE_FILES 0x0008 +#define CAP_NT_SMBS 0x0010 +#define CAP_RPC_REMOTE_APIS 0x0020 +#define CAP_STATUS32 0x0040 +#define CAP_LEVEL_II_OPLOCKS 0x0080 +#define CAP_LOCK_AND_READ 0x0100 +#define CAP_NT_FIND 0x0200 +#define CAP_DFS 0x1000 +#define CAP_LARGE_READX 0x4000 + /* protocol types. It assumes that higher protocols include lower protocols as subsets */ enum protocol_types {PROTOCOL_NONE,PROTOCOL_CORE,PROTOCOL_COREPLUS,PROTOCOL_LANMAN1,PROTOCOL_LANMAN2,PROTOCOL_NT1}; -- cgit