From: Francesco Chemolli Date: Sat, 12 Jul 2008 15:40:56 +0000 (+0200) Subject: Cleaned up the namespace some. X-Git-Tag: SQUID_3_1_0_1~49^2~143^2~7 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5f5e883f588637e2d7c760b0cb3e8e2bea5e4772;p=thirdparty%2Fsquid.git Cleaned up the namespace some. Fixed some broken file permisssions. --- diff --git a/helpers/basic_auth/squid_radius_auth/radius-util.h b/helpers/basic_auth/squid_radius_auth/radius-util.h old mode 100755 new mode 100644 diff --git a/helpers/basic_auth/squid_radius_auth/squid_rad_auth.c b/helpers/basic_auth/squid_radius_auth/squid_rad_auth.c old mode 100755 new mode 100644 diff --git a/helpers/external_acl/session/squid_session.c b/helpers/external_acl/session/squid_session.c old mode 100755 new mode 100644 diff --git a/helpers/negotiate_auth/squid_kerb_auth/spnegohelp/spnegohelp.c b/helpers/negotiate_auth/squid_kerb_auth/spnegohelp/spnegohelp.c old mode 100755 new mode 100644 diff --git a/helpers/negotiate_auth/squid_kerb_auth/spnegohelp/spnegohelp.h b/helpers/negotiate_auth/squid_kerb_auth/spnegohelp/spnegohelp.h old mode 100755 new mode 100644 diff --git a/helpers/ntlm_auth/fakeauth/fakeauth_auth.c b/helpers/ntlm_auth/fakeauth/fakeauth_auth.c old mode 100755 new mode 100644 diff --git a/include/squid_mswin.h b/include/squid_mswin.h old mode 100755 new mode 100644 diff --git a/lib/dirent.c b/lib/dirent.c old mode 100755 new mode 100644 diff --git a/lib/encrypt.c b/lib/encrypt.c old mode 100755 new mode 100644 diff --git a/lib/getopt.c b/lib/getopt.c old mode 100755 new mode 100644 diff --git a/lib/inet_ntoa.c b/lib/inet_ntoa.c old mode 100755 new mode 100644 diff --git a/lib/radix.c b/lib/radix.c old mode 100755 new mode 100644 diff --git a/lib/strnstr.cc b/lib/strnstr.cc old mode 100755 new mode 100644 diff --git a/lib/win32lib.c b/lib/win32lib.c old mode 100755 new mode 100644 diff --git a/src/AccessLogEntry.h b/src/AccessLogEntry.h index 9ddd12f500..ef559f3df5 100644 --- a/src/AccessLogEntry.h +++ b/src/AccessLogEntry.h @@ -144,7 +144,6 @@ extern void accessLogLog(AccessLogEntry *, ACLChecklist * checklist); extern void accessLogRotate(void); extern void accessLogClose(void); extern void accessLogInit(void); -extern void accessLogRegisterWithCacheManager(); extern void accessLogFreeMemory(AccessLogEntry * aLogEntry); extern const char *accessLogTime(time_t); extern int accessLogParseLogFormat(logformat_token ** fmt, char *def); diff --git a/src/ICMPPinger.cc b/src/ICMPPinger.cc old mode 100755 new mode 100644 diff --git a/src/ICMPv4.h b/src/ICMPv4.h old mode 100755 new mode 100644 diff --git a/src/Makefile.am b/src/Makefile.am old mode 100755 new mode 100644 diff --git a/src/WinSvc.cc b/src/WinSvc.cc old mode 100755 new mode 100644 diff --git a/src/access_log.cc b/src/access_log.cc index c1f63a3241..364fb3c0a7 100644 --- a/src/access_log.cc +++ b/src/access_log.cc @@ -1555,6 +1555,14 @@ hierarchyNote(HierarchyLogEntry * hl, xstrncpy(hl->host, cache_peer, SQUIDHOSTNAMELEN); } +static void +accessLogRegisterWithCacheManager(void) +{ +#if FORW_VIA_DB + fvdbRegisterWithCacheManager(); +#endif +} + void accessLogInit(void) { @@ -1613,14 +1621,6 @@ accessLogInit(void) #endif } -void -accessLogRegisterWithCacheManager() -{ -#if FORW_VIA_DB - fvdbRegisterWithCacheManager(); -#endif -} - const char * accessLogTime(time_t t) { diff --git a/src/carp.cc b/src/carp.cc index e392820bcf..ab49036d31 100644 --- a/src/carp.cc +++ b/src/carp.cc @@ -52,6 +52,13 @@ peerSortWeight(const void *a, const void *b) return (*p1)->weight - (*p2)->weight; } +static void +carpRegisterWithCacheManager(void) +{ + CacheManager::GetInstance()-> + registerAction("carp", "CARP information", carpCachemgr, 0, 1); +} + void carpInit(void) { @@ -154,13 +161,6 @@ carpInit(void) } } -void -carpRegisterWithCacheManager() -{ - CacheManager::GetInstance()-> - registerAction("carp", "CARP information", carpCachemgr, 0, 1); -} - peer * carpSelectParent(HttpRequest * request) { diff --git a/src/client_db.cc b/src/client_db.cc index 675ec38721..33d9203216 100644 --- a/src/client_db.cc +++ b/src/client_db.cc @@ -75,6 +75,13 @@ clientdbAdd(const IPAddress &addr) return c; } +static void +clientdbRegisterWithCacheManager(void) +{ + CacheManager::GetInstance()-> + registerAction("client_list", "Cache Client List", clientdbDump, 0, 1); +} + void clientdbInit(void) { @@ -88,14 +95,6 @@ clientdbInit(void) } void -clientdbRegisterWithCacheManager(void) -{ - CacheManager::GetInstance()-> - registerAction("client_list", "Cache Client List", clientdbDump, 0, 1); -} - -void - clientdbUpdate(const IPAddress &addr, log_type ltype, protocol_t p, size_t size) { char key[MAX_IPSTRLEN]; diff --git a/src/debug.cc b/src/debug.cc old mode 100755 new mode 100644 diff --git a/src/dns_internal.cc b/src/dns_internal.cc old mode 100755 new mode 100644 index f9d92a48ee..f3b8d2403b --- a/src/dns_internal.cc +++ b/src/dns_internal.cc @@ -1309,6 +1309,13 @@ idnsRcodeCount(int rcode, int attempt) /* ====================================================================== */ +static void +idnsRegisterWithCacheManager(void) +{ + CacheManager::GetInstance()-> + registerAction("idns", "Internal DNS Statistics", idnsStats, 0, 1); +} + void idnsInit(void) { @@ -1385,13 +1392,6 @@ idnsInit(void) idnsRegisterWithCacheManager(); } -void -idnsRegisterWithCacheManager(void) -{ - CacheManager::GetInstance()-> - registerAction("idns", "Internal DNS Statistics", idnsStats, 0, 1); -} - void idnsShutdown(void) { diff --git a/src/dnsserver.cc b/src/dnsserver.cc old mode 100755 new mode 100644 diff --git a/src/fqdncache.cc b/src/fqdncache.cc index 6c5b21adda..c3584e55a3 100644 --- a/src/fqdncache.cc +++ b/src/fqdncache.cc @@ -582,6 +582,16 @@ fqdncache_nbgethostbyaddr(IPAddress &addr, FQDNH * handler, void *handlerData) #endif } +/// \ingroup FQDNCacheInternal +static void +fqdncacheRegisterWithCacheManager(void) +{ + CacheManager::GetInstance()-> + registerAction("fqdncache", "FQDN Cache Stats and Contents", + fqdnStats, 0, 1); + +} + /** \ingroup FQDNCacheAPI * @@ -618,16 +628,6 @@ fqdncache_init(void) sizeof(fqdncache_entry), 0); } -/// \ingroup FQDNCacheAPI -void -fqdncacheRegisterWithCacheManager(void) -{ - CacheManager::GetInstance()-> - registerAction("fqdncache", "FQDN Cache Stats and Contents", - fqdnStats, 0, 1); - -} - /** \ingroup FQDNCacheAPI * diff --git a/src/ipcache.cc b/src/ipcache.cc index 2564723d9a..ff8e07e06b 100644 --- a/src/ipcache.cc +++ b/src/ipcache.cc @@ -770,6 +770,17 @@ ipcache_nbgethostbyname(const char *name, IPH * handler, void *handlerData) #endif } +/// \ingroup IPCacheInternal +static void +ipcacheRegisterWithCacheManager(void) +{ + CacheManager::GetInstance()-> + registerAction("ipcache", + "IP Cache Stats and Contents", + stat_ipcache_get, 0, 1); +} + + /** \ingroup IPCacheAPI * @@ -810,16 +821,6 @@ ipcache_init(void) ipcacheRegisterWithCacheManager(); } -/// \ingroup IPCacheAPI -void -ipcacheRegisterWithCacheManager(void) -{ - CacheManager::GetInstance()-> - registerAction("ipcache", - "IP Cache Stats and Contents", - stat_ipcache_get, 0, 1); -} - /** \ingroup IPCacheAPI * diff --git a/src/main.cc b/src/main.cc index 9c4317e036..7970463d96 100644 --- a/src/main.cc +++ b/src/main.cc @@ -962,11 +962,9 @@ mainInitialize(void) FwdState::initModule(); /* register the modules in the cache manager menus */ - // accessLogRegisterWithCacheManager(); //moved to accessLogInit() // asnRegisterWithCacheManager(); //moved to asnInit() // authenticateRegisterWithCacheManager(&Config.authConfiguration); // moved authenticateInit() - // carpRegisterWithCacheManager(); //moved to carpInit() cbdataRegisterWithCacheManager(); /* These use separate calls so that the comm loops can eventually @@ -1047,7 +1045,7 @@ mainInitialize(void) neighbors_init(); - neighborsRegisterWithCacheManager(); + // neighborsRegisterWithCacheManager(); //moved to neighbors_init() if (Config.chroot_dir) no_suid(); diff --git a/src/neighbors.cc b/src/neighbors.cc index 3ffcb4751f..aa28ee9caf 100644 --- a/src/neighbors.cc +++ b/src/neighbors.cc @@ -488,6 +488,21 @@ neighborRemove(peer * target) first_ping = Config.peers; } +static void +neighborsRegisterWithCacheManager() +{ + CacheManager *manager = CacheManager::GetInstance(); + manager->registerAction("server_list", + "Peer Cache Statistics", + neighborDumpPeers, 0, 1); + + if (theInIcpConnection >= 0) { + manager->registerAction("non_peers", + "List of Unknown sites sending ICP messages", + neighborDumpNonPeers, 0, 1); + } +} + void neighbors_init(void) { @@ -551,21 +566,6 @@ neighbors_init(void) nul.FreeAddrInfo(AI); } -void -neighborsRegisterWithCacheManager() -{ - CacheManager *manager = CacheManager::GetInstance(); - manager->registerAction("server_list", - "Peer Cache Statistics", - neighborDumpPeers, 0, 1); - - if (theInIcpConnection >= 0) { - manager->registerAction("non_peers", - "List of Unknown sites sending ICP messages", - neighborDumpNonPeers, 0, 1); - } -} - int neighborsUdpPing(HttpRequest * request, StoreEntry * entry, diff --git a/src/net_db.cc b/src/net_db.cc index fe38729b02..666b204a4c 100644 --- a/src/net_db.cc +++ b/src/net_db.cc @@ -886,6 +886,15 @@ netdbExchangeDone(void *data) #endif /* USE_ICMP */ +static void +netdbRegisterWitHCacheManager(void) +{ +#if USE_ICMP + CacheManager::GetInstance()-> + registerAction("netdb", "Network Measurement Database", netdbDump, 0, 1); +#endif +} + /* PUBLIC FUNCTIONS */ void @@ -914,15 +923,6 @@ netdbInit(void) #endif } -void -netdbRegisterWitHCacheManager(void) -{ -#if USE_ICMP - CacheManager::GetInstance()-> - registerAction("netdb", "Network Measurement Database", netdbDump, 0, 1); -#endif -} - void netdbPingSite(const char *hostname) { diff --git a/src/pinger.cc b/src/pinger.cc old mode 100755 new mode 100644 diff --git a/src/protos.h b/src/protos.h index 48c494adbb..3ab251642c 100644 --- a/src/protos.h +++ b/src/protos.h @@ -83,7 +83,6 @@ SQUIDCEXTERN void parse_IPAddress_list_token(IPAddress_list **, char *); /* client_side.c - FD related client side routines */ SQUIDCEXTERN void clientdbInit(void); -extern void clientdbRegisterWithCacheManager(void); SQUIDCEXTERN void clientdbUpdate(const IPAddress &, log_type, protocol_t, size_t); @@ -135,13 +134,11 @@ SQUIDCEXTERN void disk_init(void); SQUIDCEXTERN void dnsShutdown(void); SQUIDCEXTERN void dnsInit(void); -extern void dnsRegisterWithCacheManager(void); SQUIDCEXTERN void dnsSubmit(const char *lookup, HLPCB * callback, void *data); /* dns_internal.c */ SQUIDCEXTERN void idnsInit(void); SQUIDCEXTERN void idnsShutdown(void); -extern void idnsRegisterWithCacheManager(void); SQUIDCEXTERN void idnsALookup(const char *, IDNSCB *, void *); SQUIDCEXTERN void idnsPTRLookup(const IPAddress &, IDNSCB *, void *); @@ -167,7 +164,6 @@ SQUIDCEXTERN void fqdncache_nbgethostbyaddr(IPAddress &, FQDNH *, void *); SQUIDCEXTERN const char *fqdncache_gethostbyaddr(IPAddress &, int flags); SQUIDCEXTERN void fqdncache_init(void); -extern void fqdncacheRegisterWithCacheManager(void); SQUIDCEXTERN void fqdnStats(StoreEntry *); SQUIDCEXTERN void fqdncacheReleaseInvalid(const char *); @@ -342,7 +338,6 @@ SQUIDCEXTERN const ipcache_addrs *ipcache_gethostbyname(const char *, int flags) SQUIDCEXTERN void ipcacheInvalidate(const char *); SQUIDCEXTERN void ipcacheInvalidateNegative(const char *); SQUIDCEXTERN void ipcache_init(void); -extern void ipcacheRegisterWithCacheManager(void); SQUIDCEXTERN void stat_ipcache_get(StoreEntry *); SQUIDCEXTERN void ipcacheCycleAddr(const char *name, ipcache_addrs *); @@ -391,7 +386,6 @@ SQUIDCEXTERN void neighborAddAcl(const char *, const char *); SQUIDCEXTERN void neighborsUdpAck(const cache_key *, icp_common_t *, const IPAddress &); SQUIDCEXTERN void neighborAdd(const char *, const char *, int, int, int, int, int); SQUIDCEXTERN void neighbors_init(void); -extern void neighborsRegisterWithCacheManager(); SQUIDCEXTERN peer *peerFindByName(const char *); SQUIDCEXTERN peer *peerFindByNameAndPort(const char *, unsigned short); SQUIDCEXTERN peer *getDefaultParent(HttpRequest * request); @@ -415,7 +409,6 @@ SQUIDCEXTERN int peerHTTPOkay(const peer *, HttpRequest *); SQUIDCEXTERN peer *whichPeer(const IPAddress &from); SQUIDCEXTERN void netdbInit(void); -extern void netdbRegisterWitHCacheManager(void); SQUIDCEXTERN void netdbHandlePingReply(const IPAddress &from, int hops, int rtt); SQUIDCEXTERN void netdbPingSite(const char *hostname); @@ -453,7 +446,6 @@ unsigned long getOutgoingTOS(HttpRequest * request); SQUIDCEXTERN void urnStart(HttpRequest *, StoreEntry *); SQUIDCEXTERN void redirectInit(void); -extern void redirectRegisterWithCacheManager(void); SQUIDCEXTERN void redirectShutdown(void); extern void refreshAddToList(const char *, int, time_t, int, time_t); @@ -464,7 +456,6 @@ extern int refreshCheckHTCP(const StoreEntry *, HttpRequest *); extern int refreshCheckDigest(const StoreEntry *, time_t delta); extern time_t getMaxAge(const char *url); extern void refreshInit(void); -extern void refreshRegisterWithCacheManager(void); extern const refresh_t *refreshLimits(const char *url); extern void serverConnectionsClose(void); @@ -477,7 +468,6 @@ extern void start_announce(void *unused); extern void waisStart(FwdState *); SQUIDCEXTERN void statInit(void); -extern void statRegisterWithCacheManager(void); SQUIDCEXTERN void statFreeMemory(void); SQUIDCEXTERN double median_svc_get(int, int); SQUIDCEXTERN void pconnHistCount(int, int); @@ -538,7 +528,6 @@ SQUIDCEXTERN void storeLog(int tag, const StoreEntry * e); SQUIDCEXTERN void storeLogRotate(void); SQUIDCEXTERN void storeLogClose(void); SQUIDCEXTERN void storeLogOpen(void); -SQUIDCEXTERN void storeLogRegisterWithCacheManager(void); /* @@ -563,7 +552,6 @@ SQUIDCEXTERN HASHCMP storeKeyHashCmp; * store_digest.c */ SQUIDCEXTERN void storeDigestInit(void); -extern void storeDigestRegisterWithCacheManager(void); SQUIDCEXTERN void storeDigestNoteStoreReady(void); SQUIDCEXTERN void storeDigestScheduleRebuild(void); SQUIDCEXTERN void storeDigestDel(const StoreEntry * entry); @@ -588,7 +576,8 @@ SQUIDCEXTERN void storeSwapInStart(store_client *); */ SQUIDCEXTERN store_client *storeClientListAdd(StoreEntry * e, void *data); SQUIDCEXTERN int storeClientCopyPending(store_client *, StoreEntry * e, void *data); -SQUIDCEXTERN int storeUnregister(store_client * sc, StoreEntry * e, void *data); +SQUIDCEXTERN int storeUnregister(store_client * sc, StoreEntry * e, void *data) +; SQUIDCEXTERN int storePendingNClients(const StoreEntry * e); SQUIDCEXTERN int storeClientIsThisAClient(store_client * sc, void *someClient); @@ -729,7 +718,6 @@ SQUIDCEXTERN const char *internalHostname(void); SQUIDCEXTERN int internalHostnameIs(const char *); SQUIDCEXTERN void carpInit(void); -extern void carpRegisterWithCacheManager(); SQUIDCEXTERN peer *carpSelectParent(HttpRequest *); diff --git a/src/redirect.cc b/src/redirect.cc index e5c311cf55..45c923c8cd 100644 --- a/src/redirect.cc +++ b/src/redirect.cc @@ -176,6 +176,13 @@ redirectStart(ClientHttpRequest * http, RH * handler, void *data) helperSubmit(redirectors, buf, redirectHandleReply, r); } +static void +redirectRegisterWithCacheManager(void) +{ + CacheManager::GetInstance()-> + registerAction("redirector", "URL Redirector Stats", redirectStats, 0, 1); +} + void redirectInit(void) { @@ -205,13 +212,6 @@ redirectInit(void) } } -void -redirectRegisterWithCacheManager(void) -{ - CacheManager::GetInstance()-> - registerAction("redirector", "URL Redirector Stats", redirectStats, 0, 1); -} - void redirectShutdown(void) { diff --git a/src/refresh.cc b/src/refresh.cc index 399023b0a7..e19b3da8e7 100644 --- a/src/refresh.cc +++ b/src/refresh.cc @@ -574,6 +574,13 @@ refreshStats(StoreEntry * sentry) refreshCountsStats(sentry, &refreshCounts[i]); } +static void +refreshRegisterWithCacheManager(void) +{ + CacheManager::GetInstance()-> + registerAction("refresh", "Refresh Algorithm Statistics", refreshStats, 0, 1); +} + void refreshInit(void) { @@ -599,10 +606,3 @@ refreshInit(void) refreshRegisterWithCacheManager(); } - -void -refreshRegisterWithCacheManager(void) -{ - CacheManager::GetInstance()-> - registerAction("refresh", "Refresh Algorithm Statistics", refreshStats, 0, 1); -} diff --git a/src/stat.cc b/src/stat.cc index c73fd0edd6..cc1a8594ce 100644 --- a/src/stat.cc +++ b/src/stat.cc @@ -1006,31 +1006,7 @@ statAvgDump(StoreEntry * sentry, int minutes, int hours) storeAppendPrintf(sentry, "cpu_usage = %f%%\n", dpercent(ct, dt)); } - -void -statInit(void) -{ - int i; - debugs(18, 5, "statInit: Initializing..."); - - for (i = 0; i < N_COUNT_HIST; i++) - statCountersInit(&CountHist[i]); - - for (i = 0; i < N_COUNT_HOUR_HIST; i++) - statCountersInit(&CountHourHist[i]); - - statCountersInit(&statCounter); - - eventAdd("statAvgTick", statAvgTick, NULL, (double) COUNT_INTERVAL, 1); - - ClientActiveRequests.head = NULL; - - ClientActiveRequests.tail = NULL; - - statRegisterWithCacheManager(); -} - -void +static void statRegisterWithCacheManager(void) { CacheManager *manager = CacheManager::GetInstance(); @@ -1072,6 +1048,30 @@ statRegisterWithCacheManager(void) #endif } + +void +statInit(void) +{ + int i; + debugs(18, 5, "statInit: Initializing..."); + + for (i = 0; i < N_COUNT_HIST; i++) + statCountersInit(&CountHist[i]); + + for (i = 0; i < N_COUNT_HOUR_HIST; i++) + statCountersInit(&CountHourHist[i]); + + statCountersInit(&statCounter); + + eventAdd("statAvgTick", statAvgTick, NULL, (double) COUNT_INTERVAL, 1); + + ClientActiveRequests.head = NULL; + + ClientActiveRequests.tail = NULL; + + statRegisterWithCacheManager(); +} + static void statAvgTick(void *notused) { diff --git a/src/store_digest.cc b/src/store_digest.cc index 01e131fdf1..ad10563c2f 100644 --- a/src/store_digest.cc +++ b/src/store_digest.cc @@ -101,6 +101,13 @@ static void storeDigestAdd(const StoreEntry *); #endif /* USE_CACHE_DIGESTS */ +static void +storeDigestRegisterWithCacheManager(void) +{ + CacheManager::GetInstance()-> + registerAction("store_digest", "Store Digest", storeDigestReport, 0, 1); +} + /* * PUBLIC FUNCTIONS */ @@ -132,13 +139,6 @@ storeDigestInit(void) #endif } -void -storeDigestRegisterWithCacheManager(void) -{ - CacheManager::GetInstance()-> - registerAction("store_digest", "Store Digest", storeDigestReport, 0, 1); -} - /* called when store_rebuild completes */ void storeDigestNoteStoreReady(void) diff --git a/src/store_log.cc b/src/store_log.cc index 247acd040b..2b2912243f 100644 --- a/src/store_log.cc +++ b/src/store_log.cc @@ -124,6 +124,14 @@ storeLogClose(void) storelog = NULL; } +static void +storeLogRegisterWithCacheManager(void) +{ + CacheManager::GetInstance()-> + registerAction("store_log_tags", "Histogram of store.log tags", + storeLogTagsHist, 0, 1); +} + void storeLogOpen(void) { @@ -137,14 +145,6 @@ storeLogOpen(void) storelog = logfileOpen(Config.Log.store, 0, 1); } -void -storeLogRegisterWithCacheManager(void) -{ - CacheManager::GetInstance()-> - registerAction("store_log_tags", "Histogram of store.log tags", - storeLogTagsHist, 0, 1); -} - void storeLogTagsHist(StoreEntry *e) { diff --git a/src/structs.h b/src/structs.h old mode 100755 new mode 100644 diff --git a/tools/squidclient.cc b/tools/squidclient.cc old mode 100755 new mode 100644