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 /* A socket error has occurred. */
30 connection_fatal(data
);
34 /* Connection has closed. */
44 * Called to set up the raw connection.
46 * Returns an error message, or NULL on success.
48 * Also places the canonical host name into `realhost'.
50 static char *raw_init (char *host
, int port
, char **realhost
) {
57 addr
= sk_namelookup(host
, realhost
);
58 if ( (err
= sk_addr_error(addr
)) )
62 port
= 23; /* default telnet port */
67 s
= sk_new(addr
, port
, 0, raw_receive
);
68 if ( (err
= sk_socket_error(s
)) )
74 * We have no pre-session phase.
82 * Called to send data down the raw connection.
84 static void raw_send (char *buf
, int len
) {
89 sk_write(s
, buf
, len
);
93 * Called to set the size of the window
95 static void raw_size(void) {
101 * Send raw special codes.
103 static void raw_special (Telnet_Special code
) {
108 static Socket
raw_socket(void) { return s
; }
110 static int raw_sendok(void) { return 1; }
112 Backend raw_backend
= {