+/*
+ * "Raw" backend.
+ */
+
#include <stdio.h>
#include <stdlib.h>
if ((err = sk_socket_error(raw->s)) != NULL)
return err;
+ if (*cfg->loghost) {
+ char *colon;
+
+ sfree(*realhost);
+ *realhost = dupstr(cfg->loghost);
+ colon = strrchr(*realhost, ':');
+ if (colon) {
+ /*
+ * FIXME: if we ever update this aspect of ssh.c for
+ * IPv6 literal management, this should change in line
+ * with it.
+ */
+ *colon++ = '\0';
+ }
+ }
+
return NULL;
}
return NULL;
}
-static Socket raw_socket(void *handle)
+static int raw_connected(void *handle)
{
Raw raw = (Raw) handle;
- return raw->s;
+ return raw->s != NULL;
}
static int raw_sendok(void *handle)
raw_size,
raw_special,
raw_get_specials,
- raw_socket,
+ raw_connected,
raw_exitcode,
raw_sendok,
raw_ldisc,
raw_provide_logctx,
raw_unthrottle,
raw_cfg_info,
- 1
+ "raw",
+ PROT_RAW,
+ 0
};