]> andersk Git - moira.git/blob - include/moira.h
add MR_PROXY as procno 7, and bump MR_MAX_PROC.
[moira.git] / include / moira.h
1 /* $Id$
2  *
3  * Copyright (C) 1987-1998 by the Massachusetts Institute of Technology
4  *
5  */
6
7 #ifndef _moira_h_
8 #define _moira_h_
9
10 /* return values from queries (and error codes) */
11
12 #include <com_err.h>
13 #include "mr_et.h"
14 #include "krb_et.h"
15 #include "gdss_et.h"
16 #include "ureg_err.h"
17 #define MR_SUCCESS 0            /* Query was successful */
18
19 #define MR_VERSION_1 1          /* Version in use from 7/87 to 4/88 */
20 #define MR_VERSION_2 2          /* After 4/88, new query lib */
21
22 /* return values for Moira server calls, used by clients */
23
24 #define MR_CONT 0               /* Everything okay, continue sending values. */
25 #define MR_ABORT -1             /* Something went wrong don't send anymore
26                                    values. */
27
28 #define MOIRA_SNAME     "moira" /* Kerberos service key to use */
29
30 /* Protocol operations */
31 #define MR_NOOP 0
32 #define MR_AUTH 1
33 #define MR_SHUTDOWN 2
34 #define MR_QUERY 3
35 #define MR_ACCESS 4
36 #define MR_DO_UPDATE 5
37 #define MR_MOTD 6
38 #define MR_PROXY 7
39 #define MR_MAX_PROC 7
40
41 /* values used in NFS physical flags */
42 #define MR_FS_STUDENT   0x0001
43 #define MR_FS_FACULTY   0x0002
44 #define MR_FS_STAFF     0x0004
45 #define MR_FS_MISC      0x0008
46 #define MR_FS_GROUPQUOTA 0x0010
47
48 /* magic values to pass for list and user queries */
49 #define UNIQUE_GID      "create unique GID"
50 #define UNIQUE_UID      "create unique UID"
51 #define UNIQUE_LOGIN    "create unique login ID"
52
53 /* Structure used by Save Queue routines (for temporary storage of data) */
54 struct save_queue
55 {
56   struct save_queue *q_next;
57   struct save_queue *q_prev;
58   struct save_queue *q_lastget;
59   void *q_data;
60 };
61
62 /* Hash table declarations */
63 struct bucket {
64   struct bucket *next;
65   int key;
66   void *data;
67 };
68 struct hash {
69   int size;
70   struct bucket **data;
71 };
72
73 /* prototypes from critical.c */
74 void critical_alert(char *instance, char *msg, ...);
75 void send_zgram(char *inst, char *msg);
76
77 /* prototypes from fixhost.c */
78 char *canonicalize_hostname(char *s);
79
80 /* prototypes from fixname.c */
81 void FixName(char *ilnm, char *ifnm, char *last, char *first, char *middle);
82 void FixCase(char *p);
83 void LookForJrAndIII(char *nm, int *pends_jr, int *pends_sr,
84                      int *pends_ii, int *pends_iii,
85                      int *pends_iv, int *pends_v);
86 void LookForSt(char *nm);
87 void LookForO(char *nm);
88 void TrimTrailingSpace(char *ip);
89 void GetMidInit(char *nm, char *mi);
90 void RemoveHyphens(char *str);
91
92 /* prototypes from gdss_convert.c */
93 int gdss2et(int code);
94
95 /* prototypes from hash.c */
96 struct hash *create_hash(int size);
97 void *hash_lookup(struct hash *h, int key);
98 int hash_update(struct hash *h, int key, void *value);
99 int hash_store(struct hash *h, int key, void *value);
100 void hash_search(struct hash *h, void *value, void (*callback)(int));
101 void hash_step(struct hash *h, void (*callback)(int, void *, void *),
102                void *hint);
103 void hash_destroy(struct hash *h);
104
105 /* prototypes from kname_unparse.c */
106 char *kname_unparse(char *p, char *i, char *r);
107
108 /* prototypes from nfsparttype.c */
109 char *parse_filesys_type(char *fs_type_name);
110 char *format_filesys_type(char *fs_status);
111
112 /* prototypes from sq.c */
113 struct save_queue *sq_create(void);
114 int sq_save_data(struct save_queue *sq, void *data);
115 int sq_save_args(int argc, char *argv[], struct save_queue *sq);
116 int sq_save_unique_data(struct save_queue *sq, void *data);
117 int sq_save_unique_string(struct save_queue *sq, char *data);
118 /* in sq_get_data and sq_remove_data, the `data' arg should be a
119    pointer to a pointer */
120 int sq_get_data(struct save_queue *sq, void *data);
121 int sq_remove_data(struct save_queue *sq, void *data);
122 void sq_remove_last_data(struct save_queue *sq);
123 int sq_empty(struct save_queue *sq);
124 void sq_destroy(struct save_queue *sq);
125
126 /* prototypes from strs.c */
127 char *strtrim(char *s);
128 char *uppercase(char *s);
129 char *lowercase(char *s);
130
131 /* mr_ functions */
132 int mr_access(char *handle, int argc, char **argv);
133 int mr_auth(char *prog);
134 int mr_proxy(char *principal, char *orig_authtype);
135 int mr_connect(char *server);
136 int mr_disconnect(void);
137 int mr_do_update(void);
138 int mr_host(char *host, int size);
139 int mr_motd(char **motd);
140 int mr_noop(void);
141 int mr_query(char *handle, int argc, char **argv,
142              int (*callback)(int, char **, void *), void *callarg);
143
144 /* error-name backward compatibility */
145 #define MR_INGRES_ERR           MR_DBMS_ERR
146 #define MR_INGRES_SOFTFAIL      MR_DBMS_SOFTFAIL
147
148
149 #ifdef __GNUC__
150 #if __GNUC_MINOR__ < 7
151 #define __attribute__(x)
152 #endif
153 #else /* ! __GNUC __ */
154 #define __attribute__(x)
155 #endif
156
157 #define RCSID(id) static char *rcsid __attribute__ ((__unused__)) = id
158
159 #endif /* _moira_h_ */          /* Do Not Add Anything after this line. */
This page took 0.089604 seconds and 5 git commands to generate.