sarg  2.4.0
About: SARG ia a Squid Analysis Report Generator.
  Fossies Dox: sarg-2.4.0.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

defs.h
Go to the documentation of this file.
1 
5 #ifdef __MINGW32__
6 #define __attribute__(a)
7 #endif
8 
9 #include "include/fileobject.h"
10 
13 {
22 };
23 
24 struct ReadLogStruct;//forward declaration
25 
27 {
28  const char *current;
29  const char *beginning;
30  int modified;
31 };
32 
33 typedef struct longlinestruct *longline;
34 
36 {
38  int total;
40  char *user;
42  long long nacc;
44  long long nbytes;
46  char *url;
48  char *ip;
50  char *time;
52  char *date;
54  long long nelap;
56  long long incache;
58  long long oucache;
59 };
60 
65 {
74 };
75 
79 {
81  const char *id;
83  const char *ip;
85  bool id_is_ip;
87  bool no_report;
89  const char *label;
91  const char *filename;
93  int topuser;
95  int flag;
96 #ifdef ENABLE_DOUBLE_CHECK_DATA
97  long long int nbytes;
100  long long int elap;
101 #endif
102 };
103 
105 typedef struct userscanstruct *userscan;
106 
110 {
112  long long int nacc;
114  long long int nbytes;
116  long long int elap;
118  long long int incache;
120  long long int oucache;
122  int totuser;
123 };
124 
126 typedef struct DayStruct *DayObject;
127 
132 {
134  char DateRange[255];
138  int EndDate;
144  long int max_elapsed;
146  bool SysUsers;
150  int EndTime;
151 };
152 
157 {
162 };
163 
168 {
171 };
172 
177 {
179  char File[255];
181  int Limit;
184 };
185 
186 // auth.c
187 void htaccess(const struct userinfostruct *uinfo);
188 
189 // authfail.c
190 void authfail_open(void);
191 void authfail_write(const struct ReadLogStruct *log_entry);
192 void authfail_close(void);
193 bool is_authfail(void);
194 void authfail_report(void);
195 void authfail_cleanup(void);
196 
197 // convlog.c
198 void convlog(const char* arq, char df, const struct ReadLogDataStruct *ReadFilter);
199 
200 // css.c
201 void css_content(FILE *fp_css);
202 void css(FILE *fp_css);
203 
204 // dansguardian_log.c
205 void dansguardian_log(const struct ReadLogDataStruct *ReadFilter);
206 
207 // dansguardian_report.c
208 void dansguardian_report(void);
209 
210 // datafile.c
211 void data_file(char *tmp);
212 
213 // decomp.c
214 FileObject *decomp(const char *arq);
215 
216 // denied.c
217 void denied_open(void);
218 void denied_write(const struct ReadLogStruct *log_entry);
219 void denied_close(void);
220 bool is_denied(void);
221 void gen_denied_report(void);
222 void denied_cleanup(void);
223 
224 // download.c
225 void download_open(void);
226 void download_write(const struct ReadLogStruct *log_entry,const char *url);
227 void download_close(void);
228 bool is_download(void);
229 void download_report(void);
230 void free_download(void);
231 void set_download_suffix(const char *list);
232 bool is_download_suffix(const char *url);
233 void download_cleanup(void);
234 
235 // email.c
236 FILE *Email_OutputFile(const char *Module);
237 void Email_Send(FILE *fp,const char *Subject);
238 
239 // exclude.c
240 void gethexclude(const char *hexfile, int debug);
241 void getuexclude(const char *uexfile, int debug);
242 int vhexclude(const char *url);
243 int vuexclude(const char *user);
244 bool is_indexonly(void);
245 void free_exclude(void);
246 
247 #ifndef HAVE_FNMATCH
248 // fnmtach.c
249 int fnmatch(const char *pattern,const char *string,int flags);
250 #endif
251 
252 // getconf.c
253 void getconf(const char *File);
254 
255 // grepday.c
256 void greport_prepare(void);
257 void greport_day(const struct userinfostruct *user);
258 void greport_cleanup(void);
259 
260 // html.c
261 void htmlrel(void);
262 
263 // indexonly.c
264 void index_only(const char *dirname,int debug);
265 
266 // ip2name.c
267 int ip2name_config(const char *param);
268 void ip2name_forcedns(void);
269 void ip2name(char *ip,int ip_len);
270 void ip2name_cleanup(void);
271 void name2ip(char *name,int name_size);
272 
273 // lastlog.c
274 void mklastlog(const char *outdir);
275 
276 // longline.c
277 __attribute__((warn_unused_result)) /*@null@*//*@only@*/longline longline_create(void);
278 void longline_reset(longline line);
279 /*@null@*/char *longline_read(FileObject *fp_in,/*@null@*/longline line);
280 void longline_destroy(/*@out@*//*@only@*//*@null@*/longline *line_ptr);
281 
282 // index.c
283 void make_index(void);
284 
285 // readlog.c
286 int ReadLogFile(struct ReadLogDataStruct *Filter);
287 bool GetLogPeriod(struct tm *Start,struct tm *End);
288 
289 // realtime.c
290 void realtime(void);
291 
292 // redirector.c
293 void redirector_log(const struct ReadLogDataStruct *ReadFilter);
294 void redirector_report(void);
295 
296 // repday.c
297 void report_day(const struct userinfostruct *user);
298 
299 // report.c
300 void gerarel(const struct ReadLogDataStruct *ReadFilter);
301 int ger_read(char *buffer,struct generalitemstruct *item,const char *filename);
302 void totalger(FILE *fp_gen,const char *filename);
303 
304 // siteuser.c
305 void siteuser(void);
306 
307 // smartfilter.c
308 void smartfilter_report(void);
309 
310 // sort.c
311 void sort_users_log(const char *tmp, int debug,struct userinfostruct *uinfo);
312 void tmpsort(const struct userinfostruct *uinfo);
313 void sort_labels(const char **label,const char **order);
314 
315 // splitlog.c
316 void splitlog(const char *arq, char df, const struct ReadLogDataStruct *ReadFilter, int convert, const char *splitprefix);
317 
318 // topsites.c
319 void topsites(void);
320 
321 // topuser.c
322 void topuser(void);
323 
324 // totday.c
325 DayObject day_prepare(void);
326 void day_cleanup(DayObject ddata);
327 void day_newuser(DayObject ddata);
328 void day_addpoint(DayObject ddata,const char *date, const char *time, long long int elap, long long int bytes);
329 void day_totalize(DayObject ddata,const char *tmp, const struct userinfostruct *uinfo);
330 void day_deletefile(const struct userinfostruct *uinfo);
331 
332 // url.c
333 void read_hostalias(const char *Filename);
334 void free_hostalias(void);
335 const char *skip_scheme(const char *url);
336 const char *process_url(const char *url,bool full_url);
337 void url_hostname(const char *url,char *hostname,int hostsize);
338 
339 // usage.c
340 void usage(const char *prog);
341 
342 // useragent.c
343 FILE *UserAgent_Open(void);
344 void UserAgent_Write(FILE *fp,const struct tm *Time,const char *Ip,const char *User,const char *Agent);
346 void UserAgent(void);
347 
348 // userinfo.c
349 /*@shared@*/struct userinfostruct *userinfo_create(const char *userid, const char *ip);
350 void userinfo_free(void);
351 void userinfo_label(struct userinfostruct *uinfo,const char *label);
352 /*@shared@*/struct userinfostruct *userinfo_find_from_file(const char *filename);
353 /*@shared@*/struct userinfostruct *userinfo_find_from_id(const char *id);
354 /*@shared@*/struct userinfostruct *userinfo_find_from_ip(const char *ip);
356 void userinfo_stopscan(userscan uscan);
358 void userinfo_clearflag(void);
359 void read_useralias(const char *Filename);
360 void free_useralias(void);
361 enum UserProcessError process_user(const char **UserPtr,const char *IpAddress,bool *IsIp);
362 
363 // usertab.c
364 void init_usertab(const char *UserTabFile);
365 void user_find(char *mappedname, int namelen, const char *userlogin);
366 void close_usertab(void);
367 
368 // util.c
369 void getword_start(/*@out@*/struct getwordstruct *gwarea, const char *line);
370 void getword_restart(struct getwordstruct *gwarea);
371 __attribute__((warn_unused_result)) int getword(/*@out@*/char *word, int limit, struct getwordstruct *gwarea, char stop);
372 __attribute__((warn_unused_result)) int getword_limit(/*@out@*/char *word, int limit, struct getwordstruct *gwarea, char stop);
373 __attribute__((warn_unused_result)) int getword_multisep(/*@out@*/char *word, int limit, struct getwordstruct *gwarea, char stop);
374 __attribute__((warn_unused_result)) int getword_skip(int limit, struct getwordstruct *gwarea, char stop);
375 __attribute__((warn_unused_result)) int getword_atoll(/*@out@*/long long int *number, struct getwordstruct *gwarea, char stop);
376 __attribute__((warn_unused_result)) int getword_atoi(/*@out@*/int *number, struct getwordstruct *gwarea, char stop);
377 __attribute__((warn_unused_result)) int getword_atol(long int *number, struct getwordstruct *gwarea, char stop);
378 __attribute__((warn_unused_result)) int getword_atolu(unsigned long int *number, struct getwordstruct *gwarea, char stop);
379 __attribute__((warn_unused_result)) int getword_ptr(char *orig_line,/*@out@*/char **word, struct getwordstruct *gwarea, char stop);
380 long long int my_atoll (const char *nptr);
381 int is_absolute(const char *path);
382 void getnumlist(const char *paramname, const char *buffer, int *list, int maxvalue);
383 bool numlistcontains(const int *list, int maxvalue, int value);
384 int conv_month(const char *month);
385 const char *conv_month_name(int month);
386 void buildymd(const char *dia, const char *mes, const char *ano, char *wdata,int wdata_size);
388 char *fixnum(long long int value, int n);
389 char *fixnum2(long long int value, int n);
390 void fixnone(char *str);
391 char *fixtime(long long int elap);
392 void fixendofline(char *str);
393 void show_info(FILE *fp_ou);
394 void show_sarg(FILE *fp_ou, int depth);
395 void write_logo_image(FILE *fp_ou);
396 void write_html_head(FILE *fp_ou, int depth, const char *page_title,int javascript);
397 void write_html_header(FILE *fp_ou, int depth, const char *title,int javascript);
398 void close_html_header(FILE *fp_ou);
399 void write_html_trailer(FILE *fp_ou);
400 void output_html_string(FILE *fp_ou,const char *str,int maxlen);
401 void output_html_url(FILE *fp_ou,const char *url);
402 void output_html_link(FILE *fp_ou,const char *url,int maxlen);
403 void debuga(const char *File, int Line, const char *msg,...) __attribute__((format(printf,3,4)));
404 void debuga_more(const char *msg,...) __attribute__((format(printf,1,2)));
405 void debugaz(const char *File,int Line,const char *msg,...) __attribute__((format(printf,3,4)));
406 void my_lltoa(unsigned long long int n, char *s, int ssize, int len);
407 void url_module(const char *url, char *w2);
408 void url_to_anchor(const char *url,char *anchor,int size);
409 void safe_strcpy(char *dest,const char *src,int length);
410 void strip_latin(char *line);
411 char *buildtime(long long int elap);
412 int obtdate(const char *dirname, const char *name, char *data);
413 void formatdate(char *date,int date_size,int year,int month,int day,int hour,int minute,int second,int dst);
414 void computedate(int year,int month,int day,struct tm *t);
415 int obtuser(const char *dirname, const char *name);
416 void obttotal(const char *dirname, const char *name, int nuser, long long int *tbytes, long long int *media);
417 void version(void);
418 int vercode(const char *code);
419 void load_excludecodes(const char *ExcludeCodes);
420 void free_excludecodes(void);
421 int PortableMkDir(const char *path,int mode);
422 bool my_mkdir(const char *name);
423 void makeTmpDir(const char *tmp);
424 int testvaliduserchar(const char *user);
425 char *strlow(char *string);
426 char *strup(char *string);
427 int month2num(const char *month);
428 int builddia(int day, int month, int year);
429 int compare_date(const struct tm *date1,const struct tm *date2);
430 bool IsTreeFileDirName(const char *Name);
431 bool IsTreeYearFileName(const char *Name);
432 bool IsTreeMonthFileName(const char *Name);
433 bool IsTreeDayFileName(const char *Name);
434 int vrfydir(const struct periodstruct *per1, const char *addr, const char *site, const char *us);
435 int getperiod_fromsarglog(const char *arqtt,struct periodstruct *period);
437 void getperiod_torange(const struct periodstruct *period,int *dfrom,int *duntil);
438 void getperiod_merge(struct periodstruct *main,struct periodstruct *candidate);
440 void removetmp(const char *outdir);
441 void zdate(char *ftime,int ftimesize, char DateFormat);
442 char *get_param_value(const char *param,char *line);
443 int compar( const void *, const void * );
444 void unlinkdir(const char *dir,bool contentonly);
445 void emptytmpdir(const char *dir);
446 int extract_address_mask(const char *buf,const char **text,unsigned char *ipv4,unsigned short int *ipv6,int *nbits,const char **next);
447 int format_path(const char *file, int line, char *output_buffer, int buffer_size, const char *format,...);
448 void append_to_path(char *base_path, int base_path_size, const char *append);
siteuser
void siteuser(void)
Definition: siteuser.c:30
authfail_close
void authfail_close(void)
Definition: authfail.c:81
LogLevel_Data
@ LogLevel_Data
Display data about what is processed.
Definition: defs.h:21
userinfo_startscan
userscan userinfo_startscan(void)
Definition: userinfo.c:250
url_module
void url_module(const char *url, char *w2)
Definition: util.c:2231
ReadLogDataStruct::UserFilter
bool UserFilter
True to filter on users.
Definition: defs.h:142
ReadFilter
struct ReadLogDataStruct ReadFilter
The log file filtering.
Definition: log.c:37
totalger
void totalger(FILE *fp_gen, const char *filename)
Definition: report.c:563
ReadLogDataStruct::SysUsers
bool SysUsers
True to restrict the log to the system users.
Definition: defs.h:146
DebugLogLevel
DebugLogLevel
Constants to compare the log level to display messages.
Definition: defs.h:12
sort_users_log
void sort_users_log(const char *tmp, int debug, struct userinfostruct *uinfo)
Definition: sort.c:112
userinfostruct::topuser
int topuser
True if this user is in the topuser list.
Definition: defs.h:93
append_to_path
void append_to_path(char *base_path, int base_path_size, const char *append)
Definition: util.c:2681
getword_start
void getword_start(struct getwordstruct *gwarea, const char *line)
Definition: util.c:74
generalitemstruct::url
char * url
The URL accessed by the user. The length is not limited.
Definition: defs.h:46
write_html_header
void write_html_header(FILE *fp_ou, int depth, const char *title, int javascript)
Definition: util.c:2144
debuga
void debuga(const char *File, int Line, const char *msg,...)
Definition: util.c:601
output_html_url
void output_html_url(FILE *fp_ou, const char *url)
Definition: util.c:2194
topsites
void topsites(void)
Definition: topsites.c:34
fixtime
char * fixtime(long long int elap)
Definition: util.c:1598
getconf
void getconf(const char *File)
Definition: getconf.c:982
denied_cleanup
void denied_cleanup(void)
Definition: denied.c:291
getperiod_fromrange
void getperiod_fromrange(struct periodstruct *period, const struct ReadLogDataStruct *ReadFilter)
Definition: util.c:1088
getperiod_torange
void getperiod_torange(const struct periodstruct *period, int *dfrom, int *duntil)
Definition: util.c:1111
read_hostalias
void read_hostalias(const char *Filename)
Definition: url.c:575
site
char site[20000]
Definition: conf.h:433
getuexclude
void getuexclude(const char *uexfile, int debug)
Definition: exclude.c:310
greport_day
void greport_day(const struct userinfostruct *user)
Definition: grepday.c:666
userinfostruct
What is known about a user.
Definition: defs.h:78
is_download_suffix
bool is_download_suffix(const char *url)
Definition: download.c:414
UserTabFile
char UserTabFile[255]
Definition: conf.h:333
outdir
char outdir[20000]
Definition: conf.h:310
addr
char addr[20000]
Definition: conf.h:439
make_index
void make_index(void)
Definition: index.c:42
UserAgent_Open
FILE * UserAgent_Open(void)
Definition: useragent.c:46
name2ip
void name2ip(char *name, int name_size)
Definition: ip2name.c:256
code
char code[20000]
Definition: conf.h:313
longline_read
char * longline_read(FileObject *fp_in, longline line)
Definition: longline.c:97
format_path
int format_path(const char *file, int line, char *output_buffer, int buffer_size, const char *format,...)
Definition: util.c:2665
download_report
void download_report(void)
Definition: download.c:162
USERERR_Untracked
@ USERERR_Untracked
Definition: defs.h:73
longlinestruct
Definition: longline.c:56
PUFC_Always
@ PUFC_Always
Purge the file if it exists or create an empty file.
Definition: defs.h:159
arqtt
static char arqtt[4096]
The name of the file containing the access time of the site/user.
Definition: report.c:41
LogLevel_Debug
@ LogLevel_Debug
Debug level messages.
Definition: defs.h:17
gen_denied_report
void gen_denied_report(void)
Definition: denied.c:114
IsTreeMonthFileName
bool IsTreeMonthFileName(const char *Name)
Definition: util.c:1368
periodstruct
Definition: conf.h:298
free_exclude
void free_exclude(void)
Definition: exclude.c:387
url_to_anchor
void url_to_anchor(const char *url, char *anchor, int size)
Definition: util.c:2261
UserAgent_Readlog
void UserAgent_Readlog(const struct ReadLogDataStruct *ReadFilter)
Definition: useragent.c:90
userinfostruct::id
const char * id
The ID of the user as found in the input file.
Definition: defs.h:81
PUOE_UserIp
@ PUOE_UserIp
Definition: defs.h:170
generalitemstruct::ip
char * ip
The source IP address of the user. The length is limited to MAX_IP_LEN.
Definition: defs.h:48
USERERR_Excluded
@ USERERR_Excluded
Definition: defs.h:68
my_mkdir
bool my_mkdir(const char *name)
Definition: util.c:419
generalitemstruct::nbytes
long long nbytes
The number of bytes transfered.
Definition: defs.h:44
is_denied
bool is_denied(void)
Definition: denied.c:98
my_lltoa
void my_lltoa(unsigned long long int n, char *s, int ssize, int len)
Definition: util.c:493
greport_cleanup
void greport_cleanup(void)
Definition: grepday.c:782
userinfo_find_from_ip
struct userinfostruct * userinfo_find_from_ip(const char *ip)
Definition: userinfo.c:231
get_param_value
char * get_param_value(const char *param, char *line)
Definition: util.c:2326
ip2name
void ip2name(char *ip, int ip_len)
Definition: ip2name.c:216
getword_skip
int getword_skip(int limit, struct getwordstruct *gwarea, char stop)
Definition: util.c:160
gethexclude
void gethexclude(const char *hexfile, int debug)
Definition: exclude.c:184
builddia
int builddia(int day, int month, int year)
Definition: util.c:534
PerUserLimitStruct::Output
enum PerUserOutputEnum Output
What to write into the file.
Definition: defs.h:183
realtime
void realtime(void)
Definition: realtime.c:173
UserAgent_Write
void UserAgent_Write(FILE *fp, const struct tm *Time, const char *Ip, const char *User, const char *Agent)
Definition: useragent.c:74
globalstatstruct::incache
long long int incache
Amount of data fetched from the cache.
Definition: defs.h:118
close_usertab
void close_usertab(void)
Definition: usertab.c:478
userscanstruct
Hold pointer to scan through the user list.
Definition: userinfo.c:51
DayStruct
The daily statistics for one user.
Definition: totday.c:31
numlistcontains
bool numlistcontains(const int *list, int maxvalue, int value)
Definition: util.c:2091
fixnum2
char * fixnum2(long long int value, int n)
Definition: util.c:767
is_indexonly
bool is_indexonly(void)
Definition: exclude.c:381
PortableMkDir
int PortableMkDir(const char *path, int mode)
Definition: util.c:403
generalitemstruct::date
char * date
The date of the access. The length is limited to MAX_DATETIME_LEN.
Definition: defs.h:52
compar
int compar(const void *, const void *)
Definition: util.c:1951
generalitemstruct::oucache
long long oucache
The number of bytes fetched from the site (cache miss).
Definition: defs.h:58
name
char name[20000]
Definition: conf.h:335
authfail_write
void authfail_write(const struct ReadLogStruct *log_entry)
Definition: authfail.c:67
userinfostruct::id_is_ip
bool id_is_ip
True if the ID is in fact the IP address from which the user connected.
Definition: defs.h:85
day_addpoint
void day_addpoint(DayObject ddata, const char *date, const char *time, long long int elap, long long int bytes)
Definition: totday.c:95
mklastlog
void mklastlog(const char *outdir)
Definition: lastlog.c:256
getword_atol
int getword_atol(long int *number, struct getwordstruct *gwarea, char stop)
Definition: util.c:265
buildtime
char * buildtime(long long int elap)
Definition: util.c:807
getword_restart
void getword_restart(struct getwordstruct *gwarea)
Definition: util.c:81
__attribute__
#define __attribute__(x)
Definition: conf.h:173
download_close
void download_close(void)
Definition: download.c:100
fileobject.h
is_download
bool is_download(void)
Definition: download.c:118
generalitemstruct::incache
long long incache
The number of bytes fetched from the cache of the proxy (cache hit).
Definition: defs.h:56
getwordstruct::modified
int modified
Definition: defs.h:30
userinfo_find_from_id
struct userinfostruct * userinfo_find_from_id(const char *id)
Definition: userinfo.c:218
show_sarg
void show_sarg(FILE *fp_ou, int depth)
Definition: util.c:2108
unlinkdir
void unlinkdir(const char *dir, bool contentonly)
Definition: util.c:2339
free_hostalias
void free_hostalias(void)
Definition: url.c:633
sort_labels
void sort_labels(const char **label, const char **order)
Definition: sort.c:160
is_absolute
int is_absolute(const char *path)
Definition: util.c:394
longline
struct longlinestruct * longline
Definition: defs.h:33
init_usertab
void init_usertab(const char *UserTabFile)
Definition: usertab.c:426
makeTmpDir
void makeTmpDir(const char *tmp)
Definition: util.c:475
DateFormat
char DateFormat
Definition: conf.h:364
PUOE_UserId
@ PUOE_UserId
Definition: defs.h:169
show_info
void show_info(FILE *fp_ou)
Definition: util.c:2097
decomp
FileObject * decomp(const char *arq)
Definition: decomp.c:481
skip_scheme
const char * skip_scheme(const char *url)
Definition: url.c:839
userinfostruct::label
const char * label
The name of the user to display in the report.
Definition: defs.h:89
getword_atolu
int getword_atolu(unsigned long int *number, struct getwordstruct *gwarea, char stop)
Definition: util.c:303
globalstatstruct::oucache
long long int oucache
Amount of data not fetched from the cache.
Definition: defs.h:120
getword_limit
int getword_limit(char *word, int limit, struct getwordstruct *gwarea, char stop)
Definition: util.c:119
ReadLogDataStruct::EndDate
int EndDate
Last date to include in the report. The format is year*10000+month+100+day.
Definition: defs.h:138
topuser
void topuser(void)
Definition: topuser.c:559
LogLevel_Source
@ LogLevel_Source
Display the source file name and line number along with the message.
Definition: defs.h:19
date_from
void date_from(struct ReadLogDataStruct *ReadFilter)
Definition: util.c:1619
GetLogPeriod
bool GetLogPeriod(struct tm *Start, struct tm *End)
Definition: readlog.c:915
day_deletefile
void day_deletefile(const struct userinfostruct *uinfo)
Definition: totday.c:194
getperiod_buildtext
int getperiod_buildtext(struct periodstruct *period)
Definition: util.c:1136
close_html_header
void close_html_header(FILE *fp_ou)
Definition: util.c:2152
getword_ptr
int getword_ptr(char *orig_line, char **word, struct getwordstruct *gwarea, char stop)
Definition: util.c:343
computedate
void computedate(int year, int month, int day, struct tm *t)
Definition: util.c:892
redirector_log
void redirector_log(const struct ReadLogDataStruct *ReadFilter)
Definition: redirector.c:302
generalitemstruct::time
char * time
The time of the access. The length is limited to MAX_DATETIME_LEN.
Definition: defs.h:50
css_content
void css_content(FILE *fp_css)
Definition: css.c:30
vercode
int vercode(const char *code)
Definition: util.c:1882
Email_OutputFile
FILE * Email_OutputFile(const char *Module)
Definition: email.c:44
authfail_report
void authfail_report(void)
Definition: authfail.c:113
strip_latin
void strip_latin(char *line)
Definition: util.c:1560
redirector_report
void redirector_report(void)
Definition: redirector.c:441
ReadLogStruct
Data read from an input log file.
Definition: readlog.h:24
ReadLogDataStruct::HostFilter
bool HostFilter
True to filter on hosts.
Definition: defs.h:140
vrfydir
int vrfydir(const struct periodstruct *per1, const char *addr, const char *site, const char *us)
Definition: util.c:1427
compare_date
int compare_date(const struct tm *date1, const struct tm *date2)
Definition: util.c:549
free_download
void free_download(void)
Definition: download.c:324
ip2name_forcedns
void ip2name_forcedns(void)
Definition: ip2name.c:173
ReadLogDataStruct::StartTime
int StartTime
The start time to include in the report(H*100+M). Set to -1 to disable.
Definition: defs.h:148
htmlrel
void htmlrel(void)
Definition: html.c:39
authfail_cleanup
void authfail_cleanup(void)
Definition: authfail.c:299
UserProcessError
UserProcessError
Error codes returned by process_user.
Definition: defs.h:64
ger_read
int ger_read(char *buffer, struct generalitemstruct *item, const char *filename)
Definition: report.c:575
download_open
void download_open(void)
Definition: download.c:61
conv_month
int conv_month(const char *month)
Definition: util.c:575
main
int main(int argc, char *argv[])
Definition: log.c:54
globalstatstruct::nacc
long long int nacc
Total number of accesses.
Definition: defs.h:112
usage
void usage(const char *prog)
Definition: usage.c:30
fixnum
char * fixnum(long long int value, int n)
Definition: util.c:670
process_url
const char * process_url(const char *url, bool full_url)
Definition: url.c:862
denied_open
void denied_open(void)
Definition: denied.c:43
getword
int getword(char *word, int limit, struct getwordstruct *gwarea, char stop)
Definition: util.c:90
load_excludecodes
void load_excludecodes(const char *ExcludeCodes)
Definition: util.c:1816
day_totalize
void day_totalize(DayObject ddata, const char *tmp, const struct userinfostruct *uinfo)
Definition: totday.c:140
obttotal
void obttotal(const char *dirname, const char *name, int nuser, long long int *tbytes, long long int *media)
Definition: util.c:938
generalitemstruct
Definition: defs.h:35
free_useralias
void free_useralias(void)
Definition: userinfo.c:364
USERERR_EmptyUser
@ USERERR_EmptyUser
Definition: defs.h:70
userinfo_stopscan
void userinfo_stopscan(userscan uscan)
Definition: userinfo.c:266
userinfostruct::no_report
bool no_report
True if the user doesn't have a report file.
Definition: defs.h:87
getwordstruct::beginning
const char * beginning
Definition: defs.h:29
df
char df
Definition: conf.h:319
userinfo_free
void userinfo_free(void)
Definition: userinfo.c:177
ReadLogFile
int ReadLogFile(struct ReadLogDataStruct *Filter)
Definition: readlog.c:786
dansguardian_log
void dansguardian_log(const struct ReadLogDataStruct *ReadFilter)
Definition: dansguardian_log.c:30
htaccess
void htaccess(const struct userinfostruct *uinfo)
Definition: auth.c:30
USERERR_NameTooLong
@ USERERR_NameTooLong
Definition: defs.h:67
vuexclude
int vuexclude(const char *user)
Definition: exclude.c:364
formatdate
void formatdate(char *date, int date_size, int year, int month, int day, int hour, int minute, int second, int dst)
Definition: util.c:871
ip2name_config
int ip2name_config(const char *param)
Definition: ip2name.c:153
is_authfail
bool is_authfail(void)
Definition: authfail.c:99
download_write
void download_write(const struct ReadLogStruct *log_entry, const char *url)
Definition: download.c:86
removetmp
void removetmp(const char *outdir)
Definition: util.c:1789
obtdate
int obtdate(const char *dirname, const char *name, char *data)
Definition: util.c:835
conv_month_name
const char * conv_month_name(int month)
Definition: util.c:584
userinfo_advancescan
struct userinfostruct * userinfo_advancescan(userscan uscan)
Definition: userinfo.c:280
userinfo_create
struct userinfostruct * userinfo_create(const char *userid, const char *ip)
Definition: userinfo.c:73
strup
char * strup(char *string)
Definition: util.c:1775
ReadLogDataStruct
Log filtering criterion.
Definition: defs.h:131
longline_create
longline longline_create(void)
Definition: longline.c:70
zdate
void zdate(char *ftime, int ftimesize, char DateFormat)
Definition: util.c:1581
fixnone
void fixnone(char *str)
Definition: util.c:1900
UserAgent
void UserAgent(void)
Definition: useragent.c:207
ip2name_cleanup
void ip2name_cleanup(void)
Definition: ip2name.c:251
Email_Send
void Email_Send(FILE *fp, const char *Subject)
Definition: email.c:66
userinfostruct::filename
const char * filename
The mangled name to use in file names of that user.
Definition: defs.h:91
generalitemstruct::nelap
long long nelap
The number of milliseconds spend processing the request.
Definition: defs.h:54
data_file
void data_file(char *tmp)
Definition: datafile.c:32
DayObject
struct DayStruct * DayObject
The object to store the daily statistics.
Definition: defs.h:126
read_useralias
void read_useralias(const char *Filename)
Definition: userinfo.c:317
ExcludeCodes
char ExcludeCodes[256]
Definition: conf.h:330
PerUserFileCreationEnum
PerUserFileCreationEnum
How to handle the per_user_limit file creation.
Definition: defs.h:156
PUFC_AsRequired
@ PUFC_AsRequired
Delete old files and don't create a new file unless necessary.
Definition: defs.h:161
month2num
int month2num(const char *month)
Definition: util.c:526
smartfilter_report
void smartfilter_report(void)
Definition: smartfilter.c:30
denied_close
void denied_close(void)
Definition: denied.c:81
testvaliduserchar
int testvaliduserchar(const char *user)
Definition: util.c:1933
report_day
void report_day(const struct userinfostruct *user)
Definition: repday.c:32
generalitemstruct::user
char * user
The user to which the entry apply. The length is limited to MAX_USER_LEN.
Definition: defs.h:40
getword_multisep
int getword_multisep(char *word, int limit, struct getwordstruct *gwarea, char stop)
Definition: util.c:134
getwordstruct
Definition: defs.h:26
css
void css(FILE *fp_css)
Definition: css.c:82
IsTreeDayFileName
bool IsTreeDayFileName(const char *Name)
Definition: util.c:1392
extract_address_mask
int extract_address_mask(const char *buf, const char **text, unsigned char *ipv4, unsigned short int *ipv6, int *nbits, const char **next)
Definition: util.c:2534
day_newuser
void day_newuser(DayObject ddata)
Definition: totday.c:75
gerarel
void gerarel(const struct ReadLogDataStruct *ReadFilter)
Definition: report.c:50
longline_reset
void longline_reset(longline line)
Definition: longline.c:88
longline_destroy
void longline_destroy(longline *line_ptr)
Definition: longline.c:168
fnmatch
int fnmatch(const char *pattern, const char *string, int flags)
Definition: fnmatch.c:39
getwordstruct::current
const char * current
Definition: defs.h:28
day_prepare
DayObject day_prepare(void)
Definition: totday.c:46
getperiod_merge
void getperiod_merge(struct periodstruct *main, struct periodstruct *candidate)
Definition: util.c:1122
version
void version(void)
Definition: util.c:2300
download_cleanup
void download_cleanup(void)
Definition: download.c:453
userinfostruct::flag
int flag
A general purpose flag that can be set when scanning the user's list.
Definition: defs.h:95
USERERR_Ignored
@ USERERR_Ignored
Definition: defs.h:72
userinfostruct::ip
const char * ip
The user's IP address.
Definition: defs.h:83
us
char us[50]
Definition: conf.h:434
debugaz
void debugaz(const char *File, int Line, const char *msg,...)
Definition: util.c:646
safe_strcpy
void safe_strcpy(char *dest, const char *src, int length)
Definition: util.c:1550
vhexclude
int vhexclude(const char *url)
Definition: exclude.c:242
USERERR_InvalidChar
@ USERERR_InvalidChar
Definition: defs.h:69
ReadLogDataStruct::EndTime
int EndTime
The end time to include in the report(H*100+M). Set to -1 to disable.
Definition: defs.h:150
write_html_trailer
void write_html_trailer(FILE *fp_ou)
Definition: util.c:2157
generalitemstruct::nacc
long long nacc
The number of accesses performed by the user.
Definition: defs.h:42
tmp
char tmp[20000]
Definition: conf.h:315
globalstatstruct::nbytes
long long int nbytes
Total number of bytes.
Definition: defs.h:114
getnumlist
void getnumlist(const char *paramname, const char *buffer, int *list, int maxvalue)
Definition: util.c:1998
url_hostname
void url_hostname(const char *url, char *hostname, int hostsize)
Definition: url.c:909
globalstatstruct::totuser
int totuser
The number of users in the topuser list.
Definition: defs.h:122
IsTreeFileDirName
bool IsTreeFileDirName(const char *Name)
Definition: util.c:1257
splitlog
void splitlog(const char *arq, char df, const struct ReadLogDataStruct *ReadFilter, int convert, const char *splitprefix)
Definition: splitlog.c:46
index_only
void index_only(const char *dirname, int debug)
Definition: indexonly.c:31
free_excludecodes
void free_excludecodes(void)
Definition: util.c:1874
convlog
void convlog(const char *arq, char df, const struct ReadLogDataStruct *ReadFilter)
Definition: convlog.c:30
generalitemstruct::total
int total
True if the entry is for the total of the file or false if it is a single line.
Definition: defs.h:38
PerUserOutputEnum
PerUserOutputEnum
What to write into the per_user_limit file.
Definition: defs.h:167
process_user
enum UserProcessError process_user(const char **UserPtr, const char *IpAddress, bool *IsIp)
Definition: userinfo.c:377
strlow
char * strlow(char *string)
Definition: util.c:1759
denied_write
void denied_write(const struct ReadLogStruct *log_entry)
Definition: denied.c:67
userinfo_find_from_file
struct userinfostruct * userinfo_find_from_file(const char *filename)
Definition: userinfo.c:205
IsTreeYearFileName
bool IsTreeYearFileName(const char *Name)
Definition: util.c:1350
userscan
struct userscanstruct * userscan
Scan through the known users.
Definition: defs.h:105
user_find
void user_find(char *mappedname, int namelen, const char *userlogin)
Definition: usertab.c:460
day_cleanup
void day_cleanup(DayObject ddata)
Definition: totday.c:65
output_html_string
void output_html_string(FILE *fp_ou, const char *str, int maxlen)
Definition: util.c:2163
PerUserLimitStruct
How to log every user crossing the download limit.
Definition: defs.h:176
ReadLogDataStruct::DateRange
char DateRange[255]
The filtering date range.
Definition: defs.h:134
period
struct periodstruct period
Definition: conf.h:312
getperiod_fromsarglog
int getperiod_fromsarglog(const char *arqtt, struct periodstruct *period)
Definition: util.c:1009
userinfo_clearflag
void userinfo_clearflag(void)
Definition: userinfo.c:301
dansguardian_report
void dansguardian_report(void)
Definition: dansguardian_report.c:38
getword_atoll
int getword_atoll(long long int *number, struct getwordstruct *gwarea, char stop)
Definition: util.c:182
userinfo_label
void userinfo_label(struct userinfostruct *uinfo, const char *label)
Definition: userinfo.c:194
USERERR_NoError
@ USERERR_NoError
Definition: defs.h:66
write_html_head
void write_html_head(FILE *fp_ou, int depth, const char *page_title, int javascript)
Definition: util.c:2125
ReadLogDataStruct::StartDate
int StartDate
First date to include in the report. The format is year*10000+month+100+day.
Definition: defs.h:136
PerUserLimitStruct::Limit
int Limit
Limit above which the user is reported.
Definition: defs.h:181
obtuser
int obtuser(const char *dirname, const char *name)
Definition: util.c:901
fixendofline
void fixendofline(char *str)
Definition: util.c:1911
debuga_more
void debuga_more(const char *msg,...)
Definition: util.c:631
authfail_open
void authfail_open(void)
Definition: authfail.c:43
debug
int debug
Definition: conf.h:489
FileObjectStruct
Definition: fileobject.h:4
USERERR_SysUser
@ USERERR_SysUser
Definition: defs.h:71
emptytmpdir
void emptytmpdir(const char *dir)
Definition: util.c:2401
my_atoll
long long int my_atoll(const char *nptr)
Definition: util.c:372
write_logo_image
void write_logo_image(FILE *fp_ou)
Definition: util.c:2119
getword_atoi
int getword_atoi(int *number, struct getwordstruct *gwarea, char stop)
Definition: util.c:227
buildymd
void buildymd(const char *dia, const char *mes, const char *ano, char *wdata, int wdata_size)
Definition: util.c:566
globalstatstruct::elap
long long int elap
Total time spent processing the requests.
Definition: defs.h:116
output_html_link
void output_html_link(FILE *fp_ou, const char *url, int maxlen)
Definition: util.c:2214
greport_prepare
void greport_prepare(void)
Definition: grepday.c:635
set_download_suffix
void set_download_suffix(const char *list)
Definition: download.c:345
ReadLogDataStruct::max_elapsed
long int max_elapsed
Maximum elpased time allowed. Any time greater than this value is set to zero.
Definition: defs.h:144
PerUserLimitStruct::File
char File[255]
File to save the user's IP or ID to.
Definition: defs.h:179
tmpsort
void tmpsort(const struct userinfostruct *uinfo)
Definition: sort.c:36
LogLevel_Process
@ LogLevel_Process
Process informational messages.
Definition: defs.h:15
globalstatstruct
Global statistics.
Definition: defs.h:109