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
,
31 /* A socket error has occurred. */
32 connection_fatal(error_msg
);
33 } /* Otherwise, the remote side closed the connection normally. */
37 static int raw_receive(Plug plug
, int urgent
, char *data
, int len
)
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'. It must be
49 * freed by the caller.
51 static char *raw_init(char *host
, int port
, char **realhost
)
53 static struct plug_function_table fn_table
= {
56 }, *fn_table_ptr
= &fn_table
;
64 addr
= sk_namelookup(host
, realhost
);
65 if ((err
= sk_addr_error(addr
)))
69 port
= 23; /* default telnet port */
74 s
= sk_new(addr
, port
, 0, 1, &fn_table_ptr
);
75 if ((err
= sk_socket_error(s
)))
84 * Called to send data down the raw connection.
86 static void raw_send(char *buf
, int len
)
92 sk_write(s
, buf
, len
);
96 * Called to set the size of the window
98 static void raw_size(void)
105 * Send raw special codes.
107 static void raw_special(Telnet_Special code
)
113 static Socket
raw_socket(void)
118 static int raw_sendok(void)
123 static int raw_ldisc(int option
)
125 if (option
== LD_EDIT
|| option
== LD_ECHO
)
130 Backend raw_backend
= {