2 * gpgwww.c - www interface to path finder.
4 * Jonathan McDowell <noodles@earth.li>
6 * Copyright 2001-2002 Project Purple.
8 * $Id: gpgwww.c,v 1.12 2003/10/15 21:15:20 noodles Exp $
20 #include "onak-conf.h"
23 void parsecgistuff(char **cgiparams, uint64_t *from, uint64_t *to)
27 if (cgiparams != NULL) {
29 while (cgiparams[i] != NULL) {
30 if (!strcmp(cgiparams[i], "to")) {
31 *to = strtoul(cgiparams[i+1], NULL, 16);
32 } else if (!strcmp(cgiparams[i], "from")) {
33 *from = strtoul(cgiparams[i+1], NULL, 16);
42 int main(int argc, char *argv[])
44 char **cgiparams = NULL; /* Our CGI parameter block */
45 uint64_t from = 0, to = 0;
47 cgiparams = getcgivars(argc, argv);
49 start_html("Experimental PGP key path finder results");
51 parsecgistuff(cgiparams, &from, &to);
53 if (from == 0 || to == 0) {
54 printf("Must pass from & to\n");
59 printf("<P>Looking for path from 0x%llX to 0x%llX.\n", from, to);
60 printf("<A HREF=\"gpgwww?from=0x%08llX&to=0x%08llX\">"
61 "Find reverse path</A></P>\n",
66 initlogthing("gpgwww", config.logfile);
69 dofindpath(from, to, true, 3);
76 puts("Produced by gpgwww " VERSION ", part of onak. "
77 "<A HREF=\"mailto:noodles-onak@earth.li\">"
78 "Jonathan McDowell</A>");
81 cleanupcgi(cgiparams);