int reserved[32 - 6];
};
-struct _DigestFetchState {
+class DigestFetchState {
+public:
PeerDigest *pd;
StoreEntry *entry;
StoreEntry *old_entry;
Mgr::IoActionData::operator += (const IoActionData& stats)
{
http_reads += stats.http_reads;
- for (int i = 0; i < _iostats::histSize; ++i)
+ for (int i = 0; i < iostats::histSize; ++i)
http_read_hist[i] += stats.http_read_hist[i];
ftp_reads += stats.ftp_reads;
- for (int i = 0; i < _iostats::histSize; ++i)
+ for (int i = 0; i < iostats::histSize; ++i)
ftp_read_hist[i] += stats.ftp_read_hist[i];
gopher_reads += stats.gopher_reads;
- for (int i = 0; i < _iostats::histSize; ++i)
+ for (int i = 0; i < iostats::histSize; ++i)
gopher_read_hist[i] += stats.gopher_read_hist[i];
return *this;
#define SQUID_MGR_IO_ACTION_H
#include "mgr/Action.h"
-#include "structs.h" /* _iostats::histSize */
+#include "structs.h" /* iostats::histSize */
namespace Mgr
{
double http_reads;
double ftp_reads;
double gopher_reads;
- double http_read_hist[_iostats::histSize];
- double ftp_read_hist[_iostats::histSize];
- double gopher_read_hist[_iostats::histSize];
+ double http_read_hist[iostats::histSize];
+ double ftp_read_hist[iostats::histSize];
+ double gopher_read_hist[iostats::histSize];
};
/// implement aggregated 'io' action
neighborType(const peer * p, const HttpRequest * request)
{
- const struct _domain_type *d = NULL;
+ const domain_type *d = NULL;
for (d = p->typelist; d; d = d->next) {
if (0 == matchDomainName(request->GetHost(), d->domain))
peerAllowedToUse(const peer * p, HttpRequest * request)
{
- const struct _domain_ping *d = NULL;
+ const domain_ping *d = NULL;
assert(request != NULL);
if (neighborType(p, request) == PEER_SIBLING) {
if (p == NULL)
return;
- struct _domain_ping *nl = NULL;
+ domain_ping *nl = NULL;
- for (struct _domain_ping *l = p->peer_domain; l; l = nl) {
+ for (domain_ping *l = p->peer_domain; l; l = nl) {
nl = l->next;
safe_free(l->domain);
xfree(l);
{
peer *e = NULL;
char ntoabuf[MAX_IPSTRLEN];
- struct _domain_ping *d = NULL;
+ domain_ping *d = NULL;
icp_opcode op;
int i;
stats.http_reads = IOStats.Http.reads;
- for (i = 0; i < _iostats::histSize; ++i) {
+ for (i = 0; i < iostats::histSize; ++i) {
stats.http_read_hist[i] = IOStats.Http.read_hist[i];
}
stats.ftp_reads = IOStats.Ftp.reads;
- for (i = 0; i < _iostats::histSize; ++i) {
+ for (i = 0; i < iostats::histSize; ++i) {
stats.ftp_read_hist[i] = IOStats.Ftp.read_hist[i];
}
stats.gopher_reads = IOStats.Gopher.reads;
- for (i = 0; i < _iostats::histSize; ++i) {
+ for (i = 0; i < iostats::histSize; ++i) {
stats.gopher_read_hist[i] = IOStats.Gopher.read_hist[i];
}
}
storeAppendPrintf(sentry, "number of reads: %.0f\n", stats.http_reads);
storeAppendPrintf(sentry, "Read Histogram:\n");
- for (i = 0; i < _iostats::histSize; ++i) {
+ for (i = 0; i < iostats::histSize; ++i) {
storeAppendPrintf(sentry, "%5d-%5d: %9.0f %2.0f%%\n",
i ? (1 << (i - 1)) + 1 : 1,
1 << i,
storeAppendPrintf(sentry, "number of reads: %.0f\n", stats.ftp_reads);
storeAppendPrintf(sentry, "Read Histogram:\n");
- for (i = 0; i < _iostats::histSize; ++i) {
+ for (i = 0; i < iostats::histSize; ++i) {
storeAppendPrintf(sentry, "%5d-%5d: %9.0f %2.0f%%\n",
i ? (1 << (i - 1)) + 1 : 1,
1 << i,
storeAppendPrintf(sentry, "number of reads: %.0f\n", stats.gopher_reads);
storeAppendPrintf(sentry, "Read Histogram:\n");
- for (i = 0; i < _iostats::histSize; ++i) {
+ for (i = 0; i < iostats::histSize; ++i) {
storeAppendPrintf(sentry, "%5d-%5d: %9.0f %2.0f%%\n",
i ? (1 << (i - 1)) + 1 : 1,
1 << i,
int64_t size;
};
-struct ushortlist {
- unsigned short i;
- ushortlist *next;
-};
-
struct relist {
int flags;
char *pattern;
SQUIDCEXTERN SquidConfig2 Config2;
-struct _close_handler {
+class close_handler {
+public:
PF *handler;
void *data;
close_handler *next;
};
-struct _dread_ctrl {
+class dread_ctrl {
+public:
int fd;
off_t offset;
int req_len;
void *client_data;
};
-struct _dwrite_q {
+class dwrite_q {
+public:
off_t file_offset;
char *buf;
size_t len;
HttpHeaderFieldStat stat;
};
-struct _http_state_flags {
+class http_state_flags {
+public:
unsigned int proxying:1;
unsigned int keepalive:1;
unsigned int only_if_cached:1;
unsigned int sentLastChunk:1; ///< do not try to write last-chunk again
};
-struct _domain_ping {
+class domain_ping {
+public:
char *domain;
int do_ping; /* boolean */
domain_ping *next;
};
-struct _domain_type {
+class domain_type {
+public:
char *domain;
peer_t type;
domain_type *next;
int connection_auth;
};
-struct _net_db_name {
+class netdbEntry;
+
+class net_db_name {
+public:
hash_link hash; /* must be first */
net_db_name *next;
netdbEntry *net_db_entry;
};
-struct _net_db_peer {
+class net_db_peer {
+public:
const char *peername;
double hops;
double rtt;
time_t expires;
};
-struct _netdbEntry {
+class netdbEntry {
+public:
hash_link hash; /* must be first */
char network[MAX_IPSTRLEN];
int pings_sent;
int n_peers;
};
-struct _iostats {
+class iostats {
+public:
+ static const int histSize=16;
- enum { histSize = 16 };
+// enum { histSize = 16 };
struct {
int reads;
size_t kb;
} kb_t;
-typedef struct _close_handler close_handler;
-
-typedef struct _dread_ctrl dread_ctrl;
-
-typedef struct _dwrite_q dwrite_q;
-
typedef struct _HttpHeaderFieldAttrs HttpHeaderFieldAttrs;
-typedef struct _domain_ping domain_ping;
-
-typedef struct _domain_type domain_type;
-
-typedef struct _DigestFetchState DigestFetchState;
-
-typedef struct _net_db_name net_db_name;
-
-typedef struct _net_db_peer net_db_peer;
-
-typedef struct _netdbEntry netdbEntry;
-
typedef struct _icp_common_t icp_common_t;
-typedef struct _iostats iostats;
-
-typedef struct _http_state_flags http_state_flags;
-
typedef struct _header_mangler header_mangler;
typedef struct _cachemgr_passwd cachemgr_passwd;