decode: add stats counters for ipv4/ipv6 over ipv4

These existed for ipv6 over ipv6, and ipv4 over ipv6, but not for the
ipv4 counterpart.

Task #7758
pull/13518/head
Juliana Fajardini 1 month ago committed by Victor Julien
parent fdf0fa30c6
commit cbe621fb09

@ -6064,12 +6064,18 @@
"ipv4": { "ipv4": {
"type": "integer" "type": "integer"
}, },
"ipv4_in_ipv4": {
"type": "integer"
},
"ipv4_in_ipv6": { "ipv4_in_ipv6": {
"type": "integer" "type": "integer"
}, },
"ipv6": { "ipv6": {
"type": "integer" "type": "integer"
}, },
"ipv6_in_ipv4": {
"type": "integer"
},
"ipv6_in_ipv6": { "ipv6_in_ipv6": {
"type": "integer" "type": "integer"
}, },

@ -591,6 +591,7 @@ int DecodeIPV4(ThreadVars *tv, DecodeThreadVars *dtv, Packet *p,
if (tp != NULL) { if (tp != NULL) {
PKT_SET_SRC(tp, PKT_SRC_DECODER_IPV4); PKT_SET_SRC(tp, PKT_SRC_DECODER_IPV4);
PacketEnqueueNoLock(&tv->decode_pq, tp); PacketEnqueueNoLock(&tv->decode_pq, tp);
StatsIncr(tv, dtv->counter_ipv6inipv4);
} }
FlowSetupPacket(p); FlowSetupPacket(p);
break; break;
@ -601,6 +602,7 @@ int DecodeIPV4(ThreadVars *tv, DecodeThreadVars *dtv, Packet *p,
if (tp != NULL) { if (tp != NULL) {
PKT_SET_SRC(tp, PKT_SRC_DECODER_IPV4); PKT_SET_SRC(tp, PKT_SRC_DECODER_IPV4);
PacketEnqueueNoLock(&tv->decode_pq, tp); PacketEnqueueNoLock(&tv->decode_pq, tp);
StatsIncr(tv, dtv->counter_ipv4inipv4);
} }
FlowSetupPacket(p); FlowSetupPacket(p);
break; break;

@ -664,6 +664,8 @@ void DecodeRegisterPerfCounters(DecodeThreadVars *dtv, ThreadVars *tv)
dtv->counter_vntag = StatsRegisterCounter("decoder.vntag", tv); dtv->counter_vntag = StatsRegisterCounter("decoder.vntag", tv);
dtv->counter_ieee8021ah = StatsRegisterCounter("decoder.ieee8021ah", tv); dtv->counter_ieee8021ah = StatsRegisterCounter("decoder.ieee8021ah", tv);
dtv->counter_teredo = StatsRegisterCounter("decoder.teredo", tv); dtv->counter_teredo = StatsRegisterCounter("decoder.teredo", tv);
dtv->counter_ipv4inipv4 = StatsRegisterCounter("decoder.ipv4_in_ipv4", tv);
dtv->counter_ipv6inipv4 = StatsRegisterCounter("decoder.ipv6_in_ipv4", tv);
dtv->counter_ipv4inipv6 = StatsRegisterCounter("decoder.ipv4_in_ipv6", tv); dtv->counter_ipv4inipv6 = StatsRegisterCounter("decoder.ipv4_in_ipv6", tv);
dtv->counter_ipv6inipv6 = StatsRegisterCounter("decoder.ipv6_in_ipv6", tv); dtv->counter_ipv6inipv6 = StatsRegisterCounter("decoder.ipv6_in_ipv6", tv);
dtv->counter_mpls = StatsRegisterCounter("decoder.mpls", tv); dtv->counter_mpls = StatsRegisterCounter("decoder.mpls", tv);

@ -1007,6 +1007,8 @@ typedef struct DecodeThreadVars_
uint16_t counter_pppoe; uint16_t counter_pppoe;
uint16_t counter_teredo; uint16_t counter_teredo;
uint16_t counter_mpls; uint16_t counter_mpls;
uint16_t counter_ipv4inipv4;
uint16_t counter_ipv6inipv4;
uint16_t counter_ipv4inipv6; uint16_t counter_ipv4inipv6;
uint16_t counter_ipv6inipv6; uint16_t counter_ipv6inipv6;
uint16_t counter_erspan; uint16_t counter_erspan;

Loading…
Cancel
Save