Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Compound Members | File Members

proxytrace.h File Reference

#include <stdio.h>
#include <sys/types.h>

Include dependency graph for proxytrace.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Compounds

struct  ReqLog
struct  TEntry
struct  TEntryHeader
struct  TEntryTail
struct  URL

Defines

#define NO_PATH_FLAG   1
#define PORT_SPECIFIED_FLAG   2
#define NULL_PATH_ADDED_FLAG   4
#define QUERY_FOUND_FLAG   8
#define EXTENSION_SPECIFIED_FLAG   16
#define CGI_BIN_FLAG   32
#define TRACE_HEADER_SIZE   8192

Typedefs

typedef unsigned int u_4bytes
typedef unsigned short int u_2bytes
typedef int method_t
typedef int protocol_t
typedef int pagetype_t

Functions

const char * MethodStr (int method)
const char * ProtocolStr (int protocol)
const char * ExtensionStr (int type)
const char * ExtensionTypeStr (int type)
size_t ReadHeader (FILE *in_file, void *userBuf)
size_t ReadEntry (FILE *in_file, TEntry *entry)
size_t ReadEntryV1 (FILE *in_file, TEntry *entry)

Variables

const int METHOD_NONE
const int PROTO_NONE
const int EXT_NONE


Define Documentation

#define CGI_BIN_FLAG   32
 

Definition at line 51 of file proxytrace.h.

Referenced by lf_analyze(), and PrintEntry_Squid().

#define EXTENSION_SPECIFIED_FLAG   16
 

Definition at line 50 of file proxytrace.h.

Referenced by PrintEntry_Squid().

#define NO_PATH_FLAG   1
 

Definition at line 46 of file proxytrace.h.

#define NULL_PATH_ADDED_FLAG   4
 

Definition at line 48 of file proxytrace.h.

#define PORT_SPECIFIED_FLAG   2
 

Definition at line 47 of file proxytrace.h.

Referenced by PrintEntry_Squid().

#define QUERY_FOUND_FLAG   8
 

Definition at line 49 of file proxytrace.h.

Referenced by lf_analyze(), and PrintEntry_Squid().

#define TRACE_HEADER_SIZE   8192
 

Definition at line 82 of file proxytrace.h.

Referenced by ReadHeader().


Typedef Documentation

typedef int method_t
 

Definition at line 10 of file proxytrace.h.

Referenced by ToOtherEndian().

typedef int pagetype_t
 

Definition at line 27 of file proxytrace.h.

typedef int protocol_t
 

Definition at line 18 of file proxytrace.h.

Referenced by ToOtherEndian().

typedef unsigned short int u_2bytes
 

Definition at line 8 of file proxytrace.h.

Referenced by rotate4(), and swap2().

typedef unsigned int u_4bytes
 

Definition at line 7 of file proxytrace.h.

Referenced by PrintEntry_Squid(), rotate4(), and ToOtherEndian().


Function Documentation

const char* ExtensionStr int  type  ) 
 

Definition at line 71 of file proxytrace.cc.

References ExtensionStrings, and MAX_EXTENSIONS.

Referenced by ExtensionTypeStr(), and PrintEntry_Squid().

00071                                    {
00072 
00073         if (type < 0 || type > MAX_EXTENSIONS)
00074                 type = MAX_EXTENSIONS;
00075 
00076         return ExtensionStrings[type];
00077 }

const char* ExtensionTypeStr int  type  ) 
 

Definition at line 79 of file proxytrace.cc.

References ExtensionStr().

Referenced by PrintEntry_Text().

00079                                        {
00080 
00081         return (type == 0) ? "NONE" : (ExtensionStr(type)+1);
00082 }

Here is the call graph for this function:

const char* MethodStr int  method  ) 
 

Definition at line 55 of file proxytrace.cc.

References MAX_METHODS, and MethodStrings.

Referenced by PrintEntry_Squid(), and PrintEntry_Text().

00055                                   {
00056 
00057         if (method < 0 || method > MAX_METHODS)
00058                 method = MAX_METHODS;
00059 
00060         return MethodStrings[method];
00061 }

const char* ProtocolStr int  protocol  ) 
 

Definition at line 63 of file proxytrace.cc.

References MAX_PROTOCOLS, and ProtocolStrings.

00063                                       {
00064 
00065         if (protocol < 0 || protocol > MAX_PROTOCOLS)
00066                 protocol = MAX_PROTOCOLS;
00067 
00068         return ProtocolStrings[protocol];
00069 }

size_t ReadEntry FILE *  in_file,
TEntry entry
 

Definition at line 99 of file proxytrace.cc.

References in_file, and TEntry.

Referenced by main().

00099                                                {
00100 
00101         size_t items_read = fread(entry, sizeof(TEntry), 1, in_file);
00102 
00103         if (items_read < 0 || items_read > 1) {
00104                 fprintf(stderr, "%s:%d error reading trace entry (%u bytes)\n",
00105                         __FILE__, __LINE__, (unsigned)sizeof(TEntry));
00106                 exit(-2);
00107         }
00108 
00109         return items_read*sizeof(TEntry);
00110 }

size_t ReadEntryV1 FILE *  in_file,
TEntry entry
 

Definition at line 112 of file proxytrace.cc.

References in_file, and url.

00112                                                  {
00113 
00114         size_t items_read = fread(&entry -> head, sizeof(TEntryHeader), 1, in_file);
00115 
00116         if (items_read == 1)
00117                 items_read = fread(&entry -> tail, sizeof(TEntryTail), 1, in_file);
00118 
00119         if (items_read < 0 || items_read > 1) {
00120                 fprintf(stderr, "%s:%d error reading v1 trace entry (%u bytes)\n",
00121                         __FILE__, __LINE__, (unsigned)(sizeof(TEntryHeader)+sizeof(TEntryTail)));
00122                 exit(-2);
00123         }
00124 
00125         entry -> url = 0; /* initialize unused field */
00126 
00127         return items_read*(sizeof(TEntryHeader)+sizeof(TEntryTail));
00128 }

size_t ReadHeader FILE *  in_file,
void *  userBuf
 

Definition at line 85 of file proxytrace.cc.

References in_file, and TRACE_HEADER_SIZE.

Referenced by main().

00085                                                 {
00086         static char defaultBuf[TRACE_HEADER_SIZE];
00087 
00088         void *buf = (userBuf) ? userBuf : defaultBuf;
00089 
00090         if (fread(buf, TRACE_HEADER_SIZE, 1, in_file) != 1) {
00091                 fprintf(stderr, "%s:%d error reading file header (%d bytes)\n",
00092                         __FILE__, __LINE__, TRACE_HEADER_SIZE);
00093                 exit(-2);
00094         }
00095 
00096         return TRACE_HEADER_SIZE;
00097 }


Variable Documentation

const int EXT_NONE
 

Initial value:

 0
        EXT_HTML = 1
        EXT_GIF = 2
        EXT_CGI = 3
        EXT_DATA = 4
        EXT_CLASS = 5
        EXT_MAP = 6
        EXT_JPEG = 7
        EXT_MPEG = 8 
        EXT_OTHER = 9

Definition at line 28 of file proxytrace.h.

const int METHOD_NONE
 

Initial value:

Definition at line 12 of file proxytrace.h.

const int PROTO_NONE
 

Initial value:

Definition at line 19 of file proxytrace.h.


Generated on Tue Apr 20 12:26:34 2004 for NS2.26SourcesOriginal by doxygen 1.3.3