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.14 2004/05/26 18:53:14 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         logthing(LOGTHING_NOTICE, "Looking for path from 0x%llX to 0x%llX.",
 
  72         dofindpath(from, to, true, 3);
 
  79         puts("Produced by gpgwww " VERSION ", part of onak. "
 
  80                 "<A HREF=\"mailto:noodles-onak@earth.li\">"
 
  81                 "Jonathan McDowell</A>");
 
  84         cleanupcgi(cgiparams);