* freed by the caller.
*/
static char *rlogin_init(void *frontend_handle, void **backend_handle,
+ Config *cfg,
char *host, int port, char **realhost, int nodelay)
{
static const struct plug_function_table fn_table = {
rlogin->fn = &fn_table;
rlogin->s = NULL;
rlogin->frontend = frontend_handle;
- rlogin->term_width = cfg.width;
- rlogin->term_height = cfg.height;
+ rlogin->term_width = cfg->width;
+ rlogin->term_height = cfg->height;
*backend_handle = rlogin;
/*
logevent(rlogin->frontend, buf);
sfree(buf);
}
- addr = name_lookup(host, port, realhost);
+ addr = name_lookup(host, port, realhost, cfg);
if ((err = sk_addr_error(addr)) != NULL)
return err;
sfree(buf);
}
rlogin->s = new_connection(addr, *realhost, port, 1, 0,
- nodelay, (Plug) rlogin);
+ nodelay, (Plug) rlogin, cfg);
if ((err = sk_socket_error(rlogin->s)) != NULL)
return err;
char z = 0;
char *p;
sk_write(rlogin->s, &z, 1);
- sk_write(rlogin->s, cfg.localusername, strlen(cfg.localusername));
+ sk_write(rlogin->s, cfg->localusername,
+ strlen(cfg->localusername));
sk_write(rlogin->s, &z, 1);
- sk_write(rlogin->s, cfg.username, strlen(cfg.username));
+ sk_write(rlogin->s, cfg->username,
+ strlen(cfg->username));
sk_write(rlogin->s, &z, 1);
- sk_write(rlogin->s, cfg.termtype, strlen(cfg.termtype));
+ sk_write(rlogin->s, cfg->termtype,
+ strlen(cfg->termtype));
sk_write(rlogin->s, "/", 1);
- for (p = cfg.termspeed; isdigit(*p); p++) continue;
- sk_write(rlogin->s, cfg.termspeed, p - cfg.termspeed);
+ for (p = cfg->termspeed; isdigit(*p); p++) continue;
+ sk_write(rlogin->s, cfg->termspeed, p - cfg->termspeed);
rlogin->bufsize = sk_write(rlogin->s, &z, 1);
}
}
/*
+ * Stub routine (we don't have any need to reconfigure this backend).
+ */
+static void rlogin_reconfig(void *handle, Config *cfg)
+{
+}
+
+/*
* Called to send data down the rlogin connection.
*/
static int rlogin_send(void *handle, char *buf, int len)
Backend rlogin_backend = {
rlogin_init,
+ rlogin_reconfig,
rlogin_send,
rlogin_sendbuffer,
rlogin_size,