14 static Socket s = NULL;
16 static void raw_size(void);
18 static int sb_opt, sb_len;
19 static char *sb_buf = NULL;
20 static int sb_size = 0;
23 static void c_write (char *buf, int len) {
24 from_backend(0, buf, len);
27 static int raw_receive (Socket s, int urgent, char *data, int len) {
29 /* Connection has closed. */
39 * Called to set up the raw connection.
41 * Returns an error message, or NULL on success.
43 * Also places the canonical host name into `realhost'.
45 static char *raw_init (char *host, int port, char **realhost) {
52 addr = sk_namelookup(host, realhost);
53 if ( (err = sk_addr_error(addr)) )
57 port = 23; /* default telnet port */
62 s = sk_new(addr, port, raw_receive);
63 if ( (err = sk_socket_error(s)) )
69 * We have no pre-session phase.
77 * Called to send data down the raw connection.
79 static void raw_send (char *buf, int len) {
84 sk_write(s, buf, len);
88 * Called to set the size of the window
90 static void raw_size(void) {
96 * Send raw special codes.
98 static void raw_special (Telnet_Special code) {
103 static Socket raw_socket(void) { return s; }
105 static int raw_sendok(void) { return 1; }
107 Backend raw_backend = {