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