diff options
Diffstat (limited to 'networking/telnet.c')
-rw-r--r-- | networking/telnet.c | 38 |
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; | |||
112 | static struct Globalvars G; | 112 | static struct Globalvars G; |
113 | #endif | 113 | #endif |
114 | 114 | ||
115 | static inline void iacflush() | 115 | static 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 */ |
122 | static int getport(char * p); | 122 | static int getport(char * p); |
123 | static struct in_addr getserver(char * p); | 123 | static struct in_addr getserver(char * p); |
124 | static int create_socket(); | ||
125 | static void setup_sockaddr_in(struct sockaddr_in * addr, int port); | 124 | static void setup_sockaddr_in(struct sockaddr_in * addr, int port); |
126 | static int remote_connect(struct in_addr addr, int port); | 125 | static int remote_connect(struct in_addr addr, int port); |
127 | static void rawmode(); | 126 | static void rawmode(void); |
128 | static void cookmode(); | 127 | static void cookmode(void); |
129 | static void do_linemode(); | 128 | static void do_linemode(void); |
130 | static void will_charmode(); | 129 | static void will_charmode(void); |
131 | static void telopt(byte c); | 130 | static void telopt(byte c); |
132 | static int subneg(byte c); | 131 | static 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 | ||
150 | static void conescape() | 149 | static 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 | ||
354 | static char const escapecharis[] = "\r\nEscape character is "; | 353 | static char const escapecharis[] = "\r\nEscape character is "; |
355 | 354 | ||
356 | static void setConMode() | 355 | static 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 | ||
378 | static void will_charmode() | 377 | static 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 | ||
389 | static void do_linemode() | 388 | static 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 | ||
408 | static inline void to_echo() | 407 | static 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 | ||
435 | static inline void to_sga() | 434 | static 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 |
457 | static inline void to_ttype() | 456 | static 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 | ||
518 | static void rawmode() | 517 | static void rawmode(void) |
519 | { | 518 | { |
520 | tcsetattr(0, TCSADRAIN, &G.termios_raw); | 519 | tcsetattr(0, TCSADRAIN, &G.termios_raw); |
521 | } | 520 | } |
522 | 521 | ||
523 | static void cookmode() | 522 | static 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 | ||
653 | static int create_socket() | 652 | static 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 | |||
708 | tab-width: 4 | 707 | tab-width: 4 |
709 | End: | 708 | End: |
710 | */ | 709 | */ |
711 | |||