Token.cc
Go to the documentation of this file.
1 /*
2  * Copyright (C) 1996-2020 The Squid Software Foundation and contributors
3  *
4  * Squid software is distributed under GPLv2+ license and includes
5  * contributions from numerous individuals and organizations.
6  * Please see the COPYING and CONTRIBUTORS files for details.
7  */
8 
9 #include "squid.h"
10 #include "format/Config.h"
11 #include "format/Token.h"
12 #include "format/TokenTableEntry.h"
13 #include "globals.h"
14 #include "proxyp/Elements.h"
15 #include "sbuf/Stream.h"
16 #include "SquidConfig.h"
17 #include "Store.h"
18 
19 // Due to token overlaps between 1 and 2 letter tokens (Bug 3310)
20 // We split the token table into sets determined by the token length
21 namespace Format
22 {
23 
26 
30 
34 
39 
41 
43 
44  TokenTableEntry(NULL, LFT_NONE) /* this must be last */
45 };
46 
49 
54  /*TokenTableEntry( "lA", LFT_LOCAL_NAME ), */
55 
59 
66 
70 
73 
76  /*TokenTableEntry( "ur", LFT_USER_REALM ), */
77  /*TokenTableEntry( "us", LFT_USER_SCHEME ), */
80 
84  /*TokenTableEntry( "Ht", LFT_HTTP_STATUS ), */
86 
89 
91 
98  /*TokenTableEntry(">rq", LFT_CLIENT_REQ_QUERY),*/
100 
102  TokenTableEntry("ru", LFT_REQUEST_URI), /* doesn't include the query-string */
104  /* TokenTableEntry( "rq", LFT_REQUEST_QUERY ), * / / * the query-string, INCLUDING the leading ? */
107 
114  /*TokenTableEntry("<rq", LFT_SERVER_REQ_QUERY),*/
116 
119  /*TokenTableEntry( ">sb", LFT_REQUEST_SIZE_BODY ), */
120  /*TokenTableEntry( ">sB", LFT_REQUEST_SIZE_BODY_NO_TE ), */
121 
122  TokenTableEntry("<st", LFT_ADAPTED_REPLY_SIZE_TOTAL), // XXX: adapted should be code: <sta
125  TokenTableEntry("<sh", LFT_ADAPTED_REPLY_SIZE_HEADERS ), // XXX: adapted should be code: <sha
126  /*TokenTableEntry( "<sb", LFT_REPLY_SIZE_BODY ), */
127  /*TokenTableEntry( "<sB", LFT_REPLY_SIZE_BODY_NO_TE ), */
128 
129  TokenTableEntry("st", LFT_CLIENT_IO_SIZE_TOTAL), // XXX: total from client should be stC ??
130  /*TokenTableEntry("stP", LFT_SERVER_IO_SIZE_TOTAL),*/
131 
132  TokenTableEntry("et", LFT_TAG),
135 
136  TokenTableEntry(NULL, LFT_NONE) /* this must be last */
137 };
138 
146  TokenTableEntry(">handshake", LFT_CLIENT_HANDSHAKE),
147  TokenTableEntry("err_code", LFT_SQUID_ERROR ),
148  TokenTableEntry("err_detail", LFT_SQUID_ERROR_DETAIL ),
149  TokenTableEntry("note", LFT_NOTE ),
150  TokenTableEntry("credentials", LFT_CREDENTIALS),
151  TokenTableEntry("master_xaction", LFT_MASTER_XACTION),
152  /*
153  * Legacy external_acl_type format tokens
154  */
158  TokenTableEntry("EXT_LOG", LFT_EXT_LOG),
159  TokenTableEntry("EXT_TAG", LFT_TAG),
160  TokenTableEntry("EXT_USER", LFT_USER_EXTERNAL),
171  TokenTableEntry("SRCPORT", LFT_CLIENT_PORT),
172  TokenTableEntry("SRC", LFT_CLIENT_IP_ADDRESS), // keep after longer SRC* tokens
173  TokenTableEntry("TAG", LFT_TAG),
175 #if USE_OPENSSL
178 #endif
179  TokenTableEntry(NULL, LFT_NONE) /* this must be last */
180 };
181 
184 };
185 
188 };
189 
190 #if USE_ADAPTATION
195  TokenTableEntry(NULL, LFT_NONE) /* this must be last */
196 };
197 #endif
198 
199 #if ICAP_CLIENT
200 static TokenTableEntry TokenTableIcap[] = {
202  TokenTableEntry("tt", LFT_ICAP_TOTAL_TIME),
203  TokenTableEntry("<last_h", LFT_ADAPTATION_LAST_HEADER), // deprecated
204 
205  TokenTableEntry("<A", LFT_ICAP_ADDR),
206  TokenTableEntry("<service_name", LFT_ICAP_SERV_NAME),
207  TokenTableEntry("ru", LFT_ICAP_REQUEST_URI),
208  TokenTableEntry("rm", LFT_ICAP_REQUEST_METHOD),
209  TokenTableEntry(">st", LFT_ICAP_BYTES_SENT),
210  TokenTableEntry("<st", LFT_ICAP_BYTES_READ),
211  TokenTableEntry("<bs", LFT_ICAP_BODY_BYTES_READ),
212 
213  TokenTableEntry(">h", LFT_ICAP_REQ_HEADER),
214  TokenTableEntry("<h", LFT_ICAP_REP_HEADER),
215 
216  TokenTableEntry("tr", LFT_ICAP_TR_RESPONSE_TIME),
217  TokenTableEntry("tio", LFT_ICAP_IO_TIME),
218  TokenTableEntry("to", LFT_ICAP_OUTCOME),
219  TokenTableEntry("Hs", LFT_ICAP_STATUS_CODE),
220 
221  TokenTableEntry(NULL, LFT_NONE) /* this must be last */
222 };
223 #endif
224 
225 #if USE_OPENSSL
226 // TLS/SSL (tls:: or ssl::) tokens
228  TokenTableEntry("bump_mode", LFT_SSL_BUMP_MODE),
229  TokenTableEntry(">cert_subject", LFT_SSL_USER_CERT_SUBJECT),
230  TokenTableEntry(">cert_issuer", LFT_SSL_USER_CERT_ISSUER),
236  TokenTableEntry(">negotiated_version", LFT_TLS_CLIENT_NEGOTIATED_VERSION),
237  TokenTableEntry("<negotiated_version", LFT_TLS_SERVER_NEGOTIATED_VERSION),
238  TokenTableEntry(">negotiated_cipher", LFT_TLS_CLIENT_NEGOTIATED_CIPHER),
239  TokenTableEntry("<negotiated_cipher", LFT_TLS_SERVER_NEGOTIATED_CIPHER),
240  TokenTableEntry(">received_hello_version", LFT_TLS_CLIENT_RECEIVED_HELLO_VERSION),
241  TokenTableEntry("<received_hello_version", LFT_TLS_SERVER_RECEIVED_HELLO_VERSION),
242  TokenTableEntry(">received_supported_version", LFT_TLS_CLIENT_SUPPORTED_VERSION),
243  TokenTableEntry("<received_supported_version", LFT_TLS_SERVER_SUPPORTED_VERSION),
245 };
246 #endif
247 } // namespace Format
248 
250 void
252 {
253  // TODO standard log tokens
254 
255 #if USE_ADAPTATION
257 #endif
258 #if ICAP_CLIENT
260 #endif
261 #if USE_OPENSSL
264 #endif
267 }
268 
271 const char *
273 {
274  for (TokenTableEntry const *lte = table; lte->configTag != NULL; ++lte) {
275  debugs(46, 8, HERE << "compare tokens '" << lte->configTag << "' with '" << cur << "'");
276  if (strncmp(lte->configTag, cur, strlen(lte->configTag)) == 0) {
277  type = lte->tokenType;
278  label = lte->configTag;
279  debugs(46, 7, HERE << "Found token '" << label << "'");
280  return cur + strlen(lte->configTag);
281  }
282  }
283  return cur;
284 }
285 
286 /* parses a single token. Returns the token length in characters,
287  * and fills in the lt item with the token information.
288  * def is for sure null-terminated
289  */
290 int
291 Format::Token::parse(const char *def, Quoting *quoting)
292 {
293  const char *cur = def;
294 
295  int l;
296 
297  l = strcspn(cur, "%");
298 
299  if (l > 0) {
300  char *cp;
301  /* it's a string for sure, until \0 or the next % */
302  cp = (char *)xmalloc(l + 1);
303  xstrncpy(cp, cur, l + 1);
304  type = LFT_STRING;
305  data.string = cp;
306 
307  while (l > 0) {
308  switch (*cur) {
309 
310  case '"':
311 
312  if (*quoting == LOG_QUOTE_NONE)
313  *quoting = LOG_QUOTE_QUOTES;
314  else if (*quoting == LOG_QUOTE_QUOTES)
315  *quoting = LOG_QUOTE_NONE;
316 
317  break;
318 
319  case '[':
320  if (*quoting == LOG_QUOTE_NONE)
321  *quoting = LOG_QUOTE_MIMEBLOB;
322 
323  break;
324 
325  case ']':
326  if (*quoting == LOG_QUOTE_MIMEBLOB)
327  *quoting = LOG_QUOTE_NONE;
328 
329  break;
330  }
331 
332  ++cur;
333  --l;
334  }
335 
336  } else if (*cur) {
337 
338  ++cur;
339 
340  // select quoting style for his particular token
341  switch (*cur) {
342 
343  case '"':
345  ++cur;
346  break;
347 
348  case '\'':
350  ++cur;
351  break;
352 
353  case '[':
355  ++cur;
356  break;
357 
358  case '#':
360  ++cur;
361  break;
362 
363  case '/':
365  ++cur;
366  break;
367 
368  default:
369  quote = *quoting;
370  break;
371  }
372 
373  if (*cur == '-') {
374  left = true;
375  ++cur;
376  }
377 
378  if (*cur == '0') {
379  zero = true;
380  ++cur;
381  }
382 
383  char *endp;
384  if (xisdigit(*cur)) {
385  widthMin = strtol(cur, &endp, 10);
386  cur = endp;
387  }
388 
389  if (*cur == '.' && xisdigit(*(++cur))) {
390  widthMax = strtol(cur, &endp, 10);
391  cur = endp;
392  }
393 
394  // when {arg} field is before the token (old logformat syntax)
395  if (*cur == '{') {
396  char *cp;
397  ++cur;
398  l = strcspn(cur, "}");
399  cp = (char *)xmalloc(l + 1);
400  xstrncpy(cp, cur, l + 1);
401  data.string = cp;
402  cur += l;
403 
404  if (*cur == '}')
405  ++cur;
406  }
407 
408  type = LFT_NONE;
409 
410  // Scan each registered token namespace
411  debugs(46, 9, "check for token in " << TheConfig.tokens.size() << " namespaces.");
412  for (const auto &itr : TheConfig.tokens) {
413  debugs(46, 7, "check for possible " << itr.prefix << ":: token");
414  const size_t len = itr.prefix.length();
415  if (itr.prefix.cmp(cur, len) == 0 && cur[len] == ':' && cur[len+1] == ':') {
416  debugs(46, 5, "check for " << itr.prefix << ":: token in '" << cur << "'");
417  const char *old = cur;
418  cur = scanForToken(itr.tokenSet, cur+len+2);
419  if (old != cur) // found
420  break;
421  else // reset to start of namespace
422  cur = cur - len - 2;
423  }
424  }
425 
426  if (type == LFT_NONE) {
427  // For upward compatibility, assume "http::" prefix as default prefix
428  // for all log access formatting codes, except those starting with a
429  // "%" or a known namespace. (ie "icap::", "adapt::")
430  if (strncmp(cur,"http::", 6) == 0 && *(cur+6) != '%' )
431  cur += 6;
432 
433  // NP: scan the sets of tokens in decreasing size to guarantee no
434  // mistakes made with overlapping names. (Bug 3310)
435 
436  // Scan for various long tokens
437  debugs(46, 5, HERE << "scan for possible Misc token");
438  cur = scanForToken(TokenTableMisc, cur);
439  // scan for 2-char tokens
440  if (type == LFT_NONE) {
441  debugs(46, 5, HERE << "scan for possible 2C token");
442  cur = scanForToken(TokenTable2C, cur);
443  }
444  // finally scan for 1-char tokens.
445  if (type == LFT_NONE) {
446  debugs(46, 5, HERE << "scan for possible 1C token");
447  cur = scanForToken(TokenTable1C, cur);
448  }
449  }
450 
451  if (type == LFT_NONE)
452  throw TexcHere(ToSBuf("Unsupported %code: '", def, "'"));
453 
454  // when {arg} field is after the token (old external_acl_type token syntax)
455  // but accept only if there was none before the token
456  if (*cur == '{' && !data.string) {
457  char *cp;
458  ++cur;
459  l = strcspn(cur, "}");
460  cp = (char *)xmalloc(l + 1);
461  xstrncpy(cp, cur, l + 1);
462  data.string = cp;
463  cur += l;
464 
465  if (*cur == '}')
466  ++cur;
467  }
468 
469  if (*cur == ' ') {
470  space = true;
471  ++cur;
472  }
473  }
474 
475  switch (type) {
476 
477 #if USE_ADAPTATION
479 #endif
480 
481 #if ICAP_CLIENT
482  case LFT_ICAP_REQ_HEADER:
483 
484  case LFT_ICAP_REP_HEADER:
485 #endif
486 
488 
489  case LFT_REQUEST_HEADER:
490 
491  case LFT_REPLY_HEADER:
492 
493  case LFT_NOTE:
494 
496 
497  if (data.string) {
498  char *header = data.string;
499  const auto initialType = type;
500 
501  const auto pseudoHeader = header[0] == ':';
502  char *cp = strchr(pseudoHeader ? header+1 : header, ':');
503 
504  if (cp) {
505  *cp = '\0';
506  ++cp;
507 
508  if (*cp == ',' || *cp == ';' || *cp == ':') {
509  data.header.separator = *cp;
510  ++cp;
511  } else {
512  data.header.separator = ',';
513  }
514 
515  data.header.element = cp;
516 
517  switch (type) {
518  case LFT_REQUEST_HEADER:
520  break;
521 
524  break;
525 
526  case LFT_REPLY_HEADER:
528  break;
529 #if USE_ADAPTATION
532  break;
533 #endif
534 #if ICAP_CLIENT
535  case LFT_ICAP_REQ_HEADER:
537  break;
538  case LFT_ICAP_REP_HEADER:
540  break;
541 #endif
544  break;
545  default:
546  break;
547  }
548  }
549 
550  if (!*header)
551  throw TexcHere(ToSBuf("Can't parse configuration token: '", def, "': missing header name"));
552 
553  if (initialType == LFT_PROXY_PROTOCOL_RECEIVED_HEADER)
554  data.headerId = ProxyProtocol::FieldNameToFieldType(SBuf(header));
555  else if (pseudoHeader)
556  throw TexcHere(ToSBuf("Pseudo headers are not supported in this context; got: '", def, "'"));
557 
558  data.header.header = header;
559  } else {
560  switch (type) {
561  case LFT_REQUEST_HEADER:
563  break;
564 
567  break;
568 
569  case LFT_REPLY_HEADER:
571  break;
572 #if USE_ADAPTATION
575  break;
576 #endif
577 #if ICAP_CLIENT
578  case LFT_ICAP_REQ_HEADER:
580  break;
581  case LFT_ICAP_REP_HEADER:
583  break;
584 #endif
587  break;
588  default:
589  break;
590  }
592  }
593 
594  break;
595 
596  case LFT_CLIENT_FQDN:
597  Config.onoff.log_fqdn = 1;
598  break;
599 
603  case LFT_DNS_WAIT_TIME:
604 #if ICAP_CLIENT
606  case LFT_ICAP_IO_TIME:
607  case LFT_ICAP_TOTAL_TIME:
608 #endif
609  case LFT_TIME_START:
610  case LFT_TIME_SUBSECOND:
611  divisor = 1000;
612 
613  if (widthMax > 0) {
614  divisor = 1000000;
615 
616  for (int i = widthMax; i > 0; --i)
617  divisor /= 10;
618 
619  if (!divisor)
620  divisor = 1;
621  }
622  break;
623 
625  debugs(46, DBG_PARSE_NOTE(DBG_IMPORTANT), "WARNING: The \"Hs\" formatting code is deprecated. Use the \">Hs\" instead.");
627  break;
628 
630  debugs(46, DBG_PARSE_NOTE(DBG_IMPORTANT), "WARNING: The \"oa\" formatting code is deprecated. Use the \"<la\" instead.");
632  break;
633 
635  debugs(46, DBG_PARSE_NOTE(DBG_IMPORTANT), "WARNING: The \"rp\" formatting code is deprecated. Use the \">rp\" instead.");
637  break;
638 
640  debugs(46, DBG_PARSE_NOTE(DBG_IMPORTANT), "WARNING: The \">v\" formatting code is deprecated. Use the \">rv\" instead.");
642  break;
643 
644 #if !USE_SQUID_EUI
645  case LFT_CLIENT_EUI:
646  debugs(46, DBG_CRITICAL, "WARNING: The \">eui\" formatting code requires EUI features which are disabled in this Squid.");
647  break;
648 #endif
649 
650 #if USE_OPENSSL
655  break;
656 #endif
657 
659  debugs(46, DBG_PARSE_NOTE(DBG_IMPORTANT), "WARNING: The \"rG\" formatting code is deprecated. Use \"note{urlgroup}\" instead.");
660  type = LFT_NOTE;
661  data.header.header = xstrdup("urlgroup");
662  break;
663 
664  default:
665  break;
666  }
667 
668  return (cur - def);
669 }
670 
672  label(NULL),
673  widthMin(-1),
674  widthMax(-1),
676  left(false),
677  space(false),
678  zero(false),
679  divisor(1),
680  next(NULL)
681 {
682  data.string = NULL;
683  data.header.header = NULL;
684  data.header.element = NULL;
685  data.header.separator = ',';
687 }
688 
690 {
691  label = NULL; // drop reference to global static.
692  safe_free(data.string);
693  while (next) {
694  Token *tokens = next;
695  next = next->next;
696  tokens->next = NULL;
697  delete tokens;
698  }
699 }
700 
@ LFT_ICAP_TR_RESPONSE_TIME
Definition: ByteCode.h:210
@ LFT_LOCAL_LISTENING_IP
Definition: ByteCode.h:54
@ LFT_TRANSPORT_CLIENT_CONNECTION_ID
Definition: ByteCode.h:49
@ LFT_TLS_CLIENT_NEGOTIATED_VERSION
Definition: ByteCode.h:226
@ LFT_EXT_ACL_USER_CERT_RAW
Definition: ByteCode.h:242
@ LFT_SQUID_ERROR_DETAIL
Definition: ByteCode.h:173
@ LFT_CLIENT_LOCAL_PORT
Definition: ByteCode.h:44
const char * quote
Definition: html_quote.c:21
@ LFT_ICAP_REQUEST_METHOD
Definition: ByteCode.h:197
@ LFT_ICAP_SERV_NAME
Definition: ByteCode.h:195
@ LFT_ICAP_BODY_BYTES_READ
Definition: ByteCode.h:200
@ LFT_CLIENT_REQ_URLSCHEME
Definition: ByteCode.h:73
@ LFT_SSL_SERVER_CERT_ERRORS
Definition: ByteCode.h:224
@ LFT_USER_NAME
Definition: ByteCode.h:149
@ LFT_ADAPTATION_LAST_ALL_HEADERS
Definition: ByteCode.h:187
#define xmalloc
@ LOG_QUOTE_URL
Definition: ByteCode.h:263
@ LFT_ICAP_IO_TIME
Definition: ByteCode.h:211
@ LFT_ADAPTATION_LAST_HEADER
Definition: ByteCode.h:185
static TokenTableEntry TokenTableTransport[]
Definition: Token.cc:186
@ LFT_TAG
Definition: ByteCode.h:177
@ LFT_TOTAL_SERVER_SIDE_RESPONSE_TIME
Definition: ByteCode.h:167
static TokenTableEntry TokenTable2C[]
2-char tokens
Definition: Token.cc:48
const char * scanForToken(TokenTableEntry const table[], const char *cur)
Definition: Token.cc:272
static TokenTableEntry TokenTableSsl[]
Definition: Token.cc:227
@ LFT_ICAP_REQ_HEADER_ELEM
Definition: ByteCode.h:203
static TokenTableEntry TokenTableIcap[]
ICAP (icap::) tokens.
Definition: Token.cc:201
@ LFT_CLIENT_LOCAL_IP
Definition: ByteCode.h:43
@ LFT_PROXY_PROTOCOL_RECEIVED_HEADER
Definition: ByteCode.h:253
@ LFT_CLIENT_EUI
Definition: ByteCode.h:40
@ LFT_SSL_USER_CERT_SUBJECT
Definition: ByteCode.h:219
@ LFT_REQUEST_VERSION
Definition: ByteCode.h:86
@ LFT_SERVER_LOCAL_IP_OLD_27
Definition: ByteCode.h:65
int log_mime_hdrs
Definition: SquidConfig.h:289
@ LFT_USER_LOGIN
Definition: ByteCode.h:150
@ LFT_TLS_CLIENT_SUPPORTED_VERSION
Definition: ByteCode.h:232
@ LFT_SERVER_REQ_URLDOMAIN
Definition: ByteCode.h:103
@ LFT_SSL_SERVER_CERT_ISSUER
Definition: ByteCode.h:223
@ LOG_QUOTE_RAW
Definition: ByteCode.h:265
int parse(const char *def, enum Quoting *quote)
Definition: Token.cc:291
@ LFT_EXT_LOG
Definition: ByteCode.h:178
Definition: SBuf.h:87
@ LFT_REQUEST_METHOD
Definition: ByteCode.h:81
@ LFT_SQUID_ERROR
Definition: ByteCode.h:172
#define xstrdup
@ LFT_CLIENT_REQ_URI
Definition: ByteCode.h:72
@ LFT_SERVER_LOCAL_IP
Definition: ByteCode.h:64
@ LFT_MIME_TYPE
Definition: ByteCode.h:176
int type
Definition: errorpage.cc:153
@ LFT_USER_EXTERNAL
Definition: ByteCode.h:154
char * xstrncpy(char *dst, const char *src, size_t n)
Definition: xstring.cc:37
@ LFT_REQUEST_URLGROUP_OLD_2X
Definition: ByteCode.h:87
static TokenTableEntry TokenTableAdapt[]
Definition: Token.cc:191
@ LFT_SQUID_STATUS
Definition: ByteCode.h:171
@ LFT_REQUEST_HEADER
Definition: ByteCode.h:90
@ LFT_SERVER_REQ_URLSCHEME
Definition: ByteCode.h:102
struct tok * next
Definition: parse.c:165
One entry in a table of format tokens.
#define DBG_CRITICAL
Definition: Debug.h:45
@ LFT_TIME_LOCALTIME
Definition: ByteCode.h:160
@ LFT_ADAPTED_REQUEST_HEADER
Definition: ByteCode.h:95
@ LFT_SERVER_IP_ADDRESS
Definition: ByteCode.h:59
@ LFT_TIME_START
Definition: ByteCode.h:162
static TokenTableEntry TokenTableMisc[]
Miscellaneous >2 byte tokens.
Definition: Token.cc:140
@ LFT_ICAP_TOTAL_TIME
Definition: ByteCode.h:192
#define DBG_IMPORTANT
Definition: Debug.h:46
@ LOG_QUOTE_NONE
Definition: ByteCode.h:260
@ LFT_TLS_SERVER_NEGOTIATED_CIPHER
Definition: ByteCode.h:229
@ LFT_REPLY_HIGHOFFSET
Definition: ByteCode.h:140
@ LFT_CLIENT_FQDN
Definition: ByteCode.h:38
@ LFT_SERVER_LOCAL_PORT
Definition: ByteCode.h:66
#define TexcHere(msg)
legacy convenience macro; it is not difficult to type Here() now
Definition: TextException.h:58
@ LFT_SSL_USER_CERT_ISSUER
Definition: ByteCode.h:220
@ LFT_ADAPTATION_LAST_HEADER_ELEM
Definition: ByteCode.h:186
@ LFT_ICAP_STATUS_CODE
Definition: ByteCode.h:213
@ LFT_PEER_RESPONSE_TIME
Definition: ByteCode.h:166
@ LFT_SERVER_REQ_VERSION
Definition: ByteCode.h:107
Two::FieldType FieldNameToFieldType(const SBuf &nameOrId)
Definition: Elements.cc:102
@ LFT_REQUEST_URLPATH_OLD_31
Definition: ByteCode.h:83
@ LFT_TIME_GMT
Definition: ByteCode.h:161
@ LFT_TLS_CLIENT_RECEIVED_HELLO_VERSION
Definition: ByteCode.h:230
@ LFT_SERVER_LOCAL_NFMARK
Definition: ByteCode.h:68
struct SquidConfig::@113 onoff
@ LOG_QUOTE_SHELL
Definition: ByteCode.h:264
@ LFT_MASTER_XACTION
Definition: ByteCode.h:238
struct tok tokens[]
Definition: parse.c:168
static TokenTableEntry TokenTableProxyProtocol[]
Definition: Token.cc:182
@ LFT_CLIENT_REQUEST_SIZE_TOTAL
Definition: ByteCode.h:110
@ LFT_TLS_SERVER_NEGOTIATED_VERSION
Definition: ByteCode.h:227
bool logTlsServerHelloDetails
Definition: SquidConfig.h:347
#define NULL
Definition: types.h:166
@ LFT_ICAP_BYTES_READ
Definition: ByteCode.h:199
#define debugs(SECTION, LEVEL, CONTENT)
Definition: Debug.h:128
@ LFT_ADAPTATION_ALL_XACT_TIMES
Definition: ByteCode.h:184
@ LFT_ICAP_REP_HEADER
Definition: ByteCode.h:206
@ LFT_TLS_CLIENT_NEGOTIATED_CIPHER
Definition: ByteCode.h:228
FmtConfig TheConfig
Definition: Config.cc:16
@ LFT_HTTP_SENT_STATUS_CODE_OLD_30
Definition: ByteCode.h:122
@ LFT_REQUEST_URI
Definition: ByteCode.h:82
@ LFT_SERVER_REQ_URLPATH
Definition: ByteCode.h:105
@ LFT_HTTP_BODY_BYTES_READ
Definition: ByteCode.h:126
@ LFT_TLS_SERVER_SUPPORTED_VERSION
Definition: ByteCode.h:233
@ LFT_DNS_WAIT_TIME
Definition: ByteCode.h:168
@ LFT_STRING
Definition: ByteCode.h:34
std::ostream & HERE(std::ostream &s)
Definition: Debug.h:157
@ LFT_ICAP_OUTCOME
Definition: ByteCode.h:212
@ LFT_CLIENT_REQUEST_SIZE_HEADERS
Definition: ByteCode.h:111
@ LFT_EXT_ACL_CLIENT_EUI64
Definition: ByteCode.h:248
@ LFT_EXT_ACL_USER_CERTCHAIN_RAW
Definition: ByteCode.h:243
void const char HLPCB void * data
Definition: stub_helper.cc:16
@ LFT_CLIENT_REQ_METHOD
Definition: ByteCode.h:71
#define safe_free(x)
Definition: xalloc.h:73
@ LFT_CLIENT_REQ_URLPATH
Definition: ByteCode.h:76
@ LFT_REQUEST_ALL_HEADERS
Definition: ByteCode.h:92
@ LFT_REPLY_HEADER
Definition: ByteCode.h:129
static TokenTableEntry TokenTable1C[]
1-char tokens.
Definition: Token.cc:25
@ LFT_SERVER_LOCAL_TOS
Definition: ByteCode.h:67
@ LFT_EXT_ACL_DATA
Definition: ByteCode.h:250
static void Init()
Initialize the format token registrations.
Definition: Token.cc:251
std::list< TokenNamespace > tokens
list of token namespaces registered
Definition: Config.h:64
@ LFT_ICAP_REP_ALL_HEADERS
Definition: ByteCode.h:208
@ LFT_USER_IDENT
Definition: ByteCode.h:151
#define xisdigit(x)
Definition: xis.h:20
@ LFT_TIME_TO_HANDLE_REQUEST
Definition: ByteCode.h:165
@ LFT_ICAP_REQ_ALL_HEADERS
Definition: ByteCode.h:204
@ LFT_ICAP_REQ_HEADER
Definition: ByteCode.h:202
@ LFT_ICAP_REP_HEADER_ELEM
Definition: ByteCode.h:207
@ LFT_CLIENT_IP_ADDRESS
Definition: ByteCode.h:37
#define DBG_PARSE_NOTE(x)
Definition: Debug.h:50
@ LFT_REPLY_OBJECTSIZE
Definition: ByteCode.h:141
int cur
Definition: ModDevPoll.cc:76
@ LFT_ADAPTED_REPLY_SIZE_TOTAL
Definition: ByteCode.h:139
@ LFT_ADAPTATION_SUM_XACT_TIMES
Definition: ByteCode.h:183
@ LFT_CLIENT_PORT
Definition: ByteCode.h:39
@ LFT_SERVER_REQ_URLPORT
Definition: ByteCode.h:104
@ LFT_EXT_ACL_NAME
Definition: ByteCode.h:249
@ LFT_ADAPTED_REPLY_SIZE_HEADERS
Definition: ByteCode.h:142
@ LFT_TLS_SERVER_RECEIVED_HELLO_VERSION
Definition: ByteCode.h:231
@ LFT_PROXY_PROTOCOL_RECEIVED_ALL_HEADERS
Definition: ByteCode.h:255
@ LFT_SEQUENCE_NUMBER
Definition: ByteCode.h:180
@ LFT_REPLY_ALL_HEADERS
Definition: ByteCode.h:131
@ LFT_ADAPTED_REQUEST_HEADER_ELEM
Definition: ByteCode.h:96
@ LFT_SERVER_PORT
Definition: ByteCode.h:61
@ LOG_QUOTE_QUOTES
Definition: ByteCode.h:261
@ LFT_ADAPTED_REQUEST_ALL_HEADERS
Definition: ByteCode.h:97
@ LFT_CLIENT_REQ_VERSION
Definition: ByteCode.h:78
@ LOG_QUOTE_MIMEBLOB
Definition: ByteCode.h:262
@ LFT_PROXY_PROTOCOL_RECEIVED_HEADER_ELEM
Definition: ByteCode.h:254
@ LFT_CLIENT_REQ_URLDOMAIN
Definition: ByteCode.h:74
SBuf ToSBuf(Args &&... args)
slowly stream-prints all arguments into a freshly allocated SBuf
Definition: Stream.h:124
@ LFT_CLIENT_LOCAL_NFMARK
Definition: ByteCode.h:47
@ LFT_HTTP_SENT_STATUS_CODE
Definition: ByteCode.h:123
@ LFT_TIME_SECONDS_SINCE_EPOCH
Definition: ByteCode.h:158
@ LFT_REQUEST_HEADER_ELEM
Definition: ByteCode.h:91
int unsigned int const char *desc STUB void int len
Definition: stub_fd.cc:20
@ LFT_SSL_SERVER_CERT_WHOLE
Definition: ByteCode.h:225
@ LFT_REQUEST_VERSION_OLD_2X
Definition: ByteCode.h:85
@ LFT_SERVER_REQ_METHOD
Definition: ByteCode.h:100
@ LFT_CLIENT_IO_SIZE_TOTAL
Definition: ByteCode.h:146
@ LFT_SSL_BUMP_MODE
Definition: ByteCode.h:218
@ LFT_PERCENT
Definition: ByteCode.h:237
@ LFT_CLIENT_REQ_URLPORT
Definition: ByteCode.h:75
@ LFT_REPLY_HEADER_ELEM
Definition: ByteCode.h:130
@ LFT_HTTP_RECEIVED_STATUS_CODE
Definition: ByteCode.h:124
@ LFT_NONE
Definition: ByteCode.h:31
@ LFT_SSL_CLIENT_SNI
Definition: ByteCode.h:221
@ LFT_CLIENT_HANDSHAKE
Definition: ByteCode.h:51
@ LFT_NOTE
Definition: ByteCode.h:236
@ LFT_CREDENTIALS
Definition: ByteCode.h:215
@ LFT_SERVER_REQ_URI
Definition: ByteCode.h:101
void registerTokens(const SBuf &nsName, TokenTableEntry const *tokenArray)
Definition: Config.cc:48
#define false
Definition: GnuRegex.c:233
@ LFT_ICAP_REQUEST_URI
Definition: ByteCode.h:196
@ LFT_TIME_SUBSECOND
Definition: ByteCode.h:159
@ LFT_SSL_SERVER_CERT_SUBJECT
Definition: ByteCode.h:222
@ LFT_ICAP_ADDR
Definition: ByteCode.h:194
@ LFT_CLIENT_LOCAL_TOS
Definition: ByteCode.h:46
@ LFT_SERVER_FQDN_OR_PEER_NAME
Definition: ByteCode.h:60
struct Format::Token::@69 data
@ LFT_LOCAL_LISTENING_PORT
Definition: ByteCode.h:55
@ LFT_EXT_ACL_CLIENT_EUI48
Definition: ByteCode.h:247
@ LFT_ICAP_BYTES_SENT
Definition: ByteCode.h:198
class SquidConfig Config
Definition: SquidConfig.cc:12
Quoting
Quoting style for a format output.
Definition: ByteCode.h:259
@ LFT_SQUID_HIERARCHY
Definition: ByteCode.h:174

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors