00001 #include <stdio.h>
00002
00003 #include "proxytrace.h"
00004
00005
00006
00007 const char *make_query(u_4bytes query) {
00008 static char buf[128];
00009
00010 sprintf(buf, "?%d", query);
00011
00012 return buf;
00013 }
00014
00015
00016 const char *make_port(u_4bytes port) {
00017 static char buf[128];
00018
00019 sprintf(buf, ":%d", port);
00020
00021 return buf;
00022 }
00023
00024 void PrintEntry_Squid(FILE *out_file, TEntry *entry, int swap) {
00025
00026 u_4bytes duration = ((entry -> head.event_duration+500)/1000);
00027
00028 fprintf(stdout, "%9d.%06u %d %d %s/%d %d %s %s://%d%s/%s%d%s%s %s %s/%d\n",
00029 entry -> head.time_sec, entry -> head.time_usec,
00030 (( swap) ? entry -> head.client : duration),
00031 ((!swap) ? entry -> head.client : duration),
00032 "NONE",
00033 entry -> tail.status,
00034 entry -> head.size,
00035 MethodStr(entry -> tail.method),
00036 ProtocolStr(entry -> tail.protocol),
00037 entry -> head.server,
00038 ((entry -> tail.flags & PORT_SPECIFIED_FLAG) ? make_port(entry -> head.port) : ""),
00039 ((entry -> tail.flags & CGI_BIN_FLAG) ? "cgi_bin/" : ""),
00040 entry -> head.path,
00041 ((entry -> tail.flags & EXTENSION_SPECIFIED_FLAG) ? ExtensionStr(entry -> tail.type) : ""),
00042 ((entry -> tail.flags & QUERY_FOUND_FLAG) ? make_query(entry -> head.query) : ""),
00043 "-",
00044 "DIRECT",
00045 entry -> head.server);
00046 }