summaryrefslogtreecommitdiff
path: root/source3/include
diff options
context:
space:
mode:
authorSamba Release Account <samba-bugs@samba.org>1996-08-01 17:49:40 +0000
committerSamba Release Account <samba-bugs@samba.org>1996-08-01 17:49:40 +0000
commit3ffb30e8be5bcddca9d0489e1993085a4995c3af (patch)
treea36a093e5ede9021bc01ca5d50cae3d82ac3bbea /source3/include
parent9bf446124b5ad991e071f92eeabcbb838eb9f50b (diff)
downloadsamba-3ffb30e8be5bcddca9d0489e1993085a4995c3af.tar.gz
samba-3ffb30e8be5bcddca9d0489e1993085a4995c3af.tar.bz2
samba-3ffb30e8be5bcddca9d0489e1993085a4995c3af.zip
local_only NetServerEnum syncs can now be issued.
bug spotted in nameservresp.c - arguments to test subnet the response is received on (same_net()) were the wrong way round (ccm@shentel.net) samba was adding WORKGROUP(1e) as a unique not a group name: fixed this bug in reply_name_status() and reply_name_query(): WINS entries weren't being looked up. name status reply adds local SELF entries to WINS SELF entries: some SELF entries are only added locally, while others are only added via WINS. name status needs to have both, combined. a sync will only occur when an ANN_LocalMasterAnnouncement is received, NOT an ANN_HostAnnouncement or an ANN_DomainAnnouncement. when samba is a member of a workgroup, it looks for (using a wins server) and announces to its domain master. NAME_QUERY_ANNOUNCE_HOST - yet another 'state' - has been created to do this: do the name query on the wins server and send the announce host to the answer to this query. jeremy @ vantive wrote the original code to do this, which used the name_query() function. i'm trying to avoid name_query: it times out and generally messes things up, but using queue_netbios_packet() and queue_netbios_pkt_wins() is... not intuitive? lkcl with help from jra (This used to be commit 6e932e4bae8b46e7ff4a55a75484bad78308336a)
Diffstat (limited to 'source3/include')
-rw-r--r--source3/include/nameserv.h25
-rw-r--r--source3/include/proto.h20
2 files changed, 33 insertions, 12 deletions
diff --git a/source3/include/nameserv.h b/source3/include/nameserv.h
index 7a97097e78..582378e183 100644
--- a/source3/include/nameserv.h
+++ b/source3/include/nameserv.h
@@ -48,10 +48,10 @@
#define NB_ACTIVE 0x04
#define NB_CONFL 0x08
#define NB_DEREG 0x10
-#define NB_BFLAG 0x00
-#define NB_PFLAG 0x20
-#define NB_MFLAG 0x40
-#define NB__FLAG 0x60
+#define NB_BFLAG 0x00 /* broadcast node type */
+#define NB_PFLAG 0x20 /* point-to-point node type */
+#define NB_MFLAG 0x40 /* mixed bcast & p-p node type */
+#define NB_HFLAG 0x60 /* microsoft 'hybrid' node type */
#define NB_FLGMSK 0x60
#define REFRESH_TIME (15*60)
@@ -68,7 +68,7 @@
#define NAME_BFLAG(p) (((p) & NB_FLGMSK) == NB_BFLAG)
#define NAME_PFLAG(p) (((p) & NB_FLGMSK) == NB_PFLAG)
#define NAME_MFLAG(p) (((p) & NB_FLGMSK) == NB_MFLAG)
-#define NAME__FLAG(p) (((p) & NB_FLGMSK) == NB__FLAG)
+#define NAME_HFLAG(p) (((p) & NB_FLGMSK) == NB_HFLAG)
/* server type identifiers */
#define AM_MASTER(work) (work->ServerType & SV_TYPE_MASTER_BROWSER)
@@ -99,14 +99,16 @@ enum master_state
enum state_type
{
- NAME_STATUS_PDC_SRV_CHK,
+ NAME_STATUS_DOM_SRV_CHK,
NAME_STATUS_SRV_CHK,
NAME_REGISTER_CHALLENGE,
NAME_REGISTER,
NAME_RELEASE,
NAME_QUERY_CONFIRM,
- NAME_QUERY_SYNC,
- NAME_QUERY_PDC_SRV_CHK,
+ 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
@@ -147,6 +149,7 @@ struct browse_cache_record
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 */
@@ -190,6 +193,8 @@ struct work_record
};
/* initiated name queries recorded in this list to track any responses... */
+/* sadly, we need to group everything together. i suppose that if this
+ gets unwieldy, then a union ought to be considered. oh for c++... */
struct response_record
{
struct response_record *next;
@@ -204,6 +209,10 @@ struct response_record
int nb_flags;
time_t ttl;
+ int server_type;
+ fstring my_name;
+ fstring my_comment;
+
BOOL bcast;
BOOL recurse;
struct in_addr send_ip;
diff --git a/source3/include/proto.h b/source3/include/proto.h
index 60b8eed59a..10f2bc3325 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -295,6 +295,11 @@ void sync_server(enum state_type state, char *serv_name, char *work_name,
int name_type,
struct in_addr ip);
void announce_backup(void);
+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 *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);
@@ -305,11 +310,15 @@ void announce_master(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);
+ time_t ttl, struct in_addr ip, BOOL local);
void do_browser_lists(void);
+/*The following definitions come from namedb.c */
+
+
/*The following definitions come from namedbname.c */
+void set_samba_nb_type(void);
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);
@@ -342,6 +351,7 @@ void remove_response_record(struct subnet_record *d,
struct response_record *make_response_queue_record(enum state_type state,
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);
struct response_record *find_response_record(struct subnet_record **d,
@@ -432,13 +442,15 @@ void expire_netbios_response_entries();
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,
- BOOL bcast,BOOL recurse,
- struct in_addr send_ip, struct in_addr reply_to_ip);
+ 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 */
@@ -502,7 +514,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);
+ char *name, int nm_type, struct in_addr ip, BOOL local);
/*The following definitions come from params.c */