4 sms_connect, sms_host, sms_auth, sms_disconnect, sms_noop, sms_access,
5 sms_query, sms_do_update, sms_motd, sms_set_alternate_input,
6 format_filesys_type, parse_filesys_type,
7 canonicalize_hostname, strsave, strtrim, sq_create, sq_destroy,
8 sq_get_data, sq_save_args, sq_save_data, sq_save_unique_data,
9 sq_save_unique_string, Start_paging, Stop_paging, Start_menu,
10 Start_no_menu, Cleanup_menu, Prompt_input, Password_input, Put_message
18 .B extern int sending_version_no;
20 .B int sms_connect(server);
23 .B int sms_host(host, size);
26 .B int sms_motd(motd);
29 .B int sms_auth(prog);
32 .B int sms_disconnect();
36 .B int sms_access(name, argc, argv);
41 .B int sms_query(name, argc, argv, callproc, callarg);
45 .B int (*callproc)(int, char **, char *);
48 .B int sms_do_update();
50 .B int sms_set_alternate_input(fd, proc)
55 .B char *format_filesys_type(fs_status);
58 .B char *parse_filesys_type(fs_type_name);
59 .B char *fs_type_name;
61 .B char *canonicalize_hostname(host);
71 .B struct save_queue *sq_create();
74 .B struct save_queue *sq;
76 .B int sq_get_data(sq, data);
79 .B sq_save_args(argc, argv, sq);
81 .B sq_save_data(sq, data);
83 .B sq_save_unique_data(sq, data);
85 .B sq_save_unique_string(sq, data);
89 .B char *whoami = argv[0];
95 .B Start_menu(top_menu);
98 .B Start_no_menu(top_menu);
102 .B Prompt_input(prompt, buf, buflen);
103 .B char *prompt, buf;
106 .B Password_input(prompt, buf, buflen);
112 This library supports the Athena Service Management System protocol
113 and related operations. The library contains many routines beyond
114 those described in this man page, but they are not intended to be used
115 directly. Instead, they are called by the routines that are described.
117 Be sure to link your application against these libraries:
118 -lsms -lsmsgdb -lcom_err -lkrb -ldes, and also curses if the menu are
119 routines are to be used.
122 All protocol routines return 0 on success, or a value from
124 on failure. An application should connect, check the motd in case the
125 server is closed, authenticate, perform queries, then disconnect.
127 .I sending_version_no
132 to determine the version of the protocol that will be used. It
133 currently defaults to
137 establishes a connection with the SMS server. The
139 specification is of the form hostname:portname, where the portname can
146 with the name of the host that the client is currently connected to.
149 will check to see if the server is closed and if so, will retrieve an
150 explanatory message (the so-called motd). This routine will always
151 return 0 if no error occurs. *motd will be NULL if the server is
152 functioning normally, or a pointer to a static string with the
153 explanation if the server is down.
156 authenticates an established connection using Kerberos.
158 is the name of the program making the connection. The program name
159 and the kerberos principal name will be recorded with any changes made
160 to the database through this connection.
163 severs the connection with the SMS server.
166 pings the SMS server through a "no operation" request, verifying that
167 the connection is still working.
170 Verifies that the authenticated user has the necessary access to
171 perform the query specified by
177 performs a query. This query may be a retrieval, append, delete, or
178 update of the database. Query
180 will be executed with the
182 arguments specified in the string array
184 For each return tuple,
186 will be called with an
188 and the value passed to
194 triggers a DCM update immediately on the SMS server.
196 .B sms_set_alternate_input
197 tells the Moira library that you want to allow some asynchronus
198 actions while a query is being processed. During query processing, if
199 any data is available to be read on the specified file descriptor,
200 then the specified function will be called to handle it. For
201 instance, calling sms_set_alternate_input with the connection to the X
202 server and a routine which will dispatch X events will allow a toolkit
203 application to handle mouse and expose events while a query is being
207 .B format_filesys_type
208 returns a user-displayable representation of the status bits on an NFS
211 is the ascii representation of the integer value of that field.
213 .B parse_filesys_type
214 returns the numeric value of the filesystem type, given a string
215 describing an NFS physical partition allocation type. The returned
216 value is a pointer to a static buffer containing the ascii
217 representation of the integer value.
219 .B canonicalize_hostname
220 attempts to update what is possibly the nickname for a host to its
221 canonical form which is a fully specified, uppercase domain name.
222 If the named host is in the namespace, it calls the nameserver to
223 expand it and return the primary name of the host. Otherwise, it just
224 returns the argument. It assumes that
228 and may be freed or realloc'ed before returning. The returned value
229 will be a malloc'ed value, possibly the same buffer as the argument.
232 will malloc some memory and make a copy of
236 will trim whitespace off of both ends of the string
238 The returned value will be a pointer into the same buffer
243 will create an empty save_queue.
247 will free all of the memory contained in the queue structure
249 It will not attempt to free the elements.
254 with the next piece of data in the queue. If will return 0 if there
255 is no more data in the queue.
260 null terminate it so that
262 is not necessary, and save this value on the end of the queue
268 on the end of the queue
271 .B sq_save_unique_data
274 on the queue if it does not already appear in the queue. If it is
275 already present, nothing is modified and no errors are returned.
276 .B sq_save_unique_string
278 .B sq_save_unique_data,
279 except that it uses strcmp on the elements rather than comparing the
283 The menu package requires that the string
285 be defined. It is usually set to argv[0] of the program.
288 initializes menu package and sets up the screen.
291 resets the screen to normal mode. This must be done before the
292 program exits to put the tty back into a sane mode.
295 starts interpreting menus with
297 giving the menu package complete control of the screen.
299 must have been called first.
302 starts interpreting menus, but does not entirely give up control of
303 the screen. The menu package will treat the tty as a printing
307 aborts the menu package and returns the tty to sane modes.
310 will get input from the user, using the dialogue window on the screen.
311 It will first display
315 bytes into the buffer
321 except that the value the user types is not echoed.
325 to the screen, appending a newline at the end.
329 /usr/include/sms_et.h
333 smstest(8), The Service Management System section of the Athena
336 The 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.
339 COPYRIGHT 1987,1988,1989 Massachusetts Institute of Technology