{
middle=(down+up)/2;
cmp=strcasecmp(key,Obj->Items[middle].Key);
- if (!cmp)
+ if (!cmp)
{
*Found=true;
return(middle);
/*!
Store a IPv4 address to exclude from the reported URL.
-
+
\param addr The 4 char of the address.
\param nbits The number of bits to keep in the prefix.
*/
/*!
Store a IPv6 address to exclude from the reported URL.
-
+
\param addr The 8 short int of the address.
\param nbits The number of bits to keep in the prefix.
*/
/*!
Store a host name to exclude from the report.
-
+
\param url The host name to exclude.
*/
static void store_exclude_url(const char *url,const char *next)
/*!
Read the file listing the host to exclude from the report.
-
+
\param hexfile The name of the file.
\param debug \c True to print debug information.
*/
/*!
Check if the URL is excluded as per the host exclusion list.
-
+
\param url The URL to check.
-
+
\retval 1 Keep the URL.
\retval 0 Exclude the URL.
*/
RLRC_Unknown,
//! Error encountered during the parsing of the file.
RLRC_InternalError,
-
+
RLRC_LastRetCode //!< last entry of the list.
};
char *User;
/*!
The URL of the visited site.
-
+
The pointer may be NULL if the URL doesn't exists in the log file.
*/
char *Url;
Entry->User=++Line;
for (UserLen=0 ; *Line && *Line!=' ' ; UserLen++) Line++;
if (*Line!=' ' || UserLen==0) return(RLRC_Unknown);
-
+
if (squid24) {
// squid version > 2.4 store the user ID in the first column: skip the second column here
Begin=++Line;
Year=0;
while (isdigit(*Line)) Year=Year*10+(*Line++-'0');
if (*Line!=':' || Year<1900 || Year>2200) return(RLRC_Unknown);
-
+
// get the time
++Line;
Hour=0;
// skip the timezone up to the closing ]
while (*Line && *Line!=']') Line++;
if (*Line!=']') return(RLRC_Unknown);
-
+
Entry->EntryTime.tm_year=Year-1900;
Entry->EntryTime.tm_mon=Month;
Entry->EntryTime.tm_mday=Day;
if (*Line!=' ') return(RLRC_Unknown);
++Line;
if (*Line!='\"') return(RLRC_Unknown);
-
+
// skip the HTTP function
Begin=++Line;
while (isalpha(*Line)) Line++;
if (*Line!=' ' || Line==Begin) return(RLRC_Unknown);
-
+
// get the URL
Entry->Url=++Line;
for (UrlLen=0 ; *Line && *Line!=' ' ; UrlLen++) Line++;
if (*Line!=' ' || UrlLen==0) return(RLRC_Unknown);
-
+
// skip the HTTP/...
++Line;
while (*Line && *Line!='\"') Line++;
Entry->HttpCode=++Line;
for (HttpCodeLen=0 ; *Line && *Line!=' ' ; HttpCodeLen++) Line++;
if (*Line!=' ' || HttpCodeLen==0) return(RLRC_Unknown);
-
+
// get the number of transfered bytes.
Begin=++Line;
Entry->DataSize=0LL;
Entry->HttpCode[HttpCodeLen]='\0';
Entry->Url[UrlLen]='\0';
Entry->User[UserLen]='\0';
-
+
return(RLRC_NoError);
}
/*!
Copy a string without overflowing the buffer. The copied string
is properly terminated by an ASCII zero.
-
+
\param dest The destination buffer.
\param src The source buffer.
\param length The size of the destination buffer. The program is aborted
Write a host name inside an A tag of a HTML file. If the host name starts
with a star, it is assumed to be an alias that cannot be put inside a link
so the A tag is not written around the host name.
-
+
\param fp_ou The handle of the HTML file.
\param url The host to display in the HTML file.
\param maxlen The maximum number of characters to print into the host name.