6 * Copyright (C) 1987 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 * creating a connection to the sms server.
15 static char *rcsid_sms_connect_c = "$Header$";
18 #include <mit-copyright.h>
19 #include "sms_private.h"
22 * Open a connection to the sms server.
29 if (!sms_inited) sms_init();
30 if (_sms_conn) return SMS_ALREADY_CONNECTED;
33 * XXX should do a hesiod call to find the sms machine name & service
37 _sms_conn = start_server_connection(SMS_GDB_SERV, "");
38 if (_sms_conn == NULL)
40 if (connection_status(_sms_conn) == CON_STOPPED) {
41 register status = connection_errno(_sms_conn);
42 if (!status) status = SMS_CANT_CONNECT;
52 _sms_conn = sever_connection(_sms_conn);
60 struct sms_params *params = NULL;
61 struct sms_params *reply = NULL;
65 params->sms_version_no = sending_version_no;
66 params->sms_procno = SMS_NOOP;
68 params->sms_argl = NULL;
69 params->sms_argv = NULL;
71 if ((status = sms_do_call(params, &reply)) == 0)
72 status = reply->sms_status;
74 sms_destroy_reply(reply);
83 * c-continued-statement-offset: 4