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. */
32 connection_fatal(data
);
36 /* Connection has closed. */
46 * Called to set up the raw connection.
48 * Returns an error message, or NULL on success.
50 * Also places the canonical host name into `realhost'.
52 static char *raw_init (char *host
, int port
, char **realhost
) {
59 addr
= sk_namelookup(host
, realhost
);
60 if ( (err
= sk_addr_error(addr
)) )
64 port
= 23; /* default telnet port */
69 s
= sk_new(addr
, port
, 0, 1, raw_receive
);
70 if ( (err
= sk_socket_error(s
)) )
79 * Called to send data down the raw connection.
81 static void raw_send (char *buf
, int len
) {
86 sk_write(s
, buf
, len
);
90 * Called to set the size of the window
92 static void raw_size(void) {
98 * Send raw special codes.
100 static void raw_special (Telnet_Special code
) {
105 static Socket
raw_socket(void) { return s
; }
107 static int raw_sendok(void) { return 1; }
109 static int raw_ldisc(int option
) {
110 if (option
== LD_EDIT
|| option
== LD_ECHO
)
115 Backend raw_backend
= {