diff options
author | Andrew Tridgell <tridge@samba.org> | 1996-10-02 15:41:30 +0000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 1996-10-02 15:41:30 +0000 |
commit | afd08462ad5ff6b3c4bf621e39c55853a608175e (patch) | |
tree | fdbaf287628ee046f0db73dd13611a03089fb47b /source3/include | |
parent | 5a2f52b79e28530c454cb488a44588147640f061 (diff) | |
download | samba-afd08462ad5ff6b3c4bf621e39c55853a608175e.tar.gz samba-afd08462ad5ff6b3c4bf621e39c55853a608175e.tar.bz2 samba-afd08462ad5ff6b3c4bf621e39c55853a608175e.zip |
backout all the changes to nmbd.
The 1.9.16 tree is now back to 1.9.16p2 as far as nmbd is concerned
apart from a small change that fixes the announce type in two places.
(This used to be commit 45e66a69d320024877c8b13f12b21bf895e04410)
Diffstat (limited to 'source3/include')
-rw-r--r-- | source3/include/nameserv.h | 80 | ||||
-rw-r--r-- | source3/include/proto.h | 151 | ||||
-rw-r--r-- | source3/include/smb.h | 6 |
3 files changed, 98 insertions, 139 deletions
diff --git a/source3/include/nameserv.h b/source3/include/nameserv.h index 1d1cf85962..e4876bac57 100644 --- a/source3/include/nameserv.h +++ b/source3/include/nameserv.h @@ -54,19 +54,6 @@ #define NB_HFLAG 0x60 /* microsoft 'hybrid' node type */ #define NB_FLGMSK 0x60 - -#define WG_BROWSE_SIGNATURE 0x017e -#define WG_BROWSE_VERSION 0xff08 - -#define HOST_BROWSE_SIGNATURE 0xaa55 -#define HOST_BROWSE_VERSION 0x010f - -#define WG_MAJOR_VERSION 0x03 -#define WG_MINOR_VERSION 0x0a - -#define HOST_MAJOR_VERSION 0x04 /* nt/as host version */ -#define HOST_MINOR_VERSION 0x01 /* one better than current nt/as version */ - #define REFRESH_TIME (15*60) #define NAME_POLL_REFRESH_TIME (5*60) #define NAME_POLL_INTERVAL 15 @@ -86,7 +73,7 @@ /* 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_DMBRSE(work) (work->ServerType & SV_TYPE_DOMAIN_MASTER) +#define AM_DOMCTL(work) (work->ServerType & SV_TYPE_DOMAIN_CTRL) /* microsoft browser NetBIOS name */ #define MSBROWSE "\001\002__MSBROWSE__\002" @@ -112,19 +99,19 @@ enum master_state enum state_type { - NAME_STATUS_DOM_SRV_CHK, - NAME_STATUS_SRV_CHK, - NAME_REGISTER_CHALLENGE, - NAME_REGISTER, - NAME_RELEASE, - NAME_QUERY_CONFIRM, - NAME_QUERY_ANNOUNCE_HOST, - NAME_QUERY_SYNC_LOCAL, - NAME_QUERY_SYNC_REMOTE, - NAME_QUERY_DOM_SRV_CHK, - NAME_QUERY_SRV_CHK, - NAME_QUERY_FIND_MST, - NAME_QUERY_MST_CHK + NAME_STATUS_DOM_SRV_CHK, + NAME_STATUS_SRV_CHK, + NAME_REGISTER_CHALLENGE, + NAME_REGISTER, + NAME_RELEASE, + NAME_QUERY_CONFIRM, + NAME_QUERY_ANNOUNCE_HOST, + NAME_QUERY_SYNC_LOCAL, + NAME_QUERY_SYNC_REMOTE, + NAME_QUERY_DOM_SRV_CHK, + NAME_QUERY_SRV_CHK, + NAME_QUERY_FIND_MST, + NAME_QUERY_MST_CHK }; /* a netbios name structure */ @@ -134,14 +121,6 @@ struct nmb_name { int name_type; }; -/* A server name and comment. */ -struct server_identity -{ - char *name; - char *comment; - struct server_identity *next; -}; - /* a netbios flags + ip address structure */ /* this is used for multi-homed systems and for internet group names */ struct nmb_ip @@ -169,16 +148,16 @@ struct name_record /* browse and backup server cache for synchronising browse list */ struct browse_cache_record { - struct browse_cache_record *next; - struct browse_cache_record *prev; - - char name[17]; - int type; - char group[17]; - struct in_addr ip; - time_t sync_time; - BOOL synced; - BOOL local; + struct browse_cache_record *next; + struct browse_cache_record *prev; + + pstring name; + int type; + pstring group; + struct in_addr ip; + time_t sync_time; + BOOL synced; + BOOL local; }; /* this is used to hold the list of servers in my domain, and is */ @@ -204,7 +183,7 @@ struct work_record enum master_state state; /* work group info */ - char work_group[17]; + fstring work_group; int token; /* used when communicating with backup browsers */ int ServerType; @@ -235,18 +214,17 @@ struct response_record int fd; int quest_type; struct nmb_name name; - struct nmb_ip reply; + int nb_flags; time_t ttl; - enum name_source source; - int token; /* unique workgroup token id */ int server_type; - char my_name[17]; - char my_comment[50]; + fstring my_name; + fstring my_comment; BOOL bcast; BOOL recurse; struct in_addr send_ip; + struct in_addr reply_to_ip; int num_msgs; diff --git a/source3/include/proto.h b/source3/include/proto.h index 5f18c488ce..1b76591abd 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -124,7 +124,6 @@ char *lp_smbrun(void); char *lp_configfile(void); char *lp_smb_passwd_file(void); char *lp_serverstring(void); -char *lp_server_comment(void); char *lp_printcapname(void); char *lp_lockdir(void); char *lp_rootdir(void); @@ -147,7 +146,6 @@ char *lp_interfaces(void); char *lp_socket_address(void); BOOL lp_wins_support(void); BOOL lp_wins_proxy(void); -BOOL lp_local_master(void); BOOL lp_domain_master(void); BOOL lp_domain_logons(void); BOOL lp_preferred_master(void); @@ -294,22 +292,20 @@ int reply_sendend(char *inbuf,char *outbuf); /*The following definitions come from nameannounce.c */ void announce_request(struct work_record *work, struct in_addr ip); -void do_announce_request(char *info, char *from_name, char *to_name, - int announce_type, int from, int to, struct in_addr dest_ip); +void do_announce_request(char *info, char *to_name, int announce_type, + int from, + int to, struct in_addr dest_ip); void sync_server(enum state_type state, char *serv_name, char *work_name, - int name_type, - struct in_addr ip); + int name_type, + struct in_addr ip); void do_announce_host(int command, - char *from_name, int from_type, struct in_addr from_ip, - char *to_name , int to_type , struct in_addr to_ip, - time_t announce_interval, - char *server_name, int server_type, - char major_version, char minor_version, - uint16 browse_version, uint16 browse_sig, - char *server_comment); + char *from_name, int from_type, struct in_addr from_ip, + char *to_name , int to_type , struct in_addr to_ip, + time_t announce_interval, + char *server_name, int server_type, char *server_comment); void remove_my_servers(void); void announce_server(struct subnet_record *d, struct work_record *work, - char *name, char *comment, time_t ttl, int server_type); + char *name, char *comment, time_t ttl, int server_type); void announce_host(void); void announce_master(void); void announce_remote(void); @@ -318,7 +314,7 @@ void announce_remote(void); void expire_browse_cache(time_t t); struct browse_cache_record *add_browser_entry(char *name, int type, char *wg, - time_t ttl, struct in_addr ip, BOOL local); + time_t ttl, struct in_addr ip, BOOL local); void do_browser_lists(void); /*The following definitions come from nameconf.c */ @@ -326,10 +322,8 @@ void do_browser_lists(void); int get_num_workgroups(void); int conf_workgroup_name_to_token(char *workgroup_name,char *default_name); char *conf_workgroup_name(int token); -int conf_should_preferred_master(int token); int conf_should_workgroup_member(int token); int conf_should_local_master(int token); -int conf_should_domain_logon(int token); int conf_should_domain_master(int token); char *conf_browsing_alias(int token); char *conf_browsing_alias_comment(int token); @@ -344,24 +338,24 @@ BOOL name_equal(struct nmb_name *n1,struct nmb_name *n2); BOOL ms_browser_name(char *name, int type); void remove_name(struct subnet_record *d, struct name_record *n); struct name_record *find_name(struct name_record *n, - struct nmb_name *name, - int search); + struct nmb_name *name, + int search); struct name_record *find_name_search(struct subnet_record **d, - struct nmb_name *name, - int search, struct in_addr ip); + struct nmb_name *name, + int search, struct in_addr ip); void dump_names(void); void load_netbios_names(void); void remove_netbios_name(struct subnet_record *d, - char *name,int type, enum name_source source, - struct in_addr ip); + char *name,int type, enum name_source source, + struct in_addr ip); struct name_record *add_netbios_entry(struct subnet_record *d, - char *name, int type, int nb_flags, - int ttl, enum name_source source, struct in_addr ip, - BOOL new_only,BOOL wins); -void check_expire_names(time_t t); + char *name, int type, int nb_flags, + int ttl, enum name_source source, struct in_addr ip, + BOOL new_only,BOOL wins); +void expire_names(time_t t); struct name_record *search_for_name(struct subnet_record **d, - struct nmb_name *question, - struct in_addr ip, int Time, int search); + struct nmb_name *question, + struct in_addr ip, int Time, int search); /*The following definitions come from namedbresp.c */ @@ -370,9 +364,8 @@ void add_response_record(struct subnet_record *d, void remove_response_record(struct subnet_record *d, struct response_record *n); struct response_record *make_response_queue_record(enum state_type state, - int id,uint16 fd, int quest_type, - int token, char *name,int type, - enum name_source source, int nb_flags, time_t ttl, + int id,uint16 fd, + int quest_type, char *name,int type, int nb_flags, time_t ttl, int server_type, char *my_name, char *my_comment, BOOL bcast,BOOL recurse, struct in_addr send_ip, struct in_addr reply_to_ip); @@ -382,13 +375,13 @@ struct response_record *find_response_record(struct subnet_record **d, /*The following definitions come from namedbserver.c */ void remove_old_servers(struct work_record *work, time_t t, - BOOL remove_all); + BOOL remove_all); struct server_record *find_server(struct work_record *work, char *name); struct server_record *add_server_entry(struct subnet_record *d, - struct work_record *work, - char *name,int servertype, - int ttl,char *comment, - BOOL replace); + struct work_record *work, + char *name,int servertype, + int ttl,char *comment, + BOOL replace); void expire_servers(time_t t); /*The following definitions come from namedbsubnet.c */ @@ -396,21 +389,19 @@ void expire_servers(time_t t); struct subnet_record *find_subnet(struct in_addr bcast_ip); struct subnet_record *find_req_subnet(struct in_addr ip, BOOL bcast); void add_subnet_interfaces(void); -void add_workgroup_to_subnet(char *group, struct in_addr bcast_ip, - struct in_addr mask_ip); -void add_workgroups_to_subnets(); +void add_my_subnets(char *group); struct subnet_record *add_subnet_entry(struct in_addr bcast_ip, - struct in_addr mask_ip, - char *name, BOOL add, BOOL lmhosts); + struct in_addr mask_ip, + char *name, BOOL add, BOOL lmhosts); void write_browse_list(void); /*The following definitions come from namedbwork.c */ struct work_record *remove_workgroup(struct subnet_record *d, - struct work_record *work, - BOOL remove_all_servers); + struct work_record *work, + BOOL remove_all_servers); struct work_record *find_workgroupstruct(struct subnet_record *d, - fstring name, BOOL add); + fstring name, BOOL add); void dump_workgroups(void); /*The following definitions come from nameelect.c */ @@ -418,14 +409,13 @@ void dump_workgroups(void); void check_master_browser(void); void browser_gone(char *work_name, struct in_addr ip); void send_election(struct subnet_record *d, char *group,uint32 criterion, - int timeup,char *name); + int timeup,char *name); void name_unregister_work(struct subnet_record *d, char *name, int name_type); -void name_register_work(struct subnet_record *d, int token, - char *name, int name_type, enum name_source source, - struct nmb_ip *data, time_t ttl, struct in_addr ip, BOOL bcast); +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, - int remove_type); + int remove_type); void run_elections(void); void process_election(struct packet_struct *p,char *buf); BOOL check_elections(void); @@ -437,20 +427,20 @@ void process_logon_packet(struct packet_struct *p,char *buf,int len); /*The following definitions come from namepacket.c */ void debug_browse_data(char *outbuf, int len); -BOOL initiate_netbios_packet(uint16 id, - int fd,int quest_type,char *name,int name_type, - int nb_flags,BOOL bcast,BOOL recurse, - struct in_addr to_ip); +void initiate_netbios_packet(uint16 *id, + int fd,int quest_type,char *name,int name_type, + int nb_flags,BOOL bcast,BOOL recurse, + struct in_addr to_ip); void reply_netbios_packet(struct packet_struct *p1,int trn_id, - int rcode, int rcv_code, int opcode, BOOL recurse, - struct nmb_name *rr_name,int rr_type,int rr_class,int ttl, - char *data,int len); + int rcode, int rcv_code, int opcode, BOOL recurse, + struct nmb_name *rr_name,int rr_type,int rr_class,int ttl, + char *data,int len); 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, - char *dstname,int src_type,int dest_type, - struct in_addr dest_ip,struct in_addr src_ip); + char *dstname,int src_type,int dest_type, + struct in_addr dest_ip,struct in_addr src_ip); /*The following definitions come from namequery.c */ @@ -463,30 +453,27 @@ BOOL name_query(int fd,char *name,int name_type, /*The following definitions come from nameresp.c */ -void update_name_trn_id(void); void expire_netbios_response_entries(); -void queue_netbios_pkt_wins(struct subnet_record *d, - int fd,int quest_type,enum state_type state, - int token, char *name,int name_type, - enum name_source source, int nb_flags, time_t ttl, - int server_type, char *my_name, char *my_comment, - BOOL bcast,BOOL recurse, - struct in_addr send_ip, struct in_addr reply_to_ip); -void queue_netbios_packet(struct subnet_record *d, - int fd,int quest_type,enum state_type state, - int token, char *name, int name_type, - enum name_source source, int nb_flags, time_t ttl, - int server_type, char *my_name, char *my_comment, - BOOL bcast,BOOL recurse, - struct in_addr send_ip, struct in_addr reply_to_ip); +struct response_record *queue_netbios_pkt_wins(struct subnet_record *d, + int fd,int quest_type,enum state_type state, + char *name,int name_type,int nb_flags, time_t ttl, + int server_type, char *my_name, char *my_comment, + BOOL bcast,BOOL recurse, + struct in_addr send_ip, struct in_addr reply_to_ip); +struct response_record *queue_netbios_packet(struct subnet_record *d, + int fd,int quest_type,enum state_type state,char *name, + int name_type,int nb_flags, time_t ttl, + int server_type, char *my_name, char *my_comment, + BOOL bcast,BOOL recurse, + struct in_addr send_ip, struct in_addr reply_to_ip); /*The following definitions come from nameserv.c */ -void remove_name_entry(struct subnet_record *d, int token, char *name,int type); -void add_my_name_entry(struct subnet_record *d, int token, - char *name,int type,int nb_flags); +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_my_names(void); void remove_my_names(); +void refresh_my_names(time_t t); void query_refresh_names(void); /*The following definitions come from nameservreply.c */ @@ -508,18 +495,13 @@ void reply_name_query(struct packet_struct *p); /*The following definitions come from nameservresp.c */ void debug_state_type(int state); -void response_process(struct in_addr ip, struct subnet_record *d, - struct response_record *n, - int rcode, char *nmb_data, struct nmb_name *q_name, - time_t ttl, BOOL bcast, struct nmb_name *ans_name); void response_netbios_packet(struct packet_struct *p); /*The following definitions come from namework.c */ -void reset_server(struct work_record *work, char *name, int state, struct in_addr ip); +void reset_server(char *name, int state, struct in_addr ip); void tell_become_backup(void); BOOL same_context(struct dgram_packet *dgram); -BOOL listening_name(struct work_record *work, struct nmb_name *n); void process_browse_packet(struct packet_struct *p,char *buf,int len); /*The following definitions come from nmbd.c */ @@ -545,7 +527,7 @@ int main(int argc,char *argv[]); char *getsmbpass(char *pass); void sync_browse_lists(struct subnet_record *d, struct work_record *work, - char *name, int nm_type, struct in_addr ip, BOOL local); + char *name, int nm_type, struct in_addr ip, BOOL local); /*The following definitions come from params.c */ @@ -769,7 +751,6 @@ unsigned int Ucrit_checkPid(int pid); int sys_select(fd_set *fds,struct timeval *tval); int sys_select(fd_set *fds,struct timeval *tval); int sys_unlink(char *fname); -unsigned int sys_random(int max_range); int sys_open(char *fname,int flags,int mode); DIR *sys_opendir(char *dname); int sys_stat(char *fname,struct stat *sbuf); diff --git a/source3/include/smb.h b/source3/include/smb.h index 56ad8cbacd..f5d35d5261 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -380,10 +380,10 @@ typedef struct /* used for server information: client, nameserv and ipc */ struct server_info_struct { - char name[17]; + fstring name; uint32 type; - char comment[50]; - char domain[17]; /* used ONLY in ipc.c NOT namework.c */ + fstring comment; + fstring domain; /* used ONLY in ipc.c NOT namework.c */ BOOL server_added; /* used ONLY in ipc.c NOT namework.c */ }; |