]>
git.ipfire.org Git - thirdparty/sarg.git/blob - include/defs.h
2 \brief Declaration of the structures and functions.
14 //! The buffer to store the data read from the log file.
16 //! The size of the buffer.
18 //! The number of bytes stored in the buffer.
20 //! The position of the beginning of the current string.
22 //! The position of the end of the current string.
26 struct generalitemstruct
28 //! \c True if the entry is for the total of the file or \c false if it is a single line.
30 //! The user to which the entry apply. The length is limited to ::MAX_USER_LEN.
32 //! The number of accesses performed by the user.
34 //! The number of bytes transfered.
36 //! The URL accessed by the user. The length is not limited.
38 //! The source IP address of the user. The length is limited to ::MAX_IP_LEN.
40 //! The time of the access. The length is limited to ::MAX_DATETIME_LEN.
42 //! The date of the access. The length is limited to ::MAX_DATETIME_LEN.
44 //! The number of milliseconds spend processing the request.
46 //! The number of bytes fetched from the cache of the proxy (cache hit).
48 //! The number of bytes fetched from the site (cache miss).
54 //! The ID of the user as found in the input file.
55 char id
[ MAX_USER_LEN
];
56 //! \c True if the ID is in fact the IP address from which the user connected.
58 //! The name of the user to display in the report.
59 char label
[ MAX_USER_LEN
];
60 //! The mangled name to use in file names of that user.
61 char filename
[ MAX_USER_FNAME_LEN
];
65 void htaccess ( const char * name
);
68 void authfail_report ( void );
71 void ccharset ( char * CharSet
);
74 void convlog ( const char * arq
, char * df
, int dfrom
, int duntil
);
77 void css ( FILE * fp_css
);
80 void dansguardian_log ( void );
82 // dansguardian_report.c
83 void dansguardian_report ( void );
86 void data_file ( char * tmp
);
89 void decomp ( char * arq
, char * zip
, const char * tmp
);
90 void recomp ( const char * arq
, const char * zip
) ;
93 void gen_denied_report ( void );
96 void download_report ( void );
97 void free_download ( void );
98 void set_download_suffix ( const char * list
);
99 int is_download_suffix ( const char * url
);
102 int geramail ( const char * dirname
, int debug
, const char * outdir
, int userip
, const char * email
, const char * TempDir
);
105 void gethexclude ( const char * hexfile
, int debug
);
106 void getuexclude ( const char * uexfile
, int debug
);
107 int vhexclude ( const char * url
);
108 int vuexclude ( const char * user
);
109 int is_indexonly ( void );
110 void free_exclude ( void );
116 void greport_day ( const struct userinfostruct
* user
);
117 void greport_cleanup ( void );
123 void index_only ( const char * dirname
, int debug
);
126 void ip2name ( char * ip
, int ip_len
);
127 void name2ip ( char * name
);
130 void language_load ( const char * language
);
133 void mklastlog ( const char * outdir
);
136 void make_index ( void );
142 void report_day ( const struct userinfostruct
* user
);
145 void gravatmp ( const struct userinfostruct
* uinfo
, const char * oldurl
, long long int nacc
, long long int nbytes
, const char * oldmsg
, long long int nelap
, int indexonly
, long long int incache
, long long int oucache
);
147 int ger_read ( char * buffer
, struct generalitemstruct
* item
, const char * filename
);
153 void smartfilter_report ( void );
156 void sort_users_log ( const char * tmp
, int debug
);
160 void splitlog ( const char * arq
, char * df
, int dfrom
, int duntil
, char * convert
);
163 void squidguard_log ( void );
165 // squidguard_report.c
166 void squidguard_report ( void );
175 void day_totalize ( const char * tmp
, const struct userinfostruct
* uinfo
, int indexonly
);
178 int totalger ( const char * dirname
, int debug
, const char * outdir
);
181 void usage ( const char * prog
);
184 void useragent ( void );
187 struct userinfostruct
* userinfo_create ( const char * userid
);
188 void userinfo_free ( void );
189 struct userinfostruct
* userinfo_find_from_file ( const char * filename
);
190 struct userinfostruct
* userinfo_find_from_id ( const char * id
);
193 void init_usertab ( const char * UserTabFile
);
194 void user_find ( char * mappedname
, int namelen
, const char * userlogin
);
195 void close_usertab ( void );
198 void getword_start ( struct getwordstruct
* gwarea
, const char * line
);
199 void getword_restart ( struct getwordstruct
* gwarea
);
200 int getword ( char * word
, int limit
, struct getwordstruct
* gwarea
, int stop
);
201 int getword_limit ( char * word
, int limit
, struct getwordstruct
* gwarea
, int stop
);
202 int getword_multisep ( char * word
, int limit
, struct getwordstruct
* gwarea
, int stop
);
203 int getword_skip ( int limit
, struct getwordstruct
* gwarea
, int stop
);
204 int getword_atoll ( long long int * number
, struct getwordstruct
* gwarea
, int stop
);
205 int getword_ptr ( char * orig_line
, char ** word
, struct getwordstruct
* gwarea
, int stop
);
206 long long int my_atoll ( const char * nptr
);
207 int is_absolute ( const char * path
);
208 int getnumlist ( char *, numlist
*, const int , const int );
209 void name_month ( char * month
, int month_len
);
210 void conv_month_name ( char * month
);
211 void buildymd ( const char * dia
, const char * mes
, const char * ano
, char * wdata
);
212 void date_from ( char * date
, char * dfrom
, char * duntil
);
213 char * fixnum ( long long int value
, int n
);
214 char * fixnum2 ( long long int value
, int n
);
215 void fixnone ( char * str
);
216 void fixper ( char * tbuf
, char * period
, const char * duntil
);
217 char * fixtime ( long int elap
);
218 void fixendofline ( char * str
);
219 void show_info ( FILE * fp_ou
);
220 void show_sarg ( FILE * fp_ou
, int depth
);
221 void write_logo_image ( FILE * fp_ou
);
222 void write_html_header ( FILE * fp_ou
, int depth
, const char * title
);
223 void close_html_header ( FILE * fp_ou
);
224 void write_html_trailer ( FILE * fp_ou
);
225 void output_html_string ( FILE * fp_ou
, const char * str
, int maxlen
);
226 void output_html_url ( FILE * fp_ou
, const char * url
);
227 void subs ( char * str
, int size
, char * from
, char * to
);
228 void conv_month ( char * month
);
229 void debuga ( const char * msg
,...);
230 void debugaz ( const char * head
, const char * msg
);
231 void my_lltoa ( unsigned long long int n
, char * s
, int ssize
, int len
);
232 char * get_size ( const char * path
, const char * file
);
233 void url_module ( const char * url
, char * w2
);
234 void url_to_file ( const char * url
, char * file
, int filesize
);
235 void strip_latin ( char * line
);
236 char * buildtime ( long long int elap
);
237 void obtdate ( const char * dirname
, const char * name
, char * data
);
238 void formatdate ( char * date
, int date_size
, int year
, int month
, int day
, int hour
, int minute
, int second
, int dst
);
239 void obtuser ( const char * dirname
, const char * name
, char * tuser
);
240 void obttotal ( const char * dirname
, const char * name
, char * tbytes
, const char * tuser
, char * media
);
242 int vercode ( const char * code
);
243 void load_excludecodes ( const char * ExcludeCodes
);
244 void free_excludecodes ( void );
245 void my_mkdir ( const char * name
);
246 int testvaliduserchar ( const char * user
);
247 char * strlow ( char * string
);
248 char * strup ( char * string
);
249 void builddia ( char * dia
, const char * mes
, const char * ano
, const char * df
, char * wdata
);
250 void vrfydir ( const char * per1
, const char * addr
, const char * site
, const char * us
, const char * form
);
251 void gperiod ( const char * dirname
, const char * period
);
252 void removetmp ( const char * outdir
);
253 void zdate ( char * ftime
, int ftimesize
, const char * DateFormat
);
255 char * get_param_value ( const char * param
, char * line
);
256 int compar ( const void *, const void * );
257 void unlinkdir ( const char * dir
, int contentonly
);
258 int longline_prepare ( struct longlinestruct
* line
);
259 char * longline_read ( FILE * fp_in
, struct longlinestruct
* line
);
260 void longline_free ( struct longlinestruct
* line
);