#define G (*Gptr)
#endif
-static inline void iacflush(void)
+static void iacflush(void)
{
write(G.netfd, G.iacbuf, G.iaclen);
G.iaclen = 0;
* I don't agree.
* first - I cannot use programs like sz/rz
* second - the 0x0D is sent as one character and if the next
- * char is 0x0A then it's eaten by a server side.
+ * char is 0x0A then it's eaten by a server side.
* third - whay doy you have to make 'many write()s'?
- * I don't understand.
+ * I don't understand.
* So I implemented it. It's realy useful for me. I hope that
* others people will find it interesting to.
*/
}
outbuf[j++] = *p;
if (*p == 0xff)
- outbuf[j++] = 0xff;
+ outbuf[j++] = 0xff;
else if (*p == 0x0d)
- outbuf[j++] = 0x00;
+ outbuf[j++] = 0x00;
}
if (j > 0 )
- write(G.netfd, outbuf, j);
+ write(G.netfd, outbuf, j);
}
/* ******************************* */
-static inline void putiac(int c)
+static void putiac(int c)
{
G.iacbuf[G.iaclen++] = c;
}
/* ******************************* */
-static inline void to_notsup(char c)
+static void to_notsup(char c)
{
if (G.telwish == WILL) putiac2(DONT, c);
else if (G.telwish == DO) putiac2(WONT, c);
}
-static inline void to_echo(void)
+static void to_echo(void)
{
/* if server requests ECHO, don't agree */
if (G.telwish == DO) { putiac2(WONT, TELOPT_ECHO); return; }
WriteCS(1, "\r\n"); /* sudden modec */
}
-static inline void to_sga(void)
+static void to_sga(void)
{
/* daemon always sends will/wont, client do/dont */
}
#ifdef CONFIG_FEATURE_TELNET_TTYPE
-static inline void to_ttype(void)
+static void to_ttype(void)
{
/* Tell server we will (or won't) do TTYPE */
#endif
#ifdef CONFIG_FEATURE_TELNET_AUTOLOGIN
-static inline void to_new_environ(void)
+static void to_new_environ(void)
{
/* Tell server we will (or will not) do AUTOLOGIN */
#endif
#ifdef CONFIG_FEATURE_AUTOWIDTH
-static inline void to_naws(void)
+static void to_naws(void)
{
/* Tell server we will do NAWS */
putiac2(WILL, TELOPT_NAWS);
#endif
#ifdef CONFIG_FEATURE_TELNET_TTYPE
- ttype = getenv("TERM");
+ ttype = getenv("TERM");
#endif
memset(&G, 0, sizeof G);
bb_show_usage();
#ifdef CONFIG_FEATURE_TELNET_AUTOLOGIN
- if (1 & bb_getopt_ulflags(argc, argv, "al:", &autologin))
+ if (1 & getopt32(argc, argv, "al:", &autologin))
autologin = getenv("USER");
if (optind < argc) {
s_in.sin_port = bb_lookup_port((argc == 3) ? argv[2] : "telnet", "tcp", 23);
#endif
- G.netfd = xconnect(&s_in);
+ G.netfd = xconnect_tcp_v4(&s_in);
setsockopt(G.netfd, SOL_SOCKET, SO_KEEPALIVE, &one, sizeof one);