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