]> andersk Git - moira.git/blame - server/query.h
Remove `delete_user_by_uid' since it's never been used in any logs we have,
[moira.git] / server / query.h
CommitLineData
0236bb42 1/* $Header$
2 *
3 * Structures and constants used in the query dispatch table
4 */
5
6/* Query Types */
7enum query_type {RETRIEVE, UPDATE, APPEND, DELETE, SPECIAL};
8
03c05291 9/* Tables */
10enum tables {NO_TABLE, USERS_TABLE, KRBMAP_TABLE, MACHINE_TABLE,
11 HOSTALIAS_TABLE, SUBNET_TABLE, CLUSTER_TABLE, MCMAP_TABLE,
12 SVC_TABLE, LIST_TABLE, IMEMBERS_TABLE, SERVERS_TABLE,
13 SERVERHOSTS_TABLE, FILESYS_TABLE, FSGROUP_TABLE, NFSPHYS_TABLE,
14 QUOTA_TABLE, ZEPHYR_TABLE, HOSTACCESS_TABLE, STRINGS_TABLE,
15 SERVICES_TABLE, PRINTCAP_TABLE, PALLADIUM_TABLE, CAPACLS_TABLE,
16 ALIAS_TABLE, NUMVALUES_TABLE, TBLSTATS_TABLE, INCREMENTAL_TABLE};
17
0236bb42 18/* Query Definition Structure */
19struct query
20{
21 char *name; /* query name */
22 char *shortname; /* abbreviated query name (must be 4 chars) */
23 enum query_type type; /* query type */
24 char *rvar; /* range variable */
03c05291 25 enum tables rtable; /* range table */
0236bb42 26 char *tlist; /* target list */
27 char **fields; /* input and output variable names (for help) */
28 int vcnt; /* variable count */
29 char *qual; /* format string for "where" clause */
30 int argc; /* number of args for qualifier */
68b5b948 31 char *sort; /* fields to sort on */
0236bb42 32 struct validate *validate; /* validation support */
33 int acl; /* hint as to query ACL for this query */
34 int everybody; /* is the default user on this ACL? */
35};
36
37/* Query Validation Structure */
38struct validate
39{
40 /* object validation (e.g., user, filesys, type) */
41 struct valobj *valobj; /* array of object validation descriptors */
42 int objcnt; /* size of array */
43 /* row validation - retrieve (exists = any(rvar.field where qual)) */
44 char *field; /* field to check for */
45 char *qual; /* format string for "where" clause */
46 int argc; /* number of args used in qual */
47 /* values field containing current max object id */
48 char *object_id;
49 /* routine to verify access permission on objects */
50 int (*acs_rtn)();
51 /* pre-processing routine (var setup only) */
52 int (*pre_rtn)();
53 /* post-processing routine */
54 int (*post_rtn)();
55};
56
57/* Validated Object Types */
60140d51 58enum vo_type {V_NAME, V_ID, V_TYPE, V_TYPEDATA, V_RENAME,
59 V_CHAR, V_LEN, V_NUM};
0236bb42 60
61/* Validated Object Definition */
62struct valobj
63{
64 enum vo_type type;
65 int index; /* index of object to validate */
03c05291 66 enum tables table; /* table containing object */
0236bb42 67 char *namefield; /* table's fieldname for object */
68 char *idfield; /* table's corresponding id field (if any) */
69 int error;
70};
03c05291 71
72
73/* prototypes from cache.dc */
74void flush_cache(void);
75int name_to_id(char *name, enum tables type, int *id);
76int id_to_name(int id, enum tables type, char **name);
77int cache_entry(char *name, enum tables type, int id);
78void flush_name(char *name, enum tables type);
79void cache_commit(void);
80void cache_abort(void);
81
82/* prototypes from increment.dc */
83void incremental_before(enum tables table, char *qualx, char **argv);
84void incremental_clear_before(void);
85void incremental_after(enum tables table, char *qualx, char **argv);
86void incremental_clear_after(void);
87
88/* prototypes from qfollow.dc */
89int set_pobox_modtime(struct query *q, char *argv[], client *cl);
90
91/* prototypes from qrtn.dc */
92int check_query_access(struct query *q, char *argv[], client *cl);
93int set_next_object_id(char *objectx, enum tables table, int limit);
94
95/* prototypes from qsubs.c */
960b073b 96void list_queries(int version, int (*action)(), char *actarg);
97void help_query(struct query *q, int (*action)(), char *actarg);
03c05291 98struct query *get_query_by_name(char *name, int version);
This page took 0.070229 seconds and 5 git commands to generate.