]>
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 | ||
ac3530a2 | 27 | /* Protocol operations */ |
0fa91a0a | 28 | #define SMS_NOOP 0 |
29 | #define SMS_AUTH 1 | |
6d409214 | 30 | #define SMS_SHUTDOWN 2 |
4bce71fa | 31 | #define SMS_QUERY 3 |
f358be80 | 32 | #define SMS_ACCESS 4 |
1a1fe0bc | 33 | #define SMS_DO_UPDATE 5 |
379bd35f | 34 | #define SMS_MOTD 6 |
35 | #define SMS_MAX_PROC 6 | |
1a1fe0bc | 36 | |
ac3530a2 | 37 | /* values used in NFS physical flags */ |
1a1fe0bc | 38 | #define SMS_FS_STUDENT 0x0001 |
39 | #define SMS_FS_FACULTY 0x0002 | |
40 | #define SMS_FS_STAFF 0x0004 | |
41 | #define SMS_FS_MISC 0x0008 | |
f4a12540 | 42 | |
ac3530a2 | 43 | /* magic values to pass for list and user queries */ |
44 | #define UNIQUE_GID "create unique GID" | |
45 | #define UNIQUE_UID "create unique UID" | |
46 | #define UNIQUE_LOGIN "create unique login ID" | |
47 | ||
ea7f8538 | 48 | /* Structure used by Save Queue routines (for temporary storage of data) */ |
49 | struct save_queue | |
50 | { | |
51 | struct save_queue *q_next; | |
52 | struct save_queue *q_prev; | |
53 | struct save_queue *q_lastget; | |
54 | char *q_data; | |
55 | }; | |
56 | ||
57 | /* Hash table declarations */ | |
58 | struct bucket { | |
59 | struct bucket *next; | |
60 | int key; | |
61 | char *data; | |
62 | }; | |
63 | struct hash { | |
64 | int size; | |
65 | struct bucket **data; | |
66 | }; | |
ac3530a2 | 67 | |
f4a12540 | 68 | #ifdef __STDC__ |
69 | int sms_connect(); | |
70 | int sms_disconnect(); | |
71 | int sms_auth(); | |
72 | int sms_access(char *handle, int argc, char **argv); | |
73 | int sms_access_internal(int argc, char **argv); | |
74 | int sms_query(char *handle, int argc, char **argv, | |
75 | int (*callback)(), char *callarg); | |
76 | int sms_query_internal(int argc, char **argv, | |
77 | int (*callback)(), char *callarg); | |
78 | int sms_noop(); | |
79 | int sms_shutdown(char *reason); | |
ea7f8538 | 80 | struct save_queue *sq_create(); |
81 | struct hash *create_hash(int size); | |
82 | char *hash_lookup(struct hash *h, int key); | |
83 | char *strsave(char *s); | |
84 | char *strtrim(char *s); | |
819d4e30 | 85 | char *canonicalize_hostname(char *s); |
f4a12540 | 86 | #else !__STDC__ |
87 | int sms_connect(); | |
88 | int sms_disconnect(); | |
89 | int sms_auth(); | |
90 | int sms_access(); | |
91 | int sms_query(); | |
92 | int sms_noop(); | |
93 | int sms_shutdown(); | |
ea7f8538 | 94 | struct save_queue *sq_create(); |
95 | struct hash *create_hash(); | |
96 | char *hash_lookup(); | |
97 | char *strsave(); | |
98 | char *strtrim(); | |
819d4e30 | 99 | char *canonicalize_hostname(); |
f4a12540 | 100 | #endif __STDC__ |
ebf77ded | 101 | |
102 | #endif _sms_h_ /* Do Not Add Anything after this line. */ |