Changeset 619 for libcaca/trunk
- Timestamp:
- Mar 15, 2006, 4:03:43 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libcaca/trunk/caca/driver_network.c
r611 r619 47 47 /* Following vars are static */ 48 48 #define INIT_PREFIX \ 49 "\xff\xfb\x01" /* WILL ECHO */ \ 50 "\xff\xfb\x03" /* WILL SUPPRESS GO AHEAD */ \ 51 "\xff\xfd\x31" /* DO NAWS */ \ 52 "\xff\xfe\x1f" /* DON'T NAWS */ \ 53 "\xff\x1f\xfa____" /* Set size, replaced in display */ \ 54 "\xff\xf0" \ 49 "\xff\xfb\x01" /* WILL ECHO */ \ 50 "\xff\xfb\x03" /* WILL SUPPRESS GO AHEAD */ \ 51 "\xff\xfd\x31" /* DO NAWS */ \ 52 "\xff\x1f\xfa____" /* SB NAWS */ \ 53 "\xff\xf0" /* SE */ \ 55 54 "\x1b]2;caca for the network\x07" /* Change window title */ \ 56 "\x1b[H\x1b[J" /* Clear screen */ \57 /*"\x1b[?25l"*/ /* Hide cursor */ \55 "\x1b[H\x1b[J" /* Clear screen */ 56 /*"\x1b[?25l"*/ /* Hide cursor */ 58 57 59 58 #define ANSI_PREFIX \ … … 65 64 "\x1b[?1049h" /* Clear screen */ \ 66 65 "\x1b[?1049h" /* Clear screen again */ 66 67 68 static char const telnet_commands[16][5] = 69 {"SE ", "NOP ", "DM ", "BRK ", "IP ", "AO ", "AYT ", "EC ", 70 "EL ", "GA ", "SB ", "WILL", "WONT", "DO ", "DONT", "IAC "}; 71 72 static char const telnet_options[37][5] = 73 {"????", "ECHO", "????", "SUGH", "????", "STTS", "TIMK", "????", "????", "????", 74 "????", "????", "????", "????", "????", "????", "????", "????", "????", "????", 75 "????", "????", "????", "????", "TTYP", "????", "????", "????", "????", "????", 76 "????", "NAWS", "TRSP", "RMFC", "LIMO", "????", "EVAR"}; 77 78 79 #define COMMAND_NAME(x) (x>=240)?telnet_commands[x-240]:"????" 80 #define OPTION_NAME(x) (x<=36)?telnet_options[x]:"????" 81 67 82 68 83 struct client … … 358 373 if(c->inbytes == 3) 359 374 { 360 fprintf(stderr, "client %i said: %.02x %.02x %.02x\n", 361 c->fd, c->inbuf[0], c->inbuf[1], c->inbuf[2]); 375 fprintf(stderr, "client %i said: %.02x %.02x %.02x (%s %s %s)\n", 376 c->fd, c->inbuf[0], c->inbuf[1], c->inbuf[2], 377 COMMAND_NAME(c->inbuf[0]), COMMAND_NAME(c->inbuf[1]), OPTION_NAME(c->inbuf[2])); 362 378 /* Just ignore, lol */ 363 379 c->inbytes = 0;
Note: See TracChangeset
for help on using the changeset viewer.