6 * Copyright (C) 1987, 1989 by the Massachusetts Institute of Technology
7 * For copying and distribution information, please see the file
10 * This routine is part of the client library. It handles
11 * the protocol operations: invoking an update and getting the
12 * SMS message of the day.
16 static char *rcsid_sms_do_update_c = "$Header$";
19 #include <mit-copyright.h>
20 #include "sms_private.h"
23 /* Invoke a DCM update. */
29 struct sms_params *params = NULL;
30 struct sms_params *reply = NULL;
34 params->sms_version_no = sending_version_no;
35 params->sms_procno = SMS_DO_UPDATE;
37 params->sms_argl = NULL;
38 params->sms_argv = NULL;
40 if ((status = sms_do_call(params, &reply)) == 0)
41 status = reply->sms_status;
43 sms_destroy_reply(reply);
49 /* Get the SMS motd. This returns an SMS status, and motd will either
50 * point to NULL or the motd in a static buffer.
58 struct sms_params *params = NULL;
59 struct sms_params *reply = NULL;
60 static char buffer[1024];
65 params->sms_version_no = sending_version_no;
66 params->sms_procno = SMS_MOTD;
68 params->sms_argl = NULL;
69 params->sms_argv = NULL;
71 if ((status = sms_do_call(params, &reply)))
74 while ((status = reply->sms_status) == SMS_MORE_DATA) {
75 if (reply->sms_argc > 0) {
76 strncpy(buffer, reply->sms_argv[0], sizeof(buffer));
79 sms_destroy_reply(reply);
82 initialize_operation(_sms_recv_op, sms_start_recv, &reply,
84 queue_operation(_sms_conn, CON_INPUT, _sms_recv_op);
86 complete_operation(_sms_recv_op);
87 if (OP_STATUS(_sms_recv_op) != OP_COMPLETE) {
94 sms_destroy_reply(reply);
95 /* for backwards compatability */
96 if (status == SMS_UNKNOWN_PROC)