geomyidae

A small C-based gopherd. (gopher://bitreich.org/1/scm/geomyidae)
git clone git://r-36.net/geomyidae
Log | Files | Refs | README | LICENSE

handlr.h (2407B)


      1 /*
      2  * Copy me if you can.
      3  * by 20h
      4  */
      5 
      6 #ifndef HANDLR_H
      7 #define HANDLR_H
      8 
      9 /*
     10  * Handler API definition
     11  *
     12  *   Sample: /get/some/script/with/dirs////?key=value\tsearch what?\r\n
     13  *         * in /get/some/script is a file "index.dcgi"
     14  *         * request to bitreich.org on port 70 using TLS
     15  *         * base is in /var/gopher
     16  *         * client from 85.65.4.2
     17  *
     18  * path/file absolute path to the script/directory, always starts with '/'
     19  *   Sample: /var/gopher/get/some/script/index.dcgi
     20  * port .... port which the script should use when defining menu items
     21  *	     (See -o and -p in geomyidae(8))
     22  *   Sample: 70
     23  * base .... base path of geomyidae, never ends in '/', so chroot is ''
     24  *   Sample: /var/gopher
     25  * args .... Gives all variable input from the selector in some way.
     26  *   Sample: key=value
     27  * sear .... search part of request
     28  *   Sample: search what?
     29  * ohost ... host of geomyidae (See -h in geomyidae(8))
     30  *   Sample: bitreich.org
     31  * chost ... IP of the client sending a request
     32  *   Sample: 85.65.4.2
     33  * bhost ... server IP the server received the connection to
     34  *   Sample: 78.46.175.99
     35  * istls ... set to 1, if TLS was used for thr request
     36  *   Sample: 1
     37  * sel ..... Gives the raw selector after processing.
     38  *   Sample: /get/some/script/with/dirs////?key=value
     39  * traversal ..... Gives the raw selector after processing.
     40  *   Sample: /with/dirs////
     41  */
     42 
     43 void handledir(int sock, char *path, char *port, char *base, char *args,
     44 			char *sear, char *ohost, char *chost, char *bhost,
     45 			int istls, char *sel, char *traverse);
     46 void handlegph(int sock, char *file, char *port, char *base, char *args,
     47 			char *sear, char *ohost, char *chost, char *bhost,
     48 			int istls, char *sel, char *traverse);
     49 void handlebin(int sock, char *file, char *port, char *base, char *args,
     50 			char *sear, char *ohost, char *chost, char *bhost,
     51 			int istls, char *sel, char *traverse);
     52 void handletxt(int sock, char *file, char *port, char *base, char *args,
     53 			char *sear, char *ohost, char *chost, char *bhost,
     54 			int istls, char *sel, char *traverse);
     55 void handlecgi(int sock, char *file, char *port, char *base, char *args,
     56 			char *sear, char *ohost, char *chost, char *bhost,
     57 			int istls, char *sel, char *traverse);
     58 void handledcgi(int sock, char *file, char *port, char *base, char *args,
     59 			char *sear, char *ohost, char *chost, char *bhost,
     60 			int istls, char *sel, char *traverse);
     61 
     62 #endif