/* Package Name : twhttpd * File Name : read_cfg.h * Author : Sam NG * * This package is an secure HTTP application proxy writen by Sam Ng. * Copyright (C) 2001 SAM NG * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, * MA 02111-1307, USA. */ // extern struct http_header_struct; #include "config.h" #include "structs.h" /* define global config */ #define yycfg cfg extern gen_cfg cfg; #define yysco tmp_sc extern srv_cfg tmp_sc; /* general functions */ void init_gen_cfg(gen_cfg *gc); void init_srv_cfg(srv_cfg *sc); void init_dt(struct decision_tree_st *dt); /* dt related functions */ decision_tree *or_dt(decision_tree *dt1, decision_tree *dt2); decision_tree *and_dt(decision_tree *dt1, decision_tree *dt2); decision_tree *seq_and_dt(decision_tree *dt1, decision_tree *dt2); int and_only_dt(decision_tree *dt); void print_dt(decision_tree *dt); int eval_dt(http_header *hd, decision_tree *init_dt); /* tester functions */ int cfg_str_fnmatch(http_header *hd, void *value, void *value2, int property); int cfg_str_regex(http_header *hd, void *value, void *value2, int property); int cfg_numeric_test(http_header *hd, void *value, void *value2, int property); int cfg_ip_range(http_header *hd, void *value, void *value2, int property); int cfg_is_cgi(http_header *hd, void *value, void *value2, int property); int cfg_htpasswd(http_header *hd, void *value, void *value2, int property); int cfg_set_forward(http_header *hd, void *value, void *value2, int property); int cfg_set_forward_proxy(http_header *hd, void *value, void *value2, int property); int cfg_set_location(http_header *hd, void *value, void *value2, int property); int cfg_return(http_header *hd, void *value, void *value2, int property); int cfg_strlen(char *s); void *cf_malloc(size_t s);