]>
Commit | Line | Data |
---|---|---|
6d409214 | 1 | /* |
2 | * $Source$ | |
3 | * $Author$ | |
4 | * $Header$ | |
5 | * | |
6 | * Copyright (C) 1987 by the Massachusetts Institute of Technology | |
7 | * | |
6d409214 | 8 | */ |
9 | ||
ebf77ded | 10 | #ifndef _sms_h_ |
11 | #define _sms_h_ | |
12 | ||
ac3530a2 | 13 | /* return values from queries (and error codes) */ |
14 | ||
0fa91a0a | 15 | #include "sms_et.h" |
ac3530a2 | 16 | #define SMS_SUCCESS 0 /* Query was successful */ |
0fa91a0a | 17 | |
d30a7b2b | 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 */ | |
0fa91a0a | 20 | |
ebf77ded | 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 | ||
311f6975 | 27 | #define MOIRA_SNAME "moira" /* Kerberos service key to use */ |
28 | ||
ac3530a2 | 29 | /* Protocol operations */ |
0fa91a0a | 30 | #define SMS_NOOP 0 |
31 | #define SMS_AUTH 1 | |
6d409214 | 32 | #define SMS_SHUTDOWN 2 |
4bce71fa | 33 | #define SMS_QUERY 3 |
f358be80 | 34 | #define SMS_ACCESS 4 |
1a1fe0bc | 35 | #define SMS_DO_UPDATE 5 |
379bd35f | 36 | #define SMS_MOTD 6 |
37 | #define SMS_MAX_PROC 6 | |
1a1fe0bc | 38 | |
ac3530a2 | 39 | /* values used in NFS physical flags */ |
1a1fe0bc | 40 | #define SMS_FS_STUDENT 0x0001 |
41 | #define SMS_FS_FACULTY 0x0002 | |
42 | #define SMS_FS_STAFF 0x0004 | |
43 | #define SMS_FS_MISC 0x0008 | |
f4a12540 | 44 | |
ac3530a2 | 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 | ||
ea7f8538 | 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 | }; | |
ac3530a2 | 69 | |
f4a12540 | 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); | |
ea7f8538 | 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); | |
819d4e30 | 87 | char *canonicalize_hostname(char *s); |
f4a12540 | 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(); | |
ea7f8538 | 96 | struct save_queue *sq_create(); |
97 | struct hash *create_hash(); | |
98 | char *hash_lookup(); | |
99 | char *strsave(); | |
100 | char *strtrim(); | |
819d4e30 | 101 | char *canonicalize_hostname(); |
f4a12540 | 102 | #endif __STDC__ |
ebf77ded | 103 | |
104 | #endif _sms_h_ /* Do Not Add Anything after this line. */ |