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)  

useragent.c File Reference
#include "include/conf.h"
#include "include/defs.h"
#include "include/filelist.h"
Include dependency graph for useragent.c:

Go to the source code of this file.

Functions

FILE * UserAgent_Open (void)
 
void UserAgent_Write (FILE *fp, const struct tm *Time, const char *Ip, const char *User, const char *Agent)
 
void UserAgent_Readlog (const struct ReadLogDataStruct *ReadFilter)
 
void UserAgent (void)
 

Variables

FileListObject UserAgentLog =NULL
 
static char UserAgentTempLog [20000] =""
 Log file where the user agent data are written. More...
 
static struct tm UserAgentStartDate
 
static struct tm UserAgentEndDate
 

Function Documentation

◆ UserAgent()

void UserAgent ( void  )

Definition at line 207 of file useragent.c.

References _, close_html_header(), getwordstruct::current, debug, debuga(), fixendofline(), format_path(), getword(), getword_start(), HTML_JS_NONE, idate, INDEX_TREE_DATE, IndexTree, ip2name(), Ip2Name, KeepTempLog, MAXLEN, outdirname, output_html_string(), tmp, useragent_count, UserAgentEndDate, UserAgentStartDate, UserAgentTempLog, write_html_header(), and write_html_trailer().

Referenced by ExtLog_ReadEntry(), and gerarel().

Here is the caller graph for this function:

◆ UserAgent_Open()

FILE* UserAgent_Open ( void  )

Open the temporary file to store the useragent entries to be reported.

Returns
The file handle. It must be closed when the data have been written.

Definition at line 46 of file useragent.c.

References _, debuga(), format_path(), REPORT_TYPE_USERAGENT, ReportType, tmp, UserAgentEndDate, UserAgentStartDate, and UserAgentTempLog.

Referenced by ReadOneLogFile(), and UserAgent_Readlog().

Here is the caller graph for this function:

◆ UserAgent_Readlog()

void UserAgent_Readlog ( const struct ReadLogDataStruct ReadFilter)

Read the user provided useragent file and create a temporary file with the data to report.

Definition at line 90 of file useragent.c.

References _, getwordstruct::current, debug, debuga(), decomp(), ReadLogDataStruct::EndTime, FileListIter_Close(), FileListIter_Next(), FileListIter_Open(), FileObject_Close(), FileObject_GetLastCloseError(), FileObject_GetLastOpenError(), fp_log, getperiod_torange(), getword(), getword_atoi(), getword_skip(), getword_start(), longline_create(), longline_destroy(), longline_read(), longline_reset(), MAXLEN, month2num(), period, ReadFilter, ReadLogDataStruct::StartTime, totregsl, UserAgent_Open(), UserAgent_Write(), UserAgentLog, and UserAgentTempLog.

Referenced by gerarel().

Here is the caller graph for this function:

◆ UserAgent_Write()

void UserAgent_Write ( FILE *  fp,
const struct tm *  Time,
const char *  Ip,
const char *  User,
const char *  Agent 
)

Write a user agent entry into the temporary log.

Parameters
fpThe file opened by UserAgent_Open().
IpThe IP address using this agent.
UserThe user name.
AgentThe user agent string.

Definition at line 74 of file useragent.c.

References compare_date(), useragent_count, UserAgentEndDate, and UserAgentStartDate.

Referenced by ReadOneLogFile(), and UserAgent_Readlog().

Here is the caller graph for this function:

Variable Documentation

◆ UserAgentEndDate

struct tm UserAgentEndDate
static

Definition at line 37 of file useragent.c.

Referenced by UserAgent(), UserAgent_Open(), and UserAgent_Write().

◆ UserAgentLog

FileListObject UserAgentLog =NULL

Definition at line 31 of file useragent.c.

Referenced by gerarel(), main(), parmtest(), and UserAgent_Readlog().

◆ UserAgentStartDate

struct tm UserAgentStartDate
static

Definition at line 36 of file useragent.c.

Referenced by UserAgent(), UserAgent_Open(), and UserAgent_Write().

◆ UserAgentTempLog

char UserAgentTempLog[20000] =""
static

Log file where the user agent data are written.

Definition at line 34 of file useragent.c.

Referenced by UserAgent(), UserAgent_Open(), and UserAgent_Readlog().