27af2c4e01b8c1b9e4286e577639fae1fd4ec769
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 skt
, int urgent
, char *data
, int len
) {
29 /* A socket error has occurred. */
31 connection_fatal(data
);
35 /* Connection has closed. */
45 * Called to set up the raw connection.
47 * Returns an error message, or NULL on success.
49 * Also places the canonical host name into `realhost'.
51 static char *raw_init (char *host
, int port
, char **realhost
) {
58 addr
= sk_namelookup(host
, realhost
);
59 if ( (err
= sk_addr_error(addr
)) )
63 port
= 23; /* default telnet port */
68 s
= sk_new(addr
, port
, 0, raw_receive
);
69 if ( (err
= sk_socket_error(s
)) )
78 * Called to send data down the raw connection.
80 static void raw_send (char *buf
, int len
) {
85 sk_write(s
, buf
, len
);
89 * Called to set the size of the window
91 static void raw_size(void) {
97 * Send raw special codes.
99 static void raw_special (Telnet_Special code
) {
104 static Socket
raw_socket(void) { return s
; }
106 static int raw_sendok(void) { return 1; }
108 static int raw_ldisc(int option
) {
109 if (option
== LD_EDIT
|| option
== LD_ECHO
)
114 Backend raw_backend
= {