From ed1684e64e2c1702898411725bb2f1169984884e Mon Sep 17 00:00:00 2001 From: Kevin Lange Date: Sat, 3 Dec 2011 19:00:34 -0600 Subject: Get rid of all of that nasty python --- src/nyancat.c | 1178 +++++++++++++-------------------------------------------- 1 file changed, 256 insertions(+), 922 deletions(-) (limited to 'src/nyancat.c') diff --git a/src/nyancat.c b/src/nyancat.c index ab36280..0262555 100644 --- a/src/nyancat.c +++ b/src/nyancat.c @@ -35,953 +35,286 @@ #include #include #include +#include "telnet.h" +#include "animation.h" char * colors[256] = {NULL}; +char * output = " "; -char * frame0[] = { -",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,.,,,,,,,,,,,,,,,,,,,,,,,,,", -",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,.,.,,,,,,,,,,,,,,,,,,,,,,,,", -",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,.,,,,,,,,,,,,,,,,,,,,,,,,,", -",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,", -",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,", -",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,", -",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,.,", -",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,.,", -",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,", -",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,.,.,", -",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,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',,,,,,,,,,,,,,,,,,,,,,", -"&&&&&&&&&&&&&&&&&&&&&&&'@$$-$$$$$$$$$$$$@',,,,,,,,,,,,,,,,,,,,,,", -"&&&&&&&&&&&&&&&&&&&&&&&'@$$$$$$$$'**'$$$@''**',,,,,,,,,,,,,,,,,,", -"&&&+++++++&&&&&&&&'''++'@$$$$$-$$'***$$$@'***',,,,,,,,,,,,,,,,,,", -"++++++++++++++++++**''+'@$$$$$$$$'***''''****',,,,,,,,,,,,,,,,,,", -"++++++++++++++++++'**'''@$$$$$$$$'***********',,,,,,,,,,,,,,,,,,", -"+++#######++++++++''**''@$$$$$$-'*************',,,,,,,,,,,,,,,,,", -"###################''**'@$-$$$$$'***.*****.'**',,,,,,,,,,,,,,,,,", -"####################''''@$$$$$$$'***'***'*''**',,,,,,,,,,,,,,,,,", -"###=======########====''@$$$$-$$'*%%********%%',,,,,,,,,,,,,,,,,", -"======================='@@@$$$$$$'***''''''**',,,,,,,,,,,,,,,,,,", -"===;;;;;;;.=======;;;;'''@@@@@@@@@'*********',,,,,,,,,,,,,,,,,,,", -";;;;;;;;;;;;;;;;;;;;;'***''''''''''''''''''',,,,,,,,,,,,,,,,,,,,", -";;;;;;;;;;;;;;;;;;;;;'**'','*',,,,,'*','**',,,,,,,,,,,,,,,,,,,,,", -";;;,,,,.,,;;;.;;;;,,,'''',,'',,,,,,,'',,'',,,,,,,,,,,,,,,,,,,,,,", -",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,", -",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,", -",,,,,,,,,,.,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,", -",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,", -",,,,,,,,,,,,,,,,,,,,,,,,,,,,,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,'',,,,,,,,,,,,,,,,,,", -"&&&&&&&&&&&&&&&&&&&&&&&'@$$$$$$$$$'**'$$@','**',,,,,,,,,,,,,,,,,", -"&&&+++++++&&&&&&&&+++++'@$$$$$-$$$'***$$@''***',,,,,,,,,,,,,,,,,", -"+++++++++++++++++++'+++'@$$$$$$$$$'***''''****',,,,,,,,,,,,,,,,,", -"++++++++++++++++++'*'++'@$$$$$$$$$'***********',,,,,,,,,,,,,,,,,", -"+++#######++++++++'*''''@$$$$$$-$'*************',,,,,,,,,,,,,,,,", -"###################****'@$-$$$$$$'***.*****.'**',,,,,,,,,,,,,,,,", -"###################''**'@$$$$$$$$'***'***'*''**',,,,,,,,,,,,,,,,", -"###=======########==='''@$$$$-$$$'*%%********%%',,,,,,,,,,,,,,,,", -"======================='@@@$$$$$$$'***''''''**',,,,,,,,,,,,,,,,,", -"===;;;;;;;========;;;;;''@@@@@@@@@@'*********',,,,,,,,,,,,,,,,,,", -";;;;;;;;;;;;;;;;;;;;;;'**'''''''''''''''''''',,,,,,,,,,,,,,,,,,,", -";;;;;;;;;;;;;;;;;;;;;;'**','*',,,,,,**','**',,,,,,,,,,,,,,,,,,,,", -";;;,,.,,,,;;;;;;;;,,,,''',,,'',,,,,,''',,''',,,,,,,,,,,,,,,,,,,,", -",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,", -",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,", -",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,", -",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,", -",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,", -",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,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,,,,,,,,,,,,,,,", -"++&&&&&&&++++++++&&&&&&'@$$$$$$$$$'**$$$@','**',,,,,,,,,,,,,,,,,", -"+++++++++++++++++++++++'@$$$$$-$$$'**'$$@''***',,,,,,,,,,,,,,,,,", -"+++++++++++++++++++++++'@$$$$$$$$$'***''''****',,,,,,,,,,,,,,,,,", -"##+++++++########++++++'@$$$$$$$$$'***********',,,,,,,,,,,,,,,,,", -"######################''@$$$$$$-$'*************',,,,,,,,,,,,,,,,", -"###################'''''@$-$$$$$$'***'*****.'**',,,,,,,,,,,,,,,,", -"==#######========#'****'@$$$$$$$$'***'***'*''**',,,,,,,,,,,,,,,,", -"==================='''='@@$-$$$$$'*%%'**'**'*%%',,,,,,,,,,,,,,,,", -";;=======;;;;;;;;======'@@@$$$$$$$'**'''''''**',,,,,,,,,,,,,,,,,", -";;;;;;;;;;;;;;;;;;;;;;;''@@@@@@@@@@'*********',,,,,,,,,,,,,,,,,,", -";.;;;;;;;;;;;;;;;;;;;;;'*'''''''''''''''''''',,,,,,,,,,,,,,,,,,,", -".,.;;;;;;,,,,,,,,;;;;;;'**',**',,,,,,**','**',,,,,,,,,,,,,,,,,,,", -",.,,,,,,,,,,,,,,,,,,,,,''',,''',,,,,,''',,''',,,,,,,,,,,,,,,,,,,", -",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,", -",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,", -",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,", -",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,", -",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,", -",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,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','**',,,,,,,,,,,,,,,,,", -"+++++++++++++++++++++++'@$$$$$-$$$'***$$@''***',,,,,,,,,,,,,,,,,", -"+++++++++++++++++++++++'@$$$$$$$$$'***''''****',,,,,,,,,,,,,,,,,", -"##+++++++########++++++'@$$$$$$$$$'***********',,,,,,,,,,,,,,,,,", -"#####################'''@$$$$$$-$'*************',,,,,,,,,,,,,,,,", -"###################''**'@$-$$$$$$'***.*****.'**',,,,,,,,,,,,,,,,", -"==#######========##****'@$$$$$$$$'***'***'*''**',,,,,,,,,,,,,,,,", -"=================='*'=='@@$-$$$$$'*%%***'**'*%%',,,,,,,,,,,,,,,,", -";;=======;;;;;;;;=='==='@@@$$$$$$$'***''''''**',,,,,,,,,,,,,,,,,", -";;;;;;;;;;;;;;;;;;;;;;;''@@@@@@@@@@'*********',,,,,,,,,,,,,,,,,,", -";;;;;;;;;;;;;;;;;;;;;;'**'''''''''''''''''''',,,,,,,,,,,,,,,,,,,", -",,;;;;;;;,,,,,,,,;;;;;'**','*',,,,,,'*','**',,,,,,,,,,,,,,,,,,,,", -",,,,,,,,,,,,,,,,,,,,,,''',,,'',,,,,,,'',,''',,,,,,,,,,,,,,,,,,,,", -",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,", -",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,", -",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,", -",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,", -",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,", -",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,", -",,,,,,,,,,,,,,,,,,,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$$'***$$$@'***',,,,,,,,,,,,,,,,,,", -"++++++++++++++++++'''++'@$$$$$$$$'***''''****',,,,,,,,,,,,,,,,,,", -"+++#######+++++++'**''''@$$$$$$$$'***********',,,,,,,,,,,,,,,,,,", -"#################'****''@$$$$$$-'*************',,,,,,,,,,,,,,,,,", -"##################''''*'@$-$$$$$'***.*****.'**',,,,,,,,,,,,,,,,,", -"###=======########==='''@$$$$$$$'***'***'*''**',,,,,,,,,,,,,,,,,", -"======================='@@$-$$$$'*%%***'**'*%%',,,,,,,,,,,,,,,,,", -"===;;;;;;;========;;;;''@@@$$$$$$'***''''''**',,,,,,,,,,,,,,,,,,", -";;;;;;;;;;;;;;;;;;;;;''''@@@@@@@@@'*********',,,,,,,,,,,,,,,,,,,", -";;;;;;;;;;;;;;;;;;;;'***'''''''''''''''''''',,,,,,,,,,,,,,,,,,,,", -";;;,,,,,,,;;;;;;;;,,'**','**,,,,,,'**,'**',,,,,,,,,,,,,,,,,,,,,,", -",,,,,,,,,,,,,,,,,,,,''',,,'',,,,,,,'',,''',,,,,,,,,,,,,,,,,,,,,,", -",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,", -",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,", -",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,", -",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,", -",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,", -",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,", -",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,.,,,,,,,,,,,,,,,,,,,,,,,,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$$$$'***********',,,,,,,,,,,,,,,,,,", -"+++#######++++++++'*''''@$$$$$$$'*************',,,,,,,,,,,,,,,,,", -"###################****'@$$$$$$-'***.*****.'**',,,,,,,,,,,,,,,,,", -"###################''**'@$-$$$$$'***'***'*''**',,,,,,,,,,,,,,,,,", -"###=======########==='''@$$$$$$$'*%%********%%',,,,,,,,,,,,,,,,,", -"======================='@@$-$$$$$'***''''''**',,,,,,,,,,,,,,,,,,", -"===;;;;;;;========;;;;''@@@$$$$$$$'*********',,,,,,,,,,,,,,,,,,.", -";;;;;;;;;;;;;;;;;;;;;'*''@@@@@@@@@@''''''''',,,,,,,,,,,,,,,,,,,.", -";;;;;;;;;;;;;;;;;;;;'***''''''''''''''''*',,,,,,,,,,,,,,,,,,,,,,", -";;;,,,,,,,;;;;;;;;,,'**','**,,,,,,'**,'**',,,,,,,,,,,,,,,,,,..,.", -",,,,,,,,,,,,,,,,,,,,''',,''',,,,,,''',,''',,,,,,,,,,,,,,,,,,,,,,", -",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,.", -",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,.", -",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,", -",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,", -",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,", -",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,", -",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,", -",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,.,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,", -",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,.,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,", -",,,,,,,,,,,,,,,,,,,,,,,,,,,,,..,..,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,", -",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,.,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,", -",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,.,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,", -",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,", -",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,", -",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,", -",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,", -",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,", -",,.,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,", -",.,.,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,", -",,.,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,", -",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,", -",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,"}; +void set_options() { + telnet_options[ECHO] = WONT; + telnet_options[SGA] = WILL; + telnet_options[NEW_ENVIRON] = WONT; -char * frame6[] = { -".,,,,,,,,,,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,,,,,,,,,,,,,,,,,,", -",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,", -",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,", -",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,", -",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,.,,,,,,,,,,,,,,,,,,,,,,,,", -",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,.,.,,,,,,,,,,,,,,,,,,,,,,,", -",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,.,,,,,,,,,,,,,,,,,,,,,,,,", -",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,", -",,,,,,,,,,,,,,,,,,,,,,,,,''''''''''''''',,,,,,,,,,,,,,,,,,,,,,,,", -">>,,,,,,,>>>>>>>>,,,,,,,'@@@@@@@@@@@@@@@',,,,,,,,,,,,,,,,,,,,,,,", -">>>>>>>>>>>>>>>>>>>>>>>'@@@$$$$$$$$$$$@@@',,,,,,,,,,,,,,,,,,,,,,", -">>>>>>>>>>>>>>>>>>>>>>>'@@$$$$$-$$-$$$$@@',,,,,,,,,,,,,,,,,,,,,,", -"&&&&&&&&&&&&&&&&&&&&&&&'@$$-$$$$$$$$$$$$@',,,,,,,,,,,,,,,,,,,,,,", -"&&&&&&&&&&&&&&&&&&&&&&&'@$$$$$$$$'**'$$$@''**',,,,,,,,,,,,,,,,,,", -"++&&&&&&&++++++++&'''&&'@$$$$$-$$'***'$$@'***',,,,,,,,,,,,,,,,,,", -"++++++++++++++++++'*''+'@$$$$$$$$'****'''****',,,,,,,,,,,,,,,,,,", -"++++++++++++++++++'**'''@$$$$$$$$'***********',,,,,,,,,,,,,,,,,,", -"##+++++++########++'**''@$$$$$$-'*************',,,,,,,,,,,,,,,,,", -"###################''**'@$-$$$$$'***.'****.'**',,,,,,,,,,,,,,,,,", -"####################''''@$$$$$$$'***''**'*''**',,,,,,,,,,,,,,,,,", -"==#######========#####''@$$$$-$$'*%%********%%',,,,,,,,,,,,,,,,,", -"======================='@@@$$$$$$'***''''''**',,,,,,,,,,,,,,,,,,", -";;=======;;;;;;;;====='''@@@@@@@@@'*********',,,,,,,,,,,.,,,,,,,", -";;;;;;;;;;;;;;;;;;;;;'***''''''''''''''''''',,,,,,,,,,.,,,.,,,,,", -";;;;;;;;;;;;;;;;;;;;;'**'','*',,,,,'**,'**',,,,,,,,,,,,,,,,,,,,,", -",,;;;;;;;,,,,,,,,;;;;'''',,'',,,,,,,'',,'',,,,,,,,,,,.,,,,,.,,,,", -",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,", -",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,.,,,.,,,,,", -",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,.,,,,,,,", -",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,", -",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,", -",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,", -",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,", -",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,", -",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,", -",,,,,,,,,,,,,,,,,,,,,,,,,,.,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,", -",,,,,,,,,,,,,,,,,,,,,,,,,.,.,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,", -",,,,,,,,,,,,,,,,,,,,,,,,,,.,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,", -",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,", -",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,", -",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,", -",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,", -",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,", -",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,", -",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,", -",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,", -",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,", -",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,", -",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,"}; + telnet_willack[ECHO] = DO; + telnet_willack[SGA] = DO; + telnet_willack[NAWS] = DONT; + telnet_willack[TTYPE] = DO; + telnet_willack[LINEMODE] = DONT; + telnet_willack[NEW_ENVIRON] = DO; +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,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,", -",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,", -",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,", -",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,.,,,,,,,,,,,,,,,,,,,,,,,,,,,,,", -",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,.,,,,,,,,,,,,,,,,,,,,,,,,,,,,,", -",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,..,..,,,,,,,,,,,,,,,,,,,,,,,,,,,", -",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,.,,,,,,,,,,,,,,,,,,,,,,,,,,,,,", -",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,.,,,,,,,,,,,,,,,,,,,,,,,,,,,,,", -",,,,,,,,,,,,,,,,,,,,,,,,,''''''''''''''',,,,,,,,,,,,,,,,,,,,,,,,", -">>,,,,,,,>>>>>>>>,,,,,,,'@@@@@@@@@@@@@@@',,,,,,,,,,,,,,,,,,,,,,,", -">>>>>>>>>>>>>>>>>>>>>>>'@@@$$$$$$$$$$$@@@',,,,,,,,,,,,,,,,,,,,,,", -">>>>>>>>>>>>>>>>>>>>>>>'@@$$$$$-$$-$$$$@@',,,,,,,,,,,,,,,,,,,,,,", -"&&&&&&&&&&&&&&&&&&&&&&&'@$$-$$$$$$$''$$$@',,'',,,,,,,,,,,,,,,,,,", -"&&&&&&&&&&&&&&&&&&&&&&&'@$$$$$$$$$'**'$$@','**',,,,,,,,,,,,,,,,,", -"++&&&&&&&++++++++&&&&&&'@$$$$$-$$$'***$$@''***',,,,,,,,,,,,,,,,,", -"+++++++++++++++++++'+++'@$$$$$$$$$'***''''****',,,,,,,,,,,,,,,,,", -"++++++++++++++++++'*'++'@$$$$$$$$$'***********',,,,,,,,,,,,,,,,,", -"##+++++++########+'*''''@$$$$$$-$'*************',,,,,,,,,,,,,,,,", -"###################****'@$-$$$$$$'***.*****.'**',,,,,,,,,,,,,,,,", -"###################''**'@$$$$$$$$'***'***'*''**',,,,,,,,,,,,,,,,", -"==#######========####'''@$$$$-$$$'*%%********%%',,,,,,,,,,,,,,,,", -"======================='@@@$$$$$$$'***''''''**',,,,,,,,,,,,,,,,,", -";;=======;;;;;;;;======''@@@@@@@@@@'*********',,,.,,,,,,,,,,,,,,", -";;;;;;;;;;;;;;;;;;;;;;'**'''''''''''''''''''',,,,,,,,,,,,,,,,,,,", -";;;;;;;;;;;;;;;;;;;;;;'**','*',,,,,,**','**',,,,,,,,,,,,,,,,,,,,", -",,;;;;;;;,,,,,,,,;;;;;''',,,'',,,,,,''',,''',,.,,,,.,,,,,,,,,,,,", -",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,", -",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,", -",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,.,,,,,,,,,,,,,,", -",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,", -",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,", -",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,", -",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,", -",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,", -",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,", -",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,", -",,,,,,,,,,,,,,,,,,,,,,.,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,", -",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,", -",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,", -",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,", -",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,", -",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,", -",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,", -",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,", -",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,", -",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,..,", -",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,", -",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,", -",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,"}; +void send_command(int cmd, int opt) { + if (cmd == DO || cmd == DONT) { + if (((cmd == DO) && (telnet_do_set[opt] != DO)) || + ((cmd == DONT) && (telnet_do_set[opt] != DONT))) { + telnet_do_set[opt] = cmd; + printf("%c%c%c", IAC, cmd, opt); + } + } else if (cmd == WILL || cmd == WONT) { + if (((cmd == WILL) && (telnet_will_set[opt] != WILL)) || + ((cmd == WONT) && (telnet_will_set[opt] != WONT))) { + telnet_will_set[opt] = cmd; + printf("%c%c%c", IAC, cmd, opt); + } + } else { + printf("%c%c", IAC, cmd); + } +} -char * frame8[] = { -",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,", -",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,.,.,", -",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,", -",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,.,", -",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,", -",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,", -",,,,,,,,,.,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,", -",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,", -",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,", -",,,,,,.,,,,,.,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,", -",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,", -",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,", -",,,,,,,,,.,,,,,,,,,,,,,,,,,,,,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&&&&&&&&&&&&&'@$$$$$$$$$$''-$$@',,'',,,,,,,,,,,,,,,,,,", -"&&&+++++++&&&&&&&&+++++'@$$$$$$$$$'**'$$@','**',,,,,,,,,,,,,,,,,", -"+++++++++++++++++++++++'@$$$$$-$$$'***$$@''***',,,,,,,,,,,,,,,,,", -"+++++++++++++++++++++++'@$$$$$$$$$'***''''****',,,,,,,,,,,,,,,,,", -"+++#######++++++++#####'@$$$$$$$$$'***********',,,,,,,,,,,,,,,,,", -"######################''@$$$$$$-$'*************',,,,,,,,,,,,,,,,", -"###################'''''@$-$$$$$$'***.*****.'**',,,,,,,,,,,,,,,,", -"###=======########'****'@$$$$$$$$'***'***'*''**',,,,,,,,,,,,,,,,", -"==================='''='@@$-$$$$$'*%%***'**'*%%',,,,,,,,,,,,,,,,", -"===;;;;;;;========;;;;;'@@@$$$$$$$'***''''''**',,,,,,,,,,,,,,,,,", -";;;;;;;;;;;;;;;;;;;;;;;''@@@@@@@@@@'*********',,,,,,,,,,,,,,,,,,", -";;;;;;;;;;;;;;;;;;;;;;;'*'''''''''''''''''''',,,,,,,,,,,,,,,,,,,", -";;;,,,,,,,;;;;;;;;,,,,,'**',**',,,,,,**'.'**',,,,,,,,,,,,,,,,,,,", -",,,,,,,,,,,,,,,,,,,,,,,''',,''',,,,,,''',,''',,,,,,,,,,,,,,,,,,,", -",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,", -",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,", -",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,", -",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,", -",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,",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@','**',,,,,,,,,,,,,,,,,", -"+++++++++++++++++++++++'@$$$$$-$$$'***$$@''***',,,,,,,,,,,,,,,,,", -"+++++++++++++++++++++++'@$$$$$$$$$'***''''****',,,,,,,,,,,,,,,,,", -"+++#######++++++++#####'@$$$$$$$$$'***********',,,,,,,,,,,,,,,,,", -"#####################'''@$$$$$$-$'*************',,,,,,,,,,,,,,,,", -"###################''**'@$-$$$$$$'***.*****.'**',,,,,,,,,,,,,,,,", -"###=======########=****'@$$$$$$$$'***'***'*''**',,,,,,,,,,,,,,,,", -"=================='*'=='@@$-$$$$$'*%%***'**'*%%',,,,,,,,,,,,,,,,", -"===;;;;;;;========;';;;'@@@$$$$$$$'***''''''**',,,,,,,,,,,,,,,,,", -";;;;;;;;;;;;;;;;;;;;;;;''@@@@@@@@@@'*********',,,,,,,,,,,,,,,,,,", -";;;;;;;;;;;;;;;;;;;;;;'**'''''''''''''''''''',,,,,,,,,,,,,,,,,,,", -";;;,,,,,,,;;;;;;;;,,,,'**','*',,..,.**','**',,,,,,,,,,,,,,,,,,,,", -",,,,,,,,,,,,,,,,,,,,,,''',,,'',,,,.,''',,''',,,,,,,,,,,,,,,,,,,,", -",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,.,,,,,,,,,,,,,,,,,,,,,,,,,,,,,", -",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,", -",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,", -",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,", -",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,", -",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,", -",,,,,,,,,.,,,,,,,,,,,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"++++++++++++++++++'''++'@$$$$$$$$'***''''****',,,,,,,,,,,,,,,,,,", -"##+++++++########'**''''@$$$$$$$$'***********',,,,,,,,,,,,,,,,,,", -"#################'****''@$$$$$$-'*************',,,,,,,,,,,,,,,,,", -"##################''''*'@$-$$$$$'***.*****.'**',,,,,,,,,,,,,,,,,", -"==#######========####'''@$$$$$$$'***'***'*''**',,,,,,,,,,,,,,,,,", -"======================='@@$-$$$$'*%%***'**'*%%',,,,,,,,,,,,,,,,,", -";;=======;;;;;;;;=====''@@@$$$$$$'***''''''**',,,,,,,,,,,,,,,,,,", -";;;;;;;;;;;;;;;;;;;;;''''@@@@@@@@@'*********',,,,,,,,,,,,,,,,,,,", -";;;;;;;;;;;;;;;;;;;;'***'''''''''''''''''''',,,,,,,,,,,,,,,,,,,,", -",,;;;;;;;,,,,,,,,;;;'**'.'**..,,,,'**''**',,,,,,,,,,,,,,,,,,,,,,", -",,,,,,,,,,,,,,,,,,,,''',,,'',,,,,,,''',''',,,,,,,,,,,,,,,,,,,,,,", -",,,,,,,,,,,,,,,,,,,,,,,,,,,.,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,", -",,,,,,,,,,,,,,,,,,,,,,,,,,,.,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,", -",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,", -",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,", -",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,", -",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,", -",,.,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,", -",,.,,,,,,,,,,,,,,,,,,,,,,,,,,,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'++'@$$$$$$$$'***********',,,,,,,,,,,,,,,,,,", -"##+++++++########+'*''''@$$$$$$$'*************',,,,,,,,,,,,,,,,,", -"###################****'@$$$$$$-'***.*****.'**',,,,,,,,,,,,,,,,,", -"###################''**'@$-$$$$$'***'***'*''**',,,,,,,,,,,,,,,,,", -"==#######========####'''@$$$$$$$'*%%********%%',,,,,,,,,,,,,,,,,", -"======================='@@$-$$$$$'***''''''**',,,,,,,,,,,,,,,,,,", -";;=======;;;;;;;;=.===''@@@$$$$$$$'*********',,,,,,,,,,,,,,,,,,,", -";;;;;;;;;;;;;;;;;;;;.'*''@@@@@@@@@@''''''''',,,,,,,,,,,,,,,,,,,,", -";;;;;;;;;;;;;;;;;;;;'***''''''''''''''''*',,,,,,,,,,,,,,,,,,,,,,", -",,;;;;;;;,,,,,,,.;;;'**','**,,,,,,'**''**',,,,,,,,,,,,,,,,,,,,,,", -",,,,,,,,,,,,,,,,,,,,''',,''',,,,,,''',,''',,,,,,,,,,,,,,,,,,,,,,", -",,,,,,,,,,,,,,,,,,,,.,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,", -",,,,,,,,,,,,,,,,,,.,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,", -",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,", -",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,", -",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,", -",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,", -",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,", -",.,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,", -",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,", -",,.,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,", -",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,", -",.,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,", -",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,", -",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,", -",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,", -",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,", -",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,", -",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,.,,,,,,,,,,,,,,,,,,,,,,,", -",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,.,.,,,,,,,,,,,,,,,,,,,,,,", -",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,.,,,,,,,,,,,,,,,,,,,,,,,", -",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,", -",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,"}; + if (argc > 1) { + if (!strcmp(argv[1], "-t")) { -char ** frames[] = { - frame0, - frame1, - frame2, - frame3, - frame4, - frame5, - frame6, - frame7, - frame8, - frame9, - frame10, - frame11, - NULL -}; + set_options(); -char * output = " "; + for (option = 0; option < 256; option++) { + if (telnet_options[option]) { + send_command(telnet_options[option], option); + fflush(stdout); + } + } + for (option = 0; option < 256; option++) { + if (telnet_willack[option]) { + send_command(telnet_willack[option], option); + fflush(stdout); + } + } -#define MIN_ROW 20 -#define MAX_ROW 44 + while (!feof(stdin) && !done) { + unsigned char i = getchar(); + unsigned char opt = 0; + if (i == 255) { + i = getchar(); + switch (i) { + case SE: + sb_mode = 0; + if (sb[0] == TTYPE) { + strcpy(term, &sb[2]); + goto ready; + } + break; + case NOP: + send_command(NOP, 0); + fflush(stdout); + break; + case WILL: + case WONT: + opt = getchar(); + if (!telnet_willack[opt]) { + telnet_willack[opt] = WONT; + } + send_command(telnet_willack[opt], opt); + fflush(stdout); + if ((i == WILL) && (opt == TTYPE)) { + printf("%c%c%c%c%c%c", IAC, SB, TTYPE, SEND, IAC, SE); + fflush(stdout); + } + break; + case DO: + case DONT: + opt = getchar(); + if (!telnet_options[opt]) { + telnet_options[opt] = DONT; + } + send_command(telnet_options[opt], opt); + if (opt == ECHO) { + do_echo = (i == DO); + } + fflush(stdout); + break; + case SB: + sb_mode = 1; + sb_len = 0; + memset(sb, 0, 1024); + break; + case IAC: + /* Connection Closed */ + done = 1; + break; + default: + break; + } + } else if (sb_mode) { + sb[sb_len] = i; + sb_len++; + } + } + } + } else { + char * nterm = getenv("TERM"); + strcpy(term, nterm); + } -#define MIN_COL 10 -#define MAX_COL 50 +ready: -void SIGINT_handler(int sig){ - printf("\033[?25h"); - exit(0); -} + for (k = 0; k < strlen(term); ++k) { + term[k] = tolower(term[k]); + } + + if (strstr(term, "xterm")) { + ttype = 1; + } else if (strstr(term, "linux")) { + ttype = 3; + } else if (strstr(term, "vtnt")) { + ttype = 5; + } else if (strstr(term, "cygwin")) { + ttype = 5; + } else if (strstr(term, "vt220")) { + ttype = 6; + } else if (strstr(term, "fallback")) { + ttype = 4; + } else if (strstr(term, "rxvt")) { + ttype = 3; + } else { + ttype = 2; + } -int main(int argc, char ** argv) { - printf("\033[H\033[2J"); - fflush(stdout); int always_escape = 0; signal(SIGINT, SIGINT_handler); -try_again: - printf("Select a mode:\n"); - printf(" 1 xterm 256-color compatible mode (best)\n"); - printf(" 2 xterm standard-color mode (good)\n"); - printf(" 3 linux + blink attribute (okay)\n"); - printf(" 4 unicode ansi terminal (okay)\n"); - printf(" 5 extended ascii ansi terminal (okay)\n"); - printf(" 6 vt220 terrible, no-color mode\n"); - printf("Your selection: "); - char response[10]; - fgets(response, 2, stdin); - if (!strcmp(response, "1")) { - colors[','] = "\033[48;5;17m"; /* Blue background */ - colors['.'] = "\033[48;5;15m"; /* White stars */ - colors['\''] = "\033[48;5;0m"; /* Black border */ - colors['@'] = "\033[48;5;230m"; /* Tan poptart */ - colors['$'] = "\033[48;5;175m"; /* Pink poptart */ - colors['-'] = "\033[48;5;162m"; /* Red poptart */ - colors['>'] = "\033[48;5;9m"; /* Red rainbow */ - colors['&'] = "\033[48;5;202m"; /* Orange rainbow */ - colors['+'] = "\033[48;5;11m"; /* Yellow Rainbow */ - colors['#'] = "\033[48;5;10m"; /* Green rainbow */ - colors['='] = "\033[48;5;33m"; /* Light blue rainbow */ - colors[';'] = "\033[48;5;19m"; /* Dark blue rainbow */ - colors['*'] = "\033[48;5;8m"; /* Gray cat face */ - colors['%'] = "\033[48;5;175m"; /* Pink cheeks */ - } else if (!strcmp(response, "2")) { - colors[','] = "\033[104m"; /* Blue background */ - colors['.'] = "\033[107m"; /* White stars */ - colors['\''] = "\033[40m"; /* Black border */ - colors['@'] = "\033[47m"; /* Tan poptart */ - colors['$'] = "\033[105m"; /* Pink poptart */ - colors['-'] = "\033[101m"; /* Red poptart */ - colors['>'] = "\033[101m"; /* Red rainbow */ - colors['&'] = "\033[43m"; /* Orange rainbow */ - colors['+'] = "\033[103m"; /* Yellow Rainbow */ - colors['#'] = "\033[102m"; /* Green rainbow */ - colors['='] = "\033[104m"; /* Light blue rainbow */ - colors[';'] = "\033[44m"; /* Dark blue rainbow */ - colors['*'] = "\033[100m"; /* Gray cat face */ - colors['%'] = "\033[105m"; /* Pink cheeks */ - } else if (!strcmp(response, "3")) { - colors[','] = "\033[25;44m"; /* Blue background */ - colors['.'] = "\033[5;47m"; /* White stars */ - colors['\''] = "\033[25;40m"; /* Black border */ - colors['@'] = "\033[5;47m"; /* Tan poptart */ - colors['$'] = "\033[5;45m"; /* Pink poptart */ - colors['-'] = "\033[5;41m"; /* Red poptart */ - colors['>'] = "\033[5;41m"; /* Red rainbow */ - colors['&'] = "\033[25;43m"; /* Orange rainbow */ - colors['+'] = "\033[5;43m"; /* Yellow Rainbow */ - colors['#'] = "\033[5;42m"; /* Green rainbow */ - colors['='] = "\033[25;44m"; /* Light blue rainbow */ - colors[';'] = "\033[5;44m"; /* Dark blue rainbow */ - colors['*'] = "\033[5;40m"; /* Gray cat face */ - colors['%'] = "\033[5;45m"; /* Pink cheeks */ - } else if (!strcmp(response, "4")) { - colors[','] = "\033[0;34;44m"; /* Blue background */ - colors['.'] = "\033[1;37;47m"; /* White stars */ - colors['\''] = "\033[0;30;40m"; /* Black border */ - colors['@'] = "\033[1;37;47m"; /* Tan poptart */ - colors['$'] = "\033[1;35;45m"; /* Pink poptart */ - colors['-'] = "\033[1;31;41m"; /* Red poptart */ - colors['>'] = "\033[1;31;41m"; /* Red rainbow */ - colors['&'] = "\033[0;33;43m"; /* Orange rainbow */ - colors['+'] = "\033[1;33;43m"; /* Yellow Rainbow */ - colors['#'] = "\033[1;32;42m"; /* Green rainbow */ - colors['='] = "\033[1;34;44m"; /* Light blue rainbow */ - colors[';'] = "\033[0;34;44m"; /* Dark blue rainbow */ - colors['*'] = "\033[1;30;40m"; /* Gray cat face */ - colors['%'] = "\033[1;35;45m"; /* Pink cheeks */ - output = "██"; - } else if (!strcmp(response, "5")) { - colors[','] = "\033[0;34;44m"; /* Blue background */ - colors['.'] = "\033[1;37;47m"; /* White stars */ - colors['\''] = "\033[0;30;40m"; /* Black border */ - colors['@'] = "\033[1;37;47m"; /* Tan poptart */ - colors['$'] = "\033[1;35;45m"; /* Pink poptart */ - colors['-'] = "\033[1;31;41m"; /* Red poptart */ - colors['>'] = "\033[1;31;41m"; /* Red rainbow */ - colors['&'] = "\033[0;33;43m"; /* Orange rainbow */ - colors['+'] = "\033[1;33;43m"; /* Yellow Rainbow */ - colors['#'] = "\033[1;32;42m"; /* Green rainbow */ - colors['='] = "\033[1;34;44m"; /* Light blue rainbow */ - colors[';'] = "\033[0;34;44m"; /* Dark blue rainbow */ - colors['*'] = "\033[1;30;40m"; /* Gray cat face */ - colors['%'] = "\033[1;35;45m"; /* Pink cheeks */ - output = "\333\333"; - } else if (!strcmp(response, "6")) { - colors[','] = " "; /* Blue background */ - colors['.'] = "**"; /* White stars */ - colors['\''] = "##"; /* Black border */ - colors['@'] = "##"; /* Tan poptart */ - colors['$'] = "??"; /* Pink poptart */ - colors['-'] = "<>"; /* Red poptart */ - colors['>'] = "##"; /* Red rainbow */ - colors['&'] = "=="; /* Orange rainbow */ - colors['+'] = "--"; /* Yellow Rainbow */ - colors['#'] = "++"; /* Green rainbow */ - colors['='] = "~~"; /* Light blue rainbow */ - colors[';'] = "$$"; /* Dark blue rainbow */ - colors['*'] = " "; /* Gray cat face */ - colors['%'] = "()"; /* Pink cheeks */ - always_escape = 1; - } else { - printf("\033[H\033[2J"); - printf("I'm sorry, what was that?\n"); - goto try_again; + switch (ttype) { + case 1: + colors[','] = "\033[48;5;17m"; /* Blue background */ + colors['.'] = "\033[48;5;15m"; /* White stars */ + colors['\''] = "\033[48;5;0m"; /* Black border */ + colors['@'] = "\033[48;5;230m"; /* Tan poptart */ + colors['$'] = "\033[48;5;175m"; /* Pink poptart */ + colors['-'] = "\033[48;5;162m"; /* Red poptart */ + colors['>'] = "\033[48;5;9m"; /* Red rainbow */ + colors['&'] = "\033[48;5;202m"; /* Orange rainbow */ + colors['+'] = "\033[48;5;11m"; /* Yellow Rainbow */ + colors['#'] = "\033[48;5;10m"; /* Green rainbow */ + colors['='] = "\033[48;5;33m"; /* Light blue rainbow */ + colors[';'] = "\033[48;5;19m"; /* Dark blue rainbow */ + colors['*'] = "\033[48;5;8m"; /* Gray cat face */ + colors['%'] = "\033[48;5;175m"; /* Pink cheeks */ + break; + case 2: + colors[','] = "\033[104m"; /* Blue background */ + colors['.'] = "\033[107m"; /* White stars */ + colors['\''] = "\033[40m"; /* Black border */ + colors['@'] = "\033[47m"; /* Tan poptart */ + colors['$'] = "\033[105m"; /* Pink poptart */ + colors['-'] = "\033[101m"; /* Red poptart */ + colors['>'] = "\033[101m"; /* Red rainbow */ + colors['&'] = "\033[43m"; /* Orange rainbow */ + colors['+'] = "\033[103m"; /* Yellow Rainbow */ + colors['#'] = "\033[102m"; /* Green rainbow */ + colors['='] = "\033[104m"; /* Light blue rainbow */ + colors[';'] = "\033[44m"; /* Dark blue rainbow */ + colors['*'] = "\033[100m"; /* Gray cat face */ + colors['%'] = "\033[105m"; /* Pink cheeks */ + break; + case 3: + colors[','] = "\033[25;44m"; /* Blue background */ + colors['.'] = "\033[5;47m"; /* White stars */ + colors['\''] = "\033[25;40m"; /* Black border */ + colors['@'] = "\033[5;47m"; /* Tan poptart */ + colors['$'] = "\033[5;45m"; /* Pink poptart */ + colors['-'] = "\033[5;41m"; /* Red poptart */ + colors['>'] = "\033[5;41m"; /* Red rainbow */ + colors['&'] = "\033[25;43m"; /* Orange rainbow */ + colors['+'] = "\033[5;43m"; /* Yellow Rainbow */ + colors['#'] = "\033[5;42m"; /* Green rainbow */ + colors['='] = "\033[25;44m"; /* Light blue rainbow */ + colors[';'] = "\033[5;44m"; /* Dark blue rainbow */ + colors['*'] = "\033[5;40m"; /* Gray cat face */ + colors['%'] = "\033[5;45m"; /* Pink cheeks */ + break; + case 4: + colors[','] = "\033[0;34;44m"; /* Blue background */ + colors['.'] = "\033[1;37;47m"; /* White stars */ + colors['\''] = "\033[0;30;40m"; /* Black border */ + colors['@'] = "\033[1;37;47m"; /* Tan poptart */ + colors['$'] = "\033[1;35;45m"; /* Pink poptart */ + colors['-'] = "\033[1;31;41m"; /* Red poptart */ + colors['>'] = "\033[1;31;41m"; /* Red rainbow */ + colors['&'] = "\033[0;33;43m"; /* Orange rainbow */ + colors['+'] = "\033[1;33;43m"; /* Yellow Rainbow */ + colors['#'] = "\033[1;32;42m"; /* Green rainbow */ + colors['='] = "\033[1;34;44m"; /* Light blue rainbow */ + colors[';'] = "\033[0;34;44m"; /* Dark blue rainbow */ + colors['*'] = "\033[1;30;40m"; /* Gray cat face */ + colors['%'] = "\033[1;35;45m"; /* Pink cheeks */ + output = "██"; + break; + case 5: + colors[','] = "\033[0;34;44m"; /* Blue background */ + colors['.'] = "\033[1;37;47m"; /* White stars */ + colors['\''] = "\033[0;30;40m"; /* Black border */ + colors['@'] = "\033[1;37;47m"; /* Tan poptart */ + colors['$'] = "\033[1;35;45m"; /* Pink poptart */ + colors['-'] = "\033[1;31;41m"; /* Red poptart */ + colors['>'] = "\033[1;31;41m"; /* Red rainbow */ + colors['&'] = "\033[0;33;43m"; /* Orange rainbow */ + colors['+'] = "\033[1;33;43m"; /* Yellow Rainbow */ + colors['#'] = "\033[1;32;42m"; /* Green rainbow */ + colors['='] = "\033[1;34;44m"; /* Light blue rainbow */ + colors[';'] = "\033[0;34;44m"; /* Dark blue rainbow */ + colors['*'] = "\033[1;30;40m"; /* Gray cat face */ + colors['%'] = "\033[1;35;45m"; /* Pink cheeks */ + output = "\333\333"; + break; + case 6: + colors[','] = " "; /* Blue background */ + colors['.'] = "**"; /* White stars */ + colors['\''] = "##"; /* Black border */ + colors['@'] = "##"; /* Tan poptart */ + colors['$'] = "??"; /* Pink poptart */ + colors['-'] = "<>"; /* Red poptart */ + colors['>'] = "##"; /* Red rainbow */ + colors['&'] = "=="; /* Orange rainbow */ + colors['+'] = "--"; /* Yellow Rainbow */ + colors['#'] = "++"; /* Green rainbow */ + colors['='] = "~~"; /* Light blue rainbow */ + colors[';'] = "$$"; /* Dark blue rainbow */ + colors['*'] = " "; /* Gray cat face */ + colors['%'] = "()"; /* Pink cheeks */ + always_escape = 1; + break; + default: + break; } printf("\033[H\033[2J\033[?25l"); - int countdown_clock = 1000; - if (always_escape) { - countdown_clock = 5; - } - int k; + int countdown_clock = 5; for (k = 0; k < countdown_clock; ++k) { printf("\n\n\n"); printf(" Nyancat Telnet Server\n"); @@ -998,7 +331,8 @@ try_again: printf("\n"); printf(" Starting in %d... \n", countdown_clock-k); - usleep(4000); + fflush(stdout); + usleep(400000); printf("\033[H"); } @@ -1018,7 +352,7 @@ try_again: last = frames[i][y][x]; printf("%s%s", colors[frames[i][y][x]], output); } else { - printf(output); + printf("%s", output); } } } -- cgit v1.2.3