Also updates the enum strings generator to work with any given header file.
The header does however need to be named identical to the enum and not pull
in any other definitions that require .cc content. The generated .cc will
only contain the minimal includes and enum string array global.
ac_configure_args="$new_configure_args"
-use_loadable_modules=1
+use_loadable_modules=0
AC_MSG_CHECKING(whether to use loadable modules)
AC_ARG_ENABLE(loadable-modules,
AS_HELP_STRING([--disable-loadable-modules],[do not support loadable modules]) ,
AC_MSG_RESULT([$use_loadable_modules, implicitly])
]
)
+use_loadable_modules=0
AM_CONDITIONAL(USE_LOADABLE_MODULES, test $use_loadable_modules = yes)
#define SQUID_HTTPHIERARCHYLOGENTRY_H
#include "hier_code.h"
+#include "lookup_t.h"
#include "rfc2181.h"
#include "PingData.h"
-/* for lookup_t and http_status */
+/* for http_status */
#include "enums.h"
class HierarchyLogEntry
$(SHELL) $(srcdir)/DiskIO/modules.sh $(DISK_MODULES) > DiskIO/DiskIOModules_gen.cc
-EXTRA_squid_SOURCES = \
- $(AIO_WIN32_ALL_SOURCES) \
- $(all_AUTHMODULES) \
- ConfigOption.h \
- $(DELAY_POOL_ALL_SOURCE) \
- dns.cc \
- dnsserver.cc \
- dns_internal.cc \
- DnsLookupDetails.cc \
- DnsLookupDetails.h \
- htcp.cc \
- htcp.h \
- ipc.cc \
- ipc_win32.cc \
- ProfStats.cc \
- LeakFinder.cc \
- LeakFinder.h \
- $(SNMP_ALL_SOURCE) \
- $(UNLINKDSOURCE) \
- $(SSL_ALL_SOURCE) \
- $(WIN32_ALL_SOURCE) \
- $(LOADABLE_MODULES_SOURCES) \
- DiskIO/DiskThreads/aiops.cc \
- DiskIO/DiskThreads/aiops_win32.cc
-
squid_COMMSOURCES = \
comm_select.cc \
comm_select.h \
dlink.cc \
$(DNSSOURCE) \
enums.h \
+ err_type.h \
errorpage.cc \
errorpage.h \
ETag.cc \
helper.cc \
helper.h \
hier_code.h \
- hier_code.cc \
HierarchyLogEntry.h \
$(HTCPSOURCE) \
http.cc \
HttpRequestMethod.h \
HttpVersion.h \
ICP.h \
+ icp_opcode.h \
icp_v2.cc \
icp_v3.cc \
int.cc \
$(LEAKFINDERSOURCE) \
list.cc \
logfile.cc \
+ lookup_t.h \
main.cc \
mem.cc \
mem_node.cc \
Server.cc \
Server.h \
structs.h \
+ swap_log_op.h \
SwapDir.cc \
SwapDir.h \
time.cc \
$(WIN32_SOURCE) \
$(WINSVC_SOURCE)
+EXTRA_squid_SOURCES = \
+ $(AIO_WIN32_ALL_SOURCES) \
+ $(all_AUTHMODULES) \
+ ConfigOption.h \
+ $(DELAY_POOL_ALL_SOURCE) \
+ dns.cc \
+ dnsserver.cc \
+ dns_internal.cc \
+ DnsLookupDetails.cc \
+ DnsLookupDetails.h \
+ htcp.cc \
+ htcp.h \
+ ipc.cc \
+ ipc_win32.cc \
+ ProfStats.cc \
+ LeakFinder.cc \
+ LeakFinder.h \
+ $(SNMP_ALL_SOURCE) \
+ $(UNLINKDSOURCE) \
+ $(SSL_ALL_SOURCE) \
+ $(WIN32_ALL_SOURCE) \
+ $(LOADABLE_MODULES_SOURCES) \
+ DiskIO/DiskThreads/aiops.cc \
+ DiskIO/DiskThreads/aiops_win32.cc
+
noinst_HEADERS = \
client_side_request.cci \
MemBuf.cci \
SquidString.h \
SquidTime.h
-nodist_squid_SOURCES = \
- $(DISKIO_GEN_SOURCE) \
- repl_modules.cc \
+BUILT_SOURCES = \
+ cf_gen_defines.h \
cf_parser.h \
+ err_type.cc \
globals.cc \
- string_arrays.c
+ hier_code.cc \
+ icp_opcode.cc \
+ lookup_t.cc \
+ repl_modules.cc \
+ swap_log_op.cc
+
+CLEANFILES += $(BUILT_SOURCES)
+
+nodist_squid_SOURCES = \
+ $(DISKIO_GEN_SOURCE) \
+ $(BUILT_SOURCES)
squid_LDADD = \
$(COMMON_LIBS) \
nodist_ufsdump_SOURCES = \
globals.cc
-BUILT_SOURCES = \
- cf_gen_defines.h \
- cf_parser.h \
- globals.cc \
- string_arrays.c \
- repl_modules.cc
-
sysconf_DATA = \
squid.conf.default \
squid.conf.documented \
snmp_core.o snmp_agent.o: ../snmplib/libsnmp.a $(top_srcdir)/include/cache_snmp.h
-globals.cc: globals.h mk-globals-c.pl
+globals.cc: globals.h mk-globals-c.awk
$(AWK) -f $(srcdir)/mk-globals-c.awk < $(srcdir)/globals.h > $@
-string_arrays.c: enums.h mk-string-arrays.pl
- $(AWK) -f $(srcdir)/mk-string-arrays.awk < $(srcdir)/enums.h > $@
+## Generate files containing strng arrays for various enums....
+hier_code.cc: hier_code.h mk-string-arrays.awk
+ $(AWK) -f $(srcdir)/mk-string-arrays.awk < $(srcdir)/hier_code.h > $@
+
+err_type.cc: err_type.h mk-string-arrays.awk
+ $(AWK) -f $(srcdir)/mk-string-arrays.awk < $(srcdir)/err_type.h > $@
+
+lookup_t.cc: lookup_t.h mk-string-arrays.awk
+ $(AWK) -f $(srcdir)/mk-string-arrays.awk < $(srcdir)/lookup_t.h > $@
+
+icp_opcode.cc: icp_opcode.h mk-string-arrays.awk
+ $(AWK) -f $(srcdir)/mk-string-arrays.awk < $(srcdir)/icp_opcode.h > $@
+
+swap_log_op.cc: swap_log_op.h mk-string-arrays.awk
+ $(AWK) -f $(srcdir)/mk-string-arrays.awk < $(srcdir)/swap_log_op.h > $@
+
+
+## other generated files...
cache_diff: cache_diff.o debug.o globals.o store_key_md5.o
$(CC) -o $@ $(LDFLAGS) $@.o debug.o globals.o store_key_md5.o $(STD_APP_LIBS)
@$(SHELL) $(top_srcdir)/scripts/remove-cfg.sh "$(RM)" $(DESTDIR)$(DEFAULT_MIME_TABLE)
@$(SHELL) $(top_srcdir)/scripts/remove-cfg.sh "$(RM)" $(DESTDIR)$(DEFAULT_CONFIG_FILE)
-CLEANFILES += cf_gen_defines.h cf.data cf_parser.h squid.conf.default squid.conf.documented \
- globals.cc string_arrays.c repl_modules.cc DiskIO/DiskIOModules_gen.cc \
+CLEANFILES += cf.data squid.conf.default squid.conf.documented \
+ DiskIO/DiskIOModules_gen.cc \
test_tools.cc *.a
test_tools.cc: $(top_srcdir)/test-suite/test_tools.cc
ftp.cc \
gopher.cc \
hier_code.h \
- hier_code.cc \
helper.cc \
$(HTCPSOURCE) \
http.cc \
$(WIN32_SOURCE) \
wordlist.cc
nodist_tests_testCacheManager_SOURCES = \
- globals.cc \
- repl_modules.cc \
- string_arrays.c
+ $(BUILT_SOURCES)
tests_testCacheManager_LDADD = \
$(COMMON_LIBS) \
icmp/libicmp.la icmp/libicmp-core.la \
tests/testMain.cc \
tests/stub_cache_manager.cc
nodist_tests_testDiskIO_SOURCES= \
- $(SWAP_TEST_GEN_SOURCES)
+ $(SWAP_TEST_GEN_SOURCES) \
+ swap_log_op.cc
tests_testDiskIO_LDADD = \
$(SWAP_TEST_LDADD) \
@DISK_LIBS@ \
ftp.cc \
gopher.cc \
hier_code.h \
- hier_code.cc \
helper.cc \
$(HTCPSOURCE) \
http.cc \
$(WIN32_SOURCE) \
wordlist.cc
nodist_tests_testEvent_SOURCES = \
- globals.cc \
- repl_modules.cc \
- string_arrays.c
+ $(BUILT_SOURCES)
tests_testEvent_LDADD = \
$(COMMON_LIBS) \
icmp/libicmp.la icmp/libicmp-core.la \
gopher.cc \
helper.cc \
hier_code.h \
- hier_code.cc \
$(HTCPSOURCE) \
http.cc \
HttpBody.cc \
$(WIN32_SOURCE) \
wordlist.cc
nodist_tests_testEventLoop_SOURCES = \
- globals.cc \
- repl_modules.cc \
- string_arrays.c
+ $(BUILT_SOURCES)
tests_testEventLoop_LDADD = \
$(COMMON_LIBS) \
icmp/libicmp.la icmp/libicmp-core.la \
gopher.cc \
helper.cc \
hier_code.h \
- hier_code.cc \
$(HTCPSOURCE) \
http.cc \
HttpBody.cc \
Packer.cc \
MemBuf.cc
nodist_tests_test_http_range_SOURCES = \
- globals.cc \
- repl_modules.cc \
- string_arrays.c
+ $(BUILT_SOURCES)
tests_test_http_range_LDADD = \
$(COMMON_LIBS) \
icmp/libicmp.la icmp/libicmp-core.la \
gopher.cc \
helper.cc \
hier_code.h \
- hier_code.cc \
$(HTCPSOURCE) \
http.cc \
HttpBody.cc \
$(WIN32_SOURCE) \
wordlist.cc
nodist_tests_testHttpRequest_SOURCES = \
- globals.cc \
- repl_modules.cc \
- string_arrays.c
+ $(BUILT_SOURCES)
tests_testHttpRequest_LDADD = \
$(COMMON_LIBS) \
icmp/libicmp.la icmp/libicmp-core.la \
URLScheme.cc \
wordlist.cc
-STORE_TEST_GEN_SOURCES = \
- $(TESTSOURCES) \
- string_arrays.c
-
## why so many sources? well httpHeaderTools requites ACLChecklist & friends.
## first line - what we are testing.
tests_testStore_SOURCES= \
$(STORE_TEST_SOURCES)
nodist_tests_testStore_SOURCES= \
- $(STORE_TEST_GEN_SOURCES)
+ $(TESTSOURCES) \
+ swap_log_op.cc
tests_testStore_LDADD= \
$(COMMON_LIBS) \
$(DISKIO_SOURCE)
SWAP_TEST_GEN_SOURCES = \
- $(STORE_TEST_GEN_SOURCES) \
+ $(TESTSOURCES) \
$(DISKIO_GEN_SOURCE)
SWAP_TEST_LDADD = \
tests/stub_cache_manager.cc \
$(SWAP_TEST_SOURCES)
nodist_tests_testUfs_SOURCES = \
- $(SWAP_TEST_GEN_SOURCES)
+ $(SWAP_TEST_GEN_SOURCES) \
+ swap_log_op.cc
tests_testUfs_LDADD = \
$(SWAP_TEST_LDADD) \
$(COMMON_LIBS) \
gopher.cc \
helper.cc \
hier_code.h \
- hier_code.cc \
$(HTCPSOURCE) \
http.cc \
HttpBody.cc \
$(WIN32_SOURCE) \
wordlist.cc
nodist_tests_testURL_SOURCES = \
- globals.cc \
- repl_modules.cc \
- string_arrays.c
+ $(BUILT_SOURCES)
tests_testURL_LDADD = \
$(COMMON_LIBS) \
icmp/libicmp.la icmp/libicmp-core.la \
*/
#include "StoreSwapLogData.h"
+#include "swap_log_op.h"
StoreSwapLogData::StoreSwapLogData(): op(0), swap_filen (0), timestamp (0), lastref (0), expires (0), lastmod(0), swap_file_sz (0), refcount (0), flags (0)
{
if (al->hier.ping.timedout)
mb.append("TIMEOUT_", 8);
- out = hier_strings[al->hier.code];
+ out = hier_code_str[al->hier.code];
break;
al->url,
user ? user : dash_str,
al->hier.ping.timedout ? "TIMEOUT_" : "",
- hier_strings[al->hier.code],
+ hier_code_str[al->hier.code],
al->hier.host,
al->http.content_type);
} else {
al->url,
user ? user : dash_str,
al->hier.ping.timedout ? "TIMEOUT_" : "",
- hier_strings[al->hier.code],
+ hier_code_str[al->hier.code],
al->hier.host,
al->http.content_type,
ereq,
al->http.code,
al->cache.replySize,
log_tags[al->cache.code],
- hier_strings[al->hier.code]);
+ hier_code_str[al->hier.code]);
safe_free(user1);
#define SQUID_ACL_GADGETS_H
#include "config.h"
-#include "enums.h" /* for err_type */
+#include "err_type.h"
struct dlink_list;
class StoreEntry;
for (hier_code iter=HIER_NONE; iter<HIER_MAX; ++iter) {
if (!values[iter]) continue;
- wordlistAdd(&W, hier_strings[iter]);
+ wordlistAdd(&W, hier_code_str[iter]);
}
return W;
fatalf("ERROR: No such hier_code '%s'",t);
return;
}
- if (strcmp(hier_strings[iter],t) == 0) {
+ if (strcmp(hier_code_str[iter],t) == 0) {
values[iter] = true;
break; // back to while-loop
}
LOG_TYPE_MAX
} log_type;
-typedef enum {
- ERR_NONE,
- ERR_READ_TIMEOUT,
- ERR_LIFETIME_EXP,
- ERR_READ_ERROR,
- ERR_WRITE_ERROR,
- ERR_SHUTTING_DOWN,
- ERR_CONNECT_FAIL,
- ERR_SECURE_CONNECT_FAIL,
- ERR_INVALID_REQ,
- ERR_UNSUP_REQ,
- ERR_INVALID_URL,
- ERR_SOCKET_FAILURE,
- ERR_DNS_FAIL,
- ERR_CANNOT_FORWARD,
- ERR_FORWARDING_DENIED,
- ERR_NO_RELAY,
- ERR_ZERO_SIZE_OBJECT,
- ERR_FTP_DISABLED,
- ERR_FTP_FAILURE,
- ERR_URN_RESOLVE,
- ERR_ACCESS_DENIED,
- ERR_CACHE_ACCESS_DENIED,
- ERR_CACHE_MGR_ACCESS_DENIED,
- ERR_SQUID_SIGNATURE, /* not really an error */
- ERR_FTP_PUT_CREATED, /* !error,a note that the file was created */
- ERR_FTP_PUT_MODIFIED, /* modified, !created */
- ERR_FTP_PUT_ERROR,
- ERR_FTP_NOT_FOUND,
- ERR_FTP_FORBIDDEN,
- ERR_FTP_UNAVAILABLE,
- ERR_ONLY_IF_CACHED_MISS, /* failure to satisfy only-if-cached request */
- ERR_TOO_BIG,
- TCP_RESET,
- ERR_ESI, /* Failure to perform ESI processing */
- ERR_INVALID_RESP,
- ERR_ICAP_FAILURE,
- ERR_UNSUP_HTTPVERSION, /* HTTP version is not supported */
- ERR_MAX
-} err_type;
-
enum fd_type {
FD_NONE,
FD_LOG,
PEER_MULTICAST
} peer_t;
-typedef enum {
- LOOKUP_NONE,
- LOOKUP_HIT,
- LOOKUP_MISS
-} lookup_t;
-
typedef enum {
CC_BADHDR = -1,
CC_PUBLIC = 0,
} http_hdr_sc_type;
-/// \ingroup ServerProtocolICPAPI
-typedef enum {
- ICP_INVALID,
- ICP_QUERY,
- ICP_HIT,
- ICP_MISS,
- ICP_ERR,
- ICP_SEND,
- ICP_SENDA,
- ICP_DATABEG,
- ICP_DATA,
- ICP_DATAEND,
- ICP_SECHO,
- ICP_DECHO,
- ICP_NOTIFY,
- ICP_INVALIDATE,
- ICP_DELETE,
- ICP_UNUSED15,
- ICP_UNUSED16,
- ICP_UNUSED17,
- ICP_UNUSED18,
- ICP_UNUSED19,
- ICP_UNUSED20,
- ICP_MISS_NOFETCH,
- ICP_DENIED,
- ICP_HIT_OBJ,
- ICP_END
-} icp_opcode;
-
typedef enum _mem_status_t {
NOT_IN_MEMORY,
IN_MEMORY
STORE_LOG_SWAPOUTFAIL
};
-typedef enum {
- SWAP_LOG_NOP,
- SWAP_LOG_ADD,
- SWAP_LOG_DEL,
- SWAP_LOG_VERSION,
- SWAP_LOG_MAX
-} swap_log_op;
-
-
/* parse state of HttpReply or HttpRequest */
typedef enum {
psReadyToParseStartLine = 0,
--- /dev/null
+#ifndef _SQUID_ERR_TYPE_H
+#define _SQUID_ERR_TYPE_H
+
+typedef enum {
+ ERR_NONE,
+
+/* Access Permission Errors. Prefix new with ERR_ACCESS_ */
+ ERR_ACCESS_DENIED,
+ ERR_CACHE_ACCESS_DENIED,
+ ERR_CACHE_MGR_ACCESS_DENIED,
+ ERR_FORWARDING_DENIED,
+ ERR_NO_RELAY,
+ ERR_CANNOT_FORWARD,
+
+/* TCP Errors. */
+ ERR_READ_TIMEOUT,
+ ERR_LIFETIME_EXP,
+ ERR_READ_ERROR,
+ ERR_WRITE_ERROR,
+ ERR_CONNECT_FAIL,
+ ERR_SECURE_CONNECT_FAIL,
+ ERR_SOCKET_FAILURE,
+
+/* DNS Errors */
+ ERR_DNS_FAIL,
+ ERR_URN_RESOLVE,
+
+/* HTTP Errors */
+ ERR_ONLY_IF_CACHED_MISS, /* failure to satisfy only-if-cached request */
+ ERR_TOO_BIG,
+ ERR_INVALID_RESP,
+ ERR_UNSUP_HTTPVERSION, /* HTTP version is not supported */
+ ERR_INVALID_REQ,
+ ERR_UNSUP_REQ,
+ ERR_INVALID_URL,
+ ERR_ZERO_SIZE_OBJECT,
+
+/* FTP Errors */
+ ERR_FTP_DISABLED,
+ ERR_FTP_UNAVAILABLE,
+ ERR_FTP_FAILURE,
+ ERR_FTP_PUT_ERROR,
+ ERR_FTP_NOT_FOUND,
+ ERR_FTP_FORBIDDEN,
+ ERR_FTP_PUT_CREATED, /* !error,a note that the file was created */
+ ERR_FTP_PUT_MODIFIED, /* modified, !created */
+
+/* ESI Errors */
+ ERR_ESI, /* Failure to perform ESI processing */
+
+/* ICAP Errors */
+ ERR_ICAP_FAILURE,
+
+/* Special Cases */
+ ERR_SQUID_SIGNATURE, /* not really an error */
+ ERR_SHUTTING_DOWN,
+ TCP_RESET,
+
+ ERR_MAX
+} err_type;
+
+extern const char *err_type_str[];
+
+#endif /* _SQUID_ERR_TYPE_H */
#include "Parsing.h"
#include "SquidTime.h"
#include "SwapDir.h"
+#include "swap_log_op.h"
int UFSSwapDir::NumberOfUFSDirs = 0;
int *UFSSwapDir::UFSDirToGlobalDirMapping = NULL;
/*
* $Id$
- * vim: set et :
*
* DEBUG: section 47 Store Directory Routines
* AUTHOR: Robert Collins
* Copyright (c) 2003, Robert Collins <robertc@squid-cache.org>
*/
+#include "config.h"
#include "ufscommon.h"
#include "Store.h"
#include "fde.h"
#include "StoreMetaUnpacker.h"
#include "RefCount.h"
#include "StoreSwapLogData.h"
+#include "swap_log_op.h"
+
CBDATA_CLASS_INIT(RebuildState);
extern unsigned long store_swap_size; /* 0 */
extern time_t hit_only_mode_until; /* 0 */
extern StatCounters statCounter;
- extern char *err_type_str[];
- extern char *icp_opcode_str[];
- extern char *swap_log_op_str[];
- extern char *lookup_t_str[];
extern double request_failure_ratio; /* 0.0 */
extern int store_hash_buckets; /* 0 */
extern hash_table *store_table; /* NULL */
+++ /dev/null
-#include "config.h"
-#include "hier_code.h"
-
-const char *hier_strings[] = {
- "NONE", /* HIER_NONE */
- "DIRECT", /* HIER_DIRECT */
- "SIBLING_HIT",
- "PARENT_HIT",
- "DEFAULT_PARENT",
- "SINGLE_PARENT",
- "FIRSTUP_PARENT",
- "FIRST_PARENT_MISS",
- "CLOSEST_PARENT_MISS",
- "CLOSEST_PARENT",
- "CLOSEST_DIRECT",
- "NO_DIRECT_FAIL",
- "SOURCE_FASTEST",
- "ROUNDROBIN_PARENT",
-#if USE_CACHE_DIGESTS
- "CD_PARENT_HIT",
- "CD_SIBLING_HIT",
-#endif
- "CARP",
- "ANY_PARENT",
- "USERHASH",
- "SOURCEHASH",
- "PINNED",
- "HIER_MAX"
-};
HIER_MAX
} hier_code;
-extern const char *hier_strings[];
+extern const char *hier_code_str[];
inline const hier_code operator++(hier_code &i) { return (hier_code)(i+1); }
--- /dev/null
+#ifndef _SQUID_ICP_OPCODE_H
+#define _SQUID_ICP_OPCODE_H
+
+/// \ingroup ServerProtocolICPAPI
+typedef enum {
+ ICP_INVALID,
+ ICP_QUERY,
+ ICP_HIT,
+ ICP_MISS,
+ ICP_ERR,
+ ICP_SEND,
+ ICP_SENDA,
+ ICP_DATABEG,
+ ICP_DATA,
+ ICP_DATAEND,
+ ICP_SECHO,
+ ICP_DECHO,
+ ICP_NOTIFY,
+ ICP_INVALIDATE,
+ ICP_DELETE,
+ ICP_UNUSED15,
+ ICP_UNUSED16,
+ ICP_UNUSED17,
+ ICP_UNUSED18,
+ ICP_UNUSED19,
+ ICP_UNUSED20,
+ ICP_MISS_NOFETCH,
+ ICP_DENIED,
+ ICP_HIT_OBJ,
+ ICP_END
+} icp_opcode;
+
+extern const char *icp_opcode_str[];
+
+#endif /* _SQUID_ICP_OPCODE_H */
# --> awk -f mk-string-arrays.awk enum.h
#
# 2006 by Christopher Kerr.
+#
+# 2009 modified by Amos Jeffries
+# Adapted to convert individual enum headers
+#
-BEGIN { # converted to "const char *"TypedefEnum[?]"_str[]"
- TypedefEnum["err_type"] = 1
- TypedefEnum["lookup_t"] = 1
- TypedefEnum["icp_opcode"] = 1
- TypedefEnum["swap_log_op"] = 1
+BEGIN {
+ print "/*"
+ print " * Auto-Generated File. Changes will be destroyed."
+ print " */"
+ print "#include \"squid.h\""
+ codeSkip = 1
+ e = 0
}
-/^ \*\/$/ && Copyright != 1 { Copyright = 1; print; next }
-Copyright != 1 { print; next }
-/^typedef/ { e = 0; next }
+# Skip all lines outside of typedef {}
+/^typedef/ { codeSkip = 0; next }
+codeSkip == 1 { next }
/^[ \t]*[A-Z]/ {
split($1, t, ",") # remove ,
/^} / {
split($2, t, ";") # remove ;
type = t[1]
- if (TypedefEnum[type]) {
- print "\nconst char *" type "_str[] = {"
- for ( i = 1; i < e; ++i)
- print "\t\"" Element[i] "\","
- print "\t\"" Element[i] "\""
- print "};"
- }
+ codeSkip = 1
+
+ print "#include \"" type ".h\""
+ print "\nconst char *" type "_str[] = {"
+ for ( i = 1; i < e; ++i)
+ print "\t\"" Element[i] "\","
+ print "\t\"" Element[i] "\""
+ print "};"
next
}
-
peerNoteDigestLookup(HttpRequest * request, peer * p, lookup_t lookup)
{
#if USE_CACHE_DIGESTS
-
if (p)
strncpy(request->hier.cd_host, p->host, sizeof(request->hier.cd_host));
else
*request->hier.cd_host = '\0';
request->hier.cd_lookup = lookup;
-
- debugs(15, 4, "peerNoteDigestLookup: peer " <<
- (p ? p->host : "<none>") << ", lookup: " <<
- lookup_t_str[lookup] );
-
+ debugs(15, 4, "peerNoteDigestLookup: peer " << (p? p->host : "<none>") << ", lookup: " << lookup_t_str[lookup] );
#endif
}
return 1;
}
-/* I should attach these records to the entry. We take the first
+/**
+ * I should attach these records to the entry. We take the first
* hit we get our wait until everyone misses. The timeout handler
* call needs to nip this shopping list or call one of the misses.
*
* If a hit process is already started, then sobeit
*/
void
-
neighborsUdpAck(const cache_key * key, icp_common_t * header, const IpAddress &from)
{
peer *p = NULL;
StoreEntry *entry;
MemObject *mem = NULL;
peer_t ntype = PEER_NONE;
- char *opcode_d;
icp_opcode opcode = (icp_opcode) header->opcode;
debugs(15, 6, "neighborsUdpAck: opcode " << opcode << " '" << storeKeyText(key) << "'");
if (opcode > ICP_END)
return;
- opcode_d = icp_opcode_str[opcode];
+ const char *opcode_d = icp_opcode_str[opcode];
if (p)
neighborUpdateRtt(p, mem);
if (code != HIER_NONE) {
assert(p);
- debugs(44, 3, "peerSelect: " << hier_strings[code] << "/" << p->host);
+ debugs(44, 3, "peerSelect: " << hier_code_str[code] << "/" << p->host);
peerAddFwdServer(&ps->servers, p, code);
}
if (peerCheckNetdbDirect(ps)) {
code = CLOSEST_DIRECT;
- debugs(44, 3, "peerSelect: " << hier_strings[code] << "/" << request->GetHost());
+ debugs(44, 3, "peerSelect: " << hier_code_str[code] << "/" << request->GetHost());
peerAddFwdServer(&ps->servers, NULL, code);
return;
}
}
}
if (p && code != HIER_NONE) {
- debugs(44, 3, "peerSelect: " << hier_strings[code] << "/" << p->host);
+ debugs(44, 3, "peerSelect: " << hier_code_str[code] << "/" << p->host);
peerAddFwdServer(&ps->servers, p, code);
}
}
}
if (code != HIER_NONE) {
- debugs(44, 3, "peerSelect: " << hier_strings[code] << "/" << p->host);
+ debugs(44, 3, "peerSelect: " << hier_code_str[code] << "/" << p->host);
peerAddFwdServer(&ps->servers, p, code);
}
}
FwdServer *fs = (FwdServer *)memAllocate(MEM_FWD_SERVER);
debugs(44, 5, "peerAddFwdServer: adding " <<
(p ? p->host : "DIRECT") << " " <<
- hier_strings[code] );
+ hier_code_str[code] );
fs->_peer = cbdataReference(p);
fs->code = code;
/* some parameters stil need this */
#include "wordlist.h"
+/* for parameters that still need these */
+#include "lookup_t.h"
+
+
class HttpRequestMethod;
SQUIDCEXTERN int mcastSetTtl(int, int);
SQUIDCEXTERN IPH mcastJoinGroups;
-/* Labels for hierachical log file */
-/* put them all here for easier reference when writing a logfile analyzer */
-
-
SQUIDCEXTERN peer *getFirstPeer(void);
SQUIDCEXTERN peer *getFirstUpParent(HttpRequest *);
SQUIDCEXTERN peer *getNextPeer(peer *);
#endif
#include "Stack.h"
#include "SquidTime.h"
+#include "swap_log_op.h"
static STMCB storeWriteComplete;
#define STORE_IN_MEM_BUCKETS (229)
+
+/** \todo Convert these string constants to enum string-arrays generated */
+
const char *memStatusStr[] = {
"NOT_IN_MEMORY",
"IN_MEMORY"
#include "MemObject.h"
#include "SquidTime.h"
#include "SwapDir.h"
+#include "swap_log_op.h"
#if HAVE_STATVFS
#if HAVE_SYS_STATVFS_H
#include "mem_node.h"
#include "MemObject.h"
#include "SwapDir.h"
+#include "swap_log_op.h"
static void storeSwapOutStart(StoreEntry * e);
static StoreIOState::STIOCB storeSwapOutFileClosed;
#include "config.h"
#include "RefCount.h"
#include "cbdata.h"
-
-/* needed for various structures still in structs.h */
#include "dlink.h"
+#include "err_type.h"
+
/* needed for the global config */
#include "HttpHeader.h"
+/* for ICP_END */
+#include "icp_opcode.h"
+
struct acl_name_list {
char name[ACL_NAME_SZ];
acl_name_list *next;
--- /dev/null
+#ifndef _SQUID_SWAP_LOG_OP_H
+#define _SQUID_SWAP_LOG_OP_H
+
+typedef enum {
+ SWAP_LOG_NOP,
+ SWAP_LOG_ADD,
+ SWAP_LOG_DEL,
+ SWAP_LOG_VERSION,
+ SWAP_LOG_MAX
+} swap_log_op;
+
+extern const char *swap_log_op_str[];
+
+#endif /* _SQUID_SWAP_LOG_OP_H */