<sect1>Removed directives<label id="removeddirectives">
<p>
<descrip>
- <p>No removed directives in this version.
+ <tag>mcast_miss_addr</tag>
+ <p>The corresponding code has not built for many years, indicating that the
+ feature is unused.
+
+ <tag>mcast_miss_ttl</tag>
+ <p>The corresponding code has not built for many years, indicating that the
+ feature is unused.
+
+ <tag>mcast_miss_port</tag>
+ <p>The corresponding code has not built for many years, indicating that the
+ feature is unused.
+
+ <tag>mcast_miss_encode_key</tag>
+ <p>The corresponding code has not built for many years, indicating that the
+ feature is unused.
</descrip>
<p>The code enabled by this preprocessor macro has not built for many
years, indicating that the feature is unused.
+ <tag>CPPFLAGS=-DMULTICAST_MISS_STREAM</tag>
+ <p>The code enabled by this preprocessor macro has not built for many
+ years, indicating that the feature is unused.
+
</descrip>
<sect>Copyright
By default, Squid doesn't listen on any multicast groups.
DOC_END
-NAME: mcast_miss_addr
-IFDEF: MULTICAST_MISS_STREAM
-TYPE: address
-LOC: Config.mcast_miss.addr
-DEFAULT: no_addr
-DEFAULT_DOC: disabled.
-DOC_START
- If you enable this option, every "cache miss" URL will
- be sent out on the specified multicast address.
-
- Do not enable this option unless you are are absolutely
- certain you understand what you are doing.
-DOC_END
-
-NAME: mcast_miss_ttl
-IFDEF: MULTICAST_MISS_STREAM
-TYPE: u_short
-LOC: Config.mcast_miss.ttl
-DEFAULT: 16
-DOC_START
- This is the time-to-live value for packets multicasted
- when multicasting off cache miss URLs is enabled. By
- default this is set to 'site scope', i.e. 16.
-DOC_END
-
-NAME: mcast_miss_port
-IFDEF: MULTICAST_MISS_STREAM
-TYPE: u_short
-LOC: Config.mcast_miss.port
-DEFAULT: 3135
-DOC_START
- This is the port number to be used in conjunction with
- 'mcast_miss_addr'.
-DOC_END
-
-NAME: mcast_miss_encode_key
-IFDEF: MULTICAST_MISS_STREAM
-TYPE: string
-LOC: Config.mcast_miss.encode_key
-DEFAULT: XXXXXXXXXXXXXXXX
-DOC_START
- The URLs that are sent in the multicast miss stream are
- encrypted. This is the encryption key.
-DOC_END
-
NAME: mcast_icp_query_timeout
COMMENT: (msec)
DEFAULT: 2000
#include <unordered_map>
-#if MULTICAST_MISS_STREAM
-static int mcast_miss_fd = -1;
-
-static struct sockaddr_in mcast_miss_to;
-static void mcast_encode(unsigned int *, size_t, const unsigned int *);
-#endif
-
#if USE_FORW_VIA_DB
using HeaderValueCountsElement = std::pair<const SBuf, uint64_t>;
return;
accessLogLogTo(Config.Log.accesslogs, al, checklist);
-#if MULTICAST_MISS_STREAM
-
- if (al->cache.code != LOG_TCP_MISS)
- (void) 0;
- else if (al->http.method != METHOD_GET)
- (void) 0;
- else if (mcast_miss_fd < 0)
- (void) 0;
- else {
- unsigned int ibuf[365];
- size_t isize;
- xstrncpy((char *) ibuf, al->url.c_str(), 364 * sizeof(int));
- isize = ((al->url.length() + 8) / 8) * 2;
-
- if (isize > 364)
- isize = 364;
-
- mcast_encode((unsigned int *) ibuf, isize,
- (const unsigned int *) Config.mcast_miss.encode_key);
-
- comm_udp_sendto(mcast_miss_fd,
- &mcast_miss_to, sizeof(mcast_miss_to),
- ibuf, isize * sizeof(int));
- }
-
-#endif
}
void
}
#endif
}
-
-#if MULTICAST_MISS_STREAM
-
- if (Config.mcast_miss.addr.s_addr != no_addr.s_addr) {
- memset(&mcast_miss_to, '\0', sizeof(mcast_miss_to));
- mcast_miss_to.sin_family = AF_INET;
- mcast_miss_to.sin_port = htons(Config.mcast_miss.port);
- mcast_miss_to.sin_addr.s_addr = Config.mcast_miss.addr.s_addr;
- mcast_miss_fd = comm_open(SOCK_DGRAM,
- IPPROTO_UDP,
- Config.Addrs.udp_incoming,
- Config.mcast_miss.port,
- COMM_NONBLOCKING,
- "Multicast Miss Stream");
-
- if (mcast_miss_fd < 0)
- fatal("Cannot open Multicast Miss Stream Socket");
-
- debugs(46, DBG_IMPORTANT, "Multicast Miss Stream Socket opened on FD " << mcast_miss_fd);
-
- mcastSetTtl(mcast_miss_fd, Config.mcast_miss.ttl);
-
- if (strlen(Config.mcast_miss.encode_key) < 16)
- fatal("mcast_encode_key is too short, must be 16 characters");
- }
-
-#endif
}
#if USE_FORW_VIA_DB
#endif
-#if MULTICAST_MISS_STREAM
-/*
- * From http://www.io.com/~paulhart/game/algorithms/tea.html
- *
- * size of 'ibuf' must be a multiple of 2.
- * size of 'key' must be 4.
- * 'ibuf' is modified in place, encrypted data is written in
- * network byte order.
- */
-static void
-mcast_encode(unsigned int *ibuf, size_t isize, const unsigned int *key)
-{
- unsigned int y;
- unsigned int z;
- unsigned int sum;
- const unsigned int delta = 0x9e3779b9;
- unsigned int n = 32;
- const unsigned int k0 = htonl(key[0]);
- const unsigned int k1 = htonl(key[1]);
- const unsigned int k2 = htonl(key[2]);
- const unsigned int k3 = htonl(key[3]);
- int i;
-
- for (i = 0; i < isize; i += 2) {
- y = htonl(ibuf[i]);
- z = htonl(ibuf[i + 1]);
- sum = 0;
-
- for (n = 32; n; --n) {
- sum += delta;
- y += (z << 4) + (k0 ^ z) + (sum ^ (z >> 5)) + k1;
- z += (y << 4) + (k2 ^ y) + (sum ^ (y >> 5)) + k3;
- }
-
- ibuf[i] = htonl(y);
- ibuf[i + 1] = htonl(z);
- }
-}
-
-#endif
-