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