]> git.ipfire.org Git - thirdparty/cups.git/blob - scheduler/policy.h
eef0c03abd6681cc7ede5a3b50e1e0f127ae98ec
[thirdparty/cups.git] / scheduler / policy.h
1 /*
2 * "$Id: policy.h,v 1.1.2.8 2004/06/30 18:24:18 mike Exp $"
3 *
4 * Policy definitions for the Common UNIX Printing System (CUPS)
5 * scheduler.
6 *
7 * Copyright 1997-2004 by Easy Software Products, all rights reserved.
8 *
9 * These coded instructions, statements, and computer programs are the
10 * property of Easy Software Products and are protected by Federal
11 * copyright law. Distribution and use rights are outlined in the file
12 * "LICENSE.txt" which should have been included with this file. If this
13 * file is missing or damaged please contact Easy Software Products
14 * at:
15 *
16 * Attn: CUPS Licensing Information
17 * Easy Software Products
18 * 44141 Airport View Drive, Suite 204
19 * Hollywood, Maryland 20636-3142 USA
20 *
21 * Voice: (301) 373-9600
22 * EMail: cups-info@cups.org
23 * WWW: http://www.cups.org
24 */
25
26 /*
27 * "Any" operation code...
28 */
29
30 #define IPP_ANY_OPERATION (ipp_op_t)0
31 #define IPP_BAD_OPERATION (ipp_op_t)-1
32
33
34 /*
35 * Access levels...
36 */
37
38 #define POLICY_ALLOW 0 /* Allow access */
39 #define POLICY_DENY 1 /* Deny access */
40
41
42 /*
43 * IPP operation policy structures...
44 */
45
46 typedef struct
47 {
48 int allow_deny; /* POLICY_ALLOW or POLICY_DENY */
49 char *name; /* Name to allow or deny */
50 } policyname_t;
51
52 typedef struct
53 {
54 ipp_op_t op; /* Operation */
55 int order_type, /* Default allow/deny */
56 authenticate, /* Authentication required? */
57 num_names; /* Number of names */
58 policyname_t *names; /* Names */
59 } policyop_t;
60
61 typedef struct
62 {
63 char *name; /* Policy name */
64 int num_ops; /* Number of operations */
65 policyop_t **ops; /* Operations */
66 } policy_t;
67
68
69 /*
70 * Globals...
71 */
72
73 VAR int NumPolicies VALUE(0);
74 /* Number of policies */
75 VAR policy_t **Policies VALUE(NULL);
76 /* Policies */
77
78
79 /*
80 * Prototypes...
81 */
82
83 extern policy_t *AddPolicy(const char *policy);
84 extern policyop_t *AddPolicyOp(policy_t *p, policyop_t *po, ipp_op_t op);
85 extern void AddPolicyOpName(policyop_t *po, int allow_deny,
86 const char *name);
87 extern int CheckPolicy(policy_t *p, client_t *con,
88 const char *owner);
89 extern void DeleteAllPolicies(void);
90 extern policy_t *FindPolicy(const char *policy);
91 extern policyop_t *FindPolicyOp(policy_t *p, ipp_op_t op);
92
93
94 /*
95 * End of "$Id: policy.h,v 1.1.2.8 2004/06/30 18:24:18 mike Exp $".
96 */