вообщем когда исправил в файле vars.h строку, чтобы режик был независимым, после пишу make и он вываливается с ошибками
make
rm -f pass.o raw_change.o load_cache.o pcre.o parse_input.o init_vars.o check_urls.o run_make_cache.o new_url.o redirect.o err_mes.o now.o get_opt.o parse_urls.o cache2url.o ip.o id.o comparing.o load_urls.o prune_urls.o write_cache.o need_cache_update.o err_mes.o now.o get_opt.o parse_urls.o cache2url.o ip.o id.o comparing.o redirector make-cache OUT
gcc -Wall -I/usr/include -I/usr/local/include -I/usr/include/pcre -c pass.c
In file included from pass.c:3:
vars.h:29: ошибка: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘CASE_INDEPENDENT’
make: *** [pass.o] Ошибка 1
что может быть...??
Режик собирается с ошибками
#include <stdio.h>
#include <pcre.h>
#define DEFAULT_CONFIG "/usr/local/rejik3/redirector.conf"
/*** Print debug info for develop ***/
//#define DEBUG_CFG
//#define DEBUG_CYCLE
//#define DEBUG_MAKE_CACHE
//#define DEBUG_URLS_LOAD
//#define DEBUG_PCRE
//#define DEBUG_PARSE_URL
//#define DEBUG_PRUNE_URLS
//#define DEBUG_CACHE2URL
//#define DEBUG_WRITE_CACHE
//#define DEBUG_LOAD_CACHE
//#define DEBUG_PARSE_UNPUT
//#define DEBUG_CHECK_URLS
//#define DEBUG_URLS_CMP
//#define DEBUG_RUN_MAKE_CACHE
//#define DEBUG_IP
//#define DEBUG_ID
//#define DEBUG_NEW_URL
//#define DEBUG_RAW_CHANGE
//#define DEBUG_PASS
// Uncoment next line for case independent
define CASE_INDEPENDENT - вот здесь раскоментировал
// MAX LENS OF SOME VARS
#define ML_CFG 200
#define ML_FILE_NAME 200
#define ML_ETMP 5512
#define ML_PCRE_VARS 512
#define ML_URL 4095
#define ML_HOST 100
#define ML_IDENT 100
#define ML_METHOD 10
#define ML_PROTOKOL 20
#define ML_DIRS 1024
#define ML_PORT 10
#define ML_2LD 200
#define ML_SUBDOMEN 200
FILE *change_log;
unsigned char *input_ident;
unsigned char *input_ident_un;
unsigned char *input_ip;
unsigned char *input_url;
unsigned char *input_url_un;
#ifdef CASE_INDEPENDENT
unsigned char *input_url_uc;
#endif
unsigned char *input_method;
unsigned char *input_host;
//unsigned int input_separator;
struct p_url *i_url;
unsigned char *change_reason;
/*****************************************************************
* http://sub.sub.sub.domen2levelname.ru:4 ... r/dir/file *
* | | | | | | *
* protocol | subdomen | twoleveldomen |port| dirs *
*****************************************************************/
struct p_url
{
unsigned char protocol[ML_PROTOKOL];
unsigned char twoleveldomen[ML_2LD];
unsigned char port[ML_PORT];
unsigned char subdomen[ML_SUBDOMEN];
unsigned char dirs[ML_DIRS];
};
//GLOBAL OPTIONS
unsigned char *err_log; // Error log path
unsigned char *chg_log; // Change log path
unsigned char *makecache; // make-cache program
unsigned char *work_ip; //Work ip
unsigned int work_ip_count; //Work ip count
unsigned int work_ip_flag; //Work ip flag
unsigned char *allow_ip; //Allow ip
unsigned int allow_ip_count; //Allow ip count
unsigned char **work_id; //Work id
unsigned int work_id_count; //Work id count
unsigned int work_id_flag; //Work id flag
unsigned char **allow_id; //Allow id
unsigned int allow_id_count; //Allow id count
unsigned char *allow_urls_file; //Allow urls file name
unsigned char **allow_urls; //Allow urls
unsigned int allow_urls_count; //Allow urls count
unsigned char **change_from; //
unsigned char **change_to; // Change data
unsigned int change_count; //
int raw_change_log_flag; //
unsigned int sections_count; //Count of sections in config
//SECTIONS OPTIONS
unsigned int sections_count; //Count of sections in config
struct section
{
unsigned char *name; //Header name
char *ban_dir; //Ban lists dir
char *url; //Url to change
char revers; // revers flag
char **new_url; // Block of urls
char *new_url_inset; // to change with
int new_url_count; // change #*# elements
char log_flag; //Write to log or not
unsigned char *work_ip; //Work ip
unsigned int work_ip_count; //Work ip count
unsigned int work_ip_flag; //Work ip flag
unsigned char *allow_ip; //Allow ip
unsigned int allow_ip_count; //Allow ip count
unsigned char **work_id; //Work id
unsigned int work_id_count; //Work id count
unsigned int work_id_flag; //Work id flag
unsigned char **allow_id; //Allow id
unsigned int allow_id_count; //Allow id count
pcre **ban_pcre; //Ban PCRE patterns
pcre_extra **ban_pcre_s; //Ban PCRE optimization
unsigned int ban_pcre_count; //Ban PCRE patterns count
unsigned char **ban_urls; //Ban urls lists area
unsigned int ban_urls_count; //Counter urls elements
} **redir;
char *now (void);
void err_mes(char*);
void get_opt(char*);
int load_urls(int,char *);
int parse_urls(struct p_url *,char *);
int prune_urls(int);
int cmp_urls(const void *, const void *);
int cache2url(struct p_url *,char *);
int need_cache_update(char*,char*);
int write_cache(int,char*,char*);
int load_cache(unsigned char ***,unsigned int*,unsigned char *);
int load_pcre_file(int);
int check_pcre(int);
int parse_input(unsigned char *);
void init_vars(void);
int check_url(unsigned char**,int count);
int cmp_urls_bs(const void *, const void *);
int cmp_urls_sub(const void *, const void *);
int cmp_urls_dirs(const void *, const void *);
int cmp_urls_port(const void *, const void *);
int run_make_cache(char*);
int add_ip(char *,unsigned char **,unsigned int* );
int check_ip(unsigned char *,unsigned int );
int add_id(char *,unsigned char ***,unsigned int* );
int sort_id(unsigned char ***,unsigned int* );
int check_id(unsigned char **,unsigned int);
int prepare_new_url(int);
int add_new_url (int, char *, int);
int redirect(int);
int raw_change(void);
int pass(void);
#include <pcre.h>
#define DEFAULT_CONFIG "/usr/local/rejik3/redirector.conf"
/*** Print debug info for develop ***/
//#define DEBUG_CFG
//#define DEBUG_CYCLE
//#define DEBUG_MAKE_CACHE
//#define DEBUG_URLS_LOAD
//#define DEBUG_PCRE
//#define DEBUG_PARSE_URL
//#define DEBUG_PRUNE_URLS
//#define DEBUG_CACHE2URL
//#define DEBUG_WRITE_CACHE
//#define DEBUG_LOAD_CACHE
//#define DEBUG_PARSE_UNPUT
//#define DEBUG_CHECK_URLS
//#define DEBUG_URLS_CMP
//#define DEBUG_RUN_MAKE_CACHE
//#define DEBUG_IP
//#define DEBUG_ID
//#define DEBUG_NEW_URL
//#define DEBUG_RAW_CHANGE
//#define DEBUG_PASS
// Uncoment next line for case independent
define CASE_INDEPENDENT - вот здесь раскоментировал
// MAX LENS OF SOME VARS
#define ML_CFG 200
#define ML_FILE_NAME 200
#define ML_ETMP 5512
#define ML_PCRE_VARS 512
#define ML_URL 4095
#define ML_HOST 100
#define ML_IDENT 100
#define ML_METHOD 10
#define ML_PROTOKOL 20
#define ML_DIRS 1024
#define ML_PORT 10
#define ML_2LD 200
#define ML_SUBDOMEN 200
FILE *change_log;
unsigned char *input_ident;
unsigned char *input_ident_un;
unsigned char *input_ip;
unsigned char *input_url;
unsigned char *input_url_un;
#ifdef CASE_INDEPENDENT
unsigned char *input_url_uc;
#endif
unsigned char *input_method;
unsigned char *input_host;
//unsigned int input_separator;
struct p_url *i_url;
unsigned char *change_reason;
/*****************************************************************
* http://sub.sub.sub.domen2levelname.ru:4 ... r/dir/file *
* | | | | | | *
* protocol | subdomen | twoleveldomen |port| dirs *
*****************************************************************/
struct p_url
{
unsigned char protocol[ML_PROTOKOL];
unsigned char twoleveldomen[ML_2LD];
unsigned char port[ML_PORT];
unsigned char subdomen[ML_SUBDOMEN];
unsigned char dirs[ML_DIRS];
};
//GLOBAL OPTIONS
unsigned char *err_log; // Error log path
unsigned char *chg_log; // Change log path
unsigned char *makecache; // make-cache program
unsigned char *work_ip; //Work ip
unsigned int work_ip_count; //Work ip count
unsigned int work_ip_flag; //Work ip flag
unsigned char *allow_ip; //Allow ip
unsigned int allow_ip_count; //Allow ip count
unsigned char **work_id; //Work id
unsigned int work_id_count; //Work id count
unsigned int work_id_flag; //Work id flag
unsigned char **allow_id; //Allow id
unsigned int allow_id_count; //Allow id count
unsigned char *allow_urls_file; //Allow urls file name
unsigned char **allow_urls; //Allow urls
unsigned int allow_urls_count; //Allow urls count
unsigned char **change_from; //
unsigned char **change_to; // Change data
unsigned int change_count; //
int raw_change_log_flag; //
unsigned int sections_count; //Count of sections in config
//SECTIONS OPTIONS
unsigned int sections_count; //Count of sections in config
struct section
{
unsigned char *name; //Header name
char *ban_dir; //Ban lists dir
char *url; //Url to change
char revers; // revers flag
char **new_url; // Block of urls
char *new_url_inset; // to change with
int new_url_count; // change #*# elements
char log_flag; //Write to log or not
unsigned char *work_ip; //Work ip
unsigned int work_ip_count; //Work ip count
unsigned int work_ip_flag; //Work ip flag
unsigned char *allow_ip; //Allow ip
unsigned int allow_ip_count; //Allow ip count
unsigned char **work_id; //Work id
unsigned int work_id_count; //Work id count
unsigned int work_id_flag; //Work id flag
unsigned char **allow_id; //Allow id
unsigned int allow_id_count; //Allow id count
pcre **ban_pcre; //Ban PCRE patterns
pcre_extra **ban_pcre_s; //Ban PCRE optimization
unsigned int ban_pcre_count; //Ban PCRE patterns count
unsigned char **ban_urls; //Ban urls lists area
unsigned int ban_urls_count; //Counter urls elements
} **redir;
char *now (void);
void err_mes(char*);
void get_opt(char*);
int load_urls(int,char *);
int parse_urls(struct p_url *,char *);
int prune_urls(int);
int cmp_urls(const void *, const void *);
int cache2url(struct p_url *,char *);
int need_cache_update(char*,char*);
int write_cache(int,char*,char*);
int load_cache(unsigned char ***,unsigned int*,unsigned char *);
int load_pcre_file(int);
int check_pcre(int);
int parse_input(unsigned char *);
void init_vars(void);
int check_url(unsigned char**,int count);
int cmp_urls_bs(const void *, const void *);
int cmp_urls_sub(const void *, const void *);
int cmp_urls_dirs(const void *, const void *);
int cmp_urls_port(const void *, const void *);
int run_make_cache(char*);
int add_ip(char *,unsigned char **,unsigned int* );
int check_ip(unsigned char *,unsigned int );
int add_id(char *,unsigned char ***,unsigned int* );
int sort_id(unsigned char ***,unsigned int* );
int check_id(unsigned char **,unsigned int);
int prepare_new_url(int);
int add_new_url (int, char *, int);
int redirect(int);
int raw_change(void);
int pass(void);
конфиг Squid
каталогов первого уровня и 256 второго.
cache_dir ufs /var/spool/squid 1500 16 256
http_port 192.168.1.1:3128 transparent
visible_hostname SquidFox
hierarchy_stoplist cgi-bin ?
acl QUERY urlpath_regex cgi-bin /?
no_cache deny QUERY
#pid_filename /usr/local/squid/var/logs/squid.pid
#Протокол доступа к кэшу
cache_access_log /var/log/squid/access.log
#Протокол работы кэша
cache_log /var/log/squid/cache.log
#Протокол работы менеджера кэша
cache_store_log /var/log/squid/store.log
# Размер оперативной памяти, предоставляемой кэшу
cache_mem 256 MB
# Максимальный размер объекта, записываемого в кэш
maximum_object_size 15000 KB
refresh_pattern ^ftp: 1440 20% 10080
refresh_pattern ^gopher: 1440 0% 1440
refresh_pattern . 0 20% 4320
#локальная сеть
acl all src 0.0.0.0/0.0.0.0
acl manager proto_cache object
acl localnet src 192.168.1.0/255.255.255.0
acl localhost src 127.0.0.1/255.255.255.255
acl to_localhost dst 127.0.0.0/8
# Указываем необходимые правильные порт
acl SSL_ports port 443 563
acl Safe_ports port 80
acl Safe_ports port 21
acl Safe_ports port 5190
acl Safe_ports port 443 563
acl Safe_ports port 70
acl Safe_ports port 210
acl Safe_ports port 1025-65535
acl Safe_ports port 280
acl Safe_ports port 488
acl Safe_ports port 591
acl Safe_ports port 777
acl CONNECT method CONNECT
http_access allow manager
http_access allow localnet
http_access allow manager localhost
http_access deny manager
http_access deny CONNECT !SSL_ports
http_access deny !Safe_ports
http_access deny all
http_reply_access allow all
icp_access allow all
cache_mgr
cache_effective_user squid
cache_effective_group squid
error_directory /usr/share/squid/errors/Russian-1251
coredump_dir /var/log/squid/cache
redirect_program /usr/local/rejik3/redirector /usr/local/rejik3/redirector.conf
После access.log
1218900783.826 2674 192.168.1.2 TCP_MISS/200 30097 GET http://sex.ru/ - DIRECT/89.108.86.213 text/html
1218900784.187 288 192.168.1.2 TCP_MISS/200 1549 GET http://sex.ru/menu.txt - DIRECT/89.108.86.213 text/plain
1218900789.223 2242 192.168.1.2 TCP_MISS/200 30097 GET http://sex.ru/ - DIRECT/89.108.86.213 text/html
1218900791.094 1802 192.168.1.2 TCP_MISS/200 25670 GET http://sex.ru/menu.txt - DIRECT/89.108.86.213 text/plain
и потом в режике в логах пусто права везде стоят squid....
раньше работал потом отвалился почему то..
Help:///
каталогов первого уровня и 256 второго.
cache_dir ufs /var/spool/squid 1500 16 256
http_port 192.168.1.1:3128 transparent
visible_hostname SquidFox
hierarchy_stoplist cgi-bin ?
acl QUERY urlpath_regex cgi-bin /?
no_cache deny QUERY
#pid_filename /usr/local/squid/var/logs/squid.pid
#Протокол доступа к кэшу
cache_access_log /var/log/squid/access.log
#Протокол работы кэша
cache_log /var/log/squid/cache.log
#Протокол работы менеджера кэша
cache_store_log /var/log/squid/store.log
# Размер оперативной памяти, предоставляемой кэшу
cache_mem 256 MB
# Максимальный размер объекта, записываемого в кэш
maximum_object_size 15000 KB
refresh_pattern ^ftp: 1440 20% 10080
refresh_pattern ^gopher: 1440 0% 1440
refresh_pattern . 0 20% 4320
#локальная сеть
acl all src 0.0.0.0/0.0.0.0
acl manager proto_cache object
acl localnet src 192.168.1.0/255.255.255.0
acl localhost src 127.0.0.1/255.255.255.255
acl to_localhost dst 127.0.0.0/8
# Указываем необходимые правильные порт
acl SSL_ports port 443 563
acl Safe_ports port 80
acl Safe_ports port 21
acl Safe_ports port 5190
acl Safe_ports port 443 563
acl Safe_ports port 70
acl Safe_ports port 210
acl Safe_ports port 1025-65535
acl Safe_ports port 280
acl Safe_ports port 488
acl Safe_ports port 591
acl Safe_ports port 777
acl CONNECT method CONNECT
http_access allow manager
http_access allow localnet
http_access allow manager localhost
http_access deny manager
http_access deny CONNECT !SSL_ports
http_access deny !Safe_ports
http_access deny all
http_reply_access allow all
icp_access allow all
cache_mgr
cache_effective_user squid
cache_effective_group squid
error_directory /usr/share/squid/errors/Russian-1251
coredump_dir /var/log/squid/cache
redirect_program /usr/local/rejik3/redirector /usr/local/rejik3/redirector.conf
После access.log
1218900783.826 2674 192.168.1.2 TCP_MISS/200 30097 GET http://sex.ru/ - DIRECT/89.108.86.213 text/html
1218900784.187 288 192.168.1.2 TCP_MISS/200 1549 GET http://sex.ru/menu.txt - DIRECT/89.108.86.213 text/plain
1218900789.223 2242 192.168.1.2 TCP_MISS/200 30097 GET http://sex.ru/ - DIRECT/89.108.86.213 text/html
1218900791.094 1802 192.168.1.2 TCP_MISS/200 25670 GET http://sex.ru/menu.txt - DIRECT/89.108.86.213 text/plain
и потом в режике в логах пусто права везде стоят squid....
раньше работал потом отвалился почему то..
Help:///