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'.
53 static char *raw_init(char *host
, int port
, char **realhost
)
55 static struct plug_function_table fn_table
= {
58 }, *fn_table_ptr
= &fn_table
;
66 addr
= sk_namelookup(host
, realhost
);
67 if ((err
= sk_addr_error(addr
)))
71 port
= 23; /* default telnet port */
76 s
= sk_new(addr
, port
, 0, 1, &fn_table_ptr
);
77 if ((err
= sk_socket_error(s
)))
86 * Called to send data down the raw connection.
88 static void raw_send(char *buf
, int len
)
94 sk_write(s
, buf
, len
);
98 * Called to set the size of the window
100 static void raw_size(void)
107 * Send raw special codes.
109 static void raw_special(Telnet_Special code
)
115 static Socket
raw_socket(void)
120 static int raw_sendok(void)
125 static int raw_ldisc(int option
)
127 if (option
== LD_EDIT
|| option
== LD_ECHO
)
132 Backend raw_backend
= {