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,
17 .B extern int sending_version_no;
19 .B int sms_connect(server);
22 .B int sms_host(host, size);
25 .B int sms_motd(motd);
28 .B int sms_auth(prog);
31 .B int sms_disconnect();
35 .B int sms_access(name, argc, argv);
40 .B int sms_query(name, argc, argv, callproc, callarg);
44 .B int (*callproc)(int, char **, char *);
47 .B int sms_do_update();
49 .B int sms_set_alternate_input(fd, proc)
54 .B char *format_filesys_type(fs_status);
57 .B char *parse_filesys_type(fs_type_name);
58 .B char *fs_type_name;
60 .B char *canonicalize_hostname(host);
70 .B struct save_queue *sq_create();
73 .B struct save_queue *sq;
75 .B int sq_get_data(sq, data);
78 .B sq_save_args(argc, argv, sq);
80 .B sq_save_data(sq, data);
82 .B sq_save_unique_data(sq, data);
84 .B sq_save_unique_string(sq, data);
87 This library supports the Athena Service Management System protocol
88 and related operations. The library contains many routines beyond
89 those described in this man page, but they are not intended to be used
90 directly. Instead, they are called by the routines that are described.
92 Be sure to link your application against these libraries:
93 -lsms -lsmsgdb -lcom_err -lkrb -ldes
96 All protocol routines return 0 on success, or a value from
98 on failure. An application should connect, check the motd in case the
99 server is closed, authenticate, perform queries, then disconnect.
101 .I sending_version_no
106 to determine the version of the protocol that will be used. It
107 currently defaults to
111 establishes a connection with the SMS server. The
113 specification is of the form hostname:portname, where the portname can
120 with the name of the host that the client is currently connected to.
123 will check to see if the server is closed and if so, will retrieve an
124 explanatory message (the so-called motd). This routine will always
125 return 0 if no error occurs. *motd will be NULL if the server is
126 functioning normally, or a pointer to a static string with the
127 explanation if the server is down.
130 authenticates an established connection using Kerberos.
132 is the name of the program making the connection. The program name
133 and the kerberos principal name will be recorded with any changes made
134 to the database through this connection.
137 severs the connection with the SMS server.
140 pings the SMS server through a "no operation" request, verifying that
141 the connection is still working.
144 Verifies that the authenticated user has the necessary access to
145 perform the query specified by
151 performs a query. This query may be a retrieval, append, delete, or
152 update of the database. Query
154 will be executed with the
156 arguments specified in the string array
158 For each return tuple,
160 will be called with an
162 and the value passed to
168 triggers a DCM update immediately on the SMS server.
170 .B sms_set_alternate_input
171 tells the Moira library that you want to allow some asynchronus
172 actions while a query is being processed. During query processing, if
173 any data is available to be read on the specified file descriptor,
174 then the specified function will be called to handle it. For
175 instance, calling sms_set_alternate_input with the connection to the X
176 server and a routine which will dispatch X events will allow a toolkit
177 application to handle mouse and expose events while a query is being
181 .B format_filesys_type
182 returns a user-displayable representation of the status bits on an NFS
185 is the ascii representation of the integer value of that field.
187 .B parse_filesys_type
188 returns the numeric value of the filesystem type, given a string
189 describing an NFS physical partition allocation type. The returned
190 value is a pointer to a static buffer containing the ascii
191 representation of the integer value.
193 .B canonicalize_hostname
194 attempts to update what is possibly the nickname for a host to its
195 canonical form which is a fully specified, uppercase domain name.
196 If the named host is in the namespace, it calls the nameserver to
197 expand it and return the primary name of the host. Otherwise, it just
198 returns the argument. It assumes that
202 and may be freed or realloc'ed before returning. The returned value
203 will be a malloc'ed value, possibly the same buffer as the argument.
206 will malloc some memory and make a copy of
210 will trim whitespace off of both ends of the string
212 The returned value will be a pointer into the same buffer
217 will create an empty save_queue.
221 will free all of the memory contained in the queue structure
223 It will not attempt to free the elements.
228 with the next piece of data in the queue. If will return 0 if there
229 is no more data in the queue.
234 null terminate it so that
236 is not necessary, and save this value on the end of the queue
242 on the end of the queue
245 .B sq_save_unique_data
248 on the queue if it does not already appear in the queue. If it is
249 already present, nothing is modified and no errors are returned.
250 .B sq_save_unique_string
252 .B sq_save_unique_data,
253 except that it uses strcmp on the elements rather than comparing the
258 /usr/include/sms_et.h
262 smstest(8), The Service Management System section of the Athena
265 The error codes returned are those defined in <sms_et.h>, or
266 <krb_et.h>. They may be easily decoded using the com_err library.
268 COPYRIGHT 1987,1988,1989 Massachusetts Institute of Technology