X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~mdw/git/tripe/blobdiff_plain/50c74957dd3384f817e6018f0a40647a9153d904..13a55605839046f6f42910de713f4a9b6c44dfd4:/mallory.c diff --git a/mallory.c b/mallory.c index 267e9d47..970e18e7 100644 --- a/mallory.c +++ b/mallory.c @@ -1,6 +1,6 @@ /* -*-c-*- * - * $Id: mallory.c,v 1.1 2001/06/19 22:11:14 mdw Exp $ + * $Id$ * * An evil proxy for TrIPE * @@ -26,14 +26,6 @@ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/*----- Revision history --------------------------------------------------* - * - * $Log: mallory.c,v $ - * Revision 1.1 2001/06/19 22:11:14 mdw - * The beginnings of a malicious proxy for TrIPE. - * - */ - /*----- Header files ------------------------------------------------------*/ #include "config.h" @@ -65,10 +57,11 @@ #include #include +#include + #include #include -#include #include #include @@ -76,7 +69,6 @@ #include #include -#include "buf.h" /*----- Data structures ---------------------------------------------------*/ @@ -212,18 +204,26 @@ static void addfork(filter *f, unsigned ac, char **av) static void nextfork(unsigned ac, char **av) { - unsigned i; + unsigned i, j; filter *f; forkfilt *ff; forknode *fn, **ffn; peer *p; + if (ac < 1) + die(1, "syntax: next:NAME:..."); for (i = 0; i < 2; i++) { p = &peers[i]; for (f = p->f; f; f = f->next) { if (f->func != dofork) continue; ff = f->state; + for (j = 0; j < ac; j++) { + if (strcmp(av[j], ff->name) == 0) + goto match; + } + continue; + match: fn = CREATE(forknode); for (ffn = &ff->fn; *ffn; ffn = &(*ffn)->next) ; @@ -610,7 +610,7 @@ static void version(FILE *fp) static void usage(FILE *fp) { - pquis(fp, "Usage: $ [-k keyring] directive...\n"); + pquis(fp, "Usage: $ [-k KEYRING] DIRECTIVE...\n"); } static void help(FILE *fp) @@ -618,6 +618,28 @@ static void help(FILE *fp) version(fp); putc('\n', fp); usage(fp); + fputs("\n\ +Options:\n\ +\n\ +-h, --help Show this help text.\n\ +-v, --version Show the version number.\n\ +-u, --usage Show terse usage summary.\n\ +\n\ +-k, --keyring=FILE Fetch keys from FILE.\n\ +\n\ +Directives:\n\ + peer:NAME:LOCAL-PORT:REMOTE-ADDR:REMOTE-PORT\n\ + include:FILE\n\ + {,l,r}filt:FILTER:ARGS:...\n\ + next:TAG\n\ + {,l,r}flood:TYPE:MILLIS:SIZE\n\ +\n\ +Filters:\n\ + send\n\ + fork:TAG\n\ + delay:QLEN[:MILLIS:P-REPLAY]\n\ + corrupt[:P-CORRUPT]\n", + fp); } int main(int argc, char *argv[])