s3-nmbd: move nmbd proto out of main proto.h
authorGünther Deschner <gd@samba.org>
Wed, 18 Aug 2010 13:22:09 +0000 (15:22 +0200)
committerGünther Deschner <gd@samba.org>
Wed, 25 Aug 2010 22:20:28 +0000 (00:20 +0200)
Guenther

30 files changed:
source3/include/proto.h
source3/nmbd/asyncdns.c
source3/nmbd/nmbd.c
source3/nmbd/nmbd.h [new file with mode: 0644]
source3/nmbd/nmbd_become_dmb.c
source3/nmbd/nmbd_become_lmb.c
source3/nmbd/nmbd_browserdb.c
source3/nmbd/nmbd_browsesync.c
source3/nmbd/nmbd_elections.c
source3/nmbd/nmbd_incomingdgrams.c
source3/nmbd/nmbd_incomingrequests.c
source3/nmbd/nmbd_lmhosts.c
source3/nmbd/nmbd_logonnames.c
source3/nmbd/nmbd_mynames.c
source3/nmbd/nmbd_namelistdb.c
source3/nmbd/nmbd_namequery.c
source3/nmbd/nmbd_nameregister.c
source3/nmbd/nmbd_namerelease.c
source3/nmbd/nmbd_nodestatus.c
source3/nmbd/nmbd_packets.c
source3/nmbd/nmbd_processlogon.c
source3/nmbd/nmbd_proto.h [new file with mode: 0644]
source3/nmbd/nmbd_responserecordsdb.c
source3/nmbd/nmbd_sendannounce.c
source3/nmbd/nmbd_serverlistdb.c
source3/nmbd/nmbd_subnetdb.c
source3/nmbd/nmbd_synclists.c
source3/nmbd/nmbd_winsproxy.c
source3/nmbd/nmbd_winsserver.c
source3/nmbd/nmbd_workgroupdb.c

