14 static Socket s = NULL;
16 static void raw_size(void);
18 static void c_write(char *buf, int len)
20 from_backend(0, buf, len);
23 static int raw_closing(Plug plug, char *error_msg, int error_code,
29 /* A socket error has occurred. */
30 connection_fatal(error_msg);
31 } /* Otherwise, the remote side closed the connection normally. */
35 static int raw_receive(Plug plug, int urgent, char *data, int len)
42 * Called to set up the raw connection.
44 * Returns an error message, or NULL on success.
46 * Also places the canonical host name into `realhost'. It must be
47 * freed by the caller.
49 static char *raw_init(char *host, int port, char **realhost)
51 static struct plug_function_table fn_table = {
54 }, *fn_table_ptr = &fn_table;
62 addr = sk_namelookup(host, realhost);
63 if ((err = sk_addr_error(addr)))
67 port = 23; /* default telnet port */
72 s = sk_new(addr, port, 0, 1, &fn_table_ptr);
73 if ((err = sk_socket_error(s)))
82 * Called to send data down the raw connection.
84 static void raw_send(char *buf, int len)
90 sk_write(s, buf, len);
94 * Called to set the size of the window
96 static void raw_size(void)
103 * Send raw special codes.
105 static void raw_special(Telnet_Special code)
111 static Socket raw_socket(void)
116 static int raw_sendok(void)
121 static int raw_ldisc(int option)
123 if (option == LD_EDIT || option == LD_ECHO)
128 Backend raw_backend = {