summaryrefslogtreecommitdiff
path: root/networking/telnet.c
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2001-11-10 11:22:46 +0000
committerEric Andersen <andersen@codepoet.org>2001-11-10 11:22:46 +0000
commitcd8c436d811a5a077a0b61a6616c900173e2dcfb (patch)
tree94163bfef63fec4c2638d5f56be310b7176464d7 /networking/telnet.c
parent94f19a838518293810a0fc0c4dca926ca8caff57 (diff)
downloadbusybox-w32-cd8c436d811a5a077a0b61a6616c900173e2dcfb.tar.gz
busybox-w32-cd8c436d811a5a077a0b61a6616c900173e2dcfb.tar.bz2
busybox-w32-cd8c436d811a5a077a0b61a6616c900173e2dcfb.zip
Latest patch from vodz:
-- reverse resolve network name and cache in route and ifconfig applets, fix print nslookup server name if compile without uClibc, fix route crashe 'route add', fix warnings compile networking and pwd_grp applets
Diffstat (limited to 'networking/telnet.c')
-rw-r--r--networking/telnet.c38
1 files changed, 18 insertions, 20 deletions
diff --git a/networking/telnet.c b/networking/telnet.c
index 57494089d..71479fce4 100644
--- a/networking/telnet.c
+++ b/networking/telnet.c
@@ -112,7 +112,7 @@ struct Globalvars * Gptr;
112static struct Globalvars G; 112static struct Globalvars G;
113#endif 113#endif
114 114
115static inline void iacflush() 115static inline void iacflush(void)
116{ 116{
117 write(G.netfd, G.iacbuf, G.iaclen); 117 write(G.netfd, G.iacbuf, G.iaclen);
118 G.iaclen = 0; 118 G.iaclen = 0;
@@ -121,13 +121,12 @@ static inline void iacflush()
121/* Function prototypes */ 121/* Function prototypes */
122static int getport(char * p); 122static int getport(char * p);
123static struct in_addr getserver(char * p); 123static struct in_addr getserver(char * p);
124static int create_socket();
125static void setup_sockaddr_in(struct sockaddr_in * addr, int port); 124static void setup_sockaddr_in(struct sockaddr_in * addr, int port);
126static int remote_connect(struct in_addr addr, int port); 125static int remote_connect(struct in_addr addr, int port);
127static void rawmode(); 126static void rawmode(void);
128static void cookmode(); 127static void cookmode(void);
129static void do_linemode(); 128static void do_linemode(void);
130static void will_charmode(); 129static void will_charmode(void);
131static void telopt(byte c); 130static void telopt(byte c);
132static int subneg(byte c); 131static int subneg(byte c);
133#if 0 132#if 0
@@ -147,7 +146,7 @@ static void doexit(int ev)
147 exit(ev); 146 exit(ev);
148} 147}
149 148
150static void conescape() 149static void conescape(void)
151{ 150{
152 char b; 151 char b;
153 152
@@ -353,7 +352,7 @@ static void putiac_subopt(byte c, char *str)
353 352
354static char const escapecharis[] = "\r\nEscape character is "; 353static char const escapecharis[] = "\r\nEscape character is ";
355 354
356static void setConMode() 355static void setConMode(void)
357{ 356{
358 if (G.telflags & UF_ECHO) 357 if (G.telflags & UF_ECHO)
359 { 358 {
@@ -375,7 +374,7 @@ static void setConMode()
375 374
376/* ******************************* */ 375/* ******************************* */
377 376
378static void will_charmode() 377static void will_charmode(void)
379{ 378{
380 G.charmode = CHM_TRY; 379 G.charmode = CHM_TRY;
381 G.telflags |= (UF_ECHO | UF_SGA); 380 G.telflags |= (UF_ECHO | UF_SGA);
@@ -386,7 +385,7 @@ static void will_charmode()
386 iacflush(); 385 iacflush();
387} 386}
388 387
389static void do_linemode() 388static void do_linemode(void)
390{ 389{
391 G.charmode = CHM_TRY; 390 G.charmode = CHM_TRY;
392 G.telflags &= ~(UF_ECHO | UF_SGA); 391 G.telflags &= ~(UF_ECHO | UF_SGA);
@@ -405,7 +404,7 @@ static inline void to_notsup(char c)
405 else if (G.telwish == DO) putiac2(WONT, c); 404 else if (G.telwish == DO) putiac2(WONT, c);
406} 405}
407 406
408static inline void to_echo() 407static inline void to_echo(void)
409{ 408{
410 /* if server requests ECHO, don't agree */ 409 /* if server requests ECHO, don't agree */
411 if (G.telwish == DO) { putiac2(WONT, TELOPT_ECHO); return; } 410 if (G.telwish == DO) { putiac2(WONT, TELOPT_ECHO); return; }
@@ -432,7 +431,7 @@ static inline void to_echo()
432 WriteCS(1, "\r\n"); /* sudden modec */ 431 WriteCS(1, "\r\n"); /* sudden modec */
433} 432}
434 433
435static inline void to_sga() 434static inline void to_sga(void)
436{ 435{
437 /* daemon always sends will/wont, client do/dont */ 436 /* daemon always sends will/wont, client do/dont */
438 437
@@ -454,7 +453,7 @@ static inline void to_sga()
454} 453}
455 454
456#ifdef CONFIG_FEATURE_TELNET_TTYPE 455#ifdef CONFIG_FEATURE_TELNET_TTYPE
457static inline void to_ttype() 456static inline void to_ttype(void)
458{ 457{
459 /* Tell server we will (or won't) do TTYPE */ 458 /* Tell server we will (or won't) do TTYPE */
460 459
@@ -471,10 +470,10 @@ static void telopt(byte c)
471{ 470{
472 switch (c) 471 switch (c)
473 { 472 {
474 case TELOPT_ECHO: to_echo(c); break; 473 case TELOPT_ECHO: to_echo(); break;
475 case TELOPT_SGA: to_sga(c); break; 474 case TELOPT_SGA: to_sga(); break;
476#ifdef CONFIG_FEATURE_TELNET_TTYPE 475#ifdef CONFIG_FEATURE_TELNET_TTYPE
477 case TELOPT_TTYPE: to_ttype(c); break; 476 case TELOPT_TTYPE: to_ttype(); break;
478#endif 477#endif
479 default: to_notsup(c); break; 478 default: to_notsup(c); break;
480 } 479 }
@@ -515,12 +514,12 @@ static void fgotsig(int sig)
515} 514}
516 515
517 516
518static void rawmode() 517static void rawmode(void)
519{ 518{
520 tcsetattr(0, TCSADRAIN, &G.termios_raw); 519 tcsetattr(0, TCSADRAIN, &G.termios_raw);
521} 520}
522 521
523static void cookmode() 522static void cookmode(void)
524{ 523{
525 tcsetattr(0, TCSADRAIN, &G.termios_def); 524 tcsetattr(0, TCSADRAIN, &G.termios_def);
526} 525}
@@ -650,7 +649,7 @@ static struct in_addr getserver(char * host)
650 return addr; 649 return addr;
651} 650}
652 651
653static int create_socket() 652static int create_socket(void)
654{ 653{
655 return socket(AF_INET, SOCK_STREAM, 0); 654 return socket(AF_INET, SOCK_STREAM, 0);
656} 655}
@@ -708,4 +707,3 @@ c-basic-offset: 4
708tab-width: 4 707tab-width: 4
709End: 708End:
710*/ 709*/
711