diff options
author | etxrab <etxrab@f5534014-38df-0310-8fa8-9805f1628bb7> | 2011-04-16 12:03:50 +0000 |
---|---|---|
committer | etxrab <etxrab@f5534014-38df-0310-8fa8-9805f1628bb7> | 2011-04-16 12:03:50 +0000 |
commit | 69e381fe2c25b93d2c0227a5801d85b605a8ae73 (patch) | |
tree | 4a8d4c88c0edc87b669c442fd7b1b52ed62ef9b1 /epan/dissectors/packet-netflow.c | |
parent | de794e86770ed1f70685fc999d61fca233cfa843 (diff) |
From Motonori Shindo:
Current NetFlow V9/IPFIX dissector treats IN_BYTES (IE=1) and
IN_PERMANENT_BYTES (IE=85) exactly in the same way. The same applies to IN_PKTS
(IE=2) and IN_PERMANENT_PKTS (IE=86). However, IN_BYTES/IN_PKTS and
IN_PERMANENT_BYTES/IN_PERMANENT_PKTS have different semantics so they should be
distinguishable when they are displayed or specified in a filter. Please find
attached the patch
which does that.
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5807
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@36661 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'epan/dissectors/packet-netflow.c')
-rw-r--r-- | epan/dissectors/packet-netflow.c | 54 |
1 files changed, 52 insertions, 2 deletions
diff --git a/epan/dissectors/packet-netflow.c b/epan/dissectors/packet-netflow.c index 618e7b588d..4d0c8b3017 100644 --- a/epan/dissectors/packet-netflow.c +++ b/epan/dissectors/packet-netflow.c @@ -1082,6 +1082,10 @@ static int hf_cflow_post_vlanid = -1; static int hf_cflow_ipv6_exthdr = -1; static int hf_cflow_dstmac = -1; static int hf_cflow_post_srcmac = -1; +static int hf_cflow_permanent_packets = -1; +static int hf_cflow_permanent_packets64 = -1; +static int hf_cflow_permanent_octets = -1; +static int hf_cflow_permanent_octets64 = -1; static int hf_cflow_fragment_offset = -1; static int hf_cflow_mpls_vpn_rd = -1; static int hf_cflow_mpls_top_label_prefix_length = -1; /* ID: 91 */ @@ -2400,7 +2404,6 @@ dissect_v9_v10_pdu_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *pdutree, ti = NULL; switch (pen_type) { - case 85: /* BYTES_PERMANENT */ case 1: /* bytes */ if (length == 4) { ti = proto_tree_add_item(pdutree, hf_cflow_octets, @@ -2415,7 +2418,6 @@ dissect_v9_v10_pdu_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *pdutree, } break; - case 86: /* PACKETS_PERMANENT */ case 2: /* packets */ if (length == 4) { ti = proto_tree_add_item(pdutree, hf_cflow_packets, @@ -3035,6 +3037,34 @@ dissect_v9_v10_pdu_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *pdutree, tvb, offset, length, ENC_NA); break; + case 85: /* BYTES_PERMANENT */ + if (length == 4) { + ti = proto_tree_add_item(pdutree, hf_cflow_permanent_octets, + tvb, offset, length, ENC_BIG_ENDIAN); + } else if (length == 8) { + ti = proto_tree_add_item(pdutree, hf_cflow_permanent_octets64, + tvb, offset, length, ENC_BIG_ENDIAN); + } else { + ti = proto_tree_add_text(pdutree, + tvb, offset, length, + "Running Octets: length %u", length); + } + break; + + case 86: /* PACKETS_PERMANENT */ + if (length == 4) { + ti = proto_tree_add_item(pdutree, hf_cflow_permanent_packets, + tvb, offset, length, ENC_BIG_ENDIAN); + } else if (length == 8) { + ti = proto_tree_add_item(pdutree, hf_cflow_permanent_packets64, + tvb, offset, length, ENC_BIG_ENDIAN); + } else { + ti = proto_tree_add_text(pdutree, + tvb, offset, length, + "Running Packets: length %u", length); + } + break; + case 88: /* fragmentOffset */ ti = proto_tree_add_item(pdutree, hf_cflow_fragment_offset, tvb, offset, length, ENC_BIG_ENDIAN); @@ -6001,6 +6031,26 @@ proto_register_netflow(void) FT_ETHER, BASE_NONE, NULL, 0x0, NULL, HFILL} }, + {&hf_cflow_permanent_packets, + {"Permanent Packets", "cflow.permanent_packets", + FT_UINT32, BASE_DEC, NULL, 0x0, + "Running Count of packets for permanent flows", HFILL} + }, + {&hf_cflow_permanent_packets64, + {"Permanent Packets", "cflow.permanent_packets64", + FT_UINT64, BASE_DEC, NULL, 0x0, + "Running Count of packets for permanent flows", HFILL} + }, + {&hf_cflow_permanent_octets, + {"Permanent Octets", "cflow.permanent_octets", + FT_UINT32, BASE_DEC, NULL, 0x0, + "Running Count of bytes for permanent flows", HFILL} + }, + {&hf_cflow_permanent_octets64, + {"Permanent Octets", "cflow.permanent_octets64", + FT_UINT64, BASE_DEC, NULL, 0x0, + "Running Count of bytes for permanent flows", HFILL} + }, {&hf_cflow_fragment_offset, {"Fragment Offset", "cflow.fragment_offset", FT_UINT16, BASE_DEC, NULL, 0x0, |