Re: about cf.data.pre and squid compiling

From: Arthur Tumanyan <arthurtumanyan@dont-contact.us>
Date: Thu, 19 Jul 2007 00:25:52 -0700 (PDT)

Arthur Tumanyan wrote:
>
> Hi,everyone.I am working above a new squid based non-comercial
> engine,called Shaga.It will be included in Squid,and will write to
> database some entries of log file directly from squid for furter analysis.
>
> So,I add the lines below in the end of "cf.data.pre" and "cf_gen_defines"
> .
>
> cf.data.pre:
>
> NAME: enable_shaga_engine
> COMMENT: on|off
> IFDEF: USE_SHAGA
> TYPE: onoff
> DEFAULT: on
> LOC: Config.shaga.enable_shaga
> DOC_START
> DOC_END
>
> cf_den_defines:
> define["USE_SHAGA"]="--enable-shaga"
>
> Then I just do ./configure --enable-shaga ;make;make install.After
> installation I found in squid.conf the following lines :
>
> # TAG: enable_shaga_engine on|off
> # Note: This option is only available if Squid is rebuilt with the
> # --enable-shaga option
> #
>
> What is wrong?
> And where can I find more information about "TYPE" s ?
>
> Thanks in advance!
>
>
My shaga.h

-------------------------------------
#ifndef SHAGA_H
#define SHAGA_H

#define UNAME_L 8
#define PWD_L 8
#define Q_LINE_L 512

#define SHAGA_IDENT "ShagaEngine"
#define shaga_logfile "/var/log/shaga.log"
#define TMP_TABLE "tmp_traff"
//
int db_connect(char *,char *,char *,char *,unsigned int); /* 0 - success,1
- failure */
int initShagaEngine(void);
void log_debug(char *);
void log_to_shaga(char *);
void log_to_syslog(char *);
int shutdownShagaEngine(void);

int writeToDB(time_t __time,char *username,char * ip_address,char * bytes);

char MYSQL_ERR[Q_LINE_L];
char ERR_CONNECT[Q_LINE_L];
char ERR_INIT[Q_LINE_L];
char MSG_INIT[Q_LINE_L];
char ERR_VARIOUS[Q_LINE_L];
char DEBUG_STRING[Q_LINE_L];
char QBLOCKED_USER[Q_LINE_L];
char QOVERDRAFT_USER[Q_LINE_L];
char QBLOCK_USER[Q_LINE_L];
char QADD_REC_TODB[Q_LINE_L];
//
char timestr[25];
//const char SHAGA_IDENT[] = "ShagaEngine";
//const char shaga_logfile[] = "/var/log/shaga.log";
time_t ticks;
FILE *log_fd;
struct tm *thistime;
//
enum _logtype{ shaga,system_logger };
enum _onoff{ off , on };
//

struct _tr_info{

        u_int traffic_lim;
        u_int traffic_cur;
        u_int traffic_over;
        u_int reached; /* 0 - not reached,1 reached */
};
struct shaga_user{
        u_int id;
        char username[UNAME_L];
        char password[PWD_L];
        struct _tr_info tr_info;
        u_int isBlocked; /* 0 - user is not blocked,1 - user is blocked */
};

int u_count; /* users count */

char *db_host;
char *db_name;
char *db_user;
char *db_pwd;
unsigned int db_port;

MYSQL_RES *result;
MYSQL_ROW row;
MYSQL *connection, mysql;
int state;
//
#endif

-- 
View this message in context: http://www.nabble.com/about-cf.data.pre-and-squid-compiling-tf4044722.html#a11683658
Sent from the Squid - Development mailing list archive at Nabble.com.
Received on Thu Jul 19 2007 - 01:25:56 MDT

This archive was generated by hypermail pre-2.1.9 : Wed Aug 01 2007 - 12:00:06 MDT