smbtorture: Directory Leases vs overwrite
[samba4-gss.git] / source4 / kdc / kdc-server.h
blob274c4bf4009b6592dd80d46a75e6435615afec79
1 /*
2 Unix SMB/CIFS implementation.
4 KDC related functions
6 Copyright (c) 2005-2008 Andrew Bartlett <abartlet@samba.org>
7 Copyright (c) 2005 Andrew Tridgell <tridge@samba.org>
8 Copyright (c) 2005 Stefan Metzmacher <metze@samba.org>
10 This program is free software; you can redistribute it and/or modify
11 it under the terms of the GNU General Public License as published by
12 the Free Software Foundation; either version 3 of the License, or
13 (at your option) any later version.
15 This program is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License for more details.
20 You should have received a copy of the GNU General Public License
21 along with this program. If not, see <http://www.gnu.org/licenses/>.
24 #ifndef _KDC_SERVER_H
25 #define _KDC_SERVER_H
27 #include "system/kerberos.h"
28 #include "auth/kerberos/kerberos.h"
30 struct tsocket_address;
31 struct model_ops;
34 * Context structure for the kdc server
36 struct kdc_server {
37 struct task_server *task;
38 struct smb_krb5_context *smb_krb5_context;
39 struct samba_kdc_base_context *base_ctx;
40 bool am_rodc;
41 uint32_t proxy_timeout;
42 const char *kpasswd_keytab_name;
43 void *private_data;
44 struct samba_kdc_db_context *kdc_db_ctx;
47 typedef enum kdc_code_e {
48 KDC_OK = 0,
49 KDC_ERROR,
50 KDC_PROXY_REQUEST
51 } kdc_code;
53 typedef kdc_code (*kdc_process_fn_t)(struct kdc_server *kdc,
54 TALLOC_CTX *mem_ctx,
55 DATA_BLOB *request,
56 DATA_BLOB *reply,
57 struct tsocket_address *remote_address,
58 struct tsocket_address *local_address,
59 int datagram);
61 /* Information about one kdc socket */
62 struct kdc_socket {
63 struct kdc_server *kdc;
64 struct tsocket_address *local_address;
65 kdc_process_fn_t process;
68 /* Information about one kdc/kpasswd udp socket */
69 struct kdc_udp_socket {
70 struct kdc_socket *kdc_socket;
71 struct tdgram_context *dgram;
72 struct tevent_queue *send_queue;
75 NTSTATUS kdc_add_socket(struct kdc_server *kdc,
76 const struct model_ops *model_ops,
77 const char *name,
78 const char *address,
79 uint16_t port,
80 kdc_process_fn_t process,
81 bool udp_only);
83 #endif /* _KDC_SERVER_H */