From 54620462a0ed10a8fc6531c2b0d9e97b48d932d9 Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Tue, 1 Jun 2004 18:39:13 +0000 Subject: [PATCH] As Motonori Shindo nodes, the sampling rate and mode in a Netflow V5 header is 2 bits of sampling mode and 14 bits of sample rate, not 16 bits of sample rate. svn path=/trunk/; revision=11054 --- packet-netflow.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/packet-netflow.c b/packet-netflow.c index a802dbeb9b..5182d9342f 100644 --- a/packet-netflow.c +++ b/packet-netflow.c @@ -45,7 +45,7 @@ ** http://www.cisco.com/univercd/cc/td/doc/cisintwk/intsolns/netflsol/nfwhite.htm ** ** $Yahoo: //depot/fumerola/packet-netflow/packet-netflow.c#14 $ - ** $Id: packet-netflow.c,v 1.11 2004/03/09 20:08:26 guy Exp $ + ** $Id: packet-netflow.c,v 1.12 2004/06/01 18:39:13 guy Exp $ */ #ifdef HAVE_CONFIG_H @@ -161,6 +161,7 @@ static int hf_cflow_sysuptime = -1; static int hf_cflow_unix_secs = -1; static int hf_cflow_unix_nsecs = -1; static int hf_cflow_timestamp = -1; +static int hf_cflow_samplingmode = -1; static int hf_cflow_samplerate = -1; /* @@ -455,6 +456,8 @@ dissect_netflow(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree) offset = flow_process_textfield(netflow_tree, tvb, offset, 4, "reserved"); else if (ver == 5) { + proto_tree_add_item(netflow_tree, hf_cflow_samplingmode, + tvb, offset, 2, FALSE); proto_tree_add_item(netflow_tree, hf_cflow_samplerate, tvb, offset, 2, FALSE); offset += 2; @@ -1422,9 +1425,14 @@ proto_register_netflow(void) FT_UINT32, BASE_DEC, NULL, 0x0, "Residual nanoseconds since epoch", HFILL} }, + {&hf_cflow_samplingmode, + {"SamplingMode", "cflow.samplingmode", + FT_UINT16, BASE_DEC, NULL, 0xC000, + "Sampling Mode of exporter", HFILL} + }, {&hf_cflow_samplerate, {"SampleRate", "cflow.samplerate", - FT_UINT16, BASE_DEC, NULL, 0x0, + FT_UINT16, BASE_DEC, NULL, 0x3FFF, "Sample Frequency of exporter", HFILL} },