source: trunk/third/moira/man/moira.3 @ 23095

Revision 23095, 6.2 KB checked in by ghudson, 16 years ago (diff)
Import the moira package from SIPB Debathena.
RevLine 
[23095]1.TH MOIRA 3 "8 Jan 1989"
2.FM mit
3.SH NAME
4mr_connect, mr_host, mr_auth, mr_disconnect, mr_noop, mr_access,
5mr_query, mr_do_update, mr_motd, mr_set_alternate_input,
6format_filesys_type, parse_filesys_type,
7canonicalize_hostname, strsave, strtrim, sq_create, sq_destroy,
8sq_get_data, sq_remove_data, sq_empty, sq_save_args, sq_save_data,
9sq_save_unique_data, sq_save_unique_string
10.SH SYNOPSIS
11.nf
12.nj
13.TP
14Protocol functions
15.B
16int mr_connect(char *server);
17
18.B
19int mr_host(char *host, int size);
20
21.B
22int mr_motd(char **motd);
23
24.B
25int mr_auth(char *prog);
26
27.B
28int mr_disconnect(void);
29
30.B
31int mr_noop(void);
32
33.B
34int mr_access(char *name, int argc, char **argv);
35
36.B
37int mr_query(char *name, int argc, char **argv,
38.B
39        int (*callproc)(int, char **, void *), void *callarg);
40
41.TP
42Data manipulation
43.B
44char *format_filesys_type(char *fs_status);
45
46.B
47char *parse_filesys_type(char *fs_type_name);
48
49.B
50char *canonicalize_hostname(char *host);
51
52.B
53char *strtrim(char *s);
54.TP
55Simple Queues
56.B
57struct save_queue *sq_create(void);
58
59.B
60void sq_destroy(struct save_queue *sq);
61
62.B
63int sq_get_data(struct save_queue *sq, void *data);
64
65.B
66int sq_remove_data(struct save_queue *sq, void *data);
67
68.B
69int sq_empty(struct save_queue *sq);
70
71.B
72sq_save_args(int argc, char **argv, struct save_queue *sq);
73
74.B
75sq_save_data(struct save_queue *sq, void *data);
76
77.B
78sq_save_unique_data(struct save_queue *sq, void *data);
79
80.B
81sq_save_unique_string(struct save_queue *sq, char *data);
82.fi
83.SH DESCRIPTION
84This library supports the Athena Service Management System protocol
85and related operations.  The library contains many routines beyond
86those described in this man page, but they are not intended to be used
87directly. Instead, they are called by the routines that are described.
88
89Be sure to link your application against these libraries:
90-lmoira -lkrb -ldes -lcom_err
91.TP
92Protocol functions
93All protocol routines return 0 on success, or a value from
94.I <mr_et.h>
95on failure.  An application should connect, check the motd in case the
96server is closed, authenticate, perform queries, then disconnect.
97
98.B mr_connect
99establishes a connection with the Moira server.  The
100.I server
101specification is optional.  If present, it is of the form
102hostname:portname, where the portname can be looked up in
103.B /etc/services.
104If NULL or an empty string is passed as
105.I server,
106then the server will be found from the MOIRASERVER environment
107variable, the "moira" sloc entry in hesiod, or the compiled in
108default, in that order.
109
110.B mr_host
111initializes
112.I host
113with the name of the host that the client is currently connected to.
114
115.B mr_motd
116will check to see if the server is closed and if so, will retrieve an
117explanatory message (the so-called motd).  This routine will always
118return 0 if no error occurs.  *motd will be NULL if the server is
119functioning normally, or a pointer to a static string with the
120explanation if the server is down.
121
122.B mr_auth
123authenticates an established connection using Kerberos.
124.I prog
125is the name of the program making the connection.  The program name
126and the kerberos principal name will be recorded with any changes made
127to the database through this connection.
128
129.B mr_disconnect
130severs the connection with the Moira server.
131
132.B mr_noop
133pings the Moira server through a "no operation" request, verifying that
134the connection is still working.
135
136.B mr_access
137Verifies that the authenticated user has the necessary access to
138perform the query specified by
139.I name, argc,
140and
141.I argv.
142
143.B mr_query
144performs a query.  This query may be a retrieval, append, delete, or
145update of the database.  Query
146.I name
147will be executed with the
148.I argc
149arguments specified in the string array
150.I argv.
151For each return tuple,
152.I callproc
153will be called with an
154.I argc, argv,
155and the value passed to
156.B mr_query
157as
158.I callarg.
159
160.TP
161Data manipulation
162.B format_filesys_type
163returns a user-displayable representation of the status bits on an NFS
164physical partition.
165.I fs_status
166is the ascii representation of the integer value of that field.
167
168.B parse_filesys_type
169returns the numeric value of the filesystem type, given a string
170describing an NFS physical partition allocation type.  The returned
171value is a pointer to a static buffer containing the ascii
172representation of the integer value.
173
174.B canonicalize_hostname
175attempts to update what is possibly the nickname for a host to its
176canonical form which is a fully specified, uppercase domain name.
177If the named host is in the namespace, it calls the nameserver to
178expand it and return the primary name of the host.  Otherwise, it just
179returns the argument.  It assumes that
180.I host
181was allocated using
182.I malloc(),
183and may be freed or realloc'ed before returning.  The returned value
184will be a malloc'ed value, possibly the same buffer as the argument.
185
186.B strtrim
187will trim whitespace off of both ends of the string
188.I s.
189The returned value will be a pointer into the same buffer
190.I s
191pointed to.
192
193.TP
194Simple Queues
195.B sq_create
196will create an empty save_queue.
197
198.B sq_destroy
199will free all of the memory contained in the queue structure
200.I sq.
201It will not attempt to free the elements.
202
203.B sq_get_data
204will fill in
205.I data
206with the next piece of data in the queue.  If will return 0 if there
207is no more data in the queue.
208
209.B sq_remove_data
210functions like sq_get_data except that any returned data is first
211removed from the queue.
212
213.B sq_empty
214tests the length of the queue, returning non-zero if it is empty or
215zero if the queue contains data.
216
217.B sq_save_args
218will make a copy of
219.I argv,
220null terminate it so that
221.I argc
222is not necessary, and save this value on the end of the queue
223.I sq.
224
225.B sq_save_data
226saves
227.I data
228on the end of the queue
229.I sq.
230
231.B sq_save_unique_data
232will save
233.I data
234on the queue if it does not already appear in the queue.  If it is
235already present, nothing is modified and no errors are returned.
236.B sq_save_unique_string
237is like
238.B sq_save_unique_data,
239except that it uses strcmp on the elements rather than comparing the
240addresses directly.
241.SH FILES
242/usr/athena/include/moira.h
243.br
244/usr/athena/include/mr_et.h
245.br
246/tmp/tkt###
247.SH "SEE ALSO"
248mrtest(8), The Moira section of the Athena Technical Plan
249.SH DIAGNOSTICS
250The 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.
252.SH RESTRICTIONS
253COPYRIGHT 1987,1988,1989 Massachusetts Institute of Technology
Note: See TracBrowser for help on using the repository browser.