#include <strings.h>
#endif
-
/* Define the syntax stuff for \<, \>, etc. */
/* This must be nonzero for the wordchar and notwordchar pattern
* internal error. */
static int re_compile_fastmap(struct re_pattern_buffer * buffer);
-
/* Search in the string STRING (with length LENGTH) for the pattern
* compiled into BUFFER. Start searching at position START, for RANGE
* characters. Return the starting position of the match, -1 for no
static int re_search(struct re_pattern_buffer * buffer, const char *string,
int length, int start, int range, struct re_registers * regs);
-
/* Like `re_search', but search in the concatenation of STRING1 and
* STRING2. Also, stop searching at index START + STOP. */
static int re_search_2(struct re_pattern_buffer * buffer, const char *string1,
int length1, const char *string2, int length2,
int start, int range, struct re_registers * regs, int stop);
-
/* Like `re_search_2', but return how many characters in STRING the regexp
* in BUFFER matched, starting at position START. */
static int re_match_2(struct re_pattern_buffer * buffer, const char *string1,
int length1, const char *string2, int length2,
int start, struct re_registers * regs, int stop);
-
/* isalpha etc. are used for the character classes. */
#include <ctype.h>
#endif /* not REGEX_MALLOC */
-
/* True if `size1' is non-NULL and PTR is pointing anywhere inside
* `string1' or just past its end. This works if PTR is NULL, which is
* a good thing. */
#define DEBUG_PRINT_DOUBLE_STRING(w, s1, sz1, s2, sz2) \
if (debug) print_double_string (w, s1, sz1, s2, sz2)
-
extern void printchar();
/* Print the fastmap in human-readable form. */
putchar('\n');
}
-
/* Print a compiled pattern string in human-readable form, starting at
* the START pointer into it and ending just before the pointer END. */
printf("/\n");
}
-
void
print_compiled_pattern(bufp)
struct re_pattern_buffer *bufp;
/* Perhaps we should print the translate table? */
}
-
void
print_double_string(where, string1, size1, string2, size2)
const char *where;
/* Go backwards one character in the pattern. */
#define PATUNFETCH p--
-
/* If `translate' is non-null, return translate[D], else just D. We
* cast the subscript to translate because some data is declared as
* `char *', to avoid warnings when a string constant is passed. But
* when we use a character as a subscript we must make it unsigned. */
#define TRANSLATE(d) (translate ? translate[(unsigned char) (d)] : (d))
-
/* Macros for outputting the compiled pattern into `buffer'. */
/* If the buffer isn't allocated when it comes in, use this. */
*b++ = (unsigned char) (c); \
} while (0)
-
/* Ensure we have two more bytes of buffer space and then append C1 and C2. */
#define BUF_PUSH_2(c1, c2) \
do { \
*b++ = (unsigned char) (c2); \
} while (0)
-
/* As with BUF_PUSH_2, except for three bytes. */
#define BUF_PUSH_3(c1, c2, c3) \
do { \
*b++ = (unsigned char) (c3); \
} while (0)
-
/* Store a jump with opcode OP at LOC to location TO. We store a
* relative address offset by the three bytes the jump itself occupies. */
#define STORE_JUMP(op, loc, to) \
#define INSERT_JUMP2(op, loc, to, arg) \
insert_op2 (op, loc, (to) - (loc) - 3, arg, b)
-
/* This is not an arbitrary limit: the arguments which represent offsets
* into the pattern are two bytes long. So if 2^16 bytes turns out to
* be too small, many things would have to change. */
#define MAX_BUF_SIZE (1L << 16)
-
/* Extend the buffer by twice its current size via realloc and
* reset the pointers that pointed into the old block to point to the
* correct places in the new one. If extending the buffer results in it
} \
} while (0)
-
/* Since we have one byte reserved for the register number argument to
* {start,stop}_memory, the maximum number of groups we can report
* things about is what fits in that byte. */
* ignore the excess. */
typedef unsigned regnum_t;
-
/* Macros for the compile stack. */
/* Since offsets can go either forwards or backwards, this type needs to
regnum_t regnum;
} compile_stack_elt_t;
-
typedef struct {
compile_stack_elt_t *stack;
unsigned size;
/* The next available element. */
#define COMPILE_STACK_TOP (compile_stack.stack[compile_stack.avail])
-
/* Set the bit for character C in a list. */
#define SET_LIST_BIT(c) \
(b[((unsigned char) (c)) / BYTEWIDTH] \
|= 1 << (((unsigned char) c) % BYTEWIDTH))
-
/* Get the next unsigned number in the uncompiled pattern. */
#define GET_UNSIGNED_NUMBER(num) \
{ if (p != pend) \
}
break;
-
case '$': {
if ( /* If at end of pattern, it's an operator. */
p == pend
}
break;
-
case '+':
case '?':
if ((syntax & RE_BK_PLUS_QM)
}
break;
-
case '.':
laststart = b;
BUF_PUSH(anychar);
break;
-
case '[': {
boolean had_char_class = false;
}
break;
-
case '(':
if (syntax & RE_NO_BK_PARENS)
goto handle_open;
else
goto normal_char;
-
case ')':
if (syntax & RE_NO_BK_PARENS)
goto handle_close;
else
goto normal_char;
-
case '\n':
if (syntax & RE_NEWLINE_ALT)
goto handle_alt;
else
goto normal_char;
-
case '|':
if (syntax & RE_NO_BK_VBAR)
goto handle_alt;
else
goto normal_char;
-
case '{':
if (syntax & RE_INTERVALS && syntax & RE_NO_BK_BRACES)
goto handle_interval;
else
goto normal_char;
-
case '\\':
if (p == pend)
return REG_EESCAPE;
pending_exact = 0;
break;
-
case ')':
if (syntax & RE_NO_BK_PARENS)
goto normal_backslash;
}
break;
-
case '|': /* `\|'. */
if (syntax & RE_LIMITED_OPS || syntax & RE_NO_BK_VBAR)
goto normal_backslash;
begalt = b;
break;
-
case '{':
/* If \{ is a literal. */
if (!(syntax & RE_INTERVALS)
}
goto normal_char;
-
case 'w':
laststart = b;
BUF_PUSH(wordchar);
break;
-
case 'W':
laststart = b;
BUF_PUSH(notwordchar);
break;
-
case '<':
BUF_PUSH(wordbeg);
break;
BUF_PUSH_2(duplicate, c1);
break;
-
case '+':
case '?':
if (syntax & RE_BK_PLUS_QM)
}
break;
-
default:
/* Expects the character in `c'. */
normal_char:
} /* switch (c) */
} /* while p != pend */
-
/* Through the pattern now. */
if (fixup_alt_jump)
STORE_NUMBER(loc + 1, arg);
}
-
/* Like `store_op1', but for two two-byte parameters ARG1 and ARG2. */
void
STORE_NUMBER(loc + 3, arg2);
}
-
/* Copy the bytes from LOC to END to open up three bytes of space at LOC
* for OP followed by two-byte integer parameter ARG. */
store_op1(op, loc, arg);
}
-
/* Like `insert_op1', but for two two-byte parameters ARG1 and ARG2. */
void
store_op2(op, loc, arg1, arg2);
}
-
/* P points to just after a ^ in PATTERN. Return true if that ^ comes
* after an alternative or a begin-subexpression. We assume there is at
* least one character before the ^. */
|| (*prev == '|' && (syntax & RE_NO_BK_VBAR || prev_prev_backslash));
}
-
/* The dual of at_begline_loc_p. This one is for $. We assume there is
* at least one character after the $, i.e., `P < PEND'. */
: next_backslash && next_next && *next_next == '|');
}
-
/* Returns true if REGNUM is in one of COMPILE_STACK's elements and
* false if it's not. */
return false;
}
-
/* Read the ending character of a range (in a bracket expression) from the
* uncompiled pattern *P_PTR (which ends at PEND). We assume the
* starting character is in `P[-2]'. (`P[-1]' is the character `-'.)
* re_match_2 use a failure stack. These have to be macros because of
* REGEX_ALLOCATE. */
-
/* Number of failure points for which to initially allocate space
* when matching. If this number is exceeded, we allocate more
* space, so it is not a hard limit. */
#define FAIL_STACK_FULL() (fail_stack.avail == fail_stack.size)
#define FAIL_STACK_TOP() (fail_stack.stack[fail_stack.avail])
-
/* Initialize `fail_stack'. Do `return -2' if the alloc fails. */
#define INIT_FAIL_STACK() \
fail_stack.avail = 0; \
} while (0)
-
/* Double the size of FAIL_STACK, up to approximately `re_max_failures' items.
*
* Return 1 if succeeds, and 0 if either ran out of memory
: ((fail_stack).size <<= 1, \
1)))
-
/* Push PATTERN_OP on FAIL_STACK.
*
* Return 1 if was able to do so and 0 if ran out of memory allocating
#define DEBUG_POP(item_addr)
#endif
-
/* Push the information about the state we will need
* if we ever fail back to it.
*
/* How many items can still be added to the stack without overflowing it. */
#define REMAINING_AVAIL_SLOTS ((fail_stack).size - (fail_stack).avail)
-
/* Pops what PUSH_FAIL_STACK pushes.
*
* We restore into the parameters, all of which should be lvalues:
bufp->can_be_null = 1;
return 0;
-
/* Following are the cases which match a character. These end
* with `break'. */
fastmap[p[1]] = 1;
break;
-
case charset:
for (j = *p++ * BYTEWIDTH - 1; j >= 0; j--)
if (p[j / BYTEWIDTH] & (1 << (j % BYTEWIDTH)))
fastmap[j] = 1;
break;
-
case charset_not:
/* Chars beyond end of map must be allowed. */
for (j = *p * BYTEWIDTH; j < (1 << BYTEWIDTH); j++)
fastmap[j] = 1;
break;
-
case wordchar:
for (j = 0; j < (1 << BYTEWIDTH); j++)
if (SYNTAX(j) == Sword)
fastmap[j] = 1;
break;
-
case notwordchar:
for (j = 0; j < (1 << BYTEWIDTH); j++)
if (SYNTAX(j) != Sword)
fastmap[j] = 1;
break;
-
case anychar:
/* `.' matches anything ... */
for (j = 0; j < (1 << BYTEWIDTH); j++)
/* Otherwise, have to check alternative paths. */
break;
-
case no_op:
case begline:
case endline:
case push_dummy_failure:
continue;
-
case jump_n:
case pop_failure_jump:
case maybe_pop_jump:
continue;
-
case on_failure_jump:
case on_failure_keep_string_jump:
handle_on_failure_jump:
}
continue;
-
case succeed_n:
/* Get to the number of times to succeed. */
p += 2;
}
continue;
-
case set_number_at:
p += 4;
continue;
-
case start_memory:
case stop_memory:
p += 2;
continue;
-
default:
abort(); /* We have listed all the cases. */
} /* switch *p++ */
regs, size);
}
-
/* Using the compiled pattern in BUFP->buffer, first tries to match the
* virtual concatenation of STRING1 and STRING2, starting first at index
* STARTPOS, then at STARTPOS + 1, and so on.
#define MATCHED_SOMETHING(R) ((R).bits.matched_something)
#define EVER_MATCHED_SOMETHING(R) ((R).bits.ever_matched_something)
-
/* Call this when have matched a real character; it sets `matched' flags
* for the subexpressions which we are currently inside. Also records
* that those subexprs have matched. */
} \
while (0)
-
/* This converts PTR, a pointer into one of the search strings `string1'
* and `string2' into an offset from the beginning of that string. */
#define POINTER_TO_OFFSET(ptr) \
#define REG_UNSET_VALUE ((char *) -1)
#define REG_UNSET(e) ((e) == REG_UNSET_VALUE)
-
/* Macros for dealing with the split strings in re_match_2. */
#define MATCHING_IN_FIRST_STRING (dend == end_match_1)
dend = end_match_2; \
}
-
/* Test if at very beginning or at very end of the virtual concatenation
* of `string1' and `string2'. If only one string, it's `string2'. */
#define AT_STRINGS_BEG(d) ((d) == (size1 ? string1 : string2) || !size2)
#define AT_STRINGS_END(d) ((d) == end2)
-
/* Test if D points to a character which is word-constituent. We have
* two special cases to check for: if past the end of string1, look at
* the first character in string2; and if before the beginning of
(AT_STRINGS_BEG (d) || AT_STRINGS_END (d) \
|| WORDCHAR_P (d - 1) != WORDCHAR_P (d))
-
/* Free everything we malloc. */
#ifdef REGEX_MALLOC
#define FREE_VAR(var) if (var) free (var); var = NULL
#define FREE_VARIABLES() alloca (0)
#endif /* not REGEX_MALLOC */
-
/* These values must meet several constraints. They must not be valid
* register values; since we have a limit of 255 registers (because
* we use only one byte in the pattern for the register number), we can
DEBUG_PRINT1("EXECUTING no_op.\n");
break;
-
/* Match the next n pattern characters exactly. The following
* byte in the pattern defines n, and the n bytes after that
* are the characters to match. */
SET_REGS_MATCHED();
break;
-
/* Match any character except possibly a newline or a null. */
case anychar:
DEBUG_PRINT1("EXECUTING anychar.\n");
d++;
break;
-
case charset:
case charset_not: {
register unsigned char c;
break;
}
-
/* The beginning of a group is represented by start_memory.
* The arguments are the register number in the next byte, and the
* number of groups inner to this one in the next. The text
p += 2;
break;
-
/* The stop_memory opcode represents the end of a group. Its
* arguments are the same as start_memory's: the register
* number, and the number of inner groups. */
p += 2;
break;
-
/* \<digit> has been turned into a `duplicate' command which is
* followed by the numeric value of <digit> as the register number. */
case duplicate: {
}
break;
-
/* begline matches the empty string at the beginning of the string
* (unless `not_bol' is set in `bufp'), and, if
* `newline_anchor' is set, after newlines. */
/* In all other cases, we fail. */
goto fail;
-
/* endline is the dual of begline. */
case endline:
DEBUG_PRINT1("EXECUTING endline.\n");
}
goto fail;
-
/* Match at the very beginning of the data. */
case begbuf:
DEBUG_PRINT1("EXECUTING begbuf.\n");
break;
goto fail;
-
/* Match at the very end of the data. */
case endbuf:
DEBUG_PRINT1("EXECUTING endbuf.\n");
break;
goto fail;
-
/* on_failure_keep_string_jump is used to optimize `.*\n'. It
* pushes NULL as the value for the string on the stack. Then
* `pop_failure_point' will keep the current value for the
PUSH_FAILURE_POINT(p + mcnt, NULL, -2);
break;
-
/* Uses of on_failure_jump:
*
* Each alternative starts with an on_failure_jump that points
PUSH_FAILURE_POINT(p + mcnt, d, -2);
break;
-
/* A smart repeat ends with `maybe_pop_jump'.
* We change it to either `pop_failure_jump' or `jump'. */
case maybe_pop_jump:
}
/* Note fall through. */
-
/* The end of a simple repeat has a pop_failure_jump back to
* its matching on_failure_jump, where the latter will push a
* failure point. The pop_failure_jump takes off failure
}
/* Note fall through. */
-
/* Unconditionally jump (without popping any failure points). */
case jump:
unconditional_jump:
DEBUG_PRINT2("(to 0x%x).\n", p);
break;
-
/* We need this opcode so we can detect where alternatives end
* in `group_match_null_string_p' et al. */
case jump_past_alt:
DEBUG_PRINT1("EXECUTING jump_past_alt.\n");
goto unconditional_jump;
-
/* Normally, the on_failure_jump pushes a failure point, which
* then gets popped at pop_failure_jump. We will end up at
* pop_failure_jump, also, and with a pattern of, say, `a+', we
PUSH_FAILURE_POINT(0, 0, -2);
goto unconditional_jump;
-
/* At the end of an alternative, we need to push a dummy failure
* point in case we are followed by a `pop_failure_jump', because
* we don't want the failure point for the alternative to be
}
continue; /* Successfully executed one pattern command; keep going. */
-
/* We goto here if a matching operation fails. */
fail:
if (!FAIL_STACK_EMPTY()) { /* A restart point is known. Restore to that state. */
* So, we have to first go through the first (n-1)
* alternatives and then deal with the last one separately. */
-
/* Deal with the first (n-1) alternatives, which start
* with an on_failure_jump (see above) that jumps to right
* past a jump_past_alt. */
} /* if mcnt > 0 */
break;
-
case stop_memory:
assert(p1[1] == **p);
*p = p1 + 2;
return true;
-
default:
if (!common_op_match_null_string_p(&p1, end, reg_info))
return false;
return false;
} /* group_match_null_string_p */
-
/* Similar to group_match_null_string_p, but doesn't deal with alternatives:
* It expects P to be the first byte of a single alternative and END one
* byte past the last. The alternative can contain groups. */
return true;
} /* alt_match_null_string_p */
-
/* Deals with the ops common to group_match_null_string_p and
* alt_match_null_string_p.
*
return true;
} /* common_op_match_null_string_p */
-
/* Return zero if TRANSLATE[S1] and TRANSLATE[S2] are identical for LEN
* bytes; nonzero otherwise. */
\f
/* Entry points for GNU code. */
-\f
/* POSIX.2 functions */
/* regcomp takes a regular expression as a string and compiles it.
return (int) ret;
}
-
/* regexec searches for a given pattern, specified by PREG, in the
* string STRING.
*
return ret >= 0 ? (int) REG_NOERROR : (int) REG_NOMATCH;
}
-
/* Returns a message corresponding to an error code, ERRCODE, returned
* from either regcomp or regexec. We don't use PREG here. */
return msg_size;
}
-
/* Free dynamically allocated space used by PREG. */
void
#include <regex.h>
#endif
-
#else /* USE_GNUREGEX */
#ifdef __cplusplus
* If not set, then an unmatched ) is invalid. */
#define RE_UNMATCHED_RIGHT_PAREN_ORD (RE_NO_EMPTY_RANGES << 1)
- \f
/* Define combinations of the above bits for the standard possibilities.
* (The [[[ comments delimit what gets put into the Texinfo file, so
* don't delete them!) */
#endif
#define RE_DUP_MAX ((1 << 15) - 1)
-
/* POSIX `cflags' bits (i.e., information for `regcomp'). */
/* If this bit is set, then use extended regular expression syntax.
* If not set, then returns differ between not matching and errors. */
#define REG_NOSUB (REG_NEWLINE << 1)
-
/* POSIX `eflags' bits (i.e., information for regexec). */
/* If this bit is set, then the beginning-of-line operator doesn't match
/* Like REG_NOTBOL, except for the end-of-line. */
#define REG_NOTEOL (1 << 1)
-
/* If any error codes are removed, changed, or added, update the
* `re_error_msg' table in regex.c. */
typedef enum {
typedef struct re_pattern_buffer regex_t;
-
/* search.c (search_buffer) in Emacs needs this one opcode value. It is
* defined both in `regex.c' and here. */
#define RE_EXACTN_VALUE 1
/* Type for byte offsets within the string. POSIX mandates this. */
typedef int regoff_t;
-
/* This is the structure we store register match data in. See
* regex.texinfo for a full description of what registers match. */
struct re_registers {
regoff_t *end;
};
-
/* If `regs_allocated' is REGS_UNALLOCATED in the pattern buffer,
* `re_match_2' returns information about at least this many registers
* the first time a `regs' structure is passed. */
#define RE_NREGS 30
#endif
-
/* POSIX specification for registers. Aside from the different names than
* `re_registers', POSIX uses an array of structures, instead of a
* structure of arrays. */
int msg_flags; /* Flags on received message. */
};
-
struct iovec {
void *iov_base;
size_t iov_len;
# define SUN_LEN(ptr) ((size_t) (((struct sockaddr_un *) 0)->sun_path) \
+ strlen ((ptr)->sun_path))
-
#endif /* CMSG_SPACE */
#ifndef SCM_RIGHTS
* squid.h at the top line of your .cc file.
*/
-
/******************************************************/
/* Define the _SQUID_TYPE_ based on a guess of the OS */
/* NP: this MUST come first within compat.h */
#endif
#endif
-
-
/*****************************************************/
/* FDSETSIZE is messy and needs to be done before */
/* sys/types.h are defined. */
/*****************************************************/
#include "compat/fdsetsize.h"
-
/*****************************************************/
/* Global type re-definitions */
/* this also takes care of the basic system includes */
#include "compat/os/sunos.h"
#include "compat/os/windows.h"
-
/*****************************************************/
/* portabilities shared between all platforms and */
/* components as found to be needed */
/* cstdio has a bunch of problems with 64-bit definitions */
#include "compat/stdio.h"
-
/*****************************************************/
/* component-specific portabilities */
/*****************************************************/
# error Unknown select loop model!
#endif
-
-
#if !HAVE_STRUCT_RUSAGE
/**
* If we don't have getrusage() then we create a fake structure
};
#endif /* !HAVE_STRUCT_RUSAGE */
-
#ifndef min
#ifdef __cplusplus
/**
*/
#define w_space " \t\n\r"
-
#ifndef SQUID_NONBLOCK
/* REQUIRED for the below logics. If they move this needs to as well */
#if HAVE_FCNTL_H
#define SA_RESETHAND SA_ONESHOT
#endif
-
/**
* com_err.h is a C header and needs explicit shielding, but not
* all other system headers including this care to do so.
private: /* dummy typedef so that the macro can still end with ';'*/ \
typedef int CppUnitDummyTypedefForSemiColonEnding__
-
#endif /* HAVE_UNIQUE_PTR */
#endif /* HAVE_CPPUNIT_EXTENSIONS_HELPERMACROS_H */
#endif /* SQUID_COMPAT_CPPUNIT_H */
/* the macro overload style is really a gcc-ism */
#ifdef __GNUC__
-
#define debug(X...) \
if (debug_enabled) { \
fprintf(stderr, "%s(%d): pid=%ld :", __FILE__, __LINE__, (long)getpid() ); \
void debug(const char *format,...);
#endif
-
#endif /* COMPAT_DEBUG_H */
#define FD_SETSIZE SQUID_MAXFD
#endif
-
/*
* Trap unintentional use of fd_set. Must not be used outside the
* select code as it only supports FD_SETSIZE number of filedescriptors
int flags );
#define getnameinfo xgetnameinfo
-
#endif /* HAVE_GETNAMEINFO */
#endif /* _getnameinfo_h */
*--------------------------------------------------------------------------*
****************************************************************************/
-
/*
* Syslog facility on AIX requires some portability wrappers
*/
#define _XOPEN_SOURCE_EXTENDED 1
#endif
-
#endif /* _SQUID_AIX_ */
#endif /* SQUID_OS_AIX_H */
*--------------------------------------------------------------------------*
****************************************************************************/
-
#if USE_ASYNC_IO && defined(LINUXTHREADS)
#define _SQUID_LINUX_THREADS_
#endif
//#define s6_addr16 __u6_addr.__u6_addr16
#define s6_addr32 __u6_addr.__u6_addr32
-
#endif /* _SQUID_FREEBSD_ */
#endif /* SQUID_OS_FREEBSD_H */
*--------------------------------------------------------------------------*
****************************************************************************/
-
#if !defined(HAVE_GETPAGESIZE)
#define HAVE_GETPAGESIZE
#define getpagesize( ) sysconf(_SC_PAGE_SIZE)
*--------------------------------------------------------------------------*
****************************************************************************/
-
#if USE_ASYNC_IO
#define _SQUID_LINUX_THREADS_
#endif
#define HAVE_RES_INIT HAVE___RES_INIT
#endif
-
/*
* sys/capability.h is only needed in Linux apparently.
*
*--------------------------------------------------------------------------*
****************************************************************************/
-
/*
* Don't allow inclusion of malloc.h
*/
#define h_addr h_addr_list[0] /* address, for backward compatiblity */
};
-
/*
* addrinfo introduced with IPv6 for Protocol-Independent Hostname
* and Service Name Translation.
struct addrinfo *ai_next; /* next structure in linked list */
};
-
/* addrinfo flags */
#define AI_PASSIVE 0x0008 /* intended for bind() + listen() */
#define AI_CANONNAME 0x0010 /* return canonical version of host */
#define AI_ALL 0x0002 /* IPv6 and IPv4 mapped addresses */
#define AI_ADDRCONFIG 0x0004 /* AAAA or A records only if IPv6/IPv4 cnfg'd */
-
/*
* These were defined in RFC 2553 but not SUSv3
* or RFC 3493 which obsoleted 2553.
*/
#define SCOPE_DELIMITER '%'
-
/*
* Algorithm entry for /etc/inet/ipsecalgs which defines IPsec protocols
* and algorithms.
* need to be overridden.
*/
-
#endif /* _SQUID_OS2_ */
#endif /* SQUID_OS_OS2_H */
*/
#include <unix.h>
-
#endif /* _SQUID_QNX_ */
#endif /* SQUID_OS_QNX_H */
#ifndef SQUID_OS_SOLARIS_H
#define SQUID_OS_SOLARIS_H
-
#if _SQUID_SOLARIS_
/*
*--------------------------------------------------------------------------*
****************************************************************************/
-
/* O_NONBLOCK requires <fcntl.h> to be included first */
#if HAVE_FCNTL_H
#include <fcntl.h>
*/
#define SQUID_NONBLOCK O_NDELAY
-
-
#endif /* _SQUID_SUNOS_ */
#endif /* SQUID_OS_SUNOS_H */
#ifndef SQUID_COMPAT_OSDETECT_H
#define SQUID_COMPAT_OSDETECT_H
-
/****************************************************************************
*--------------------------------------------------------------------------*
* DO *NOT* MAKE ANY CHANGES below here unless you know what you're doing...*
#endif /* OS automatic detection */
-
-
#endif /* SQUID_COMPAT_OSDETECT_H */
#include <sys/sysctl.h>
#endif
-
/*
* Some systems have filesystem-based resources and interpret segment names
* as file paths. The so-called 'portable' "/name" format does not work well
#endif /* HAVE_SHM */
-
/// Determines whether segment names are iterpreted as full file paths.
bool shm_portable_segment_name_is_path();
#include <errno.h>
#endif
-
#ifndef INT64_MIN
/* Native 64 bit system without strtoll() */
#if defined(LONG_MIN) && (SIZEOF_LONG == 8)
#endif
#endif
-
/*
* Convert a string to a int64 integer.
*
#endif
#endif
-
static char *
_tmpnam(void)
{
#include <netinet/in_systm.h>
#endif
-
/******************************************************/
/* Typedefs for missing entries on a system */
/******************************************************/
-
/*
* ISO C99 Standard printf() macros for 64 bit integers
* On some 64 bit platform, HP Tru64 is one, for printf must be used
#endif
#define strndup(X) xstrndup((X))
-
#ifdef __cplusplus
}
#endif
#define SIVALS(buf,pos,val) IVALS(buf,pos)=((int32)(val))
#endif
-
/* now the reverse routines - these are used in nmb packets (mostly) */
#define SREV(x) ((((x)&0xFF)<<8) | (((x)>>8)&0xFF))
#define IREV(x) ((SREV(x)<<16) | (SREV((x)>>16)))
Check_forfilechange(&DenyUsers);
}
-
/*
* Check to see if the username provided by Squid appears in the denied
* user list. Returns 0 if the user was not found, and 1 if they were.
-
typedef struct {
char *path;
char **names;
time_t LMT;
} usersfile;
-
-
int Read_usersfile(const char *path, usersfile * uf);
int Check_userlist(usersfile * uf, char *User);
void Check_forfilechange(usersfile * uf);
return 0;
}
-
/*
* Generate a random vector.
*/
#define AUTH_PASS_LEN 16
#define AUTH_STRING_LEN 128 /* maximum of 254 */
-
typedef struct pw_auth_hdr {
u_char code;
u_char id;
#define PW_TYPE_IPADDR 2
#define PW_TYPE_DATE 3
-
#define PW_AUTHENTICATION_REQUEST 1
#define PW_AUTHENTICATION_ACK 2
#define PW_AUTHENTICATION_REJECT 3
#include <string.h>
#endif
-
#define NMB_UNICAST 1
#define NMB_BROADCAST 2
#define PROGRAM_NAME "digest_ldap_auth"
-
static void
GetHHA1(RequestData * requestData)
{
return NULL;
}
-
-
static void
ldapconnect(void)
{
const char * utf8Pwd2Ptr = NULL;
int utf8Pwd2Size = 0;
-
/* Convert objectDN and tag strings from Unicode to UTF-8 */
utf8ObjSize = strlen(objectDN)+1;
utf8ObjPtr = objectDN;
return err;
}
-
/**********************************************************************
Attempts to get the Universal Password
**********************************************************************/
return NULL;
}
-
-
static void
ldapconnect(void)
{
wchar_t *My_NameTranslate(wchar_t *, int, int);
char *Get_WIN32_ErrorMessage(HRESULT);
-
void
CloseCOM(void)
{
CoUninitialize();
}
-
HRESULT
GetLPBYTEtoOctetString(VARIANT * pVar, LPBYTE * ppByte)
{
return hr;
}
-
wchar_t *
Get_primaryGroup(IADs * pUser)
{
return result;
}
-
char *
Get_WIN32_ErrorMessage(HRESULT hr)
{
return WIN32_ErrorMessage;
}
-
wchar_t *
My_NameTranslate(wchar_t * name, int in_format, int out_format)
{
return wc;
}
-
wchar_t *
GetLDAPPath(wchar_t * Base_DN, int query_mode)
{
return wc;
}
-
char *
GetDomainName(void)
{
return DomainName;
}
-
int
add_User_Group(wchar_t * Group)
{
return 1;
}
-
/* returns 0 on match, -1 if no match */
static int
wccmparray(const wchar_t * str, const wchar_t ** array)
return -1;
}
-
/* returns 0 on match, -1 if no match */
static int
wcstrcmparray(const wchar_t * str, const char **array)
return -1;
}
-
HRESULT
Recursive_Memberof(IADs * pObj)
{
return hr;
}
-
static wchar_t **
build_groups_DN_array(const char **array, char *userdomain)
{
return wc_array;
}
-
/* returns 1 on success, 0 on failure */
int
Valid_Local_Groups(char *UserName, const char **Groups)
return result;
}
-
/* returns 1 on success, 0 on failure */
int
Valid_Global_Groups(char *UserName, const char **Groups)
return;
}
-
int
main(int argc, char *argv[])
{
atexit(CloseCOM);
-
/* Main Loop */
while (fgets(buf, HELPER_INPUT_BUFFER, stdin)) {
if (NULL == strchr(buf, '\n')) {
}
}
-
int
readSecret(const char *filename)
{
#include "helpers/defines.h"
#include "include/util.h"
-
#if _SQUID_CYGWIN_
#include <wchar.h>
int _wcsicmp(const wchar_t *, const wchar_t *);
#include <lm.h>
#include <ntsecapi.h>
-
int use_global = 0;
int use_PDC_only = 0;
char *program_name;
char *DefaultDomain = NULL;
const char NTV_VALID_DOMAIN_SEPARATOR[] = "\\/";
-
char *
AllocStrFromLSAStr(LSA_UNICODE_STRING LsaStr)
{
return target;
}
-
char *
GetDomainName(void)
{
return result;
}
-
/* returns 1 on success, 0 on failure */
int
Valid_Global_Groups(char *UserName, const char **Groups)
MultiByteToWideChar(CP_ACP, 0, machinedomain,
strlen(machinedomain) + 1, wszLocalDomain, sizeof(wszLocalDomain) / sizeof(wszLocalDomain[0]));
-
/* Call the NetServerGetInfo function for local computer, specifying level 101. */
dwLevel = 101;
nStatus = NetServerGetInfo(NULL, dwLevel, (LPBYTE *) & pSrvBuf);
return;
}
-
int
main(int argc, char *argv[])
{
#include <grp.h>
#endif
-
struct ip_user_dict {
unsigned long address; // IP address (assumes IPv4)
unsigned long netmask; // IP netmask
/* the macro overload style is really a gcc-ism */
#ifdef __GNUC__
-
#define log(X...) \
if (log_enabled) { \
fprintf(stderr, "%s(%d): pid=%ld :", __FILE__, __LINE__, (long)getpid() ); \
void warn(char *format,...);
#endif
-
struct hstruct {
char *host;
int port;
char *pw;
};
-
void init_args(struct main_args *margs);
void clean_args(struct main_args *margs);
const char *LogTime(void);
return NULL;
}
-
if (n == a - 1) {
debug((char *) "%s| %s: WARNING: Invalid Hex UTF-8 string %s\n", LogTime(), PROGRAM, up);
if (ul)
return ul;
}
-
int
create_gd(struct main_args *margs)
{
char *p;
char *ldap_filter_esc = NULL;
-
searchtime.tv_sec = SEARCH_TIMEOUT;
searchtime.tv_usec = 0;
/*
struct gdstruct *gr;
int found = 0;
-
/* Check users domain */
gr = margs->groups;
hp[i].host = NULL;
}
-
if (hp)
xfree(hp);
hp = NULL;
void lutil_sasl_freedefs(
void *defaults);
-
/*
* SASL definitions for openldap support
*/
-
typedef struct lutil_sasl_defaults_s {
char *mech;
char *realm;
*secs = (long)(periodLength * value);
}
-
/** This function parses the time quota file and stores it
* in memory.
*/
"-s Strip NT domain from usernames\n");
}
-
int
main(int argc, char *argv[])
{
return (0);
}
-
-
int
main(int argc, char *const argv[])
{
GSS_C_NO_CHANNEL_BINDINGS,
&client_name, NULL, &output_token, &ret_flags, NULL, NULL);
-
if (output_token.length) {
spnegoToken = (const unsigned char *) output_token.value;
spnegoTokenLength = output_token.length;
return 1;
}
-
if (( fpid = vfork()) < 0 ) {
fprintf(stderr, "%s| %s: Failed first fork\n", LogTime(), PROGRAM);
return 1;
setbuf(FDNIN, NULL);
setbuf(FDNOUT, NULL);
-
while (1) {
if (fgets(buf, sizeof(buf) - 1, stdin) == NULL) {
if (ferror(stdin)) {
return result;
}
-
char * AllocStrFromLSAStr(LSA_UNICODE_STRING LsaStr)
{
size_t len;
return target;
}
-
char * GetDomainName(void)
{
my_program_name);
}
-
void
process_options(int argc, char *argv[])
{
#include <time.h>
#endif
-
/************* CONFIGURATION ***************/
#define DEAD_DC_RETRY_INTERVAL 30
const char * obtain_challenge(void);
void manage_request(void);
-
#define ENCODED_PASS_LEN 24
#define MAX_USERNAME_LEN 255
#define MAX_DOMAIN_LEN 255
dc *current_dc;
char smb_error_buffer[1000];
-
/* Disconnects from the DC. A reconnection will be done upon the next request
*/
void
smberr = SMB_Get_Last_Error();
SMB_Get_Error_Msg(smberr, errstr, 1000);
-
if (handle == NULL) { /* couldn't connect */
debug("Couldn't connect to SMB Server. Error:%s\n", errstr);
return 1;
memcpy(user, tmp.str, tmp.l);
*(user + tmp.l) = '\0';
-
/* Authenticating against the NT response doesn't seem to work... */
tmp = ntlm_fetch_string(&(auth->hdr), auth_length, &auth->lmresponse, auth->flags);
if (tmp.str == NULL || tmp.l == 0) {
/* TODO: check against empty password!!!!! */
-
debug("checking domain: '%s', user: '%s', pass='%s'\n", domain, user, pass);
rv = SMB_Logon_Server(handle, user, pass, domain, 1);
return NULL;
}
-
void
manage_request()
{
return;
/********* END ********/
-
}
int
return last;
}
-
template <class C>
bool
CbDataList<C>::find (C const &toFind) const
MemMeter inuse;
MemMeter idle;
-
/** history Allocations */
mgb_t gb_allocated;
mgb_t gb_oallocated;
{
}
-
#endif /* _MEM_POOL_H_ */
Stack<void *> freelist;
};
-
#endif /* _MEM_POOL_MALLOC_H_ */
xfree(address);
}
-
#endif /* __SUNPRO_CC */
#endif /* SQUID_NEW_H */
/// \return number of bytes filled in result.
extern int base64_decode(char *result, unsigned int result_max_size, const char *encoded);
-
// Encoding functions
/// Calculate the buffer size required to hold the encoded form of
// Ensures a nul-terminated result. Will always return non-NULL.
extern const char *old_base64_encode(const char *decoded);
-
#ifdef __cplusplus
}
#endif
#define LEN_CONF LEN_SQ_CONF + 1
#define LEN_CONF_INST LEN_SQ_CONF + 2
-
/**
* cacheStorageConfig group { cacheConfig 5 }
*/
PERF_END
};
-
/* cacheSysPerf */
enum {
PERF_SYS_START = 0,
typedef double heap_key;
typedef heap_key heap_key_func(heap_t, heap_key);
-
/*
* Heap node. Has a key value generated by a key_func, id (array index) so
* it can be quickly found in its heap, and a pointer to a data object that
heap_t data;
} heap_node;
-
/*
* Heap object. Holds an array of heap_node objects along with a heap size
* (array length), the index of the last heap element, and a key generation
#define heap_gen_key(hp,md) ((hp)->gen_key((md),(hp)->age))
#endif /* MACRO_DEBUG */
-
/*
* Extract the minimum (root) element and maintain the heap property.
* Returns the data pointed to by the root node, which the caller must
struct squid_radix_node rnh_nodes[3]; /* empty tree for common case */
};
-
SQUIDCEXTERN void squid_rn_init (void);
SQUIDCEXTERN int squid_rn_inithead(struct squid_radix_node_head **, int);
#define RFC1035_TYPE_PTR 12
#define RFC1035_CLASS_IN 1
-
/* Child Library RFC3596 Depends on some otherwise internal functions */
SQUIDCEXTERN int rfc1035HeaderPack(char *buf,
size_t sz,
* Suitable for safely encoding an absolute URL which may be encoded but is not trusted. */
#define rfc1738_escape_unescaped(x) rfc1738_do_escape(x, RFC1738_ESCAPE_UNSAFE|RFC1738_ESCAPE_CTRLS|RFC1738_ESCAPE_NOPERCENT)
-
/**
* Unescape a URL string according to RFC 1738 specification.
* String is unescaped in-place
* to prevent squid knowing the users password (idea suggested in RFC 2617).
*/
-
/*
* $Id$
*
SQUIDCEXTERN int rfc2671RROptPack(char *buf, size_t sz, ssize_t edns_sz);
-
#endif /* SQUID_RFC3596_H */
* snmp_api.h - API for access to snmp.
*/
-
-
/*
* Set fields in session and pdu to the following to get a default or unconfigured value.
*/
*/
int snmp_close(struct snmp_session *);
-
/*
* int snmp_send(session, pdu)
* struct snmp_session *session;
*/
void snmp_read(fd_set *);
-
/*
* int snmp_select_info(numfds, fdset, timeout, block)
* int *numfds;
*/
void snmp_timeout(void);
-
/*
* This routine must be supplied by the application:
*
* Operations are defined below:
*/
-
-
-
-
void snmp_api_stats(void *);
#endif
#ifdef __cplusplus
/* call a function at regular intervals (in seconds): */
extern void snmp_alarm(int ival, void (*handler) (void));
-
/* service for filedescriptors: */
extern void fd_add(int fd, void (*func) (int fd));
extern void fd_service(void);
-
/* ---------------------------------------------------------------------- */
/*
* Copyright (c) 1997 FT/CNET/DES/GRL Olivier Montanuy
*/
-
/* Function to safely copy a string, and ensure the last
* character is always '\0'. */
void strcpy_safe(char *str, int str_len, char *val);
#define SMI_OPAQUE (ASN_APPLICATION | 4) /* OCTET STRING */
#define SMI_COUNTER64 (ASN_APPLICATION | 6) /* INTEGER */
-
/* constants for enums for the MIB nodes
* cachePeerAddressType (InetAddressType / ASN_INTEGER)
* cacheClientAddressType (InetAddressType / ASN_INTEGER)
#endif /* INETADDRESSTYPE_ENUMS */
-
/*
* RFC 1905: Protocol Operations for SNMPv2
*
size_t elements;
};
-
SQUIDCEXTERN int splayLastResult;
SQUIDCEXTERN splayNode *splay_insert(void *, splayNode *, splayNode::SPLAYCMP *);
* we do not need such an interface yet.
*/
-
#include "squid.h"
#include "Array.h"
*
*/
-
#include "squid.h"
#if HAVE_ASSERT_H
#include <assert.h>
#include <stdlib.h>
#endif
-
static void base64_init(void);
static int base64_initialized = 0;
int base64_value[BASE64_VALUE_SZ];
const char base64_code[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
-
static void
base64_init(void)
{
#define SUFFIX ("*")
#define SLASH ("\\")
-
/*
* opendir
*
return nd;
}
-
/*
* readdir
*
return (struct dirent *) 0;
}
-
/*
* closedir
*
static char schluessel[16][KS];
-
static char PC1[] = {
56, 48, 40, 32, 24, 16, 8, 0,
57, 49, 41, 33, 25, 17, 9, 1,
27, 19, 11, 3
};
-
static char PC2[] = {
13, 16, 10, 23, 0, 4, 2, 27,
14, 5, 20, 9, 22, 18, 11, 3,
33, 52, 45, 41, 49, 35, 28, 31
};
-
static char IP[] = {
57, 49, 41, 33, 25, 17, 9, 1,
59, 51, 43, 35, 27, 19, 11, 3,
62, 54, 46, 38, 30, 22, 14, 6
};
-
static char EP[] = {
7, 39, 15, 47, 23, 55, 31, 63,
6, 38, 14, 46, 22, 54, 30, 62,
0, 32, 8, 40, 16, 48, 24, 56
};
-
static char E0[] = {
31, 0, 1, 2, 3, 4, 3, 4,
5, 6, 7, 8, 7, 8, 9, 10,
27, 28, 27, 28, 29, 30, 31, 0
};
-
static char E[KS];
-
static char PERM[] = {
15, 6, 19, 20, 28, 11, 27, 16,
0, 14, 22, 25, 4, 17, 30, 9,
18, 12, 29, 5, 21, 10, 3, 24
};
-
static char S_BOX[][64] = {
{
14, 0, 4, 15, 13, 7, 1, 4, 2, 14, 15, 2, 11, 13, 8, 1,
#include "squid.h"
#include "getfullhostname.h"
-
#if HAVE_UNISTD_H
/* for gethostname() function */
#include <unistd.h>
return (const char *) hl->key;
}
-
#if USE_HASH_DRIVER
/**
* hash-driver - Run with a big file as stdin to insert each line into the
}
printf("done walking hash table...\n");
-
printf("driver finished.\n");
exit(0);
}
return hp;
}
-
/*
* Free memory used by a heap. Does not free the metadata pointed to by the
* heap nodes, only the heap's internal memory.
return elm;
}
-
/*
* Delete ELM while maintaining the heap property. ELM may be modified.
* Assumes that ELM is not NULL and frees it. Returns the data pointed to
}
#endif /* heap_gen_key */
-
/*
* Returns the data of the node with the largest KEY value and removes that
* node from the heap. Returns NULL if the heap was empty.
return data;
}
-
/*
* Remove the last node in HP. Frees the heap internal structure and
* returns the data pointes to by the last node.
return data;
}
-
/*
* The semantics of this routine is the same as the followings:
* heap_delete(hp, elm);
return old;
}
-
/*
* A pointer to the root node's DATA.
*/
return hp->nodes[0]->data;
}
-
/*
* The KEY of the root node.
*/
return hp->nodes[0]->key;
}
-
/*
* Same as heap_peep except that this return the KEY of the node.
* Only meant for iteration.
return hp->nodes[n]->key;
}
-
/*
* A pointer to Nth node's DATA. The caller can iterate through HP by
* calling this routine. eg. Caller can execute the following code:
return data;
}
-
#ifndef heap_nodes
/*
* Current number of nodes in HP.
}
#endif /* heap_nodes */
-
#ifndef heap_empty
/*
* Determine if the heap is empty. Returns 1 if HP has no elements and 0
}
}
-
/*
* Maintain the heap property above ELM. Caller has locked the heap.
*/
}
}
-
/*
* Swap the position of ELM1 and ELM2 in heap structure. Their IDs are also
* swapped.
hp->nodes[elm2->id] = elm2;
}
-
-
#ifdef NOTDEF
/*
* Copy KEY and DATA fields of SRC to DEST. ID field is NOT copied.
#endif /* NOTDEF */
-
/*
* True if HP needs to be grown in size.
*/
return 0;
}
-
/*
* Grow HP.
*/
hp->size = newSize;
}
-
/*
* True if a node with ID exists in HP.
*/
#include <time.h>
#endif
-
#define ASCII_DIGIT(c) ((c)-48)
time_t
(*payload_length) += toadd_length;
}
-
/* ************************************************************************* */
/* Negotiate Packet functions */
/* ************************************************************************* */
// ?
-
/* ************************************************************************* */
/* Challenge Packet functions */
/* ************************************************************************* */
/** Debug dump the given flags field to stderr */
void ntlm_dump_ntlmssp_flags(const uint32_t flags);
-
/* ************************************************************************* */
/* Packet and Payload structures and handling functions */
/* ************************************************************************* */
const char *toadd,
const int toadd_length);
-
/* ************************************************************************* */
/* Negotiate Packet structures and functions */
/* ************************************************************************* */
char payload[256]; /**< String data */
} ntlm_negotiate;
-
/* ************************************************************************* */
/* Challenge Packet structures and functions */
/* ************************************************************************* */
const int challenge_nonce_len,
const uint32_t flags);
-
/* ************************************************************************* */
/* Authenticate Packet structures and functions */
/* ************************************************************************* */
char *domain,
const int32_t size);
-
#if __cplusplus
}
#endif
#if USE_XPROF_STATS
-
#if HAVE_ASSERT_H
#include <assert.h>
#endif
/* Private stuff */
-
/* new stuff */
#define MAXSTACKDEPTH 512
*
*/
-
/*
* Copyright (c) 1988, 1989, 1993
* The Regents of the University of California. All rights reserved.
#define rm_mask rm_rmu.rmu_mask
#define rm_leaf rm_rmu.rmu_leaf /* extra field would make 32 bytes */
-
/* Helper macros */
#define squid_Bcmp(a, b, l) (l == 0 ? 0 : memcmp((caddr_t)(a), (caddr_t)(b), (u_long)l))
#define squid_R_Malloc(p, t, n) (p = (t) xmalloc((unsigned int)(n)))
#define RFC1035_UNPACK_DEBUG (void)0
#endif
-
-
/*
* rfc1035HeaderPack()
*
"Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
};
-
static int
make_num(const char *s)
{
* to prevent squid knowing the users password (idea suggested in RFC 2617).
*/
-
/*
* $Id$
*
}
}
-
/* calculate H(A1) as per spec */
void
DigestCalcHA1(
return rfc3596BuildHostQuery(hostname, buf, sz, qid, query, RFC1035_TYPE_AAAA, edns_sz);
}
-
/**
* Builds a message buffer with a QUESTION to lookup PTR records
* for an address. Caller must allocate 'buf' which should
return rfc3596BuildHostQuery(rev, buf, sz, qid, query, RFC1035_TYPE_PTR, edns_sz);
}
-
#if DRIVER
/* driver needs the rfc1035 code _without_ the main() */
return 1;
}
-
memset(&S, '\0', sizeof(S));
if (prefer == 6) {
#define PVAL(buf,pos) ((unsigned)CVAL(buf,pos))
#define SCVAL(buf,pos,val) (CVAL(buf,pos) = (val))
-
#if CAREFUL_ALIGNMENT
#define SVAL(buf,pos) (PVAL(buf,pos)|PVAL(buf,(pos)+1)<<8)
#define IVAL(buf,pos) (SVAL(buf,pos)|SVAL(buf,(pos)+2)<<16)
#define SIVALS(buf,pos,val) IVALS(buf,pos)=((int32)(val))
#endif
-
/* now the reverse routines - these are used in nmb packets (mostly) */
#define SREV(x) ((((x)&0xFF)<<8) | (((x)>>8)&0xFF))
#define IREV(x) ((SREV(x)<<16) | (SREV((x)>>16)))
}
-
/* Send an RFCNB packet to the connection.
*
* We just send each of the blocks linked together ...
/* Try to send the data ... We only send as many bytes as len claims */
/* We should try to stuff it into an IOVEC and send as one write */
-
pkt_ptr = pkt;
len_sent = tot_sent = 0; /* Nothing sent so far */
i = 0;
*
*/
-
int
RFCNB_Get_Pkt(struct RFCNB_Con *con, struct RFCNB_Pkt *pkt, int len)
{
char calling_name[33];
} RFCNB_Sess_Pkt;
-
typedef struct RFCNB_Nack_Pkt {
struct RFCNB_Hdr hdr;
unsigned char error;
}
-
/* Write numbytes from data to the file pointed to by the File_Handle at */
/* the offset in the File_Handle. */
}
-
/* Now plug in the bits we need */
memset(SMB_Hdr(pkt), 0, SMB_search_len);
strcpy(p+1, dir_name);
p = p + strlen(dir_name) + 2; /* Skip the null */
-
-
*p = SMBvariableblockID;
p = p + 1;
/* ensure we don't overwrite strings when not passed enough space. Also */
/* added code to say unknown error codes if we see any */
-
#include <stdio.h>
typedef struct {
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-
/* NOTES:
*
* This code makes no attempt to be fast! In fact, it is a very
22, 11, 4, 25
};
-
static int perm6[64] = {40, 8, 48, 16, 56, 24, 64, 32,
39, 7, 47, 15, 55, 23, 63, 31,
38, 6, 46, 14, 54, 22, 62, 30,
33, 1, 41, 9, 49, 17, 57, 25
};
-
static int sc[16] = {1, 1, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 1};
static int sbox[8][4][16] = {
}
}
-
static void
smbhash(unsigned char *out, unsigned char *in, unsigned char *key)
{
pad_api_name = TRUE;
}
-
pkt_len = pkt_len + param_len;
/* Now allocate space for the packet, build it and send it */
#define SMB_LMAPI_SUI_DESC "zWsTPWW"
#define SMB_LMAPI_SUI_DATA_DESC "B16"
-
/* Set user info ... specifically, password */
int SMBapi_NetSetUserInfo(SMB_Tree_Handle tree, char *user,
{
-
}
/* The following two arrays need to be in step! */
/* We must make it possible for callers to specify these ... */
-
extern int SMB_Types[];
typedef struct SMB_Status {
/* Print the other bits in the header */
-
/* etc */
}
}
-
/* Negotiate the protocol we will use from the list passed in Prots */
/* we return the index of the accepted protocol in NegProt, -1 indicates */
/* none acceptible, and our return value is 0 if ok, <0 if problems */
if (RFCNB_Send(Con_Handle -> Trans_Connect, pkt, pkt_len) < 0) {
-
#ifdef DEBUG
fprintf(stderr, "Error sending negotiate protocol\n");
#endif
NULL
};
-
/* Initialize the SMBlib package */
int SMB_Init()
if ((con = (struct SMB_Connect_Def *)malloc(sizeof(struct SMB_Connect_Def))) == NULL) {
-
SMBlib_errno = SMBlibE_NoSpace;
return NULL;
}
NULL
};
-
SMB_Handle_Type SMB_Connect(SMB_Handle_Type Con_Handle,
SMB_Tree_Handle *tree,
char *service,
}
-
/* Disconnect from the server, and disconnect all tree connects */
int SMB_Discon(SMB_Handle_Type Con_Handle, BOOL KeepHandle)
hModule = NULL;
}
-
HMODULE LoadSecurityDll(int mode, char * SSP_Package)
{
TCHAR lpszDLL[MAX_PATH];
return hModule;
}
-
BOOL GenClientContext(PAUTH_SEQ pAS, PSEC_WINNT_AUTH_IDENTITY pAuthIdentity,
PVOID pIn, DWORD cbIn, PVOID pOut, PDWORD pcbOut, PBOOL pfDone)
{
return TRUE;
}
-
BOOL GenServerContext(PAUTH_SEQ pAS, PVOID pIn, DWORD cbIn, PVOID pOut,
PDWORD pcbOut, PBOOL pfDone, char * credentials)
{
return TRUE;
}
-
BOOL WINAPI SSP_LogonUser(PTSTR szUser, PTSTR szPassword, PTSTR szDomain)
{
AUTH_SEQ asServer = {0};
return fResult;
}
-
const char * WINAPI SSP_MakeChallenge(PVOID PNegotiateBuf, int NegotiateLen)
{
BOOL fDone = FALSE;
return encoded;
}
-
BOOL WINAPI SSP_ValidateNTLMCredentials(PVOID PAutenticateBuf, int AutenticateLen, char * credentials)
{
BOOL fDone = FALSE;
return fResult;
}
-
const char * WINAPI SSP_MakeNegotiateBlob(PVOID PNegotiateBuf, int NegotiateLen, PBOOL fDone, int * Status, char * credentials)
{
DWORD cbOut = 0;
return encoded;
}
-
const char * WINAPI SSP_ValidateNegotiateCredentials(PVOID PAutenticateBuf, int AutenticateLen, PBOOL fDone, int * Status, char * credentials)
{
DWORD cbOut = 0;
#include <cppunit/TestResultCollector.h>
#include <cppunit/TestRunner.h>
-
int
main( int argc, char* argv[] )
{
return result.wasSuccessful() ? 0 : 1;
}
-
int res = 0;
unsigned int off = 0;
-
/* Test the HeaderUnpack function results */
msg = new rfc1035_message;
res = rfc1035HeaderUnpack(buf, len, &off, msg);
CPPUNIT_ASSERT(memcmp(unescaped_str, "Bad String %1",14)==0);
xfree(unescaped_str);
-
/* A partly corrupt string */
unescaped_str = xstrdup("Bad String %1A%3");
rfc1738_unescape(unescaped_str);
result = rfc1738_do_escape("################ ################ ################ ################ ################ ################ ################ ################", RFC1738_ESCAPE_UNSAFE);
CPPUNIT_ASSERT(memcmp(result, "%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%20%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%20%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%20%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%20%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%20%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%20%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%20%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23",406)==0);
-
/* TEST: escaping only reserved characters */
/* regular URL (full encoding requested) */
result = rfc1738_do_escape("/data/source/path", RFC1738_ESCAPE_RESERVED);
CPPUNIT_ASSERT(memcmp(result, "%2Fdata%2Fsource%2Fpath",24)==0);
-
/* TEST: safety-escaping a string already partially escaped */
/* escaping of dangerous characters in a partially escaped string */
#include "asn1.h"
#include "snmp_api_error.h"
-
u_char *
asn_build_header(u_char * data, /* IN - ptr to start of object */
int *datalength, /* IN/OUT - # of valid bytes */
return (asn_build_header_with_truth(data, datalength, type, length, 0));
}
-
/*
* asn_parse_int - pulls an int out of an ASN int type.
* On entry, datalength is input as the number of valid bytes following
return (data + strlength);
}
-
/*
* asn_parse_header - interprets the ID and length of the current object.
* On entry, datalength is input as the number of valid bytes following
return (data + 1);
}
-
u_char *
asn_build_length(u_char * data, int *datalength,
int length, int truth)
Mib = read_mib(file);
}
-
static struct snmp_mib_tree *
find_rfc1066_mib(struct snmp_mib_tree *root) {
oid *op = RFC1066_MIB;
#include <errno.h>
#endif
-
/*
* This is one element of an object identifier with either an integer subidentifier,
* or a textual string label, or both.
struct tok *next; /* pointer to next in hash table */
};
-
struct tok tokens[] = {
{"obsolete", sizeof("obsolete") - 1, OBSOLETE},
{"Opaque", sizeof("Opaque") - 1, SNMP_OPAQUE},
}
}
-
static void
print_error(const char *string, const char *token, int type)
{
return tp;
}
-
/*
* Parses a token from the file. The type of the token parsed is returned,
* and the text is placed in the string pointed to by token.
}
return count;
-
}
static void
return np;
}
-
/*
* Parses a mib file and returns a linked list of nodes found in the file.
* Returns NULL on error.
-
/**********************************************************************
*
* Copyright 1997 by Carnegie Mellon University
#include <stdio.h>
#include "snmp_api_error.h"
-
/***************************************************************************
*
***************************************************************************/
"Packet Error",
"No Response From Host",
-
"Unknown Error"
};
#include "snmp_error.h"
-
static const char *error_string[25] = {
/* 0x00 - 0x05 */
"No Error",
#include "snmp_pdu.h"
#include "snmp_msg.h"
-
/*
* RFC 1901: Introduction to Community-based SNMPv2
*
return (newpdu);
}
-
/**********************************************************************/
void
#include "util.h"
-
/* #define DEBUG_VARS 1 */
/* #define DEBUG_VARS_MALLOC 1 */
/* #define DEBUG_VARS_DECODE 1 */
return (bufp);
}
-
-
-
/* Parse all Vars from the buffer */
u_char *
snmp_var_DecodeVarBind(u_char * Buffer, int *BufLen,
}
#endif /* USE_SSL */
-
void
AccessLogEntry::getLogClientIp(char *buf, size_t bufsz) const
{
HttpRequest *request; //< virgin HTTP request
HttpRequest *adapted_request; //< HTTP request after adaptation and redirection
-
#if ICAP_CLIENT
/** \brief This subclass holds log info for ICAP part of request
* \todo Inner class declarations should be moved outside
#include "ident/AclIdent.h"
#endif
-
ACL::Prototype ACLBrowser::RegistryProtoype(&ACLBrowser::RegistryEntry_, "browser");
ACLStrategised<char const *> ACLBrowser::RegistryEntry_(new ACLRegexData, ACLRequestHeaderStrategy<HDR_USER_AGENT>::Instance(), "browser");
ACL::Prototype ACLDestinationDomain::LiteralRegistryProtoype(&ACLDestinationDomain::LiteralRegistryEntry_, "dstdomain");
return true;
}
-
/* BodyProducer */
// inform the pipe that we are done and clear the Pointer
pipe = NULL;
}
-
-
/* BodyConsumer */
// inform the pipe that we are done and clear the Pointer
pipe = NULL;
}
-
/* BodyPipe */
BodyPipe::BodyPipe(Producer *aProducer): theBodySize(-1),
clearProducer(true); // reached end-of-body
}
-
void
BodyPipe::scheduleBodyDataNotification()
{
return outputBuffer.content();
}
-
/* BodyPipeCheckout */
BodyPipeCheckout::BodyPipeCheckout(BodyPipe &aPipe): pipe(aPipe),
checkedIn = true;
}
-
BodyPipeCheckout::BodyPipeCheckout(const BodyPipeCheckout &c): pipe(c.pipe),
buf(c.buf), offset(c.offset), checkedOutSize(c.checkedOutSize),
checkedIn(c.checkedIn)
os << ", data=" << data;
}
-
/* CommAcceptCbParams */
CommAcceptCbParams::CommAcceptCbParams(void *aData):
return true; // now we are in sync and can handle the call
}
-
void
CommIoCbParams::print(std::ostream &os) const
{
}
}
-
/* CommCloseCbParams */
CommCloseCbParams::CommCloseCbParams(void *aData):
os << ')';
}
-
/* CommConnectCbPtrFun */
CommConnectCbPtrFun::CommConnectCbPtrFun(CNCB *aHandler,
os << ')';
}
-
/* CommIoCbPtrFun */
CommIoCbPtrFun::CommIoCbPtrFun(IOCB *aHandler, const CommIoCbParams &aParams):
os << ')';
}
-
/* CommCloseCbPtrFun */
CommCloseCbPtrFun::CommCloseCbPtrFun(CLCB *aHandler,
* known to comm and there are many kinds of parameters.
*/
-
/* Comm*CbParams classes below handle callback parameters */
// Maintains parameters common to all comm callbacks
return dp->params;
}
-
// All job dialers with comm parameters are merged into one since they
// all have exactly one callback argument and differ in Params type only
template <class C, class Params_>
virtual void doDial() { ((&(*this->job))->*method)(this->params); }
};
-
// accept (IOACB) dialer
class CommAcceptCbPtrFun: public CallDialer,
public CommDialerParamsT<CommAcceptCbParams>
CNCB *handler;
};
-
// read/write (IOCB) dialer
class CommIoCbPtrFun: public CallDialer,
public CommDialerParamsT<CommIoCbParams>
IOCB *handler;
};
-
// close (CLCB) dialer
class CommCloseCbPtrFun: public CallDialer,
public CommDialerParamsT<CommCloseCbParams>
{
}
-
template <class Dialer>
bool
CommCbFunPtrCallT<Dialer>::canFire()
CbDataListContainer<DeferredRead> deferredReads;
};
-
#endif /* COMMREAD_H */
/* for Vector<> */
#include "Array.h"
-
/* cache option parsers */
class ConfigOption
static CpuAffinitySet *TheCpuAffinitySet = NULL;
-
void
CpuAffinityInit()
{
/// check CPU affinity configuration and print warnings if needed
SQUIDCEXTERN void CpuAffinityCheck();
-
#endif // SQUID_CPU_AFFINITY_H
#include "CpuAffinitySet.h"
#include "Debug.h"
-
bool
CpuAffinityMap::add(const Vector<int> &aProcesses, const Vector<int> &aCores)
{
class CpuAffinitySet;
-
/// stores cpu_affinity_map configuration
class CpuAffinityMap
{
#include <string.h>
#endif
-
CpuAffinitySet::CpuAffinitySet()
{
CPU_ZERO(&theCpuSet);
xfree(lpOverlapped);
}
-
int aio_read(struct aiocb *aiocbp)
{
LPOVERLAPPED Overlapped;
return 0;
}
-
int aio_read64(struct aiocb64 *aiocbp)
{
LPOVERLAPPED Overlapped;
return 0;
}
-
int aio_write(struct aiocb *aiocbp)
{
LPOVERLAPPED Overlapped;
return 0;
}
-
int aio_write64(struct aiocb64 *aiocbp)
{
LPOVERLAPPED Overlapped;
return 0;
}
-
int aio_error(const struct aiocb * aiocbp)
{
return aiocbp->aio_sigevent.sigev_notify;
}
-
int aio_error64(const struct aiocb64 * aiocbp)
{
return aiocbp->aio_sigevent.sigev_notify;
}
-
int aio_open(const char *path, int mode)
{
HANDLE hndl;
return fd;
}
-
void aio_close(int fd)
{
CloseHandle((HANDLE)_get_osfhandle(fd));
++ statCounter.syscalls.disk.closes;
}
-
ssize_t aio_return(struct aiocb * aiocbp)
{
return aiocbp->aio_sigevent.sigev_signo;
}
-
ssize_t aio_return64(struct aiocb64 * aiocbp)
{
BlockingDiskIOModule::shutdown()
{}
-
DiskIOStrategy*
BlockingDiskIOModule::createStrategy()
{
open(flags, mode, callback);
}
-
void BlockingFile::doClose()
{
if (fd > -1) {
#include "Store.h"
#include "protos.h"
-
DiskdActionData::DiskdActionData()
{
xmemset(this, 0, sizeof(*this));
return *this;
}
-
DiskdAction::Pointer
DiskdAction::Create(const Mgr::CommandPointer &aCmd)
{
#include "mgr/forward.h"
#include "mgr/Action.h"
-
/// store disk daemon stats
class DiskdActionData
{
return;
}
-
/* set errno passed from diskd. makes debugging more meaningful */
if (M->status < 0)
errno = -M->status;
}
}
-
/*
* Handle callbacks. If we have more than magic2 requests away, we block
* until the queue is below magic2. Otherwise, we simply return when we
static Vector<DiskIOModule*> *_Modules;
};
-
#endif /* SQUID_DISKIOMODULE_H */
static int DoneReadFD;
};
-
/* Inline code. TODO: make structued approach to inlining */
void
CommIO::NotifyIOCompleted()
extern AIOCounts squidaio_counts;
extern dlink_list used_list;
-
#endif
* Copyright (c) 2003, Robert Collins <robertc@squid-cache.org>
*/
-
#include "squid.h"
#include "DiskThreadsDiskFile.h"
#include "DiskIO/IORequestor.h"
static DiskThreadsDiskIOModule Instance;
};
-
#endif /* SQUID_DISKTHREADSDISKIOMODULE_H */
/* for statfs */
#include "Store.h"
-
void
DiskThreadsIOStrategy::init(void)
{
static squidaio_thread_t *threads = NULL;
static int squidaio_initialised = 0;
-
#define AIO_LARGE_BUFS 16384
#define AIO_MEDIUM_BUFS AIO_LARGE_BUFS >> 1
#define AIO_SMALL_BUFS AIO_LARGE_BUFS >> 2
squidaio_request_pool->freeOne(requestp);
} /* squidaio_cleanup_request */
-
int
squidaio_cancel(squidaio_result_t * resultp)
{
return 1;
} /* squidaio_cancel */
-
int
squidaio_open(const char *path, int oflag, mode_t mode, squidaio_result_t * resultp)
{
return 0;
}
-
static void
squidaio_do_open(squidaio_request_t * requestp)
{
requestp->err = errno;
}
-
int
squidaio_read(int fd, char *bufp, size_t bufs, off_t offset, int whence, squidaio_result_t * resultp)
{
return 0;
}
-
static void
squidaio_do_read(squidaio_request_t * requestp)
{
requestp->err = errno;
}
-
int
squidaio_write(int fd, char *bufp, size_t bufs, off_t offset, int whence, squidaio_result_t * resultp)
{
return 0;
}
-
static void
squidaio_do_write(squidaio_request_t * requestp)
{
requestp->err = errno;
}
-
int
squidaio_close(int fd, squidaio_result_t * resultp)
{
return 0;
}
-
static void
squidaio_do_close(squidaio_request_t * requestp)
{
requestp->err = errno;
}
-
int
squidaio_stat(const char *path, struct stat *sb, squidaio_result_t * resultp)
return 0;
}
-
static void
squidaio_do_stat(squidaio_request_t * requestp)
{
requestp->err = errno;
}
-
int
squidaio_unlink(const char *path, squidaio_result_t * resultp)
{
return 0;
}
-
static void
squidaio_do_unlink(squidaio_request_t * requestp)
{
static squidaio_thread_t *threads = NULL;
static int squidaio_initialised = 0;
-
#define AIO_LARGE_BUFS 16384
#define AIO_MEDIUM_BUFS AIO_LARGE_BUFS >> 1
#define AIO_SMALL_BUFS AIO_LARGE_BUFS >> 2
squidaio_request_pool->free(requestp);
} /* squidaio_cleanup_request */
-
int
squidaio_cancel(squidaio_result_t * resultp)
{
return 1;
} /* squidaio_cancel */
-
int
squidaio_open(const char *path, int oflag, mode_t mode, squidaio_result_t * resultp)
{
return 0;
}
-
static void
squidaio_do_open(squidaio_request_t * requestp)
{
requestp->err = errno;
}
-
int
squidaio_read(int fd, char *bufp, size_t bufs, off_t offset, int whence, squidaio_result_t * resultp)
{
return 0;
}
-
static void
squidaio_do_read(squidaio_request_t * requestp)
{
requestp->err = errno;
}
-
int
squidaio_write(int fd, char *bufp, size_t bufs, off_t offset, int whence, squidaio_result_t * resultp)
{
return 0;
}
-
static void
squidaio_do_write(squidaio_request_t * requestp)
{
requestp->err = errno;
}
-
int
squidaio_close(int fd, squidaio_result_t * resultp)
{
return 0;
}
-
static void
squidaio_do_close(squidaio_request_t * requestp)
{
requestp->err = errno;
}
-
int
squidaio_stat(const char *path, struct stat *sb, squidaio_result_t * resultp)
return 0;
}
-
static void
squidaio_do_stat(squidaio_request_t * requestp)
{
requestp->err = errno;
}
-
int
squidaio_unlink(const char *path, squidaio_result_t * resultp)
{
return 0;
}
-
static void
squidaio_do_unlink(squidaio_request_t * requestp)
{
}
}
-
void
aioWrite(int fd, off_t offset, char *bufp, size_t len, AIOCB * callback, void *callback_data, FREE * free_func)
{
dlinkAdd(ctrlp, &ctrlp->node, &used_list);
} /* aioWrite */
-
void
aioRead(int fd, off_t offset, size_t len, AIOCB * callback, void *callback_data)
{
IpcIoDiskIOModule::shutdown()
{}
-
DiskIOStrategy*
IpcIoDiskIOModule::createStrategy()
{
(sio.msg.command == IpcIo::cmdRead ? 'r' : 'w') << sio.disker;
}
-
IpcIoFile::IpcIoFile(char const *aDb):
dbName(aDb), diskId(-1), error_(false), lastRequestId(0),
olderRequests(&requestMap1), newerRequests(&requestMap2),
return -1;
}
-
/* IpcIoMsg */
IpcIoMsg::IpcIoMsg():
}
}
-
-
/* XXX: disker code that should probably be moved elsewhere */
static int TheFile = -1; ///< db file descriptor
Ipc::Mem::PutPage(ipcIo.page);
}
-
void
IpcIoFile::DiskerHandleMoreRequests(void *source)
{
}
}
-
/// reports our needs for shared memory pages to Ipc::Mem::Pages
class IpcIoClaimMemoryNeedsRr: public RegisteredRunner
{
RunnerRegistrationEntry(rrClaimMemoryNeeds, IpcIoClaimMemoryNeedsRr);
-
void
IpcIoClaimMemoryNeedsRr::run(const RunnerRegistry &)
{
static_cast<int>(itemsCount * 1.1));
}
-
/// initializes shared memory segments used by IpcIoFile
class IpcIoRr: public Ipc::Mem::RegisteredRunner
{
RunnerRegistrationEntry(rrAfterConfig, IpcIoRr);
-
void IpcIoRr::create(const RunnerRegistry &)
{
if (Config.cacheSwap.n_strands <= 0)
} // namespace IpcIo
-
/// converts DiskIO requests to IPC queue messages
class IpcIoMsg
{
CBDATA_CLASS2(IpcIoFile);
};
-
/// keeps original I/O request parameters while disker is handling the request
class IpcIoPendingRequest
{
IpcIoPendingRequest &operator =(const IpcIoPendingRequest &d); // ditto
};
-
#endif /* SQUID_IPC_IOFILE_H */
MmappedDiskIOModule::shutdown()
{}
-
DiskIOStrategy*
MmappedDiskIOModule::createStrategy()
{
void *buf; ///< buffer returned by mmap, needed for munmap
};
-
void *
MmappedFile::operator new(size_t sz)
{
bool runOnceResult; /**< the result from runOnce */
};
-
#endif /* SQUID_EVENTLOOP_H */
static void ExternalAclLookup(ACLChecklist * ch, ACLExternal *);
-
ACLExternal(char const *);
ACLExternal(ACLExternal const &);
~ACLExternal();
String log;
};
-
/*******************************************************************
* external_acl cache entry
* Used opaqueue in the interface
#include "HttpBody.h"
#include "MemBuf.h"
-
HttpBody::HttpBody() : mb(new MemBuf)
{}
MemBuf *mb;
};
-
#endif /* HTTPBODY_H_ */
return aHeader;
}
-
/// Module initialization hook
void
httpHdrCcInitModule(void)
* entity-length = 1*DIGIT
*/
-
/* local constants */
#define range_spec_unknown (-1)
* spec into type one above. (Canonization process).
*/
-
/* local routines */
#define known_spec(s) ((s) > HttpHdrRangeSpec::UnknownPosition)
" specs, merged " << basis.size() - specs.size() << " specs");
}
-
void
HttpHdrRange::getCanonizedSpecs (Vector<HttpHdrRangeSpec *> ©)
{
return (int)anSc - (int)anSc2;
}
-
/* module initialization */
void
}
}
-
HttpHdrSc::HttpHdrSc(const HttpHdrSc &sc)
{
dlink_node *node = sc.targets.head;
extern void httpHdrScTargetStatDumper(StoreEntry * sentry, int idx, double val, double size, int count);
-
-
#endif /* SQUID_HTTPHDRSURROGATECONTROLTARGET_H */
* An entry is a (field_id, field_name, field_value) triplet.
*/
-
/*
* local constants and vars
*/
return aHeader;
}
-
/*
* headers with field values defined as #(values) in HTTP/1.1
* Headers that are currently not recognized, are commented out.
xpercent(count, dump_stat->destroyedCount));
}
-
static void
httpHeaderStatDump(const HttpHeaderStat * hs, StoreEntry * e)
{
/* HttpHeader holds a HttpHeaderMask */
#include "HttpHeaderMask.h"
-
/* class forward declarations */
class HttpHdrContRange;
class HttpHdrCc;
class HttpHdrRange;
class String;
-
/* constant attributes of http header fields */
/// recognized or "known" header fields; and the RFC which defines them (or not)
field_type type;
};
-
/** Iteration for headers; use HttpHeaderPos as opaque type, do not interpret */
typedef ssize_t HttpHeaderPos;
HttpHeaderEntry *findLastEntry(http_hdr_type id) const;
};
-
extern int httpHeaderParseQuotedString(const char *start, const int len, String *val);
SQUIDCEXTERN int httpHeaderHasByNameListMember(const HttpHeader * hdr, const char *name, const char *member, const char separator);
SQUIDCEXTERN void httpHeaderUpdate(HttpHeader * old, const HttpHeader * fresh, const HttpHeaderMask * denied_mask);
int busyDestroyedCount;
};
-
#endif /* HTTPHEADERSTAT_H_ */
static void httpHeaderPutStrvf(HttpHeader * hdr, http_hdr_type id, const char *fmt, va_list vargs);
-
HttpHeaderFieldInfo *
httpHeaderBuildFieldsInfo(const HttpHeaderFieldAttrs * attrs, int count)
{
mb.clean();
}
-
/** wrapper arrounf PutContRange */
void
httpHeaderAddContRange(HttpHeader * hdr, HttpHdrRangeSpec spec, int64_t ent_len)
httpHdrContRangeDestroy(cr);
}
-
/**
* return true if a given directive is found in at least one of
* the "connection" header-fields note: if HDR_PROXY_CONNECTION is
return 1;
}
-
/**
* Parses a quoted-string field (RFC 2616 section 2.2), complains if
* something went wrong, returns non-zero on success.
template <class Msg>
class HttpMsgPointerT;
-
class HttpMsg
{
// NP: we have now seen EOL, more-data (0) cannot occur.
// From here on any failure is -1, success is 1
-
// Input Validation:
// Process what we now know about the line structure into field offsets
#define HttpParserRequestLen(hp) ( (hp)->hdr_end - (hp)->req.start + 1 )
#endif
-
#endif /* _SQUID_SRC_HTTPPARSER_H */
return rep;
}
-
bool HttpReply::inheritProperties(const HttpMsg *aMsg)
{
const HttpReply *aRep = dynamic_cast<const HttpReply*>(aMsg);
METHOD_ENUM_END // MUST be last, (yuck) this is used as an array-initialization index constant!
};
-
/**
* This class represents an HTTP Request METHOD
* - i.e. PUT, POST, GET etc.
SQUIDCEXTERN const char *httpStatusString(http_status status);
-
#endif /* SQUID_HTTPSTATUSLINE_H */
return aCode;
}
-
/**
\ingroup ServerProtocolICPAPI
\todo mempool this
return ((unsigned long) p >> 8) % mod;
}
-
void
LeakFinder::dump()
{
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA.
*/
-
#include "squid.h"
#include "base/TextException.h"
#include "Debug.h"
#include <iostream>
#endif
-
MemBlobStats MemBlob::Stats;
InstanceIdDefinitions(MemBlob, "blob");
-
/* MemBlobStats */
MemBlobStats::MemBlobStats(): alloc(0), live(0), append(0)
return os;
}
-
/* MemBlob */
MemBlob::MemBlob(const MemBlob::size_type reserveSize) :
++Stats.append;
}
-
const MemBlobStats&
MemBlob::GetStats()
{
uint64_t liveBytes; ///< the total size of currently allocated storage
};
-
/** Refcountable, fixed-size, content-agnostic memory buffer.
*
* Allocated memory block is divided into two sequential areas:
init(MEM_BUF_INIT_SIZE, MEM_BUF_MAX_SIZE);
}
-
/** init with specific sizes */
void
MemBuf::init(mb_size_t szInit, mb_size_t szMax)
va_end(args);
}
-
/**
* vPrintf for other printf()'s to use; calls vsnprintf, extends buf if needed
*/
PROF_stop(MemBuf_grow);
}
-
/* Reports */
/**
/* Should we check for clients? */
}
-
int64_t
MemObject::lowestMemReaderOffset() const
{
inmem_lo = new_mem_lo;
}
-
bool
MemObject::isContiguous() const
{
DelayId mostBytesAllowed() const;
#endif
-
#if URL_CHECKSUM_DEBUG
void checkUrlChecksum() const;
return entryLimit;
}
-
/// reports our needs for shared memory pages to Ipc::Mem::Pages
class MemStoreClaimMemoryNeedsRr: public RegisteredRunner
{
RunnerRegistrationEntry(rrClaimMemoryNeeds, MemStoreClaimMemoryNeedsRr);
-
void
MemStoreClaimMemoryNeedsRr::run(const RunnerRegistry &)
{
Ipc::Mem::NotePageNeed(Ipc::Mem::PageId::cachePage, MemStore::EntryLimit());
}
-
/// decides whether to use a shared memory cache or checks its configuration
class MemStoreCfgRr: public ::RegisteredRunner
{
}
}
-
/// initializes shared memory segments used by MemStore
class MemStoreRr: public Ipc::Mem::RegisteredRunner
{
RunnerRegistrationEntry(rrAfterConfig, MemStoreRr);
-
void MemStoreRr::run(const RunnerRegistry &r)
{
assert(Config.memShared.configured());
*
*/
-
/*
* To-Do:
*/
-
#include "squid.h"
#include "Store.h"
#include "MemBuf.h"
e->append(buf, len);
}
-
/* append()'s */
static void (*const store_append) (StoreEntry *, const char *, int) = &storeEntryAppend;
static void (*const memBuf_append) (MemBuf *, const char *, mb_size_t) = &memBufAppend;
static void (*const store_vprintf) (StoreEntry *, const char *, va_list ap) = &storeAppendVPrintf;
static void (*const memBuf_vprintf) (MemBuf *, const char *, va_list ap) = &memBufVPrintf;
-
/* init/clean */
/* init with this to forward data to StoreEntry */
typedef void (*append_f) (void *, const char *buf, int size);
typedef void (*vprintf_f) (void *, const char *fmt, va_list args);
-
class Packer
{
CBDATA_CLASS(ps_state);
};
-
#endif /* SQUID_PEERSELECTSTATE_H */
typedef RemovalPolicy *REMOVALPOLICYCREATE(wordlist * args);
-
#endif /* SQUID_REMOVALPOLICY_H */
// implemented in client_side_reply.cc until sides have a common parent
extern void purgeEntriesByUrl(HttpRequest * req, const char *url);
-
ServerStateData::ServerStateData(FwdState *theFwdState): AsyncJob("ServerStateData"),
requestSender(NULL),
#if USE_ADAPTATION
#endif
}
-
HttpReply *
ServerStateData::virginReply()
{
handleRequestBodyProducerAborted();
}
-
// more origin request body data is available
void
ServerStateData::handleMoreRequestBodyAvailable()
completeForwarding();
}
-
// common part of noteAdaptation*Aborted and noteBodyConsumerAborted methods
void
ServerStateData::handleAdaptationAborted(bool bypassable)
#include "squid.h"
-
#ifdef __SUNPRO_CC
#include <new>
#define SQUIDSTRINGPRINT(s) (s).psize(),(s).rawBuf()
#endif /* SQUIDSTRINGPH */
-
#define DEBUGSTRINGS 0
#if DEBUGSTRINGS
#include "splay.h"
void stat (StoreEntry *) const;
#endif
-
private:
void allocAndFill(const char *str, int len);
void allocBuffer(size_type sz);
};
#endif
-
/** General collection of process-wide statistics.
*
* \note if you add a field to StatCounters,
/* for StoreEntry */
#include "Store.h"
-
/// function signature for in/out StatHist adaptation
typedef double hbase_f(double);
#include <ostream>
#endif
-
class AsyncCall;
class HttpRequest;
class MemObject;
void trimMemory(const bool preserveSwappable) {}
-
static NullStoreEntry _instance;
};
/// \ingroup StoreAPI
typedef void (*STOREGETCLIENT) (StoreEntry *, void *cbdata);
-
/**
\ingroup StoreAPI
* Abstract base class that will replace the whole store and swapdir interface.
SQUIDCEXTERN void storeClientCopy(store_client *, StoreEntry *, StoreIOBuffer, STCB *, void *);
-
#endif /* SQUID_STORECLIENT_H */
// TODO: Kill this typedef!
typedef StoreFileSystem storefs_entry_t;
-
#endif /* SQUID_STOREFILESYSTEM_H */
return true;
}
-
StoreMeta *
StoreMeta::Factory (char type, size_t len, void const *value)
{
#include "protos.h" /* for xmemset only */
#include "StoreStats.h"
-
/* StoreInfoStats */
StoreInfoStats::StoreInfoStats()
return *this;
}
-
-
/* StoreIoStats */
StoreIoStats::StoreIoStats()
bool shared; ///< whether memory cache is shared among workers
};
-
StoreInfoStats();
StoreInfoStats &operator +=(const StoreInfoStats &stats);
-
Swap swap; ///< cache_mem stats
Mem mem; ///< all cache_dirs stats
int32_t record_size;
};
-
#endif /* SQUID_STORESWAPLOGDATA_H */
return size();
}
-
// low-level buffer allocation,
// does not free old buffer and does not adjust or look at len_
void
return rv;
}
-
#if DEBUGSTRINGS
void
String::stat(StoreEntry *entry) const
return c-rawBuf();
}
-
-
#if !_USE_INLINE_
#include "String.cci"
#endif
#endif /* INT_MAX */
#endif /* HAVE_STDINT_H */
-
String::String() : size_(0), len_(0), buf_ (NULL)
{
#if DEBUGSTRINGS
return buf_[aPos];
}
-
/// compare NULL and empty strings because str*cmp() may fail on NULL strings
/// and because we need to return consistent results for strncmp(count == 0).
bool
return true;
}
-
int
String::cmp (char const *aString) const
{
return caseCmp(str.rawBuf(),str.size());
}
-
void
String::set(char const *loc, char const ch)
{
return true; // kids may provide more tests and should report true load
}
-
void
SwapDir::sync() {}
return false;
}
-
ACLList::ACLList() : op (1), _acl (NULL), next (NULL)
{}
return true;
}
-
/*********************/
/* Destroy functions */
/*********************/
MEMPROXY_CLASS_INLINE(acl_proxy_auth_match_cache);
-
/// \ingroup ACLAPI
extern const char *AclMatchedName; /* NULL */
static SplayNode<Eui::Eui48 *>::SPLAYCMP aclArpCompare;
static SplayNode<Eui::Eui48 *>::SPLAYWALKEE aclDumpArpListWalkee;
-
ACL *
ACLARP::clone() const
{
return q;
}
-
/*******************/
/* aclParseArpList */
/*******************/
/* BEGIN of definitions for radix tree entries */
-
/* 32/128 bits address in memory with length */
class m_ADDR
{
static STCB asHandleReply;
-
#if defined(__cplusplus)
extern "C" {
#endif
/* PRIVATE */
-
static void
asnCacheStart(int as)
{
cbdataFree(asState);
}
-
/**
* add a network (addr, mask) to the radix tree, with matching AS number
*/
ACLSourceASNStrategy ACLSourceASNStrategy::Instance_;
-
int
ACLDestinationASNStrategy::match (ACLData<MatchType> * &data, ACLFilledChecklist *checklist)
{
template class ACLRequestHeaderStrategy<HDR_USER_AGENT>;
-
#include "fde.h"
#include "globals.h"
-
int
ACLCertificateStrategy::match (ACLData<MatchType> * &data, ACLFilledChecklist *checklist)
{
return true;
}
-
/// Check whether a single ACL matches, returning NodeMatchingResult
ACLChecklist::NodeMatchingResult
ACLChecklist::matchNode(const ACLList &node, bool const fast)
debugs(28, 4, "ACLChecklist::~ACLChecklist: destroyed " << this);
}
-
void
ACLChecklist::AsyncState::changeState (ACLChecklist *checklist, AsyncState *newState) const
{
static NullState _instance;
};
-
public:
ACLChecklist();
virtual ~ACLChecklist();
checklist->matchNonBlocking();
}
-
int
ACLDestinationDomainStrategy::match (ACLData<MatchType> * &data, ACLFilledChecklist *checklist)
{
checklist->matchNonBlocking();
}
-
-
ACL *
ACLDestinationIP::clone() const
{
return matchDomainName(h, d);
}
-
/* compare two domains */
template<class T>
return domains->empty();
}
-
ACLData<char const *> *
ACLDomainData::clone() const
{
static SplayNode<Eui::Eui64 *>::SPLAYCMP aclEui64Compare;
static SplayNode<Eui::Eui64 *>::SPLAYWALKEE aclDumpEuiListWalkee;
-
ACL *
ACLEui64::clone() const
{
return q;
}
-
/*******************/
/* aclParseEuiList */
/*******************/
class Eui64;
};
-
/// \ingroup ACLAPI
class ACLEui64 : public ACL
{
#include "auth/AclProxyAuth.h"
#endif
-
CBDATA_CLASS_INIT(ACLFilledChecklist);
-
void *
ACLFilledChecklist::operator new (size_t size)
{
cbdataFree(t);
}
-
ACLFilledChecklist::ACLFilledChecklist() :
dst_peer(NULL),
dst_rdns(NULL),
rfc931[0] = '\0';
}
-
ACLFilledChecklist::~ACLFilledChecklist()
{
assert (!asyncInProgress());
debugs(28, 4, HERE << "ACLFilledChecklist destroyed " << this);
}
-
ConnStateData *
ACLFilledChecklist::conn() const
{
#include "HttpRequest.h"
#include "protos.h"
-
/* does name lookup, returns page_id */
err_type
aclGetDenyInfoPage(acl_deny_info_list ** head, const char *name, int redirect_allowed)
return false;
}
-
/* maex@space.net (05.09.96)
* get the info for redirecting "access denied" to info pages
* TODO (probably ;-)
}
}
-
-
/*********************/
/* Destroy functions */
/*********************/
template class ACLStrategised<hier_code>;
-
int
ACLHierCodeStrategy::match (ACLData<MatchType> * &data, ACLFilledChecklist *checklist)
{
#include "acl/Checklist.h"
#include "HttpReply.h"
-
-
int
ACLHTTPRepHeaderStrategy::match (ACLData<MatchType> * &data, ACLFilledChecklist *checklist)
{
#include "acl/Checklist.h"
#include "HttpRequest.h"
-
-
int
ACLHTTPReqHeaderStrategy::match (ACLData<MatchType> * &data, ACLFilledChecklist *checklist)
{
return ret;
}
-
-
ACL *
ACLHTTPStatus::clone() const
{
return new acl_httpstatus_data(status, INT_MAX);
}
-
void
ACLHTTPStatus::parse()
{
}
}
-
/*
* acl_ip_data::NetworkCompare - Compare two acl_ip_data entries. Strictly
* used by the splay insertion routine. It emits a warning if it
return ACLIP::match (Filled(checklist)->my_addr);
}
-
-
-
ACL *
ACLLocalIP::clone() const
{
template class ACLStrategised<HttpRequestMethod>;
-
-
int
ACLMethodStrategy::match (ACLData<MatchType> * &data, ACLFilledChecklist *checklist)
{
#include "acl/StringData.h"
#include "acl/Checklist.h"
-
-
int
ACLPeerNameStrategy::match (ACLData<MatchType> * &data, ACLFilledChecklist *checklist)
{
template class ACLStrategised<AnyP::ProtocolType>;
-
-
int
ACLProtocolStrategy::match (ACLData<MatchType> * &data, ACLFilledChecklist *checklist)
{
template class ACLRequestHeaderStrategy<HDR_REFERER>;
-
template class ACLReplyHeaderStrategy<HDR_CONTENT_TYPE>;
-
template class ACLRequestHeaderStrategy<HDR_CONTENT_TYPE>;
-
checklist->matchNonBlocking();
}
-
int
ACLSourceDomainStrategy::match (ACLData<MatchType> * &data, ACLFilledChecklist *checklist)
{
return ACLIP::match(Filled(checklist)->src_addr);
}
-
-
ACL *
ACLSourceIP::clone() const
{
#include "acl/Acl.h"
#include "acl/Data.h"
-
class ACLStringData : public ACLData<char const *>
{
#include "acl/TimeData.h"
#include "SquidTime.h"
-
int
ACLTimeStrategy::match (ACLData<MatchType> * &data, ACLFilledChecklist *checklist)
{
#include "acl/Checklist.h"
#include "HttpRequest.h"
-
int
ACLUrlPortStrategy::match (ACLData<MatchType> * &data, ACLFilledChecklist *checklist)
{
}
}
-
bool
ACLUserData::empty() const
{
return FindGroup(groupId);
}
-
Adaptation::AccessRules &
Adaptation::AllRules()
{
return answer;
}
-
Adaptation::Answer
Adaptation::Answer::Block(const String &aRule)
{
int Adaptation::Config::use_indirect_client = true;
Adaptation::Config::MetaHeaders Adaptation::Config::metaHeaders;
-
Adaptation::Config::MetaHeader::Value::~Value()
{
aclDestroyAclList(&aclList);
return meta;
}
-
Adaptation::ServiceConfig*
Adaptation::Config::newServiceConfig() const
{
return "NONE";
}
-
const char *
Adaptation::vectPointStr(Adaptation::VectPoint point)
{
return "NONE";
}
-
return theRptm;
}
-
Adaptation::History::History():
lastMeta(hoReply),
allMeta(hoReply),
namespace Adaptation
{
-
/// collects information about adaptations related to a master transaction
class History: public RefCountable
{
theInitiator = i;
}
-
// internal cleanup
void Adaptation::Initiate::swanSong()
{
clearInitiator();
}
-
void Adaptation::Initiate::tellQueryAborted(bool final)
{
sendAnswer(Answer::Error(final));
#include "HttpReply.h"
#include "HttpMsg.h"
-
Adaptation::Iterator::Iterator(
HttpMsg *aMsg, HttpRequest *aCause,
const ServiceGroupPointer &aGroup):
} // namespace Adaptation
-
#endif /* SQUID_ADAPTATION__ITERATOR_H */
return true;
}
-
Adaptation::Services &
Adaptation::AllServices()
{
return true;
}
-
bool
Adaptation::ServiceConfig::grokBool(bool &var, const char *name, const char *value)
{
#include "HttpReply.h"
#include "adaptation/ServiceFilter.h"
-
Adaptation::ServiceFilter::ServiceFilter(Method aMethod, VectPoint aPoint,
HttpRequest *aReq, HttpReply *aRep): method(aMethod), point(aPoint),
request(HTTPMSGLOCK(aReq)),
#include "protos.h"
#include "wordlist.h"
-
Adaptation::ServiceGroup::ServiceGroup(const String &aKind, bool allSame):
kind(aKind), method(methodNone), point(pointNone),
allServicesSame(allSame)
return !allServicesSame && findService(filter, pos);
}
-
/* ServiceSet */
Adaptation::ServiceSet::ServiceSet(): ServiceGroup("adaptation set", true)
{
}
-
/* SingleService */
Adaptation::SingleService::SingleService(const String &aServiceId):
services.push_back(aServiceId);
}
-
/* ServiceChain */
Adaptation::ServiceChain::ServiceChain(): ServiceGroup("adaptation chain", false)
{
}
-
/* DynamicServiceChain */
Adaptation::DynamicServiceChain::DynamicServiceChain(
(atEof ? ".]" : "]");
}
-
/* globals */
Adaptation::Groups &
DynamicGroupCfg ¤t, DynamicGroupCfg &future);
};
-
/** iterates services stored in a group; iteration is not linear because we
need to both replace failed services and advance to the next chain link */
class ServicePlan
extern Groups &AllGroups();
extern ServiceGroupPointer FindGroup(const ServiceGroup::Id &id);
-
} // namespace Adaptation
#endif /* SQUID_ADAPTATION__SERVICE_GROUPS_H */
return new Adaptation::Ecap::ServiceRep(cfg);
}
-
/* ServiceConfig */
bool
Extensions extensions;
};
-
/// General eCAP configuration
class Config: public Adaptation::Config
{
Debug::finishDebug();
}
-
Adaptation::Ecap::Host::MessagePtr
Adaptation::Ecap::Host::newRequest() const
{
return HDR_OTHER;
}
-
/* FirstLineRep */
Adaptation::Ecap::FirstLineRep::FirstLineRep(HttpMsg &aMessage): theMessage(aMessage)
return AnyP::PROTO_UNKNOWN;
}
-
/* RequestHeaderRep */
Adaptation::Ecap::RequestLineRep::RequestLineRep(HttpRequest &aMessage):
FirstLineRep::protocol(p);
}
-
/* ReplyHeaderRep */
Adaptation::Ecap::StatusLineRep::StatusLineRep(HttpReply &aMessage):
return !theBody ? BodySize() : BodySize(theBody->bodySize());
}
-
/* MessageRep */
Adaptation::Ecap::MessageRep::MessageRep(HttpMsg *rawHeader):
HttpMsg &theMessage; // the message being translated to libecap
};
-
// Helps translate Squid HttpMsg into libecap::FirstLine (see children).
class FirstLineRep
{
HttpReply &theMessage; // the request header being translated to libecap
};
-
// Translates Squid BodyPipe into libecap::Body.
class BodyRep: public libecap::Body
{
} // namespace Ecap
} // namespace Adaptation
-
Adaptation::Ecap::ConfigRep::ConfigRep(const Master &aMaster): master(aMaster)
{
}
visitor.visit(Name(i->first), Area::FromTempString(i->second));
}
-
-
Adaptation::Ecap::ServiceRep::ServiceRep(const ServiceConfigPointer &cfg):
/*AsyncJob("Adaptation::Ecap::ServiceRep"),*/ Adaptation::Service(cfg),
isDetached(false)
CBDATA_NAMESPACED_CLASS_INIT(Adaptation::Ecap::XactionRep, XactionRep);
-
/// a libecap Visitor for converting adapter transaction options to HttpHeader
class OptionsExtractor: public libecap::NamedValueVisitor
{
adaptedReq->adaptHistoryImport(*request);
}
-
void
Adaptation::Ecap::XactionRep::vbDiscard()
{
if (vbProductionFinished)
buf.append(".", 1);
-
buf.Printf(" A%d", static_cast<int>(proxyingAb));
if (proxyingAb == opOn) {
// ICAP-related things needed by code unaware of ICAP internals.
-
namespace Adaptation
{
namespace Icap
extern void InitModule();
extern void CleanModule();
-
} // namespace Icap
} // namespace Adaptation
extern Config TheConfig;
-
} // namespace Icap
} // namespace Adaptation
// ICAP-related things shared by many ICAP classes
-
namespace Adaptation
{
namespace Icap
// as the "cause". ICAP transactions use this class to store virgin
// and adapted HTTP messages.
-
namespace Adaptation
{
namespace Icap
// TODO: s/Header/Message/i ?
-
} // namespace Icap
} // namespace Adaptation
#include "HttpRequest.h"
#include "HttpReply.h"
-
Adaptation::Icap::Launcher::Launcher(const char *aTypeName,
Adaptation::ServicePointer &aService):
AsyncJob(aTypeName),
* ICAP transactions.
*/
-
namespace Adaptation
{
namespace Icap
} // namespace Icap
} // namespace Adaptation
-
#endif /* SQUID_ICAPLAUNCHER_H */
}
}
-
-
// note that allocation for echoing is done in handle204NoContent()
void Adaptation::Icap::ModXact::maybeAllocateHttpMsg()
{
Xaction::finalizeLogInfo();
}
-
void Adaptation::Icap::ModXact::makeRequestHeaders(MemBuf &buf)
{
char ntoabuf[MAX_IPSTRLEN];
}
}
-
buf.Printf("Encapsulated: ");
MemBuf httpBuf;
adapted.body_pipe << " pipe");
}
-
// TODO: Move SizedEstimate and Preview elsewhere
Adaptation::Icap::SizedEstimate::SizedEstimate()
return static_cast<uint64_t>(theData);
}
-
-
Adaptation::Icap::VirginBodyAct::VirginBodyAct(): theStart(0), theState(stUndecided)
{}
return static_cast<uint64_t>(theStart);
}
-
Adaptation::Icap::Preview::Preview(): theWritten(0), theAd(0), theState(stDisabled)
{}
* receive the HTTP body.
*/
-
class ChunkedCodingParser;
namespace Adaptation
State theState;
};
-
// maintains preview-related sizes
class Preview
CBDATA_CLASS2(ModXactLauncher);
};
-
} // namespace Icap
} // namespace Adaptation
CBDATA_NAMESPACED_CLASS_INIT(Adaptation::Icap, OptXact);
CBDATA_NAMESPACED_CLASS_INIT(Adaptation::Icap, OptXactLauncher);
-
Adaptation::Icap::OptXact::OptXact(Adaptation::Icap::ServiceRep::Pointer &aService):
AsyncJob("Adaptation::Icap::OptXact"),
Adaptation::Icap::Xaction("Adaptation::Icap::OptXact", aService),
#include "adaptation/icap/Xaction.h"
#include "adaptation/icap/Launcher.h"
-
namespace Adaptation
{
namespace Icap
CBDATA_CLASS2(OptXactLauncher);
};
-
} // namespace Icap
} // namespace Adaptation
list.report(5, "Adaptation::Icap::Options::cfgTransferList: ");
}
-
/* Adaptation::Icap::Options::TransferList */
Adaptation::Icap::Options::TransferList::TransferList(): extensions(NULL), name(NULL),
void cfgTransferList(const HttpHeader *h, TransferList &l);
};
-
-
-
} // namespace Icap
} // namespace Adaptation
return (available != 0); // it is -1 (no limit) or has available slots
}
-
bool Adaptation::Icap::ServiceRep::wantsUrl(const String &urlPath) const
{
Must(hasOptions());
return false;
}
-
static
void ServiceRep_noteTimeToUpdate(void *data)
{
}
}
-
/*
* Check the ICAP server's date header for clock skew
*/
* auto-destroyed by refcounting when no longer used.
*/
-
class ServiceRep : public RefCountable, public Adaptation::Service,
public Adaptation::Initiator
{
#include "protos.h"
#include "SquidTime.h"
-
//CBDATA_NAMESPACED_CLASS_INIT(Adaptation::Icap, Xaction);
Adaptation::Icap::Xaction::Xaction(const char *aTypeName, Adaptation::Icap::ServiceRep::Pointer &aService):
Adaptation::Initiate::callException(e);
}
-
void Adaptation::Icap::Xaction::callEnd()
{
if (doneWithIo()) {
}
}
-
void Adaptation::Icap::Xaction::maybeLog()
{
if (IcapLogfileStatus == LOG_ENABLE) {
//CBDATA_CLASS2(Xaction);
};
-
} // namespace Icap
} // namespace Adaptation
credentials_state = newCreds;
}
-
/**
* Combine two user structs. ONLY to be called from within a scheme
* module. The scheme module is responsible for ensuring that the
return auth_user_request->user()->ipcount;
}
-
/*
* authenticateUserAuthenticated: is this auth_user structure logged in ?
*/
* They DO NOT perform access control or auditing.
* See acl.c for access control and client_side.c for auditing */
-
#include "squid.h"
#include "auth/basic/auth_basic.h"
#include "auth/basic/Scheme.h"
static int authbasic_initialised = 0;
-
/*
*
* Public Functions
* They DO NOT perform access control or auditing.
* See acl.c for access control and client_side.c for auditing */
-
#include "squid.h"
#include "rfc2617.h"
#include "auth/digest/auth_digest.h"
return Auth::Digest::Scheme::GetInstance()->type();
}
-
static void
authenticateDigestStats(StoreEntry * sentry)
{
temp.clean();
-
/* now we validate the data given to us */
/*
/* the method we'll check at the authenticate step as well */
-
/* we don't send or parse opaques. Ok so we're flexable ... */
/* find the user */
* They DO NOT perform access control or auditing.
* See acl.c for access control and client_side.c for auditing */
-
#include "squid.h"
#include "auth/negotiate/auth_negotiate.h"
#include "auth/Gadgets.h"
* They DO NOT perform access control or auditing.
* See acl.c for access control and client_side.c for auditing */
-
#include "squid.h"
#include "auth/Gadgets.h"
#include "auth/ntlm/auth_ntlm.h"
InstanceIdDefinitions(AsyncCall, "call");
-
/* AsyncCall */
AsyncCall::AsyncCall(int aDebugSection, int aDebugLevel,
/** Call scheduling helper. */
#define ScheduleCallHere(call) ScheduleCall(__FILE__, __LINE__, (call))
-
#endif /* SQUID_ASYNCCALL_H */
AsyncCallQueue *AsyncCallQueue::TheInstance = 0;
-
AsyncCallQueue::AsyncCallQueue(): theHead(NULL), theTail(NULL)
{
}
return buf.content();
}
-
return ScheduleCall(fileName, fileLine, call);
}
-
#define CallJobHere(debugSection, debugLevel, job, Class, method) \
CallJob((debugSection), (debugLevel), __FILE__, __LINE__, \
(#Class "::" #method), \
(#Class "::" #method), \
JobMemFun((job), &Class::method, (arg1)))
-
/// Convenience macro to create a Dialer-based job callback
#define JobCallback(dbgSection, dbgLevel, Dialer, job, method) \
asyncCall((dbgSection), (dbgLevel), #method, \
Dialer(CbcPointer<Dialer::DestClass>(job), &method))
-
/*
* *MemFunT are member function (i.e., class method) wrappers. They store
* details of a method call in an object so that the call can be delayed
// ... add more as needed
-
// Now we add global templated functions that create the member function
// wrappers above. These are for convenience: it is often easier to
// call a templated function than to create a templated object.
return UnaryMemFunT<C, Argument1>(job, method, arg1);
}
-
// inlined methods
template<class Job>
return os << cbc << '/' << lock;
}
-
#endif /* SQUID_CBC_POINTER_H */
return os << Prefix << value; \
}
-
/// print the id
template <class Class>
inline
return id.print(os);
}
-
#endif /* SQUID_BASE_INSTANCE_ID_H */
virtual void run(const RunnerRegistry &r) = 0;
};
-
/// registers a given runner with the given registry and returns registry count
int RegisterRunner(const RunnerRegistry ®istry, RegisteredRunner *rr);
/// deletes all runners in the given registry
void DeactivateRegistered(const RunnerRegistry ®istry);
-
/// convenience function to "use" an otherwise unreferenced static variable
bool UseThisStatic(const void *);
#include "snmp.h"
#endif
-
-
-
#if HAVE_GLOB_H
#include <glob.h>
#endif
return err_count;
}
-
static void
configDoConfigure(void)
{
self_destruct();
}
-
static void
parseBytesLine(size_t * bptr, const char *units)
{
return option > 0 ? (void*)this : NULL;
}
-
inline void
free_YesNoNone(YesNoNone *)
{
}
#endif /* USE_ADAPTATION */
-
#if ICAP_CLIENT
static void
#endif
-
#if USE_ECAP
static void
int bad_del_count; /* #dels with no prior add */
} CacheIndex;
-
typedef struct _CacheEntry {
const cache_key *key;
unsigned char key_arr[SQUID_MD5_DIGEST_LENGTH];
} CacheEntry;
-
/* copied from url.c */
const char *RequestMethodStr[] = {
"NONE",
"PURGE"
};
-
static int cacheIndexScan(CacheIndex * idx, const char *fname, FILE * file);
-
static CacheEntry *
cacheEntryCreate(const StoreSwapLogData * s)
{
cacheIndexCmpReport(idx2, shared_count);
}
-
static int
usage(const char *prg_name)
{
#include "wordlist.h"
#include <algorithm>
-
/// \ingroup CacheManagerInternal
#define MGR_PASSWD_SZ 128
Handler *handler;
};
-
/// Registers new profiles, ignoring attempts to register a duplicate
void
CacheManager::registerProfile(const Mgr::ActionProfile::Pointer &profile)
}
#endif
-
cbdata::~cbdata()
{
#if USE_CBDATA_DEBUG
/// \ingroup CBDATAAPI
extern cbdata_type cbdataInternalAddType(cbdata_type type, const char *label, int size, FREE * free_func);
-
/* cbdata macros */
#if USE_CBDATA_DEBUG
#define cbdataAlloc(type) ((type *)cbdataInternalAllocDbg(CBDATA_##type,__FILE__,__LINE__))
/// \ingroup ClientStreamInternal
CBDATA_TYPE(clientStreamNode);
-
/* Local functions */
static FREE clientStreamFree;
#include "StatCounters.h"
#include "Store.h"
-
static hash_table *client_table = NULL;
static ClientInfo *clientdbAdd(const Ip::Address &addr);
/* our socket-related context */
-
CBDATA_CLASS_INIT(ClientSocketContext);
void *
static ConnStateData *connStateCreate(const Comm::ConnectionPointer &client, AnyP::PortCfg *port);
-
clientStreamNode *
ClientSocketContext::getTail() const
{
comm_read(clientConnection, in.addressToReadInto(), getAvailableBufferLength(), reader);
}
-
void
ClientSocketContext::removeFromConnectionList(ConnStateData * conn)
{
}
}
-
void
ClientSocketContext::doClose()
{
goto finish;
}
-
if (!chunked && !clientIsContentLengthValid(request)) {
clientStreamNode *node = context->getClientReplyContext();
clientReplyContext *repContext = dynamic_cast<clientReplyContext *>(node->data.getRaw());
" client certificate: issuer: " <<
X509_NAME_oneline(X509_get_issuer_name(client_cert), 0, 0));
-
X509_free(client_cert);
} else {
debugs(83, 5, "clientNegotiateSSL: FD " << fd <<
}
}
-
BodyPipe::Pointer
ConnStateData::expectRequestBody(int64_t size)
{
CBDATA_CLASS(ClientSocketContext);
};
-
class ConnectionDetail;
#if USE_SSL
namespace Ssl
}
}
-
void
clientReplyContext::sendClientUpstreamResponse()
{
}
}
-
/* A write has completed, what is the next status based on the
* canonical request data?
* 1 something is wrong
httpHdrMangleList(hdr, request, ROR_REPLY);
}
-
void
clientReplyContext::cloneReply()
{
assert (context);
assert(context->http == http);
-
clientStreamNode *next = ( clientStreamNode *)aNode->node.next->data;
if (!context->ourNode)
startError(err);
-
return;
}
return;
}
-
-
/* Using this breaks the client layering just a little!
*/
void
*
*/
-
/*
* General logic of request processing:
*
#include "ssl/ServerBump.h"
#endif
-
#if LINGERING_CLOSE
#define comm_close comm_lingering_close
#endif
*
*/
-
#ifndef SQUID_CLIENTSIDEREQUEST_H
#define SQUID_CLIENTSIDEREQUEST_H
#endif
}
-
/**
* Return whether the FD has a pending completed callback.
* NP: does not work.
Comm::SetSelect(fd, COMM_SELECT_READ, NULL, NULL, 0);
}
-
/**
* synchronous wrapper around udp socket functions
*/
return send(s, buf, len, flags);
}
-
bool
comm_has_incomplete_write(int fd)
{
comm_empty_os_read_buffers(fd);
-
AsyncCall::Pointer completeCall=commCbCall(5,4, "comm_close_complete",
FdeCbPtrFun(comm_close_complete, NULL));
FdeCbParams &completeParams = GetCommParams<FdeCbParams>(completeCall);
fd_table[fd].closeHandler = call;
}
-
// remove function-based close handler
void
comm_remove_close_handler(int fd, CLCB * handler, void *data)
commPlanHalfClosedCheck(); // make sure this fd will be checked again
}
-
CommRead::CommRead() : conn(NULL), buf(NULL), len(0), callback(NULL) {}
CommRead::CommRead(const Comm::ConnectionPointer &c, char *buf_, int len_, AsyncCall::Pointer &callback_)
SQUIDCEXTERN void commCloseAllSockets(void);
SQUIDCEXTERN void checkTimeouts(void);
-
//typedef void IOACB(int fd, int nfd, Comm::ConnectionPointer details, comm_err_t flag, int xerrno, void *data);
extern void comm_add_close_handler(int fd, CLCB *, void *);
extern void comm_add_close_handler(int fd, AsyncCall::Pointer &);
extern void comm_remove_close_handler(int fd, CLCB *, void *);
extern void comm_remove_close_handler(int fd, AsyncCall::Pointer &);
-
extern int comm_has_pending_read_callback(int fd);
extern bool comm_monitors_read(int fd);
//extern void comm_read(const Comm::ConnectionPointer &conn, char *buf, int len, IOCB *handler, void *data);
int size; /**< maximum number of elements in array */
} devpoll_update;
-
/* STATIC VARIABLES */
static int devpoll_fd; /**< handle to /dev/poll device */
static int max_poll_time = 1000; /**< maximum milliseconds to spend in poll */
/* PROTOTYPES */
static void commDevPollRegisterWithCacheManager(void);
-
/* PRIVATE FUNCTIONS */
/** \brief Write batched file descriptor event changes to poll device
*
devpoll_update.pfds[devpoll_update.cur].revents = 0;
}
-
static void commIncomingStats(StoreEntry *sentry)
{
storeAppendPrintf(sentry, "Total number of devpoll loops: %ld\n", statCounter.select_loops);
statCounter.select_fds_hist.dump(sentry, statHistIntDumper);
}
-
static void
commDevPollRegisterWithCacheManager(void)
{
);
}
-
/* PUBLIC FUNCTIONS */
/** \brief Initialise /dev/poll support
F->timeout = squid_curtime + timeout;
}
-
/** \brief Clear polling of file handle (both read and write)
*
* @param fd file descriptor to clear polling on
SetSelect(fd, COMM_SELECT_READ, NULL, NULL, 0);
}
-
/** \brief Do poll and trigger callback functions as appropriate
*
* Check all connections for new connections and input data that is to be
static void commEPollRegisterWithCacheManager(void);
-
/* XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX */
/* Public functions */
-
/*
* This is a needed exported function which will be called to initialise
* the network loop code.
SetSelect(fd, 0, NULL, NULL, 0);
}
-
static void commIncomingStats(StoreEntry * sentry);
static void
}
}
-
-
/* XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX */
/* Public functions */
-
/*
* comm_select_init
*
#define commCheckDnsIncoming (++dns_io_events > (incoming_dns_interval>> INCOMING_FACTOR))
#define commCheckTcpIncoming (++tcp_io_events > (incoming_tcp_interval>> INCOMING_FACTOR))
-
void
Comm::SetSelect(int fd, unsigned int type, PF * handler, void *client_data, time_t timeout)
{
return COMM_TIMEOUT;
}
-
static void
comm_poll_dns_incoming(void)
{
statCounter.comm_dns_incoming.count(nevents);
}
-
static void
commPollRegisterWithCacheManager(void)
{
static void commUpdateReadBits(int fd, PF * handler);
static void commUpdateWriteBits(int fd, PF * handler);
-
static struct timeval zero_tv;
static fd_set global_readfds;
static fd_set global_writefds;
return 0;
}
-
static void
commIncomingStats(StoreEntry * sentry)
{
static void commUpdateReadBits(int fd, PF * handler);
static void commUpdateWriteBits(int fd, PF * handler);
-
static struct timeval zero_tv;
static fd_set global_readfds;
static fd_set global_writefds;
return 0;
}
-
static void
commIncomingStats(StoreEntry * sentry)
{
#ifndef SQUID_COMM_POLL_H
#define SQUID_COMM_POLL_H
-
#endif /* SQUID_COMM_POLL_H */
/* "safe" get secription */
static const char *ctx_get_descr(Ctx ctx);
-
Ctx
ctx_enter(const char *descr)
{
RegisterWithCacheManager();
}
-
void
DelayPools::InitDelayData()
{
return ( (ntohl(net.s_addr) >> 8) & 0xff);
}
-
ClassCHostPool::ClassCHostPool()
{
DelayPools::registerForUpdates (this);
return fd;
}
-
/* close a disk file. */
void
file_close(int fd)
q << "," << (int) q->buf_offset << ", " << q->len << ", " <<
len << " FD " << fd << ")");
-
assert(q->buf_offset <= q->len);
if (q->buf_offset == q->len) {
PROF_stop(diskHandleWrite);
}
-
/* write block to a file */
/* write back queue. Only one writer at a time. */
/* call a handle when writing is complete. */
PROF_stop(diskHandleRead);
}
-
/* start read operation */
/* buffer must be allocated from the caller.
* It must have at least req_len space in there.
/* dlink are Mem-pooled */
#include "MemPool.h"
-
dlink_list ClientActiveRequests;
MemAllocator *dlink_node_pool = NULL;
++npc;
}
-
static void
idnsFreeNameservers(void)
{
npc = npc_alloc = 0;
}
-
-
static void
idnsParseNameservers(void)
{
#endif /* HAVE_RES_INIT */
}
-
/**
* \ingroup dnsserver
*
SC_ENUM_END
} http_hdr_sc_type;
-
typedef enum _mem_status_t {
NOT_IN_MEMORY,
IN_MEMORY
psError
} HttpMsgParseState;
-
enum {
PCTILE_HTTP,
PCTILE_ICP_QUERY,
ROR_REPLY
};
-
/* CygWin & Windows NT Port */
#if _SQUID_WINDOWS_
/*
* Config.errorDirectory)
*/
-
#if !defined(DEFAULT_SQUID_ERROR_DIR)
/** Where to look for errors if config path fails.
\note Please use ./configure --datadir=/path instead of patching
ElementList &operator=(ElementList const&);
};
-
#endif /* SQUID_ELEMENTLIST_H */
typedef ESIContext::esiKick_t esiKick_t;
-
/* some core operators */
/* esiComment */
static FREE esiRemoveFree;
static ESIElement * esiRemoveNew(void);
-
/* esiTry */
struct esiTry : public ESIElement {
return reading_;
}
-
ESIStreamContext::ESIStreamContext() : finished(false), include (NULL), localbuffer (new ESISegment), buffer (NULL)
{}
/* ESIContext */
static ESIContext *ESIContextNew(HttpReply *, clientStreamNode *, ClientHttpRequest *);
-
void *
ESIContext::operator new(size_t byteCount)
{
return;
}
-
if (context->flags.oktosend && context->flags.finished) {
StoreIOBuffer tempBuffer;
assert (!context->outbound.getRaw());
if (len == 0)
len = 1; /* tell the caller we sent something (because we sent headers */
-
cbdataReferenceDone (templock);
debugs (86,5,"ESIContext::send: this=" << this << " sent " << len);
extern ErrorState *clientBuildError (err_type, http_status, char const *, Ip::Address &, HttpRequest *);
-
/* This can ONLY be used before we have sent *any* data to the client */
void
ESIContext::fail ()
parent->provideData (data, this);
}
-
esiChoose::esiChoose(esiChoose const &old) : chosenelement(-1), otherwise (NULL), parent (NULL)
{
for (size_t counter = 0; counter < old.elements.size(); ++counter) {
return 1;
}
-
int
evalor(stackmember * stack, int *depth, int whereAmI, stackmember * candidate)
{
/* debugs(86, DBG_IMPORTANT, "?= " << srv.value.integral << " "); */
return 0;
-
}
int
/* debugs(86, DBG_IMPORTANT, "?= " << srv.value.integral << " "); */
return 0;
-
}
int
/* debugs(86, DBG_IMPORTANT, "?= " << srv.value.integral << " "); */
return 0;
-
}
int
return;
}
-
/* after the write to the user occurs, (ie here, or in a callback)
* we call */
if (clientHttpRequestStatus(-1, http)) {
return rv;
}
-
-
/* ESIInclude */
ESIInclude::~ESIInclude()
{
tempheaders.removeHopByHopEntries();
}
-
void
ESIInclude::Start (ESIStreamContext::Pointer stream, char const *url, ESIVarState *vars)
{
virtual ~ESIParserClient() {};
};
-
/* for RefCountable */
#include "RefCount.h"
void adsorbList (ESISegment::Pointer from);
size_t space() const;
-
char buf[HTTP_REQBUF_SZ];
size_t len; /* how much data has been pushed into this */
Pointer next;
parent = NULL;
}
-
void
esiSequence::provideData (ESISegment::Pointer data, ESIElement *source)
{
debugs(86, 5, "esiSequence::provideData: " << this << " data provided during processing");
debugs(86, 5, "esiSequence::provideData " << this << " " << data.getRaw() << " " << source);
-
/* when data is provided, the element *must* be completed */
/* XXX: when the callback model is complete,
* we can introduce 'finished'. And then this rule can be
"OTHER"
};
-
void
ESIVarState::Variable::eval (ESIVarState &state, char const *subref, char const *found_default) const
{
delete currentFunction;
}
-
/* XXX FIXME: this should be comma delimited, no? */
void
ESIVarState::buildVary (HttpReply *rep)
char *browserversion;
};
-
-
#endif /* SQUID_ESIVARSTATE_H */
/* The list of event processes */
-
static OBJH eventDump;
static const char *last_event_ran = NULL;
os << ')';
}
-
ev_entry::ev_entry(char const * aName, EVH * aFunction, void * aArgument, double evWhen,
int aWeight, bool haveArgument) : name(aName), func(aFunction),
arg(haveArgument ? cbdataReference(aArgument) : aArgument), when(evWhen), weight(aWeight),
external_acl_cache_delete(this, static_cast<external_acl_entry *>(lru_list.tail->data));
}
-
/******************************************************************
* external acl type
*/
#include "profiler/Profiler.h"
#include "SquidTime.h"
-
// Solaris and possibly others lack MSG_NOSIGNAL optimization
// TODO: move this into compat/? Use a dedicated compat file to avoid dragging
// sys/types.h and sys/socket.h into the rest of Squid??
#include "ssl/ErrorDetail.h"
#endif
-
/// Convert a string to NULL pointer if it is ""
#define strOrNull(s) ((s)==NULL||(s)[0]=='\0'?NULL:(s))
doint = 1;
break;
-
case LFT_TIME_LOCALTIME:
case LFT_TIME_GMT: {
*
*/
-
#include "squid.h"
#include "AccessLogEntry.h"
#include "acl/FilledChecklist.h"
}
}
-
/**** CALLBACK WRAPPERS ************************************************************/
static void
}
}
-
/**** STATIC MEMBER FUNCTIONS *************************************************/
bool
class ErrorState;
class HttpRequest;
-
/**
* Returns the TOS value that we should be setting on the connection
* to the server, based on the ACL.
*/
nfmark_t GetNfmarkToServer(HttpRequest * request);
-
class FwdState : public RefCountable
{
public:
return request_time.tv_sec ? tvSubMsec(request_time, current_time) : -1;
}
-
/**
\ingroup FQDNCacheInternal
* Removes the given fqdncache entry
#endif
-
/**
\ingroup FQDNCacheAPI
*
return NULL;
}
-
/**
\ingroup FQDNCacheInternal
*
fqdncacheLockEntry(fce);
}
-
#if SQUID_SNMP
/**
* \ingroup FQDNCacheAPI
static Fs::Ufs::StoreFSufs<Fs::Ufs::UFSSwapDir> *AufsInstance;
#endif
-
#if HAVE_FS_DISKD
static Fs::Ufs::StoreFSufs<Fs::Ufs::UFSSwapDir> *DiskdInstance;
#endif
static Rock::StoreFileSystem *RockInstance = NULL;
#endif
-
/* TODO: Modify coss code to:
* (a) remove the StoreFScoss::GetInstance method,
* (b) declare the StoreFScoss::stats as static and
StoreFScoss &CossInstance = StoreFScoss::GetInstance();
#endif
-
void Fs::Init()
{
AufsInstance = new Fs::Ufs::StoreFSufs<Fs::Ufs::UFSSwapDir>("DiskThreads", "aufs");;
#endif
-
#if HAVE_FS_DISKD
DiskdInstance = new Fs::Ufs::StoreFSufs<Fs::Ufs::UFSSwapDir>("DiskDaemon", "diskd");;
#endif
}
-
void Fs::Clean()
{
#if HAVE_FS_UFS
delete AufsInstance;
#endif
-
#if HAVE_FS_DISKD
delete DiskdInstance;
#endif
#include "SwapDir.h"
#include "DiskIO/IORequestor.h"
-
#ifndef COSS_MEMBUF_SZ
#define COSS_MEMBUF_SZ 1048576
#endif
#define COSS_ALLOC_ALLOCATE 1
#define COSS_ALLOC_REALLOC 2
-
/// \ingroup COSS
class CossSwapDir : public SwapDir, public IORequestor
{
/// \ingroup COSS
extern void storeCossStartMembuf(CossSwapDir * SD);
-
#include "StoreSearch.h"
/// \ingroup COSS
open, create, close, unlink, read, write, stripe_write;
};
-
class CacheManager;
#include "StoreFileSystem.h"
dlink_node node;
};
-
-
/**
\ingroup COSS
* Per-storeiostate info
/// \ingroup COSS
typedef struct _cossindex CossIndexNode;
-
/**
\ingroup COSS
* Whether the coss system has been setup or not
debugs(79, 3, "storeCossWriteMemBufDone: buf " << cossWrite->membuf << ", len " << len);
-
if (errflag) {
++ StoreFScoss::GetInstance().stats.stripe_write.fail;
debugs(79, DBG_IMPORTANT, "storeCossWriteMemBufDone: got failure (" << errflag << ")");
++ StoreFScoss::GetInstance().stats.stripe_write.success;
}
-
dlinkDelete(&cossWrite->membuf->node, &membufs);
cbdataFree(cossWrite->membuf);
-- StoreFScoss::GetInstance().stats.stripes;
&CossSwapDir::optionBlockSizeParse,
&CossSwapDir::optionBlockSizeDump));
-
ConfigOption *ioOptions = NULL;
if (io)
}
}
-
void
CossSwapDir::reconfigure()
{
CossState::CossState(CossSwapDir *aCSD):SD (aCSD)
{}
-
/*
* This routine sucks. I want to rewrite it when possible, and I also think
* that we should check after creatmembuf() to see if the object has a
CBDATA_CLASS2(ReadRequest);
};
-
/// \ingroup Rock
class WriteRequest: public ::WriteRequest
{
CBDATA_CLASS2(WriteRequest);
};
-
} // namespace Rock
#endif /* SQUID_FS_ROCK_IO_REQUESTS_H */
Rock::IoState::Pointer sio;
};
-
void
Rock::IoState::callBack(int errflag)
{
#include "fs/rock/RockStoreFileSystem.h"
#include "fs/rock/RockSwapDir.h"
-
Rock::StoreFileSystem::StoreFileSystem()
{
FsAdd(*this);
return false;
}
-
bool
Rock::SwapDir::canStore(const StoreEntry &e, int64_t diskSpaceNeeded, int &load) const
{
repl->Add(repl, &e, &e.repl);
}
-
void
Rock::SwapDir::ignoreReferences(StoreEntry &e)
{
}
-
namespace Rock
{
RunnerRegistrationEntry(rrAfterConfig, SwapDirRr);
Vector<SwapDir::DirMap::Owner *> owners;
};
-
} // namespace Rock
#endif /* SQUID_FS_ROCK_SWAP_DIR_H */
void *cbdata;
};
-
} /* namespace Ufs */
} /* namespace Fs */
#include "UFSStrategy.h"
#include "UFSStoreState.h"
-
CBDATA_NAMESPACED_CLASS_INIT(Fs::Ufs,UFSStoreState);
void *
theFile->read(new ReadRequest(buf,aOffset,size));
}
-
/*
* DPW 2006-05-24
* This, the public write interface, places the write request at the end
drainWriteQueue();
}
-
/*
* DPW 2006-05-24
* This, the private write method, calls the lower level write for the
#endif
-
cleanLog = state;
return 0;
}
repl->Add(repl, e, &e->repl);
}
-
void
Fs::Ufs::UFSSwapDir::replacementRemove(StoreEntry * e)
{
if (reply)
err->ftp.reply = xstrdup(reply);
-
HttpReply *newrep = err->BuildHttpReply();
delete err;
entry->unlock();
}
-
/// \ingroup ServerProtocolFTPInternal
static void
ftpReadTransferDone(FtpStateData * ftpState)
/* for iostats */
#include "structs.h"
-
extern char *ConfigFile; /* NULL */
extern char *IcpOpcodeStr[];
extern char tmp_error_buf[ERROR_BUF_SZ];
break;
} /* HTML_DIR, HTML_INDEX_RESULT */
-
case gopher_ds::HTML_CSO_RESULT: {
if (line[0] == '-') {
int code, recno;
break;
}
-
}
}
#define HELPER_MAX_ARGS 64
-
/** Initial Squid input buffer size. Helper responses may exceed this, and
* Squid will grow the input buffer as needed, up to ReadBufMaxSize.
*/
static void StatefulEnqueue(statefulhelper * hlp, helper_stateful_request * r);
static bool helperStartStats(StoreEntry *sentry, void *hlp, const char *label);
-
CBDATA_CLASS_INIT(helper);
CBDATA_TYPE(helper_server);
CBDATA_CLASS_INIT(statefulhelper);
helperStatefulKickQueue(hlp);
}
-
void
helperSubmit(helper * hlp, const char *buf, HLPCB * callback, void *data)
{
debugs(84, 5, "helperStatefulHandleRead: " << len << " bytes from " <<
hlp->id_name << " #" << srv->index + 1);
-
if (flag != COMM_OK || len == 0) {
srv->closePipesSafely();
return;
return NULL;
}
-
static void
helperDispatchWriteDone(const Comm::ConnectionPointer &conn, char *buf, size_t len, comm_err_t flag, int xerrno, void *data)
{
/* nothing! */
}
-
static void
helperStatefulDispatch(helper_stateful_server * srv, helper_stateful_request * r)
{
++ hlp->stats.requests;
}
-
static void
helperKickQueue(helper * hlp)
{
SQUIDCEXTERN void helperStatefulReleaseServer(helper_stateful_server * srv);
SQUIDCEXTERN void *helperStatefulServerGetData(helper_stateful_server * srv);
-
#endif /* SQUID_HELPER_H */
static int old_squid_format = 0;
-
static ssize_t htcpBuildPacket(char *buf, size_t buflen, htcpStuff * stuff);
static htcpSpecifier *htcpUnpackSpecifier(char *buf, int sz);
static htcpDetail *htcpUnpackDetail(char *buf, int sz);
CallJobHere(11, 3, this, HttpStateData, HttpStateData::processReply);
}
-
/**
* returns true if the peer can support connection pinning
*/
if (request->flags.spoof_client_ip)
client_addr = request->client_addr;
-
if (request->flags.pinned) {
ispinned = true;
} else if (request->flags.connection_auth && request->flags.auth_sent) {
case HDR_TRANSFER_ENCODING: /** \par Transfer-Encoding: */
break;
-
/** \par OTHER headers I haven't bothered to track down yet. */
case HDR_AUTHORIZATION:
#endif /* USE_ICMP */
-
/**
* Implements the squid interface to access ICMP operations
*
#define ip_dst daddr
#endif
-
/* Native Windows port doesn't have netinet support, so we emulate it.
At this time, Cygwin lacks icmp support in its include files, so we need
to use the native Windows port definitions.
icmp6_pktsize = sizeof(struct icmp6_hdr);
-
// Fill Icmp6 ECHO data content
echo = (icmpEchoData *) (pkt + sizeof(icmp6_hdr));
echo->opcode = (unsigned char) opcode;
#define ip6_hlim // MAX hops (always 64, but no guarantee)
#define ip6_hops // HOPS!!! (can it be true??)
-
ip = (struct ip6_hdr *) pkt;
pkt += sizeof(ip6_hdr);
#endif /* USE_ICMP */
-
IcmpSquid::IcmpSquid() : Icmp()
{
; // nothing new.
Close();
}
-
#if USE_ICMP
void
memFree(x, MEM_NET_DB_NAME);
}
-
static void
netdbExchangeHandleReply(void *data, StoreIOBuffer receivedData)
{
#endif /* USE_ICMP */
-
/* PUBLIC FUNCTIONS */
void
#endif
}
-
#if 0 // AYJ: Looks to be unused code.
int
netdbHops(Ip::Address &addr)
#endif
}
-
void
netdbBinaryExchange(StoreEntry * s)
{
/* for struct peer */
#include "structs.h"
-
SQUIDCEXTERN void netdbInit(void);
SQUIDCEXTERN void netdbHandlePingReply(const Ip::Address &from, int hops, int rtt);
HTTPMSGUNLOCK(request);
}
-
/* End ICPState */
/* ICP2State */
delete this;
}
-
/// \ingroup ServerProtocolICPInternal3
/* Currently Harvest cached-2.x uses ICP_VERSION_3 */
void
return new ACLIdent(*this);
}
-
IdentLookup IdentLookup::instance_;
IdentLookup *
static void LookupDone(const char *ident, void *data);
};
-
#include "acl/Acl.h"
#include "acl/Data.h"
*/
bool ApplyMask(const unsigned int cidr, int mtype);
-
/** Return the ASCII equivalent of the address
* Semantically equivalent to the IPv4 inet_ntoa()
* eg. 127.0.0.1 (IPv4) or ::1 (IPv6)
static const struct in6_addr v6_noaddr;
};
-
inline std::ostream &
operator << (std::ostream &os, const Address &ipa)
{
*/
inline void StopInterception(const char *str);
-
private:
/**
*/
bool PfInterception(const Comm::ConnectionPointer &newConn, int silent);
-
int transparentActive_;
int interceptActive_;
time_t lastReported_; /**< Time of last error report. Throttles NAT error display to 1 per minute */
#include "ip/QosConfig.h"
#include "Store.h"
-
void
Ip::Qos::getTosFromServer(fde *clientFde, const int server_fd)
{
#include <stdexcept>
#endif
-
CPPUNIT_TEST_SUITE_REGISTRATION( testIpAddress );
/* so that we don't break POD dependency just for the test */
CPPUNIT_ASSERT( memcmp( &insock, &outsock, sizeof(struct sockaddr_in6)) == 0 );
}
-
void
testIpAddress::testCopyConstructor()
{
Ip::Address inIPA(insock);
Ip::Address outIPA(inIPA);
-
/* test stored values */
CPPUNIT_ASSERT( !outIPA.IsAnyAddr() );
CPPUNIT_ASSERT( !outIPA.IsNoAddr() );
Ip::Address anIPA = "192.168.100.12";
-
/* test stored values */
CPPUNIT_ASSERT( !anIPA.IsAnyAddr() );
CPPUNIT_ASSERT( !anIPA.IsNoAddr() );
anIPA.GetInAddr(outval);
CPPUNIT_ASSERT( memcmp( &expectval, &outval, sizeof(struct in_addr)) == 0 );
-
/* POKE NtoA display function to see what it is doing */
anIPA.NtoA(ntoabuf,MAX_IPSTRLEN);
CPPUNIT_ASSERT( !anIPA.IsAnyAddr() );
anIPA.GetInAddr(outval);
CPPUNIT_ASSERT( memcmp( &expectval, &outval, sizeof(struct in_addr)) == 0 );
-
-
/* POKE ToHostname display function to see what it is doing */
anIPA.ToHostname(hostbuf,MAX_IPSTRLEN);
CPPUNIT_ASSERT( !anIPA.IsAnyAddr() );
anIPA.GetInAddr(outval);
CPPUNIT_ASSERT( memcmp( &expectval, &outval, sizeof(struct in_addr)) == 0 );
-
/* POKE ToURL display function to see what it is doing */
anIPA.ToURL(urlbuf,MAX_IPSTRLEN);
CPPUNIT_ASSERT( !anIPA.IsAnyAddr() );
*
*/
-
#include "squid.h"
#include "base/Subscription.h"
#include "base/TextException.h"
CBDATA_NAMESPACED_CLASS_INIT(Ipc, Coordinator);
Ipc::Coordinator* Ipc::Coordinator::TheInstance = NULL;
-
Ipc::Coordinator::Coordinator():
Port(coordinatorAddr)
{
#ifndef SQUID_IPC_COORDINATOR_H
#define SQUID_IPC_COORDINATOR_H
-
#include "Array.h"
#include "ipc/Messages.h"
#include "ipc/Port.h"
CBDATA_CLASS2(Coordinator);
};
-
} // namespace Ipc
#endif /* SQUID_IPC_COORDINATOR_H */
#include "Debug.h"
#include "ipc/FdNotes.h"
-
const char *
Ipc::FdNote(int fdNoteId)
{
} // namespace Ipc;
-
#endif /* SQUID_IPC_FD_NOTES_H */
#include "ipc/Port.h"
#include "ipc/TypedMsgHdr.h"
-
CBDATA_NAMESPACED_CLASS_INIT(Ipc, Forwarder);
Ipc::Forwarder::RequestsMap Ipc::Forwarder::TheRequestsMap;
#include "ipc/Request.h"
#include <map>
-
namespace Ipc
{
#include "MemBuf.h"
#include <algorithm>
-
CBDATA_NAMESPACED_CLASS_INIT(Ipc, Inquirer);
Ipc::Inquirer::RequestsMap Ipc::Inquirer::TheRequestsMap;
#include "ipc/StrandCoords.h"
#include <map>
-
namespace Ipc
{
#include "SquidString.h"
-
/// Squid child, including current forked process info and
/// info persistent across restarts
class Kid
status_type status; ///< exit status of a stopped kid
};
-
// TODO: processes may not be kids; is there a better place to put this?
/// process kinds
/// ProcessKind for the current process
extern int TheProcessKind;
-
#endif /* SQUID_IPC_KID_H */
#include "Array.h"
#include "ipc/Kid.h"
-
/// a collection of kids
class Kids
{
typedef char KidName[64]; ///< Squid process name (e.g., "squid-coord")
extern KidName TheKidName; ///< current Squid process name
-
#endif /* SQUID_IPC_KIDS_H */
} // namespace Ipc;
-
#endif /* SQUID_IPC_MESSAGES_H */
*
*/
-
#include "squid.h"
#include "comm.h"
#include "CommCalls.h"
const char Ipc::coordinatorAddr[] = DEFAULT_STATEDIR "/coordinator.ipc";
const char Ipc::strandAddrPfx[] = DEFAULT_STATEDIR "/kid";
-
Ipc::Port::Port(const String& aListenAddr):
UdsOp(aListenAddr)
{
#ifndef SQUID_IPC_PORT_H
#define SQUID_IPC_PORT_H
-
#include "SquidString.h"
#include "ipc/UdsOp.h"
-
namespace Ipc
{
-
/// Waits for and receives incoming IPC messages; kids handle the messages
class Port: public UdsOp
{
TypedMsgHdr buf; ///< msghdr struct filled by Comm
};
-
extern const char coordinatorAddr[]; ///< where coordinator listens
extern const char strandAddrPfx[]; ///< strand's listening address prefix
} // namespace Ipc
-
#endif /* SQUID_IPC_PORT_H */
return id;
}
-
/* QueueReader */
InstanceIdDefinitions(Ipc::QueueReader, "ipcQR");
return sizeof(QueueReaders) + sizeof(QueueReader) * capacity;
}
-
// OneToOneUniQueue
Ipc::OneToOneUniQueue::OneToOneUniQueue(const unsigned int aMaxItemSize, const int aCapacity):
return sizeof(OneToOneUniQueue) + maxItemSize * size;
}
-
/* OneToOneUniQueues */
Ipc::OneToOneUniQueues::OneToOneUniQueues(const int aCapacity, const unsigned int maxItemSize, const int queueCapacity): theCapacity(aCapacity)
return *reinterpret_cast<const OneToOneUniQueue *>(queue);
}
-
// FewToFewBiQueue
Ipc::FewToFewBiQueue::Owner *
int theLastPopProcessId; ///< the ID of the last process we tried to pop() from
};
-
// OneToOneUniQueue
template <class Value>
return wasEmpty && (!reader || reader->raiseSignal());
}
-
// OneToOneUniQueues
inline OneToOneUniQueue &
return *reinterpret_cast<const OneToOneUniQueue *>(queue);
}
-
// FewToFewBiQueue
template <class Value>
++stats.count;
}
-
/* Ipc::ReadWriteLockStats */
Ipc::ReadWriteLockStats::ReadWriteLockStats()
Atomic::Word writers; ///< number of writers trying to modify protected data
};
-
/// approximate stats of a set of ReadWriteLocks
class ReadWriteLockStats
{
#include "ipc/forward.h"
#include "RefCount.h"
-
namespace Ipc
{
unsigned int requestId; ///< unique for sender; matches request w/ response
};
-
} // namespace Ipc
#endif /* SQUID_IPC_REQUEST_H */
#include "ipc/forward.h"
#include "RefCount.h"
-
namespace Ipc
{
return os;
}
-
} // namespace Ipc
#endif /* SQUID_IPC_RESPONSE_H */
return addr.compareWhole(p.addr) < 0;
}
-
-
Ipc::SharedListenRequest::SharedListenRequest(): requestorId(-1), mapId(-1)
{
// caller will then set public data members
hdrMsg.putPod(*this);
}
-
Ipc::SharedListenResponse::SharedListenResponse(int aFd, int anErrNo, int aMapId):
fd(aFd), errNo(anErrNo), mapId(aMapId)
{
hdrMsg.putFd(fd);
}
-
void Ipc::JoinSharedListen(const OpenListenerParams ¶ms,
AsyncCall::Pointer &callback)
{
} // namespace Ipc;
-
#endif /* SQUID_IPC_SHARED_LISTEN_H */
} // namespace Ipc;
-
#endif /* SQUID_IPC_START_LISTENING_H */
" in map [" << path << ']');
}
-
/* Ipc::StoreMapSlot */
Ipc::StoreMapSlot::StoreMapSlot(): state(Empty)
return sharedExtras[fileno];
}
-
} // namespace Ipc
// We do not reuse FileMap because we cannot control its size,
CBDATA_NAMESPACED_CLASS_INIT(Ipc, Strand);
-
Ipc::Strand::Strand():
Port(MakeAddr(strandAddrPfx, KidIdentifier)),
isRegistered(false)
CBDATA_CLASS2(Strand);
};
-
}
-
#endif /* SQUID_IPC_STRAND_H */
*
*/
-
#include "squid.h"
#include "Debug.h"
#include "ipc/Messages.h"
#include "ipc/StrandCoord.h"
#include "ipc/TypedMsgHdr.h"
-
Ipc::StrandCoord::StrandCoord(): kidId(-1), pid(0)
{
}
hdrMsg.putString(tag);
}
-
Ipc::HereIamMessage::HereIamMessage(const StrandCoord &aStrand):
strand(aStrand)
{
StrandCoord strand; ///< registrant coordinates and related details
};
-
-
} // namespace Ipc;
#endif /* SQUID_IPC_STRAND_COORD_H */
*
*/
-
#include "squid.h"
#include "ipc/Messages.h"
#include "ipc/StrandSearch.h"
#include "ipc/TypedMsgHdr.h"
-
Ipc::StrandSearchRequest::StrandSearchRequest(): requestorId(-1)
{
}
hdrMsg.putString(tag);
}
-
/* StrandSearchResponse */
Ipc::StrandSearchResponse::StrandSearchResponse(const Ipc::StrandCoord &aStrand):
*
*/
-
#include "squid.h"
#include "protos.h"
#include "base/TextException.h"
offset = 0;
}
-
-
int
Ipc::TypedMsgHdr::type() const
{
*
*/
-
#include "squid.h"
#include "comm.h"
#include "CommCalls.h"
#include "base/TextException.h"
#include "ipc/UdsOp.h"
-
Ipc::UdsOp::UdsOp(const String& pathAddr):
AsyncJob("Ipc::UdsOp"),
address(PathToAddress(pathAddr)),
timedout(); // our kid handles communication timeout
}
-
struct sockaddr_un
Ipc::PathToAddress(const String& pathAddr) {
assert(pathAddr.size() != 0);
return unixAddr;
}
-
CBDATA_NAMESPACED_CLASS_INIT(Ipc, UdsSender);
Ipc::UdsSender::UdsSender(const String& pathAddr, const TypedMsgHdr& aMessage):
mustStop("timedout");
}
-
void Ipc::SendMessage(const String& toAddress, const TypedMsgHdr &message)
{
AsyncJob::Start(new UdsSender(toAddress, message));
#ifndef SQUID_IPC_ASYNCUDSOP_H
#define SQUID_IPC_ASYNCUDSOP_H
-
#include "SquidString.h"
#include "base/AsyncJob.h"
#include "cbdata.h"
/// converts human-readable filename path into UDS address
extern struct sockaddr_un PathToAddress(const String &pathAddr);
-
-
// XXX: move UdsSender code to UdsSender.{cc,h}
/// attempts to send an IPC message a few times, with a timeout
class UdsSender: public UdsOp
CBDATA_CLASS2(UdsSender);
};
-
void SendMessage(const String& toAddress, const TypedMsgHdr& message);
/// import socket fd from another strand into our Comm state
const Comm::ConnectionPointer & ImportFdIntoComm(const Comm::ConnectionPointer &conn, int socktype, int protocol, FdNoteId noteId);
-
}
#endif /* SQUID_IPC_ASYNCUDSOP_H */
#include <iostream>
#endif
-
std::ostream &Ipc::Mem::operator <<(std::ostream &os, const PageId &page)
{
return os << "sh_page" << page.pool << '.' << page.number;
#include "ipc/mem/Page.h"
#include "ipc/mem/PagePool.h"
-
// Ipc::Mem::PagePool
Ipc::Mem::PagePool::Owner *
/// used to mark a stack slot available for storing free page offsets
const Ipc::Mem::PageStack::Value Writable = 0;
-
Ipc::Mem::PageStack::PageStack(const uint32_t aPoolId, const unsigned int aCapacity, const size_t aPageSize):
thePoolId(aPoolId), theCapacity(aCapacity), thePageSize(aPageSize),
theSize(theCapacity),
RunnerRegistrationEntry(rrAfterConfig, SharedMemPagesRr);
-
void
SharedMemPagesRr::run(const RunnerRegistry &r)
{
/// converts page handler into a temporary writeable shared memory pointer
char *PagePointer(const PageId &page);
-
/* Limits and statistics */
/// the total number of shared memory pages that can be in use at any time
#include <sys/stat.h>
#include <unistd.h>
-
// test cases change this
const char *Ipc::Mem::Segment::BasePath = DEFAULT_STATEDIR;
return request_time.tv_sec ? tvSubMsec(request_time, current_time) : -1;
}
-
-
/**
\ingroup IPCacheInternal
*
stat_ipcache_get, 0, 1);
}
-
/**
\ingroup IPCacheAPI
*
eventAdd("logfileFlush", logfileFlushEvent, lf, 1.0, 1);
}
-
/* External code */
int
lf->data = NULL;
}
-
-
/*
* This code expects the path to be syslog:<priority>
*/
lf->data = NULL;
}
-
-
/*
* This code expects the path to be //host:port
*/
lf->data = NULL;
}
-
-
/*
* This code expects the path to be //host:port
*/
*
*/
-
#include "squid.h"
#include "AccessLogEntry.h"
#include "Store.h"
MemPools[type]->zeroOnPush(zeroOnPush);
}
-
/* find appropriate pool and use it (pools always init buffer with 0s) */
void *
memAllocate(mem_type type)
#include "SquidTime.h"
#include "Store.h"
-
Mgr::Action::Action(const Command::Pointer &aCmd): cmd(aCmd)
{
Must(cmd != NULL);
Action(const CommandPointer &aCmd);
virtual ~Action();
-
/* for local Cache Manager use */
/// collect + fillEntry: collect local information and fill the store entry
/// prepare store entry, dump info, close store entry (if possible)
void fillEntry(StoreEntry *entry, bool writeHttpHeader);
-
/* for global Coordinator use */
/// incrementally merge in remote information (of the same action type)
virtual void add(const Action &action);
-
/* global-local communication */
/// respond to Coordinator request; default is to collect and sendResponse
/// notify Coordinator that this action is done with local processing
void sendResponse(unsigned int requestId);
-
/* Action properties */
/// whether at least some local kid info can be combined and, hence, the
*/
virtual void dump(StoreEntry *entry) {}
-
private:
const CommandPointer cmd; ///< the command that caused this action
-
private:
Action(const Action &); // not implemented
Action &operator= (const Action &); // not implemented
#include "mgr/ActionWriter.h"
#include "Store.h"
-
CBDATA_NAMESPACED_CLASS_INIT(Mgr, ActionWriter);
Mgr::ActionWriter::ActionWriter(const Action::Pointer &anAction, const Comm::ConnectionPointer &conn):
#include "HttpRequestMethod.h"
#include "mgr/StoreToCommWriter.h"
-
namespace Mgr
{
/* a collection of simple, mostly stateless actions */
-
namespace Mgr
{
IndexAction(const CommandPointer &cmd);
};
-
/// returns available Cache Manager actions and their access requirements
class MenuAction: public Action
{
MenuAction(const CommandPointer &cmd);
};
-
/// shuts Squid down
class ShutdownAction: public Action
{
#include "SquidTime.h"
#include "Store.h"
-
extern void GetCountersStats(Mgr::CountersActionData& stats);
extern void DumpCountersStats(Mgr::CountersActionData& stats, StoreEntry* sentry);
#include "mgr/Action.h"
#include <sys/time.h>
-
namespace Mgr
{
#include "mgr/Response.h"
#include "Store.h"
-
CBDATA_NAMESPACED_CLASS_INIT(Mgr, Filler);
Mgr::Filler::Filler(const Action::Pointer &anAction, const Comm::ConnectionPointer &conn,
#include "SquidTime.h"
#include "Store.h"
-
CBDATA_NAMESPACED_CLASS_INIT(Mgr, Forwarder);
-
Mgr::Forwarder::Forwarder(const Comm::ConnectionPointer &aConn, const ActionParams &aParams,
HttpRequest* aRequest, StoreEntry* anEntry):
Ipc::Forwarder(new Request(KidIdentifier, 0, aConn, aParams), 10),
#include "ipc/Forwarder.h"
#include "mgr/ActionParams.h"
-
class CommCloseCbParams;
class HttpRequest;
class StoreEntry;
#include "protos.h"
#include "Store.h"
-
Mgr::FunAction::Pointer
Mgr::FunAction::Create(const Command::Pointer &aCmd, OBJH* aHandler)
{
#include "mgr/Action.h"
#include "mgr/ActionCreator.h"
-
namespace Mgr
{
OBJH *handler; ///< legacy function that collects and dumps info
};
-
/// creates FunAction using ActionCreator API
class FunActionCreator: public ActionCreator
{
#include "SquidTime.h"
#include "Store.h"
-
extern void GetInfo(Mgr::InfoActionData& stats);
extern void DumpInfo(Mgr::InfoActionData& stats, StoreEntry* sentry);
extern void DumpMallocStatistics(StoreEntry* sentry);
#include "StoreStats.h"
#include <sys/time.h>
-
namespace Mgr
{
#include <memory>
#include <algorithm>
-
CBDATA_NAMESPACED_CLASS_INIT(Mgr, Inquirer);
-
Mgr::Inquirer::Inquirer(Action::Pointer anAction,
const Request &aCause, const Ipc::StrandCoords &coords):
Ipc::Inquirer(aCause.clone(), applyQueryParams(coords, aCause.params.queryParams), anAction->atomic() ? 10 : 100),
#include "ipc/TypedMsgHdr.h"
#include "mgr/IntParam.h"
-
Mgr::IntParam::IntParam():
QueryParam(QueryParam::ptInt), array()
{
#include "mgr/QueryParam.h"
#include <vector>
-
namespace Mgr
{
#include "SquidMath.h"
#include "Store.h"
-
extern void GetAvgStat(Mgr::IntervalActionData& stats, int minutes, int hours);
extern void DumpAvgStat(Mgr::IntervalActionData& stats, StoreEntry* sentry);
#include "mgr/Action.h"
#include <sys/time.h>
-
namespace Mgr
{
#include "SquidMath.h"
#include "Store.h"
-
extern void GetIoStats(Mgr::IoActionData& stats);
extern void DumpIoStats(Mgr::IoActionData& stats, StoreEntry* sentry);
#include "ipc/forward.h"
#include "RefCount.h"
-
namespace Mgr
{
#include "mgr/StringParam.h"
#include "mgr/QueryParams.h"
-
Mgr::QueryParam::Pointer
Mgr::QueryParams::get(const String& name) const
{
#include <vector>
#include <utility>
-
namespace Mgr
{
#include "mgr/ActionParams.h"
#include "mgr/Request.h"
-
Mgr::Request::Request(int aRequestorId, unsigned int aRequestId, const Comm::ConnectionPointer &aConn,
const ActionParams &aParams):
Ipc::Request(aRequestorId, aRequestId),
#include "ipc/Request.h"
#include "mgr/ActionParams.h"
-
namespace Mgr
{
ActionParams params; ///< action name and parameters
};
-
} // namespace Mgr
#endif /* SQUID_MGR_REQUEST_H */
#include "mgr/ActionProfile.h"
#include "mgr/Response.h"
-
Mgr::Response::Response(unsigned int aRequestId, Action::Pointer anAction):
Ipc::Response(aRequestId), action(anAction)
{
#include "ipc/Response.h"
#include "mgr/Action.h"
-
namespace Mgr
{
#include "mgr/Action.h"
-
namespace Mgr
{
#include "protos.h"
#include "Store.h"
-
Mgr::StoreIoActionData::StoreIoActionData()
{
xmemset(this, 0, sizeof(*this));
#include "mgr/Action.h"
-
namespace Mgr
{
#include "StoreClient.h"
#include "Store.h"
-
CBDATA_NAMESPACED_CLASS_INIT(Mgr, StoreToCommWriter);
-
Mgr::StoreToCommWriter::StoreToCommWriter(const Comm::ConnectionPointer &conn, StoreEntry* anEntry):
AsyncJob("Mgr::StoreToCommWriter"),
clientConnection(conn), entry(anEntry), sc(NULL), writeOffset(0), closer(NULL)
#include "mgr/Action.h"
#include "StoreIOBuffer.h"
-
class store_client;
class CommIoCbParams;
class CommCloseCbParams;
#include "ipc/TypedMsgHdr.h"
#include "mgr/StringParam.h"
-
Mgr::StringParam::StringParam():
QueryParam(QueryParam::ptString), str()
{
#include "mgr/QueryParam.h"
#include "SquidString.h"
-
namespace Mgr
{
safe_free (url);
}
-
char const *
mimeGetIcon(const char *fn)
{
return mime_get_header_field(mime, name, NULL);
}
-
size_t
headersEnd(const char *mime, size_t l)
{
return "Parent";
}
-
peer *
whichPeer(const Ip::Address &from)
{
CBDATA_CLASS2(IdleConnList);
};
-
#include "ip/forward.h"
class StoreEntry;
int theCount; ///< the number of pooled connections
};
-
class StoreEntry;
class PconnPool;
static int peerDigestSetCBlock(PeerDigest * pd, const char *buf);
static int peerDigestUseful(const PeerDigest * pd);
-
/* local constants */
Version const CacheDigestVer = { 5, 3 };
peerDigestHandleReply, fetch);
}
-
/* Handle the data copying .. */
/*
cbdataReferenceDone(fetch);
}
-
-
/* wait for full http headers to be received then parse them */
/*
* This routine handles parsing the reply line.
peerDigestFetchFinish(fetch, err);
}
-
/* destroys digest if peer disappeared
* must be called only when fetch and pd cbdata are valid */
static void
}
-
static int
peerDigestSetCBlock(PeerDigest * pd, const char *buf)
{
output_token.length);
}
-
cleanup:
gss_delete_sec_context(&minor_status, &gss_context, NULL);
gss_release_buffer(&minor_status, &service);
return n;
}
-
void
peerSelect(Comm::ConnectionList * paths,
HttpRequest * request,
" ICP replies expected, RTT " << ps->ping.timeout <<
" msec");
-
if (ps->ping.n_replies_expected > 0) {
entry->ping_status = PING_WAITING;
eventAdd("peerPingTimeout",
}
}
-
/*
* peerGetSomeDirect
*
n_userhash_peers = 0;
/* find out which peers we have */
-
peerUserHashRegisterWithCacheManager();
for (p = Config.peers; p; p = p->next) {
/* for parameters that still need these */
#include "lookup_t.h"
-
class HttpRequestMethod;
#if USE_DELAY_POOLS
class ClientInfo;
#endif
-
#if USE_FORW_VIA_DB
extern void fvdbCountVia(const char *key);
extern void fvdbCountForw(const char *key);
extern int xatoi(const char *token);
extern long xatol(const char *token);
-
/* extra functions from cache_cf.c useful for lib modules */
SQUIDCEXTERN void parse_int(int *var);
SQUIDCEXTERN void parse_onoff(int *var);
SQUIDCEXTERN void requirePathnameExists(const char *name, const char *path);
SQUIDCEXTERN void parse_time_t(time_t * var);
-
/* client_side.c - FD related client side routines */
SQUIDCEXTERN void clientdbInit(void);
/// \ingroup ServerProtocolFTPAPI
SQUIDCEXTERN const char *ftpUrlWith2f(HttpRequest *);
-
/**
\defgroup ServerProtocolGopherAPI Server-Side Gopher API
\ingroup ServerProtocol
/// \ingroup ServerProtocolGopherAPI
SQUIDCEXTERN int gopherCachable(const HttpRequest *);
-
/**
\defgroup ServerProtocolWhoisAPI Server-Side WHOIS API
\ingroup ServerProtocol
/// \ingroup ServerProtocolWhoisAPI
SQUIDCEXTERN void whoisStart(FwdState *);
-
/* http.c */
/* for http_hdr_type field */
#include "HttpHeader.h"
SQUIDCEXTERN int httpHeaderParseInt(const char *start, int *val);
SQUIDCEXTERN void httpHeaderPutStrf(HttpHeader * hdr, http_hdr_type id, const char *fmt,...) PRINTF_FORMAT_ARG3;
-
/* Http Header */
SQUIDCEXTERN void httpHeaderInitModule(void);
SQUIDCEXTERN void httpHeaderCleanModule(void);
extern void rotate_logs(int);
extern void reconfigure(int);
-
extern void start_announce(void *unused);
extern void waisStart(FwdState *);
SQUIDCEXTERN void memDataInit(mem_type, const char *, size_t, int, bool zeroOnPush = true);
SQUIDCEXTERN void memCheckInit(void);
-
/* Mem */
SQUIDCEXTERN void memConfigure(void);
extern void storeLogClose(void);
extern void storeLogOpen(void);
-
/*
* store_key_*.c
*/
/// checks whether the loaded entry should be kept; updates counters
extern bool storeRebuildKeepEntry(const StoreEntry &e, const cache_key *key, struct _store_rebuild_data &counts);
-
/*
* store_swapin.c
*/
SQUIDCEXTERN int storePendingNClients(const StoreEntry * e);
SQUIDCEXTERN int storeClientIsThisAClient(store_client * sc, void *someClient);
-
SQUIDCEXTERN const char *getMyHostname(void);
SQUIDCEXTERN const char *uniqueHostname(void);
SQUIDCEXTERN void safeunlink(const char *path, int quiet);
SQUIDCEXTERN char *strwordtok(char *buf, char **t);
SQUIDCEXTERN void strwordquote(MemBuf * mb, const char *str);
-
/*
* ipc.c
*/
exit(0);
}
-
int
main(int argc, char *argv[])
{
signal(len, sig_handle);
}
-
if (argc > 1)
logfile = argv[1];
else
close(2);
dup(1);
-
IPAddress ipa;
chat tmp[MAX_HOSTNAMELEN];
for (;;) {
return (double) key;
}
-
/*
* Key generation function to implement the GDS-Frequency policy.
* Similar to Greedy Dual-Size Hits policy, but adds aging of
#include "snmp/Request.h"
#include "snmp/Response.h"
-
CBDATA_NAMESPACED_CLASS_INIT(Snmp, Forwarder);
-
Snmp::Forwarder::Forwarder(const Pdu& aPdu, const Session& aSession, int aFd,
const Ip::Address& anAddress):
Ipc::Forwarder(new Request(KidIdentifier, 0, aPdu, aSession, aFd, anAddress), 2),
#include "snmp/Pdu.h"
#include "snmp/Session.h"
-
class CommCloseCbParams;
namespace Snmp
#include "snmp/Response.h"
#include "snmp/Request.h"
-
CBDATA_NAMESPACED_CLASS_INIT(Snmp, Inquirer);
-
Snmp::Inquirer::Inquirer(const Request& aRequest, const Ipc::StrandCoords& coords):
Ipc::Inquirer(aRequest.clone(), coords, 2),
aggrPdu(aRequest.pdu)
#include "snmp/forward.h"
#include "snmp/Pdu.h"
-
class CommCloseCbParams;
namespace Snmp
#include <algorithm>
#endif
-
Snmp::Pdu::Pdu()
{
init();
#include "Range.h"
#include "snmp.h"
-
namespace Snmp
{
#include "ipc/TypedMsgHdr.h"
#include "snmp/Request.h"
-
Snmp::Request::Request(int aRequestorId, unsigned int aRequestId,
const Pdu& aPdu, const Session& aSession,
int aFd, const Ip::Address& anAddress):
#include "snmp/Pdu.h"
#include "snmp/Session.h"
-
namespace Snmp
{
Ip::Address address; ///< client address
};
-
} // namespace Snmp
#endif /* SQUID_SNMPX_REQUEST_H */
#include "ipc/TypedMsgHdr.h"
#include "snmp/Response.h"
-
std::ostream& Snmp::operator << (std::ostream& os, const Response& response)
{
os << "response: {requestId: " << response.requestId << '}';
#include "protos.h"
#include "snmp/Session.h"
-
Snmp::Session::Session()
{
clear();
#include "snmp.h"
#include "snmp_session.h"
-
namespace Snmp
{
#include <algorithm>
#endif
-
Snmp::Var::Var()
{
init();
#include "Range.h"
#include "snmp_vars.h"
-
namespace Snmp
{
return Answer;
}
-
/*
* cacheMesh group
* - cachePeerTable
return NULL;
}
-
switch (Var->name[LEN_SQ_MESH + 2]) {
case MESH_PTBL_INDEX: { // FIXME INET6: Should be visible?
Answer = snmp_var_new_integer(Var->name, Var->name_length,
}
break;
-
case MESH_PTBL_NAME:
cp = p->host;
Answer = snmp_var_new(Var->name, Var->name_length);
if (mibTreeEntry == mib_tree_last)
return (Fn);
-
if ((mibTreeEntry) && (mibTreeEntry->parsefunction)) {
*NextLen = CurrentLen;
*Next = (*mibTreeEntry->instancefunction) (Current, NextLen, mibTreeEntry, &Fn);
return (instance);
}
-
static oid *
peer_Inst(oid * name, snint * len, mib_tree_entry * current, oid_ParseFn ** Fn)
{
return m;
}
-
/*
* Adds a node to the MIB tree structure and adds the appropriate children
*/
debugs(49, lvl, buf);
}
-
-
/*
IPv4 address: 10.10.0.9 ==>
oid == 10.10.0.9
#define SNMP_REQUEST_SIZE 4096
#define MAX_PROTOSTAT 5
-
typedef struct _mib_tree_entry mib_tree_entry;
typedef oid *(instance_Fn) (oid * name, snint * len, mib_tree_entry * current, oid_ParseFn ** Fn);
typedef enum {atNone = 0, atSum, atAverage, atMax, atMin} AggrType;
TheDetailsManager = NULL;
}
-
Ssl::ErrorDetailsManager::ErrorDetailsManager()
{
theDefaultErrorDetails = new ErrorDetailsList();
static ErrorDetailsManager *TheDetailsManager;
};
-
void errorDetailInitialize();
void errorDetailClean();
} //namespace Ssl
#include "ssl/ServerBump.h"
#include "Store.h"
-
CBDATA_NAMESPACED_CLASS_INIT(Ssl, ServerBump);
-
Ssl::ServerBump::ServerBump(HttpRequest *fakeRequest, StoreEntry *e):
request(fakeRequest),
sslErrors(NULL)
#endif
throw std::runtime_error("Failed to open file " + filename);
-
#if _SQUID_MSWIN_
if (!LockFile(hFile, 0, 0, 1, 0))
#else
Queue lru_queue; ///< LRU cache index
};
-
/// Class for storing/manipulating LocalContextStorage per local listening address/port.
class GlobalContextStorage
{
void Ssl::CrtdMessage::setCode(std::string const & aCode) { code = aCode; }
-
std::string Ssl::CrtdMessage::compose() const
{
if (code.empty()) return std::string();
body += '\n' + other_part;
}
-
bool Ssl::CrtdMessage::parseRequest(Ssl::CertificateProperties &certProperties, std::string &error)
{
Ssl::CrtdMessage::BodyParams map;
return false;
}
-
char *alStr1;
int alLen;
alStr1 = (char *)X509_alias_get0(cert, &alLen);
CtoCpp1(SSL_free, SSL *)
typedef TidyPointer<SSL, SSL_free_cpp> SSL_Pointer;
-
/**
\ingroup SslCrtdSslAPI
* Create 1024 bits rsa key.
PEM_write_bio_X509(mem, cert);
-
len = BIO_get_mem_data(mem, &ptr);
str = (char *)xmalloc(len + 1);
/// \ingroup ServerProtocolSSLAPI
void ssl_shutdown_method(SSL *ssl);
-
/// \ingroup ServerProtocolSSLAPI
const char *sslGetUserEmail(SSL *ssl);
CBDATA_CLASS2(StatObjectsState);
};
-
/* LOCALS */
static const char *describeStatuses(const StoreEntry *);
static const char *describeTimestamps(const StoreEntry *);
#endif
}
-
void
statInit(void)
{
return candidate;
}
-
bool
mem_hdr::write (StoreIOBuffer const &writeBuffer)
{
#define STORE_IN_MEM_BUCKETS (229)
-
/** \todo Convert these string constants to enum string-arrays generated */
const char *memStatusStr[] = {
"SWAPOUT_DONE"
};
-
/*
* This defines an repl type
*/
static storerepl_entry_t *storerepl_list = NULL;
-
/*
* local function prototypes
*/
/* -------------------------------------------------------------------------- */
-
/* get rid of memory copy of the object */
void
StoreEntry::purgeMem()
write(tempBuffer);
}
-
void
storeAppendPrintf(StoreEntry * e, const char *fmt,...)
{
PROF_stop(storeGetMemSpace);
}
-
/* thunk through to Store::Root().maintain(). Note that this would be better still
* if registered against the root store itself, but that requires more complex
* update logic - bigger fish to fry first. Long term each store when
#endif
-
/*
* Replace a store entry with
* a new reply. This eats the reply.
startWriting();
}
-
void
StoreEntry::startWriting()
{
packerClean(&p);
}
-
char const *
StoreEntry::getSerialisedMetaData()
{
*
*/
-
/*
* TODO: We probably do not track all the cases when
* storeDigestNoteStoreReady() must be called; this may prevent
int rewrite_count;
};
-
typedef struct {
int del_count; /* #store entries deleted from store_digest */
int del_lost_count; /* #store entries not found in store_digest on delete */
eventAdd("storeDigestRebuildStep", storeDigestRebuildStep, NULL, 0.0, 1);
}
-
/* starts swap out sequence for the digest */
static void
storeDigestRewriteStart(void *datanotused)
#include <errno.h>
#endif
-
static STDIRSELECT storeDirSelectSwapDirRoundRobin;
static STDIRSELECT storeDirSelectSwapDirLeastLoad;
return min_objsize <= objsize && max_objsize > objsize;
}
-
/*
* This new selection scheme simply does round-robin on all SwapDirs.
* A SwapDir is skipped if it is over the max_size (100%) limit, or
debugs(20, DBG_IMPORTANT, " Took "<< std::setw(3)<< std::setprecision(2) << dt <<
" seconds ("<< std::setw(6) << ((double) n / (dt > 0.0 ? dt : 1.0)) << " entries/sec).");
-
return n;
}
return NULL;
}
-
if (objsize >= 0) {
T = StoreMeta::Add(T, t);
t = StoreMeta::Factory(STORE_META_OBJSIZE, sizeof(objsize), &objsize);
} while (true);
}
-
/* This routine is called every time data is sent to the client side.
* It's overhead is therefor, significant.
*/
off_t offset;
};
-
/* per field statistics */
class HttpHeaderFieldStat
Http, Ftp, Gopher;
};
-
struct request_flags {
request_flags(): range(0),nocache(0),ims(0),auth(0),cachable(0),hierarchical(0),loopdetect(0),proxy_keepalive(0),proxying(0),refresh(0),redirected(0),need_validation(0),fail_on_validation_err(0),stale_if_hit(0),accelerated(0),ignore_cc(0),intercepted(0),hostVerified(0),spoof_client_ip(0),internal(0),internalclient(0),must_keepalive(0),pinned(0),canRePin(0),chunked_reply(0),stream_error(0),sslPeek(0),sslBumped(0),destinationIPLookedUp_(0) {
#if USE_HTTP_VIOLATIONS
int max_stale;
};
-
struct _CacheDigest {
/* public, read-only */
char *mask; /* bit mask */
int del_count; /* number of deletions performed so far */
};
-
struct _store_rebuild_data {
int objcount; /* # objects successfully reloaded */
int expcount; /* # objects expired */
int bad_del_count; /* #dels with no prior add */
};
-
typedef struct _CacheEntry {
const cache_key *key;
xfree(e);
}
-
/* Cache */
static Cache *
return frOk;
}
-
static void
cachePurge(Cache * cache, storeSwapLogData * s, int update_digest)
{
/// Intended for registration pattern APIs where the function result does not matter to the test
#define STUB_RETVAL_NOP(x) { std::cerr<<"SKIP: "<<STUB_API<<" "<<__FUNCTION__<<" (not implemented).\n"; return x; }
-
/** macro to stub a function which returns a reference to dynamic
* Aborts unit tests requiring its definition with a message about the missing linkage
* This macro uses 'new x' to construct a stack vailable for the reference, may leak.
#define STUB_API "stub_libformat.cc"
#include "tests/STUB.h"
-
void Format::Format::assemble(MemBuf &mb, const AccessLogEntryPointer &al, int logSequenceNumber) const STUB
#define STUB_API "ssl/libsslsquid.la"
#include "tests/STUB.h"
-
#include "ssl/Config.h"
Ssl::Config::Config() { printf("Ssl::Config::Config No implemented\n"); }
Ssl::Config::~Config() { printf("Ssl::Config::Config No implemented\n"); }
#include "RemovalPolicy.h"
RemovalPolicy * createRemovalPolicy(RemovalPolicySettings * settings) STUB_RETVAL(NULL)
-
#include "Store.h"
StorePointer Store::CurrentRoot = NULL;
StoreIoStats store_io_stats;
/* XXX: wrong stub file... */
void storeUnlink(StoreEntry * e) STUB
-
char *storeSwapMetaPack(tlv * tlv_list, int *length) STUB_RETVAL(NULL)
tlv *storeSwapMetaBuild(StoreEntry * e) STUB_RETVAL(NULL)
void storeSwapTLVFree(tlv * n) STUB
CPPUNIT_TEST_SUITE_REGISTRATION( testACLMaxUserIP );
-
void
testACLMaxUserIP::testDefaults()
{
CPPUNIT_ASSERT(!anACL.valid());
}
-
void
testACLMaxUserIP::testParseLine()
{
CPPUNIT_TEST_SUITE_REGISTRATION( testBoilerplate );
-
void
testBoilerplate::testDemonstration()
{
#include "protos.h"
#include "testEvent.h"
-
CPPUNIT_TEST_SUITE_REGISTRATION( testEvent );
/* init legacy static-initialized modules */
EventScheduler scheduler = EventScheduler();
}
-
/* Helper for tests - an event which records the number of calls it received. */
struct CalledEvent {
#include "MemBuf.h"
#include "structs.h"
-
CPPUNIT_TEST_SUITE_REGISTRATION( testHttpParser );
void
#include "Mem.h"
#include "protos.h"
-
CPPUNIT_TEST_SUITE_REGISTRATION( testHttpRequest );
/** wrapper for testing HttpRequest object private and protected functions */
CPPUNIT_TEST_SUITE_REGISTRATION( testHttpRequestMethod );
-
/*
* We should be able to make an HttpRequestMethod straight from a string.
*/
return (memcmp(bins,src.bins,capacity_*sizeof(*bins))==0);
}
-
-
void
testStatHist::testStatHistBaseEquality()
{
CPPUNIT_ASSERT(raw==test);
}
-
void
testStatHist::testStatHistLog()
{
#include <cppunit/extensions/HelperMacros.h>
-
class testStatHist : public CPPUNIT_NS::TestFixture
{
CPPUNIT_TEST_SUITE( testStatHist );
#include <cppunit/extensions/HelperMacros.h>
-
/*
* test the store framework
*/
void testMaxSize();
};
-
/* subclass of Store to allow testing of methods without having all the
* other components live
*/
typedef RefCount<TestStore> TestStorePointer;
-
#endif
++Config.cacheSwap.n_configured;
}
-
void
testStoreController::testStats()
{
++Config.cacheSwap.n_configured;
}
-
void
testStoreHashIndex::testStats()
{
CPPUNIT_TEST_SUITE_REGISTRATION( testURLScheme );
-
#if 0
/*
* We should be able to make an HttpRequestMethod straight from a string.
commonInit();
mem_policy = createRemovalPolicy(Config.replPolicy);
-
char *path=xstrdup(TESTDIR);
char *config_line=xstrdup("foo 100 1 1");
#endif
}
-
void
PrintRusage(void)
{
rusage_pagefaults(&rusage));
}
-
void
death(int sig)
{
va_end(args);
}
-
/* used by fatalf */
static void
fatalvf(const char *fmt, va_list args)
file_close(fd);
}
-
pid_t
readPidFile(void)
{
cbdataInternalUnlock(tunnelState);
}
-
static void
tunnelConnectDone(const Comm::ConnectionPointer &conn, comm_err_t status, int xerrno, void *data)
{
for_each(*metadata, dumper);
-
return 0;
} catch (std::runtime_error error) {
std::cout << "Failed : " << error.what() << std::endl;
return urlCanonicalClean(request);
}
-
/*
* Test if a URL is relative.
*
return (xtolower(h[hl]) - xtolower(d[dl]));
}
-
/*
* return true if we can serve requests for this method.
*/
virtual ~UrnState();
-
StoreEntry *entry;
store_client *sc;
StoreEntry *urlres_e;
#include "event.h"
#include "structs.h"
-
#define WCCP_PORT 2048
#define WCCP_REVISION 0
#define WCCP_ACTIVE_CACHES 32
debugs(80, DBG_IMPORTANT, "Accepting WCCPv1 messages on " << Config.Wccp.address << ", FD " << theWccpConnection << ".");
-
// Sadly WCCP only does IPv4
struct sockaddr_in router;
local_ip = local;
}
-
void
wccpConnectionClose(void)
{
#define WCCP2_NUMPORTS 8
#define WCCP2_PASSWORD_LEN 8
-
/* WCCPv2 Pakcet format structures */
/* Defined in draft-wilson-wccp-v2-12-oct-2001.txt */
-
/** \interface WCCPv2_Protocol
* Generic header struct
*/
#define WCCP2_ASSIGN_MAP 14
#define WCCP2_COMMAND_EXTENSION 15
-
-
/** \interface WCCPv2_Protocol
* Sect 5.5 WCCP Message Header
*/
#define WCCP2_REDIRECT_ASSIGN 12
#define WCCP2_REMOVAL_QUERY 13
-
/** \interface WCCPv2_Protocol
* Sect 5.6.1 Security Info Component
*
#define WCCP2_NO_SECURITY 0
#define WCCP2_MD5_SECURITY 1
-
/** \interface WCCPv2_Protocol
* Sect 5.6.1 Security Info Component
*
#define WCCP2_SERVICE_SRC_PORT_ALT_HASH 0x400
#define WCCP2_SERVICE_DST_PORT_ALT_HASH 0x800
-
/* TODO the following structures need to be re-defined for correct full operation.
wccp2_cache_identity_element needs to be merged as a sub-struct of
wccp2_identity_info_t (identity_type); which frees up the identifty info
uint32_t number_values;
};
-
/** \interface WCCPv2_Protocol
* Sect 5.7.2 Web-Cache Identity Element
*/
#define WCCP2_PACKET_RETURN_METHOD_GRE WCCP2_METHOD_GRE
#define WCCP2_PACKET_RETURN_METHOD_L2 WCCP2_METHOD_L2
-
-
/** \interface WCCPv2_Protocol
* 5.7.8 Value Element
*/
return 1;
}
-
/*
* Check the given WCCP2 packet against the given password.
*/
return (memcmp(md5_digest, md5_challenge, 16) == 0);
}
-
void
wccp2Init(void)
{
}
}
-
/*
* Configuration option parsing code
*/
void WIN32_ExceptionHandlerCleanup(void);
static LPTOP_LEVEL_EXCEPTION_FILTER Win32_Old_ExceptionHandler = NULL;
-
int WIN32_pipe(int handles[2])
{
int new_socket;
return EXCEPTION_CONTINUE_SEARCH;
}
-
void WIN32_ExceptionHandlerInit()
{
#if !defined(_DEBUG)
return (hid->buckets[bucket]);
}
-
void
hashFreeMemory(hash_table * hid)
{
free(hid);
}
-
#if USE_HASH_DRIVER
/*
* hash-driver - Run with a big file as stdin to insert each line into the
}
printf("done walking hash table...\n");
-
printf("driver finished.\n");
exit(0);
}
return buf;
}
-
char *
mime_headers_end(const char *mime)
{
int nfds = 0;
int maxfd = 0;
-
static void
free_request(struct _request *r)
{
signal(sig, sig_child);
}
-
int
main(int argc, char *argv[])
{
}
#endif
-
#ifndef DEFAULT_CACHEMGR_CONFIG
#define DEFAULT_CACHEMGR_CONFIG "/etc/squid/cachemgr.conf"
#endif
printf("<TABLE BORDER=\"0\" CELLPADDING=\"10\" CELLSPACING=\"1\">\n");
-
if (fp != NULL) {
int servers = 0;
char config_line[BUFSIZ];
return req;
}
-
/* Routines to support authentication */
/*
return 0;
}
-
int
commonCode( int& sockfd, bool nodelay, int sendBufferSize, int recvBufferSize )
// purpose: common code in server sockets and client sockets
static ssize_t myread(int fd, void *buf, size_t len);
static ssize_t mywrite(int fd, void *buf, size_t len);
-
#if HAVE_GSSAPI
static int check_gss_err(OM_uint32 major_status, OM_uint32 minor_status, const char *function);
static char *GSSAPI_token(const char *server);