summaryrefslogtreecommitdiff
path: root/source3/include
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>1996-06-05 15:16:09 +0000
committerAndrew Tridgell <tridge@samba.org>1996-06-05 15:16:09 +0000
commite38afbf38210b8cf30c5b13dc5ea96a6dda433f7 (patch)
tree06281d362a0c4d1cb96713613b2f541c0dea491e /source3/include
parent526cc39e432682afe57a1eb2607e1a3f261f4e8f (diff)
downloadsamba-e38afbf38210b8cf30c5b13dc5ea96a6dda433f7.tar.gz
samba-e38afbf38210b8cf30c5b13dc5ea96a6dda433f7.tar.bz2
samba-e38afbf38210b8cf30c5b13dc5ea96a6dda433f7.zip
- changed some debug levels in clientutil.c
- added dir_check_ftype() to clean up the file type checking a bit - added check for libc version >= 5 for setfsuid() for Linux - moved the AM_MASTER() and related macros to nameserv.h - added proper defines for the various netbios announce types - don't call the announce_backup() code, as I'm pretty sure its wrong it sent ANN_GetBackupListReq packets as broadcasts, they are supposed to be used only by clients to the master browser to find a list of available backup servers to remote a netserverenum to, I don't think nmbd should ever send one. - fixed a bug in the browse list writing - minor debug cleanups - put in the code to discard our own broadcasts (it won't work for multi-homed hosts though) - changed ELECTION_VERSION to 1 so we can be beaten by a NT 3.51 server by lowering the os level. - only do sync_browse_lists() if we are the master browser, otherwise we'll cause network overload - don't call tell_become_backup() as it appears to be badly broken, it should only be used when the machine being told has its MAINTAIN_LIST to to auto. Not calling it does no great harm anyway - fix a nasty bug where becomebackup was confused with reset browser! - make setbuffer() not get caught by the auto protototypes (This used to be commit cfbad9b08242962f41595273de08a7293fe432b1)
Diffstat (limited to 'source3/include')
-rw-r--r--source3/include/includes.h2
-rw-r--r--source3/include/nameserv.h18
-rw-r--r--source3/include/proto.h22
3 files changed, 33 insertions, 9 deletions
diff --git a/source3/include/includes.h b/source3/include/includes.h
index ad65bcc607..5b29b27547 100644
--- a/source3/include/includes.h
+++ b/source3/include/includes.h
@@ -223,7 +223,9 @@ Here come some platform specific sections
#define USE_SETSID
#define HAVE_BZERO
#define HAVE_MEMMOVE
+#if _LINUX_C_LIB_VERSION_MAJOR >= 5
#define USE_SETFS
+#endif
#ifdef SHADOW_PWD
#ifndef crypt
#define crypt pw_encrypt
diff --git a/source3/include/nameserv.h b/source3/include/nameserv.h
index 51f5ec8479..32ee625fa4 100644
--- a/source3/include/nameserv.h
+++ b/source3/include/nameserv.h
@@ -22,7 +22,7 @@
/* NTAS uses 2, NT uses 1, WfWg uses 0 */
#define MAINTAIN_LIST 2
-#define ELECTION_VERSION 2
+#define ELECTION_VERSION 1
#define MAX_DGRAM_SIZE (80*18+64)
#define MIN_DGRAM_SIZE 12
@@ -255,3 +255,19 @@ struct packet_struct
};
+#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 ANN_HostAnnouncement 1
+#define ANN_AnnouncementRequest 2
+#define ANN_Election 8
+#define ANN_GetBackupListReq 9
+#define ANN_GetBackupListResp 10
+#define ANN_BecomeBackup 11
+#define ANN_DomainAnnouncement 12
+#define ANN_MasterAnnouncement 13
+#define ANN_ResetBrowserState 14
+#define ANN_LocalMasterAnnouncement 15
+
diff --git a/source3/include/proto.h b/source3/include/proto.h
index face79d255..a3f522b274 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -51,6 +51,7 @@ BOOL dptr_fill(char *buf1,unsigned int key);
BOOL dptr_zero(char *buf);
void *dptr_fetch(char *buf,int *num);
void *dptr_fetch_lanman2(char *params,int dptr_num);
+BOOL dir_check_ftype(int cnum,int mode,struct stat *st,int dirtype);
BOOL get_dir_entry(int cnum,char *mask,int dirtype,char *fname,int *size,int *mode,time_t *date,BOOL check_descend);
void *OpenDir(char *name);
void CloseDir(void *p);
@@ -99,21 +100,26 @@ int reply_sendstrt(char *inbuf,char *outbuf);
int reply_sendtxt(char *inbuf,char *outbuf);
int reply_sendend(char *inbuf,char *outbuf);
void announce_request(struct work_record *work, struct in_addr ip);
-void do_announce_request(char *info, char *to_name, int announce_type, int from,
+void do_announce_request(char *info, char *to_name, int announce_type,
+ int from,
int to, struct in_addr dest_ip);
void announce_backup(void);
void announce_host(void);
void announce_master(void);
-struct work_record *remove_workgroup(struct domain_record *d, struct work_record *work);
+struct work_record *remove_workgroup(struct domain_record *d,
+ struct work_record *work);
void expire_browse_cache(time_t t);
struct work_record *find_workgroupstruct(struct domain_record *d, fstring name, BOOL add);
struct domain_record *find_domain(struct in_addr source_ip);
-struct domain_record *add_domain_entry(struct in_addr source_ip, struct in_addr source_mask,
+struct domain_record *add_domain_entry(struct in_addr source_ip,
+ struct in_addr source_mask,
char *name, BOOL add);
struct browse_cache_record *add_browser_entry(char *name, int type, char *wg,
time_t ttl, struct in_addr ip);
-struct server_record *add_server_entry(struct domain_record *d, struct work_record *work,
- char *name,int servertype, int ttl,char *comment,
+struct server_record *add_server_entry(struct domain_record *d,
+ struct work_record *work,
+ char *name,int servertype,
+ int ttl,char *comment,
BOOL replace);
void write_browse_list(void);
void expire_servers(time_t t);
@@ -137,7 +143,6 @@ void reply_netbios_packet(struct packet_struct *p1,int trn_id,int rcode,int opco
char *data,int len);
uint16 initiate_netbios_packet(int fd,int quest_type,char *name,int name_type,
int nb_flags,BOOL bcast,BOOL recurse,struct in_addr to_ip);
-void send_name_reg(void);
void queue_netbios_pkt_wins(int fd,int quest_type,enum cmd_type cmd,
char *name,int name_type,int nb_flags,
BOOL bcast,BOOL recurse,struct in_addr to_ip);
@@ -162,6 +167,7 @@ struct name_record *add_netbios_entry(char *name, int type, int nb_flags, int tt
void remove_name_entry(char *name,int type);
void add_name_entry(char *name,int type,int nb_flags);
void add_my_names(void);
+void refresh_my_names(time_t t);
void expire_names(time_t t);
void response_name_release(struct packet_struct *p);
void reply_name_release(struct packet_struct *p);
@@ -174,7 +180,8 @@ void process_nmb(struct packet_struct *p);
void reset_server(char *name, int state, struct in_addr ip);
void tell_become_backup(void);
void do_browser_lists(void);
-void sync_server(enum cmd_type cmd, char *serv_name, char *work_name, int name_type,
+void sync_server(enum cmd_type cmd, char *serv_name, char *work_name,
+ int name_type,
struct in_addr ip);
void update_from_reg(char *name, int type, struct in_addr ip);
void add_my_domains(void);
@@ -464,7 +471,6 @@ BOOL yesno(char *p);
char *fgets_slash(char *s2,int maxlen,FILE *f);
int set_filelen(int fd, long len);
int byte_checksum(char *buf,int len);
-void setbuffer(FILE *f,char *buf,int bufsize);
char *dirname_dos(char *path,char *buf);
void *Realloc(void *p,int size);
void Abort(void );