X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~mdw/git/tripe/blobdiff_plain/ef4a1ab72d88f8790c367b513863d4f9a101a34d..2d752320d61b46a65ebb9fa754033f250f097cd3:/tripe.c diff --git a/tripe.c b/tripe.c index 447a0c4c..0ba169b2 100644 --- a/tripe.c +++ b/tripe.c @@ -1,6 +1,6 @@ /* -*-c-*- * - * $Id: tripe.c,v 1.12 2003/11/29 23:49:32 mdw Exp $ + * $Id$ * * Main program * @@ -26,47 +26,6 @@ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/*----- Revision history --------------------------------------------------* - * - * $Log: tripe.c,v $ - * Revision 1.12 2003/11/29 23:49:32 mdw - * Debianization. - * - * Revision 1.11 2003/05/17 11:02:03 mdw - * Document the new `-b' option. - * - * Revision 1.10 2003/05/16 12:09:03 mdw - * Allow binding to a chosen address. - * - * Revision 1.9 2003/04/15 14:11:09 mdw - * Rationalize the behaviour of the `-G' and `-U' options. - * - * Revision 1.8 2002/01/13 17:28:29 mdw - * Don't turn tracing on if tracing is turned off (!). - * - * Revision 1.7 2002/01/13 17:14:05 mdw - * Don't include the tracing option in the help if not compiled in. - * - * Revision 1.6 2001/06/19 22:08:37 mdw - * Moved buffers to peer.c. - * - * Revision 1.5 2001/02/16 21:43:12 mdw - * Provide a more helpful usage message. - * - * Revision 1.4 2001/02/16 21:41:31 mdw - * Add a new buffer. - * - * Revision 1.3 2001/02/04 17:10:40 mdw - * Remove a debugging @abort@ call. - * - * Revision 1.2 2001/02/03 22:33:00 mdw - * Stuff more randomness into the pool in the interval timer. - * - * Revision 1.1 2001/02/03 20:26:37 mdw - * Initial checkin. - * - */ - /*----- Header files ------------------------------------------------------*/ #include "tripe.h" @@ -96,7 +55,7 @@ void interval(struct timeval *tv, void *v) { struct timeval tvv; T( trace(T_PEER, "peer: interval timer"); ) - rand_seed(RAND_GLOBAL, HASHSZ); + rand_seed(RAND_GLOBAL, MAXHASHSZ); p_interval(); tvv = *tv; tvv.tv_sec += T_INTERVAL; @@ -115,9 +74,9 @@ void interval(struct timeval *tv, void *v) static void usage(FILE *fp) { - pquis(fp, "Usage: $ [-D] [-d dir] [-b addr] [-p port]\n\ - [-U user] [-G group] [-a socket] [-T trace-opts]\n\ - [-k priv-keyring] [-K pub-keyring] [-t key-tag]\n"); + pquis(fp, "Usage: $ [-D] [-d DIR] [-b ADDR] [-p PORT]\n\ + [-U USER] [-G GROUP] [-a SOCKET] [-T TRACE-OPTS]\n\ + [-k PRIV-KEYRING] [-K PUB-KEYRING] [-t KEY-TAG]\n"); } static void version(FILE *fp) @@ -201,7 +160,7 @@ int main(int argc, char *argv[]) { 0, 0, 0, 0 } }; - int i = mdwopt(argc, argv, "hvu DU:G: b:p:d:k:K:t:a:" T("T:"), + int i = mdwopt(argc, argv, "hvuDU:G:b:p:d:k:K:t:a:" T("T:"), opts, 0, 0, 0); if (i < 0) break; @@ -310,7 +269,7 @@ int main(int argc, char *argv[]) sel_init(&sel); sig_init(&sel); rand_noisesrc(RAND_GLOBAL, &noise_source); - rand_seed(RAND_GLOBAL, RMD160_HASHSZ); + rand_seed(RAND_GLOBAL, MAXHASHSZ); signal(SIGPIPE, SIG_IGN); tun_init(); p_init(baddr, port);