]> andersk Git - moira.git/blame - man/moira.3
grammar fix
[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.
105.TP
106Protocol functions
a4a12338 107All protocol routines return 0 on success, or a value from
0a796925 108.I <sms_et.h>
109on failure. An application should connect, authenticate, perform
110queries, then disconnect.
111
112.I sending_version_no
113may be set to
114.B SMS_VERSION_1
115or
116.B SMS_VERSION_2
117to determine the version of the protocol that will be used. It
118currently defaults to
119.B SMS_VERSION_2.
120
121.B sms_connect
122establishes a connection with the SMS server. The
123.I server
124specification is of the form hostname:portname, where the portname can
125be looked up in
126.B /etc/services.
127
128.B sms_auth
129authenticates an established connection using Kerberos.
130.I prog
131is the name of the program making the connection. The program name
132and the kerberos principal name will be recorded with any changes made
133to the database through this connection.
134
135.B sms_disconnect
136severs the connection with the SMS server.
137
138.B sms_noop
139pings the SMS server through a "no operation" request, verifying that
140the connection is still working.
141
142.B sms_access
143Verifies that the authenticated user has the necessary access to
144perform the query specified by
145.I name, argc,
146and
147.I argv.
148
149.B sms_query
150performs a query. This query may be a retrieval, append, delete, or
151update of the database. Query
152.I name
153will be executed with the
154.I argc
155arguments specified in the string array
156.I argv.
157For each return tuple,
158.I callproc
159will be called with an
160.I argc, argv,
161and the value passed to
162.B sms_query
163as
164.I callarg.
165
166.B sms_do_update
167triggers a DCM update immediately on the SMS server.
168.TP
169Data manipulation
170.B format_filesys_type
171returns a user-displayable representation of the status bits on an NFS
172physical partition.
173.I fs_status
174is the ascii representation of the integer value of that field.
175
176.B parse_filesys_type
177returns the numeric value of the filesystem type, given a string
178describing an NFS physical partition allocation type. The returned
179value is a pointer to a static buffer containing the ascii
180representation of the integer value.
181
182.B canonicalize_hostname
183attempts to update what is possibly the nickname for a host to its
184canonical form which is a fully specified, uppercase domain name.
185If the named host is in the namespace, it calls the nameserver to
186expand it and return the primary name of the host. Otherwise, it just
187returns the argument. It assumes that
188.I host
189was allocated using
190.I malloc(),
191and may be freed or realloc'ed before returning. The returned value
192will be a malloc'ed value, possibly the same buffer as the argument.
193
194.B strsave
195will malloc some memory and make a copy of
196.I s.
197
198.B strtrim
199will trim whitespace off of both ends of the string
200.I s.
201The returned value will be a pointer into the same buffer
202.I s
203pointed to.
204
205.B sq_create
206will create an empty save_queue.
207.TP
208Simple Queues
209.B sq_destroy
210will free all of the memory contained in the queue structure
211.I sq.
212It will not attempt to free the elements.
213
214.B sq_get_data
215will fill in
216.I data
217with the next piece of data in the queue. If will return 0 if there
218is no more data in the queue.
219
220.B sq_save_args
221will make a copy of
222.I argv,
223null terminate it so that
224.I argc
225is not necessary, and save this value on the end of the queue
226.I sq.
227
228.B sq_save_data
229saves
230.I data
231on the end of the queue
232.I sq.
233
234.B sq_save_unique_data
235will save
236.I data
237on the queue if it does not already appear in the queue. If it is
238already present, nothing is modified and no errors are returned.
239.B sq_save_unique_string
240is like
241.B sq_save_unique_data,
242except that it uses strcmp on the elements rather than comparing the
243addresses directly.
244.TP
245Menus
246The menu package requires that the string
247.B whoami
248be defined. It is usually set to argv[0] of the program.
249
250.B Start_paging
251initializes menu package and sets up the screen.
252
253.B Stop_paging
254resets the screen to normal mode. This must be done before the
255program exits to put the tty back into a sane mode.
256
257.B Start_menu
258starts interpreting menus with
259.I top_menu,
260giving the menu package complete control of the screen.
261.B Start_paging
262must have been called first.
263
264.B Start_no_menu
265starts interpreting menus, but does not entirely give up control of
266the screen. The menu package will treat the tty as a printing
267terminal.
268
269.B Cleanup_menu
270aborts the menu package and returns the tty to sane modes.
271
272.B Prompt_input
a4a12338 273will get input from the user, using the dialogue window on the screen.
0a796925 274It will first display
275.I prompt,
276then read up to
277.I buflen
278bytes into the buffer
279.I buf.
280
281.B Password_input
282is like
283.I Prompt_input,
284except that the value the user types is not echoed.
285.B Put_message
286writes
287.I msg
288to the screen, appending a newline at the end.
289.SH FILES
290/usr/include/sms.h
291.br
292/usr/include/sms_et.h
293.br
294/tmp/tkt###
295.SH "SEE ALSO"
a4a12338 296smstest(8), The Service Management System section of the Athena
0a796925 297Technical Plan
298.SH DIAGNOSTICS
299The error codes returned are those defined in <sms_et.h>, or
300<krb_et.h>. They may be easily decoded using the com_err library.
301.SH RESTRICTIONS
302COPYRIGHT 1987,1988 Massachusetts Institute of Technology
This page took 0.226719 seconds and 5 git commands to generate.