typedef struct {
 struct list_head node;
 char *var, *value;
} head_t;

typedef struct {
 head_t *header;
 unsigned char *data;
 int len; 
} msg_t;

extern int just_head;

#define BODY	0
#define HEAD	1
#define UPLOAD	2

/* big enough for a jpeg */
#define MSG_BUFFER	0x2ffffff

extern unsigned int msg_buf_i;
extern char msg_buffer[MSG_BUFFER];


int find_cats(msg_t *msg);
msg_t *ask(char *name, u_int16_t port, int just_head);
void free_msg(msg_t *msg);
char *get_var(msg_t *msg, char *var);
void dump_vars(msg_t *msg);
void do_config(char *filename);
