diff options
author | Alexis La Goutte <alexis.lagoutte@gmail.com> | 2017-03-20 19:08:02 +0100 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2017-03-23 11:54:51 +0000 |
commit | 8826910ba42e99eca7dd52b54cb0664d692c26b5 (patch) | |
tree | 768efcbd0dd18752aa528fe281d9912f0deca2bd /epan/dissectors/packet-netflow.c | |
parent | 81ad4cd3bdc1b729de2b43ccf9d5435bac17f3d5 (diff) |
netflow: fix dissection of Application ID
Bug: 13497
Change-Id: Ifa1679c95893268a70f201626d4c534d9bb54bcd
Reviewed-on: https://code.wireshark.org/review/20648
Reviewed-by: Nick Brown <nickbroon@gmail.com>
Reviewed-by: Michael Mann <mmann78@netscape.net>
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'epan/dissectors/packet-netflow.c')
-rw-r--r-- | epan/dissectors/packet-netflow.c | 33 |
1 files changed, 15 insertions, 18 deletions
diff --git a/epan/dissectors/packet-netflow.c b/epan/dissectors/packet-netflow.c index d868c82dec..429b7ae1f9 100644 --- a/epan/dissectors/packet-netflow.c +++ b/epan/dissectors/packet-netflow.c @@ -1493,7 +1493,8 @@ static int hf_cflow_forwarding_status_forward_code = -1; static int hf_cflow_forwarding_status_consume_code = -1; static int hf_cflow_forwarding_status_drop_code = -1; static int hf_cflow_nbar_appl_desc = -1; -static int hf_cflow_nbar_appl_id = -1; +static int hf_cflow_nbar_appl_id_class_eng_id = -1; +static int hf_cflow_nbar_appl_id_selector_id = -1; static int hf_cflow_nbar_appl_name = -1; static int hf_cflow_peer_srcas = -1; static int hf_cflow_peer_dstas = -1; @@ -2238,17 +2239,6 @@ proto_tree_add_mpls_label(proto_tree *pdutree, tvbuff_t *tvb, int offset, int le } -static void -nbar_fmt_id(gchar *result, guint32 nbar_id) -{ - guint32 nbar_id_type = (nbar_id>>24)&0xFF; - nbar_id &= 0xFFFFFF; - - g_snprintf(result, ITEM_LABEL_LENGTH, - "NBAR Application ID: %d:%d (type:id)", nbar_id_type, nbar_id); -} - - typedef struct _hdrinfo_t { guint8 vspec; guint32 src_id; /* SourceID in NetFlow V9, Observation Domain ID in IPFIX */ @@ -4071,8 +4061,10 @@ dissect_v9_v10_pdu_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *pdutree, break; case 95: /* NBAR applicationId */ - ti = proto_tree_add_item(pdutree, hf_cflow_nbar_appl_id, - tvb, offset, length, ENC_BIG_ENDIAN); + ti = proto_tree_add_item(pdutree, hf_cflow_nbar_appl_id_class_eng_id, + tvb, offset, 1, ENC_BIG_ENDIAN); + proto_tree_add_item(pdutree, hf_cflow_nbar_appl_id_selector_id, + tvb, offset+1, length -1, ENC_NA); break; case 96: /* NBAR applicationName */ @@ -8281,10 +8273,15 @@ proto_register_netflow(void) FT_STRING, STR_UNICODE, NULL, 0x0, "Application Desc (NBAR)", HFILL} }, - {&hf_cflow_nbar_appl_id, - {"ApplicationID", "cflow.appl_id", - FT_UINT32, BASE_CUSTOM, CF_FUNC(nbar_fmt_id), 0x0, - "Application ID (NBAR)", HFILL} + {&hf_cflow_nbar_appl_id_class_eng_id, + {"Classification Engine ID", "cflow.appl_id.classification_engine_id", + FT_UINT8, BASE_DEC, NULL, 0x0, + "Application ID", HFILL} + }, + {&hf_cflow_nbar_appl_id_selector_id, + {"Selector ID", "cflow.appl_id.selector_id", + FT_BYTES, BASE_NONE, NULL, 0x0, + "Application ID", HFILL} }, {&hf_cflow_nbar_appl_name, {"ApplicationName", "cflow.appl_name", |