]> andersk Git - moira.git/blame - man/moira.3
SMS -> Moira; typo for -> fork
[moira.git] / man / moira.3
CommitLineData
7ad50c73 1.TH SMS 3 "8 Jan 1989"
0a796925 2.FM mit
3.SH NAME
5498c996 4sms_connect, sms_host, sms_auth, sms_disconnect, sms_noop, sms_access,
7ad50c73 5sms_query, sms_do_update, sms_motd, sms_set_alternate_input,
6format_filesys_type, parse_filesys_type,
0a796925 7canonicalize_hostname, strsave, strtrim, sq_create, sq_destroy,
8sq_get_data, sq_save_args, sq_save_data, sq_save_unique_data,
eae93edc 9sq_save_unique_string
0a796925 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();
7ad50c73 48
49.B int sms_set_alternate_input(fd, proc)
50.B int fd;
51.B void (*proc)();
0a796925 52.TP
53Data manipulation
54.B char *format_filesys_type(fs_status);
55.B char *fs_status;
56
57.B char *parse_filesys_type(fs_type_name);
58.B char *fs_type_name;
59
60.B char *canonicalize_hostname(host);
61.B char *host;
62
63.B char *strsave(s);
64.B char *s;
65
66.B char *strtrim(s);
67.B char *s;
68.TP
69Simple Queues
70.B struct save_queue *sq_create();
71
72.B sq_destroy(sq);
73.B struct save_queue *sq;
74
75.B int sq_get_data(sq, data);
76.B char **data;
77
78.B sq_save_args(argc, argv, sq);
79
80.B sq_save_data(sq, data);
81
82.B sq_save_unique_data(sq, data);
83
84.B sq_save_unique_string(sq, data);
0a796925 85.fi
86.SH DESCRIPTION
87This library supports the Athena Service Management System protocol
88and related operations. The library contains many routines beyond
89those described in this man page, but they are not intended to be used
90directly. Instead, they are called by the routines that are described.
7726d871 91
92Be sure to link your application against these libraries:
eae93edc 93-lsms -lsmsgdb -lcom_err -lkrb -ldes
0a796925 94.TP
95Protocol functions
a4a12338 96All protocol routines return 0 on success, or a value from
0a796925 97.I <sms_et.h>
ca170892 98on failure. An application should connect, check the motd in case the
99server is closed, authenticate, perform queries, then disconnect.
0a796925 100
101.I sending_version_no
102may be set to
103.B SMS_VERSION_1
104or
105.B SMS_VERSION_2
106to determine the version of the protocol that will be used. It
107currently defaults to
108.B SMS_VERSION_2.
109
110.B sms_connect
111establishes a connection with the SMS server. The
112.I server
113specification is of the form hostname:portname, where the portname can
114be looked up in
115.B /etc/services.
116
5498c996 117.B sms_host
118initializes
119.I host
120with the name of the host that the client is currently connected to.
121
ca170892 122.B sms_motd
123will check to see if the server is closed and if so, will retrieve an
124explanatory message (the so-called motd). This routine will always
125return 0 if no error occurs. *motd will be NULL if the server is
126functioning normally, or a pointer to a static string with the
127explanation if the server is down.
128
0a796925 129.B sms_auth
130authenticates an established connection using Kerberos.
131.I prog
132is the name of the program making the connection. The program name
133and the kerberos principal name will be recorded with any changes made
134to the database through this connection.
135
136.B sms_disconnect
137severs the connection with the SMS server.
138
139.B sms_noop
140pings the SMS server through a "no operation" request, verifying that
141the connection is still working.
142
143.B sms_access
144Verifies that the authenticated user has the necessary access to
145perform the query specified by
146.I name, argc,
147and
148.I argv.
149
150.B sms_query
151performs a query. This query may be a retrieval, append, delete, or
152update of the database. Query
153.I name
154will be executed with the
155.I argc
156arguments specified in the string array
157.I argv.
158For each return tuple,
159.I callproc
160will be called with an
161.I argc, argv,
162and the value passed to
163.B sms_query
164as
165.I callarg.
166
167.B sms_do_update
168triggers a DCM update immediately on the SMS server.
7ad50c73 169
170.B sms_set_alternate_input
171tells the Moira library that you want to allow some asynchronus
172actions while a query is being processed. During query processing, if
173any data is available to be read on the specified file descriptor,
174then the specified function will be called to handle it. For
175instance, calling sms_set_alternate_input with the connection to the X
176server and a routine which will dispatch X events will allow a toolkit
177application to handle mouse and expose events while a query is being
178processed.
0a796925 179.TP
180Data manipulation
181.B format_filesys_type
182returns a user-displayable representation of the status bits on an NFS
183physical partition.
184.I fs_status
185is the ascii representation of the integer value of that field.
186
187.B parse_filesys_type
188returns the numeric value of the filesystem type, given a string
189describing an NFS physical partition allocation type. The returned
190value is a pointer to a static buffer containing the ascii
191representation of the integer value.
192
193.B canonicalize_hostname
194attempts to update what is possibly the nickname for a host to its
195canonical form which is a fully specified, uppercase domain name.
196If the named host is in the namespace, it calls the nameserver to
197expand it and return the primary name of the host. Otherwise, it just
198returns the argument. It assumes that
199.I host
200was allocated using
201.I malloc(),
202and may be freed or realloc'ed before returning. The returned value
203will be a malloc'ed value, possibly the same buffer as the argument.
204
205.B strsave
206will malloc some memory and make a copy of
207.I s.
208
209.B strtrim
210will trim whitespace off of both ends of the string
211.I s.
212The returned value will be a pointer into the same buffer
213.I s
214pointed to.
215
216.B sq_create
217will create an empty save_queue.
218.TP
219Simple Queues
220.B sq_destroy
221will free all of the memory contained in the queue structure
222.I sq.
223It will not attempt to free the elements.
224
225.B sq_get_data
226will fill in
227.I data
228with the next piece of data in the queue. If will return 0 if there
229is no more data in the queue.
230
231.B sq_save_args
232will make a copy of
233.I argv,
234null terminate it so that
235.I argc
236is not necessary, and save this value on the end of the queue
237.I sq.
238
239.B sq_save_data
240saves
241.I data
242on the end of the queue
243.I sq.
244
245.B sq_save_unique_data
246will save
247.I data
248on the queue if it does not already appear in the queue. If it is
249already present, nothing is modified and no errors are returned.
250.B sq_save_unique_string
251is like
252.B sq_save_unique_data,
253except that it uses strcmp on the elements rather than comparing the
254addresses directly.
0a796925 255.SH FILES
256/usr/include/sms.h
257.br
258/usr/include/sms_et.h
259.br
260/tmp/tkt###
261.SH "SEE ALSO"
a4a12338 262smstest(8), The Service Management System section of the Athena
0a796925 263Technical Plan
264.SH DIAGNOSTICS
265The 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.
267.SH RESTRICTIONS
7ad50c73 268COPYRIGHT 1987,1988,1989 Massachusetts Institute of Technology
This page took 0.094437 seconds and 5 git commands to generate.