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)
25 from_backend(0, buf, len);
28 static int raw_closing(Plug plug, char *error_msg, int error_code,
34 /* A socket error has occurred. */
35 connection_fatal(error_msg);
36 } /* Otherwise, the remote side closed the connection normally. */
40 static int raw_receive(Plug plug, int urgent, char *data, int len)
47 * Called to set up the raw connection.
49 * Returns an error message, or NULL on success.
51 * Also places the canonical host name into `realhost'. It must be
52 * freed by the caller.
54 static char *raw_init(char *host, int port, char **realhost)
56 static struct plug_function_table fn_table = {
59 }, *fn_table_ptr = &fn_table;
67 addr = sk_namelookup(host, realhost);
68 if ((err = sk_addr_error(addr)))
72 port = 23; /* default telnet port */
77 s = sk_new(addr, port, 0, 1, &fn_table_ptr);
78 if ((err = sk_socket_error(s)))
87 * Called to send data down the raw connection.
89 static void raw_send(char *buf, int len)
95 sk_write(s, buf, len);
99 * Called to set the size of the window
101 static void raw_size(void)
108 * Send raw special codes.
110 static void raw_special(Telnet_Special code)
116 static Socket raw_socket(void)
121 static int raw_sendok(void)
126 static int raw_ldisc(int option)
128 if (option == LD_EDIT || option == LD_ECHO)
133 Backend raw_backend = {