source: vendor/current/source3/nmbd/nmbd_proto.h

Last change on this file was 988, checked in by Silvan Scherrer, 9 years ago

Samba Server: update vendor to version 4.4.3

File size: 18.3 KB
Line 
1/*
2 * Unix SMB/CIFS implementation.
3 * NBT netbios routines and daemon - version 2
4 *
5 * Copyright (C) Andrew Tridgell 1994-1998
6 * Copyright (C) Jeremy Allison 1994-2005
7 * Copyright (C) Luke Kenneth Casson Leighton 1994-1998
8 * Copyright (C) John H Terpstra 1995-1998
9 * Copyright (C) Christopher R. Hertel 1998
10 * Copyright (C) Jim McDonough <jmcd@us.ibm.com> 2002
11 * Copyright (C) Jelmer Vernooij 2002,2003
12 *
13 * This program is free software; you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License as published by
15 * the Free Software Foundation; either version 3 of the License, or
16 * (at your option) any later version.
17 *
18 * This program is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU General Public License for more details.
22 *
23 * You should have received a copy of the GNU General Public License
24 * along with this program. If not, see <http://www.gnu.org/licenses/>.
25 */
26
27/* The following definitions come from nmbd/asyncdns.c */
28
29int asyncdns_fd(void);
30void kill_async_dns_child(void);
31void start_async_dns(struct messaging_context *msg);
32void run_dns_queue(struct messaging_context *msg);
33bool queue_dns_query(struct packet_struct *p,struct nmb_name *question);
34bool queue_dns_query(struct packet_struct *p,struct nmb_name *question);
35void kill_async_dns_child(void);
36
37/* The following definitions come from nmbd/nmbd.c */
38
39struct tevent_context *nmbd_event_context(void);
40
41/* The following definitions come from nmbd/nmbd_become_dmb.c */
42
43void add_domain_names(time_t t);
44
45/* The following definitions come from nmbd/nmbd_become_lmb.c */
46
47void insert_permanent_name_into_unicast( struct subnet_record *subrec,
48 struct nmb_name *nmbname, uint16_t nb_type );
49void unbecome_local_master_browser(struct subnet_record *subrec, struct work_record *work,
50 bool force_new_election);
51void become_local_master_browser(struct subnet_record *subrec, struct work_record *work);
52void set_workgroup_local_master_browser_name( struct work_record *work, const char *newname);
53
54/* The following definitions come from nmbd/nmbd_browserdb.c */
55
56void update_browser_death_time( struct browse_cache_record *browc );
57struct browse_cache_record *create_browser_in_lmb_cache( const char *work_name,
58 const char *browser_name,
59 struct in_addr ip );
60struct browse_cache_record *find_browser_in_lmb_cache( const char *browser_name );
61void expire_lmb_browsers( time_t t );
62
63/* The following definitions come from nmbd/nmbd_browsesync.c */
64
65void dmb_expire_and_sync_browser_lists(time_t t);
66void announce_and_sync_with_domain_master_browser( struct subnet_record *subrec,
67 struct work_record *work);
68void collect_all_workgroup_names_from_wins_server(time_t t);
69void sync_all_dmbs(time_t t);
70
71/* The following definitions come from nmbd/nmbd_elections.c */
72
73void check_master_browser_exists(time_t t);
74void run_elections(time_t t);
75void process_election(struct subnet_record *subrec, struct packet_struct *p, const char *buf);
76bool check_elections(void);
77void nmbd_message_election(struct messaging_context *msg,
78 void *private_data,
79 uint32_t msg_type,
80 struct server_id server_id,
81 DATA_BLOB *data);
82
83/* The following definitions come from nmbd/nmbd_incomingdgrams.c */
84
85void tell_become_backup(void);
86void process_host_announce(struct subnet_record *subrec, struct packet_struct *p, const char *buf);
87void process_workgroup_announce(struct subnet_record *subrec, struct packet_struct *p, const char *buf);
88void process_local_master_announce(struct subnet_record *subrec, struct packet_struct *p, const char *buf);
89void process_master_browser_announce(struct subnet_record *subrec,
90 struct packet_struct *p,const char *buf);
91void process_lm_host_announce(struct subnet_record *subrec, struct packet_struct *p, const char *buf, int len);
92void process_get_backup_list_request(struct subnet_record *subrec,
93 struct packet_struct *p,const char *buf);
94void process_reset_browser(struct subnet_record *subrec,
95 struct packet_struct *p,const char *buf);
96void process_announce_request(struct subnet_record *subrec, struct packet_struct *p, const char *buf);
97void process_lm_announce_request(struct subnet_record *subrec, struct packet_struct *p, const char *buf, int len);
98
99/* The following definitions come from nmbd/nmbd_incomingrequests.c */
100
101void process_name_release_request(struct subnet_record *subrec,
102 struct packet_struct *p);
103void process_name_refresh_request(struct subnet_record *subrec,
104 struct packet_struct *p);
105void process_name_registration_request(struct subnet_record *subrec,
106 struct packet_struct *p);
107void process_node_status_request(struct subnet_record *subrec, struct packet_struct *p);
108void process_name_query_request(struct subnet_record *subrec, struct packet_struct *p);
109
110/* The following definitions come from nmbd/nmbd_lmhosts.c */
111
112void load_lmhosts_file(const char *fname);
113bool find_name_in_lmhosts(struct nmb_name *nmbname, struct name_record **namerecp);
114
115/* The following definitions come from nmbd/nmbd_logonnames.c */
116
117void add_logon_names(void);
118
119/* The following definitions come from nmbd/nmbd_mynames.c */
120
121void register_my_workgroup_one_subnet(struct subnet_record *subrec);
122bool register_my_workgroup_and_names(void);
123void release_wins_names(void);
124void refresh_my_names(time_t t);
125
126/* The following definitions come from nmbd/nmbd_namelistdb.c */
127
128void set_samba_nb_type(void);
129void remove_name_from_namelist(struct subnet_record *subrec,
130 struct name_record *namerec );
131struct name_record *find_name_on_subnet(struct subnet_record *subrec,
132 const struct nmb_name *nmbname,
133 bool self_only);
134struct name_record *find_name_for_remote_broadcast_subnet(struct nmb_name *nmbname,
135 bool self_only);
136void update_name_ttl( struct name_record *namerec, int ttl );
137bool add_name_to_subnet( struct subnet_record *subrec,
138 const char *name,
139 int type,
140 uint16_t nb_flags,
141 int ttl,
142 enum name_source source,
143 int num_ips,
144 struct in_addr *iplist);
145void standard_success_register(struct subnet_record *subrec,
146 struct userdata_struct *userdata,
147 struct nmb_name *nmbname, uint16_t nb_flags, int ttl,
148 struct in_addr registered_ip);
149void standard_fail_register( struct subnet_record *subrec,
150 struct nmb_name *nmbname );
151bool find_ip_in_name_record( struct name_record *namerec, struct in_addr ip );
152void add_ip_to_name_record( struct name_record *namerec, struct in_addr new_ip );
153void remove_ip_from_name_record( struct name_record *namerec,
154 struct in_addr remove_ip );
155void standard_success_release( struct subnet_record *subrec,
156 struct userdata_struct *userdata,
157 struct nmb_name *nmbname,
158 struct in_addr released_ip );
159void expire_names(time_t t);
160void add_samba_names_to_subnet( struct subnet_record *subrec );
161void dump_name_record( struct name_record *namerec, XFILE *fp);
162void dump_all_namelists(void);
163
164/* The following definitions come from nmbd/nmbd_namequery.c */
165
166bool query_name(struct subnet_record *subrec, const char *name, int type,
167 query_name_success_function success_fn,
168 query_name_fail_function fail_fn,
169 struct userdata_struct *userdata);
170bool query_name_from_wins_server(struct in_addr ip_to,
171 const char *name, int type,
172 query_name_success_function success_fn,
173 query_name_fail_function fail_fn,
174 struct userdata_struct *userdata);
175
176/* The following definitions come from nmbd/nmbd_nameregister.c */
177
178void register_name(struct subnet_record *subrec,
179 const char *name, int type, uint16_t nb_flags,
180 register_name_success_function success_fn,
181 register_name_fail_function fail_fn,
182 struct userdata_struct *userdata);
183void wins_refresh_name(struct name_record *namerec);
184
185/* The following definitions come from nmbd/nmbd_namerelease.c */
186
187void release_name(struct subnet_record *subrec, struct name_record *namerec,
188 release_name_success_function success_fn,
189 release_name_fail_function fail_fn,
190 struct userdata_struct *userdata);
191
192/* The following definitions come from nmbd/nmbd_nodestatus.c */
193
194bool node_status(struct subnet_record *subrec, struct nmb_name *nmbname,
195 struct in_addr send_ip, node_status_success_function success_fn,
196 node_status_fail_function fail_fn, struct userdata_struct *userdata);
197
198/* The following definitions come from nmbd/nmbd_packets.c */
199
200bool nmbd_init_packet_server(void);
201
202uint16_t get_nb_flags(char *buf);
203void set_nb_flags(char *buf, uint16_t nb_flags);
204struct response_record *queue_register_name( struct subnet_record *subrec,
205 response_function resp_fn,
206 timeout_response_function timeout_fn,
207 register_name_success_function success_fn,
208 register_name_fail_function fail_fn,
209 struct userdata_struct *userdata,
210 struct nmb_name *nmbname,
211 uint16_t nb_flags);
212void queue_wins_refresh(struct nmb_name *nmbname,
213 response_function resp_fn,
214 timeout_response_function timeout_fn,
215 uint16_t nb_flags,
216 struct in_addr refresh_ip,
217 const char *tag);
218struct response_record *queue_register_multihomed_name( struct subnet_record *subrec,
219 response_function resp_fn,
220 timeout_response_function timeout_fn,
221 register_name_success_function success_fn,
222 register_name_fail_function fail_fn,
223 struct userdata_struct *userdata,
224 struct nmb_name *nmbname,
225 uint16_t nb_flags,
226 struct in_addr register_ip,
227 struct in_addr wins_ip);
228struct response_record *queue_release_name( struct subnet_record *subrec,
229 response_function resp_fn,
230 timeout_response_function timeout_fn,
231 release_name_success_function success_fn,
232 release_name_fail_function fail_fn,
233 struct userdata_struct *userdata,
234 struct nmb_name *nmbname,
235 uint16_t nb_flags,
236 struct in_addr release_ip,
237 struct in_addr dest_ip);
238struct response_record *queue_query_name( struct subnet_record *subrec,
239 response_function resp_fn,
240 timeout_response_function timeout_fn,
241 query_name_success_function success_fn,
242 query_name_fail_function fail_fn,
243 struct userdata_struct *userdata,
244 struct nmb_name *nmbname);
245struct response_record *queue_query_name_from_wins_server( struct in_addr to_ip,
246 response_function resp_fn,
247 timeout_response_function timeout_fn,
248 query_name_success_function success_fn,
249 query_name_fail_function fail_fn,
250 struct userdata_struct *userdata,
251 struct nmb_name *nmbname);
252struct response_record *queue_node_status( struct subnet_record *subrec,
253 response_function resp_fn,
254 timeout_response_function timeout_fn,
255 node_status_success_function success_fn,
256 node_status_fail_function fail_fn,
257 struct userdata_struct *userdata,
258 struct nmb_name *nmbname,
259 struct in_addr send_ip);
260void reply_netbios_packet(struct packet_struct *orig_packet,
261 int rcode, enum netbios_reply_type_code rcv_code, int opcode,
262 int ttl, char *data,int len);
263void queue_packet(struct packet_struct *packet);
264void run_packet_queue(void);
265void retransmit_or_expire_response_records(time_t t);
266bool listen_for_packets(struct messaging_context *msg, bool run_election);
267bool send_mailslot(bool unique, const char *mailslot,char *buf, size_t len,
268 const char *srcname, int src_type,
269 const char *dstname, int dest_type,
270 struct in_addr dest_ip,struct in_addr src_ip,
271 int dest_port);
272
273/* The following definitions come from nmbd/nmbd_processlogon.c */
274
275bool initialize_nmbd_proxy_logon(void);
276
277void process_logon_packet(struct packet_struct *p, const char *buf,int len,
278 const char *mailslot);
279
280/* The following definitions come from nmbd/nmbd_responserecordsdb.c */
281
282void remove_response_record(struct subnet_record *subrec,
283 struct response_record *rrec);
284struct response_record *make_response_record( struct subnet_record *subrec,
285 struct packet_struct *p,
286 response_function resp_fn,
287 timeout_response_function timeout_fn,
288 success_function success_fn,
289 fail_function fail_fn,
290 struct userdata_struct *userdata);
291struct response_record *find_response_record(struct subnet_record **ppsubrec,
292 uint16_t id);
293bool is_refresh_already_queued(struct subnet_record *subrec, struct name_record *namerec);
294
295/* The following definitions come from nmbd/nmbd_sendannounce.c */
296
297void send_browser_reset(int reset_type, const char *to_name, int to_type, struct in_addr to_ip);
298void broadcast_announce_request(struct subnet_record *subrec, struct work_record *work);
299void announce_my_server_names(time_t t);
300void announce_my_lm_server_names(time_t t);
301void reset_announce_timer(void);
302void announce_myself_to_domain_master_browser(time_t t);
303void announce_my_servers_removed(void);
304void announce_remote(time_t t);
305void browse_sync_remote(time_t t);
306
307/* The following definitions come from nmbd/nmbd_serverlistdb.c */
308
309void remove_all_servers(struct work_record *work);
310struct server_record *find_server_in_workgroup(struct work_record *work, const char *name);
311void remove_server_from_workgroup(struct work_record *work, struct server_record *servrec);
312struct server_record *create_server_on_workgroup(struct work_record *work,
313 const char *name,int servertype,
314 int ttl, const char *comment);
315void update_server_ttl(struct server_record *servrec, int ttl);
316void expire_servers(struct work_record *work, time_t t);
317void write_browse_list_entry(XFILE *fp, const char *name, uint32_t rec_type,
318 const char *local_master_browser_name, const char *description);
319void write_browse_list(time_t t, bool force_write);
320
321/* The following definitions come from nmbd/nmbd_subnetdb.c */
322
323void close_subnet(struct subnet_record *subrec);
324struct subnet_record *make_normal_subnet(const struct interface *iface);
325bool create_subnets(void);
326bool we_are_a_wins_client(void);
327struct subnet_record *get_next_subnet_maybe_unicast(struct subnet_record *subrec);
328struct subnet_record *get_next_subnet_maybe_unicast_or_wins_server(struct subnet_record *subrec);
329
330/* The following definitions come from nmbd/nmbd_synclists.c */
331
332void sync_browse_lists(struct work_record *work,
333 char *name, int nm_type,
334 struct in_addr ip, bool local, bool servers);
335void sync_check_completion(void);
336
337/* The following definitions come from nmbd/nmbd_winsproxy.c */
338
339void make_wins_proxy_name_query_request( struct subnet_record *subrec,
340 struct packet_struct *incoming_packet,
341 struct nmb_name *question_name);
342
343/* The following definitions come from nmbd/nmbd_winsserver.c */
344
345struct name_record *find_name_on_wins_subnet(const struct nmb_name *nmbname, bool self_only);
346bool wins_store_changed_namerec(const struct name_record *namerec);
347bool add_name_to_wins_subnet(const struct name_record *namerec);
348bool remove_name_from_wins_namelist(struct name_record *namerec);
349void dump_wins_subnet_namelist(XFILE *fp);
350bool packet_is_for_wins_server(struct packet_struct *packet);
351bool initialise_wins(void);
352void wins_process_name_refresh_request( struct subnet_record *subrec,
353 struct packet_struct *p );
354void wins_process_name_registration_request(struct subnet_record *subrec,
355 struct packet_struct *p);
356void wins_process_multihomed_name_registration_request( struct subnet_record *subrec,
357 struct packet_struct *p);
358void fetch_all_active_wins_1b_names(void);
359void send_wins_name_query_response(int rcode, struct packet_struct *p,
360 struct name_record *namerec);
361void wins_process_name_query_request(struct subnet_record *subrec,
362 struct packet_struct *p);
363void wins_process_name_release_request(struct subnet_record *subrec,
364 struct packet_struct *p);
365void initiate_wins_processing(time_t t);
366void wins_write_name_record(struct name_record *namerec, XFILE *fp);
367void wins_write_database(time_t t, bool background);
368void nmbd_wins_new_entry(struct messaging_context *msg,
369 void *private_data,
370 uint32_t msg_type,
371 struct server_id server_id,
372 DATA_BLOB *data);
373
374/* The following definitions come from nmbd/nmbd_workgroupdb.c */
375
376struct work_record *find_workgroup_on_subnet(struct subnet_record *subrec,
377 const char *name);
378struct work_record *create_workgroup_on_subnet(struct subnet_record *subrec,
379 const char *name, int ttl);
380void update_workgroup_ttl(struct work_record *work, int ttl);
381void initiate_myworkgroup_startup(struct subnet_record *subrec, struct work_record *work);
382void dump_workgroups(bool force_write);
383void expire_workgroups_and_servers(time_t t);
Note: See TracBrowser for help on using the repository browser.