diff options
author | Andrew Tridgell <tridge@samba.org> | 2000-01-03 03:17:16 +0000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2000-01-03 03:17:16 +0000 |
commit | 574788039f53fada4769731ea3fafe9710417b71 (patch) | |
tree | 98e454727d3fe01fc12b921cb7b3fe0b9e2ce8ad /source3/include | |
parent | c0ad729de6a09cb6334f49ca31d606c215f30632 (diff) | |
download | samba-574788039f53fada4769731ea3fafe9710417b71.tar.gz samba-574788039f53fada4769731ea3fafe9710417b71.tar.bz2 samba-574788039f53fada4769731ea3fafe9710417b71.zip |
added the unexpected packet database (unexpected.tdb)
this means "nmblookup -S" now always works, even with broken servers
the database stores all unexpected replies and these can be accessed
by any client.
while doing this I cleaned up a couple of functions, and put in place
a better trn_id generator. in most places the code got quite a bit
simpler due to the addition of simple helper functions.
I haven't yet put the code in to take advantage of this for pdc
replies - that will be next. Jeremys pdc finding code will then work :)
(This used to be commit 280e6359d36c9bc8dcded302f15c3a1db8e3feeb)
Diffstat (limited to 'source3/include')
-rw-r--r-- | source3/include/local.h | 1 | ||||
-rw-r--r-- | source3/include/proto.h | 19 |
2 files changed, 15 insertions, 5 deletions
diff --git a/source3/include/local.h b/source3/include/local.h index 9da39fe991..bd75d4e385 100644 --- a/source3/include/local.h +++ b/source3/include/local.h @@ -138,6 +138,7 @@ #define NMBD_MAX_TTL (24*60*60) #define LPQ_LOCK_TIMEOUT (5) #define NMBD_INTERFACES_RELOAD (120) +#define NMBD_UNEXPECTED_TIMEOUT (15) /* the following are in milliseconds */ #define LOCK_RETRY_TIMEOUT (100) diff --git a/source3/include/proto.h b/source3/include/proto.h index 251f051452..2c2bcd71c1 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -600,10 +600,10 @@ BOOL deal_with_creds(uchar sess_key[8], /*The following definitions come from libsmb/namequery.c */ BOOL name_status(int fd,char *name,int name_type,BOOL recurse, - struct in_addr to_ip,char *master,char *rname, - void (*fn)(struct packet_struct *)); -struct in_addr *name_query(int fd,const char *name,int name_type, BOOL bcast,BOOL recurse, - struct in_addr to_ip, int *count, void (*fn)(struct packet_struct *)); + struct in_addr to_ip,char *master,char *rname); +struct in_addr *name_query(int fd,const char *name,int name_type, + BOOL bcast,BOOL recurse, + struct in_addr to_ip, int *count); FILE *startlmhosts(char *fname); BOOL getlmhostsent( FILE *fp, pstring name, int *name_type, struct in_addr *ipaddr); void endlmhosts(FILE *fp); @@ -618,11 +618,15 @@ void debug_nmb_packet(struct packet_struct *p); char *nmb_namestr(struct nmb_name *n); struct packet_struct *copy_packet(struct packet_struct *packet); void free_packet(struct packet_struct *packet); +struct packet_struct *parse_packet(char *buf,int length, + enum packet_type packet_type); struct packet_struct *read_packet(int fd,enum packet_type packet_type); void make_nmb_name( struct nmb_name *n, const char *name, int type, const char *this_scope ); BOOL nmb_name_equal(struct nmb_name *n1, struct nmb_name *n2); +int build_packet(char *buf, struct packet_struct *p); BOOL send_packet(struct packet_struct *p); struct packet_struct *receive_packet(int fd,enum packet_type type,int t); +struct packet_struct *receive_reply_packet(int fd, int t, int trn_id); void sort_query_replies(char *data, int n, struct in_addr ip); /*The following definitions come from libsmb/nterr.c */ @@ -674,6 +678,12 @@ BOOL make_oem_passwd_hash(char data[516], const char *passwd, uchar old_pw_hash[ char *smb_errstr(char *inbuf); +/*The following definitions come from libsmb/unexpected.c */ + +void unexpected_packet(struct packet_struct *p); +void clear_unexpected(time_t t); +struct packet_struct *receive_unexpected_137(int trn_id); + /*The following definitions come from locking/locking.c */ BOOL is_locked(files_struct *fsp,connection_struct *conn, @@ -697,7 +707,6 @@ BOOL set_share_mode(files_struct *fsp, uint16 port, uint16 op_type); BOOL remove_share_oplock(files_struct *fsp); BOOL downgrade_share_oplock(files_struct *fsp); BOOL modify_share_mode(files_struct *fsp, int new_mode, uint16 new_oplock); -int traverse_fn(TDB_CONTEXT *tdb, TDB_DATA kbuf, TDB_DATA dbuf); int share_mode_forall(void (*fn)(share_mode_entry *, char *)); /*The following definitions come from nmbd/asyncdns.c */ |