index c1e471886c6bf13445c32a7d26aa095e20c5b7ce..7728af3ff5e4f84bccf81449a416c3dc21585587 100644 (file)
@@ -3235,363 +3235,6 @@ ssize_t vfswrap_llistxattr(struct vfs_handle_struct *handle, const char *path, c
 ssize_t vfswrap_flistxattr(struct vfs_handle_struct *handle, struct files_struct *fsp, char *list, size_t size);
 NTSTATUS vfs_default_init(void);
 
-/* The following definitions come from nmbd/asyncdns.c  */
-
-int asyncdns_fd(void);
-void kill_async_dns_child(void);
-void start_async_dns(void);
-void run_dns_queue(void);
-bool queue_dns_query(struct packet_struct *p,struct nmb_name *question);
-bool queue_dns_query(struct packet_struct *p,struct nmb_name *question);
-void kill_async_dns_child(void);
-
-/* The following definitions come from nmbd/nmbd.c  */
-
-struct event_context *nmbd_event_context(void);
-struct messaging_context *nmbd_messaging_context(void);
-
-/* The following definitions come from nmbd/nmbd_become_dmb.c  */
-
-void add_domain_names(time_t t);
-
-/* The following definitions come from nmbd/nmbd_become_lmb.c  */
-
-void insert_permanent_name_into_unicast( struct subnet_record *subrec, 
-                                                struct nmb_name *nmbname, uint16 nb_type );
-void unbecome_local_master_browser(struct subnet_record *subrec, struct work_record *work,
-                                   bool force_new_election);
-void become_local_master_browser(struct subnet_record *subrec, struct work_record *work);
-void set_workgroup_local_master_browser_name( struct work_record *work, const char *newname);
-
-/* The following definitions come from nmbd/nmbd_browserdb.c  */
-
-void update_browser_death_time( struct browse_cache_record *browc );
-struct browse_cache_record *create_browser_in_lmb_cache( const char *work_name, 
-                                                         const char *browser_name, 
-                                                         struct in_addr ip );
-struct browse_cache_record *find_browser_in_lmb_cache( const char *browser_name );
-void expire_lmb_browsers( time_t t );
-
-/* The following definitions come from nmbd/nmbd_browsesync.c  */
-
-void dmb_expire_and_sync_browser_lists(time_t t);
-void announce_and_sync_with_domain_master_browser( struct subnet_record *subrec,
-                                                   struct work_record *work);
-void collect_all_workgroup_names_from_wins_server(time_t t);
-void sync_all_dmbs(time_t t);
-
-/* The following definitions come from nmbd/nmbd_elections.c  */
-
-void check_master_browser_exists(time_t t);
-void run_elections(time_t t);
-void process_election(struct subnet_record *subrec, struct packet_struct *p, char *buf);
-bool check_elections(void);
-void nmbd_message_election(struct messaging_context *msg,
-                          void *private_data,
-                          uint32_t msg_type,
-                          struct server_id server_id,
-                          DATA_BLOB *data);
-
-/* The following definitions come from nmbd/nmbd_incomingdgrams.c  */
-
-void tell_become_backup(void);
-void process_host_announce(struct subnet_record *subrec, struct packet_struct *p, char *buf);
-void process_workgroup_announce(struct subnet_record *subrec, struct packet_struct *p, char *buf);
-void process_local_master_announce(struct subnet_record *subrec, struct packet_struct *p, char *buf);
-void process_master_browser_announce(struct subnet_record *subrec, 
-                                     struct packet_struct *p,char *buf);
-void process_lm_host_announce(struct subnet_record *subrec, struct packet_struct *p, char *buf, int len);
-void process_get_backup_list_request(struct subnet_record *subrec,
-                                     struct packet_struct *p,char *buf);
-void process_reset_browser(struct subnet_record *subrec,
-                                  struct packet_struct *p,char *buf);
-void process_announce_request(struct subnet_record *subrec, struct packet_struct *p, char *buf);
-void process_lm_announce_request(struct subnet_record *subrec, struct packet_struct *p, char *buf, int len);
-
-/* The following definitions come from nmbd/nmbd_incomingrequests.c  */
-
-void process_name_release_request(struct subnet_record *subrec, 
-                                  struct packet_struct *p);
-void process_name_refresh_request(struct subnet_record *subrec,
-                                  struct packet_struct *p);
-void process_name_registration_request(struct subnet_record *subrec, 
-                                       struct packet_struct *p);
-void process_node_status_request(struct subnet_record *subrec, struct packet_struct *p);
-void process_name_query_request(struct subnet_record *subrec, struct packet_struct *p);
-
-/* The following definitions come from nmbd/nmbd_lmhosts.c  */
-
-void load_lmhosts_file(const char *fname);
-bool find_name_in_lmhosts(struct nmb_name *nmbname, struct name_record **namerecp);
-
-/* The following definitions come from nmbd/nmbd_logonnames.c  */
-
-void add_logon_names(void);
-
-/* The following definitions come from nmbd/nmbd_mynames.c  */
-
-void register_my_workgroup_one_subnet(struct subnet_record *subrec);
-bool register_my_workgroup_and_names(void);
-void release_wins_names(void);
-void refresh_my_names(time_t t);
-
-/* The following definitions come from nmbd/nmbd_namelistdb.c  */
-
-void set_samba_nb_type(void);
-void remove_name_from_namelist(struct subnet_record *subrec, 
-                               struct name_record *namerec );
-struct name_record *find_name_on_subnet(struct subnet_record *subrec,
-                               const struct nmb_name *nmbname,
-                               bool self_only);
-struct name_record *find_name_for_remote_broadcast_subnet(struct nmb_name *nmbname,
-                                               bool self_only);
-void update_name_ttl( struct name_record *namerec, int ttl );
-bool add_name_to_subnet( struct subnet_record *subrec,
-                       const char *name,
-                       int type,
-                       uint16 nb_flags,
-                       int ttl,
-                       enum name_source source,
-                       int num_ips,
-                       struct in_addr *iplist);
-void standard_success_register(struct subnet_record *subrec, 
-                             struct userdata_struct *userdata,
-                             struct nmb_name *nmbname, uint16 nb_flags, int ttl,
-                             struct in_addr registered_ip);
-void standard_fail_register( struct subnet_record   *subrec,
-                             struct nmb_name        *nmbname );
-bool find_ip_in_name_record( struct name_record *namerec, struct in_addr ip );
-void add_ip_to_name_record( struct name_record *namerec, struct in_addr new_ip );
-void remove_ip_from_name_record( struct name_record *namerec,
-                                 struct in_addr      remove_ip );
-void standard_success_release( struct subnet_record   *subrec,
-                               struct userdata_struct *userdata,
-                               struct nmb_name        *nmbname,
-                               struct in_addr          released_ip );
-void expire_names(time_t t);
-void add_samba_names_to_subnet( struct subnet_record *subrec );
-void dump_name_record( struct name_record *namerec, XFILE *fp);
-void dump_all_namelists(void);
-
-/* The following definitions come from nmbd/nmbd_namequery.c  */
-
-bool query_name(struct subnet_record *subrec, const char *name, int type,
-                   query_name_success_function success_fn,
-                   query_name_fail_function fail_fn, 
-                   struct userdata_struct *userdata);
-bool query_name_from_wins_server(struct in_addr ip_to, 
-                   const char *name, int type,
-                   query_name_success_function success_fn,
-                   query_name_fail_function fail_fn, 
-                   struct userdata_struct *userdata);
-
-/* The following definitions come from nmbd/nmbd_nameregister.c  */
-
-void register_name(struct subnet_record *subrec,
-                   const char *name, int type, uint16 nb_flags,
-                   register_name_success_function success_fn,
-                   register_name_fail_function fail_fn,
-                   struct userdata_struct *userdata);
-void wins_refresh_name(struct name_record *namerec);
-
-/* The following definitions come from nmbd/nmbd_namerelease.c  */
-
-void release_name(struct subnet_record *subrec, struct name_record *namerec,
-                 release_name_success_function success_fn,
-                 release_name_fail_function fail_fn,
-                 struct userdata_struct *userdata);
-
-/* The following definitions come from nmbd/nmbd_nodestatus.c  */
-
-bool node_status(struct subnet_record *subrec, struct nmb_name *nmbname,
-                 struct in_addr send_ip, node_status_success_function success_fn, 
-                 node_status_fail_function fail_fn, struct userdata_struct *userdata);
-
-/* The following definitions come from nmbd/nmbd_packets.c  */
-
-uint16 get_nb_flags(char *buf);
-void set_nb_flags(char *buf, uint16 nb_flags);
-struct response_record *queue_register_name( struct subnet_record *subrec,
-                          response_function resp_fn,
-                          timeout_response_function timeout_fn,
-                          register_name_success_function success_fn,
-                          register_name_fail_function fail_fn,
-                          struct userdata_struct *userdata,
-                          struct nmb_name *nmbname,
-                          uint16 nb_flags);
-void queue_wins_refresh(struct nmb_name *nmbname,
-                       response_function resp_fn,
-                       timeout_response_function timeout_fn,
-                       uint16 nb_flags,
-                       struct in_addr refresh_ip,
-                       const char *tag);
-struct response_record *queue_register_multihomed_name( struct subnet_record *subrec,
-                                                       response_function resp_fn,
-                                                       timeout_response_function timeout_fn,
-                                                       register_name_success_function success_fn,
-                                                       register_name_fail_function fail_fn,
-                                                       struct userdata_struct *userdata,
-                                                       struct nmb_name *nmbname,
-                                                       uint16 nb_flags,
-                                                       struct in_addr register_ip,
-                                                       struct in_addr wins_ip);
-struct response_record *queue_release_name( struct subnet_record *subrec,
-                                           response_function resp_fn,
-                                           timeout_response_function timeout_fn,
-                                           release_name_success_function success_fn,
-                                           release_name_fail_function fail_fn,
-                                           struct userdata_struct *userdata,
-                                           struct nmb_name *nmbname,
-                                           uint16 nb_flags,
-                                           struct in_addr release_ip,
-                                           struct in_addr dest_ip);
-struct response_record *queue_query_name( struct subnet_record *subrec,
-                          response_function resp_fn,
-                          timeout_response_function timeout_fn,
-                          query_name_success_function success_fn,
-                          query_name_fail_function fail_fn,
-                          struct userdata_struct *userdata,
-                          struct nmb_name *nmbname);
-struct response_record *queue_query_name_from_wins_server( struct in_addr to_ip,
-                          response_function resp_fn,
-                          timeout_response_function timeout_fn,
-                          query_name_success_function success_fn,
-                          query_name_fail_function fail_fn,
-                          struct userdata_struct *userdata,
-                          struct nmb_name *nmbname);
-struct response_record *queue_node_status( struct subnet_record *subrec,
-                          response_function resp_fn,
-                          timeout_response_function timeout_fn,
-                          node_status_success_function success_fn,
-                          node_status_fail_function fail_fn,
-                          struct userdata_struct *userdata,
-                          struct nmb_name *nmbname,
-                          struct in_addr send_ip);
-void reply_netbios_packet(struct packet_struct *orig_packet,
-                          int rcode, enum netbios_reply_type_code rcv_code, int opcode,
-                          int ttl, char *data,int len);
-void queue_packet(struct packet_struct *packet);
-void run_packet_queue(void);
-void retransmit_or_expire_response_records(time_t t);
-bool listen_for_packets(bool run_election);
-bool send_mailslot(bool unique, const char *mailslot,char *buf, size_t len,
-                   const char *srcname, int src_type,
-                   const char *dstname, int dest_type,
-                   struct in_addr dest_ip,struct in_addr src_ip,
-                  int dest_port);
-
-/* The following definitions come from nmbd/nmbd_processlogon.c  */
-
-bool initialize_nmbd_proxy_logon(void);
-
-void process_logon_packet(struct packet_struct *p, char *buf,int len, 
-                          const char *mailslot);
-
-/* The following definitions come from nmbd/nmbd_responserecordsdb.c  */
-
-void remove_response_record(struct subnet_record *subrec,
-                               struct response_record *rrec);
-struct response_record *make_response_record( struct subnet_record *subrec,
-                                             struct packet_struct *p,
-                                             response_function resp_fn,
-                                             timeout_response_function timeout_fn,
-                                             success_function success_fn,
-                                             fail_function fail_fn,
-                                             struct userdata_struct *userdata);
-struct response_record *find_response_record(struct subnet_record **ppsubrec,
-                               uint16 id);
-bool is_refresh_already_queued(struct subnet_record *subrec, struct name_record *namerec);
-
-/* The following definitions come from nmbd/nmbd_sendannounce.c  */
-
-void send_browser_reset(int reset_type, const char *to_name, int to_type, struct in_addr to_ip);
-void broadcast_announce_request(struct subnet_record *subrec, struct work_record *work);
-void announce_my_server_names(time_t t);
-void announce_my_lm_server_names(time_t t);
-void reset_announce_timer(void);
-void announce_myself_to_domain_master_browser(time_t t);
-void announce_my_servers_removed(void);
-void announce_remote(time_t t);
-void browse_sync_remote(time_t t);
-
-/* The following definitions come from nmbd/nmbd_serverlistdb.c  */
-
-void remove_all_servers(struct work_record *work);
-struct server_record *find_server_in_workgroup(struct work_record *work, const char *name);
-void remove_server_from_workgroup(struct work_record *work, struct server_record *servrec);
-struct server_record *create_server_on_workgroup(struct work_record *work,
-                                                 const char *name,int servertype, 
-                                                 int ttl, const char *comment);
-void update_server_ttl(struct server_record *servrec, int ttl);
-void expire_servers(struct work_record *work, time_t t);
-void write_browse_list_entry(XFILE *fp, const char *name, uint32 rec_type,
-               const char *local_master_browser_name, const char *description);
-void write_browse_list(time_t t, bool force_write);
-
-/* The following definitions come from nmbd/nmbd_subnetdb.c  */
-
-void close_subnet(struct subnet_record *subrec);
-struct subnet_record *make_normal_subnet(const struct interface *iface);
-bool create_subnets(void);
-bool we_are_a_wins_client(void);
-struct subnet_record *get_next_subnet_maybe_unicast(struct subnet_record *subrec);
-struct subnet_record *get_next_subnet_maybe_unicast_or_wins_server(struct subnet_record *subrec);
-
-/* The following definitions come from nmbd/nmbd_synclists.c  */
-
-void sync_browse_lists(struct work_record *work,
-                      char *name, int nm_type, 
-                      struct in_addr ip, bool local, bool servers);
-void sync_check_completion(void);
-
-/* The following definitions come from nmbd/nmbd_winsproxy.c  */
-
-void make_wins_proxy_name_query_request( struct subnet_record *subrec, 
-                                         struct packet_struct *incoming_packet,
-                                         struct nmb_name *question_name);
-
-/* The following definitions come from nmbd/nmbd_winsserver.c  */
-
-struct name_record *find_name_on_wins_subnet(const struct nmb_name *nmbname, bool self_only);
-bool wins_store_changed_namerec(const struct name_record *namerec);
-bool add_name_to_wins_subnet(const struct name_record *namerec);
-bool remove_name_from_wins_namelist(struct name_record *namerec);
-void dump_wins_subnet_namelist(XFILE *fp);
-bool packet_is_for_wins_server(struct packet_struct *packet);
-bool initialise_wins(void);
-void wins_process_name_refresh_request( struct subnet_record *subrec,
-                                        struct packet_struct *p );
-void wins_process_name_registration_request(struct subnet_record *subrec,
-                                            struct packet_struct *p);
-void wins_process_multihomed_name_registration_request( struct subnet_record *subrec,
-                                                        struct packet_struct *p);
-void fetch_all_active_wins_1b_names(void);
-void send_wins_name_query_response(int rcode, struct packet_struct *p, 
-                                          struct name_record *namerec);
-void wins_process_name_query_request(struct subnet_record *subrec, 
-                                     struct packet_struct *p);
-void wins_process_name_release_request(struct subnet_record *subrec,
-                                       struct packet_struct *p);
-void initiate_wins_processing(time_t t);
-void wins_write_name_record(struct name_record *namerec, XFILE *fp);
-void wins_write_database(time_t t, bool background);
-void nmbd_wins_new_entry(struct messaging_context *msg,
-                                       void *private_data,
-                                       uint32_t msg_type,
-                                       struct server_id server_id,
-                                       DATA_BLOB *data);
-
-/* The following definitions come from nmbd/nmbd_workgroupdb.c  */
-
-struct work_record *find_workgroup_on_subnet(struct subnet_record *subrec, 
-                                             const char *name);
-struct work_record *create_workgroup_on_subnet(struct subnet_record *subrec,
-                                               const char *name, int ttl);
-void update_workgroup_ttl(struct work_record *work, int ttl);
-void initiate_myworkgroup_startup(struct subnet_record *subrec, struct work_record *work);
-void dump_workgroups(bool force_write);
-void expire_workgroups_and_servers(time_t t);
-
 /* The following definitions come from param/loadparm.c  */
 
 char *lp_smb_ports(void);
index 2701c96dd7994bcd2635838fcb349599abbf61ab..9e7707b4102c925f2daf3d50c6af09c022c22832 100644 (file)
@@ -18,6 +18,7 @@
    */
 
 #include "includes.h"
+#include "nmbd/nmbd.h"
 
 /***************************************************************************
   Add a DNS result to the name cache.
index 16a4d7d81669e668a2b78574268cc131815b02bc..5678c8e848cf9cc37acfc6dc9a4c494acd031ae0 100644 (file)
@@ -23,6 +23,7 @@
 #include "includes.h"
 #include "popt_common.h"
 #include "librpc/gen_ndr/messaging.h"
+#include "nmbd/nmbd.h"
 
 int ClientNMB       = -1;
 int ClientDGRAM     = -1;
diff --git a/source3/nmbd/nmbd.h b/source3/nmbd/nmbd.h
new file mode 100644 (file)
index 0000000..0e8d12e
--- /dev/null
@@ -0,0 +1,2 @@
+
+#include "nmbd/nmbd_proto.h"
index 337eae85f5b74b261be85bf13f6d66e7a2df7cab..160bcb3c339d6078cf445abd766fbb209fed6759 100644 (file)
@@ -22,6 +22,7 @@
 
 #include "includes.h"
 #include "../librpc/gen_ndr/svcctl.h"
+#include "nmbd/nmbd.h"
 
 extern uint16 samba_nb_type; /* Samba's NetBIOS type. */
 
index 45476f9bfd6b8faa7c505f69998d1805b21a4a3c..ffd92cf0d8ff8f8996f918d14a00e2c4809ac80c 100644 (file)
@@ -21,6 +21,7 @@
 */
 
 #include "includes.h"
+#include "nmbd/nmbd.h"
 #include "../librpc/gen_ndr/svcctl.h"
 
 extern uint16 samba_nb_type; /* Samba's NetBIOS name type. */
index a2793649787411c37c37a89685bcc3f052bd7ce6..b7c99005bbf129ba40d3997beaab51d32b441a7a 100644 (file)
@@ -27,6 +27,7 @@
  */
 
 #include "includes.h"
+#include "nmbd/nmbd.h"
 
 /* -------------------------------------------------------------------------- **
  * Variables...
index 73d953e72693b6ad18dd88df40a1aabdbf7503fe..3dc89b502615a8ae8ac629a881bf8cf2e4c3b6d5 100644 (file)
@@ -21,6 +21,7 @@
 */
 
 #include "includes.h"
+#include "nmbd/nmbd.h"
 
 /* This is our local master browser list database. */
 extern struct browse_cache_record *lmb_browserlist;
index 1ed64f4059f7ce18c42b170e3470a0571c941e69..4c9c9d9151d0ba5a6dad83730f2aa64943ae30a8 100644 (file)
@@ -21,6 +21,7 @@
 */
 
 #include "includes.h"
+#include "nmbd/nmbd.h"
 
 /* Election parameters. */
 extern time_t StartupTime;
index 5216e1a90b5faca09992adb7667ed1324803b2f7..cc657e39625e56826ea63aa1a17c9fea11f72d3a 100644 (file)
@@ -22,6 +22,7 @@
 
 #include "includes.h"
 #include "../librpc/gen_ndr/svcctl.h"
+#include "nmbd/nmbd.h"
 
 extern bool found_lm_clients;
 
index 6d8436d9e38251fd88b1faadd18d11b74c10998e..d0138ddd4a9c215175c7887d1afe76fe984653eb 100644 (file)
@@ -25,6 +25,7 @@
 */
 
 #include "includes.h"
+#include "nmbd/nmbd.h"
 
 /****************************************************************************
 Send a name release response.
index 227d7a3c8d8322eab2883717931ab06738609ab2..c3eb2b58dd4adce164f6accc5b45c1239d3c346b 100644 (file)
@@ -24,6 +24,7 @@
 
 #include "includes.h"
 #include "../libcli/nbt/libnbt.h"
+#include "nmbd/nmbd.h"
 
 /****************************************************************************
 Load a lmhosts file.
index 5f21ea0cd01319f215f2e1ad6e4372483c14cbc7..f99092055bba4c9b02b18c8abc6f1ec1479ded97 100644 (file)
@@ -22,6 +22,7 @@
 
 #include "includes.h"
 #include "../librpc/gen_ndr/svcctl.h"
+#include "nmbd/nmbd.h"
 
 extern uint16 samba_nb_type; /* Samba's NetBIOS type. */
 
index ed48095f2308f50457a5be4ad33b17353f4d1939..e3798507c219766a4e1bbde2bed5250ac298051f 100644 (file)
@@ -21,6 +21,7 @@
 */
 
 #include "includes.h"
+#include "nmbd/nmbd.h"
 
 extern uint16 samba_nb_type; /* Samba's NetBIOS type. */
 
index 6570fd4ec763c5a0f3a1335649cc62a02d235910..9c5d0efde2a983ebb8f02ba2b261950333fdf5d7 100644 (file)
@@ -21,6 +21,7 @@
 */
 
 #include "includes.h"
+#include "nmbd/nmbd.h"
 
 uint16 samba_nb_type = 0; /* samba's NetBIOS name type */
 
index c1c5f5238a6effc7c989d25eb00df9b58f0e07e4..ae50a232987fc2073e6d1c07b6a3b0625b8496e2 100644 (file)
@@ -21,6 +21,7 @@
 */
 
 #include "includes.h"
+#include "nmbd/nmbd.h"
 
 /****************************************************************************
  Deal with a response packet when querying a name.
index d4359aab37d44153881e836231be3dbe2f4e8fc0..71c4751d7c1d0cf27dcc2e37b5c58fd532a325cc 100644 (file)
@@ -21,6 +21,7 @@
 */
 
 #include "includes.h"
+#include "nmbd/nmbd.h"
 
 /* forward declarations */
 static void wins_next_registration(struct response_record *rrec);
index 4be7396f2e3a3c07cc5694204a4c11d5bb8d0497..4f34a458471909c90c85fcb23d0c136d42c41ed9 100644 (file)
@@ -21,6 +21,7 @@
 */
 
 #include "includes.h"
+#include "nmbd/nmbd.h"
 
 /****************************************************************************
  Deal with a response packet when releasing one of our names.
index 168ccf1ad430f4427b6d465371cdf7a42bb3b8f8..1f3e1cf91a03996ea20ffc6b3d36ae3c435db762 100644 (file)
@@ -21,6 +21,7 @@
 */
 
 #include "includes.h"
+#include "nmbd/nmbd.h"
 
 /****************************************************************************
  Deal with a successful node status response.
index 8e46efe2d06a0cab6c6d47a7bc55124b69c61d9f..2dd218aece0b9b721796036cafd6ca8d043aeadd 100644 (file)
@@ -21,6 +21,7 @@
 */
 
 #include "includes.h"
+#include "nmbd/nmbd.h"
 
 extern int ClientNMB;
 extern int ClientDGRAM;
index 607260b230a529367c3fba1681a211de8633fe86..273f3d308a93b44916559cf45cb776fb770de69b 100644 (file)
@@ -29,6 +29,7 @@
 #include "../lib/tsocket/tsocket.h"
 #include "../libcli/security/dom_sid.h"
 #include "secrets.h"
+#include "nmbd/nmbd.h"
 
 struct sam_database_info {
         uint32 index;
diff --git a/source3/nmbd/nmbd_proto.h b/source3/nmbd/nmbd_proto.h
new file mode 100644 (file)
index 0000000..e90a90e
--- /dev/null
@@ -0,0 +1,357 @@
+
+/* The following definitions come from nmbd/asyncdns.c  */
+
+int asyncdns_fd(void);
+void kill_async_dns_child(void);
+void start_async_dns(void);
+void run_dns_queue(void);
+bool queue_dns_query(struct packet_struct *p,struct nmb_name *question);
+bool queue_dns_query(struct packet_struct *p,struct nmb_name *question);
+void kill_async_dns_child(void);
+
+/* The following definitions come from nmbd/nmbd.c  */
+
+struct event_context *nmbd_event_context(void);
+struct messaging_context *nmbd_messaging_context(void);
+
+/* The following definitions come from nmbd/nmbd_become_dmb.c  */
+
+void add_domain_names(time_t t);
+
+/* The following definitions come from nmbd/nmbd_become_lmb.c  */
+
+void insert_permanent_name_into_unicast( struct subnet_record *subrec,
+                                                struct nmb_name *nmbname, uint16 nb_type );
+void unbecome_local_master_browser(struct subnet_record *subrec, struct work_record *work,
+                                   bool force_new_election);
+void become_local_master_browser(struct subnet_record *subrec, struct work_record *work);
+void set_workgroup_local_master_browser_name( struct work_record *work, const char *newname);
+
+/* The following definitions come from nmbd/nmbd_browserdb.c  */
+
+void update_browser_death_time( struct browse_cache_record *browc );
+struct browse_cache_record *create_browser_in_lmb_cache( const char *work_name,
+                                                         const char *browser_name,
+                                                         struct in_addr ip );
+struct browse_cache_record *find_browser_in_lmb_cache( const char *browser_name );
+void expire_lmb_browsers( time_t t );
+
+/* The following definitions come from nmbd/nmbd_browsesync.c  */
+
+void dmb_expire_and_sync_browser_lists(time_t t);
+void announce_and_sync_with_domain_master_browser( struct subnet_record *subrec,
+                                                   struct work_record *work);
+void collect_all_workgroup_names_from_wins_server(time_t t);
+void sync_all_dmbs(time_t t);
+
+/* The following definitions come from nmbd/nmbd_elections.c  */
+
+void check_master_browser_exists(time_t t);
+void run_elections(time_t t);
+void process_election(struct subnet_record *subrec, struct packet_struct *p, char *buf);
+bool check_elections(void);
+void nmbd_message_election(struct messaging_context *msg,
+                          void *private_data,
+                          uint32_t msg_type,
+                          struct server_id server_id,
+                          DATA_BLOB *data);
+
+/* The following definitions come from nmbd/nmbd_incomingdgrams.c  */
+
+void tell_become_backup(void);
+void process_host_announce(struct subnet_record *subrec, struct packet_struct *p, char *buf);
+void process_workgroup_announce(struct subnet_record *subrec, struct packet_struct *p, char *buf);
+void process_local_master_announce(struct subnet_record *subrec, struct packet_struct *p, char *buf);
+void process_master_browser_announce(struct subnet_record *subrec,
+                                     struct packet_struct *p,char *buf);
+void process_lm_host_announce(struct subnet_record *subrec, struct packet_struct *p, char *buf, int len);
+void process_get_backup_list_request(struct subnet_record *subrec,
+                                     struct packet_struct *p,char *buf);
+void process_reset_browser(struct subnet_record *subrec,
+                                  struct packet_struct *p,char *buf);
+void process_announce_request(struct subnet_record *subrec, struct packet_struct *p, char *buf);
+void process_lm_announce_request(struct subnet_record *subrec, struct packet_struct *p, char *buf, int len);
+
+/* The following definitions come from nmbd/nmbd_incomingrequests.c  */
+
+void process_name_release_request(struct subnet_record *subrec,
+                                  struct packet_struct *p);
+void process_name_refresh_request(struct subnet_record *subrec,
+                                  struct packet_struct *p);
+void process_name_registration_request(struct subnet_record *subrec,
+                                       struct packet_struct *p);
+void process_node_status_request(struct subnet_record *subrec, struct packet_struct *p);
+void process_name_query_request(struct subnet_record *subrec, struct packet_struct *p);
+
+/* The following definitions come from nmbd/nmbd_lmhosts.c  */
+
+void load_lmhosts_file(const char *fname);
+bool find_name_in_lmhosts(struct nmb_name *nmbname, struct name_record **namerecp);
+
+/* The following definitions come from nmbd/nmbd_logonnames.c  */
+
+void add_logon_names(void);
+
+/* The following definitions come from nmbd/nmbd_mynames.c  */
+
+void register_my_workgroup_one_subnet(struct subnet_record *subrec);
+bool register_my_workgroup_and_names(void);
+void release_wins_names(void);
+void refresh_my_names(time_t t);
+
+/* The following definitions come from nmbd/nmbd_namelistdb.c  */
+
+void set_samba_nb_type(void);
+void remove_name_from_namelist(struct subnet_record *subrec,
+                               struct name_record *namerec );
+struct name_record *find_name_on_subnet(struct subnet_record *subrec,
+                               const struct nmb_name *nmbname,
+                               bool self_only);
+struct name_record *find_name_for_remote_broadcast_subnet(struct nmb_name *nmbname,
+                                               bool self_only);
+void update_name_ttl( struct name_record *namerec, int ttl );
+bool add_name_to_subnet( struct subnet_record *subrec,
+                       const char *name,
+                       int type,
+                       uint16 nb_flags,
+                       int ttl,
+                       enum name_source source,
+                       int num_ips,
+                       struct in_addr *iplist);
+void standard_success_register(struct subnet_record *subrec,
+                             struct userdata_struct *userdata,
+                             struct nmb_name *nmbname, uint16 nb_flags, int ttl,
+                             struct in_addr registered_ip);
+void standard_fail_register( struct subnet_record   *subrec,
+                             struct nmb_name        *nmbname );
+bool find_ip_in_name_record( struct name_record *namerec, struct in_addr ip );
+void add_ip_to_name_record( struct name_record *namerec, struct in_addr new_ip );
+void remove_ip_from_name_record( struct name_record *namerec,
+                                 struct in_addr      remove_ip );
+void standard_success_release( struct subnet_record   *subrec,
+                               struct userdata_struct *userdata,
+                               struct nmb_name        *nmbname,
+                               struct in_addr          released_ip );
+void expire_names(time_t t);
+void add_samba_names_to_subnet( struct subnet_record *subrec );
+void dump_name_record( struct name_record *namerec, XFILE *fp);
+void dump_all_namelists(void);
+
+/* The following definitions come from nmbd/nmbd_namequery.c  */
+
+bool query_name(struct subnet_record *subrec, const char *name, int type,
+                   query_name_success_function success_fn,
+                   query_name_fail_function fail_fn,
+                   struct userdata_struct *userdata);
+bool query_name_from_wins_server(struct in_addr ip_to,
+                   const char *name, int type,
+                   query_name_success_function success_fn,
+                   query_name_fail_function fail_fn,
+                   struct userdata_struct *userdata);
+
+/* The following definitions come from nmbd/nmbd_nameregister.c  */
+
+void register_name(struct subnet_record *subrec,
+                   const char *name, int type, uint16 nb_flags,
+                   register_name_success_function success_fn,
+                   register_name_fail_function fail_fn,
+                   struct userdata_struct *userdata);
+void wins_refresh_name(struct name_record *namerec);
+
+/* The following definitions come from nmbd/nmbd_namerelease.c  */
+
+void release_name(struct subnet_record *subrec, struct name_record *namerec,
+                 release_name_success_function success_fn,
+                 release_name_fail_function fail_fn,
+                 struct userdata_struct *userdata);
+
+/* The following definitions come from nmbd/nmbd_nodestatus.c  */
+
+bool node_status(struct subnet_record *subrec, struct nmb_name *nmbname,
+                 struct in_addr send_ip, node_status_success_function success_fn,
+                 node_status_fail_function fail_fn, struct userdata_struct *userdata);
+
+/* The following definitions come from nmbd/nmbd_packets.c  */
+
+uint16 get_nb_flags(char *buf);
+void set_nb_flags(char *buf, uint16 nb_flags);
+struct response_record *queue_register_name( struct subnet_record *subrec,
+                          response_function resp_fn,
+                          timeout_response_function timeout_fn,
+                          register_name_success_function success_fn,
+                          register_name_fail_function fail_fn,
+                          struct userdata_struct *userdata,
+                          struct nmb_name *nmbname,
+                          uint16 nb_flags);
+void queue_wins_refresh(struct nmb_name *nmbname,
+                       response_function resp_fn,
+                       timeout_response_function timeout_fn,
+                       uint16 nb_flags,
+                       struct in_addr refresh_ip,
+                       const char *tag);
+struct response_record *queue_register_multihomed_name( struct subnet_record *subrec,
+                                                       response_function resp_fn,
+                                                       timeout_response_function timeout_fn,
+                                                       register_name_success_function success_fn,
+                                                       register_name_fail_function fail_fn,
+                                                       struct userdata_struct *userdata,
+                                                       struct nmb_name *nmbname,
+                                                       uint16 nb_flags,
+                                                       struct in_addr register_ip,
+                                                       struct in_addr wins_ip);
+struct response_record *queue_release_name( struct subnet_record *subrec,
+                                           response_function resp_fn,
+                                           timeout_response_function timeout_fn,
+                                           release_name_success_function success_fn,
+                                           release_name_fail_function fail_fn,
+                                           struct userdata_struct *userdata,
+                                           struct nmb_name *nmbname,
+                                           uint16 nb_flags,
+                                           struct in_addr release_ip,
+                                           struct in_addr dest_ip);
+struct response_record *queue_query_name( struct subnet_record *subrec,
+                          response_function resp_fn,
+                          timeout_response_function timeout_fn,
+                          query_name_success_function success_fn,
+                          query_name_fail_function fail_fn,
+                          struct userdata_struct *userdata,
+                          struct nmb_name *nmbname);
+struct response_record *queue_query_name_from_wins_server( struct in_addr to_ip,
+                          response_function resp_fn,
+                          timeout_response_function timeout_fn,
+                          query_name_success_function success_fn,
+                          query_name_fail_function fail_fn,
+                          struct userdata_struct *userdata,
+                          struct nmb_name *nmbname);
+struct response_record *queue_node_status( struct subnet_record *subrec,
+                          response_function resp_fn,
+                          timeout_response_function timeout_fn,
+                          node_status_success_function success_fn,
+                          node_status_fail_function fail_fn,
+                          struct userdata_struct *userdata,
+                          struct nmb_name *nmbname,
+                          struct in_addr send_ip);
+void reply_netbios_packet(struct packet_struct *orig_packet,
+                          int rcode, enum netbios_reply_type_code rcv_code, int opcode,
+                          int ttl, char *data,int len);
+void queue_packet(struct packet_struct *packet);
+void run_packet_queue(void);
+void retransmit_or_expire_response_records(time_t t);
+bool listen_for_packets(bool run_election);
+bool send_mailslot(bool unique, const char *mailslot,char *buf, size_t len,
+                   const char *srcname, int src_type,
+                   const char *dstname, int dest_type,
+                   struct in_addr dest_ip,struct in_addr src_ip,
+                  int dest_port);
+
+/* The following definitions come from nmbd/nmbd_processlogon.c  */
+
+bool initialize_nmbd_proxy_logon(void);
+
+void process_logon_packet(struct packet_struct *p, char *buf,int len,
+                          const char *mailslot);
+
+/* The following definitions come from nmbd/nmbd_responserecordsdb.c  */
+
+void remove_response_record(struct subnet_record *subrec,
+                               struct response_record *rrec);
+struct response_record *make_response_record( struct subnet_record *subrec,
+                                             struct packet_struct *p,
+                                             response_function resp_fn,
+                                             timeout_response_function timeout_fn,
+                                             success_function success_fn,
+                                             fail_function fail_fn,
+                                             struct userdata_struct *userdata);
+struct response_record *find_response_record(struct subnet_record **ppsubrec,
+                               uint16 id);
+bool is_refresh_already_queued(struct subnet_record *subrec, struct name_record *namerec);
+
+/* The following definitions come from nmbd/nmbd_sendannounce.c  */
+
+void send_browser_reset(int reset_type, const char *to_name, int to_type, struct in_addr to_ip);
+void broadcast_announce_request(struct subnet_record *subrec, struct work_record *work);
+void announce_my_server_names(time_t t);
+void announce_my_lm_server_names(time_t t);
+void reset_announce_timer(void);
+void announce_myself_to_domain_master_browser(time_t t);
+void announce_my_servers_removed(void);
+void announce_remote(time_t t);
+void browse_sync_remote(time_t t);
+
+/* The following definitions come from nmbd/nmbd_serverlistdb.c  */
+
+void remove_all_servers(struct work_record *work);
+struct server_record *find_server_in_workgroup(struct work_record *work, const char *name);
+void remove_server_from_workgroup(struct work_record *work, struct server_record *servrec);
+struct server_record *create_server_on_workgroup(struct work_record *work,
+                                                 const char *name,int servertype,
+                                                 int ttl, const char *comment);
+void update_server_ttl(struct server_record *servrec, int ttl);
+void expire_servers(struct work_record *work, time_t t);
+void write_browse_list_entry(XFILE *fp, const char *name, uint32 rec_type,
+               const char *local_master_browser_name, const char *description);
+void write_browse_list(time_t t, bool force_write);
+
+/* The following definitions come from nmbd/nmbd_subnetdb.c  */
+
+void close_subnet(struct subnet_record *subrec);
+struct subnet_record *make_normal_subnet(const struct interface *iface);
+bool create_subnets(void);
+bool we_are_a_wins_client(void);
+struct subnet_record *get_next_subnet_maybe_unicast(struct subnet_record *subrec);
+struct subnet_record *get_next_subnet_maybe_unicast_or_wins_server(struct subnet_record *subrec);
+
+/* The following definitions come from nmbd/nmbd_synclists.c  */
+
+void sync_browse_lists(struct work_record *work,
+                      char *name, int nm_type,
+                      struct in_addr ip, bool local, bool servers);
+void sync_check_completion(void);
+
+/* The following definitions come from nmbd/nmbd_winsproxy.c  */
+
+void make_wins_proxy_name_query_request( struct subnet_record *subrec,
+                                         struct packet_struct *incoming_packet,
+                                         struct nmb_name *question_name);
+
+/* The following definitions come from nmbd/nmbd_winsserver.c  */
+
+struct name_record *find_name_on_wins_subnet(const struct nmb_name *nmbname, bool self_only);
+bool wins_store_changed_namerec(const struct name_record *namerec);
+bool add_name_to_wins_subnet(const struct name_record *namerec);
+bool remove_name_from_wins_namelist(struct name_record *namerec);
+void dump_wins_subnet_namelist(XFILE *fp);
+bool packet_is_for_wins_server(struct packet_struct *packet);
+bool initialise_wins(void);
+void wins_process_name_refresh_request( struct subnet_record *subrec,
+                                        struct packet_struct *p );
+void wins_process_name_registration_request(struct subnet_record *subrec,
+                                            struct packet_struct *p);
+void wins_process_multihomed_name_registration_request( struct subnet_record *subrec,
+                                                        struct packet_struct *p);
+void fetch_all_active_wins_1b_names(void);
+void send_wins_name_query_response(int rcode, struct packet_struct *p,
+                                          struct name_record *namerec);
+void wins_process_name_query_request(struct subnet_record *subrec,
+                                     struct packet_struct *p);
+void wins_process_name_release_request(struct subnet_record *subrec,
+                                       struct packet_struct *p);
+void initiate_wins_processing(time_t t);
+void wins_write_name_record(struct name_record *namerec, XFILE *fp);
+void wins_write_database(time_t t, bool background);
+void nmbd_wins_new_entry(struct messaging_context *msg,
+                                       void *private_data,
+                                       uint32_t msg_type,
+                                       struct server_id server_id,
+                                       DATA_BLOB *data);
+
+/* The following definitions come from nmbd/nmbd_workgroupdb.c  */
+
+struct work_record *find_workgroup_on_subnet(struct subnet_record *subrec,
+                                             const char *name);
+struct work_record *create_workgroup_on_subnet(struct subnet_record *subrec,
+                                               const char *name, int ttl);
+void update_workgroup_ttl(struct work_record *work, int ttl);
+void initiate_myworkgroup_startup(struct subnet_record *subrec, struct work_record *work);
+void dump_workgroups(bool force_write);
+void expire_workgroups_and_servers(time_t t);
index b042fb41edbe640d4609d234a45ca02b87d48316..78d4cc95d90b3946822e3e1c978827056dd3e195 100644 (file)
@@ -21,6 +21,7 @@
 */
 
 #include "includes.h"
+#include "nmbd/nmbd.h"
 
 int num_response_packets = 0;
 
index 4140040b2b8ccc0e1b9f6206ed4a4c16545fe7eb..e04e1f6fe3c3320971404bf733e7c404297fd2a7 100644 (file)
@@ -25,6 +25,7 @@
 
 #include "includes.h"
 #include "../librpc/gen_ndr/svcctl.h"
+#include "nmbd/nmbd.h"
 
 extern int  updatecount;
 extern bool found_lm_clients;
index f9b55d298d4397e94338ce2b28249f1d970b6f43..acb5310a6406dbb8f9e3f878c6c9d58469b4b475 100644 (file)
@@ -22,6 +22,7 @@
 
 #include "includes.h"
 #include "../librpc/gen_ndr/svcctl.h"
+#include "nmbd/nmbd.h"
 
 int updatecount = 0;
 
index 4fb142509462b44225eaf5c5c1a749de49779f13..3a60038dcdcec3933b8da843e7e8bc857053fe9e 100644 (file)
@@ -23,6 +23,7 @@
 */
 
 #include "includes.h"
+#include "nmbd/nmbd.h"
 
 extern int global_nmb_port;
 
index d1844450227f3b9c1d372eff0bacc6992fb0a955..5c139b31afb3723ef938f4a6bb44a6ffdece7639 100644 (file)
@@ -28,6 +28,7 @@
 
 #include "includes.h"
 #include "../librpc/gen_ndr/svcctl.h"
+#include "nmbd/nmbd.h"
 
 struct sync_record {
        struct sync_record *next, *prev;
index ff80c15ffff4ecbf9c29312918e848e0c1837c37..66725fc9b962a494598ea4fe50771a0df6c57694 100644 (file)
@@ -20,6 +20,7 @@
 */
 
 #include "includes.h"
+#include "nmbd/nmbd.h"
 
 /****************************************************************************
 Function called when the name lookup succeeded.
index be2c6a24438129d6a1fe93ed0ade91368727b31b..4232afc18c68ce4d8005d0303ae0342dbcfb2383 100644 (file)
@@ -21,6 +21,7 @@
 */
 
 #include "includes.h"
+#include "nmbd/nmbd.h"
 
 #define WINS_LIST "wins.dat"
 #define WINS_VERSION 1
index 17cd21b58c512eb6e0cc359e57a2ea30145f9d35..5ce10e64d46e8434b439252f30f2aa80aeb72f76 100644 (file)
@@ -22,6 +22,7 @@
 
 #include "includes.h"
 #include "../librpc/gen_ndr/svcctl.h"
+#include "nmbd/nmbd.h"
 
 extern uint16 samba_nb_type;