Use variable for ndr_netlogon.o path.
[kai/samba-autobuild/.git] / source4 / ntptr / ntptr.h
1 /* 
2    Unix SMB/CIFS implementation.
3
4    NTPTR structures and defines
5
6    Copyright (C) Stefan (metze) Metzmacher 2005
7    
8    This program is free software; you can redistribute it and/or modify
9    it under the terms of the GNU General Public License as published by
10    the Free Software Foundation; either version 3 of the License, or
11    (at your option) any later version.
12    
13    This program is distributed in the hope that it will be useful,
14    but WITHOUT ANY WARRANTY; without even the implied warranty of
15    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16    GNU General Public License for more details.
17    
18    You should have received a copy of the GNU General Public License
19    along with this program.  If not, see <http://www.gnu.org/licenses/>.
20 */
21
22 /* modules can use the following to determine if the interface has changed */
23 #define NTPTR_INTERFACE_VERSION 0
24
25 struct ntptr_context;
26
27 enum ntptr_HandleType {
28         NTPTR_HANDLE_SERVER,
29         NTPTR_HANDLE_PRINTER,
30         NTPTR_HANDLE_PORT,
31         NTPTR_HANDLE_MONITOR
32 };
33
34 struct ntptr_GenericHandle {
35         enum ntptr_HandleType type;
36         struct ntptr_context *ntptr;
37         const char *object_name;
38         uint32_t access_mask;
39         void *private_data;
40 };
41
42 struct spoolss_OpenPrinterEx;
43 struct spoolss_EnumPrinterData;
44 struct spoolss_DeletePrinterData;
45 struct spoolss_AddForm;
46 struct spoolss_GetForm;
47 struct spoolss_SetForm;
48 struct spoolss_DeleteForm;
49 struct spoolss_AddPrinterDriver;
50 struct spoolss_DeletePrinterDriver;
51 struct spoolss_GetPrinterDriverDirectory;
52 struct spoolss_AddPrinter;
53 struct spoolss_GetPrinter;
54 struct spoolss_SetPrinter;
55 struct spoolss_DeletePrinter;
56 struct spoolss_GetPrinterDriver;
57 struct spoolss_AddJob;
58 struct spoolss_EnumJobs;
59 struct spoolss_SetJob;
60 struct spoolss_GetJob;
61 struct spoolss_ScheduleJob;
62 struct spoolss_ReadPrinter;
63 struct spoolss_WritePrinter;
64 struct spoolss_StartDocPrinter;
65 struct spoolss_EndDocPrinter;
66 struct spoolss_StartPagePrinter;
67 struct spoolss_EndPagePrinter;
68 struct spoolss_GetPrinterData;
69 struct spoolss_SetPrinterData;
70 struct spoolss_EnumPrinterDrivers;
71 struct spoolss_EnumMonitors;
72 struct spoolss_EnumPrinters;
73 struct spoolss_EnumForms;
74 struct spoolss_EnumPorts;
75 struct spoolss_EnumPrintProcessors;
76 struct spoolss_XcvData;
77
78 /* the ntptr operations structure - contains function pointers to 
79    the backend implementations of each operation */
80 struct ntptr_ops {
81         const char *name;
82
83         /* initial setup */
84         NTSTATUS (*init_context)(struct ntptr_context *ntptr);
85
86         /* PrintServer functions */
87         WERROR (*OpenPrintServer)(struct ntptr_context *ntptr, TALLOC_CTX *mem_ctx,
88                                   struct spoolss_OpenPrinterEx *r,
89                                   const char *printer_name,
90                                   struct ntptr_GenericHandle **server);
91         WERROR (*XcvDataPrintServer)(struct ntptr_GenericHandle *server, TALLOC_CTX *mem_ctx,
92                                      struct spoolss_XcvData *r);
93
94         /* PrintServer PrinterData functions */
95         WERROR (*EnumPrintServerData)(struct ntptr_GenericHandle *server, TALLOC_CTX *mem_ctx,
96                                      struct spoolss_EnumPrinterData *r);
97         WERROR (*GetPrintServerData)(struct ntptr_GenericHandle *server, TALLOC_CTX *mem_ctx,
98                                      struct spoolss_GetPrinterData *r);
99         WERROR (*SetPrintServerData)(struct ntptr_GenericHandle *server, TALLOC_CTX *mem_ctx,
100                                      struct spoolss_SetPrinterData *r);
101         WERROR (*DeletePrintServerData)(struct ntptr_GenericHandle *server, TALLOC_CTX *mem_ctx,
102                                         struct spoolss_DeletePrinterData *r);
103
104         /* PrintServer Form functions */
105         WERROR (*EnumPrintServerForms)(struct ntptr_GenericHandle *server, TALLOC_CTX *mem_ctx,
106                                        struct spoolss_EnumForms *r);
107         WERROR (*AddPrintServerForm)(struct ntptr_GenericHandle *server, TALLOC_CTX *mem_ctx,
108                                      struct spoolss_AddForm *r);
109         WERROR (*SetPrintServerForm)(struct ntptr_GenericHandle *server, TALLOC_CTX *mem_ctx,
110                                      struct spoolss_SetForm *r);
111         WERROR (*DeletePrintServerForm)(struct ntptr_GenericHandle *server, TALLOC_CTX *mem_ctx,
112                                         struct spoolss_DeleteForm *r);
113
114         /* PrintServer Driver functions */
115         WERROR (*EnumPrinterDrivers)(struct ntptr_context *ntptr, TALLOC_CTX *mem_ctx,
116                                      struct spoolss_EnumPrinterDrivers *r);
117         WERROR (*AddPrinterDriver)(struct ntptr_context *ntptr, TALLOC_CTX *mem_ctx,
118                                    struct spoolss_AddPrinterDriver *r);
119         WERROR (*DeletePrinterDriver)(struct ntptr_context *ntptr, TALLOC_CTX *mem_ctx,
120                                       struct spoolss_DeletePrinterDriver *r);
121         WERROR (*GetPrinterDriverDirectory)(struct ntptr_context *ntptr, TALLOC_CTX *mem_ctx,
122                                             struct spoolss_GetPrinterDriverDirectory *r);
123
124         /* Port functions */
125         WERROR (*EnumPorts)(struct ntptr_context *ntptr, TALLOC_CTX *mem_ctx,
126                             struct spoolss_EnumPorts *r);
127         WERROR (*OpenPort)(struct ntptr_context *ntptr, TALLOC_CTX *mem_ctx,
128                            struct spoolss_OpenPrinterEx *r,
129                            const char *port_name,
130                            struct ntptr_GenericHandle **port);
131         WERROR (*XcvDataPort)(struct ntptr_GenericHandle *port, TALLOC_CTX *mem_ctx,
132                               struct spoolss_XcvData *r);
133         
134         /* Monitor functions */
135         WERROR (*EnumMonitors)(struct ntptr_context *ntptr, TALLOC_CTX *mem_ctx,
136                                struct spoolss_EnumMonitors *r);
137         WERROR (*OpenMonitor)(struct ntptr_context *ntptr, TALLOC_CTX *mem_ctx,
138                               struct spoolss_OpenPrinterEx *r,
139                               const char *monitor_name,
140                               struct ntptr_GenericHandle **monitor);
141         WERROR (*XcvDataMonitor)(struct ntptr_GenericHandle *monitor, TALLOC_CTX *mem_ctx,
142                                  struct spoolss_XcvData *r);
143
144         /* PrintProcessor functions */
145         WERROR (*EnumPrintProcessors)(struct ntptr_context *ntptr, TALLOC_CTX *mem_ctx,
146                                       struct spoolss_EnumPrintProcessors *r);
147
148         /* Printer functions */
149         WERROR (*EnumPrinters)(struct ntptr_context *ntptr, TALLOC_CTX *mem_ctx,
150                                struct spoolss_EnumPrinters *r);
151         WERROR (*OpenPrinter)(struct ntptr_context *ntptr, TALLOC_CTX *mem_ctx,
152                               struct spoolss_OpenPrinterEx *r,
153                               const char *printer_name,
154                               struct ntptr_GenericHandle **printer);
155         WERROR (*AddPrinter)(struct ntptr_context *ntptr, TALLOC_CTX *mem_ctx,
156                              struct spoolss_AddPrinter *r,
157                              struct ntptr_GenericHandle **printer);
158         WERROR (*GetPrinter)(struct ntptr_context *ntptr, TALLOC_CTX *mem_ctx,
159                              struct spoolss_GetPrinter *r);
160         WERROR (*SetPrinter)(struct ntptr_context *ntptr, TALLOC_CTX *mem_ctx,
161                              struct spoolss_SetPrinter *r);
162         WERROR (*DeletePrinter)(struct ntptr_context *ntptr, TALLOC_CTX *mem_ctx,
163                                 struct spoolss_DeletePrinter *r);
164         WERROR (*XcvDataPrinter)(struct ntptr_GenericHandle *printer, TALLOC_CTX *mem_ctx,
165                                  struct spoolss_XcvData *r);
166
167         /* Printer Driver functions */
168         WERROR (*GetPrinterDriver)(struct ntptr_context *ntptr, TALLOC_CTX *mem_ctx,
169                                    struct spoolss_GetPrinterDriver *r);
170
171         /* Printer PrinterData functions */
172         WERROR (*EnumPrinterData)(struct ntptr_GenericHandle *printer, TALLOC_CTX *mem_ctx,
173                                   struct spoolss_EnumPrinterData *r);
174         WERROR (*GetPrinterData)(struct ntptr_GenericHandle *printer, TALLOC_CTX *mem_ctx,
175                                  struct spoolss_GetPrinterData *r);
176         WERROR (*SetPrinterData)(struct ntptr_GenericHandle *printer, TALLOC_CTX *mem_ctx,
177                                  struct spoolss_SetPrinterData *r);
178         WERROR (*DeletePrinterData)(struct ntptr_GenericHandle *printer, TALLOC_CTX *mem_ctx,
179                                     struct spoolss_DeletePrinterData *r);
180
181         /* Printer Form functions */
182         WERROR (*EnumPrinterForms)(struct ntptr_GenericHandle *printer, TALLOC_CTX *mem_ctx,
183                                    struct spoolss_EnumForms *r);
184         WERROR (*AddPrinterForm)(struct ntptr_GenericHandle *printer, TALLOC_CTX *mem_ctx,
185                                  struct spoolss_AddForm *r);
186         WERROR (*GetPrinterForm)(struct ntptr_GenericHandle *printer, TALLOC_CTX *mem_ctx,
187                                  struct spoolss_GetForm *r);
188         WERROR (*SetPrinterForm)(struct ntptr_GenericHandle *printer, TALLOC_CTX *mem_ctx,
189                                  struct spoolss_SetForm *r);
190         WERROR (*DeletePrinterForm)(struct ntptr_GenericHandle *printer, TALLOC_CTX *mem_ctx,
191                                     struct spoolss_DeleteForm *r);
192
193         /* Printer Job functions */
194         WERROR (*EnumJobs)(struct ntptr_GenericHandle *printer, TALLOC_CTX *mem_ctx,
195                            struct spoolss_EnumJobs *r);
196         WERROR (*AddJob)(struct ntptr_GenericHandle *printer, TALLOC_CTX *mem_ctx,
197                          struct spoolss_AddJob *r);
198         WERROR (*ScheduleJob)(struct ntptr_GenericHandle *printer, TALLOC_CTX *mem_ctx,
199                               struct spoolss_ScheduleJob *r);
200         WERROR (*GetJob)(struct ntptr_GenericHandle *printer, TALLOC_CTX *mem_ctx,
201                          struct spoolss_GetJob *r);
202         WERROR (*SetJob)(struct ntptr_GenericHandle *printer, TALLOC_CTX *mem_ctx,
203                          struct spoolss_SetJob *r);
204
205         /* Printer Printing functions */
206         WERROR (*StartDocPrinter)(struct ntptr_GenericHandle *printer, TALLOC_CTX *mem_ctx,
207                                   struct spoolss_StartDocPrinter *r);
208         WERROR (*EndDocPrinter)(struct ntptr_GenericHandle *printer, TALLOC_CTX *mem_ctx,
209                                 struct spoolss_EndDocPrinter *r);
210         WERROR (*StartPagePrinter)(struct ntptr_GenericHandle *printer, TALLOC_CTX *mem_ctx,
211                                    struct spoolss_StartPagePrinter *r);
212         WERROR (*EndPagePrinter)(struct ntptr_GenericHandle *printer, TALLOC_CTX *mem_ctx,
213                                  struct spoolss_EndPagePrinter *r);
214         WERROR (*WritePrinter)(struct ntptr_GenericHandle *printer, TALLOC_CTX *mem_ctx,
215                                struct spoolss_WritePrinter *r);
216         WERROR (*ReadPrinter)(struct ntptr_GenericHandle *printer, TALLOC_CTX *mem_ctx,
217                               struct spoolss_ReadPrinter *r);
218 };
219
220 struct ntptr_context {
221         const struct ntptr_ops *ops;
222         void *private_data;
223         struct event_context *ev_ctx;
224         struct loadparm_context *lp_ctx;
225 };
226
227 /* this structure is used by backends to determine the size of some critical types */
228 struct ntptr_critical_sizes {
229         int interface_version;
230         int sizeof_ntptr_critical_sizes;
231         int sizeof_ntptr_context;
232         int sizeof_ntptr_ops;
233 };
234
235 struct loadparm_context;
236
237 #include "ntptr/ntptr_proto.h"