]> andersk Git - moira.git/blob - include/moira.h
added US_HALF_ENROLLED
[moira.git] / include / moira.h
1 /*
2  *      $Source$
3  *      $Author$
4  *      $Header$
5  *
6  *      Copyright (C) 1987 by the Massachusetts Institute of Technology
7  *
8  */
9
10 #ifndef _sms_h_
11 #define _sms_h_
12
13 /* return values from queries (and error codes) */
14
15 #include "sms_et.h"
16 #define SMS_SUCCESS 0           /* Query was successful */
17
18 #define SMS_VERSION_1 1         /* Version in use from 7/87 to 4/88 */
19 #define SMS_VERSION_2 2         /* After 4/88, new query lib */
20
21 /* return values for sms server calls, used by clients */
22
23 #define SMS_CONT 0              /* Everything okay, continue sending values. */
24 #define SMS_ABORT -1            /* Something went wrong don't send anymore
25                                    values. */
26
27 #define MOIRA_SNAME     "moira" /* Kerberos service key to use */
28
29 /* Protocol operations */
30 #define SMS_NOOP 0
31 #define SMS_AUTH 1
32 #define SMS_SHUTDOWN 2
33 #define SMS_QUERY 3
34 #define SMS_ACCESS 4
35 #define SMS_DO_UPDATE 5
36 #define SMS_MOTD 6
37 #define SMS_MAX_PROC 6
38
39 /* values used in NFS physical flags */
40 #define SMS_FS_STUDENT  0x0001
41 #define SMS_FS_FACULTY  0x0002
42 #define SMS_FS_STAFF    0x0004
43 #define SMS_FS_MISC     0x0008
44
45 /* magic values to pass for list and user queries */
46 #define UNIQUE_GID      "create unique GID"
47 #define UNIQUE_UID      "create unique UID"
48 #define UNIQUE_LOGIN    "create unique login ID"
49
50 /* Structure used by Save Queue routines (for temporary storage of data) */
51 struct save_queue
52 {
53     struct save_queue *q_next;
54     struct save_queue *q_prev;
55     struct save_queue *q_lastget;
56     char *q_data;
57 };
58
59 /* Hash table declarations */
60 struct bucket {
61     struct bucket *next;
62     int key;
63     char *data;
64 };
65 struct hash {
66     int size;
67     struct bucket **data;
68 };
69
70 #ifdef __STDC__
71 int sms_connect();
72 int sms_disconnect();
73 int sms_auth();
74 int sms_access(char *handle, int argc, char **argv);
75 int sms_access_internal(int argc, char **argv);
76 int sms_query(char *handle, int argc, char **argv,
77               int (*callback)(), char *callarg);
78 int sms_query_internal(int argc, char **argv,
79                        int (*callback)(), char *callarg);
80 int sms_noop();
81 int sms_shutdown(char *reason);
82 struct save_queue *sq_create();
83 struct hash *create_hash(int size);
84 char *hash_lookup(struct hash *h, int key);
85 char *strsave(char *s);
86 char *strtrim(char *s);
87 char *canonicalize_hostname(char *s);
88 #else !__STDC__
89 int sms_connect();
90 int sms_disconnect();
91 int sms_auth();
92 int sms_access();
93 int sms_query();
94 int sms_noop();
95 int sms_shutdown();
96 struct save_queue *sq_create();
97 struct hash *create_hash();
98 char *hash_lookup();
99 char *strsave();
100 char *strtrim();
101 char *canonicalize_hostname();
102 #endif __STDC__
103
104 #endif _sms_h_                  /* Do Not Add Anything after this line. */
This page took 0.091525 seconds and 5 git commands to generate.