aboutsummaryrefslogtreecommitdiffstats
path: root/epan
diff options
context:
space:
mode:
authorDario Lombardo <lomato@gmail.com>2015-03-03 11:03:31 +0100
committerAlexis La Goutte <alexis.lagoutte@gmail.com>2015-03-03 10:06:39 +0000
commita0ce286d8d3aaa5a63f69bb03d15d2d225941169 (patch)
tree7b9344bf1f77ea493f04e2d200aa0335ab561d90 /epan
parentb7ef891af868b6026391d3473c0b43e7229e5b31 (diff)
sflow: added agent type
Change-Id: I01bb3dba0c27544539fdca75d655255ff25b12a3 Reviewed-on: https://code.wireshark.org/review/7504 Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Diffstat (limited to 'epan')
-rw-r--r--epan/dissectors/packet-sflow.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/epan/dissectors/packet-sflow.c b/epan/dissectors/packet-sflow.c
index 2f1a725726..ae2342f827 100644
--- a/epan/dissectors/packet-sflow.c
+++ b/epan/dissectors/packet-sflow.c
@@ -85,6 +85,12 @@ static gboolean global_analyze_samp_ip_headers = FALSE;
#define EXPANDED_FLOWSAMPLE 3
#define EXPANDED_COUNTERSSAMPLE 4
+static const value_string sflow_agent_address_types[] = {
+ { ADDR_TYPE_IPV4, "IPv4" },
+ { ADDR_TYPE_IPV6, "IPv6" },
+ { 0, NULL }
+};
+
static const value_string sflow_245_sampletype[] = {
{ FLOWSAMPLE, "Flow sample"},
{ COUNTERSSAMPLE, "Counters sample"},
@@ -325,7 +331,7 @@ struct sflow_address_type {
/* Initialize the protocol and registered fields */
static int proto_sflow = -1;
static int hf_sflow_version = -1;
-/*static int hf_sflow_245_agent_address_type = -1; */
+static int hf_sflow_agent_address_type = -1;
static int hf_sflow_agent_address_v4 = -1;
static int hf_sflow_agent_address_v6 = -1;
static int hf_sflow_5_sub_agent_id = -1;
@@ -2298,6 +2304,7 @@ dissect_sflow_245(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *dat
proto_tree_add_item(sflow_245_tree, hf_sflow_version, tvb, offset, 4, ENC_BIG_ENDIAN);
offset += 4;
+ proto_tree_add_item(sflow_245_tree, hf_sflow_agent_address_type, tvb, offset, 4, ENC_BIG_ENDIAN);
offset = dissect_sflow_245_address_type(tvb, pinfo, sflow_245_tree, offset,
&addr_type, &addr_details);
switch (sflow_addr_type) {
@@ -2354,6 +2361,10 @@ proto_register_sflow(void) {
{ "Datagram version", "sflow_245.version",
FT_UINT32, BASE_DEC, NULL, 0x0,
"sFlow datagram version", HFILL}},
+ { &hf_sflow_agent_address_type,
+ { "Agent address type", "sflow_245.agenttype",
+ FT_UINT32, BASE_DEC, VALS(sflow_agent_address_types), 0x0,
+ "sFlow agent address type", HFILL}},
{ &hf_sflow_agent_address_v4,
{ "Agent address", "sflow_245.agent",
FT_IPv4, BASE_NONE, NULL, 0x0,