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
17 .B int mr_connect(server);
20 .B int mr_host(host, size);
29 .B int mr_disconnect();
33 .B int mr_access(name, argc, argv);
38 .B int mr_query(name, argc, argv, callproc, callarg);
42 .B int (*callproc)(int, char **, char *);
45 .B int mr_do_update();
47 .B int mr_set_alternate_input(fd, proc)
52 .B char *format_filesys_type(fs_status);
55 .B char *parse_filesys_type(fs_type_name);
56 .B char *fs_type_name;
58 .B char *canonicalize_hostname(host);
68 .B struct save_queue *sq_create();
71 .B struct save_queue *sq;
73 .B int sq_get_data(sq, data);
76 .B int sq_remove_data(sq, data);
80 .B sq_save_args(argc, argv, sq);
82 .B sq_save_data(sq, data);
84 .B sq_save_unique_data(sq, data);
86 .B sq_save_unique_string(sq, data);
89 This library supports the Athena Service Management System protocol
90 and related operations. The library contains many routines beyond
91 those described in this man page, but they are not intended to be used
92 directly. Instead, they are called by the routines that are described.
94 Be sure to link your application against these libraries:
95 -lmoira -lmrgdb -lcom_err -lkrb -ldes
98 All protocol routines return 0 on success, or a value from
100 on failure. An application should connect, check the motd in case the
101 server is closed, authenticate, perform queries, then disconnect.
104 establishes a connection with the Moira server. The
106 specification is optional. If present, it is of the form
107 hostname:portname, where the portname can be looked up in
109 If NULL or an empty string is passed as
111 then the server will be found from the MOIRASERVER environment
112 variable, the "moira" sloc entry in hesiod, or the compiled in
113 default, in that order.
118 with the name of the host that the client is currently connected to.
121 will check to see if the server is closed and if so, will retrieve an
122 explanatory message (the so-called motd). This routine will always
123 return 0 if no error occurs. *motd will be NULL if the server is
124 functioning normally, or a pointer to a static string with the
125 explanation if the server is down.
128 authenticates an established connection using Kerberos.
130 is the name of the program making the connection. The program name
131 and the kerberos principal name will be recorded with any changes made
132 to the database through this connection.
135 severs the connection with the Moira server.
138 pings the Moira server through a "no operation" request, verifying that
139 the connection is still working.
142 Verifies that the authenticated user has the necessary access to
143 perform the query specified by
149 performs a query. This query may be a retrieval, append, delete, or
150 update of the database. Query
152 will be executed with the
154 arguments specified in the string array
156 For each return tuple,
158 will be called with an
160 and the value passed to
166 triggers a DCM update immediately on the Moira server.
168 .B mr_set_alternate_input
169 tells the Moira library that you want to allow some asynchronus
170 actions while a query is being processed. During query processing, if
171 any data is available to be read on the specified file descriptor,
172 then the specified function will be called to handle it. For
173 instance, calling mr_set_alternate_input with the connection to the X
174 server and a routine which will dispatch X events will allow a toolkit
175 application to handle mouse and expose events while a query is being
179 .B format_filesys_type
180 returns a user-displayable representation of the status bits on an NFS
183 is the ascii representation of the integer value of that field.
185 .B parse_filesys_type
186 returns the numeric value of the filesystem type, given a string
187 describing an NFS physical partition allocation type. The returned
188 value is a pointer to a static buffer containing the ascii
189 representation of the integer value.
191 .B canonicalize_hostname
192 attempts to update what is possibly the nickname for a host to its
193 canonical form which is a fully specified, uppercase domain name.
194 If the named host is in the namespace, it calls the nameserver to
195 expand it and return the primary name of the host. Otherwise, it just
196 returns the argument. It assumes that
200 and may be freed or realloc'ed before returning. The returned value
201 will be a malloc'ed value, possibly the same buffer as the argument.
204 will malloc some memory and make a copy of
208 will trim whitespace off of both ends of the string
210 The returned value will be a pointer into the same buffer
217 will create an empty save_queue.
220 will free all of the memory contained in the queue structure
222 It will not attempt to free the elements.
227 with the next piece of data in the queue. If will return 0 if there
228 is no more data in the queue.
231 functions like sq_get_data except that any returned data is first
232 removed from the queue.
235 tests the length of the queue, returning non-zero if it is empty or
236 zero if the queue contains data.
241 null terminate it so that
243 is not necessary, and save this value on the end of the queue
249 on the end of the queue
252 .B sq_save_unique_data
255 on the queue if it does not already appear in the queue. If it is
256 already present, nothing is modified and no errors are returned.
257 .B sq_save_unique_string
259 .B sq_save_unique_data,
260 except that it uses strcmp on the elements rather than comparing the
263 /usr/athena/include/moira.h
265 /usr/athena/include/mr_et.h
269 mrtest(8), The Moira section of the Athena Technical Plan
271 The error codes returned are those defined in <mr_et.h>, or
272 <krb_et.h>. They may be easily decoded using the com_err library.
274 COPYRIGHT 1987,1988,1989 Massachusetts Institute of Technology