suricata
decode.c
Go to the documentation of this file.
1 /* Copyright (C) 2007-2024 Open Information Security Foundation
2  *
3  * You can copy, redistribute or modify this Program under the terms of
4  * the GNU General Public License version 2 as published by the Free
5  * Software Foundation.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * version 2 along with this program; if not, write to the Free Software
14  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
15  * 02110-1301, USA.
16  */
17 
18 /**
19  * \defgroup decode Packet decoding
20  *
21  * \brief Code in charge of protocol decoding
22  *
23  * The task of decoding packets is made in different files and
24  * as Suricata is supporting encapsulation there is a potential
25  * recursivity in the call.
26  *
27  * For each protocol a DecodePROTO function is provided. For
28  * example we have DecodeIPV4() for IPv4 and DecodePPP() for
29  * PPP.
30  *
31  * These functions have all a pkt and a len argument which
32  * are respectively a pointer to the protocol data and the length
33  * of this protocol data.
34  *
35  * \attention The pkt parameter must point to the effective data because
36  * it will be used later to set per protocol pointer like Packet::tcph
37  *
38  * @{
39  */
40 
41 
42 /**
43  * \file
44  *
45  * \author Victor Julien <victor@inliniac.net>
46  *
47  * Decode the raw packet
48  */
49 
50 #include "suricata-common.h"
51 #include "decode.h"
52 
53 #include "packet.h"
54 #include "flow.h"
55 #include "flow-storage.h"
56 #include "tmqh-packetpool.h"
57 #include "app-layer.h"
58 #include "output.h"
59 
60 #include "decode-vxlan.h"
61 #include "decode-geneve.h"
62 #include "decode-erspan.h"
63 #include "decode-teredo.h"
64 #include "decode-arp.h"
65 
66 #include "defrag-hash.h"
67 
68 #include "util-hash.h"
69 #include "util-hash-string.h"
70 #include "util-print.h"
71 #include "util-profiling.h"
72 #include "util-validate.h"
73 #include "util-debug.h"
74 #include "util-exception-policy.h"
75 #include "action-globals.h"
76 
77 uint32_t default_packet_size = 0;
78 extern bool stats_decoder_events;
79 extern const char *stats_decoder_events_prefix;
80 extern bool stats_stream_events;
83 
84 /* Settings order as in the enum */
85 // clang-format off
88  /* EXCEPTION_POLICY_NOT_SET */ false,
89  /* EXCEPTION_POLICY_AUTO */ false,
90  /* EXCEPTION_POLICY_PASS_PACKET */ true,
91  /* EXCEPTION_POLICY_PASS_FLOW */ false,
92  /* EXCEPTION_POLICY_BYPASS_FLOW */ true,
93  /* EXCEPTION_POLICY_DROP_PACKET */ false,
94  /* EXCEPTION_POLICY_DROP_FLOW */ false,
95  /* EXCEPTION_POLICY_REJECT */ true,
96  /* EXCEPTION_POLICY_REJECT_BOTH */ true,
97  },
98  .valid_settings_ips = {
99  /* EXCEPTION_POLICY_NOT_SET */ false,
100  /* EXCEPTION_POLICY_AUTO */ false,
101  /* EXCEPTION_POLICY_PASS_PACKET */ true,
102  /* EXCEPTION_POLICY_PASS_FLOW */ false,
103  /* EXCEPTION_POLICY_BYPASS_FLOW */ true,
104  /* EXCEPTION_POLICY_DROP_PACKET */ true,
105  /* EXCEPTION_POLICY_DROP_FLOW */ false,
106  /* EXCEPTION_POLICY_REJECT */ true,
107  /* EXCEPTION_POLICY_REJECT_BOTH */ true,
108  },
109 };
110 // clang-format on
111 
112 /* Settings order as in the enum */
113 // clang-format off
115  .valid_settings_ids = {
116  /* EXCEPTION_POLICY_NOT_SET */ false,
117  /* EXCEPTION_POLICY_AUTO */ false,
118  /* EXCEPTION_POLICY_PASS_PACKET */ true,
119  /* EXCEPTION_POLICY_PASS_FLOW */ false,
120  /* EXCEPTION_POLICY_BYPASS_FLOW */ true,
121  /* EXCEPTION_POLICY_DROP_PACKET */ false,
122  /* EXCEPTION_POLICY_DROP_FLOW */ false,
123  /* EXCEPTION_POLICY_REJECT */ true,
124  /* EXCEPTION_POLICY_REJECT_BOTH */ true,
125  },
126  .valid_settings_ips = {
127  /* EXCEPTION_POLICY_NOT_SET */ false,
128  /* EXCEPTION_POLICY_AUTO */ false,
129  /* EXCEPTION_POLICY_PASS_PACKET */ true,
130  /* EXCEPTION_POLICY_PASS_FLOW */ false,
131  /* EXCEPTION_POLICY_BYPASS_FLOW */ true,
132  /* EXCEPTION_POLICY_DROP_PACKET */ true,
133  /* EXCEPTION_POLICY_DROP_FLOW */ false,
134  /* EXCEPTION_POLICY_REJECT */ true,
135  /* EXCEPTION_POLICY_REJECT_BOTH */ true,
136  },
137 };
138 // clang-format on
139 
140 /**
141  * \brief Initialize PacketAlerts with dynamic alerts array size
142  *
143  */
145 {
146  PacketAlert *pa_array = SCCalloc(packet_alert_max, sizeof(PacketAlert));
147  DEBUG_VALIDATE_BUG_ON(pa_array == NULL);
148 
149  return pa_array;
150 }
151 
152 void PacketAlertRecycle(PacketAlert *pa_array, uint16_t cnt)
153 {
154  if (pa_array == NULL)
155  return;
156  /* Clean json content for alerts attached to the packet */
157  for (int i = 0; i < cnt; i++) {
158  struct PacketContextData *current_json = pa_array[i].json_info;
159  while (current_json) {
160  struct PacketContextData *next_json = current_json->next;
161  SCFree(current_json->json_string);
162  SCFree(current_json);
163  current_json = next_json;
164  }
165  pa_array[i].json_info = NULL;
166  }
167 }
168 
170 {
171  if (pa_array == NULL)
172  return;
173  for (int i = 0; i < packet_alert_max; i++) {
174  struct PacketContextData *allocated_json = pa_array[i].json_info;
175  while (allocated_json) {
176  struct PacketContextData *next_json = allocated_json->next;
177  SCFree(allocated_json->json_string);
178  SCFree(allocated_json);
179  allocated_json = next_json;
180  }
181  }
182  SCFree(pa_array);
183 }
184 
185 static int DecodeTunnel(ThreadVars *, DecodeThreadVars *, Packet *, const uint8_t *, uint32_t,
187 
188 static int DecodeTunnel(ThreadVars *tv, DecodeThreadVars *dtv, Packet *p, const uint8_t *pkt,
189  uint32_t len, enum DecodeTunnelProto proto)
190 {
191  switch (proto) {
192  case DECODE_TUNNEL_PPP:
193  return DecodePPP(tv, dtv, p, pkt, len);
194  case DECODE_TUNNEL_IPV4:
195  DEBUG_VALIDATE_BUG_ON(len > UINT16_MAX);
196  return DecodeIPV4(tv, dtv, p, pkt, (uint16_t)len);
197  case DECODE_TUNNEL_IPV6:
199  DEBUG_VALIDATE_BUG_ON(len > UINT16_MAX);
200  return DecodeIPV6(tv, dtv, p, pkt, (uint16_t)len);
201  case DECODE_TUNNEL_VLAN:
202  return DecodeVLAN(tv, dtv, p, pkt, len);
204  return DecodeEthernet(tv, dtv, p, pkt, len);
206  return DecodeERSPAN(tv, dtv, p, pkt, len);
208  return DecodeERSPANTypeI(tv, dtv, p, pkt, len);
209  case DECODE_TUNNEL_NSH:
210  return DecodeNSH(tv, dtv, p, pkt, len);
211  case DECODE_TUNNEL_ARP:
212  return DecodeARP(tv, dtv, p, pkt, len);
213  default:
214  SCLogDebug("FIXME: DecodeTunnel: protocol %" PRIu32 " not supported.", proto);
215  break;
216  }
217  return TM_ECODE_OK;
218 }
219 
220 /**
221  * \brief Return a malloced packet.
222  */
224 {
225  PacketDestructor(p);
226  SCFree(p);
227 }
228 
229 /**
230  * \brief Finalize decoding of a packet
231  *
232  * This function needs to be call at the end of decode
233  * functions when decoding has been successful.
234  *
235  */
237 {
238  if (p->flags & PKT_IS_INVALID) {
240  }
241 }
242 
245 {
246  for (uint8_t i = 0; i < p->events.cnt; i++) {
247  const uint8_t e = p->events.events[i];
248 
250  continue;
252  continue;
254  }
255 }
256 
257 /**
258  * \brief Get a malloced packet.
259  *
260  * \retval p packet, NULL on error
261  */
263 {
264  Packet *p = SCCalloc(1, SIZE_OF_PACKET);
265  if (unlikely(p == NULL)) {
266  return NULL;
267  }
268  PacketInit(p);
270 
271  SCLogDebug("allocated a new packet only using alloc...");
272 
274  return p;
275 }
276 
277 /**
278  * \brief Return a packet to where it was allocated.
279  */
281 {
282  if (likely(p->pool != NULL)) {
285  } else {
286  PacketFree(p);
287  }
288 }
289 
290 /**
291  * \brief Get a packet. We try to get a packet from the packetpool first, but
292  * if that is empty we alloc a packet that is free'd again after
293  * processing.
294  *
295  * \retval p packet, NULL on error
296  */
298 {
299  /* try the pool first */
301 
302  if (p == NULL) {
303  /* non fatal, we're just not processing a packet then */
304  p = PacketGetFromAlloc();
305  } else {
308  }
309 
310  return p;
311 }
312 
313 inline int PacketCallocExtPkt(Packet *p, int datalen)
314 {
315  if (! p->ext_pkt) {
316  p->ext_pkt = SCCalloc(1, datalen);
317  if (unlikely(p->ext_pkt == NULL)) {
318  SET_PKT_LEN(p, 0);
319  return -1;
320  }
321  }
322  return 0;
323 }
324 
325 /**
326  * \brief Copy data to Packet payload at given offset
327  *
328  * This function copies data/payload to a Packet. It uses the
329  * space allocated at Packet creation (pointed by Packet::pkt)
330  * or allocate some memory (pointed by Packet::ext_pkt) if the
331  * data size is to big to fit in initial space (of size
332  * default_packet_size).
333  *
334  * \param Pointer to the Packet to modify
335  * \param Offset of the copy relatively to payload of Packet
336  * \param Pointer to the data to copy
337  * \param Length of the data to copy
338  */
339 inline int PacketCopyDataOffset(Packet *p, uint32_t offset, const uint8_t *data, uint32_t datalen)
340 {
341  if (unlikely(offset + datalen > MAX_PAYLOAD_SIZE)) {
342  /* too big */
343  SET_PKT_LEN(p, 0);
344  return -1;
345  }
346 
347  /* Do we have already an packet with allocated data */
348  if (! p->ext_pkt) {
349  uint32_t newsize = offset + datalen;
350  // check overflow
351  if (newsize < offset)
352  return -1;
353  if (newsize <= default_packet_size) {
354  /* data will fit in memory allocated with packet */
355  memcpy(GET_PKT_DIRECT_DATA(p) + offset, data, datalen);
356  } else {
357  /* here we need a dynamic allocation */
359  if (unlikely(p->ext_pkt == NULL)) {
360  SET_PKT_LEN(p, 0);
361  return -1;
362  }
363  /* copy initial data */
365  /* copy data as asked */
366  memcpy(p->ext_pkt + offset, data, datalen);
367  }
368  } else {
369  memcpy(p->ext_pkt + offset, data, datalen);
370  }
371  return 0;
372 }
373 
374 /**
375  * \brief Copy data to Packet payload and set packet length
376  *
377  * \param Pointer to the Packet to modify
378  * \param Pointer to the data to copy
379  * \param Length of the data to copy
380  */
381 inline int PacketCopyData(Packet *p, const uint8_t *pktdata, uint32_t pktlen)
382 {
383  SET_PKT_LEN(p, pktlen);
384  return PacketCopyDataOffset(p, 0, pktdata, pktlen);
385 }
386 
387 /**
388  * \brief Setup a pseudo packet (tunnel)
389  *
390  * \param parent parent packet for this pseudo pkt
391  * \param pkt raw packet data
392  * \param len packet data length
393  * \param proto protocol of the tunneled packet
394  *
395  * \retval p the pseudo packet or NULL if out of memory
396  */
398  const uint8_t *pkt, uint32_t len, enum DecodeTunnelProto proto)
399 {
400  int ret;
401 
402  SCEnter();
403 
404  if (parent->nb_decoded_layers + 1 >= decoder_max_layers) {
406  SCReturnPtr(NULL, "Packet");
407  }
408 
409  /* get us a packet */
411  if (unlikely(p == NULL)) {
412  SCReturnPtr(NULL, "Packet");
413  }
414 
415  /* copy packet and set length, proto */
416  PacketCopyData(p, pkt, len);
417  DEBUG_VALIDATE_BUG_ON(parent->recursion_level == 255);
418  p->recursion_level = parent->recursion_level + 1;
420  p->nb_decoded_layers = parent->nb_decoded_layers + 1;
421  p->ts = parent->ts;
422  p->datalink = DLT_RAW;
423  p->tenant_id = parent->tenant_id;
424  p->livedev = parent->livedev;
425 
426  /* set the root ptr to the lowest layer */
427  if (parent->root != NULL) {
428  p->root = parent->root;
429  BUG_ON(parent->ttype != PacketTunnelChild);
430  } else {
431  p->root = parent;
432  parent->ttype = PacketTunnelRoot;
433  }
434  /* tell new packet it's part of a tunnel */
436 
437  ret = DecodeTunnel(tv, dtv, p, GET_PKT_DATA(p),
438  GET_PKT_LEN(p), proto);
439 
440  if (unlikely(ret != TM_ECODE_OK) ||
442  {
443  /* Not a (valid) tunnel packet */
444  SCLogDebug("tunnel packet is invalid");
445  p->root = NULL;
447  SCReturnPtr(NULL, "Packet");
448  }
449 
450  /* Update tunnel settings in parent */
451  if (parent->root == NULL) {
452  parent->ttype = PacketTunnelRoot;
453  }
454  TUNNEL_INCR_PKT_TPR(p);
455 
456  /* disable payload (not packet) inspection on the parent, as the payload
457  * is the packet we will now run through the system separately. We do
458  * check it against the ip/port/other header checks though */
459  DecodeSetNoPayloadInspectionFlag(parent);
460  SCReturnPtr(p, "Packet");
461 }
462 
463 /**
464  * \brief Setup a pseudo packet (reassembled frags)
465  *
466  * Difference with PacketPseudoPktSetup is that this func doesn't increment
467  * the recursion level. It needs to be on the same level as the frags because
468  * we run the flow engine against this and we need to get the same flow.
469  *
470  * \param parent parent packet for this pseudo pkt
471  * \param pkt raw packet data
472  * \param len packet data length
473  * \param proto protocol of the tunneled packet
474  *
475  * \retval p the pseudo packet or NULL if out of memory
476  */
477 Packet *PacketDefragPktSetup(Packet *parent, const uint8_t *pkt, uint32_t len, uint8_t proto)
478 {
479  SCEnter();
480 
481  /* get us a packet */
483  if (unlikely(p == NULL)) {
484  SCReturnPtr(NULL, "Packet");
485  }
486 
487  /* set the root ptr to the lowest layer */
488  if (parent->root != NULL) {
489  p->root = parent->root;
490  BUG_ON(parent->ttype != PacketTunnelChild);
491  } else {
492  p->root = parent;
493  // we set parent->ttype later
494  }
495  /* tell new packet it's part of a tunnel */
497 
498  /* copy packet and set length, proto */
499  if (pkt && len) {
500  PacketCopyData(p, pkt, len);
501  }
502  p->recursion_level = parent->recursion_level; /* NOT incremented */
503  p->ts = parent->ts;
504  p->tenant_id = parent->tenant_id;
505  memcpy(&p->vlan_id[0], &parent->vlan_id[0], sizeof(p->vlan_id));
506  p->vlan_idx = parent->vlan_idx;
507  p->livedev = parent->livedev;
508 
509  SCReturnPtr(p, "Packet");
510 }
511 
512 /**
513  * \brief inform defrag "parent" that a pseudo packet is
514  * now associated to it.
515  */
517 {
518  /* tell parent packet it's part of a tunnel */
519  if (parent->ttype == PacketTunnelNone)
520  parent->ttype = PacketTunnelRoot;
521 
522  /* increment tunnel packet refcnt in the root packet */
523  TUNNEL_INCR_PKT_TPR(parent);
524 
525  /* disable payload (not packet) inspection on the parent, as the payload
526  * is the packet we will now run through the system separately. We do
527  * check it against the ip/port/other header checks though */
528  DecodeSetNoPayloadInspectionFlag(parent);
529 }
530 
531 /**
532  * \note if p->flow is set, the flow is locked
533  */
535 {
536  if (PKT_IS_PSEUDOPKT(p))
537  return;
538 
539 #ifdef CAPTURE_OFFLOAD
540  /* Don't try to bypass if flow is already out or
541  * if we have failed to do it once */
542  if (p->flow) {
543  int state = p->flow->flow_state;
544  if ((state == FLOW_STATE_LOCAL_BYPASSED) ||
545  (state == FLOW_STATE_CAPTURE_BYPASSED)) {
546  return;
547  }
548 
549  FlowBypassInfo *fc;
550 
552  if (fc == NULL) {
553  fc = SCCalloc(sizeof(FlowBypassInfo), 1);
554  if (fc) {
556  } else {
557  return;
558  }
559  }
560  }
561  if (p->BypassPacketsFlow && p->BypassPacketsFlow(p)) {
562  if (p->flow) {
563  FlowUpdateState(p->flow, FLOW_STATE_CAPTURE_BYPASSED);
564  }
565  } else {
566  if (p->flow) {
568  }
569  }
570 #else /* CAPTURE_OFFLOAD */
571  if (p->flow) {
572  int state = p->flow->flow_state;
573  if (state == FLOW_STATE_LOCAL_BYPASSED)
574  return;
576  }
577 #endif
578 }
579 
580 /** \brief switch direction of a packet */
582 {
583  if (PKT_IS_TOSERVER(p)) {
586 
590  }
591  } else {
594 
598  }
599  }
600 }
601 
602 /* counter name store */
603 static HashTable *g_counter_table = NULL;
604 static SCMutex g_counter_table_mutex = SCMUTEX_INITIALIZER;
605 
607 {
608  SCMutexLock(&g_counter_table_mutex);
609  if (g_counter_table) {
610  HashTableFree(g_counter_table);
611  g_counter_table = NULL;
612  }
613  SCMutexUnlock(&g_counter_table_mutex);
614 }
615 
616 static bool IsDefragMemcapExceptionPolicyStatsValid(enum ExceptionPolicy policy)
617 {
618  if (EngineModeIsIPS()) {
620  }
622 }
623 
624 static bool IsFlowMemcapExceptionPolicyStatsValid(enum ExceptionPolicy policy)
625 {
626  if (EngineModeIsIPS()) {
628  }
630 }
631 
633 {
634  /* register counters */
635  dtv->counter_pkts = StatsRegisterCounter("decoder.pkts", &tv->stats);
636  dtv->counter_bytes = StatsRegisterCounter("decoder.bytes", &tv->stats);
637  dtv->counter_invalid = StatsRegisterCounter("decoder.invalid", &tv->stats);
638  dtv->counter_ipv4 = StatsRegisterCounter("decoder.ipv4", &tv->stats);
639  dtv->counter_ipv6 = StatsRegisterCounter("decoder.ipv6", &tv->stats);
640  dtv->counter_eth = StatsRegisterCounter("decoder.ethernet", &tv->stats);
641  dtv->counter_arp = StatsRegisterCounter("decoder.arp", &tv->stats);
642  dtv->counter_ethertype_unknown = StatsRegisterCounter("decoder.unknown_ethertype", &tv->stats);
643  dtv->counter_chdlc = StatsRegisterCounter("decoder.chdlc", &tv->stats);
644  dtv->counter_raw = StatsRegisterCounter("decoder.raw", &tv->stats);
645  dtv->counter_null = StatsRegisterCounter("decoder.null", &tv->stats);
646  dtv->counter_sll = StatsRegisterCounter("decoder.sll", &tv->stats);
647  dtv->counter_sll2 = StatsRegisterCounter("decoder.sll2", &tv->stats);
648  dtv->counter_tcp = StatsRegisterCounter("decoder.tcp", &tv->stats);
649 
651  dtv->counter_tcp_synack = StatsRegisterCounter("tcp.synack", &tv->stats);
654 
655  dtv->counter_udp = StatsRegisterCounter("decoder.udp", &tv->stats);
656  dtv->counter_sctp = StatsRegisterCounter("decoder.sctp", &tv->stats);
657  dtv->counter_esp = StatsRegisterCounter("decoder.esp", &tv->stats);
658  dtv->counter_icmpv4 = StatsRegisterCounter("decoder.icmpv4", &tv->stats);
659  dtv->counter_icmpv6 = StatsRegisterCounter("decoder.icmpv6", &tv->stats);
660  dtv->counter_ppp = StatsRegisterCounter("decoder.ppp", &tv->stats);
661  dtv->counter_pppoe = StatsRegisterCounter("decoder.pppoe", &tv->stats);
662  dtv->counter_geneve = StatsRegisterCounter("decoder.geneve", &tv->stats);
663  dtv->counter_gre = StatsRegisterCounter("decoder.gre", &tv->stats);
664  dtv->counter_vlan = StatsRegisterCounter("decoder.vlan", &tv->stats);
665  dtv->counter_vlan_qinq = StatsRegisterCounter("decoder.vlan_qinq", &tv->stats);
666  dtv->counter_vlan_qinqinq = StatsRegisterCounter("decoder.vlan_qinqinq", &tv->stats);
667  dtv->counter_vxlan = StatsRegisterCounter("decoder.vxlan", &tv->stats);
668  dtv->counter_vntag = StatsRegisterCounter("decoder.vntag", &tv->stats);
669  dtv->counter_etag = StatsRegisterCounter("decoder.etag", &tv->stats);
670  dtv->counter_ieee8021ah = StatsRegisterCounter("decoder.ieee8021ah", &tv->stats);
671  dtv->counter_teredo = StatsRegisterCounter("decoder.teredo", &tv->stats);
672  dtv->counter_ipv4inipv4 = StatsRegisterCounter("decoder.ipv4_in_ipv4", &tv->stats);
673  dtv->counter_ipv6inipv4 = StatsRegisterCounter("decoder.ipv6_in_ipv4", &tv->stats);
674  dtv->counter_ipv4inipv6 = StatsRegisterCounter("decoder.ipv4_in_ipv6", &tv->stats);
675  dtv->counter_ipv6inipv6 = StatsRegisterCounter("decoder.ipv6_in_ipv6", &tv->stats);
676  dtv->counter_mpls = StatsRegisterCounter("decoder.mpls", &tv->stats);
677  dtv->counter_avg_pkt_size = StatsRegisterAvgCounter("decoder.avg_pkt_size", &tv->stats);
678  dtv->counter_max_pkt_size = StatsRegisterMaxCounter("decoder.max_pkt_size", &tv->stats);
680  StatsRegisterMaxCounter("decoder.max_mac_addrs_src", &tv->stats);
682  StatsRegisterMaxCounter("decoder.max_mac_addrs_dst", &tv->stats);
683  dtv->counter_erspan = StatsRegisterCounter("decoder.erspan", &tv->stats);
684  dtv->counter_nsh = StatsRegisterCounter("decoder.nsh", &tv->stats);
685  dtv->counter_flow_memcap = StatsRegisterCounter("flow.memcap", &tv->stats);
687  FlowGetMemcapExceptionPolicy(), "exception_policy.flow.memcap.",
688  IsFlowMemcapExceptionPolicyStatsValid);
689 
690  dtv->counter_tcp_active_sessions = StatsRegisterCounter("tcp.active_sessions", &tv->stats);
691  dtv->counter_flow_total = StatsRegisterCounter("flow.total", &tv->stats);
692  dtv->counter_flow_active = StatsRegisterCounter("flow.active", &tv->stats);
695  dtv->counter_flow_icmp4 = StatsRegisterCounter("flow.icmpv4", &tv->stats);
696  dtv->counter_flow_icmp6 = StatsRegisterCounter("flow.icmpv6", &tv->stats);
697  dtv->counter_flow_tcp_reuse = StatsRegisterCounter("flow.tcp_reuse", &tv->stats);
698  dtv->counter_flow_elephant = StatsRegisterCounter("flow.elephant", &tv->stats);
699  dtv->counter_flow_get_used = StatsRegisterCounter("flow.get_used", &tv->stats);
700  dtv->counter_flow_get_used_eval = StatsRegisterCounter("flow.get_used_eval", &tv->stats);
702  StatsRegisterCounter("flow.get_used_eval_reject", &tv->stats);
704  StatsRegisterCounter("flow.get_used_eval_busy", &tv->stats);
705  dtv->counter_flow_get_used_failed = StatsRegisterCounter("flow.get_used_failed", &tv->stats);
706 
708  StatsRegisterAvgCounter("flow.wrk.spare_sync_avg", &tv->stats);
709  dtv->counter_flow_spare_sync = StatsRegisterCounter("flow.wrk.spare_sync", &tv->stats);
711  StatsRegisterCounter("flow.wrk.spare_sync_incomplete", &tv->stats);
713  StatsRegisterCounter("flow.wrk.spare_sync_empty", &tv->stats);
714 
715  dtv->counter_defrag_ipv4_fragments = StatsRegisterCounter("defrag.ipv4.fragments", &tv->stats);
717  StatsRegisterCounter("defrag.ipv4.reassembled", &tv->stats);
718  dtv->counter_defrag_ipv6_fragments = StatsRegisterCounter("defrag.ipv6.fragments", &tv->stats);
720  StatsRegisterCounter("defrag.ipv6.reassembled", &tv->stats);
721  dtv->counter_defrag_max_hit = StatsRegisterCounter("defrag.max_trackers_reached", &tv->stats);
722  dtv->counter_defrag_no_frags = StatsRegisterCounter("defrag.max_frags_reached", &tv->stats);
724  StatsRegisterCounter("defrag.tracker_soft_reuse", &tv->stats);
726  StatsRegisterCounter("defrag.tracker_hard_reuse", &tv->stats);
728  StatsRegisterCounter("defrag.wrk.tracker_timeout", &tv->stats);
729 
731  DefragGetMemcapExceptionPolicy(), "exception_policy.defrag.memcap.",
732  IsDefragMemcapExceptionPolicyStatsValid);
733 
734  for (int i = 0; i < DECODE_EVENT_MAX; i++) {
735  BUG_ON(i != (int)DEvents[i].code);
736 
738  continue;
740  continue;
741 
742  if (i < DECODE_EVENT_PACKET_MAX &&
743  strncmp(DEvents[i].event_name, "decoder.", 8) == 0)
744  {
745  SCMutexLock(&g_counter_table_mutex);
746  if (g_counter_table == NULL) {
747  g_counter_table = HashTableInit(256, StringHashFunc,
750  if (g_counter_table == NULL) {
751  FatalError("decoder counter hash "
752  "table init failed");
753  }
754  }
755 
756  char name[256];
757  char *dot = strchr(DEvents[i].event_name, '.');
758  BUG_ON(!dot);
759  snprintf(name, sizeof(name), "%s.%s",
761 
762  const char *found = HashTableLookup(g_counter_table, name, 0);
763  if (!found) {
764  char *add = SCStrdup(name);
765  if (add == NULL)
766  FatalError("decoder counter hash "
767  "table name init failed");
768  int r = HashTableAdd(g_counter_table, add, 0);
769  if (r != 0)
770  FatalError("decoder counter hash "
771  "table name add failed");
772  found = add;
773  }
775 
776  SCMutexUnlock(&g_counter_table_mutex);
777  } else {
779  }
780  }
781 }
782 
784  const DecodeThreadVars *dtv, const Packet *p)
785 {
790 }
791 
792 /**
793  * \brief Debug print function for printing addresses
794  *
795  * \param Address object
796  *
797  * \todo IPv6
798  */
800 {
801  if (a == NULL)
802  return;
803 
804  switch (a->family) {
805  case AF_INET:
806  {
807  char s[16];
808  PrintInet(AF_INET, (const void *)&a->addr_data32[0], s, sizeof(s));
809  SCLogDebug("%s", s);
810  break;
811  }
812  }
813 }
814 
815 /** \brief Alloc and setup DecodeThreadVars */
817 {
818  DecodeThreadVars *dtv = NULL;
819 
820  if ((dtv = SCCalloc(1, sizeof(DecodeThreadVars))) == NULL)
821  return NULL;
822 
824 
826  SCLogError("initializing flow log API for thread failed");
828  return NULL;
829  }
830 
831  return dtv;
832 }
833 
835 {
836  if (dtv != NULL) {
837  if (dtv->app_tctx != NULL)
839 
840  if (dtv->output_flow_thread_data != NULL)
842 
843  SCFree(dtv);
844  }
845 }
846 
847 /**
848  * \brief Set data for Packet and set length when zero copy is used
849  *
850  * \param Pointer to the Packet to modify
851  * \param Pointer to the data
852  * \param Length of the data
853  */
854 inline int PacketSetData(Packet *p, const uint8_t *pktdata, uint32_t pktlen)
855 {
856  SET_PKT_LEN(p, pktlen);
857  if (unlikely(!pktdata)) {
858  return -1;
859  }
860  // ext_pkt cannot be const (because we sometimes copy)
861  p->ext_pkt = (uint8_t *) pktdata;
862  p->flags |= PKT_ZERO_COPY;
863 
864  return 0;
865 }
866 
867 const char *PktSrcToString(enum PktSrcEnum pkt_src)
868 {
869  const char *pkt_src_str = NULL;
870  switch (pkt_src) {
871  case PKT_SRC_WIRE:
872  pkt_src_str = "wire/pcap";
873  break;
874  case PKT_SRC_DECODER_GRE:
875  pkt_src_str = "gre tunnel";
876  break;
878  pkt_src_str = "ipv4 tunnel";
879  break;
881  pkt_src_str = "ipv6 tunnel";
882  break;
884  pkt_src_str = "teredo tunnel";
885  break;
886  case PKT_SRC_DEFRAG:
887  pkt_src_str = "defrag";
888  break;
890  pkt_src_str = "stream (detect/log)";
891  break;
892  case PKT_SRC_FFR:
893  pkt_src_str = "stream (flow timeout)";
894  break;
896  pkt_src_str = "geneve encapsulation";
897  break;
899  pkt_src_str = "vxlan encapsulation";
900  break;
902  pkt_src_str = "detect reload flush";
903  break;
905  pkt_src_str = "capture timeout flush";
906  break;
908  pkt_src_str = "shutdown flush";
909  break;
910  }
911  DEBUG_VALIDATE_BUG_ON(pkt_src_str == NULL);
912  return pkt_src_str;
913 }
914 
916 {
917  switch (r) {
919  return "decode error";
921  return "defrag error";
923  return "defrag memcap";
925  return "flow memcap";
927  return "flow drop";
929  return "stream error";
931  return "stream memcap";
933  return "stream midstream";
935  return "stream urgent";
937  return "stream reassembly";
939  return "applayer error";
941  return "applayer memcap";
943  return "rules";
945  return "threshold detection_filter";
947  return "nfq error";
949  return "tunnel packet drop";
951  return "default packet policy";
953  return "default app policy";
955  return "pre stream hook";
957  return "pre flow hook";
959  case PKT_DROP_REASON_MAX:
960  return NULL;
961  }
962  return NULL;
963 }
964 
965 static const char *PacketDropReasonToJsonString(enum PacketDropReason r)
966 {
967  switch (r) {
969  return "ips.drop_reason.decode_error";
971  return "ips.drop_reason.defrag_error";
973  return "ips.drop_reason.defrag_memcap";
975  return "ips.drop_reason.flow_memcap";
977  return "ips.drop_reason.flow_drop";
979  return "ips.drop_reason.stream_error";
981  return "ips.drop_reason.stream_memcap";
983  return "ips.drop_reason.stream_midstream";
985  return "ips.drop_reason.stream_urgent";
987  return "ips.drop_reason.stream_reassembly";
989  return "ips.drop_reason.applayer_error";
991  return "ips.drop_reason.applayer_memcap";
993  return "ips.drop_reason.rules";
995  return "ips.drop_reason.threshold_detection_filter";
997  return "ips.drop_reason.nfq_error";
999  return "ips.drop_reason.tunnel_packet_drop";
1001  return "ips.drop_reason.default_packet_policy";
1003  return "ips.drop_reason.default_app_policy";
1005  return "ips.drop_reason.pre_stream_hook";
1007  return "ips.drop_reason.pre_flow_hook";
1009  case PKT_DROP_REASON_MAX:
1010  return NULL;
1011  }
1012  return NULL;
1013 }
1014 
1015 typedef struct CaptureStats_ {
1020 
1023 
1025 
1027 {
1028  if (!EngineModeIsIPS() || PKT_IS_PSEUDOPKT(p))
1029  return;
1030 
1034  } else if (unlikely(PacketCheckAction(p, ACTION_DROP))) {
1036  } else if (unlikely(p->flags & PKT_STREAM_MODIFIED)) {
1038  } else {
1040  }
1043  }
1044 }
1045 
1047 {
1048  if (EngineModeIsIPS()) {
1050  s->counter_ips_accepted = StatsRegisterCounter("ips.accepted", &tv->stats);
1051  s->counter_ips_blocked = StatsRegisterCounter("ips.blocked", &tv->stats);
1052  s->counter_ips_rejected = StatsRegisterCounter("ips.rejected", &tv->stats);
1053  s->counter_ips_replaced = StatsRegisterCounter("ips.replaced", &tv->stats);
1054  for (int i = PKT_DROP_REASON_NOT_SET; i < PKT_DROP_REASON_MAX; i++) {
1055  const char *name = PacketDropReasonToJsonString(i);
1056  if (name != NULL)
1058  }
1059  }
1060 }
1061 
1063 {
1068  intmax_t value = 0;
1069  if (SCConfGetInt("decoder.max-layers", &value) == 1) {
1070  if (value < 0 || value > UINT8_MAX) {
1071  SCLogWarning("Invalid value for decoder.max-layers");
1072  } else {
1073  decoder_max_layers = (uint8_t)value;
1074  }
1075  }
1077 }
1078 
1080 {
1081  intmax_t max = 0;
1082  if (SCConfGetInt("packet-alert-max", &max) == 1) {
1083  if (max <= 0 || max > UINT8_MAX) {
1084  SCLogWarning("Invalid value for packet-alert-max, default value set instead");
1085  } else {
1086  packet_alert_max = (uint16_t)max;
1087  }
1088  }
1089  SCLogDebug("detect->packet_alert_max set to %d", packet_alert_max);
1090 }
1091 
1092 /**
1093  * @}
1094  */
PacketCheckAction
bool PacketCheckAction(const Packet *p, const uint8_t a)
Definition: packet.c:50
PKT_DROP_REASON_DEFRAG_MEMCAP
@ PKT_DROP_REASON_DEFRAG_MEMCAP
Definition: decode.h:384
DecodeThreadVars_::counter_flow_icmp6
StatsCounterId counter_flow_icmp6
Definition: decode.h:1039
PKT_DROP_REASON_DEFRAG_ERROR
@ PKT_DROP_REASON_DEFRAG_ERROR
Definition: decode.h:383
PKT_DROP_REASON_STREAM_PRE_HOOK
@ PKT_DROP_REASON_STREAM_PRE_HOOK
Definition: decode.h:400
util-hash-string.h
PKT_DROP_REASON_RULES_THRESHOLD
@ PKT_DROP_REASON_RULES_THRESHOLD
Definition: decode.h:390
len
uint8_t len
Definition: app-layer-dnp3.h:2
StatsCounterMaxUpdateI64
void StatsCounterMaxUpdateI64(StatsThreadContext *stats, StatsCounterMaxId id, int64_t x)
update the value of the localmax counter
Definition: counters.c:224
DecodeThreadVars_::counter_icmpv4
StatsCounterId counter_icmpv4
Definition: decode.h:987
DecodeThreadVars_::counter_defrag_ipv6_fragments
StatsCounterId counter_defrag_ipv6_fragments
Definition: decode.h:1021
DecodeThreadVars_::counter_esp
StatsCounterId counter_esp
Definition: decode.h:997
DECODE_TUNNEL_IPV6
@ DECODE_TUNNEL_IPV6
Definition: decode.h:1108
DecodeThreadVars_::counter_ethertype_unknown
StatsCounterId counter_ethertype_unknown
Definition: decode.h:990
decode-erspan.h
decode-vxlan.h
OutputFlowLogThreadInit
TmEcode OutputFlowLogThreadInit(ThreadVars *tv, void **data)
thread init for the flow logger This will run the thread init functions for the individual registered...
Definition: output-flow.c:123
offset
uint64_t offset
Definition: util-streaming-buffer.h:0
DecodeERSPAN
int DecodeERSPAN(ThreadVars *tv, DecodeThreadVars *dtv, Packet *p, const uint8_t *pkt, uint32_t len)
ERSPAN Type II.
Definition: decode-erspan.c:76
DecodeThreadVars_::counter_ipv6
StatsCounterId counter_ipv6
Definition: decode.h:980
DecodeThreadVars_::counter_raw
StatsCounterId counter_raw
Definition: decode.h:994
PacketFreeOrRelease
void PacketFreeOrRelease(Packet *p)
Return a packet to where it was allocated.
Definition: decode.c:280
DecodeThreadVars_::counter_vlan_qinqinq
StatsCounterId counter_vlan_qinqinq
Definition: decode.h:1003
DecodeThreadVars_::counter_flow_get_used_eval_busy
StatsCounterId counter_flow_get_used_eval_busy
Definition: decode.h:1045
DecodePPP
int DecodePPP(ThreadVars *tv, DecodeThreadVars *dtv, Packet *p, const uint8_t *pkt, uint32_t len)
Definition: decode-ppp.c:177
PacketCopyData
int PacketCopyData(Packet *p, const uint8_t *pktdata, uint32_t pktlen)
Copy data to Packet payload and set packet length.
Definition: decode.c:381
PacketBypassCallback
void PacketBypassCallback(Packet *p)
Definition: decode.c:534
PKT_IS_PSEUDOPKT
#define PKT_IS_PSEUDOPKT(p)
return 1 if the packet is a pseudo packet
Definition: decode.h:1323
DecodeERSPANConfig
void DecodeERSPANConfig(void)
Functions to decode ERSPAN Type I and II packets.
Definition: decode-erspan.c:53
PacketPoolReturnPacket
void PacketPoolReturnPacket(Packet *p)
Return packet to Packet pool.
Definition: tmqh-packetpool.c:168
GetFlowBypassInfoID
FlowStorageId GetFlowBypassInfoID(void)
Definition: flow-util.c:222
FlowBypassInfo_
Definition: flow.h:521
unlikely
#define unlikely(expr)
Definition: util-optimize.h:35
PKT_DROP_REASON_STREAM_MEMCAP
@ PKT_DROP_REASON_STREAM_MEMCAP
Definition: decode.h:392
DecodeNSH
int DecodeNSH(ThreadVars *tv, DecodeThreadVars *dtv, Packet *p, const uint8_t *pkt, uint32_t len)
Function to decode NSH packets.
Definition: decode-nsh.c:46
PKT_DROP_REASON_FLOW_MEMCAP
@ PKT_DROP_REASON_FLOW_MEMCAP
Definition: decode.h:385
DecodeTeredoConfig
void DecodeTeredoConfig(void)
Definition: decode-teredo.c:104
CaptureStatsSetup
void CaptureStatsSetup(ThreadVars *tv)
Definition: decode.c:1046
PacketDropReasonToString
const char * PacketDropReasonToString(enum PacketDropReason r)
Definition: decode.c:915
PacketEngineEvents_::events
uint8_t events[PACKET_ENGINE_EVENT_MAX]
Definition: decode.h:308
CaptureStats_
Definition: decode.c:1015
PKT_STREAM_MODIFIED
#define PKT_STREAM_MODIFIED
Definition: decode.h:1273
CaptureStats_::counter_ips_replaced
StatsCounterId counter_ips_replaced
Definition: decode.c:1019
DECODE_TUNNEL_IPV6_TEREDO
@ DECODE_TUNNEL_IPV6_TEREDO
Definition: decode.h:1109
SCLogDebug
#define SCLogDebug(...)
Definition: util-debug.h:279
PKT_SRC_SHUTDOWN_FLUSH
@ PKT_SRC_SHUTDOWN_FLUSH
Definition: decode.h:64
StatsRegisterCounter
StatsCounterId StatsRegisterCounter(const char *name, StatsThreadContext *stats)
Registers a normal, unqualified counter.
Definition: counters.c:1001
DecodeThreadVars_::counter_defrag_no_frags
StatsCounterId counter_defrag_no_frags
Definition: decode.h:1024
AddressDebugPrint
void AddressDebugPrint(Address *a)
Debug print function for printing addresses.
Definition: decode.c:799
PKT_SRC_DECODER_IPV4
@ PKT_SRC_DECODER_IPV4
Definition: decode.h:54
PacketDefragPktSetup
Packet * PacketDefragPktSetup(Packet *parent, const uint8_t *pkt, uint32_t len, uint8_t proto)
Setup a pseudo packet (reassembled frags)
Definition: decode.c:477
DecodeThreadVars_::counter_vxlan
StatsCounterId counter_vxlan
Definition: decode.h:1004
stats_stream_events
bool stats_stream_events
Definition: counters.c:101
name
const char * name
Definition: detect-engine-proto.c:48
DecodeThreadVars_::counter_flow_spare_sync_empty
StatsCounterId counter_flow_spare_sync_empty
Definition: decode.h:1049
DecodeThreadVars_::counter_nsh
StatsCounterId counter_nsh
Definition: decode.h:1016
PKT_ZERO_COPY
#define PKT_ZERO_COPY
Definition: decode.h:1286
DecodeThreadVars_::counter_gre
StatsCounterId counter_gre
Definition: decode.h:1000
DecodeThreadVars_::counter_flow_get_used_failed
StatsCounterId counter_flow_get_used_failed
Definition: decode.h:1046
PKT_SRC_CAPTURE_TIMEOUT
@ PKT_SRC_CAPTURE_TIMEOUT
Definition: decode.h:62
action-globals.h
Packet_::flags
uint32_t flags
Definition: decode.h:544
PacketAlertCreate
PacketAlert * PacketAlertCreate(void)
Initialize PacketAlerts with dynamic alerts array size.
Definition: decode.c:144
Packet_::vlan_idx
uint8_t vlan_idx
Definition: decode.h:529
util-hash.h
ExceptionPolicyStatsSetts_
Definition: util-exception-policy-types.h:57
CaptureStats
struct CaptureStats_ CaptureStats
DECODE_EVENT_PACKET_MAX
@ DECODE_EVENT_PACKET_MAX
Definition: decode-events.h:235
PKT_DROP_REASON_FLOW_PRE_HOOK
@ PKT_DROP_REASON_FLOW_PRE_HOOK
Definition: decode.h:401
Packet_::pool
struct PktPool_ * pool
Definition: decode.h:670
PKT_DROP_REASON_MAX
@ PKT_DROP_REASON_MAX
Definition: decode.h:402
PKT_DROP_REASON_STREAM_REASSEMBLY
@ PKT_DROP_REASON_STREAM_REASSEMBLY
Definition: decode.h:394
DECODE_TUNNEL_ERSPANI
@ DECODE_TUNNEL_ERSPANI
Definition: decode.h:1105
DecodeThreadVars_::counter_bytes
StatsCounterId counter_bytes
Definition: decode.h:969
PacketCopyDataOffset
int PacketCopyDataOffset(Packet *p, uint32_t offset, const uint8_t *data, uint32_t datalen)
Copy data to Packet payload at given offset.
Definition: decode.c:339
DecodeThreadVars_::counter_flow_get_used
StatsCounterId counter_flow_get_used
Definition: decode.h:1042
DecodeThreadVars_::counter_pppoe
StatsCounterId counter_pppoe
Definition: decode.h:1008
SCMutexLock
#define SCMutexLock(mut)
Definition: threads-debug.h:117
FLOW_PKT_TOSERVER
#define FLOW_PKT_TOSERVER
Definition: flow.h:225
HashTable_
Definition: util-hash.h:35
DecodeThreadVars_::counter_tcp_syn
StatsCounterId counter_tcp_syn
Definition: decode.h:982
ACTION_REJECT_ANY
#define ACTION_REJECT_ANY
Definition: action-globals.h:38
Address_
Definition: decode.h:112
flow_memcap_eps_stats
ExceptionPolicyStatsSetts flow_memcap_eps_stats
Definition: decode.c:114
DecodeARP
int DecodeARP(ThreadVars *tv, DecodeThreadVars *dtv, Packet *p, const uint8_t *pkt, uint32_t len)
Definition: decode-arp.c:29
SCMUTEX_INITIALIZER
#define SCMUTEX_INITIALIZER
Definition: threads-debug.h:122
DecodeThreadVars_::counter_icmpv6
StatsCounterId counter_icmpv6
Definition: decode.h:988
StatsCounterId
Definition: counters.h:30
PacketDecodeFinalize
void PacketDecodeFinalize(ThreadVars *tv, DecodeThreadVars *dtv, Packet *p)
Finalize decoding of a packet.
Definition: decode.c:236
proto
uint8_t proto
Definition: decode-template.h:0
DecodeThreadVars_::counter_invalid
StatsCounterId counter_invalid
Definition: decode.h:975
PacketAlertGetMaxConfig
void PacketAlertGetMaxConfig(void)
Definition: decode.c:1079
decoder_max_layers
uint8_t decoder_max_layers
Definition: decode.c:81
Packet_::flowflags
uint8_t flowflags
Definition: decode.h:532
StringHashCompareFunc
char StringHashCompareFunc(void *data1, uint16_t datalen1, void *data2, uint16_t datalen2)
Definition: util-hash-string.c:38
Packet_::BypassPacketsFlow
int(* BypassPacketsFlow)(struct Packet_ *)
Definition: decode.h:594
TmqhOutputPacketpool
void TmqhOutputPacketpool(ThreadVars *t, Packet *p)
Definition: tmqh-packetpool.c:305
DecodeVXLANConfig
void DecodeVXLANConfig(void)
Definition: decode-vxlan.c:104
DecodeThreadVars_::counter_flow_spare_sync
StatsCounterId counter_flow_spare_sync
Definition: decode.h:1048
DecodeThreadVars_::counter_defrag_ipv4_reassembled
StatsCounterId counter_defrag_ipv4_reassembled
Definition: decode.h:1020
PacketDropReason
PacketDropReason
Definition: decode.h:380
DecodeUnregisterCounters
void DecodeUnregisterCounters(void)
Definition: decode.c:606
DecodeThreadVars_::counter_chdlc
StatsCounterId counter_chdlc
Definition: decode.h:978
DecodeThreadVars_::counter_sctp
StatsCounterId counter_sctp
Definition: decode.h:996
GET_PKT_DIRECT_MAX_SIZE
#define GET_PKT_DIRECT_MAX_SIZE(p)
Definition: decode.h:211
StatsRegisterAvgCounter
StatsCounterAvgId StatsRegisterAvgCounter(const char *name, StatsThreadContext *stats)
Registers a counter, whose value holds the average of all the values assigned to it.
Definition: counters.c:1019
PacketTunnelChild
@ PacketTunnelChild
Definition: decode.h:408
tmqh-packetpool.h
StringHashFunc
uint32_t StringHashFunc(HashTable *ht, void *data, uint16_t datalen)
Definition: util-hash-string.c:33
Packet_::events
PacketEngineEvents events
Definition: decode.h:630
PacketAlertFree
void PacketAlertFree(PacketAlert *pa_array)
Definition: decode.c:169
DecodeThreadVars_::counter_tcp
StatsCounterId counter_tcp
Definition: decode.h:981
TM_ECODE_OK
@ TM_ECODE_OK
Definition: tm-threads-common.h:81
HashTableFree
void HashTableFree(HashTable *ht)
Free a HashTable and all its contents.
Definition: util-hash.c:100
Flow_::flow_state
FlowStateType flow_state
Definition: flow.h:404
PKT_DROP_REASON_STREAM_URG
@ PKT_DROP_REASON_STREAM_URG
Definition: decode.h:395
DECODE_TUNNEL_NSH
@ DECODE_TUNNEL_NSH
Definition: decode.h:1111
DecodeThreadVars_::counter_defrag_tracker_hard_reuse
StatsCounterId counter_defrag_tracker_hard_reuse
Definition: decode.h:1026
Packet_::datalink
int datalink
Definition: decode.h:639
PKT_DEFAULT_MAX_DECODED_LAYERS
#define PKT_DEFAULT_MAX_DECODED_LAYERS
Definition: decode.h:1329
stats_decoder_events_prefix
const char * stats_decoder_events_prefix
Definition: counters.c:99
StatsCounterAvgAddI64
void StatsCounterAvgAddI64(StatsThreadContext *stats, StatsCounterAvgId id, int64_t x)
Definition: counters.c:240
DecodeThreadVars_::counter_flow_memcap
StatsCounterId counter_flow_memcap
Definition: decode.h:1030
DecodeThreadVars_::counter_defrag_max_hit
StatsCounterId counter_defrag_max_hit
Definition: decode.h:1023
CaptureStats_::counter_ips_accepted
StatsCounterId counter_ips_accepted
Definition: decode.c:1016
DecodeRegisterPerfCounters
void DecodeRegisterPerfCounters(DecodeThreadVars *dtv, ThreadVars *tv)
Definition: decode.c:632
DecodeThreadVars_::counter_flow_elephant
StatsCounterId counter_flow_elephant
Definition: decode.h:1041
DECODE_TUNNEL_ERSPANII
@ DECODE_TUNNEL_ERSPANII
Definition: decode.h:1104
SET_PKT_LEN
#define SET_PKT_LEN(p, len)
Definition: decode.h:213
FLOW_STATE_LOCAL_BYPASSED
@ FLOW_STATE_LOCAL_BYPASSED
Definition: flow.h:499
PacketAlert_::json_info
struct PacketContextData * json_info
Definition: decode.h:255
PKT_DROP_REASON_DEFAULT_APP_POLICY
@ PKT_DROP_REASON_DEFAULT_APP_POLICY
Definition: decode.h:399
decode.h
util-debug.h
PKT_SRC_WIRE
@ PKT_SRC_WIRE
Definition: decode.h:52
PKT_IS_TOSERVER
#define PKT_IS_TOSERVER(p)
Definition: decode.h:238
DecodeThreadVars_::counter_udp
StatsCounterId counter_udp
Definition: decode.h:986
DecodeERSPANTypeI
int DecodeERSPANTypeI(ThreadVars *tv, DecodeThreadVars *dtv, Packet *p, const uint8_t *pkt, uint32_t len)
ERSPAN Type I.
Definition: decode-erspan.c:65
DEvents
const struct DecodeEvents_ DEvents[]
Definition: decode-events.c:29
Packet_::ts
SCTime_t ts
Definition: decode.h:555
PKT_DROP_REASON_APPLAYER_ERROR
@ PKT_DROP_REASON_APPLAYER_ERROR
Definition: decode.h:387
SCMutexUnlock
#define SCMutexUnlock(mut)
Definition: threads-debug.h:120
PacketSwap
void PacketSwap(Packet *p)
switch direction of a packet
Definition: decode.c:581
util-exception-policy.h
PktSrcEnum
PktSrcEnum
Definition: decode.h:51
PKT_DROP_REASON_NOT_SET
@ PKT_DROP_REASON_NOT_SET
Definition: decode.h:381
SCConfGetInt
int SCConfGetInt(const char *name, intmax_t *val)
Retrieve a configuration value as an integer.
Definition: conf.c:414
DecodeTunnelProto
DecodeTunnelProto
Definition: decode.h:1102
PacketDestructor
void PacketDestructor(Packet *p)
Cleanup a packet so that we can free it. No memset needed..
Definition: packet.c:169
CaptureStatsUpdate
void CaptureStatsUpdate(ThreadVars *tv, const Packet *p)
Definition: decode.c:1026
util-print.h
PKT_SRC_DECODER_TEREDO
@ PKT_SRC_DECODER_TEREDO
Definition: decode.h:56
DecodeThreadVars_::counter_vntag
StatsCounterId counter_vntag
Definition: decode.h:1005
SCEnter
#define SCEnter(...)
Definition: util-debug.h:281
GET_PKT_DATA
#define GET_PKT_DATA(p)
Definition: decode.h:209
ExceptionPolicySetStatsCounters
void ExceptionPolicySetStatsCounters(ThreadVars *tv, ExceptionPolicyCounters *counter, ExceptionPolicyStatsSetts *setting, enum ExceptionPolicy conf_policy, const char *default_str, bool(*isExceptionPolicyValid)(enum ExceptionPolicy))
Definition: util-exception-policy.c:377
HashTableLookup
void * HashTableLookup(HashTable *ht, void *data, uint16_t datalen)
Definition: util-hash.c:182
DecodeThreadVars_::counter_avg_pkt_size
StatsCounterAvgId counter_avg_pkt_size
Definition: decode.h:970
ThreadVars_
Per thread variable structure.
Definition: threadvars.h:58
PrintInet
const char * PrintInet(int af, const void *src, char *dst, socklen_t size)
Definition: util-print.c:231
DecodeThreadVars_::counter_flow_active
StatsCounterId counter_flow_active
Definition: decode.h:1035
DecodeThreadVars_::counter_ipv6inipv4
StatsCounterId counter_ipv6inipv4
Definition: decode.h:1012
DECODE_TUNNEL_PPP
@ DECODE_TUNNEL_PPP
Definition: decode.h:1110
PacketContextData
Definition: decode.h:241
FLOW_PKT_TOCLIENT_FIRST
#define FLOW_PKT_TOCLIENT_FIRST
Definition: flow.h:229
FlowSetStorageById
int FlowSetStorageById(Flow *f, FlowStorageId id, void *ptr)
Definition: flow-storage.c:45
StatsCounterIncr
void StatsCounterIncr(StatsThreadContext *stats, StatsCounterId id)
Increments the local counter.
Definition: counters.c:165
PacketFree
void PacketFree(Packet *p)
Return a malloced packet.
Definition: decode.c:223
PktSrcToString
const char * PktSrcToString(enum PktSrcEnum pkt_src)
Definition: decode.c:867
ExceptionPolicyStatsSetts_::valid_settings_ids
bool valid_settings_ids[EXCEPTION_POLICY_MAX]
Definition: util-exception-policy-types.h:59
DecodeThreadVars_::counter_tcp_urg
StatsCounterId counter_tcp_urg
Definition: decode.h:985
DecodeThreadVars_::counter_pkts
StatsCounterId counter_pkts
Definition: decode.h:968
DecodeThreadVars_::counter_eth
StatsCounterId counter_eth
Definition: decode.h:977
SCLogWarning
#define SCLogWarning(...)
Macro used to log WARNING messages.
Definition: util-debug.h:259
HashTableAdd
int HashTableAdd(HashTable *ht, void *data, uint16_t datalen)
Definition: util-hash.c:120
SIZE_OF_PACKET
#define SIZE_OF_PACKET
Definition: decode.h:703
StringHashFreeFunc
void StringHashFreeFunc(void *data)
Definition: util-hash-string.c:51
BUG_ON
#define BUG_ON(x)
Definition: suricata-common.h:317
PKT_DROP_REASON_RULES
@ PKT_DROP_REASON_RULES
Definition: decode.h:389
util-profiling.h
DecodeThreadVars_::counter_flow_spare_sync_avg
StatsCounterAvgId counter_flow_spare_sync_avg
Definition: decode.h:1051
PacketCallocExtPkt
int PacketCallocExtPkt(Packet *p, int datalen)
Definition: decode.c:313
DecodeThreadVars_::counter_flow_icmp4
StatsCounterId counter_flow_icmp4
Definition: decode.h:1038
PKT_SRC_STREAM_TCP_DETECTLOG_FLUSH
@ PKT_SRC_STREAM_TCP_DETECTLOG_FLUSH
Definition: decode.h:59
DecodeThreadVars_::counter_ieee8021ah
StatsCounterId counter_ieee8021ah
Definition: decode.h:1007
DECODE_TUNNEL_VLAN
@ DECODE_TUNNEL_VLAN
Definition: decode.h:1106
PKT_SRC_DECODER_IPV6
@ PKT_SRC_DECODER_IPV6
Definition: decode.h:55
DecodeThreadVars_::counter_defrag_tracker_timeout
StatsCounterId counter_defrag_tracker_timeout
Definition: decode.h:1027
Packet_
Definition: decode.h:501
CaptureStats_::counter_drop_reason
StatsCounterId counter_drop_reason[PKT_DROP_REASON_MAX]
Definition: decode.c:1021
DecodeIPV6
int DecodeIPV6(ThreadVars *tv, DecodeThreadVars *dtv, Packet *p, const uint8_t *pkt, uint16_t len)
Definition: decode-ipv6.c:549
DECODE_TUNNEL_IPV4
@ DECODE_TUNNEL_IPV4
Definition: decode.h:1107
GET_PKT_LEN
#define GET_PKT_LEN(p)
Definition: decode.h:208
DecodeThreadVars_::app_tctx
AppLayerThreadCtx * app_tctx
Definition: decode.h:965
decode-teredo.h
CaptureStats_::counter_ips_blocked
StatsCounterId counter_ips_blocked
Definition: decode.c:1017
PKT_DROP_REASON_STREAM_ERROR
@ PKT_DROP_REASON_STREAM_ERROR
Definition: decode.h:391
Packet_::livedev
struct LiveDevice_ * livedev
Definition: decode.h:618
DecodeThreadVars_::counter_geneve
StatsCounterId counter_geneve
Definition: decode.h:999
SCReturnPtr
#define SCReturnPtr(x, type)
Definition: util-debug.h:297
AppLayerGetCtxThread
AppLayerThreadCtx * AppLayerGetCtxThread(void)
Creates a new app layer thread context.
Definition: app-layer.c:1104
DecodeThreadVars_::counter_tcp_rst
StatsCounterId counter_tcp_rst
Definition: decode.h:984
FLOW_PKT_TOCLIENT
#define FLOW_PKT_TOCLIENT
Definition: flow.h:226
DECODE_TUNNEL_ETHERNET
@ DECODE_TUNNEL_ETHERNET
Definition: decode.h:1103
DecodeThreadVars_::counter_ipv4inipv6
StatsCounterId counter_ipv4inipv6
Definition: decode.h:1013
FlowGetStorageById
void * FlowGetStorageById(const Flow *f, FlowStorageId id)
Definition: flow-storage.c:40
FlowUpdateState
void FlowUpdateState(Flow *f, const enum FlowState s)
Definition: flow.c:1164
DecodeThreadVars_::counter_max_mac_addrs_dst
StatsCounterMaxId counter_max_mac_addrs_dst
Definition: decode.h:973
PacketTunnelNone
@ PacketTunnelNone
Definition: decode.h:406
PKT_DROP_REASON_DEFAULT_PACKET_POLICY
@ PKT_DROP_REASON_DEFAULT_PACKET_POLICY
Definition: decode.h:398
dtv
DecodeThreadVars * dtv
Definition: fuzz_decodepcapfile.c:33
DecodeThreadVars_::counter_defrag_memcap_eps
ExceptionPolicyCounters counter_defrag_memcap_eps
Definition: decode.h:1028
DecodeThreadVars_::counter_max_mac_addrs_src
StatsCounterMaxId counter_max_mac_addrs_src
Definition: decode.h:972
default_packet_size
uint32_t default_packet_size
Definition: decode.c:77
Packet_::nb_decoded_layers
uint8_t nb_decoded_layers
Definition: decode.h:644
PKT_SRC_DECODER_GENEVE
@ PKT_SRC_DECODER_GENEVE
Definition: decode.h:63
Packet_::ReleasePacket
void(* ReleasePacket)(struct Packet_ *)
Definition: decode.h:591
flow-storage.h
cnt
uint32_t cnt
Definition: tmqh-packetpool.h:7
Packet_::flow
struct Flow_ * flow
Definition: decode.h:546
Packet_::tenant_id
uint32_t tenant_id
Definition: decode.h:665
DecodeThreadVars_::counter_ipv4inipv4
StatsCounterId counter_ipv4inipv4
Definition: decode.h:1011
PKT_DROP_REASON_INNER_PACKET
@ PKT_DROP_REASON_INNER_PACKET
Definition: decode.h:397
FlowGetMemcapExceptionPolicy
enum ExceptionPolicy FlowGetMemcapExceptionPolicy(void)
Definition: flow.c:135
DecodeThreadVarsFree
void DecodeThreadVarsFree(ThreadVars *tv, DecodeThreadVars *dtv)
Definition: decode.c:834
DecodeThreadVars_::counter_sll
StatsCounterId counter_sll
Definition: decode.h:992
DecodeThreadVars_::counter_ppp
StatsCounterId counter_ppp
Definition: decode.h:998
PKT_DROP_REASON_APPLAYER_MEMCAP
@ PKT_DROP_REASON_APPLAYER_MEMCAP
Definition: decode.h:388
DecodeGlobalConfig
void DecodeGlobalConfig(void)
Definition: decode.c:1062
suricata-common.h
PKT_SRC_FFR
@ PKT_SRC_FFR
Definition: decode.h:58
DecodeThreadVars_::counter_flow_udp
StatsCounterId counter_flow_udp
Definition: decode.h:1037
decode-arp.h
DecodeThreadVars_::counter_tcp_synack
StatsCounterId counter_tcp_synack
Definition: decode.h:983
packet.h
ACTION_DROP
#define ACTION_DROP
Definition: action-globals.h:30
Packet_::ext_pkt
uint8_t * ext_pkt
Definition: decode.h:615
PKT_DROP_REASON_NFQ_ERROR
@ PKT_DROP_REASON_NFQ_ERROR
Definition: decode.h:396
GENERIC_TOO_MANY_LAYERS
@ GENERIC_TOO_MANY_LAYERS
Definition: decode-events.h:232
DecodeThreadVars_::counter_null
StatsCounterId counter_null
Definition: decode.h:995
Packet_::ttype
enum PacketTunnelType ttype
Definition: decode.h:553
PacketUpdateEngineEventCounters
void PacketUpdateEngineEventCounters(ThreadVars *tv, DecodeThreadVars *dtv, Packet *p)
Definition: decode.c:243
SCStrdup
#define SCStrdup(s)
Definition: util-mem.h:56
DecodeThreadVars_::counter_flow_memcap_eps
ExceptionPolicyCounters counter_flow_memcap_eps
Definition: decode.h:1031
FatalError
#define FatalError(...)
Definition: util-debug.h:514
decode-geneve.h
PacketContextData::next
struct PacketContextData * next
Definition: decode.h:243
PKT_SRC_DEFRAG
@ PKT_SRC_DEFRAG
Definition: decode.h:57
tv
ThreadVars * tv
Definition: fuzz_decodepcapfile.c:32
DecodeThreadVars_::counter_vlan_qinq
StatsCounterId counter_vlan_qinq
Definition: decode.h:1002
DecodeThreadVars_::counter_teredo
StatsCounterId counter_teredo
Definition: decode.h:1009
PACKET_PROFILING_START
#define PACKET_PROFILING_START(p)
Definition: util-profiling.h:73
util-validate.h
PacketGetFromAlloc
Packet * PacketGetFromAlloc(void)
Get a malloced packet.
Definition: decode.c:262
defrag_memcap_eps_stats
ExceptionPolicyStatsSetts defrag_memcap_eps_stats
Definition: decode.c:86
PKT_SRC_DECODER_VXLAN
@ PKT_SRC_DECODER_VXLAN
Definition: decode.h:60
SCMalloc
#define SCMalloc(sz)
Definition: util-mem.h:47
CaptureStats_::counter_ips_rejected
StatsCounterId counter_ips_rejected
Definition: decode.c:1018
PACKET_ALERT_MAX
#define PACKET_ALERT_MAX
Definition: decode.h:284
Packet_::root
struct Packet_ * root
Definition: decode.h:653
SCLogError
#define SCLogError(...)
Macro used to log ERROR messages.
Definition: util-debug.h:271
OutputFlowLogThreadDeinit
TmEcode OutputFlowLogThreadDeinit(ThreadVars *tv, void *thread_data)
Definition: output-flow.c:163
PKT_SRC_DETECT_RELOAD_FLUSH
@ PKT_SRC_DETECT_RELOAD_FLUSH
Definition: decode.h:61
SCFree
#define SCFree(p)
Definition: util-mem.h:61
DecodeThreadVars_::counter_max_pkt_size
StatsCounterMaxId counter_max_pkt_size
Definition: decode.h:971
DecodeThreadVars_::counter_flow_spare_sync_incomplete
StatsCounterId counter_flow_spare_sync_incomplete
Definition: decode.h:1050
DecodeThreadVars_::counter_sll2
StatsCounterId counter_sll2
Definition: decode.h:993
DecodeThreadVars_
Structure to hold thread specific data for all decode modules.
Definition: decode.h:963
MAX_PAYLOAD_SIZE
#define MAX_PAYLOAD_SIZE
Definition: decode.h:701
ExceptionPolicyStatsSetts_::valid_settings_ips
bool valid_settings_ips[EXCEPTION_POLICY_MAX]
Definition: util-exception-policy-types.h:60
AppLayerDestroyCtxThread
void AppLayerDestroyCtxThread(AppLayerThreadCtx *app_tctx)
Destroys the context created by AppLayerGetCtxThread().
Definition: app-layer.c:1125
Packet_::recursion_level
uint8_t recursion_level
Definition: decode.h:526
DecodeThreadVars_::counter_defrag_ipv4_fragments
StatsCounterId counter_defrag_ipv4_fragments
Definition: decode.h:1019
DecodeThreadVars_::counter_etag
StatsCounterId counter_etag
Definition: decode.h:1006
StatsRegisterMaxCounter
StatsCounterMaxId StatsRegisterMaxCounter(const char *name, StatsThreadContext *stats)
Registers a counter, whose value holds the maximum of all the values assigned to it.
Definition: counters.c:1037
DecodeThreadVars_::counter_tcp_active_sessions
StatsCounterId counter_tcp_active_sessions
Definition: decode.h:1033
DecodeThreadVars_::output_flow_thread_data
void * output_flow_thread_data
Definition: decode.h:1057
DecodeThreadVarsAlloc
DecodeThreadVars * DecodeThreadVarsAlloc(ThreadVars *tv)
Alloc and setup DecodeThreadVars.
Definition: decode.c:816
WARN_UNUSED
#define WARN_UNUSED
Definition: bindgen.h:33
HashTableInit
HashTable * HashTableInit(uint32_t size, uint32_t(*Hash)(struct HashTable_ *, void *, uint16_t), char(*Compare)(void *, uint16_t, void *, uint16_t), void(*Free)(void *))
Definition: util-hash.c:35
PacketSetData
int PacketSetData(Packet *p, const uint8_t *pktdata, uint32_t pktlen)
Set data for Packet and set length when zero copy is used.
Definition: decode.c:854
PacketPoolGetPacket
Packet * PacketPoolGetPacket(void)
Get a new packet from the packet pool.
Definition: tmqh-packetpool.c:118
GET_PKT_DIRECT_DATA
#define GET_PKT_DIRECT_DATA(p)
Definition: decode.h:210
t_capture_stats
thread_local CaptureStats t_capture_stats
Definition: decode.c:1024
DecodeThreadVars_::counter_defrag_ipv6_reassembled
StatsCounterId counter_defrag_ipv6_reassembled
Definition: decode.h:1022
EngineModeIsIPS
int EngineModeIsIPS(void)
Definition: suricata.c:245
DecodeThreadVars_::counter_mpls
StatsCounterId counter_mpls
Definition: decode.h:1010
defrag-hash.h
Packet_::drop_reason
uint8_t drop_reason
Definition: decode.h:647
Address_::family
char family
Definition: decode.h:113
PKT_SRC_DECODER_GRE
@ PKT_SRC_DECODER_GRE
Definition: decode.h:53
ENGINE_SET_INVALID_EVENT
#define ENGINE_SET_INVALID_EVENT(p, e)
Definition: decode.h:1196
PacketAlert_
Definition: decode.h:248
DecodeGeneveConfig
void DecodeGeneveConfig(void)
Definition: decode-geneve.c:128
PacketTunnelRoot
@ PacketTunnelRoot
Definition: decode.h:407
PacketAlertRecycle
void PacketAlertRecycle(PacketAlert *pa_array, uint16_t cnt)
Definition: decode.c:152
packet_alert_max
uint16_t packet_alert_max
Definition: decode.c:82
Packet_::vlan_id
uint16_t vlan_id[VLAN_MAX_LAYERS]
Definition: decode.h:528
DecodeThreadVars_::counter_ipv4
StatsCounterId counter_ipv4
Definition: decode.h:979
DecodeThreadVars_::counter_flow_total
StatsCounterId counter_flow_total
Definition: decode.h:1034
DECODE_TUNNEL_ARP
@ DECODE_TUNNEL_ARP
Definition: decode.h:1112
likely
#define likely(expr)
Definition: util-optimize.h:32
PacketContextData::json_string
char * json_string
Definition: decode.h:242
DecodeThreadVars_::counter_arp
StatsCounterId counter_arp
Definition: decode.h:989
DecodeThreadVars_::counter_vlan
StatsCounterId counter_vlan
Definition: decode.h:1001
PacketDefragPktSetupParent
void PacketDefragPktSetupParent(Packet *parent)
inform defrag "parent" that a pseudo packet is now associated to it.
Definition: decode.c:516
DecodeThreadVars_::counter_defrag_tracker_soft_reuse
StatsCounterId counter_defrag_tracker_soft_reuse
Definition: decode.h:1025
PacketTunnelPktSetup
Packet * PacketTunnelPktSetup(ThreadVars *tv, DecodeThreadVars *dtv, Packet *parent, const uint8_t *pkt, uint32_t len, enum DecodeTunnelProto proto)
Setup a pseudo packet (tunnel)
Definition: decode.c:397
stats_decoder_events
bool stats_decoder_events
Definition: counters.c:98
flow.h
PKT_DROP_REASON_STREAM_MIDSTREAM
@ PKT_DROP_REASON_STREAM_MIDSTREAM
Definition: decode.h:393
DecodeIPV4
int DecodeIPV4(ThreadVars *tv, DecodeThreadVars *dtv, Packet *p, const uint8_t *pkt, uint16_t len)
Definition: decode-ipv4.c:515
PacketInit
void PacketInit(Packet *p)
Initialize a packet structure for use.
Definition: packet.c:73
ExceptionPolicy
ExceptionPolicy
Definition: util-exception-policy-types.h:25
SCCalloc
#define SCCalloc(nm, sz)
Definition: util-mem.h:53
DecodeThreadVars_::counter_erspan
StatsCounterId counter_erspan
Definition: decode.h:1015
ThreadVars_::stats
StatsThreadContext stats
Definition: threadvars.h:121
DecodeVLAN
int DecodeVLAN(ThreadVars *tv, DecodeThreadVars *dtv, Packet *p, const uint8_t *pkt, uint32_t len)
Definition: decode-vlan.c:54
StatsCounterAddI64
void StatsCounterAddI64(StatsThreadContext *stats, StatsCounterId id, int64_t x)
Adds a value of type uint64_t to the local counter.
Definition: counters.c:146
DecodeThreadVars_::counter_ipv6inipv6
StatsCounterId counter_ipv6inipv6
Definition: decode.h:1014
FLOW_PKT_TOSERVER_FIRST
#define FLOW_PKT_TOSERVER_FIRST
Definition: flow.h:228
DefragGetMemcapExceptionPolicy
enum ExceptionPolicy DefragGetMemcapExceptionPolicy(void)
Definition: defrag-hash.c:80
DecodeThreadVars_::counter_engine_events
StatsCounterId counter_engine_events[DECODE_EVENT_MAX]
Definition: decode.h:1053
SCMutex
#define SCMutex
Definition: threads-debug.h:114
PacketGetFromQueueOrAlloc
Packet * PacketGetFromQueueOrAlloc(void)
Get a packet. We try to get a packet from the packetpool first, but if that is empty we alloc a packe...
Definition: decode.c:297
DEBUG_VALIDATE_BUG_ON
#define DEBUG_VALIDATE_BUG_ON(exp)
Definition: util-validate.h:102
DecodeEthernet
int DecodeEthernet(ThreadVars *tv, DecodeThreadVars *dtv, Packet *p, const uint8_t *pkt, uint32_t len)
Definition: decode-ethernet.c:42
PKT_DROP_REASON_FLOW_DROP
@ PKT_DROP_REASON_FLOW_DROP
Definition: decode.h:386
PKT_IS_INVALID
#define PKT_IS_INVALID
Definition: decode.h:1293
DecodeUpdatePacketCounters
void DecodeUpdatePacketCounters(ThreadVars *tv, const DecodeThreadVars *dtv, const Packet *p)
Definition: decode.c:783
output.h
DecodeThreadVars_::counter_flow_get_used_eval_reject
StatsCounterId counter_flow_get_used_eval_reject
Definition: decode.h:1044
DecodeThreadVars_::counter_flow_get_used_eval
StatsCounterId counter_flow_get_used_eval
Definition: decode.h:1043
DECODE_EVENT_MAX
@ DECODE_EVENT_MAX
Definition: decode-events.h:322
app-layer.h
DecodeThreadVars_::counter_flow_tcp_reuse
StatsCounterId counter_flow_tcp_reuse
Definition: decode.h:1040
PKT_DROP_REASON_DECODE_ERROR
@ PKT_DROP_REASON_DECODE_ERROR
Definition: decode.h:382
PacketEngineEvents_::cnt
uint8_t cnt
Definition: decode.h:307
DecodeThreadVars_::counter_flow_tcp
StatsCounterId counter_flow_tcp
Definition: decode.h:1036