1 .TH MOIRA 3 "8 Jan 1989"
4 mr_connect, mr_host, mr_auth, mr_disconnect, mr_noop, mr_access,
5 mr_query, mr_do_update, mr_motd, mr_set_alternate_input,
6 format_filesys_type, parse_filesys_type,
7 canonicalize_hostname, strsave, strtrim, sq_create, sq_destroy,
8 sq_get_data, sq_remove_data, sq_empty, sq_save_args, sq_save_data,
9 sq_save_unique_data, sq_save_unique_string
16 int mr_connect(char *server);
19 int mr_host(char *host, int size);
22 int mr_motd(char **motd);
25 int mr_auth(char *prog);
28 int mr_disconnect(void);
34 int mr_access(char *name, int argc, char **argv);
37 int mr_query(char *name, int argc, char **argv,
39 int (*callproc)(int, char **, void *), void *callarg);
44 char *format_filesys_type(char *fs_status);
47 char *parse_filesys_type(char *fs_type_name);
50 char *canonicalize_hostname(char *host);
53 char *strtrim(char *s);
57 struct save_queue *sq_create(void);
60 void sq_destroy(struct save_queue *sq);
63 int sq_get_data(struct save_queue *sq, void *data);
66 int sq_remove_data(struct save_queue *sq, void *data);
69 int sq_empty(struct save_queue *sq);
72 sq_save_args(int argc, char **argv, struct save_queue *sq);
75 sq_save_data(struct save_queue *sq, void *data);
78 sq_save_unique_data(struct save_queue *sq, void *data);
81 sq_save_unique_string(struct save_queue *sq, char *data);
84 This library supports the Athena Service Management System protocol
85 and related operations. The library contains many routines beyond
86 those described in this man page, but they are not intended to be used
87 directly. Instead, they are called by the routines that are described.
89 Be sure to link your application against these libraries:
90 -lmoira -lkrb -ldes -lcom_err
93 All protocol routines return 0 on success, or a value from
95 on failure. An application should connect, check the motd in case the
96 server is closed, authenticate, perform queries, then disconnect.
99 establishes a connection with the Moira server. The
101 specification is optional. If present, it is of the form
102 hostname:portname, where the portname can be looked up in
104 If NULL or an empty string is passed as
106 then the server will be found from the MOIRASERVER environment
107 variable, the "moira" sloc entry in hesiod, or the compiled in
108 default, in that order.
113 with the name of the host that the client is currently connected to.
116 will check to see if the server is closed and if so, will retrieve an
117 explanatory message (the so-called motd). This routine will always
118 return 0 if no error occurs. *motd will be NULL if the server is
119 functioning normally, or a pointer to a static string with the
120 explanation if the server is down.
123 authenticates an established connection using Kerberos.
125 is the name of the program making the connection. The program name
126 and the kerberos principal name will be recorded with any changes made
127 to the database through this connection.
130 severs the connection with the Moira server.
133 pings the Moira server through a "no operation" request, verifying that
134 the connection is still working.
137 Verifies that the authenticated user has the necessary access to
138 perform the query specified by
144 performs a query. This query may be a retrieval, append, delete, or
145 update of the database. Query
147 will be executed with the
149 arguments specified in the string array
151 For each return tuple,
153 will be called with an
155 and the value passed to
162 .B format_filesys_type
163 returns a user-displayable representation of the status bits on an NFS
166 is the ascii representation of the integer value of that field.
168 .B parse_filesys_type
169 returns the numeric value of the filesystem type, given a string
170 describing an NFS physical partition allocation type. The returned
171 value is a pointer to a static buffer containing the ascii
172 representation of the integer value.
174 .B canonicalize_hostname
175 attempts to update what is possibly the nickname for a host to its
176 canonical form which is a fully specified, uppercase domain name.
177 If the named host is in the namespace, it calls the nameserver to
178 expand it and return the primary name of the host. Otherwise, it just
179 returns the argument. It assumes that
183 and may be freed or realloc'ed before returning. The returned value
184 will be a malloc'ed value, possibly the same buffer as the argument.
187 will trim whitespace off of both ends of the string
189 The returned value will be a pointer into the same buffer
196 will create an empty save_queue.
199 will free all of the memory contained in the queue structure
201 It will not attempt to free the elements.
206 with the next piece of data in the queue. If will return 0 if there
207 is no more data in the queue.
210 functions like sq_get_data except that any returned data is first
211 removed from the queue.
214 tests the length of the queue, returning non-zero if it is empty or
215 zero if the queue contains data.
220 null terminate it so that
222 is not necessary, and save this value on the end of the queue
228 on the end of the queue
231 .B sq_save_unique_data
234 on the queue if it does not already appear in the queue. If it is
235 already present, nothing is modified and no errors are returned.
236 .B sq_save_unique_string
238 .B sq_save_unique_data,
239 except that it uses strcmp on the elements rather than comparing the
242 /usr/athena/include/moira.h
244 /usr/athena/include/mr_et.h
248 mrtest(8), The Moira section of the Athena Technical Plan
250 The error codes returned are those defined in <mr_et.h>, or
251 <krb_et.h>. They may be easily decoded using the com_err library.
253 COPYRIGHT 1987,1988,1989 Massachusetts Institute of Technology