]> andersk Git - moira.git/blame - man/moira.3
added directory definitions
[moira.git] / man / moira.3
CommitLineData
7ad50c73 1.TH SMS 3 "8 Jan 1989"
0a796925 2.FM mit
3.SH NAME
5498c996 4sms_connect, sms_host, sms_auth, sms_disconnect, sms_noop, sms_access,
7ad50c73 5sms_query, sms_do_update, sms_motd, sms_set_alternate_input,
6format_filesys_type, parse_filesys_type,
0a796925 7canonicalize_hostname, strsave, strtrim, sq_create, sq_destroy,
8sq_get_data, sq_save_args, sq_save_data, sq_save_unique_data,
9sq_save_unique_string, Start_paging, Stop_paging, Start_menu,
10Start_no_menu, Cleanup_menu, Prompt_input, Password_input, Put_message
11.SH SYNOPSIS
12.nf
13.nj
14.TP
15Protocol functions
16.B #include <sms.h>
17
18.B extern int sending_version_no;
19
20.B int sms_connect(server);
21.B char *server;
22
5498c996 23.B int sms_host(host, size);
24.B char *server;
25
ca170892 26.B int sms_motd(motd);
27.B char **motd;
28
0a796925 29.B int sms_auth(prog);
30.B char *prog;
31
32.B int sms_disconnect();
33
34.B int sms_noop();
35
36.B int sms_access(name, argc, argv);
37.B char *name;
38.B int argc;
39.B char **argv;
40
41.B int sms_query(name, argc, argv, callproc, callarg);
42.B char *name;
43.B int argc;
44.B char **argv;
45.B int (*callproc)(int, char **, char *);
46.B char *callarg;
47
48.B int sms_do_update();
7ad50c73 49
50.B int sms_set_alternate_input(fd, proc)
51.B int fd;
52.B void (*proc)();
0a796925 53.TP
54Data manipulation
55.B char *format_filesys_type(fs_status);
56.B char *fs_status;
57
58.B char *parse_filesys_type(fs_type_name);
59.B char *fs_type_name;
60
61.B char *canonicalize_hostname(host);
62.B char *host;
63
64.B char *strsave(s);
65.B char *s;
66
67.B char *strtrim(s);
68.B char *s;
69.TP
70Simple Queues
71.B struct save_queue *sq_create();
72
73.B sq_destroy(sq);
74.B struct save_queue *sq;
75
76.B int sq_get_data(sq, data);
77.B char **data;
78
79.B sq_save_args(argc, argv, sq);
80
81.B sq_save_data(sq, data);
82
83.B sq_save_unique_data(sq, data);
84
85.B sq_save_unique_string(sq, data);
86.TP
87Menus
88.B #include <menu.h>
89.B char *whoami = argv[0];
90
91.B Start_paging();
92
93.B Stop_paging();
94
95.B Start_menu(top_menu);
96.B Menu *top_menu;
97
98.B Start_no_menu(top_menu);
99
100.B Cleanup_menu();
101
102.B Prompt_input(prompt, buf, buflen);
103.B char *prompt, buf;
104.B int buflen;
105
106.B Password_input(prompt, buf, buflen);
107
108.B Put_message(msg);
109.B char *msg;
110.fi
111.SH DESCRIPTION
112This library supports the Athena Service Management System protocol
113and related operations. The library contains many routines beyond
114those described in this man page, but they are not intended to be used
115directly. Instead, they are called by the routines that are described.
7726d871 116
117Be sure to link your application against these libraries:
118-lsms -lsmsgdb -lcom_err -lkrb -ldes, and also curses if the menu are
119routines are to be used.
0a796925 120.TP
121Protocol functions
a4a12338 122All protocol routines return 0 on success, or a value from
0a796925 123.I <sms_et.h>
ca170892 124on failure. An application should connect, check the motd in case the
125server is closed, authenticate, perform queries, then disconnect.
0a796925 126
127.I sending_version_no
128may be set to
129.B SMS_VERSION_1
130or
131.B SMS_VERSION_2
132to determine the version of the protocol that will be used. It
133currently defaults to
134.B SMS_VERSION_2.
135
136.B sms_connect
137establishes a connection with the SMS server. The
138.I server
139specification is of the form hostname:portname, where the portname can
140be looked up in
141.B /etc/services.
142
5498c996 143.B sms_host
144initializes
145.I host
146with the name of the host that the client is currently connected to.
147
ca170892 148.B sms_motd
149will check to see if the server is closed and if so, will retrieve an
150explanatory message (the so-called motd). This routine will always
151return 0 if no error occurs. *motd will be NULL if the server is
152functioning normally, or a pointer to a static string with the
153explanation if the server is down.
154
0a796925 155.B sms_auth
156authenticates an established connection using Kerberos.
157.I prog
158is the name of the program making the connection. The program name
159and the kerberos principal name will be recorded with any changes made
160to the database through this connection.
161
162.B sms_disconnect
163severs the connection with the SMS server.
164
165.B sms_noop
166pings the SMS server through a "no operation" request, verifying that
167the connection is still working.
168
169.B sms_access
170Verifies that the authenticated user has the necessary access to
171perform the query specified by
172.I name, argc,
173and
174.I argv.
175
176.B sms_query
177performs a query. This query may be a retrieval, append, delete, or
178update of the database. Query
179.I name
180will be executed with the
181.I argc
182arguments specified in the string array
183.I argv.
184For each return tuple,
185.I callproc
186will be called with an
187.I argc, argv,
188and the value passed to
189.B sms_query
190as
191.I callarg.
192
193.B sms_do_update
194triggers a DCM update immediately on the SMS server.
7ad50c73 195
196.B sms_set_alternate_input
197tells the Moira library that you want to allow some asynchronus
198actions while a query is being processed. During query processing, if
199any data is available to be read on the specified file descriptor,
200then the specified function will be called to handle it. For
201instance, calling sms_set_alternate_input with the connection to the X
202server and a routine which will dispatch X events will allow a toolkit
203application to handle mouse and expose events while a query is being
204processed.
0a796925 205.TP
206Data manipulation
207.B format_filesys_type
208returns a user-displayable representation of the status bits on an NFS
209physical partition.
210.I fs_status
211is the ascii representation of the integer value of that field.
212
213.B parse_filesys_type
214returns the numeric value of the filesystem type, given a string
215describing an NFS physical partition allocation type. The returned
216value is a pointer to a static buffer containing the ascii
217representation of the integer value.
218
219.B canonicalize_hostname
220attempts to update what is possibly the nickname for a host to its
221canonical form which is a fully specified, uppercase domain name.
222If the named host is in the namespace, it calls the nameserver to
223expand it and return the primary name of the host. Otherwise, it just
224returns the argument. It assumes that
225.I host
226was allocated using
227.I malloc(),
228and may be freed or realloc'ed before returning. The returned value
229will be a malloc'ed value, possibly the same buffer as the argument.
230
231.B strsave
232will malloc some memory and make a copy of
233.I s.
234
235.B strtrim
236will trim whitespace off of both ends of the string
237.I s.
238The returned value will be a pointer into the same buffer
239.I s
240pointed to.
241
242.B sq_create
243will create an empty save_queue.
244.TP
245Simple Queues
246.B sq_destroy
247will free all of the memory contained in the queue structure
248.I sq.
249It will not attempt to free the elements.
250
251.B sq_get_data
252will fill in
253.I data
254with the next piece of data in the queue. If will return 0 if there
255is no more data in the queue.
256
257.B sq_save_args
258will make a copy of
259.I argv,
260null terminate it so that
261.I argc
262is not necessary, and save this value on the end of the queue
263.I sq.
264
265.B sq_save_data
266saves
267.I data
268on the end of the queue
269.I sq.
270
271.B sq_save_unique_data
272will save
273.I data
274on the queue if it does not already appear in the queue. If it is
275already present, nothing is modified and no errors are returned.
276.B sq_save_unique_string
277is like
278.B sq_save_unique_data,
279except that it uses strcmp on the elements rather than comparing the
280addresses directly.
281.TP
282Menus
283The menu package requires that the string
284.B whoami
285be defined. It is usually set to argv[0] of the program.
286
287.B Start_paging
288initializes menu package and sets up the screen.
289
290.B Stop_paging
291resets the screen to normal mode. This must be done before the
292program exits to put the tty back into a sane mode.
293
294.B Start_menu
295starts interpreting menus with
296.I top_menu,
297giving the menu package complete control of the screen.
298.B Start_paging
299must have been called first.
300
301.B Start_no_menu
302starts interpreting menus, but does not entirely give up control of
303the screen. The menu package will treat the tty as a printing
304terminal.
305
306.B Cleanup_menu
307aborts the menu package and returns the tty to sane modes.
308
309.B Prompt_input
a4a12338 310will get input from the user, using the dialogue window on the screen.
0a796925 311It will first display
312.I prompt,
313then read up to
314.I buflen
315bytes into the buffer
316.I buf.
317
318.B Password_input
319is like
320.I Prompt_input,
321except that the value the user types is not echoed.
322.B Put_message
323writes
324.I msg
325to the screen, appending a newline at the end.
326.SH FILES
327/usr/include/sms.h
328.br
329/usr/include/sms_et.h
330.br
331/tmp/tkt###
332.SH "SEE ALSO"
a4a12338 333smstest(8), The Service Management System section of the Athena
0a796925 334Technical Plan
335.SH DIAGNOSTICS
336The error codes returned are those defined in <sms_et.h>, or
337<krb_et.h>. They may be easily decoded using the com_err library.
338.SH RESTRICTIONS
7ad50c73 339COPYRIGHT 1987,1988,1989 Massachusetts Institute of Technology
This page took 0.09903 seconds and 5 git commands to generate.