--- ansh/src/ansh.c 2011/10/14 07:47:21 1.1.1.1.2.6 +++ ansh/src/ansh.c 2011/10/14 09:04:04 1.1.1.1.2.7 @@ -3,7 +3,7 @@ * by Michael Pounov * * $Author: misho $ - * $Id: ansh.c,v 1.1.1.1.2.6 2011/10/14 07:47:21 misho Exp $ + * $Id: ansh.c,v 1.1.1.1.2.7 2011/10/14 09:04:04 misho Exp $ * ************************************************************************* The ELWIX and AITNET software is distributed under the following @@ -50,6 +50,7 @@ SUCH DAMAGE. intptr_t Kill; int Timeout, Verbose; u_int Crypted; +char Key[STRSIZ]; extern char compiled[], compiledby[], compilehost[]; @@ -61,6 +62,7 @@ Usage() " Syntax: ansh [options] \n\n" "\t-d \tBind to host interface, like 'em0' (default is first host interface)\n" "\t-t \tClient session timeout (default is 0 sec)\n" + "\t-k \tService cipher key\n" "\t-u\t\tSwitch to unencrypted traffic between hosts\n" "\t-v\t\tVerbose (more -v, more verbosity ...)\n" "\t-h\t\tThis help screen!\n" @@ -79,15 +81,20 @@ main(int argc, char **argv) Crypted = (u_int) random() % UINT_MAX; } while (!Crypted); + strlcpy(Key, DEFAULT_KEY, sizeof Key); + Get1stEth(szDev, STRSIZ); - while ((ch = getopt(argc, argv, "hvut:d:")) != -1) + while ((ch = getopt(argc, argv, "hvut:d:k:")) != -1) switch (ch) { case 't': Timeout = abs(strtol(optarg, NULL, 0)); break; case 'd': strlcpy(szDev, optarg, sizeof szDev); + break; + case 'k': + strlcpy(Key, optarg, sizeof Key); break; case 'u': Crypted ^= Crypted;