]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
Add counters for IPv4 in IPv6 and IPv6 in IPv6 45/head
authorEric Leblond <eric@regit.org>
Mon, 3 Sep 2012 08:04:43 +0000 (10:04 +0200)
committerEric Leblond <eric@regit.org>
Mon, 3 Sep 2012 08:04:43 +0000 (10:04 +0200)
src/decode-ipv6.c
src/decode.c
src/decode.h

index be003afc110f371ea267a71dcfa49bf085585705..95afe8ca19d5588d9c22b93c46838ecbb588fa68 100644 (file)
@@ -62,6 +62,7 @@ static void DecodeIPv4inIPv6(ThreadVars *tv, DecodeThreadVars *dtv, Packet *p, u
             if (tp != NULL) {
                 DecodeTunnel(tv, dtv, tp, pkt, plen, pq, IPPROTO_IP);
                 PacketEnqueue(pq,tp);
+                SCPerfCounterIncr(dtv->counter_ipv4inipv6, tv->sc_perf_pca);
                 return;
             }
         }
@@ -88,6 +89,7 @@ static void DecodeIP6inIP6(ThreadVars *tv, DecodeThreadVars *dtv, Packet *p, uin
             if (tp != NULL) {
                 DecodeTunnel(tv, dtv, tp, pkt, plen, pq, IPPROTO_IPV6);
                 PacketEnqueue(pq,tp);
+                SCPerfCounterIncr(dtv->counter_ipv6inipv6, tv->sc_perf_pca);
                 return;
             }
         }
index 2d31b05f0cff24745f6627adf8a786a9f360b0cf..79ec96a72ce5f1fb61683b08cfdb8e94773c2531 100644 (file)
@@ -336,6 +336,10 @@ void DecodeRegisterPerfCounters(DecodeThreadVars *dtv, ThreadVars *tv)
                                                SC_PERF_TYPE_UINT64, "NULL");
     dtv->counter_teredo = SCPerfTVRegisterCounter("decoder.teredo", tv,
                                                SC_PERF_TYPE_UINT64, "NULL");
+    dtv->counter_ipv4inipv6 = SCPerfTVRegisterCounter("decoder.ipv4_in_ipv6", tv,
+                                               SC_PERF_TYPE_UINT64, "NULL");
+    dtv->counter_ipv6inipv6 = SCPerfTVRegisterCounter("decoder.ipv6_in_ipv6", tv,
+                                               SC_PERF_TYPE_UINT64, "NULL");
     dtv->counter_avg_pkt_size = SCPerfTVRegisterAvgCounter("decoder.avg_pkt_size", tv,
                                                            SC_PERF_TYPE_DOUBLE, "NULL");
     dtv->counter_max_pkt_size = SCPerfTVRegisterMaxCounter("decoder.max_pkt_size", tv,
index 669fb8c102e016dfbe4be348ace10942acb94ea2..a0127f5f3eccc048943cdb8ce6755b9ddf14a4f7 100644 (file)
@@ -555,6 +555,8 @@ typedef struct DecodeThreadVars_
     uint16_t counter_vlan;
     uint16_t counter_pppoe;
     uint16_t counter_teredo;
+    uint16_t counter_ipv4inipv6;
+    uint16_t counter_ipv6inipv6;
     uint16_t counter_avg_pkt_size;
     uint16_t counter_max_pkt_size;