/* -*-c-*-
*
- * $Id: tripe.c,v 1.3 2001/02/04 17:10:40 mdw Exp $
+ * $Id: tripe.c,v 1.8 2002/01/13 17:28:29 mdw Exp $
*
* Main program
*
/*----- Revision history --------------------------------------------------*
*
* $Log: tripe.c,v $
+ * 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.
*
/*----- Global variables --------------------------------------------------*/
sel_state sel;
-octet buf_i[PKBUFSZ], buf_o[PKBUFSZ];
/*----- Static variables --------------------------------------------------*/
{
struct timeval tvv;
T( trace(T_PEER, "peer: interval timer"); )
- rand_seed(RAND_GLOBAL, RMD160_HASHSZ);
+ rand_seed(RAND_GLOBAL, HASHSZ);
p_interval();
tvv = *tv;
tvv.tv_sec += T_INTERVAL;
static void usage(FILE *fp)
{
- pquis(fp, "Usage: $ [-options]\n");
+ pquis(fp, "Usage: $ [-D] [-p port] [-T trace-opts] [-d dir] [-a socket]\n\
+ [-k priv-keyring] [-K pub-keyring] [-t key-tag]\n");
}
static void version(FILE *fp)
-K, --pub-keyring=FILE Get public keys from FILE.\n\
-t, --tag=KEYTAG Use private key labelled TAG.\n\
-a, --admin-socket=FILE Use FILE as the adminstration socket.\n\
+" T( "\
-T, --trace=OPTIONS Turn on tracing options.\n\
+" ) "\
", fp);
}
#define f_daemon 2u
ego(argv[0]);
- trace_on(stderr, 0);
+ T( trace_on(stderr, 0); )
if ((p = getenv("TRIPEDIR")) != 0)
dir = p;
km_init(kr_priv, kr_pub, tag_priv);
a_init(csock);
if (f & f_daemon) {
- if (u_daemon)
+ if (u_daemon())
die(EXIT_FAILURE, "couldn't become a daemon: %s", strerror(errno));
a_daemon();
}