fprintf(stderr, "\t-v 2|3\t\t\tLDAP version\n");
fprintf(stderr, "\t-Z\t\t\tTLS encrypt the LDAP connection, requires LDAP version 3\n");
#endif
- fprintf(stderr, "\t-d\t\t\tenable debug mode\n");
+ fprintf(stderr, "\t-d\t\t\tenable debug mode\n");
fprintf(stderr, "\n");
fprintf(stderr, "\tIf no search filter is specified, then the dn <userattr>=user,basedn\n\twill be used (same as specifying a search filter of '<userattr>=',\n\tbut quicker as as there is no need to search for the user DN)\n\n");
fprintf(stderr, "\tIf you need to bind as a user to perform searches then use the\n\t-D binddn -w bindpasswd or -D binddn -W secretfile options\n\n");
fprintf(stderr, "\t-g\t\t\tfirst query parameter is base DN extension\n\t\t\t\tfor this query\n");
fprintf(stderr, "\t-S\t\t\tStrip NT domain from usernames\n");
fprintf(stderr, "\t-K\t\t\tStrip Kerberos realm from usernames\n");
- fprintf(stderr, "\t-d\t\t\tenable debug mode\n");
+ fprintf(stderr, "\t-d\t\t\tenable debug mode\n");
fprintf(stderr, "\n");
fprintf(stderr, "\tIf you need to bind as a user to perform searches then use the\n\t-D binddn -w bindpasswd or -D binddn -W secretfile options\n\n");
exit(1);
#include <getopt.h>
#endif
-/* At this point all Bit Types are already defined, so we must
+/* At this point all Bit Types are already defined, so we must
protect from multiple type definition on platform where
__BIT_TYPES_DEFINED__ is not defined.
*/
/* this one is reallllly haackiish. We really should be using anything from smblib-priv.h
*/
static char const *SMB_Prots[] = {"PC NETWORK PROGRAM 1.0",
- "MICROSOFT NETWORKS 1.03",
- "MICROSOFT NETWORKS 3.0",
- "DOS LANMAN1.0",
- "LANMAN1.0",
- "DOS LM1.2X002",
- "LM1.2X002",
- "DOS LANMAN2.1",
- "LANMAN2.1",
- "Samba",
- "NT LM 0.12",
- "NT LANMAN 1.0",
- NULL
- };
+ "MICROSOFT NETWORKS 1.03",
+ "MICROSOFT NETWORKS 3.0",
+ "DOS LANMAN1.0",
+ "LANMAN1.0",
+ "DOS LM1.2X002",
+ "LM1.2X002",
+ "DOS LANMAN2.1",
+ "LANMAN2.1",
+ "Samba",
+ "NT LM 0.12",
+ "NT LANMAN 1.0",
+ NULL
+ };
#if 0
int SMB_Discon(SMB_Handle_Type Con_Handle, BOOL KeepHandle);
#endif
extern SMB_Tree_Handle SMB_TreeConnect(SMB_Handle_Type con, SMB_Tree_Handle tree,
- char *path, char *password, char const *dev);
+ char *path, char *password, char const *dev);
extern int SMB_Init(void);
extern void SMB_Get_My_Name(char *name, int len);
extern int SMB_Discon(SMB_Handle_Type Con_Handle, BOOL KeepHandle);
extern int SMB_Logon_Server(SMB_Handle_Type Con_Handle, char *UserName,
- char *PassWord, char *UserDomain, int precrypted);
+ char *PassWord, char *UserDomain, int precrypted);
extern int SMB_Get_Error_Msg(int msg, char *msgbuf, int len);
};
static char const *SMB_Prots[] = {"PC NETWORK PROGRAM 1.0",
- "MICROSOFT NETWORKS 1.03",
- "MICROSOFT NETWORKS 3.0",
- "DOS LANMAN1.0",
- "LANMAN1.0",
- "DOS LM1.2X002",
- "LM1.2X002",
- "DOS LANMAN2.1",
- "LANMAN2.1",
- "Samba",
- "NT LM 0.12",
- "NT LANMAN 1.0",
- NULL
- };
+ "MICROSOFT NETWORKS 1.03",
+ "MICROSOFT NETWORKS 3.0",
+ "DOS LANMAN1.0",
+ "LANMAN1.0",
+ "DOS LM1.2X002",
+ "LM1.2X002",
+ "DOS LANMAN2.1",
+ "LANMAN2.1",
+ "Samba",
+ "NT LM 0.12",
+ "NT LANMAN 1.0",
+ NULL
+ };
/* Print out an SMB pkt in all its gory detail ... */
#if 0 // DEAD CODE
}
/**
- * SMB_Create: Create a connection structure and return for later use
+ * SMB_Create: Create a connection structure and return for later use
* We have other helper routines to set variables
*/
SMB_Handle_Type
/* use the handle passed */
char const *SMB_Prots_Restrict[] = {"PC NETWORK PROGRAM 1.0",
- NULL
- };
+ NULL
+ };
SMB_Handle_Type
void
hashFreeMemory(hash_table * hid)
{
- if(hid == NULL)
+ if (hid == NULL)
return;
if (hid->buckets)
xfree(hid->buckets);
else
Bin[i / 2] |= n;
}
-/* FIXME: Coverity detects the below as dead code.
- Why? :: right here i == 32
- which means the first step of the for loop makes i==16
- and cannot be < HASHLEN (which is also 16)
-*/
+ /* FIXME: Coverity detects the below as dead code.
+ Why? :: right here i == 32
+ which means the first step of the for loop makes i==16
+ and cannot be < HASHLEN (which is also 16)
+ */
for (i = i / 2; i < HASHLEN; i++) {
Bin[i] = '\0';
}
icp_opcode opcode;
} icp;
- class HtcpDetails {
+ class HtcpDetails
+ {
public:
HtcpDetails() : opcode(NULL) {};
#include "enums.h"
#include "typedefs.h"
-class ClientInfo {
+class ClientInfo
+{
public:
hash_link hash; /* must be first */
WIN32_OS_string = xstrdup("Windows Server 2008");
return _WIN_OS_WINLON;
}
- if ((osvi.dwMajorVersion == 6) && (osvi.dwMinorVersion == 1)) {
- if (osvi.wProductType == VER_NT_WORKSTATION)
- WIN32_OS_string = xstrdup("Windows 7");
- else
- WIN32_OS_string = xstrdup("Windows Server 2008 R2");
- return _WIN_OS_WIN7;
- }
- if (((osvi.dwMajorVersion > 6)) || ((osvi.dwMajorVersion == 6) && (osvi.dwMinorVersion > 1))) {
- if (osvi.wProductType == VER_NT_WORKSTATION)
- WIN32_OS_string = xstrdup("Unknown Windows version, assuming Windows 7 capabilities");
- else
- WIN32_OS_string = xstrdup("Unknown Windows version, assuming Windows Server 2008 R2 capabilities");
- return _WIN_OS_WIN7;
- }
+ if ((osvi.dwMajorVersion == 6) && (osvi.dwMinorVersion == 1)) {
+ if (osvi.wProductType == VER_NT_WORKSTATION)
+ WIN32_OS_string = xstrdup("Windows 7");
+ else
+ WIN32_OS_string = xstrdup("Windows Server 2008 R2");
+ return _WIN_OS_WIN7;
+ }
+ if (((osvi.dwMajorVersion > 6)) || ((osvi.dwMajorVersion == 6) && (osvi.dwMinorVersion > 1))) {
+ if (osvi.wProductType == VER_NT_WORKSTATION)
+ WIN32_OS_string = xstrdup("Unknown Windows version, assuming Windows 7 capabilities");
+ else
+ WIN32_OS_string = xstrdup("Unknown Windows version, assuming Windows Server 2008 R2 capabilities");
+ return _WIN_OS_WIN7;
+ }
break;
case VER_PLATFORM_WIN32_WINDOWS:
if ((osvi.dwMajorVersion == 4) && (osvi.dwMinorVersion == 0)) {
safe_free(ConfigFile);
/* get config file from Windows Registry */
- if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, REGKEY, 0, KEY_QUERY_VALUE, &hndKey) == ERROR_SUCCESS) {
+ if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, REGKEY, 0, KEY_QUERY_VALUE, &hndKey) == ERROR_SUCCESS) {
DWORD Type = 0;
DWORD Size = 0;
LONG Result;
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
- *
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA.
ACLTagStrategy::match (ACLData<MatchType> * &data, ACLFilledChecklist *checklist)
{
if (checklist->conn() != NULL)
- return data->match (checklist->request->tag.termedBuf());
+ return data->match (checklist->request->tag.termedBuf());
return 0;
}
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
- *
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA.
private:
static ACLTagStrategy Instance_;
- ACLTagStrategy(){}
+ ACLTagStrategy() {}
ACLTagStrategy&operator=(ACLTagStrategy const &);
};
}
for (R = Config.Refresh; R; R = R->next) {
- if (!R->flags.ignore_must_revalidate)
- continue;
- debugs(22, 1, "WARNING: use of 'ignore-must-revalidate' in 'refresh_pattern' violates HTTP");
- break;
+ if (!R->flags.ignore_must_revalidate)
+ continue;
+ debugs(22, 1, "WARNING: use of 'ignore-must-revalidate' in 'refresh_pattern' violates HTTP");
+ break;
}
for (R = Config.Refresh; R; R = R->next) {
}
/* new cache_dir */
- if(swap->n_configured > 63) {
+ if (swap->n_configured > 63) {
/* 7 bits, signed */
debugs(3, DBG_CRITICAL, "WARNING: There is a fixed maximum of 63 cache_dir entries Squid can handle.");
debugs(3, DBG_CRITICAL, "WARNING: '" << path_str << "' is one to many.");
enter_suid();
fd = comm_open_listener(SOCK_STREAM,
- IPPROTO_TCP,
- s->http.s,
- COMM_NONBLOCKING, "HTTPS Socket");
+ IPPROTO_TCP,
+ s->http.s,
+ COMM_NONBLOCKING, "HTTPS Socket");
leave_suid();
if (fd < 0)
int
comm_open_listener(int sock_type,
- int proto,
- IpAddress &addr,
- int flags,
- const char *note)
+ int proto,
+ IpAddress &addr,
+ int flags,
+ const char *note)
{
int sock = -1;
void
_db_print(const char *format,...)
{
- char f[BUFSIZ]; f[0]='\0';
+ char f[BUFSIZ];
+ f[0]='\0';
va_list args1;
va_list args2;
va_list args3;
DWORD Type = 0;
DWORD Size = 0;
LONG Result;
- Result = RegQueryValueEx(hndKey, "Domain", NULL, &Type, NULL, &Size);
+ Result = RegQueryValueEx(hndKey, "Domain", NULL, &Type, NULL, &Size);
if (Result == ERROR_SUCCESS && Size) {
t = (char *) xmalloc(Size);
idnsAddPathComponent(t);
xfree(t);
}
- Result = RegQueryValueEx(hndKey, "SearchList", NULL, &Type, NULL, &Size);
+ Result = RegQueryValueEx(hndKey, "SearchList", NULL, &Type, NULL, &Size);
if (Result == ERROR_SUCCESS && Size) {
t = (char *) xmalloc(Size);
- RegQueryValueEx(hndKey, "SearchList", NULL, &Type, (LPBYTE) t, &Size);
+ RegQueryValueEx(hndKey, "SearchList", NULL, &Type, (LPBYTE) t, &Size);
token = strtok(t, Separator);
while (token) {
case _WIN_OS_WINNT:
/* get nameservers from the Windows NT registry */
- if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, REG_TCPIP_PARA, 0, KEY_QUERY_VALUE, &hndKey) == ERROR_SUCCESS) {
+ if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, REG_TCPIP_PARA, 0, KEY_QUERY_VALUE, &hndKey) == ERROR_SUCCESS) {
DWORD Type = 0;
DWORD Size = 0;
LONG Result;
- Result = RegQueryValueEx(hndKey, "DhcpNameServer", NULL, &Type, NULL, &Size);
+ Result = RegQueryValueEx(hndKey, "DhcpNameServer", NULL, &Type, NULL, &Size);
if (Result == ERROR_SUCCESS && Size) {
t = (char *) xmalloc(Size);
/* get nameservers from the Windows 2000 registry */
/* search all interfaces for DNS server addresses */
- if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, REG_TCPIP_PARA_INTERFACES, 0, KEY_READ, &hndKey) == ERROR_SUCCESS) {
+ if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, REG_TCPIP_PARA_INTERFACES, 0, KEY_READ, &hndKey) == ERROR_SUCCESS) {
int i;
- DWORD MaxSubkeyLen, InterfacesCount;
- char *keyname;
- FILETIME ftLastWriteTime;
-
- if (RegQueryInfoKey(hndKey, NULL, NULL, NULL, &InterfacesCount, &MaxSubkeyLen, NULL, NULL, NULL, NULL, NULL, NULL) == ERROR_SUCCESS) {
- keyname = (char *) xmalloc(++MaxSubkeyLen);
- for (i = 0; i < (int) InterfacesCount; i++) {
- DWORD j;
- j = MaxSubkeyLen;
- if (RegEnumKeyEx(hndKey, i, keyname, &j, NULL, NULL, NULL, &ftLastWriteTime) == ERROR_SUCCESS) {
- char *newkeyname;
- newkeyname = (char *) xmalloc(sizeof(REG_TCPIP_PARA_INTERFACES) + j + 2);
- strcpy(newkeyname, REG_TCPIP_PARA_INTERFACES);
- strcat(newkeyname, "\\");
- strcat(newkeyname, keyname);
- if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, newkeyname, 0, KEY_QUERY_VALUE, &hndKey2) == ERROR_SUCCESS) {
- DWORD Type = 0;
- DWORD Size = 0;
- LONG Result;
- Result = RegQueryValueEx(hndKey2, "DhcpNameServer", NULL, &Type, NULL, &Size);
- if (Result == ERROR_SUCCESS && Size) {
- t = (char *) xmalloc(Size);
- RegQueryValueEx(hndKey2, "DhcpNameServer", NULL, &Type, (LPBYTE)t, &Size);
- token = strtok(t, ", ");
- while (token) {
+ DWORD MaxSubkeyLen, InterfacesCount;
+ char *keyname;
+ FILETIME ftLastWriteTime;
+
+ if (RegQueryInfoKey(hndKey, NULL, NULL, NULL, &InterfacesCount, &MaxSubkeyLen, NULL, NULL, NULL, NULL, NULL, NULL) == ERROR_SUCCESS) {
+ keyname = (char *) xmalloc(++MaxSubkeyLen);
+ for (i = 0; i < (int) InterfacesCount; i++) {
+ DWORD j;
+ j = MaxSubkeyLen;
+ if (RegEnumKeyEx(hndKey, i, keyname, &j, NULL, NULL, NULL, &ftLastWriteTime) == ERROR_SUCCESS) {
+ char *newkeyname;
+ newkeyname = (char *) xmalloc(sizeof(REG_TCPIP_PARA_INTERFACES) + j + 2);
+ strcpy(newkeyname, REG_TCPIP_PARA_INTERFACES);
+ strcat(newkeyname, "\\");
+ strcat(newkeyname, keyname);
+ if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, newkeyname, 0, KEY_QUERY_VALUE, &hndKey2) == ERROR_SUCCESS) {
+ DWORD Type = 0;
+ DWORD Size = 0;
+ LONG Result;
+ Result = RegQueryValueEx(hndKey2, "DhcpNameServer", NULL, &Type, NULL, &Size);
+ if (Result == ERROR_SUCCESS && Size) {
+ t = (char *) xmalloc(Size);
+ RegQueryValueEx(hndKey2, "DhcpNameServer", NULL, &Type, (LPBYTE)t, &Size);
+ token = strtok(t, ", ");
+ while (token) {
debugs(78, 1, "Adding DHCP nameserver " << token << " from Registry");
- idnsAddNameserver(token);
- token = strtok(NULL, ", ");
- }
- xfree(t);
- }
-
- Result = RegQueryValueEx(hndKey2, "NameServer", NULL, &Type, NULL, &Size);
- if (Result == ERROR_SUCCESS && Size) {
- t = (char *) xmalloc(Size);
- RegQueryValueEx(hndKey2, "NameServer", NULL, &Type, (LPBYTE)t, &Size);
- token = strtok(t, ", ");
- while (token) {
- debugs(78, 1, "Adding nameserver " << token << " from Registry");
- idnsAddNameserver(token);
- token = strtok(NULL, ", ");
- }
-
- xfree(t);
+ idnsAddNameserver(token);
+ token = strtok(NULL, ", ");
+ }
+ xfree(t);
+ }
+
+ Result = RegQueryValueEx(hndKey2, "NameServer", NULL, &Type, NULL, &Size);
+ if (Result == ERROR_SUCCESS && Size) {
+ t = (char *) xmalloc(Size);
+ RegQueryValueEx(hndKey2, "NameServer", NULL, &Type, (LPBYTE)t, &Size);
+ token = strtok(t, ", ");
+ while (token) {
+ debugs(78, 1, "Adding nameserver " << token << " from Registry");
+ idnsAddNameserver(token);
+ token = strtok(NULL, ", ");
+ }
+
+ xfree(t);
}
RegCloseKey(hndKey2);
}
- xfree(newkeyname);
+ xfree(newkeyname);
}
}
- xfree(keyname);
+ xfree(keyname);
}
RegCloseKey(hndKey);
case _WIN_OS_WINME:
/* get nameservers from the Windows 9X registry */
- if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, REG_VXD_MSTCP, 0, KEY_QUERY_VALUE, &hndKey) == ERROR_SUCCESS) {
+ if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, REG_VXD_MSTCP, 0, KEY_QUERY_VALUE, &hndKey) == ERROR_SUCCESS) {
DWORD Type = 0;
DWORD Size = 0;
LONG Result;
- Result = RegQueryValueEx(hndKey, "NameServer", NULL, &Type, NULL, &Size);
+ Result = RegQueryValueEx(hndKey, "NameServer", NULL, &Type, NULL, &Size);
if (Result == ERROR_SUCCESS && Size) {
t = (char *) xmalloc(Size);
debugs(78, 2, "idnsInit: attempt open DNS socket to: " << addr);
DnsSocket = comm_open_listener(SOCK_DGRAM,
- IPPROTO_UDP,
- addr,
- COMM_NONBLOCKING,
- "DNS Socket");
+ IPPROTO_UDP,
+ addr,
+ COMM_NONBLOCKING,
+ "DNS Socket");
if (DnsSocket < 0)
fatal("Could not create a DNS socket");
ipa.GetInAddr(_SQUID_RES_NSADDR_LIST[_SQUID_RES_NSADDR_COUNT++].sin_addr);
} else if ( ipa.IsIPv6() ) {
#if USE_IPV6 && defined(_SQUID_RES_NSADDR6_LIST)
- /* because things NEVER seem to resolve in tests without _res.nscount being a total. */
+ /* because things NEVER seem to resolve in tests without _res.nscount being a total. */
if (_SQUID_RES_NSADDR_COUNT == MAXNS) {
fprintf(stderr, "Too many -s options, only %d are allowed\n", MAXNS);
return;
*s = '\0';
/* if there was a username part */
- if(s > login) {
+ if (s > login) {
xstrncpy(user, login, MAX_URL);
if (escaped)
rfc1738_unescape(user);
password_url = 1;
}
}
- }
- else if (login[0]) {
+ } else if (login[0]) {
/* no password, just username */
xstrncpy(user, login, MAX_URL);
if (escaped)
assert(ftpState->restart_offset > 0);
if (code == 350) {
- ftpState->setCurrentOffset(ftpState->restart_offset);
+ ftpState->setCurrentOffset(ftpState->restart_offset);
ftpSendRetr(ftpState);
} else if (code > 0) {
debugs(9, 3, HERE << "REST not supported");
debugs(84, 1, "helperOpenServers: Starting " << need_new << "/" << hlp->n_to_start << " '" << shortname << "' processes");
- if(need_new < 1) {
+ if (need_new < 1) {
debugs(84, 1, "helperOpenServers: No '" << shortname << "' processes needed.");
}
debugs(84, 1, "helperOpenServers: Starting " << need_new << "/" << hlp->n_to_start << " '" << shortname << "' processes");
- if(need_new < 1) {
+ if (need_new < 1) {
debugs(84, 1, "helperStatefulOpenServers: No '" << shortname << "' processes needed.");
}
stuff.S.uri = spec->uri;
stuff.S.version = spec->version;
stuff.S.req_hdrs = spec->req_hdrs;
- if(e)
+ if (e)
hdr.putInt(HDR_AGE, (e->timestamp <= squid_curtime ? (squid_curtime - e->timestamp) : 0) );
else
hdr.putInt(HDR_AGE, 0);
enter_suid();
htcpInSocket = comm_open_listener(SOCK_DGRAM,
- IPPROTO_UDP,
- incomingAddr,
- COMM_NONBLOCKING,
- "HTCP Socket");
+ IPPROTO_UDP,
+ incomingAddr,
+ COMM_NONBLOCKING,
+ "HTCP Socket");
leave_suid();
if (htcpInSocket < 0)
enter_suid();
htcpOutSocket = comm_open_listener(SOCK_DGRAM,
- IPPROTO_UDP,
- outgoingAddr,
- COMM_NONBLOCKING,
- "Outgoing HTCP Socket");
+ IPPROTO_UDP,
+ outgoingAddr,
+ COMM_NONBLOCKING,
+ "Outgoing HTCP Socket");
leave_suid();
if (htcpOutSocket < 0)
{
AccessLogEntry al;
if (LOG_TAG_NONE == logcode)
- return;
+ return;
if (!Config.onoff.log_udp)
- return;
+ return;
al.htcp.opcode = htcpOpcodeStr[opcode];
al.url = url;
al.cache.caddr = caddr;
assert (fd == httpState->fd);
// assert(buf == readBuf->content());
PROF_start(HttpStateData_readReply);
- httpState->readReply (len, flag, xerrno);
+ httpState->readReply(len, flag, xerrno);
PROF_stop(HttpStateData_readReply);
}
*/
/* XXX this function is too long! */
void
-HttpStateData::readReply (const CommIoCbParams &io)
+HttpStateData::readReply(const CommIoCbParams &io)
{
int bin;
int clen;
addr = Config.Addrs.udp_incoming;
addr.SetPort(port);
theInIcpConnection = comm_open_listener(SOCK_DGRAM,
- IPPROTO_UDP,
- addr,
- COMM_NONBLOCKING,
- "ICP Socket");
+ IPPROTO_UDP,
+ addr,
+ COMM_NONBLOCKING,
+ "ICP Socket");
leave_suid();
if (theInIcpConnection < 0)
enter_suid();
addr.SetPort(port);
theOutIcpConnection = comm_open_listener(SOCK_DGRAM,
- IPPROTO_UDP,
- addr,
- COMM_NONBLOCKING,
- "ICP Port");
+ IPPROTO_UDP,
+ addr,
+ COMM_NONBLOCKING,
+ "ICP Port");
leave_suid();
if (theOutIcpConnection < 0)
#include "acl/Acl.h"
-namespace Ident {
+namespace Ident
+{
-class IdentConfig {
+class IdentConfig
+{
public:
acl_access *identLookup;
time_t timeout;
#include "ident/Ident.h"
#include "MemBuf.h"
-namespace Ident {
+namespace Ident
+{
#define IDENT_PORT 113
#define IDENT_KEY_SZ 50
addr.SetPort(0); // NP: use random port for secure outbound to IDENT_PORT
fd = comm_open_listener(SOCK_STREAM,
- IPPROTO_TCP,
- addr,
- COMM_NONBLOCKING,
- "ident");
+ IPPROTO_TCP,
+ addr,
+ COMM_NONBLOCKING,
+ "ident");
if (fd == COMM_ERROR) {
/* Failed to get a local socket */
void
Ident::Init(void)
{
- if(ident_hash) {
+ if (ident_hash) {
debugs(30, DBG_CRITICAL, "WARNING: Ident already initialized.");
return;
}
class IpAddress;
-namespace Ident {
+namespace Ident
+{
/**
\ingroup IdentAPI
{
SetEmpty();
if (s)
- memcpy(this, s, sizeof(IpAddress));
+ memcpy(this, s, sizeof(IpAddress));
}
IpAddress::IpAddress(const struct hostent &s)
#if HAVE_SETSID
if (opt_no_daemon)
- setsid();
+ setsid();
#endif
execvp(prog, (char *const *) args);
if (EBIT_TEST(entry->flags, ENTRY_REVALIDATE) && staleness > -1
#if HTTP_VIOLATIONS
- && !R->flags.ignore_must_revalidate
+ && !R->flags.ignore_must_revalidate
#endif
- ) {
+ ) {
debugs(22, 3, "refreshCheck: YES: Must revalidate stale response");
return STALE_MUST_REVALIDATE;
}
Config.Addrs.snmp_incoming.SetPort(Config.Port.snmp);
enter_suid();
theInSnmpConnection = comm_open_listener(SOCK_DGRAM,
- IPPROTO_UDP,
- Config.Addrs.snmp_incoming,
- COMM_NONBLOCKING,
- "SNMP Port");
+ IPPROTO_UDP,
+ Config.Addrs.snmp_incoming,
+ COMM_NONBLOCKING,
+ "SNMP Port");
leave_suid();
if (theInSnmpConnection < 0)
Config.Addrs.snmp_outgoing.SetPort(Config.Port.snmp);
enter_suid();
theOutSnmpConnection = comm_open_listener(SOCK_DGRAM,
- IPPROTO_UDP,
- Config.Addrs.snmp_outgoing,
- COMM_NONBLOCKING,
- "SNMP Port");
+ IPPROTO_UDP,
+ Config.Addrs.snmp_outgoing,
+ COMM_NONBLOCKING,
+ "SNMP Port");
leave_suid();
if (theOutSnmpConnection < 0)
{
debugs(26, 3, "tunnelWriteServer: FD " << server.fd() << ", " << len << " bytes written");
- if(flag == COMM_ERR_CLOSING)
+ if (flag == COMM_ERR_CLOSING)
return;
/* Error? */
{
debugs(26, 3, "tunnelWriteClient: FD " << client.fd() << ", " << len << " bytes written");
- if(flag == COMM_ERR_CLOSING)
+ if (flag == COMM_ERR_CLOSING)
return;
/* Error? */
LOCAL_ARRAY(char, buf, MAX_URL);
// method CONNECT and port HTTPS
- if(request->method == METHOD_CONNECT && request->port == 443) {
+ if (request->method == METHOD_CONNECT && request->port == 443) {
snprintf(buf, MAX_URL, "https://%s/*", request->GetHost());
return buf;
}
Config.Wccp.address.SetPort(WCCP_PORT);
theWccpConnection = comm_open_listener(SOCK_DGRAM,
- IPPROTO_UDP,
- Config.Wccp.address,
- COMM_NONBLOCKING,
- "WCCP Socket");
+ IPPROTO_UDP,
+ Config.Wccp.address,
+ COMM_NONBLOCKING,
+ "WCCP Socket");
if (theWccpConnection < 0)
fatal("Cannot open WCCP Port");
// uint16_t bits;
//#define WCCP2_HASH_ASSIGNMENT_DATA 0x0
-/* 5.7.2 Hash Assignment Data Element */
+ /* 5.7.2 Hash Assignment Data Element */
char buckets[32]; /* Draft indicates 8x 32-bit buckets but it's just a mask so doesn't matter how we define. */
uint16_t weight;
uint16_t status;
uint16_t bits;
#define WCCP2_MASK_ASSIGNMENT_DATA (0x1 <<14)
-/* Sect 5.7.2 Mask Assignment Data Element
- *
- * NP: draft specifies a variable-length set of keys here.
- * the following fields only matche the special case Squid sends outbound (single-cache).
- */
- uint32_t mask_element_count;
+ /* Sect 5.7.2 Mask Assignment Data Element
+ *
+ * NP: draft specifies a variable-length set of keys here.
+ * the following fields only matche the special case Squid sends outbound (single-cache).
+ */
+ uint32_t mask_element_count;
-/* Sect 5.7.6 Mask/Value Set Element */
-/* special case: single mask element. no values. */
+ /* Sect 5.7.6 Mask/Value Set Element */
+ /* special case: single mask element. no values. */
struct wccp2_mask_element_t mask;
-/* Sect 5.7.2 Mask Assignment Data Element */
+ /* Sect 5.7.2 Mask Assignment Data Element */
uint16_t weight;
uint16_t status;
};
/* capability values */
#define WCCP2_METHOD_GRE 0x00000001
#define WCCP2_METHOD_L2 0x00000002
- /* when type=WCCP2_CAPABILITY_FORWARDING_METHOD */
+/* when type=WCCP2_CAPABILITY_FORWARDING_METHOD */
#define WCCP2_FORWARDING_METHOD_GRE WCCP2_METHOD_GRE
#define WCCP2_FORWARDING_METHOD_L2 WCCP2_METHOD_L2
- /* when type=WCCP2_CAPABILITY_ASSIGNMENT_METHOD */
+/* when type=WCCP2_CAPABILITY_ASSIGNMENT_METHOD */
#define WCCP2_ASSIGNMENT_METHOD_HASH 0x00000001
#define WCCP2_ASSIGNMENT_METHOD_MASK 0x00000002
- /* when type=WCCP2_CAPABILITY_RETURN_METHOD */
+/* when type=WCCP2_CAPABILITY_RETURN_METHOD */
#define WCCP2_PACKET_RETURN_METHOD_GRE WCCP2_METHOD_GRE
#define WCCP2_PACKET_RETURN_METHOD_L2 WCCP2_METHOD_L2
Config.Wccp2.address.SetPort(WCCP_PORT);
theWccp2Connection = comm_open_listener(SOCK_DGRAM,
- 0,
- Config.Wccp2.address,
- COMM_NONBLOCKING,
- "WCCPv2 Socket");
+ 0,
+ Config.Wccp2.address,
+ COMM_NONBLOCKING,
+ "WCCPv2 Socket");
if (theWccp2Connection < 0)
fatal("Cannot open WCCP Port");