• Home
  • History
  • Annotate
  • Line#
  • Navigate
  • Raw
  • Download
  • only in /asuswrt-rt-n18u-9.0.0.4.380.2695/release/src-rt/router/samba-3.5.8/source3/include/
1/*
2   Unix SMB/Netbios implementation.
3   Version 1.9.
4   SMB parameters and setup
5   Copyright (C) Andrew Tridgell              1992-2000,
6   Copyright (C) Jean Francois Micouleau      1998-2000.
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#ifndef NT_PRINTING_H_
23#define NT_PRINTING_H_
24
25/* container for a single registry key */
26
27typedef struct {
28	char			*name;
29	struct regval_ctr	*values;
30} NT_PRINTER_KEY;
31
32/* container for all printer data */
33
34typedef struct {
35	int		num_keys;
36	NT_PRINTER_KEY	*keys;
37} NT_PRINTER_DATA;
38
39typedef struct ntdevicemode
40{
41	fstring	devicename;
42	fstring	formname;
43
44	uint16	specversion;
45	uint16	driverversion;
46	uint16	size;
47	uint16	driverextra;
48	uint16	orientation;
49	uint16	papersize;
50	uint16	paperlength;
51	uint16	paperwidth;
52	uint16	scale;
53	uint16	copies;
54	uint16	defaultsource;
55	uint16	printquality;
56	uint16	color;
57	uint16	duplex;
58	uint16	yresolution;
59	uint16	ttoption;
60	uint16	collate;
61	uint16	logpixels;
62
63	uint32	fields;
64	uint32	bitsperpel;
65	uint32	pelswidth;
66	uint32	pelsheight;
67	uint32	displayflags;
68	uint32	displayfrequency;
69	uint32	icmmethod;
70	uint32	icmintent;
71	uint32	mediatype;
72	uint32	dithertype;
73	uint32	reserved1;
74	uint32	reserved2;
75	uint32	panningwidth;
76	uint32	panningheight;
77	uint8 	*nt_dev_private;
78} NT_DEVICEMODE;
79
80typedef struct nt_printer_info_level_2
81{
82	uint32 attributes;
83	uint32 priority;
84	uint32 default_priority;
85	uint32 starttime;
86	uint32 untiltime;
87	uint32 status;
88	uint32 cjobs;
89	uint32 averageppm;
90	fstring servername;
91	fstring printername;
92	fstring sharename;
93	fstring portname;
94	fstring drivername;
95	char comment[1024];
96	fstring location;
97	NT_DEVICEMODE *devmode;
98	fstring sepfile;
99	fstring printprocessor;
100	fstring datatype;
101	fstring parameters;
102	NT_PRINTER_DATA *data;
103	SEC_DESC_BUF *secdesc_buf;
104	uint32 changeid;
105	uint32 c_setprinter;
106	uint32 setuptime;
107} NT_PRINTER_INFO_LEVEL_2;
108
109typedef struct nt_printer_info_level
110{
111	NT_PRINTER_INFO_LEVEL_2 *info_2;
112} NT_PRINTER_INFO_LEVEL;
113
114typedef struct
115{
116	fstring name;
117	uint32 flag;
118	uint32 width;
119	uint32 length;
120	uint32 left;
121	uint32 top;
122	uint32 right;
123	uint32 bottom;
124} nt_forms_struct;
125
126#ifndef SAMBA_PRINTER_PORT_NAME
127#define SAMBA_PRINTER_PORT_NAME "Samba Printer Port"
128#endif
129
130/* DOS header format */
131#define DOS_HEADER_SIZE                 64
132#define DOS_HEADER_MAGIC_OFFSET         0
133#define DOS_HEADER_MAGIC                0x5A4D
134#define DOS_HEADER_LFANEW_OFFSET        60
135
136/* New Executable format (Win or OS/2 1.x segmented) */
137#define NE_HEADER_SIZE                  64
138#define NE_HEADER_SIGNATURE_OFFSET      0
139#define NE_HEADER_SIGNATURE             0x454E
140#define NE_HEADER_TARGET_OS_OFFSET      54
141#define NE_HEADER_TARGOS_WIN            0x02
142#define NE_HEADER_MINOR_VER_OFFSET      62
143#define NE_HEADER_MAJOR_VER_OFFSET      63
144
145/* Portable Executable format */
146#define PE_HEADER_SIZE                  24
147#define PE_HEADER_SIGNATURE_OFFSET      0
148#define PE_HEADER_SIGNATURE             0x00004550
149#define PE_HEADER_MACHINE_OFFSET        4
150#define PE_HEADER_MACHINE_I386          0x14c
151#define PE_HEADER_NUMBER_OF_SECTIONS    6
152#define PE_HEADER_OPTIONAL_HEADER_SIZE  20
153#define PE_HEADER_SECT_HEADER_SIZE      40
154#define PE_HEADER_SECT_NAME_OFFSET      0
155#define PE_HEADER_SECT_SIZE_DATA_OFFSET 16
156#define PE_HEADER_SECT_PTR_DATA_OFFSET  20
157
158/* Microsoft file version format */
159#define VS_SIGNATURE                    "VS_VERSION_INFO"
160#define VS_MAGIC_VALUE                  0xfeef04bd
161#define VS_MAJOR_OFFSET					8
162#define VS_MINOR_OFFSET					12
163#define VS_VERSION_INFO_UNICODE_SIZE    (sizeof(VS_SIGNATURE)*2+4+VS_MINOR_OFFSET+4) /* not true size! */
164#define VS_VERSION_INFO_SIZE            (sizeof(VS_SIGNATURE)+4+VS_MINOR_OFFSET+4)   /* not true size! */
165#define VS_NE_BUF_SIZE                  4096  /* Must be > 2*VS_VERSION_INFO_SIZE */
166
167/* Notify spoolss clients that something has changed.  The
168   notification data is either stored in two uint32 values or a
169   variable length array. */
170
171#define SPOOLSS_NOTIFY_MSG_UNIX_JOBID 0x0001    /* Job id is unix  */
172
173typedef struct spoolss_notify_msg {
174	fstring printer;	/* Name of printer notified */
175	uint32 type;		/* Printer or job notify */
176	uint32 field;		/* Notify field changed */
177	uint32 id;		/* Job id */
178	uint32 len;		/* Length of data, 0 for two uint32 value */
179	uint32 flags;
180	union {
181		uint32 value[2];
182		char *data;
183	} notify;
184} SPOOLSS_NOTIFY_MSG;
185
186typedef struct {
187	fstring 		printername;
188	uint32			num_msgs;
189	SPOOLSS_NOTIFY_MSG	*msgs;
190} SPOOLSS_NOTIFY_MSG_GROUP;
191
192typedef struct {
193	TALLOC_CTX 			*ctx;
194	uint32				num_groups;
195	SPOOLSS_NOTIFY_MSG_GROUP	*msg_groups;
196} SPOOLSS_NOTIFY_MSG_CTR;
197
198#define SPLHND_PRINTER		1
199#define SPLHND_SERVER	 	2
200#define SPLHND_PORTMON_TCP	3
201#define SPLHND_PORTMON_LOCAL	4
202
203/* structure to store the printer handles */
204/* and a reference to what it's pointing to */
205/* and the notify info asked about */
206/* that's the central struct */
207typedef struct _Printer{
208	struct _Printer *prev, *next;
209	bool document_started;
210	bool page_started;
211	uint32 jobid; /* jobid in printing backend */
212	int printer_type;
213	fstring servername;
214	fstring sharename;
215	uint32 type;
216	uint32 access_granted;
217	struct {
218		uint32 flags;
219		uint32 options;
220		fstring localmachine;
221		uint32 printerlocal;
222		struct spoolss_NotifyOption *option;
223		struct policy_handle client_hnd;
224		bool client_connected;
225		uint32 change;
226		/* are we in a FindNextPrinterChangeNotify() call? */
227		bool fnpcn;
228	} notify;
229	struct {
230		fstring machine;
231		fstring user;
232	} client;
233
234	/* devmode sent in the OpenPrinter() call */
235	NT_DEVICEMODE	*nt_devmode;
236
237	/* cache the printer info */
238	NT_PRINTER_INFO_LEVEL *printer_info;
239
240} Printer_entry;
241
242/*
243 * The printer attributes.
244 * I #defined all of them (grabbed form MSDN)
245 * I'm only using:
246 * ( SHARED | NETWORK | RAW_ONLY )
247 * RAW_ONLY _MUST_ be present otherwise NT will send an EMF file
248 */
249
250#define PRINTER_ATTRIBUTE_SAMBA			(PRINTER_ATTRIBUTE_RAW_ONLY|\
251						 PRINTER_ATTRIBUTE_SHARED|\
252						 PRINTER_ATTRIBUTE_LOCAL)
253#define PRINTER_ATTRIBUTE_NOT_SAMBA		(PRINTER_ATTRIBUTE_NETWORK)
254
255#define DRIVER_ANY_VERSION		0xffffffff
256#define DRIVER_MAX_VERSION		4
257
258struct print_architecture_table_node {
259	const char 	*long_archi;
260	const char 	*short_archi;
261	int	version;
262};
263
264#endif /* NT_PRINTING_H_ */
265