s3-dcerpc: add server helpers for gssapi auth
[Samba.git] / source3 / nmbd / nmbd_proto.h
blobe90a90ee7f1806b01b195172571ec876db206eaa
2 /* The following definitions come from nmbd/asyncdns.c */
4 int asyncdns_fd(void);
5 void kill_async_dns_child(void);
6 void start_async_dns(void);
7 void run_dns_queue(void);
8 bool queue_dns_query(struct packet_struct *p,struct nmb_name *question);
9 bool queue_dns_query(struct packet_struct *p,struct nmb_name *question);
10 void kill_async_dns_child(void);
12 /* The following definitions come from nmbd/nmbd.c */
14 struct event_context *nmbd_event_context(void);
15 struct messaging_context *nmbd_messaging_context(void);
17 /* The following definitions come from nmbd/nmbd_become_dmb.c */
19 void add_domain_names(time_t t);
21 /* The following definitions come from nmbd/nmbd_become_lmb.c */
23 void insert_permanent_name_into_unicast( struct subnet_record *subrec,
24 struct nmb_name *nmbname, uint16 nb_type );
25 void unbecome_local_master_browser(struct subnet_record *subrec, struct work_record *work,
26 bool force_new_election);
27 void become_local_master_browser(struct subnet_record *subrec, struct work_record *work);
28 void set_workgroup_local_master_browser_name( struct work_record *work, const char *newname);
30 /* The following definitions come from nmbd/nmbd_browserdb.c */
32 void update_browser_death_time( struct browse_cache_record *browc );
33 struct browse_cache_record *create_browser_in_lmb_cache( const char *work_name,
34 const char *browser_name,
35 struct in_addr ip );
36 struct browse_cache_record *find_browser_in_lmb_cache( const char *browser_name );
37 void expire_lmb_browsers( time_t t );
39 /* The following definitions come from nmbd/nmbd_browsesync.c */
41 void dmb_expire_and_sync_browser_lists(time_t t);
42 void announce_and_sync_with_domain_master_browser( struct subnet_record *subrec,
43 struct work_record *work);
44 void collect_all_workgroup_names_from_wins_server(time_t t);
45 void sync_all_dmbs(time_t t);
47 /* The following definitions come from nmbd/nmbd_elections.c */
49 void check_master_browser_exists(time_t t);
50 void run_elections(time_t t);
51 void process_election(struct subnet_record *subrec, struct packet_struct *p, char *buf);
52 bool check_elections(void);
53 void nmbd_message_election(struct messaging_context *msg,
54 void *private_data,
55 uint32_t msg_type,
56 struct server_id server_id,
57 DATA_BLOB *data);
59 /* The following definitions come from nmbd/nmbd_incomingdgrams.c */
61 void tell_become_backup(void);
62 void process_host_announce(struct subnet_record *subrec, struct packet_struct *p, char *buf);
63 void process_workgroup_announce(struct subnet_record *subrec, struct packet_struct *p, char *buf);
64 void process_local_master_announce(struct subnet_record *subrec, struct packet_struct *p, char *buf);
65 void process_master_browser_announce(struct subnet_record *subrec,
66 struct packet_struct *p,char *buf);
67 void process_lm_host_announce(struct subnet_record *subrec, struct packet_struct *p, char *buf, int len);
68 void process_get_backup_list_request(struct subnet_record *subrec,
69 struct packet_struct *p,char *buf);
70 void process_reset_browser(struct subnet_record *subrec,
71 struct packet_struct *p,char *buf);
72 void process_announce_request(struct subnet_record *subrec, struct packet_struct *p, char *buf);
73 void process_lm_announce_request(struct subnet_record *subrec, struct packet_struct *p, char *buf, int len);
75 /* The following definitions come from nmbd/nmbd_incomingrequests.c */
77 void process_name_release_request(struct subnet_record *subrec,
78 struct packet_struct *p);
79 void process_name_refresh_request(struct subnet_record *subrec,
80 struct packet_struct *p);
81 void process_name_registration_request(struct subnet_record *subrec,
82 struct packet_struct *p);
83 void process_node_status_request(struct subnet_record *subrec, struct packet_struct *p);
84 void process_name_query_request(struct subnet_record *subrec, struct packet_struct *p);
86 /* The following definitions come from nmbd/nmbd_lmhosts.c */
88 void load_lmhosts_file(const char *fname);
89 bool find_name_in_lmhosts(struct nmb_name *nmbname, struct name_record **namerecp);
91 /* The following definitions come from nmbd/nmbd_logonnames.c */
93 void add_logon_names(void);
95 /* The following definitions come from nmbd/nmbd_mynames.c */
97 void register_my_workgroup_one_subnet(struct subnet_record *subrec);
98 bool register_my_workgroup_and_names(void);
99 void release_wins_names(void);
100 void refresh_my_names(time_t t);
102 /* The following definitions come from nmbd/nmbd_namelistdb.c */
104 void set_samba_nb_type(void);
105 void remove_name_from_namelist(struct subnet_record *subrec,
106 struct name_record *namerec );
107 struct name_record *find_name_on_subnet(struct subnet_record *subrec,
108 const struct nmb_name *nmbname,
109 bool self_only);
110 struct name_record *find_name_for_remote_broadcast_subnet(struct nmb_name *nmbname,
111 bool self_only);
112 void update_name_ttl( struct name_record *namerec, int ttl );
113 bool add_name_to_subnet( struct subnet_record *subrec,
114 const char *name,
115 int type,
116 uint16 nb_flags,
117 int ttl,
118 enum name_source source,
119 int num_ips,
120 struct in_addr *iplist);
121 void standard_success_register(struct subnet_record *subrec,
122 struct userdata_struct *userdata,
123 struct nmb_name *nmbname, uint16 nb_flags, int ttl,
124 struct in_addr registered_ip);
125 void standard_fail_register( struct subnet_record *subrec,
126 struct nmb_name *nmbname );
127 bool find_ip_in_name_record( struct name_record *namerec, struct in_addr ip );
128 void add_ip_to_name_record( struct name_record *namerec, struct in_addr new_ip );
129 void remove_ip_from_name_record( struct name_record *namerec,
130 struct in_addr remove_ip );
131 void standard_success_release( struct subnet_record *subrec,
132 struct userdata_struct *userdata,
133 struct nmb_name *nmbname,
134 struct in_addr released_ip );
135 void expire_names(time_t t);
136 void add_samba_names_to_subnet( struct subnet_record *subrec );
137 void dump_name_record( struct name_record *namerec, XFILE *fp);
138 void dump_all_namelists(void);
140 /* The following definitions come from nmbd/nmbd_namequery.c */
142 bool query_name(struct subnet_record *subrec, const char *name, int type,
143 query_name_success_function success_fn,
144 query_name_fail_function fail_fn,
145 struct userdata_struct *userdata);
146 bool query_name_from_wins_server(struct in_addr ip_to,
147 const char *name, int type,
148 query_name_success_function success_fn,
149 query_name_fail_function fail_fn,
150 struct userdata_struct *userdata);
152 /* The following definitions come from nmbd/nmbd_nameregister.c */
154 void register_name(struct subnet_record *subrec,
155 const char *name, int type, uint16 nb_flags,
156 register_name_success_function success_fn,
157 register_name_fail_function fail_fn,
158 struct userdata_struct *userdata);
159 void wins_refresh_name(struct name_record *namerec);
161 /* The following definitions come from nmbd/nmbd_namerelease.c */
163 void release_name(struct subnet_record *subrec, struct name_record *namerec,
164 release_name_success_function success_fn,
165 release_name_fail_function fail_fn,
166 struct userdata_struct *userdata);
168 /* The following definitions come from nmbd/nmbd_nodestatus.c */
170 bool node_status(struct subnet_record *subrec, struct nmb_name *nmbname,
171 struct in_addr send_ip, node_status_success_function success_fn,
172 node_status_fail_function fail_fn, struct userdata_struct *userdata);
174 /* The following definitions come from nmbd/nmbd_packets.c */
176 uint16 get_nb_flags(char *buf);
177 void set_nb_flags(char *buf, uint16 nb_flags);
178 struct response_record *queue_register_name( struct subnet_record *subrec,
179 response_function resp_fn,
180 timeout_response_function timeout_fn,
181 register_name_success_function success_fn,
182 register_name_fail_function fail_fn,
183 struct userdata_struct *userdata,
184 struct nmb_name *nmbname,
185 uint16 nb_flags);
186 void queue_wins_refresh(struct nmb_name *nmbname,
187 response_function resp_fn,
188 timeout_response_function timeout_fn,
189 uint16 nb_flags,
190 struct in_addr refresh_ip,
191 const char *tag);
192 struct response_record *queue_register_multihomed_name( struct subnet_record *subrec,
193 response_function resp_fn,
194 timeout_response_function timeout_fn,
195 register_name_success_function success_fn,
196 register_name_fail_function fail_fn,
197 struct userdata_struct *userdata,
198 struct nmb_name *nmbname,
199 uint16 nb_flags,
200 struct in_addr register_ip,
201 struct in_addr wins_ip);
202 struct response_record *queue_release_name( struct subnet_record *subrec,
203 response_function resp_fn,
204 timeout_response_function timeout_fn,
205 release_name_success_function success_fn,
206 release_name_fail_function fail_fn,
207 struct userdata_struct *userdata,
208 struct nmb_name *nmbname,
209 uint16 nb_flags,
210 struct in_addr release_ip,
211 struct in_addr dest_ip);
212 struct response_record *queue_query_name( struct subnet_record *subrec,
213 response_function resp_fn,
214 timeout_response_function timeout_fn,
215 query_name_success_function success_fn,
216 query_name_fail_function fail_fn,
217 struct userdata_struct *userdata,
218 struct nmb_name *nmbname);
219 struct response_record *queue_query_name_from_wins_server( struct in_addr to_ip,
220 response_function resp_fn,
221 timeout_response_function timeout_fn,
222 query_name_success_function success_fn,
223 query_name_fail_function fail_fn,
224 struct userdata_struct *userdata,
225 struct nmb_name *nmbname);
226 struct response_record *queue_node_status( struct subnet_record *subrec,
227 response_function resp_fn,
228 timeout_response_function timeout_fn,
229 node_status_success_function success_fn,
230 node_status_fail_function fail_fn,
231 struct userdata_struct *userdata,
232 struct nmb_name *nmbname,
233 struct in_addr send_ip);
234 void reply_netbios_packet(struct packet_struct *orig_packet,
235 int rcode, enum netbios_reply_type_code rcv_code, int opcode,
236 int ttl, char *data,int len);
237 void queue_packet(struct packet_struct *packet);
238 void run_packet_queue(void);
239 void retransmit_or_expire_response_records(time_t t);
240 bool listen_for_packets(bool run_election);
241 bool send_mailslot(bool unique, const char *mailslot,char *buf, size_t len,
242 const char *srcname, int src_type,
243 const char *dstname, int dest_type,
244 struct in_addr dest_ip,struct in_addr src_ip,
245 int dest_port);
247 /* The following definitions come from nmbd/nmbd_processlogon.c */
249 bool initialize_nmbd_proxy_logon(void);
251 void process_logon_packet(struct packet_struct *p, char *buf,int len,
252 const char *mailslot);
254 /* The following definitions come from nmbd/nmbd_responserecordsdb.c */
256 void remove_response_record(struct subnet_record *subrec,
257 struct response_record *rrec);
258 struct response_record *make_response_record( struct subnet_record *subrec,
259 struct packet_struct *p,
260 response_function resp_fn,
261 timeout_response_function timeout_fn,
262 success_function success_fn,
263 fail_function fail_fn,
264 struct userdata_struct *userdata);
265 struct response_record *find_response_record(struct subnet_record **ppsubrec,
266 uint16 id);
267 bool is_refresh_already_queued(struct subnet_record *subrec, struct name_record *namerec);
269 /* The following definitions come from nmbd/nmbd_sendannounce.c */
271 void send_browser_reset(int reset_type, const char *to_name, int to_type, struct in_addr to_ip);
272 void broadcast_announce_request(struct subnet_record *subrec, struct work_record *work);
273 void announce_my_server_names(time_t t);
274 void announce_my_lm_server_names(time_t t);
275 void reset_announce_timer(void);
276 void announce_myself_to_domain_master_browser(time_t t);
277 void announce_my_servers_removed(void);
278 void announce_remote(time_t t);
279 void browse_sync_remote(time_t t);
281 /* The following definitions come from nmbd/nmbd_serverlistdb.c */
283 void remove_all_servers(struct work_record *work);
284 struct server_record *find_server_in_workgroup(struct work_record *work, const char *name);
285 void remove_server_from_workgroup(struct work_record *work, struct server_record *servrec);
286 struct server_record *create_server_on_workgroup(struct work_record *work,
287 const char *name,int servertype,
288 int ttl, const char *comment);
289 void update_server_ttl(struct server_record *servrec, int ttl);
290 void expire_servers(struct work_record *work, time_t t);
291 void write_browse_list_entry(XFILE *fp, const char *name, uint32 rec_type,
292 const char *local_master_browser_name, const char *description);
293 void write_browse_list(time_t t, bool force_write);
295 /* The following definitions come from nmbd/nmbd_subnetdb.c */
297 void close_subnet(struct subnet_record *subrec);
298 struct subnet_record *make_normal_subnet(const struct interface *iface);
299 bool create_subnets(void);
300 bool we_are_a_wins_client(void);
301 struct subnet_record *get_next_subnet_maybe_unicast(struct subnet_record *subrec);
302 struct subnet_record *get_next_subnet_maybe_unicast_or_wins_server(struct subnet_record *subrec);
304 /* The following definitions come from nmbd/nmbd_synclists.c */
306 void sync_browse_lists(struct work_record *work,
307 char *name, int nm_type,
308 struct in_addr ip, bool local, bool servers);
309 void sync_check_completion(void);
311 /* The following definitions come from nmbd/nmbd_winsproxy.c */
313 void make_wins_proxy_name_query_request( struct subnet_record *subrec,
314 struct packet_struct *incoming_packet,
315 struct nmb_name *question_name);
317 /* The following definitions come from nmbd/nmbd_winsserver.c */
319 struct name_record *find_name_on_wins_subnet(const struct nmb_name *nmbname, bool self_only);
320 bool wins_store_changed_namerec(const struct name_record *namerec);
321 bool add_name_to_wins_subnet(const struct name_record *namerec);
322 bool remove_name_from_wins_namelist(struct name_record *namerec);
323 void dump_wins_subnet_namelist(XFILE *fp);
324 bool packet_is_for_wins_server(struct packet_struct *packet);
325 bool initialise_wins(void);
326 void wins_process_name_refresh_request( struct subnet_record *subrec,
327 struct packet_struct *p );
328 void wins_process_name_registration_request(struct subnet_record *subrec,
329 struct packet_struct *p);
330 void wins_process_multihomed_name_registration_request( struct subnet_record *subrec,
331 struct packet_struct *p);
332 void fetch_all_active_wins_1b_names(void);
333 void send_wins_name_query_response(int rcode, struct packet_struct *p,
334 struct name_record *namerec);
335 void wins_process_name_query_request(struct subnet_record *subrec,
336 struct packet_struct *p);
337 void wins_process_name_release_request(struct subnet_record *subrec,
338 struct packet_struct *p);
339 void initiate_wins_processing(time_t t);
340 void wins_write_name_record(struct name_record *namerec, XFILE *fp);
341 void wins_write_database(time_t t, bool background);
342 void nmbd_wins_new_entry(struct messaging_context *msg,
343 void *private_data,
344 uint32_t msg_type,
345 struct server_id server_id,
346 DATA_BLOB *data);
348 /* The following definitions come from nmbd/nmbd_workgroupdb.c */
350 struct work_record *find_workgroup_on_subnet(struct subnet_record *subrec,
351 const char *name);
352 struct work_record *create_workgroup_on_subnet(struct subnet_record *subrec,
353 const char *name, int ttl);
354 void update_workgroup_ttl(struct work_record *work, int ttl);
355 void initiate_myworkgroup_startup(struct subnet_record *subrec, struct work_record *work);
356 void dump_workgroups(bool force_write);
357 void expire_workgroups_and_servers(time_t t);