volta.h
author Mahlon E. Smith <mahlon@martini.nu>
Fri, 26 Aug 2011 14:40:51 -0700
changeset 0 eac7211fe522
child 1 823d42546cea
permissions -rw-r--r--
Initial commit of an experimental little Squid redirector.


#ifndef _VOLTA_H
#define _VOLTA_H

#ifndef PROG
#define PROG    "volta"
#endif
#define VERSION "$Version$" /* expanded by mercurial */

#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
#include <unistd.h>

#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>


/* Maximum length per line from Squid */
#define LINE_BUFSIZE 2048

/* URL <SP> client_ip "/" fqdn <SP> user <SP> method [<SP> kvpairs]<NL> */
typedef struct request {
	char   *url;
	char   *host;
	struct sockaddr_in ip;
	char   *ip_fqdn;
	char   *user;
	char   *method;
	char   *kvpairs;
} request;

/* An "empty" request struct used for re-assignment */
static const struct request reset_request;

/* Prototypes */
void usage( char *prg );
void debug( const char *fmt, ... );
int  parse( char *p );

#endif