2 * Routines for sFlow v5 dissection implemented according to the specifications
3 * at http://www.sflow.org/sflow_version_5.txt
5 * Additional 802.11 structures support implemented according to the
6 * specifications at http://www.sflow.org/sflow_80211.txt
8 * By Yi Yu <yiyu.inbox@gmail.com>
11 * 802.11 aggregation data dissection (sFlow v5)
14 * Based on Jeff Rizzo's <riz@boogers.sf.ca.us> dissector for sFlow v2/4
15 * in Wireshark 1.0.8 public release.
17 * Wireshark - Network traffic analyzer
18 * By Gerald Combs <gerald@wireshark.org>
19 * Copyright 1998 Gerald Combs
21 * This program is free software; you can redistribute it and/or
22 * modify it under the terms of the GNU General Public License
23 * as published by the Free Software Foundation; either version 2
24 * of the License, or (at your option) any later version.
26 * This program is distributed in the hope that it will be useful,
27 * but WITHOUT ANY WARRANTY; without even the implied warranty of
28 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
29 * GNU General Public License for more details.
31 * You should have received a copy of the GNU General Public License
32 * along with this program; if not, write to the Free Software
33 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
36 * This file (mostly) implements a dissector for sFlow (RFC3176),
37 * from the version 4 spec at http://www.sflow.org/SFLOW-DATAGRAM.txt .
40 * Fix the highlighting of the datastream when bits are selected
41 * split things out into packet-sflow.h ?
42 * make routines more consistent as to whether they return
43 * 'offset' or bytes consumed ('len') (sFlow v2/4)
44 * implement sampled_ipv4 and sampled_ipv6 packet data types (sFlow v2/4)
45 * implement extended_user (sFlow v2/4)
46 * implement extended_url (sFlow v2/4)
47 * implement non-generic counters sampling (sFlow v2/4)
52 #include <epan/packet.h>
53 #include <epan/exceptions.h>
54 #include <epan/prefs.h>
55 #include <epan/expert.h>
56 #include <epan/to_str.h>
57 #include <epan/ipproto.h>
58 #include "packet-sflow.h"
60 #define SFLOW_UDP_PORTS "6343"
62 void proto_register_sflow(void);
64 static dissector_handle_t sflow_handle;
67 * sflow_245_ports : holds the currently used range of ports for sflow
69 static gboolean global_dissect_samp_headers = TRUE;
70 static gboolean global_analyze_samp_ip_headers = FALSE;
72 #define ENTERPRISE_DEFAULT 0
74 #define ADDR_TYPE_UNKNOWN 0
75 #define ADDR_TYPE_IPV4 1
76 #define ADDR_TYPE_IPV6 2
79 #define COUNTERSSAMPLE 2
80 #define EXPANDED_FLOWSAMPLE 3
81 #define EXPANDED_COUNTERSSAMPLE 4
82 #define LAG_PORT_STATS 7
84 static const value_string sflow_agent_address_types[] = {
85 { ADDR_TYPE_IPV4, "IPv4" },
86 { ADDR_TYPE_IPV6, "IPv6" },
90 static const value_string sflow_245_sampletype[] = {
91 { FLOWSAMPLE, "Flow sample"},
92 { COUNTERSSAMPLE, "Counters sample"},
93 { EXPANDED_FLOWSAMPLE, "Expanded flow sample"},
94 { EXPANDED_COUNTERSSAMPLE, "Expanded counters sample"},
95 { LAG_PORT_STATS, "Lag Port stats"},
99 #define SFLOW_5_IEEE80211_VERSION_A 1
100 #define SFLOW_5_IEEE80211_VERSION_B 2
101 #define SFLOW_5_IEEE80211_VERSION_G 3
102 #define SFLOW_5_IEEE80211_VERSION_N 4
104 static const value_string sflow_5_ieee80211_versions [] = {
105 { SFLOW_5_IEEE80211_VERSION_A, "802.11a"},
106 { SFLOW_5_IEEE80211_VERSION_B, "802.11b"},
107 { SFLOW_5_IEEE80211_VERSION_G, "802.11g"},
108 { SFLOW_5_IEEE80211_VERSION_N, "802.11n"},
112 /* interface counter types */
113 #define SFLOW_245_COUNTERS_GENERIC 1
114 #define SFLOW_245_COUNTERS_ETHERNET 2
115 #define SFLOW_245_COUNTERS_TOKENRING 3
116 #define SFLOW_245_COUNTERS_FDDI 4
117 #define SFLOW_245_COUNTERS_VG 5
118 #define SFLOW_245_COUNTERS_WAN 6
119 #define SFLOW_245_COUNTERS_VLAN 7
121 static const value_string sflow_245_counterstype[] = {
122 { SFLOW_245_COUNTERS_GENERIC, "Generic counters"},
123 { SFLOW_245_COUNTERS_ETHERNET, "Ethernet counters"},
124 { SFLOW_245_COUNTERS_FDDI, "FDDI counters"},
125 { SFLOW_245_COUNTERS_VG, "100baseVG counters"},
126 { SFLOW_245_COUNTERS_WAN, "WAN counters"},
127 { SFLOW_245_COUNTERS_VLAN, "VLAN counters"},
131 #define MAX_HEADER_SIZE 256
133 #define SFLOW_245_PACKET_DATA_TYPE_HEADER 1
134 #define SFLOW_245_PACKET_DATA_TYPE_IPV4 2
135 #define SFLOW_245_PACKET_DATA_TYPE_IPV6 3
137 static const value_string sflow_245_packet_information_type[] = {
138 { SFLOW_245_PACKET_DATA_TYPE_HEADER, "Packet headers are sampled"},
139 { SFLOW_245_PACKET_DATA_TYPE_IPV4, "IP Version 4 data"},
140 { SFLOW_245_PACKET_DATA_TYPE_IPV6, "IP Version 6 data"},
144 static const value_string extended_80211_suite_type_vals[] = {
145 { 0, "Use group cipher suite"},
153 static const value_string sflow_ifdirection_vals[] = {
161 const true_false_string tfs_low_normal = { "Low", "Normal" };
162 const true_false_string tfs_high_normal = { "High", "Normal" };
163 const true_false_string tfs_minimize_monetary_normal = { "Minimize Monetary", "Normal" };
164 const true_false_string tfs_up_down = { "Up", "Down" };
166 static const value_string sflow_245_header_protocol[] = {
167 { SFLOW_245_HEADER_ETHERNET, "Ethernet"},
168 { SFLOW_245_HEADER_TOKENBUS, "Token Bus"},
169 { SFLOW_245_HEADER_TOKENRING, "Token Ring"},
170 { SFLOW_245_HEADER_FDDI, "FDDI"},
171 { SFLOW_245_HEADER_FRAME_RELAY, "Frame Relay"},
172 { SFLOW_245_HEADER_X25, "X.25"},
173 { SFLOW_245_HEADER_PPP, "PPP"},
174 { SFLOW_245_HEADER_SMDS, "SMDS"},
175 { SFLOW_245_HEADER_AAL5, "ATM AAL5"},
176 { SFLOW_245_HEADER_AAL5_IP, "ATM AAL5-IP (e.g., Cisco AAL5 mux)"},
177 { SFLOW_245_HEADER_IPv4, "IPv4"},
178 { SFLOW_245_HEADER_IPv6, "IPv6"},
179 { SFLOW_245_HEADER_MPLS, "MPLS"},
180 { SFLOW_5_HEADER_POS, "PPP over SONET/SDH (RFC 1662, 2615)"},
181 { SFLOW_5_HEADER_80211_MAC, "802.11 MAC"},
182 { SFLOW_5_HEADER_80211_AMPDU, "802.11n Aggregated MPDU"},
183 { SFLOW_5_HEADER_80211_AMSDU_SUBFRAME, "A-MSDU Subframe"},
186 static value_string_ext sflow_245_header_protocol_ext = VALUE_STRING_EXT_INIT(sflow_245_header_protocol);
188 /* extended packet data types */
189 #define SFLOW_245_EXTENDED_SWITCH 1
190 #define SFLOW_245_EXTENDED_ROUTER 2
191 #define SFLOW_245_EXTENDED_GATEWAY 3
192 #define SFLOW_245_EXTENDED_USER 4
193 #define SFLOW_245_EXTENDED_URL 5
195 static const value_string sflow_245_extended_data_types[] = {
196 { SFLOW_245_EXTENDED_SWITCH, "Extended switch information"},
197 { SFLOW_245_EXTENDED_ROUTER, "Extended router information"},
198 { SFLOW_245_EXTENDED_GATEWAY, "Extended gateway information"},
199 { SFLOW_245_EXTENDED_USER, "Extended user information"},
200 { SFLOW_245_EXTENDED_URL, "Extended URL information"},
205 #define SFLOW_245_AS_SET 1
206 #define SFLOW_245_AS_SEQUENCE 2
208 static const value_string sflow_245_as_types[] = {
209 { SFLOW_245_AS_SET, "AS Set"},
210 { SFLOW_245_AS_SEQUENCE, "AS Sequence"},
214 #define SFLOW_245_IPV4_PRECEDENCE_ROUTINE 0
215 #define SFLOW_245_IPV4_PRECEDENCE_PRIORITY 1
216 #define SFLOW_245_IPV4_PRECEDENCE_IMMEDIATE 2
217 #define SFLOW_245_IPV4_PRECEDENCE_FLASH 3
218 #define SFLOW_245_IPV4_PRECEDENCE_FLASH_OVERRIDE 4
219 #define SFLOW_245_IPV4_PRECEDENCE_CRITIC_ECP 5
220 #define SFLOW_245_IPV4_PRECEDENCE_INTERNETWORK_CONTROL 6
221 #define SFLOW_245_IPV4_PRECEDENCE_NETWORK_CONTROL 7
223 static const value_string sflow_245_ipv4_precedence_types[] = {
224 { SFLOW_245_IPV4_PRECEDENCE_ROUTINE, "Routine"},
225 { SFLOW_245_IPV4_PRECEDENCE_PRIORITY, "Priority"},
226 { SFLOW_245_IPV4_PRECEDENCE_IMMEDIATE, "Immediate"},
227 { SFLOW_245_IPV4_PRECEDENCE_FLASH, "Flash"},
228 { SFLOW_245_IPV4_PRECEDENCE_FLASH_OVERRIDE, "Flash Override"},
229 { SFLOW_245_IPV4_PRECEDENCE_CRITIC_ECP, "CRITIC/ECP"},
230 { SFLOW_245_IPV4_PRECEDENCE_INTERNETWORK_CONTROL, "Internetwork Control"},
231 { SFLOW_245_IPV4_PRECEDENCE_NETWORK_CONTROL, "Network Control"},
235 /* sFlow v5 flow record formats */
236 #define SFLOW_5_RAW_PACKET_HEADER 1
237 #define SFLOW_5_ETHERNET_FRAME 2
238 #define SFLOW_5_IPV4 3
239 #define SFLOW_5_IPV6 4
240 #define SFLOW_5_SWITCH 1001
241 #define SFLOW_5_ROUTER 1002
242 #define SFLOW_5_GATEWAY 1003
243 #define SFLOW_5_USER 1004
244 #define SFLOW_5_URL 1005
245 #define SFLOW_5_MPLS_DATA 1006
246 #define SFLOW_5_NAT 1007
247 #define SFLOW_5_MPLS_TUNNEL 1008
248 #define SFLOW_5_MPLS_VC 1009
249 #define SFLOW_5_MPLS_FEC 1010
250 #define SFLOW_5_MPLS_LVP_FEC 1011
251 #define SFLOW_5_VLAN_TUNNEL 1012
252 #define SFLOW_5_80211_PAYLOAD 1013
253 #define SFLOW_5_80211_RX 1014
254 #define SFLOW_5_80211_TX 1015
255 #define SFLOW_5_80211_AGGREGATION 1016
258 static const value_string sflow_5_flow_record_type[] = {
259 { SFLOW_5_RAW_PACKET_HEADER, "Raw packet header"},
260 { SFLOW_5_ETHERNET_FRAME, "Ethernet frame data"},
261 { SFLOW_5_IPV4, "IPv4 data"},
262 { SFLOW_5_IPV6, "IPv6 data"},
263 { SFLOW_5_SWITCH, "Extended switch data"},
264 { SFLOW_5_ROUTER, "Extended router data"},
265 { SFLOW_5_GATEWAY, "Extended gateway data"},
266 { SFLOW_5_USER, "Extended user data"},
267 { SFLOW_5_URL, "Extended URL data"},
268 { SFLOW_5_MPLS_DATA, "Extended MPLS data"},
269 { SFLOW_5_NAT, "Extended NAT data"},
270 { SFLOW_5_MPLS_TUNNEL, "Extended MPLS tunnel data"},
271 { SFLOW_5_MPLS_VC, "Extended MPLS VC data"},
272 { SFLOW_5_MPLS_FEC, "Extended MPLS FEC data"},
273 { SFLOW_5_MPLS_LVP_FEC, "Extended MPLS LVP FEC data"},
274 { SFLOW_5_VLAN_TUNNEL, "Extended VLAN tunnel"},
275 { SFLOW_5_80211_PAYLOAD, "Extended 802.11 payload"},
276 { SFLOW_5_80211_RX, "Extended 802.11 RX"},
277 { SFLOW_5_80211_TX, "Extended 802.11 TX"},
278 { SFLOW_5_80211_AGGREGATION, "Extended 802.11 aggregation"},
281 static value_string_ext sflow_5_flow_record_type_ext = VALUE_STRING_EXT_INIT(sflow_5_flow_record_type);
283 /* sFlow v5 counters record formats */
284 #define SFLOW_5_GENERIC_INTERFACE 1
285 #define SFLOW_5_ETHERNET_INTERFACE 2
286 #define SFLOW_5_TOKEN_RING 3
287 #define SFLOW_5_100BASE_VG_INTERFACE 4
288 #define SFLOW_5_VLAN 5
289 #define SFLOW_5_80211_COUNTERS 6
290 #define SFLOW_5_PROCESSOR 1001
291 #define SFLOW_5_RADIO_UTILIZATION 1002
293 static const value_string sflow_5_counters_record_type[] = {
294 { SFLOW_5_GENERIC_INTERFACE, "Generic interface counters"},
295 { SFLOW_5_ETHERNET_INTERFACE, "Ethernet interface counters"},
296 { SFLOW_5_TOKEN_RING, "Token ring counters"},
297 { SFLOW_5_100BASE_VG_INTERFACE, "100 Base VG interface counters"},
298 { SFLOW_5_VLAN, "VLAN counters"},
299 { SFLOW_5_80211_COUNTERS, "IEEE 802.11 counters"},
300 { SFLOW_5_PROCESSOR, "Processor information"},
301 { SFLOW_5_RADIO_UTILIZATION, "Radio utilization"},
305 /* ethernet counters. These will be preceded by generic counters. */
306 struct ethernet_counters {
307 guint32 dot3StatsAlignmentErrors;
308 guint32 dot3StatsFCSErrors;
309 guint32 dot3StatsSingleCollisionFrames;
310 guint32 dot3StatsMultipleCollisionFrames;
311 guint32 dot3StatsSQETestErrors;
312 guint32 dot3StatsDeferredTransmissions;
313 guint32 dot3StatsLateCollisions;
314 guint32 dot3StatsExcessiveCollisions;
315 guint32 dot3StatsInternalMacTransmitErrors;
316 guint32 dot3StatsCarrierSenseErrors;
317 guint32 dot3StatsFrameTooLongs;
318 guint32 dot3StatsInternalMacReceiveErrors;
319 guint32 dot3StatsSymbolErrors;
322 struct sflow_address_type {
328 /* Initialize the protocol and registered fields */
329 static int proto_sflow = -1;
330 static int hf_sflow_version = -1;
331 static int hf_sflow_agent_address_type = -1;
332 static int hf_sflow_agent_address_v4 = -1;
333 static int hf_sflow_agent_address_v6 = -1;
334 static int hf_sflow_5_sub_agent_id = -1;
335 static int hf_sflow_5_sample_length = -1;
336 static int hf_sflow_5_flow_data_length = -1;
337 /* static int hf_sflow_5_counters_data_length = -1; */
338 static int hf_sflow_245_seqnum = -1;
339 static int hf_sflow_245_sysuptime = -1;
340 static int hf_sflow_245_numsamples = -1;
341 static int hf_sflow_245_header_protocol = -1;
342 static int hf_sflow_245_sampletype = -1;
343 static int hf_sflow_245_sampletype12 = -1;
344 static int hf_sflow_245_ipv4_precedence_type = -1;
345 static int hf_sflow_5_flow_record_format = -1;
346 static int hf_sflow_5_counters_record_format = -1;
347 static int hf_sflow_245_header = -1;
348 static int hf_sflow_245_packet_information_type = -1;
349 static int hf_sflow_245_extended_information_type = -1;
350 static int hf_sflow_245_vlan_in = -1; /* incoming 802.1Q VLAN ID */
351 static int hf_sflow_245_vlan_out = -1; /* outgoing 802.1Q VLAN ID */
352 static int hf_sflow_245_pri_in = -1; /* incominging 802.1p priority */
353 static int hf_sflow_245_pri_out = -1; /* outgoing 802.1p priority */
354 static int hf_sflow_245_nexthop_v4 = -1; /* nexthop address */
355 static int hf_sflow_245_nexthop_v6 = -1; /* nexthop address */
356 static int hf_sflow_245_ipv4_src = -1;
357 static int hf_sflow_245_ipv4_dst = -1;
358 static int hf_sflow_245_ipv6_src = -1;
359 static int hf_sflow_245_ipv6_dst = -1;
360 static int hf_sflow_245_nexthop_src_mask = -1;
361 static int hf_sflow_245_nexthop_dst_mask = -1;
364 /* extended gateway (all versions) */
365 static int hf_sflow_245_as = -1;
366 static int hf_sflow_245_src_as = -1;
367 static int hf_sflow_245_src_peer_as = -1;
368 static int hf_sflow_245_dst_as_entries = -1; /* aka length */
369 static int hf_sflow_245_dst_as = -1;
370 /* extended gateway (>= version 4) */
371 static int hf_sflow_245_community_entries = -1;
372 /* static int hf_sflow_245_community = -1; */
373 static int hf_sflow_245_localpref = -1;
375 /* generic interface counter */
376 static int hf_sflow_245_ifindex = -1;
377 static int hf_sflow_245_iftype = -1;
378 static int hf_sflow_245_ifspeed = -1;
379 static int hf_sflow_245_ifdirection = -1;
380 static int hf_sflow_245_ifadmin_status = -1;
381 static int hf_sflow_245_ifoper_status = -1;
382 static int hf_sflow_245_ifinoct = -1;
383 static int hf_sflow_245_ifinpkt = -1;
384 static int hf_sflow_245_ifinmcast = -1;
385 static int hf_sflow_245_ifinbcast = -1;
386 static int hf_sflow_245_ifinerr = -1;
387 static int hf_sflow_245_ifindisc = -1;
388 static int hf_sflow_245_ifinunk = -1;
389 static int hf_sflow_245_ifoutoct = -1;
390 static int hf_sflow_245_ifoutpkt = -1;
391 static int hf_sflow_245_ifoutmcast = -1;
392 static int hf_sflow_245_ifoutbcast = -1;
393 static int hf_sflow_245_ifoutdisc = -1;
394 static int hf_sflow_245_ifouterr = -1;
395 static int hf_sflow_245_ifpromisc = -1;
397 /* ethernet interface counter */
398 static int hf_sflow_245_dot3StatsAlignmentErrors = -1;
399 static int hf_sflow_245_dot3StatsFCSErrors = -1;
400 static int hf_sflow_245_dot3StatsSingleCollisionFrames = -1;
401 static int hf_sflow_245_dot3StatsMultipleCollisionFrames = -1;
402 static int hf_sflow_245_dot3StatsSQETestErrors = -1;
403 static int hf_sflow_245_dot3StatsDeferredTransmissions = -1;
404 static int hf_sflow_245_dot3StatsLateCollisions = -1;
405 static int hf_sflow_245_dot3StatsExcessiveCollisions = -1;
406 static int hf_sflow_245_dot3StatsInternalMacTransmitErrors = -1;
407 static int hf_sflow_245_dot3StatsCarrierSenseErrors = -1;
408 static int hf_sflow_245_dot3StatsFrameTooLongs = -1;
409 static int hf_sflow_245_dot3StatsInternalMacReceiveErrors = -1;
410 static int hf_sflow_245_dot3StatsSymbolErrors = -1;
412 /* token ring counter */
413 static int hf_sflow_245_dot5StatsLineErrors = -1;
414 static int hf_sflow_245_dot5StatsBurstErrors = -1;
415 static int hf_sflow_245_dot5StatsACErrors = -1;
416 static int hf_sflow_245_dot5StatsAbortTransErrors = -1;
417 static int hf_sflow_245_dot5StatsInternalErrors = -1;
418 static int hf_sflow_245_dot5StatsLostFrameErrors = -1;
419 static int hf_sflow_245_dot5StatsReceiveCongestions = -1;
420 static int hf_sflow_245_dot5StatsFrameCopiedErrors = -1;
421 static int hf_sflow_245_dot5StatsTokenErrors = -1;
422 static int hf_sflow_245_dot5StatsSoftErrors = -1;
423 static int hf_sflow_245_dot5StatsHardErrors = -1;
424 static int hf_sflow_245_dot5StatsSignalLoss = -1;
425 static int hf_sflow_245_dot5StatsTransmitBeacons = -1;
426 static int hf_sflow_245_dot5StatsRecoveries = -1;
427 static int hf_sflow_245_dot5StatsLobeWires = -1;
428 static int hf_sflow_245_dot5StatsRemoves = -1;
429 static int hf_sflow_245_dot5StatsSingles = -1;
430 static int hf_sflow_245_dot5StatsFreqErrors = -1;
432 /* 100 BaseVG interface counters */
433 static int hf_sflow_245_dot12InHighPriorityFrames = -1;
434 static int hf_sflow_245_dot12InHighPriorityOctets = -1;
435 static int hf_sflow_245_dot12InNormPriorityFrames = -1;
436 static int hf_sflow_245_dot12InNormPriorityOctets = -1;
437 static int hf_sflow_245_dot12InIPMErrors = -1;
438 static int hf_sflow_245_dot12InOversizeFrameErrors = -1;
439 static int hf_sflow_245_dot12InDataErrors = -1;
440 static int hf_sflow_245_dot12InNullAddressedFrames = -1;
441 static int hf_sflow_245_dot12OutHighPriorityFrames = -1;
442 static int hf_sflow_245_dot12OutHighPriorityOctets = -1;
443 static int hf_sflow_245_dot12TransitionIntoTrainings = -1;
444 static int hf_sflow_245_dot12HCInHighPriorityOctets = -1;
445 static int hf_sflow_245_dot12HCInNormPriorityOctets = -1;
446 static int hf_sflow_245_dot12HCOutHighPriorityOctets = -1;
449 static int hf_sflow_245_vlan_id = -1;
450 static int hf_sflow_245_octets = -1;
451 static int hf_sflow_245_ucastPkts = -1;
452 static int hf_sflow_245_multicastPkts = -1;
453 static int hf_sflow_245_broadcastPkts = -1;
454 static int hf_sflow_245_discards = -1;
456 /* 802.11 interface counters */
457 static int hf_sflow_5_dot11TransmittedFragmentCount = -1;
458 static int hf_sflow_5_dot11MulticastTransmittedFrameCount = -1;
459 static int hf_sflow_5_dot11FailedCount = -1;
460 static int hf_sflow_5_dot11RetryCount = -1;
461 static int hf_sflow_5_dot11MultipleRetryCount = -1;
462 static int hf_sflow_5_dot11FrameDuplicateCount = -1;
463 static int hf_sflow_5_dot11RTSSuccessCount = -1;
464 static int hf_sflow_5_dot11RTSFailureCount = -1;
465 static int hf_sflow_5_dot11ACKFailureCount = -1;
466 static int hf_sflow_5_dot11ReceivedFragmentCount = -1;
467 static int hf_sflow_5_dot11MulticastReceivedFrameCount = -1;
468 static int hf_sflow_5_dot11FCSErrorCount = -1;
469 static int hf_sflow_5_dot11TransmittedFrameCount = -1;
470 static int hf_sflow_5_dot11WEPUndecryptableCount = -1;
471 static int hf_sflow_5_dot11QoSDiscardedFragmentCount = -1;
472 static int hf_sflow_5_dot11AssociatedStationCount = -1;
473 static int hf_sflow_5_dot11QoSCFPollsReceivedCount = -1;
474 static int hf_sflow_5_dot11QoSCFPollsUnusedCount = -1;
475 static int hf_sflow_5_dot11QoSCFPollsUnusableCount = -1;
476 static int hf_sflow_5_dot11QoSCFPollsLostCount = -1;
477 /* static int hf_sflow_5_ieee80211_version = -1; */
480 /* processor information */
481 static int hf_sflow_5_cpu_5s = -1;
482 static int hf_sflow_5_cpu_1m = -1;
483 static int hf_sflow_5_cpu_5m = -1;
484 static int hf_sflow_5_total_memory = -1;
485 static int hf_sflow_5_free_memory = -1;
487 /* radio utilisation */
488 static int hf_sflow_5_elapsed_time = -1;
489 static int hf_sflow_5_on_channel_time = -1;
490 static int hf_sflow_5_on_channel_busy_time = -1;
492 /* Generated from convert_proto_tree_add_text.pl */
493 static int hf_sflow_5_extended_80211_suite_type = -1;
494 static int hf_sflow_5_extended_80211_rx_channel = -1;
495 static int hf_sflow_flow_sample_input_interface = -1;
496 static int hf_sflow_counters_sample_sampling_interval = -1;
497 static int hf_sflow_5_extended_url_host_length = -1;
498 static int hf_sflow_245_ip_tcp_flag_syn = -1;
499 static int hf_sflow_flow_sample_output_interface = -1;
500 static int hf_sflow_245_length_of_ip_packet = -1;
501 static int hf_sflow_counters_sample_counters_type = -1;
502 static int hf_sflow_5_extended_mpls_tunnel_id = -1;
503 static int hf_sflow_flow_sample_sample_pool = -1;
504 static int hf_sflow_5_extended_80211_tx_speed = -1;
505 static int hf_sflow_5_extended_vlan_tunnel_tpid_tci_pair = -1;
506 static int hf_sflow_245_extended_mpls_out_label_stack_entries = -1;
507 static int hf_sflow_flow_sample_input_interface_value = -1;
508 static int hf_sflow_flow_sample_sampling_rate = -1;
509 static int hf_sflow_5_extended_80211_rx_rcpi = -1;
510 static int hf_sflow_enterprise = -1;
511 static int hf_sflow_245_header_frame_length = -1;
512 static int hf_sflow_5_extended_user_destination_character_set = -1;
513 static int hf_sflow_5_extended_80211_rx_bssid = -1;
514 static int hf_sflow_5_extended_80211_tx_retransmission_duration = -1;
515 static int hf_sflow_245_ethernet_length_of_mac_packet = -1;
516 static int hf_sflow_245_ip_tcp_flag_psh = -1;
517 static int hf_sflow_flow_sample_flow_record = -1;
518 static int hf_sflow_245_extended_mpls_in_label = -1;
519 static int hf_sflow_5_extended_user_source_character_set = -1;
520 static int hf_sflow_5_extended_user_destination_user_string_length = -1;
521 static int hf_sflow_counters_sample_sequence_number = -1;
522 static int hf_sflow_5_extended_80211_rx_speed = -1;
523 static int hf_sflow_5_extended_80211_rx_rsni = -1;
524 static int hf_sflow_flow_sample_source_id_index = -1;
525 static int hf_sflow_245_ip_tcp_flag_ece = -1;
526 static int hf_sflow_245_ipv4_throughput = -1;
527 static int hf_sflow_5_extended_80211_oui = -1;
528 static int hf_sflow_counters_sample_source_id_type = -1;
529 static int hf_sflow_flow_sample_input_interface_format = -1;
530 static int hf_sflow_5_extended_80211_tx_channel = -1;
531 static int hf_sflow_245_ip_tcp_flag_urg = -1;
532 static int hf_sflow_5_extended_mpls_tunnel_name_length = -1;
533 static int hf_sflow_5_extended_80211_tx_version = -1;
534 static int hf_sflow_245_ipv4_delay = -1;
535 static int hf_sflow_flow_sample_source_id_class = -1;
536 static int hf_sflow_245_ethernet_source_mac_address = -1;
537 static int hf_sflow_5_extended_mpls_ftn_mask = -1;
538 static int hf_sflow_245_extended_mpls_out_label = -1;
539 static int hf_sflow_245_ipv6_priority = -1;
540 static int hf_sflow_245_ip_tcp_flag_fin = -1;
541 static int hf_sflow_245_ip_destination_port = -1;
542 static int hf_sflow_5_extended_mpls_vc_label_cos_value = -1;
543 static int hf_sflow_5_extended_80211_rx_packet_duration = -1;
544 static int hf_sflow_5_extended_80211_tx_packet_duration = -1;
545 static int hf_sflow_245_ipv4_reliability = -1;
546 static int hf_sflow_5_extended_80211_tx_power = -1;
547 static int hf_sflow_flow_sample_multiple_outputs = -1;
548 static int hf_sflow_5_extended_user_source_user_string_length = -1;
549 static int hf_sflow_5_extended_80211_payload_length = -1;
550 static int hf_sflow_flow_sample_output_interface_format = -1;
551 static int hf_sflow_245_ethernet_packet_type = -1;
552 static int hf_sflow_counters_sample_expanded_source_id_type = -1;
553 static int hf_sflow_245_ip_source_port = -1;
554 static int hf_sflow_245_extended_mpls_in_label_stack_entries = -1;
555 static int hf_sflow_5_extended_mpls_vc_instance_name_length = -1;
556 static int hf_sflow_245_ipv4_cost = -1;
557 static int hf_sflow_5_extended_mpls_ftn_description_length = -1;
558 static int hf_sflow_5_extended_vlan_tunnel_number_of_layers = -1;
559 static int hf_sflow_5_extended_80211_tx_bssid = -1;
560 static int hf_sflow_245_ip_tcp_flag_rst = -1;
561 static int hf_sflow_245_ip_tcp_flag_ack = -1;
562 static int hf_sflow_245_ip_tcp_flag_cwr = -1;
563 static int hf_sflow_5_extended_80211_tx_retransmissions = -1;
564 static int hf_sflow_5_extended_80211_rx_version = -1;
565 static int hf_sflow_flow_sample_dropped_packets = -1;
566 static int hf_sflow_counters_sample_expanded_source_id_index = -1;
567 static int hf_sflow_245_header_payload_removed = -1;
568 static int hf_sflow_245_original_packet_header_length = -1;
569 static int hf_sflow_245_ethernet_destination_mac_address = -1;
570 static int hf_sflow_counters_sample_source_id_class = -1;
571 static int hf_sflow_5_extended_url_url_length = -1;
572 static int hf_sflow_flow_sample_source_id_type = -1;
573 static int hf_sflow_5_extended_mpls_fec_address_prefix_length = -1;
574 static int hf_sflow_flow_sample_sequence_number = -1;
575 static int hf_sflow_counters_sample_source_id_index = -1;
576 static int hf_sflow_counters_sample_counters_records = -1;
577 static int hf_sflow_5_extended_mpls_tunnel_cos_value = -1;
578 static int hf_sflow_5_extended_mpls_vc_id = -1;
579 static int hf_sflow_flow_sample_output_interface_value = -1;
580 static int hf_sflow_5_extended_user_destination_user = -1;
581 static int hf_sflow_245_as_type = -1;
582 static int hf_sflow_counters_sample_index = -1;
583 static int hf_sflow_5_extended_url_url = -1;
584 static int hf_sflow_flow_sample_index = -1;
585 static int hf_sflow_5_extended_80211_rx_ssid = -1;
586 static int hf_sflow_5_extended_mpls_vc_instance_name = -1;
587 static int hf_sflow_5_extended_mpls_tunnel_name = -1;
588 static int hf_sflow_5_extended_80211_payload = -1;
589 static int hf_sflow_5_extended_user_source_user = -1;
590 static int hf_sflow_5_extended_url_host = -1;
591 static int hf_sflow_5_extended_80211_tx_ssid = -1;
592 static int hf_sflow_5_extended_url_direction = -1;
593 static int hf_sflow_5_extended_mpls_ftn_description = -1;
594 static int hf_sflow_245_ip_protocol = -1;
596 static int hf_sflow_lag_port_actorsystemid = -1;
597 static int hf_sflow_lag_port_partneropersystemid = -1;
598 static int hf_sflow_lag_port_attachedaggid = -1;
599 static int hf_sflow_lag_port_state = -1;
600 static int hf_sflow_lag_port_actoradminstate = -1;
601 static int hf_sflow_lag_port_actoroperstate = -1;
602 static int hf_sflow_lag_port_partneradminstate = -1;
603 static int hf_sflow_lag_port_partneroperstate = -1;
604 static int hf_sflow_lag_port_reserved = -1;
605 static int hf_sflow_lag_port_stats_lacpdusrx = -1;
606 static int hf_sflow_lag_port_stats_markerpdusrx = -1;
607 static int hf_sflow_lag_port_stats_markerresponsepdusrx = -1;
608 static int hf_sflow_lag_port_stats_unknownrx = -1;
609 static int hf_sflow_lag_port_stats_illegalrx = -1;
610 static int hf_sflow_lag_port_stats_lacpdustx = -1;
611 static int hf_sflow_lag_port_stats_markerpdustx = -1;
612 static int hf_sflow_lag_port_stats_markerresponsepdustx = -1;
614 /* Initialize the subtree pointers */
615 static gint ett_sflow_245 = -1;
616 static gint ett_sflow_245_sample = -1;
617 static gint ett_sflow_5_flow_record = -1;
618 static gint ett_sflow_5_counters_record = -1;
619 static gint ett_sflow_5_mpls_in_label_stack = -1;
620 static gint ett_sflow_5_mpls_out_label_stack = -1;
621 static gint ett_sflow_245_extended_data = -1;
622 static gint ett_sflow_245_gw_as_dst = -1;
623 static gint ett_sflow_245_gw_as_dst_seg = -1;
624 static gint ett_sflow_245_gw_community = -1;
625 static gint ett_sflow_245_sampled_header = -1;
626 static gint ett_sflow_lag_port_state_flags = -1;
628 static expert_field ei_sflow_invalid_address_type = EI_INIT;
630 static dissector_table_t header_subdissector_table;
632 void proto_reg_handoff_sflow_245(void);
634 /* dissect a sampled header - layer 2 protocols */
636 dissect_sflow_245_sampled_header(tvbuff_t *tvb, packet_info *pinfo,
637 proto_tree *tree, volatile gint offset) {
638 guint32 version, header_proto, frame_length;
639 guint32 header_length;
641 proto_tree *sflow_245_header_tree;
643 /* stuff for saving column state before calling other dissectors.
644 * Thanks to Guy Harris for the tip. */
645 gboolean save_writable;
646 gboolean save_in_error_pkt;
647 address save_dl_src, save_dl_dst, save_net_src, save_net_dst, save_src, save_dst;
649 version = tvb_get_ntohl(tvb, 0);
650 header_proto = tvb_get_ntohl(tvb, offset);
651 proto_tree_add_item(tree, hf_sflow_245_header_protocol, tvb, offset, 4, ENC_BIG_ENDIAN);
653 frame_length = tvb_get_ntohl(tvb, offset);
654 proto_tree_add_item(tree, hf_sflow_245_header_frame_length, tvb, offset, 4, ENC_BIG_ENDIAN);
658 proto_tree_add_item(tree, hf_sflow_245_header_payload_removed, tvb, offset, 4, ENC_BIG_ENDIAN);
662 proto_tree_add_item_ret_uint(tree, hf_sflow_245_original_packet_header_length, tvb, offset, 4, ENC_BIG_ENDIAN, &header_length);
665 if (header_length % 4) /* XDR requires 4-byte alignment */
666 header_length += (4 - (header_length % 4));
669 ti = proto_tree_add_item(tree, hf_sflow_245_header, tvb, offset, header_length, ENC_NA);
670 sflow_245_header_tree = proto_item_add_subtree(ti, ett_sflow_245_sampled_header);
672 /* hand the header off to the appropriate dissector. It's probably
673 * a short frame, so ignore any exceptions. */
674 next_tvb = tvb_new_subset(tvb, offset, header_length, frame_length);
676 /* save some state */
677 save_writable = col_get_writable(pinfo->cinfo, -1);
680 If sFlow samples a TCP packet it is very likely that the
681 TCP analysis will flag the packet as having some error with
682 the sequence numbers. sFlow only report on a "sample" of
683 traffic so many packets will not be reported on. This is
684 most obvious if the colorizing rules are on, but will also
685 cause confusion if you attempt to filter on
686 "tcp.analysis.flags".
688 The following only works to suppress IP/TCP errors, but
689 it is a start anyway. Other protocols carried as payloads
690 may exhibit similar issues.
692 I think what is really needed is a more general
693 "protocol_as_payload" flag. Of course then someone has to
694 play whack-a-mole and add code to implement it to any
695 protocols that could be carried as a payload. In the case
696 of sFlow that pretty much means anything on your network.
698 save_in_error_pkt = pinfo->flags.in_error_pkt;
699 if (!global_analyze_samp_ip_headers) {
700 pinfo->flags.in_error_pkt = TRUE;
703 col_set_writable(pinfo->cinfo, -1, FALSE);
704 copy_address_shallow(&save_dl_src, &pinfo->dl_src);
705 copy_address_shallow(&save_dl_dst, &pinfo->dl_dst);
706 copy_address_shallow(&save_net_src, &pinfo->net_src);
707 copy_address_shallow(&save_net_dst, &pinfo->net_dst);
708 copy_address_shallow(&save_src, &pinfo->src);
709 copy_address_shallow(&save_dst, &pinfo->dst);
713 if ((global_dissect_samp_headers == FALSE) ||
714 !dissector_try_uint(header_subdissector_table, header_proto, next_tvb, pinfo, sflow_245_header_tree))
716 call_data_dissector(next_tvb, pinfo, sflow_245_header_tree);
720 CATCH_BOUNDS_ERRORS {
724 /* restore saved state */
725 col_set_writable(pinfo->cinfo, -1, save_writable);
726 pinfo->flags.in_error_pkt = save_in_error_pkt;
727 copy_address_shallow(&pinfo->dl_src, &save_dl_src);
728 copy_address_shallow(&pinfo->dl_dst, &save_dl_dst);
729 copy_address_shallow(&pinfo->net_src, &save_net_src);
730 copy_address_shallow(&pinfo->net_dst, &save_net_dst);
731 copy_address_shallow(&pinfo->src, &save_src);
732 copy_address_shallow(&pinfo->dst, &save_dst);
734 offset += header_length;
739 dissect_sflow_245_address_type(tvbuff_t *tvb, packet_info *pinfo,
740 proto_tree *tree, gint offset,
741 struct sflow_address_type *hf_type,
746 addr_type = tvb_get_ntohl(tvb, offset);
750 case ADDR_TYPE_UNKNOWN:
755 proto_tree_add_item(tree, hf_type->hf_addr_v4, tvb, offset, 4, ENC_BIG_ENDIAN);
759 proto_tree_add_item(tree, hf_type->hf_addr_v6, tvb, offset, 16, ENC_NA);
762 /* Invalid address type, or a type we don't understand; we don't
763 know the length. We treat it as having no contents; that
764 doesn't trap us in an endless loop, as we at least include
765 the address type and thus at least advance the offset by 4.
766 Note that we have a problem, though. */
768 proto_tree_add_expert_format(tree, pinfo, &ei_sflow_invalid_address_type, tvb,
769 offset - 4, 4, "Unknown address type (%u)", addr_type);
778 set_address_tvb(addr, AT_IPv4, len, tvb, offset);
781 set_address_tvb(addr, AT_IPv6, len, tvb, offset);
789 /* extended switch data, after the packet data */
791 dissect_sflow_245_extended_switch(tvbuff_t *tvb, proto_tree *tree, gint offset) {
792 proto_tree_add_item(tree, hf_sflow_245_vlan_in, tvb, offset, 4, ENC_BIG_ENDIAN);
794 proto_tree_add_item(tree, hf_sflow_245_pri_in, tvb, offset, 4, ENC_BIG_ENDIAN);
796 proto_tree_add_item(tree, hf_sflow_245_vlan_out, tvb, offset, 4, ENC_BIG_ENDIAN);
798 proto_tree_add_item(tree, hf_sflow_245_pri_out, tvb, offset, 4, ENC_BIG_ENDIAN);
804 /* extended router data, after the packet data */
806 dissect_sflow_245_extended_router(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint offset) {
807 struct sflow_address_type addr_type;
809 addr_type.hf_addr_v4 = hf_sflow_245_nexthop_v4;
810 addr_type.hf_addr_v6 = hf_sflow_245_nexthop_v6;
812 offset = dissect_sflow_245_address_type(tvb, pinfo, tree, offset, &addr_type, NULL);
813 proto_tree_add_item(tree, hf_sflow_245_nexthop_src_mask, tvb, offset, 4, ENC_BIG_ENDIAN);
815 proto_tree_add_item(tree, hf_sflow_245_nexthop_dst_mask, tvb, offset, 4, ENC_BIG_ENDIAN);
820 /* extended MPLS data */
822 dissect_sflow_5_extended_mpls_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint offset) {
823 guint32 in_label_count, out_label_count, label, i, j;
824 proto_tree *in_stack;
825 proto_tree *out_stack;
826 struct sflow_address_type addr_type;
828 addr_type.hf_addr_v4 = hf_sflow_245_nexthop_v4;
829 addr_type.hf_addr_v6 = hf_sflow_245_nexthop_v6;
831 offset = dissect_sflow_245_address_type(tvb, pinfo, tree, offset, &addr_type, NULL);
833 in_label_count = tvb_get_ntohl(tvb, offset);
834 proto_tree_add_item(tree, hf_sflow_245_extended_mpls_in_label_stack_entries, tvb, offset, 4, ENC_BIG_ENDIAN);
837 in_stack = proto_tree_add_subtree(tree, tvb, offset, -1, ett_sflow_5_mpls_in_label_stack, NULL, "In Label Stack");
839 /* by applying the mask, we avoid possible corrupted data that causes huge number of loops
840 * 255 is a sensible limit of label count */
841 for (i = 0, j = 0; i < (in_label_count & 0x000000ff); i++, j += 4) {
842 label = tvb_get_ntohl(tvb, offset + j);
843 proto_tree_add_uint_format(in_stack, hf_sflow_245_extended_mpls_in_label, tvb, offset, 4,
844 label, "Label %u: %u", i + 1, label);
846 offset += (in_label_count * 4);
848 out_label_count = tvb_get_ntohl(tvb, offset);
849 proto_tree_add_item(tree, hf_sflow_245_extended_mpls_out_label_stack_entries, tvb, offset, 4, ENC_BIG_ENDIAN);
852 out_stack = proto_tree_add_subtree(tree, tvb, offset, -1, ett_sflow_5_mpls_in_label_stack, NULL, "Out Label Stack");
854 /* by applying the mask, we avoid possible corrupted data that causes huge number of loops
855 * 255 is a sensible limit of label count */
856 for (i = 0, j = 0; i < (out_label_count & 0x000000ff); i++, j += 4) {
857 label = tvb_get_ntohl(tvb, offset + j);
858 proto_tree_add_uint_format(out_stack, hf_sflow_245_extended_mpls_out_label, tvb, offset, 4,
859 label, "Label %u: %u", i + 1, label);
861 offset = offset + out_label_count * 4;
866 /* extended NAT data */
868 dissect_sflow_5_extended_nat(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint offset) {
869 struct sflow_address_type addr_type;
871 addr_type.hf_addr_v4 = hf_sflow_245_ipv4_src;
872 addr_type.hf_addr_v6 = hf_sflow_245_ipv6_src;
874 offset = dissect_sflow_245_address_type(tvb, pinfo, tree, offset, &addr_type, NULL);
876 addr_type.hf_addr_v4 = hf_sflow_245_ipv4_dst;
877 addr_type.hf_addr_v6 = hf_sflow_245_ipv6_dst;
879 offset = dissect_sflow_245_address_type(tvb, pinfo, tree, offset, &addr_type, NULL);
884 /* extended gateway data, after the packet data */
886 dissect_sflow_245_extended_gateway(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint offset) {
888 gint32 i, j, comm_len, dst_len, dst_seg_len;
892 guint32 version = tvb_get_ntohl(tvb, 0); /* get sFlow version */
894 proto_tree *sflow_245_dst_as_tree;
895 proto_tree *sflow_245_comm_tree;
896 proto_tree *sflow_245_dst_as_seg_tree;
898 /* sFlow v5 contains next hop router IP address */
900 struct sflow_address_type addr_type;
902 addr_type.hf_addr_v4 = hf_sflow_245_nexthop_v4;
903 addr_type.hf_addr_v6 = hf_sflow_245_nexthop_v6;
905 offset = dissect_sflow_245_address_type(tvb, pinfo, tree, offset, &addr_type, NULL);
908 proto_tree_add_item(tree, hf_sflow_245_as, tvb, offset + len, 4, ENC_BIG_ENDIAN);
911 proto_tree_add_item(tree, hf_sflow_245_src_as, tvb, offset + len, 4, ENC_BIG_ENDIAN);
914 proto_tree_add_item(tree, hf_sflow_245_src_peer_as, tvb, offset + len, 4, ENC_BIG_ENDIAN);
917 dst_len = tvb_get_ntohl(tvb, offset + len);
918 ti = proto_tree_add_uint(tree, hf_sflow_245_dst_as_entries, tvb, offset + len, 4, dst_len);
919 sflow_245_dst_as_tree = proto_item_add_subtree(ti, ett_sflow_245_gw_as_dst);
922 for (i = 0; i < dst_len; i++) {
924 /* Version 2 AS paths are different than versions >= 4 as
927 There is no type encoded in the packet.
929 The destination ASs are encoded as an array of integers
930 rather as an array of arrays of integers. I just
931 pretended they were encoded as an array of arrays with
932 an implicit length of 1 to not have to do two
933 completely separate blocks for the different versions.
935 Having a subtree for "arrays" guaranteed to have only a
936 single element proved cumbersome to navigate so I moved
937 the creation of the subtree to only happen for versions
941 sflow_245_dst_as_seg_tree = sflow_245_dst_as_tree;
943 path_type = tvb_get_ntohl(tvb, offset + len);
945 dst_seg_len = tvb_get_ntohl(tvb, offset + len);
948 ti = proto_tree_add_uint_format(tree, hf_sflow_245_as_type, tvb, offset + len - kludge, kludge, path_type,
949 "%s, (%u entries)", val_to_str_const(path_type, sflow_245_as_types, "Unknown AS type"), dst_seg_len);
950 sflow_245_dst_as_seg_tree = proto_item_add_subtree(ti, ett_sflow_245_gw_as_dst_seg);
953 for (j = 0; j < dst_seg_len; j++) {
954 proto_tree_add_item(sflow_245_dst_as_seg_tree, hf_sflow_245_dst_as, tvb, offset + len, 4, ENC_BIG_ENDIAN);
961 comm_len = tvb_get_ntohl(tvb, offset + len);
963 ti = proto_tree_add_uint(tree, hf_sflow_245_community_entries, tvb, offset + len, 4, comm_len);
964 sflow_245_comm_tree = proto_item_add_subtree(ti, ett_sflow_245_gw_community);
966 for (i = 0; i < comm_len; i++) {
967 proto_tree_add_item(sflow_245_comm_tree,
968 hf_sflow_245_dst_as, tvb, offset + len,
973 proto_tree_add_item(tree, hf_sflow_245_localpref, tvb, offset + len, 4, ENC_BIG_ENDIAN);
981 /* sflow v5 ethernet frame data */
983 dissect_sflow_5_ethernet_frame(tvbuff_t *tvb, proto_tree *tree, gint offset) {
985 proto_tree_add_item(tree, hf_sflow_245_ethernet_length_of_mac_packet, tvb, offset, 4, ENC_BIG_ENDIAN);
988 proto_tree_add_item(tree, hf_sflow_245_ethernet_source_mac_address, tvb, offset, 6, ENC_NA);
989 /* Padded to 4 byte offset */
992 proto_tree_add_item(tree, hf_sflow_245_ethernet_destination_mac_address, tvb, offset, 6, ENC_NA);
993 /* Padded to 4 byte offset */
996 proto_tree_add_item(tree, hf_sflow_245_ethernet_packet_type, tvb, offset, 4, ENC_BIG_ENDIAN);
1002 /* sflow v5 IPv4 data */
1004 dissect_sflow_5_ipv4(tvbuff_t *tvb, proto_tree *tree, gint offset) {
1006 proto_tree_add_item(tree, hf_sflow_245_length_of_ip_packet, tvb, offset, 4, ENC_BIG_ENDIAN);
1009 proto_tree_add_item(tree, hf_sflow_245_ip_protocol, tvb, offset, 4, ENC_BIG_ENDIAN);
1012 proto_tree_add_item(tree, hf_sflow_245_ipv4_src, tvb, offset, 4, ENC_BIG_ENDIAN);
1015 proto_tree_add_item(tree, hf_sflow_245_ipv4_dst, tvb, offset, 4, ENC_BIG_ENDIAN);
1018 proto_tree_add_item(tree, hf_sflow_245_ip_source_port, tvb, offset, 4, ENC_BIG_ENDIAN);
1021 proto_tree_add_item(tree, hf_sflow_245_ip_destination_port, tvb, offset, 4, ENC_BIG_ENDIAN);
1024 /* dissect tcp flags bit-by-bit */
1025 /* 8 flags are included here, plus 24-bit 0-padding */
1026 proto_tree_add_item(tree, hf_sflow_245_ip_tcp_flag_cwr, tvb, offset, 1, ENC_NA);
1027 proto_tree_add_item(tree, hf_sflow_245_ip_tcp_flag_ece, tvb, offset, 1, ENC_NA);
1028 proto_tree_add_item(tree, hf_sflow_245_ip_tcp_flag_urg, tvb, offset, 1, ENC_NA);
1029 proto_tree_add_item(tree, hf_sflow_245_ip_tcp_flag_ack, tvb, offset, 1, ENC_NA);
1030 proto_tree_add_item(tree, hf_sflow_245_ip_tcp_flag_psh, tvb, offset, 1, ENC_NA);
1031 proto_tree_add_item(tree, hf_sflow_245_ip_tcp_flag_rst, tvb, offset, 1, ENC_NA);
1032 proto_tree_add_item(tree, hf_sflow_245_ip_tcp_flag_syn, tvb, offset, 1, ENC_NA);
1033 proto_tree_add_item(tree, hf_sflow_245_ip_tcp_flag_fin, tvb, offset, 1, ENC_NA);
1037 /* 7 bits for type of service, plus 1 reserved bit */
1038 proto_tree_add_item(tree, hf_sflow_245_ipv4_precedence_type, tvb, offset, 1, ENC_BIG_ENDIAN);
1039 proto_tree_add_item(tree, hf_sflow_245_ipv4_delay, tvb, offset, 1, ENC_NA);
1040 proto_tree_add_item(tree, hf_sflow_245_ipv4_throughput, tvb, offset, 1, ENC_NA);
1041 proto_tree_add_item(tree, hf_sflow_245_ipv4_reliability, tvb, offset, 1, ENC_NA);
1042 proto_tree_add_item(tree, hf_sflow_245_ipv4_cost, tvb, offset, 1, ENC_NA);
1049 /* sflow v5 IPv6 data */
1051 dissect_sflow_5_ipv6(tvbuff_t *tvb, proto_tree *tree, gint offset) {
1053 proto_tree_add_item(tree, hf_sflow_245_length_of_ip_packet, tvb, offset, 4, ENC_BIG_ENDIAN);
1056 proto_tree_add_item(tree, hf_sflow_245_ip_protocol, tvb, offset, 4, ENC_BIG_ENDIAN);
1059 proto_tree_add_item(tree, hf_sflow_245_ipv6_src, tvb, offset, 16, ENC_NA);
1062 proto_tree_add_item(tree, hf_sflow_245_ipv6_dst, tvb, offset, 16, ENC_NA);
1065 proto_tree_add_item(tree, hf_sflow_245_ip_source_port, tvb, offset, 4, ENC_BIG_ENDIAN);
1068 proto_tree_add_item(tree, hf_sflow_245_ip_destination_port, tvb, offset, 4, ENC_BIG_ENDIAN);
1071 /* dissect tcp flags bit-by-bit */
1072 /* 8 flags are included here, plus 24-bit 0-padding */
1073 proto_tree_add_item(tree, hf_sflow_245_ip_tcp_flag_cwr, tvb, offset, 1, ENC_NA);
1074 proto_tree_add_item(tree, hf_sflow_245_ip_tcp_flag_ece, tvb, offset, 1, ENC_NA);
1075 proto_tree_add_item(tree, hf_sflow_245_ip_tcp_flag_urg, tvb, offset, 1, ENC_NA);
1076 proto_tree_add_item(tree, hf_sflow_245_ip_tcp_flag_ack, tvb, offset, 1, ENC_NA);
1077 proto_tree_add_item(tree, hf_sflow_245_ip_tcp_flag_psh, tvb, offset, 1, ENC_NA);
1078 proto_tree_add_item(tree, hf_sflow_245_ip_tcp_flag_rst, tvb, offset, 1, ENC_NA);
1079 proto_tree_add_item(tree, hf_sflow_245_ip_tcp_flag_syn, tvb, offset, 1, ENC_NA);
1080 proto_tree_add_item(tree, hf_sflow_245_ip_tcp_flag_fin, tvb, offset, 1, ENC_NA);
1084 /* Priority -- Traffic class field enables a source to identify the desired
1085 delivery priority of the packets. Priority values are divided into
1086 ranges: traffic where the source provides congestion control and
1087 non-congestion control traffic.
1089 It is displayed as unsigned integer here according to sFlow specification */
1091 proto_tree_add_item(tree, hf_sflow_245_ipv6_priority, tvb, offset, 4, ENC_BIG_ENDIAN);
1097 /* sflow v5 user data */
1099 dissect_sflow_5_extended_user(tvbuff_t *tvb, proto_tree *tree, gint offset) {
1100 guint32 src_length, dest_length;
1102 /* charset is not processed here, all chars are assumed to be ASCII */
1103 proto_tree_add_item(tree, hf_sflow_5_extended_user_source_character_set, tvb, offset, 4, ENC_BIG_ENDIAN);
1106 src_length = tvb_get_ntohl(tvb, offset);
1107 proto_tree_add_item(tree, hf_sflow_5_extended_user_source_user_string_length, tvb, offset, 4, ENC_BIG_ENDIAN);
1110 /* extract source user info char by char */
1111 proto_tree_add_item(tree, hf_sflow_5_extended_user_source_user, tvb, offset, src_length, ENC_NA|ENC_ASCII);
1112 offset += src_length;
1113 /* get the correct offset by adding padding byte count */
1115 offset += (4 - src_length % 4);
1117 /* charset is not processed here, all chars are assumed to be ASCII */
1118 proto_tree_add_item(tree, hf_sflow_5_extended_user_destination_character_set, tvb, offset, 4, ENC_BIG_ENDIAN);
1121 dest_length = tvb_get_ntohl(tvb, offset);
1122 proto_tree_add_item(tree, hf_sflow_5_extended_user_destination_user_string_length, tvb, offset, 4, ENC_BIG_ENDIAN);
1125 /* extract destination user info char by char */
1126 proto_tree_add_item(tree, hf_sflow_5_extended_user_destination_user, tvb, offset, dest_length, ENC_NA|ENC_ASCII);
1127 offset += dest_length;
1128 /* get the correct offset by adding padding byte count */
1129 if (dest_length % 4)
1130 offset += (4 - dest_length % 4);
1135 /* sflow v5 URL data */
1137 dissect_sflow_5_extended_url(tvbuff_t *tvb, proto_tree *tree, gint offset) {
1138 guint32 direction, url_length, host_length;
1140 direction = tvb_get_ntohl(tvb, offset);
1141 switch (direction) {
1143 proto_tree_add_uint_format(tree, hf_sflow_5_extended_url_direction, tvb, offset, 4, direction,
1144 "Source Address is Server(%u)", direction);
1147 proto_tree_add_uint_format(tree, hf_sflow_5_extended_url_direction, tvb, offset, 4, direction,
1148 "Destination Address is Server (%u)", direction);
1151 proto_tree_add_uint_format(tree, hf_sflow_5_extended_url_direction, tvb, offset, 4, direction,
1152 "Server Unspecified (%u)", direction);
1157 url_length = tvb_get_ntohl(tvb, offset);
1158 proto_tree_add_item(tree, hf_sflow_5_extended_url_url_length, tvb, offset, 4, ENC_BIG_ENDIAN);
1161 /* extract URL char by char */
1162 proto_tree_add_item(tree, hf_sflow_5_extended_url_url, tvb, offset, url_length, ENC_NA|ENC_ASCII);
1163 offset += url_length;
1164 /* get the correct offset by adding padding byte count */
1166 offset += (4 - url_length % 4);
1168 host_length = tvb_get_ntohl(tvb, offset);
1169 proto_tree_add_item(tree, hf_sflow_5_extended_url_host_length, tvb, offset, 4, ENC_BIG_ENDIAN);
1172 /* extract host info char by char */
1173 proto_tree_add_item(tree, hf_sflow_5_extended_url_host, tvb, offset, host_length, ENC_NA|ENC_ASCII);
1174 offset += host_length;
1175 /* get the correct offset by adding padding byte count */
1176 if (host_length % 4)
1177 offset += (4 - host_length % 4);
1182 /* sflow v5 MPLS tunnel */
1184 dissect_sflow_5_extended_mpls_tunnel(tvbuff_t *tvb, proto_tree *tree, gint offset) {
1185 guint32 name_length;
1187 name_length = tvb_get_ntohl(tvb, offset);
1188 proto_tree_add_item(tree, hf_sflow_5_extended_mpls_tunnel_name_length, tvb, offset, 4, ENC_BIG_ENDIAN);
1191 /* extract tunnel name char by char */
1192 proto_tree_add_item(tree, hf_sflow_5_extended_mpls_tunnel_name, tvb, offset, name_length, ENC_NA|ENC_ASCII);
1193 offset += name_length;
1194 /* get the correct offset by adding padding byte count */
1195 if (name_length % 4)
1196 offset += (4 - name_length % 4);
1198 proto_tree_add_item(tree, hf_sflow_5_extended_mpls_tunnel_id, tvb, offset, 4, ENC_BIG_ENDIAN);
1201 proto_tree_add_item(tree, hf_sflow_5_extended_mpls_tunnel_cos_value, tvb, offset, 4, ENC_BIG_ENDIAN);
1207 /* sflow v5 MPLS VC */
1209 dissect_sflow_5_extended_mpls_vc(tvbuff_t *tvb, proto_tree *tree, gint offset) {
1210 guint32 name_length;
1212 name_length = tvb_get_ntohl(tvb, offset);
1213 proto_tree_add_item(tree, hf_sflow_5_extended_mpls_vc_instance_name_length, tvb, offset, 4, ENC_BIG_ENDIAN);
1216 /* extract source user info char by char */
1217 proto_tree_add_item(tree, hf_sflow_5_extended_mpls_vc_instance_name, tvb, offset, name_length, ENC_NA|ENC_ASCII);
1218 offset += name_length;
1219 /* get the correct offset by adding padding byte count */
1220 if (name_length % 4)
1221 offset += (4 - name_length % 4);
1223 proto_tree_add_item(tree, hf_sflow_5_extended_mpls_vc_id, tvb, offset, 4, ENC_BIG_ENDIAN);
1226 proto_tree_add_item(tree, hf_sflow_5_extended_mpls_vc_label_cos_value, tvb, offset, 4, ENC_BIG_ENDIAN);
1232 /* sflow v5 MPLS FEC */
1234 dissect_sflow_5_extended_mpls_fec(tvbuff_t *tvb, proto_tree *tree, gint offset) {
1237 length = tvb_get_ntohl(tvb, offset);
1238 proto_tree_add_item(tree, hf_sflow_5_extended_mpls_ftn_description_length, tvb, offset, 4, ENC_BIG_ENDIAN);
1241 /* extract MPLS FTN description char by char */
1242 proto_tree_add_item(tree, hf_sflow_5_extended_mpls_ftn_description, tvb, offset, length, ENC_NA|ENC_ASCII);
1244 /* get the correct offset by adding padding byte count */
1246 offset += (4 - length % 4);
1248 proto_tree_add_item(tree, hf_sflow_5_extended_mpls_ftn_mask, tvb, offset, 4, ENC_BIG_ENDIAN);
1254 /* sflow v5 MPLS LVP FEC */
1256 dissect_sflow_5_extended_mpls_lvp_fec(tvbuff_t *tvb, proto_tree *tree, gint offset) {
1258 proto_tree_add_item(tree, hf_sflow_5_extended_mpls_fec_address_prefix_length, tvb, offset, 4, ENC_BIG_ENDIAN);
1263 /* sflow v5 extended VLAN tunnel */
1265 dissect_sflow_5_extended_vlan_tunnel(tvbuff_t *tvb, proto_tree *tree, gint offset) {
1268 num = tvb_get_ntohl(tvb, offset);
1269 proto_tree_add_item(tree, hf_sflow_5_extended_vlan_tunnel_number_of_layers, tvb, offset, 4, ENC_BIG_ENDIAN);
1272 /* loop strip 802.1Q TPID/TCI layers. each TPID/TCI pair is represented as a
1273 single 32 bit integer layers listed from outermost to innermost */
1274 for (i = 0; i < num; i++) {
1275 proto_tree_add_item(tree, hf_sflow_5_extended_vlan_tunnel_tpid_tci_pair, tvb, offset, 4, ENC_BIG_ENDIAN);
1282 /* sflow v5 extended 802.11 payload */
1284 dissect_sflow_5_extended_80211_payload(tvbuff_t *tvb, proto_tree *tree, gint offset) {
1285 guint32 cipher_suite, OUI, suite_type, length;
1287 cipher_suite = tvb_get_ntohl(tvb, offset);
1288 OUI = cipher_suite >> 8;
1289 suite_type = cipher_suite & 0x000000ff;
1291 if (OUI == 0x000FAC) {
1292 proto_tree_add_uint_format_value(tree, hf_sflow_5_extended_80211_oui, tvb, offset, 3, OUI, "Default (0x%X)", OUI);
1294 proto_tree_add_item(tree, hf_sflow_5_extended_80211_suite_type, tvb, offset, 1, ENC_BIG_ENDIAN);
1296 proto_tree_add_uint_format_value(tree, hf_sflow_5_extended_80211_oui, tvb, offset, 3, OUI, "Other vender (0x%X)", OUI);
1298 proto_tree_add_uint_format_value(tree, hf_sflow_5_extended_80211_suite_type, tvb, offset, 1,
1299 suite_type, "Vender specific (%u)", suite_type);
1303 length = tvb_get_ntohl(tvb, offset);
1304 proto_tree_add_item(tree, hf_sflow_5_extended_80211_payload_length, tvb, offset, 4, ENC_BIG_ENDIAN);
1307 /* extract data byte by byte */
1308 proto_tree_add_item(tree, hf_sflow_5_extended_80211_payload, tvb, offset, length, ENC_NA);
1310 /* get the correct offset by adding padding byte count */
1312 offset += (4 - length % 4);
1317 /* sflow v5 extended 802.11 rx */
1319 dissect_sflow_5_extended_80211_rx(tvbuff_t *tvb, proto_tree *tree, gint offset) {
1320 guint32 ssid_length, duration;
1322 /* extract SSID char by char. max char count = 32 */
1323 ssid_length = tvb_get_ntohl(tvb, offset);
1325 proto_tree_add_item(tree, hf_sflow_5_extended_80211_rx_ssid, tvb, offset, ssid_length, ENC_NA|ENC_ASCII);
1326 offset += ssid_length;
1327 /* get the correct offset by adding padding byte count */
1328 if (ssid_length % 4)
1329 offset += (4 - ssid_length % 4);
1331 proto_tree_add_item(tree, hf_sflow_5_extended_80211_rx_bssid, tvb, offset, 6, ENC_NA);
1332 /* Padded to 4 byte offset */
1335 proto_tree_add_item(tree, hf_sflow_5_extended_80211_rx_version, tvb, offset, 4, ENC_BIG_ENDIAN);
1338 proto_tree_add_item(tree, hf_sflow_5_extended_80211_rx_channel, tvb, offset, 4, ENC_BIG_ENDIAN);
1341 proto_tree_add_item(tree, hf_sflow_5_extended_80211_rx_speed, tvb, offset, 8, ENC_BIG_ENDIAN);
1344 proto_tree_add_item(tree, hf_sflow_5_extended_80211_rx_rsni, tvb, offset, 4, ENC_BIG_ENDIAN);
1347 proto_tree_add_item(tree, hf_sflow_5_extended_80211_rx_rcpi, tvb, offset, 4, ENC_BIG_ENDIAN);
1350 duration = tvb_get_ntohl(tvb, offset);
1351 if (duration == 0) {
1352 proto_tree_add_uint_format_value(tree, hf_sflow_5_extended_80211_rx_packet_duration, tvb, offset, 4, duration, "Unknown");
1354 proto_tree_add_item(tree, hf_sflow_5_extended_80211_rx_packet_duration, tvb, offset, 4, ENC_BIG_ENDIAN);
1361 /* sflow v5 extended 802.11 tx */
1363 dissect_sflow_5_extended_80211_tx(tvbuff_t *tvb, proto_tree *tree, gint offset) {
1364 guint32 ssid_length, transmissions, packet_duration, retrans_duration;
1366 /* extract SSID char by char. max char count = 32 */
1367 ssid_length = tvb_get_ntohl(tvb, offset);
1368 if (ssid_length > 32)
1371 proto_tree_add_item(tree, hf_sflow_5_extended_80211_tx_ssid, tvb, offset, ssid_length, ENC_NA|ENC_ASCII);
1372 offset += ssid_length;
1373 /* get the correct offset by adding padding byte count */
1374 if (ssid_length % 4)
1375 offset += (4 - ssid_length % 4);
1377 proto_tree_add_item(tree, hf_sflow_5_extended_80211_tx_bssid, tvb, offset, 6, ENC_NA);
1378 /* Padded to 4 byte offset */
1381 proto_tree_add_item(tree, hf_sflow_5_extended_80211_tx_version, tvb, offset, 4, ENC_BIG_ENDIAN);
1384 transmissions = tvb_get_ntohl(tvb, offset);
1385 switch (transmissions) {
1387 proto_tree_add_uint_format_value(tree, hf_sflow_5_extended_80211_tx_retransmissions, tvb, offset, 4,
1391 proto_tree_add_uint_format_value(tree, hf_sflow_5_extended_80211_tx_retransmissions, tvb, offset, 4,
1392 1, "Packet transmitted successfully on first attempt");
1395 proto_tree_add_uint(tree, hf_sflow_5_extended_80211_tx_retransmissions, tvb, offset, 4, transmissions - 1);
1400 packet_duration = tvb_get_ntohl(tvb, offset);
1401 if (packet_duration == 0) {
1402 proto_tree_add_uint_format_value(tree, hf_sflow_5_extended_80211_tx_packet_duration, tvb, offset, 4, packet_duration, "Unknown");
1404 proto_tree_add_item(tree, hf_sflow_5_extended_80211_tx_packet_duration, tvb, offset, 4, ENC_BIG_ENDIAN);
1408 retrans_duration = tvb_get_ntohl(tvb, offset);
1409 if (retrans_duration == 0) {
1410 proto_tree_add_uint_format_value(tree, hf_sflow_5_extended_80211_tx_retransmission_duration, tvb, offset, 4, retrans_duration, "Unknown");
1412 proto_tree_add_item(tree, hf_sflow_5_extended_80211_tx_retransmission_duration, tvb, offset, 4, ENC_BIG_ENDIAN);
1416 proto_tree_add_item(tree, hf_sflow_5_extended_80211_tx_channel, tvb, offset, 4, ENC_BIG_ENDIAN);
1419 proto_tree_add_item(tree, hf_sflow_5_extended_80211_tx_speed, tvb, offset, 8, ENC_BIG_ENDIAN);
1422 proto_tree_add_item(tree, hf_sflow_5_extended_80211_tx_power, tvb, offset, 4, ENC_BIG_ENDIAN);
1428 /* sflow v5 extended 802.11 aggregation */
1430 dissect_sflow_5_extended_80211_aggregation(tvbuff_t *tvb _U_, proto_tree *tree _U_, gint offset) {
1435 /* dissect an sflow v2/4 flow sample */
1437 dissect_sflow_24_flow_sample(tvbuff_t *tvb, packet_info *pinfo,
1438 proto_tree *tree, gint offset, proto_item *parent) {
1439 guint32 sequence_number, sampling_rate, sample_pool, output;
1441 proto_tree *extended_data_tree;
1443 guint32 packet_type, extended_data, ext_type, i;
1445 sequence_number = tvb_get_ntohl(tvb, offset);
1446 proto_tree_add_item(tree, hf_sflow_flow_sample_sequence_number, tvb, offset, 4, ENC_BIG_ENDIAN);
1447 proto_item_append_text(parent, ", seq %u", sequence_number);
1448 proto_tree_add_item(tree, hf_sflow_flow_sample_source_id_class, tvb, offset + 4, 4, ENC_BIG_ENDIAN);
1449 proto_tree_add_item(tree, hf_sflow_flow_sample_index, tvb, offset + 4, 4, ENC_BIG_ENDIAN);
1450 sampling_rate = tvb_get_ntohl(tvb, offset + 8);
1451 proto_tree_add_uint_format_value(tree, hf_sflow_flow_sample_sampling_rate, tvb, offset + 8, 4,
1452 sampling_rate, "1 out of %u packets",
1454 sample_pool = tvb_get_ntohl(tvb, offset + 12);
1455 proto_tree_add_uint_format_value(tree, hf_sflow_flow_sample_sample_pool, tvb, offset + 12, 4,
1456 sample_pool, "%u total packets",
1458 proto_tree_add_item(tree, hf_sflow_flow_sample_dropped_packets, tvb, offset + 16, 4, ENC_BIG_ENDIAN);
1459 proto_tree_add_item(tree, hf_sflow_flow_sample_input_interface, tvb, offset + 20, 4, ENC_BIG_ENDIAN);
1460 output = tvb_get_ntohl(tvb, offset + 24);
1461 if (output & 0x80000000) {
1462 output & 0x7fffffff ?
1463 proto_tree_add_uint_format_value(tree, hf_sflow_flow_sample_multiple_outputs, tvb, offset + 24, 4,
1464 output & 0x7fffffff, "%u interfaces", output & 0x7fffffff) :
1465 proto_tree_add_uint_format_value(tree, hf_sflow_flow_sample_multiple_outputs, tvb, offset + 24, 4,
1466 0x80000000, "unknown number");
1468 proto_tree_add_item(tree, hf_sflow_flow_sample_output_interface, tvb, offset + 24, 4, ENC_BIG_ENDIAN);
1472 /* what kind of flow sample is it? */
1473 packet_type = tvb_get_ntohl(tvb, offset);
1474 proto_tree_add_item(tree, hf_sflow_245_packet_information_type, tvb, offset, 4, ENC_BIG_ENDIAN);
1476 switch (packet_type) {
1477 case SFLOW_245_PACKET_DATA_TYPE_HEADER:
1478 offset = dissect_sflow_245_sampled_header(tvb, pinfo, tree, offset);
1480 case SFLOW_245_PACKET_DATA_TYPE_IPV4:
1481 case SFLOW_245_PACKET_DATA_TYPE_IPV6:
1485 /* still need to dissect extended data */
1486 extended_data = tvb_get_ntohl(tvb, offset);
1489 for (i = 0; i < extended_data; i++) {
1490 /* figure out what kind of extended data it is */
1491 ext_type = tvb_get_ntohl(tvb, offset);
1493 /* create a subtree. Might want to move this to
1494 * the end, so more info can be correct.
1496 ti = proto_tree_add_uint(tree, hf_sflow_245_extended_information_type, tvb, offset, 4, ext_type);
1497 extended_data_tree = proto_item_add_subtree(ti, ett_sflow_245_extended_data);
1501 case SFLOW_245_EXTENDED_SWITCH:
1502 offset = dissect_sflow_245_extended_switch(tvb, extended_data_tree, offset);
1504 case SFLOW_245_EXTENDED_ROUTER:
1505 offset = dissect_sflow_245_extended_router(tvb, pinfo, extended_data_tree, offset);
1507 case SFLOW_245_EXTENDED_GATEWAY:
1508 offset = dissect_sflow_245_extended_gateway(tvb, pinfo, extended_data_tree, offset);
1510 case SFLOW_245_EXTENDED_USER:
1512 case SFLOW_245_EXTENDED_URL:
1517 proto_item_set_end(ti, tvb, offset);
1523 /* dissect an sflow v5 flow record */
1525 dissect_sflow_5_flow_record(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint offset) {
1526 proto_tree *flow_data_tree;
1528 guint32 enterprise_format, enterprise, format;
1530 /* what kind of flow sample is it? */
1531 enterprise_format = tvb_get_ntohl(tvb, offset);
1532 enterprise = enterprise_format >> 12;
1533 format = enterprise_format & 0x00000fff;
1535 /* only accept default enterprise 0 (InMon sFlow) */
1536 if (enterprise == ENTERPRISE_DEFAULT) {
1537 flow_data_tree = proto_tree_add_subtree(tree, tvb, offset, -1, ett_sflow_5_flow_record, &ti,
1538 val_to_str_ext_const(format, &sflow_5_flow_record_type_ext, "Unknown sample format"));
1540 proto_tree_add_uint_format_value(flow_data_tree, hf_sflow_enterprise, tvb, offset, 4,
1541 enterprise, "standard sFlow (%u)", enterprise);
1542 proto_tree_add_item(flow_data_tree, hf_sflow_5_flow_record_format, tvb, offset, 4, ENC_BIG_ENDIAN);
1545 proto_tree_add_item(flow_data_tree, hf_sflow_5_flow_data_length, tvb, offset, 4, ENC_BIG_ENDIAN);
1549 case SFLOW_5_RAW_PACKET_HEADER:
1550 offset = dissect_sflow_245_sampled_header(tvb, pinfo, flow_data_tree, offset);
1552 case SFLOW_5_ETHERNET_FRAME:
1553 offset = dissect_sflow_5_ethernet_frame(tvb, flow_data_tree, offset);
1556 offset = dissect_sflow_5_ipv4(tvb, flow_data_tree, offset);
1559 offset = dissect_sflow_5_ipv6(tvb, flow_data_tree, offset);
1561 case SFLOW_5_SWITCH:
1562 offset = dissect_sflow_245_extended_switch(tvb, flow_data_tree, offset);
1564 case SFLOW_5_ROUTER:
1565 offset = dissect_sflow_245_extended_router(tvb, pinfo, flow_data_tree, offset);
1567 case SFLOW_5_GATEWAY:
1568 offset = dissect_sflow_245_extended_gateway(tvb, pinfo, flow_data_tree, offset);
1571 offset = dissect_sflow_5_extended_user(tvb, flow_data_tree, offset);
1574 offset = dissect_sflow_5_extended_url(tvb, flow_data_tree, offset);
1576 case SFLOW_5_MPLS_DATA:
1577 offset = dissect_sflow_5_extended_mpls_data(tvb, pinfo, flow_data_tree, offset);
1580 offset = dissect_sflow_5_extended_nat(tvb, pinfo, flow_data_tree, offset);
1582 case SFLOW_5_MPLS_TUNNEL:
1583 offset = dissect_sflow_5_extended_mpls_tunnel(tvb, flow_data_tree, offset);
1585 case SFLOW_5_MPLS_VC:
1586 offset = dissect_sflow_5_extended_mpls_vc(tvb, flow_data_tree, offset);
1588 case SFLOW_5_MPLS_FEC:
1589 offset = dissect_sflow_5_extended_mpls_fec(tvb, flow_data_tree, offset);
1591 case SFLOW_5_MPLS_LVP_FEC:
1592 offset = dissect_sflow_5_extended_mpls_lvp_fec(tvb, flow_data_tree, offset);
1594 case SFLOW_5_VLAN_TUNNEL:
1595 offset = dissect_sflow_5_extended_vlan_tunnel(tvb, flow_data_tree, offset);
1597 case SFLOW_5_80211_PAYLOAD:
1598 offset = dissect_sflow_5_extended_80211_payload(tvb, flow_data_tree, offset);
1600 case SFLOW_5_80211_RX:
1601 offset = dissect_sflow_5_extended_80211_rx(tvb, flow_data_tree, offset);
1603 case SFLOW_5_80211_TX:
1604 offset = dissect_sflow_5_extended_80211_tx(tvb, flow_data_tree, offset);
1606 case SFLOW_5_80211_AGGREGATION:
1607 offset = dissect_sflow_5_extended_80211_aggregation(tvb, flow_data_tree, offset);
1613 /* unknown enterprise format, what to do?? */
1614 flow_data_tree = proto_tree_add_subtree(tree, tvb, offset, -1,
1615 ett_sflow_5_flow_record, &ti, "Unknown enterprise format");
1616 proto_tree_add_uint_format_value(flow_data_tree, hf_sflow_enterprise, tvb, offset, 4,
1617 enterprise, "Non-standard sFlow (%u)", enterprise);
1618 offset = tvb_captured_length(tvb);
1620 proto_item_set_end(ti, tvb, offset);
1625 /* dissect generic interface counters */
1627 dissect_sflow_5_generic_interface(proto_tree *counter_data_tree, tvbuff_t *tvb, gint offset) {
1629 proto_tree_add_item(counter_data_tree, hf_sflow_245_ifindex, tvb, offset, 4, ENC_BIG_ENDIAN);
1631 proto_tree_add_item(counter_data_tree, hf_sflow_245_iftype, tvb, offset, 4, ENC_BIG_ENDIAN);
1633 proto_tree_add_item(counter_data_tree, hf_sflow_245_ifspeed, tvb, offset, 8, ENC_BIG_ENDIAN);
1635 proto_tree_add_item(counter_data_tree, hf_sflow_245_ifdirection, tvb, offset, 4, ENC_BIG_ENDIAN);
1637 proto_tree_add_item(counter_data_tree, hf_sflow_245_ifadmin_status, tvb, offset, 4, ENC_BIG_ENDIAN);
1638 proto_tree_add_item(counter_data_tree, hf_sflow_245_ifoper_status, tvb, offset, 4, ENC_BIG_ENDIAN);
1640 proto_tree_add_item(counter_data_tree, hf_sflow_245_ifinoct, tvb, offset, 8, ENC_BIG_ENDIAN);
1642 proto_tree_add_item(counter_data_tree, hf_sflow_245_ifinpkt, tvb, offset, 4, ENC_BIG_ENDIAN);
1644 proto_tree_add_item(counter_data_tree, hf_sflow_245_ifinmcast, tvb, offset, 4, ENC_BIG_ENDIAN);
1646 proto_tree_add_item(counter_data_tree, hf_sflow_245_ifinbcast, tvb, offset, 4, ENC_BIG_ENDIAN);
1648 proto_tree_add_item(counter_data_tree, hf_sflow_245_ifindisc, tvb, offset, 4, ENC_BIG_ENDIAN);
1650 proto_tree_add_item(counter_data_tree, hf_sflow_245_ifinerr, tvb, offset, 4, ENC_BIG_ENDIAN);
1652 proto_tree_add_item(counter_data_tree, hf_sflow_245_ifinunk, tvb, offset, 4, ENC_BIG_ENDIAN);
1654 proto_tree_add_item(counter_data_tree, hf_sflow_245_ifoutoct, tvb, offset, 8, ENC_BIG_ENDIAN);
1656 proto_tree_add_item(counter_data_tree, hf_sflow_245_ifoutpkt, tvb, offset, 4, ENC_BIG_ENDIAN);
1658 proto_tree_add_item(counter_data_tree, hf_sflow_245_ifoutmcast, tvb, offset, 4, ENC_BIG_ENDIAN);
1660 proto_tree_add_item(counter_data_tree, hf_sflow_245_ifoutbcast, tvb, offset, 4, ENC_BIG_ENDIAN);
1662 proto_tree_add_item(counter_data_tree, hf_sflow_245_ifoutdisc, tvb, offset, 4, ENC_BIG_ENDIAN);
1664 proto_tree_add_item(counter_data_tree, hf_sflow_245_ifouterr, tvb, offset, 4, ENC_BIG_ENDIAN);
1666 proto_tree_add_item(counter_data_tree, hf_sflow_245_ifpromisc, tvb, offset, 4, ENC_BIG_ENDIAN);
1672 /* dissect ethernet interface counters */
1674 dissect_sflow_5_ethernet_interface(proto_tree *counter_data_tree, tvbuff_t *tvb, gint offset) {
1676 proto_tree_add_item(counter_data_tree, hf_sflow_245_dot3StatsAlignmentErrors, tvb, offset, 4, ENC_BIG_ENDIAN);
1678 proto_tree_add_item(counter_data_tree, hf_sflow_245_dot3StatsFCSErrors, tvb, offset, 4, ENC_BIG_ENDIAN);
1680 proto_tree_add_item(counter_data_tree, hf_sflow_245_dot3StatsSingleCollisionFrames, tvb, offset, 4, ENC_BIG_ENDIAN);
1682 proto_tree_add_item(counter_data_tree, hf_sflow_245_dot3StatsMultipleCollisionFrames, tvb, offset, 4, ENC_BIG_ENDIAN);
1684 proto_tree_add_item(counter_data_tree, hf_sflow_245_dot3StatsSQETestErrors, tvb, offset, 4, ENC_BIG_ENDIAN);
1686 proto_tree_add_item(counter_data_tree, hf_sflow_245_dot3StatsDeferredTransmissions, tvb, offset, 4, ENC_BIG_ENDIAN);
1688 proto_tree_add_item(counter_data_tree, hf_sflow_245_dot3StatsLateCollisions, tvb, offset, 4, ENC_BIG_ENDIAN);
1690 proto_tree_add_item(counter_data_tree, hf_sflow_245_dot3StatsExcessiveCollisions, tvb, offset, 4, ENC_BIG_ENDIAN);
1692 proto_tree_add_item(counter_data_tree, hf_sflow_245_dot3StatsInternalMacTransmitErrors, tvb, offset, 4, ENC_BIG_ENDIAN);
1694 proto_tree_add_item(counter_data_tree, hf_sflow_245_dot3StatsCarrierSenseErrors, tvb, offset, 4, ENC_BIG_ENDIAN);
1696 proto_tree_add_item(counter_data_tree, hf_sflow_245_dot3StatsFrameTooLongs, tvb, offset, 4, ENC_BIG_ENDIAN);
1698 proto_tree_add_item(counter_data_tree, hf_sflow_245_dot3StatsInternalMacReceiveErrors, tvb, offset, 4, ENC_BIG_ENDIAN);
1700 proto_tree_add_item(counter_data_tree, hf_sflow_245_dot3StatsSymbolErrors, tvb, offset, 4, ENC_BIG_ENDIAN);
1706 /* dissect token ring counters */
1708 dissect_sflow_5_token_ring(proto_tree *counter_data_tree, tvbuff_t *tvb, gint offset) {
1710 proto_tree_add_item(counter_data_tree, hf_sflow_245_dot5StatsLineErrors, tvb, offset, 4, ENC_BIG_ENDIAN);
1712 proto_tree_add_item(counter_data_tree, hf_sflow_245_dot5StatsBurstErrors, tvb, offset, 4, ENC_BIG_ENDIAN);
1714 proto_tree_add_item(counter_data_tree, hf_sflow_245_dot5StatsACErrors, tvb, offset, 4, ENC_BIG_ENDIAN);
1716 proto_tree_add_item(counter_data_tree, hf_sflow_245_dot5StatsAbortTransErrors, tvb, offset, 4, ENC_BIG_ENDIAN);
1718 proto_tree_add_item(counter_data_tree, hf_sflow_245_dot5StatsInternalErrors, tvb, offset, 4, ENC_BIG_ENDIAN);
1720 proto_tree_add_item(counter_data_tree, hf_sflow_245_dot5StatsLostFrameErrors, tvb, offset, 4, ENC_BIG_ENDIAN);
1722 proto_tree_add_item(counter_data_tree, hf_sflow_245_dot5StatsReceiveCongestions, tvb, offset, 4, ENC_BIG_ENDIAN);
1724 proto_tree_add_item(counter_data_tree, hf_sflow_245_dot5StatsFrameCopiedErrors, tvb, offset, 4, ENC_BIG_ENDIAN);
1726 proto_tree_add_item(counter_data_tree, hf_sflow_245_dot5StatsTokenErrors, tvb, offset, 4, ENC_BIG_ENDIAN);
1728 proto_tree_add_item(counter_data_tree, hf_sflow_245_dot5StatsSoftErrors, tvb, offset, 4, ENC_BIG_ENDIAN);
1730 proto_tree_add_item(counter_data_tree, hf_sflow_245_dot5StatsHardErrors, tvb, offset, 4, ENC_BIG_ENDIAN);
1732 proto_tree_add_item(counter_data_tree, hf_sflow_245_dot5StatsSignalLoss, tvb, offset, 4, ENC_BIG_ENDIAN);
1734 proto_tree_add_item(counter_data_tree, hf_sflow_245_dot5StatsTransmitBeacons, tvb, offset, 4, ENC_BIG_ENDIAN);
1736 proto_tree_add_item(counter_data_tree, hf_sflow_245_dot5StatsRecoveries, tvb, offset, 4, ENC_BIG_ENDIAN);
1738 proto_tree_add_item(counter_data_tree, hf_sflow_245_dot5StatsLobeWires, tvb, offset, 4, ENC_BIG_ENDIAN);
1740 proto_tree_add_item(counter_data_tree, hf_sflow_245_dot5StatsRemoves, tvb, offset, 4, ENC_BIG_ENDIAN);
1742 proto_tree_add_item(counter_data_tree, hf_sflow_245_dot5StatsSingles, tvb, offset, 4, ENC_BIG_ENDIAN);
1744 proto_tree_add_item(counter_data_tree, hf_sflow_245_dot5StatsFreqErrors, tvb, offset, 4, ENC_BIG_ENDIAN);
1750 /* dissect 100 BaseVG interface counters */
1752 dissect_sflow_5_vg_interface(proto_tree *counter_data_tree, tvbuff_t *tvb, gint offset) {
1754 proto_tree_add_item(counter_data_tree, hf_sflow_245_dot12InHighPriorityFrames, tvb, offset, 4, ENC_BIG_ENDIAN);
1756 proto_tree_add_item(counter_data_tree, hf_sflow_245_dot12InHighPriorityOctets, tvb, offset, 8, ENC_BIG_ENDIAN);
1758 proto_tree_add_item(counter_data_tree, hf_sflow_245_dot12InNormPriorityFrames, tvb, offset, 4, ENC_BIG_ENDIAN);
1760 proto_tree_add_item(counter_data_tree, hf_sflow_245_dot12InNormPriorityOctets, tvb, offset, 8, ENC_BIG_ENDIAN);
1762 proto_tree_add_item(counter_data_tree, hf_sflow_245_dot12InIPMErrors, tvb, offset, 4, ENC_BIG_ENDIAN);
1764 proto_tree_add_item(counter_data_tree, hf_sflow_245_dot12InOversizeFrameErrors, tvb, offset, 4, ENC_BIG_ENDIAN);
1766 proto_tree_add_item(counter_data_tree, hf_sflow_245_dot12InDataErrors, tvb, offset, 4, ENC_BIG_ENDIAN);
1768 proto_tree_add_item(counter_data_tree, hf_sflow_245_dot12InNullAddressedFrames, tvb, offset, 4, ENC_BIG_ENDIAN);
1770 proto_tree_add_item(counter_data_tree, hf_sflow_245_dot12OutHighPriorityFrames, tvb, offset, 4, ENC_BIG_ENDIAN);
1772 proto_tree_add_item(counter_data_tree, hf_sflow_245_dot12OutHighPriorityOctets, tvb, offset, 8, ENC_BIG_ENDIAN);
1774 proto_tree_add_item(counter_data_tree, hf_sflow_245_dot12TransitionIntoTrainings, tvb, offset, 4, ENC_BIG_ENDIAN);
1776 proto_tree_add_item(counter_data_tree, hf_sflow_245_dot12HCInHighPriorityOctets, tvb, offset, 8, ENC_BIG_ENDIAN);
1778 proto_tree_add_item(counter_data_tree, hf_sflow_245_dot12HCInNormPriorityOctets, tvb, offset, 8, ENC_BIG_ENDIAN);
1780 proto_tree_add_item(counter_data_tree, hf_sflow_245_dot12HCOutHighPriorityOctets, tvb, offset, 8, ENC_BIG_ENDIAN);
1786 /* dissect VLAN counters */
1788 dissect_sflow_5_vlan(proto_tree *counter_data_tree, tvbuff_t *tvb, gint offset) {
1790 proto_tree_add_item(counter_data_tree, hf_sflow_245_vlan_id, tvb, offset, 4, ENC_BIG_ENDIAN);
1792 proto_tree_add_item(counter_data_tree, hf_sflow_245_octets, tvb, offset, 8, ENC_BIG_ENDIAN);
1794 proto_tree_add_item(counter_data_tree, hf_sflow_245_ucastPkts, tvb, offset, 4, ENC_BIG_ENDIAN);
1796 proto_tree_add_item(counter_data_tree, hf_sflow_245_multicastPkts, tvb, offset, 4, ENC_BIG_ENDIAN);
1798 proto_tree_add_item(counter_data_tree, hf_sflow_245_broadcastPkts, tvb, offset, 4, ENC_BIG_ENDIAN);
1800 proto_tree_add_item(counter_data_tree, hf_sflow_245_discards, tvb, offset, 4, ENC_BIG_ENDIAN);
1806 /* dissect 802.11 counters */
1808 dissect_sflow_5_80211_counters(proto_tree *counter_data_tree, tvbuff_t *tvb, gint offset) {
1810 proto_tree_add_item(counter_data_tree, hf_sflow_5_dot11TransmittedFragmentCount, tvb, offset, 4, ENC_BIG_ENDIAN);
1812 proto_tree_add_item(counter_data_tree, hf_sflow_5_dot11MulticastTransmittedFrameCount, tvb, offset, 4, ENC_BIG_ENDIAN);
1814 proto_tree_add_item(counter_data_tree, hf_sflow_5_dot11FailedCount, tvb, offset, 4, ENC_BIG_ENDIAN);
1816 proto_tree_add_item(counter_data_tree, hf_sflow_5_dot11RetryCount, tvb, offset, 4, ENC_BIG_ENDIAN);
1818 proto_tree_add_item(counter_data_tree, hf_sflow_5_dot11MultipleRetryCount, tvb, offset, 4, ENC_BIG_ENDIAN);
1820 proto_tree_add_item(counter_data_tree, hf_sflow_5_dot11FrameDuplicateCount, tvb, offset, 4, ENC_BIG_ENDIAN);
1822 proto_tree_add_item(counter_data_tree, hf_sflow_5_dot11RTSSuccessCount, tvb, offset, 4, ENC_BIG_ENDIAN);
1824 proto_tree_add_item(counter_data_tree, hf_sflow_5_dot11RTSFailureCount, tvb, offset, 4, ENC_BIG_ENDIAN);
1826 proto_tree_add_item(counter_data_tree, hf_sflow_5_dot11ACKFailureCount, tvb, offset, 4, ENC_BIG_ENDIAN);
1828 proto_tree_add_item(counter_data_tree, hf_sflow_5_dot11ReceivedFragmentCount, tvb, offset, 4, ENC_BIG_ENDIAN);
1830 proto_tree_add_item(counter_data_tree, hf_sflow_5_dot11MulticastReceivedFrameCount, tvb, offset, 4, ENC_BIG_ENDIAN);
1832 proto_tree_add_item(counter_data_tree, hf_sflow_5_dot11FCSErrorCount, tvb, offset, 4, ENC_BIG_ENDIAN);
1834 proto_tree_add_item(counter_data_tree, hf_sflow_5_dot11TransmittedFrameCount, tvb, offset, 4, ENC_BIG_ENDIAN);
1836 proto_tree_add_item(counter_data_tree, hf_sflow_5_dot11WEPUndecryptableCount, tvb, offset, 4, ENC_BIG_ENDIAN);
1838 proto_tree_add_item(counter_data_tree, hf_sflow_5_dot11QoSDiscardedFragmentCount, tvb, offset, 4, ENC_BIG_ENDIAN);
1840 proto_tree_add_item(counter_data_tree, hf_sflow_5_dot11AssociatedStationCount, tvb, offset, 4, ENC_BIG_ENDIAN);
1842 proto_tree_add_item(counter_data_tree, hf_sflow_5_dot11QoSCFPollsReceivedCount, tvb, offset, 4, ENC_BIG_ENDIAN);
1844 proto_tree_add_item(counter_data_tree, hf_sflow_5_dot11QoSCFPollsUnusedCount, tvb, offset, 4, ENC_BIG_ENDIAN);
1846 proto_tree_add_item(counter_data_tree, hf_sflow_5_dot11QoSCFPollsUnusableCount, tvb, offset, 4, ENC_BIG_ENDIAN);
1848 proto_tree_add_item(counter_data_tree, hf_sflow_5_dot11QoSCFPollsLostCount, tvb, offset, 4, ENC_BIG_ENDIAN);
1854 /* dissect processor information */
1856 dissect_sflow_5_processor_information(proto_tree *counter_data_tree, tvbuff_t *tvb, gint offset) {
1858 proto_tree_add_item(counter_data_tree, hf_sflow_5_cpu_5s, tvb, offset, 4, ENC_BIG_ENDIAN);
1860 proto_tree_add_item(counter_data_tree, hf_sflow_5_cpu_1m, tvb, offset, 4, ENC_BIG_ENDIAN);
1862 proto_tree_add_item(counter_data_tree, hf_sflow_5_cpu_5m, tvb, offset, 4, ENC_BIG_ENDIAN);
1864 proto_tree_add_item(counter_data_tree, hf_sflow_5_total_memory, tvb, offset, 8, ENC_BIG_ENDIAN);
1866 proto_tree_add_item(counter_data_tree, hf_sflow_5_free_memory, tvb, offset, 8, ENC_BIG_ENDIAN);
1872 /* dissect radio utilization */
1874 dissect_sflow_5_radio_utilization(proto_tree *counter_data_tree, tvbuff_t *tvb, gint offset) {
1876 proto_tree_add_item(counter_data_tree, hf_sflow_5_elapsed_time, tvb, offset, 4, ENC_BIG_ENDIAN);
1878 proto_tree_add_item(counter_data_tree, hf_sflow_5_on_channel_time, tvb, offset, 4, ENC_BIG_ENDIAN);
1880 proto_tree_add_item(counter_data_tree, hf_sflow_5_on_channel_busy_time, tvb, offset, 4, ENC_BIG_ENDIAN);
1886 /* dissect an sflow v5 counters record */
1888 dissect_sflow_5_counters_record(tvbuff_t *tvb, proto_tree *tree, gint offset) {
1889 proto_tree *counter_data_tree;
1891 guint32 enterprise_format, enterprise, format;
1893 /* what kind of flow sample is it? */
1894 enterprise_format = tvb_get_ntohl(tvb, offset);
1895 enterprise = enterprise_format >> 12;
1896 format = enterprise_format & 0x00000fff;
1898 if (enterprise == ENTERPRISE_DEFAULT) { /* only accept default enterprise 0 (InMon sFlow) */
1899 counter_data_tree = proto_tree_add_subtree(tree, tvb, offset, -1, ett_sflow_5_counters_record, &ti,
1900 val_to_str_const(format, sflow_5_counters_record_type, "Unknown sample format"));
1902 proto_tree_add_uint_format_value(counter_data_tree, hf_sflow_enterprise, tvb, offset, 4,
1903 enterprise, "standard sFlow (%u)", enterprise);
1905 proto_tree_add_item(counter_data_tree, hf_sflow_5_counters_record_format, tvb, offset, 4, ENC_BIG_ENDIAN);
1908 proto_tree_add_item(counter_data_tree, hf_sflow_5_flow_data_length, tvb, offset, 4, ENC_BIG_ENDIAN);
1912 case SFLOW_5_GENERIC_INTERFACE:
1913 offset = dissect_sflow_5_generic_interface(counter_data_tree, tvb, offset);
1915 case SFLOW_5_ETHERNET_INTERFACE:
1916 offset = dissect_sflow_5_ethernet_interface(counter_data_tree, tvb, offset);
1918 case SFLOW_5_TOKEN_RING:
1919 offset = dissect_sflow_5_token_ring(counter_data_tree, tvb, offset);
1921 case SFLOW_5_100BASE_VG_INTERFACE:
1922 offset = dissect_sflow_5_vg_interface(counter_data_tree, tvb, offset);
1925 offset = dissect_sflow_5_vlan(counter_data_tree, tvb, offset);
1927 case SFLOW_5_80211_COUNTERS:
1928 offset = dissect_sflow_5_80211_counters(counter_data_tree, tvb, offset);
1930 case SFLOW_5_PROCESSOR:
1931 offset = dissect_sflow_5_processor_information(counter_data_tree, tvb, offset);
1933 case SFLOW_5_RADIO_UTILIZATION:
1934 offset = dissect_sflow_5_radio_utilization(counter_data_tree, tvb, offset);
1939 } else { /* unknown enterprise format, what to do?? */
1940 counter_data_tree = proto_tree_add_subtree(tree, tvb, offset, -1,
1941 ett_sflow_5_counters_record, &ti, "Unknown enterprise format");
1942 proto_tree_add_uint_format_value(counter_data_tree, hf_sflow_enterprise, tvb, offset, 4,
1943 enterprise, "Non-standard sFlow (%u)", enterprise);
1944 offset = tvb_captured_length(tvb);
1946 proto_item_set_end(ti, tvb, offset);
1951 /* dissect an sflow v5 flow sample */
1953 dissect_sflow_5_flow_sample(tvbuff_t *tvb, packet_info *pinfo,
1954 proto_tree *tree, gint offset, proto_item *parent) {
1956 guint32 sequence_number, sampling_rate, sample_pool,
1959 sequence_number = tvb_get_ntohl(tvb, offset);
1960 proto_tree_add_item(tree, hf_sflow_flow_sample_sequence_number, tvb, offset, 4, ENC_BIG_ENDIAN);
1962 proto_item_append_text(parent, ", seq %u", sequence_number);
1964 proto_tree_add_item(tree, hf_sflow_flow_sample_source_id_class, tvb, offset, 4, ENC_BIG_ENDIAN);
1965 proto_tree_add_item(tree, hf_sflow_flow_sample_index, tvb, offset, 4, ENC_BIG_ENDIAN);
1967 sampling_rate = tvb_get_ntohl(tvb, offset);
1968 proto_tree_add_uint_format_value(tree, hf_sflow_flow_sample_sampling_rate, tvb, offset, 4,
1969 sampling_rate, "1 out of %u packets", sampling_rate);
1971 sample_pool = tvb_get_ntohl(tvb, offset);
1972 proto_tree_add_uint_format_value(tree, hf_sflow_flow_sample_sample_pool, tvb, offset, 4,
1973 sample_pool, "%u total packets", sample_pool);
1975 proto_tree_add_item(tree, hf_sflow_flow_sample_dropped_packets, tvb, offset, 4, ENC_BIG_ENDIAN);
1977 proto_tree_add_item(tree, hf_sflow_flow_sample_input_interface, tvb, offset, 4, ENC_BIG_ENDIAN);
1979 output = tvb_get_ntohl(tvb, offset);
1980 if (output & 0x80000000) {
1981 output & 0x7fffffff ?
1982 proto_tree_add_uint_format_value(tree, hf_sflow_flow_sample_multiple_outputs, tvb, offset, 4,
1983 output & 0x7fffffff, "%u interfaces", output & 0x7fffffff) :
1984 proto_tree_add_uint_format_value(tree, hf_sflow_flow_sample_multiple_outputs, tvb, offset, 4,
1985 0x80000000, "unknown number");
1987 proto_tree_add_item(tree, hf_sflow_flow_sample_output_interface, tvb, offset, 4, ENC_BIG_ENDIAN);
1990 records = tvb_get_ntohl(tvb, offset);
1991 proto_tree_add_item(tree, hf_sflow_flow_sample_flow_record, tvb, offset, 4, ENC_BIG_ENDIAN);
1994 /* start loop processing flow records */
1995 /* we set an upper records limit to 255 in case corrupted data causes
1996 * huge number of loops! */
1997 for (i = 0; i < (records&0x000000ff); i++) {
1998 offset = dissect_sflow_5_flow_record(tvb, pinfo, tree, offset);
2003 /* dissect an expanded flow sample */
2005 dissect_sflow_5_expanded_flow_sample(tvbuff_t *tvb, packet_info *pinfo,
2006 proto_tree *tree, gint offset, proto_item *parent) {
2008 guint32 sequence_number, sampling_rate, sample_pool, records, i;
2010 sequence_number = tvb_get_ntohl(tvb, offset);
2011 proto_tree_add_item(tree, hf_sflow_flow_sample_sequence_number, tvb, offset, 4, ENC_BIG_ENDIAN);
2013 proto_item_append_text(parent, ", seq %u", sequence_number);
2014 proto_tree_add_item(tree, hf_sflow_flow_sample_source_id_type, tvb, offset, 4, ENC_BIG_ENDIAN);
2016 proto_tree_add_item(tree, hf_sflow_flow_sample_source_id_index, tvb, offset, 4, ENC_BIG_ENDIAN);
2018 sampling_rate = tvb_get_ntohl(tvb, offset);
2019 proto_tree_add_uint_format_value(tree, hf_sflow_flow_sample_sampling_rate, tvb, offset, 4,
2020 sampling_rate, "1 out of %u packets", sampling_rate);
2022 sample_pool = tvb_get_ntohl(tvb, offset);
2023 proto_tree_add_uint_format_value(tree, hf_sflow_flow_sample_sample_pool, tvb, offset, 4,
2024 sample_pool, "%u total packets", sample_pool);
2026 proto_tree_add_item(tree, hf_sflow_flow_sample_dropped_packets, tvb, offset, 4, ENC_BIG_ENDIAN);
2028 proto_tree_add_item(tree, hf_sflow_flow_sample_input_interface_format, tvb, offset, 4, ENC_BIG_ENDIAN);
2030 proto_tree_add_item(tree, hf_sflow_flow_sample_input_interface_value, tvb, offset, 4, ENC_BIG_ENDIAN);
2032 proto_tree_add_item(tree, hf_sflow_flow_sample_output_interface_format, tvb, offset, 4, ENC_BIG_ENDIAN);
2034 proto_tree_add_item(tree, hf_sflow_flow_sample_output_interface_value, tvb, offset, 4, ENC_BIG_ENDIAN);
2036 records = tvb_get_ntohl(tvb, offset);
2037 proto_tree_add_item(tree, hf_sflow_flow_sample_flow_record, tvb, offset, 4, ENC_BIG_ENDIAN);
2040 /* start loop processing flow records
2041 * we limit record count to 255 in case corrupted data may cause huge number of loops */
2042 for (i = 0; i < (records&0x000000ff); i++) {
2043 offset = dissect_sflow_5_flow_record(tvb, pinfo, tree, offset);
2047 /* dissect an sflow v2/4 counters sample */
2049 dissect_sflow_24_counters_sample(tvbuff_t *tvb, proto_tree *tree, gint offset, proto_item *parent) {
2051 guint32 sequence_number, counters_type;
2053 sequence_number = tvb_get_ntohl(tvb, offset);
2054 proto_tree_add_item(tree, hf_sflow_counters_sample_sequence_number, tvb, offset, 4, ENC_BIG_ENDIAN);
2055 proto_item_append_text(parent, ", seq %u", sequence_number);
2057 proto_tree_add_item(tree, hf_sflow_counters_sample_source_id_class, tvb, offset + 4, 4, ENC_BIG_ENDIAN);
2058 proto_tree_add_item(tree, hf_sflow_counters_sample_index, tvb, offset + 4, 4, ENC_BIG_ENDIAN);
2059 proto_tree_add_item(tree, hf_sflow_counters_sample_sampling_interval, tvb, offset + 8, 4, ENC_BIG_ENDIAN);
2060 counters_type = tvb_get_ntohl(tvb, offset + 12);
2061 proto_tree_add_item(tree, hf_sflow_counters_sample_counters_type, tvb, offset + 12, 4, ENC_BIG_ENDIAN);
2065 /* most counters types have the "generic" counters first */
2066 switch (counters_type) {
2067 case SFLOW_245_COUNTERS_GENERIC:
2068 case SFLOW_245_COUNTERS_ETHERNET:
2069 case SFLOW_245_COUNTERS_TOKENRING:
2070 case SFLOW_245_COUNTERS_FDDI:
2071 case SFLOW_245_COUNTERS_VG:
2072 case SFLOW_245_COUNTERS_WAN:
2073 proto_tree_add_item(tree, hf_sflow_245_ifindex, tvb, offset, 4, ENC_BIG_ENDIAN);
2074 proto_item_append_text(parent, ", ifIndex %u", tvb_get_ntohl(tvb, offset));
2076 proto_tree_add_item(tree, hf_sflow_245_iftype, tvb, offset, 4, ENC_BIG_ENDIAN);
2078 proto_tree_add_item(tree, hf_sflow_245_ifspeed, tvb, offset, 8, ENC_BIG_ENDIAN);
2080 proto_tree_add_item(tree, hf_sflow_245_ifdirection, tvb, offset, 4, ENC_BIG_ENDIAN);
2082 proto_tree_add_item(tree, hf_sflow_245_ifadmin_status, tvb, offset, 4, ENC_BIG_ENDIAN);
2083 proto_tree_add_item(tree, hf_sflow_245_ifoper_status, tvb, offset, 4, ENC_BIG_ENDIAN);
2085 proto_tree_add_item(tree, hf_sflow_245_ifinoct, tvb, offset, 8, ENC_BIG_ENDIAN);
2087 proto_tree_add_item(tree, hf_sflow_245_ifinpkt, tvb, offset, 4, ENC_BIG_ENDIAN);
2089 proto_tree_add_item(tree, hf_sflow_245_ifinmcast, tvb, offset, 4, ENC_BIG_ENDIAN);
2091 proto_tree_add_item(tree, hf_sflow_245_ifinbcast, tvb, offset, 4, ENC_BIG_ENDIAN);
2093 proto_tree_add_item(tree, hf_sflow_245_ifindisc, tvb, offset, 4, ENC_BIG_ENDIAN);
2095 proto_tree_add_item(tree, hf_sflow_245_ifinerr, tvb, offset, 4, ENC_BIG_ENDIAN);
2097 proto_tree_add_item(tree, hf_sflow_245_ifinunk, tvb, offset, 4, ENC_BIG_ENDIAN);
2099 proto_tree_add_item(tree, hf_sflow_245_ifoutoct, tvb, offset, 8, ENC_BIG_ENDIAN);
2101 proto_tree_add_item(tree, hf_sflow_245_ifoutpkt, tvb, offset, 4, ENC_BIG_ENDIAN);
2103 proto_tree_add_item(tree, hf_sflow_245_ifoutmcast, tvb, offset, 4, ENC_BIG_ENDIAN);
2105 proto_tree_add_item(tree, hf_sflow_245_ifoutbcast, tvb, offset, 4, ENC_BIG_ENDIAN);
2107 proto_tree_add_item(tree, hf_sflow_245_ifoutdisc, tvb, offset, 4, ENC_BIG_ENDIAN);
2109 proto_tree_add_item(tree, hf_sflow_245_ifouterr, tvb, offset, 4, ENC_BIG_ENDIAN);
2111 proto_tree_add_item(tree, hf_sflow_245_ifpromisc, tvb, offset, 4, ENC_BIG_ENDIAN);
2116 /* Some counter types have other info to gather */
2117 switch (counters_type) {
2118 case SFLOW_245_COUNTERS_ETHERNET:
2119 offset += (int)sizeof (struct ethernet_counters);
2121 case SFLOW_245_COUNTERS_TOKENRING:
2122 offset = dissect_sflow_5_token_ring(tree, tvb, offset);
2124 case SFLOW_245_COUNTERS_VG:
2125 offset = dissect_sflow_5_vg_interface(tree, tvb, offset);
2127 case SFLOW_245_COUNTERS_VLAN:
2128 offset = dissect_sflow_5_vlan(tree, tvb, offset);
2136 /* dissect an sflow v5 counters sample */
2138 dissect_sflow_5_counters_sample(tvbuff_t *tvb, proto_tree *tree, gint offset, proto_item *parent) {
2139 guint32 sequence_number, records, i;
2141 /* grab the flow header. This will remain in network byte
2142 order, so must convert each item before use */
2143 sequence_number = tvb_get_ntohl(tvb, offset);
2144 proto_tree_add_item(tree, hf_sflow_counters_sample_sequence_number, tvb, offset, 4, ENC_BIG_ENDIAN);
2145 proto_item_append_text(parent, ", seq %u", sequence_number);
2147 proto_tree_add_item(tree, hf_sflow_counters_sample_source_id_type, tvb, offset, 4, ENC_BIG_ENDIAN);
2148 proto_tree_add_item(tree, hf_sflow_counters_sample_source_id_index, tvb, offset, 4, ENC_BIG_ENDIAN);
2150 records = tvb_get_ntohl(tvb, offset);
2151 proto_tree_add_item(tree, hf_sflow_counters_sample_counters_records, tvb, offset, 4, ENC_BIG_ENDIAN);
2154 /* start loop processing counters records
2155 * limit record count to 255 in case corrupted data may cause huge number of loops */
2156 for (i = 0; i < (records&0x000000ff); i++) {
2157 offset = dissect_sflow_5_counters_record(tvb, tree, offset);
2161 /* dissect an expanded counters sample */
2163 dissect_sflow_5_expanded_counters_sample(tvbuff_t *tvb, proto_tree *tree, gint offset, proto_item *parent) {
2164 guint32 sequence_number, records, i;
2166 sequence_number = tvb_get_ntohl(tvb, offset);
2167 proto_tree_add_item(tree, hf_sflow_counters_sample_sequence_number, tvb, offset, 4, ENC_BIG_ENDIAN);
2168 proto_item_append_text(parent, ", seq %u", sequence_number);
2170 proto_tree_add_item(tree, hf_sflow_counters_sample_expanded_source_id_type, tvb, offset, 4, ENC_BIG_ENDIAN);
2172 proto_tree_add_item(tree, hf_sflow_counters_sample_expanded_source_id_index, tvb, offset, 4, ENC_BIG_ENDIAN);
2174 records = tvb_get_ntohl(tvb, offset);
2175 proto_tree_add_item(tree, hf_sflow_counters_sample_counters_records, tvb, offset, 4, ENC_BIG_ENDIAN);
2178 /* start loop processing counters records
2179 * limit record count to 255 in case corrupted data may cause huge number of loops */
2180 for (i = 0; i < (records&0x000000ff); i++) {
2181 offset = dissect_sflow_5_counters_record(tvb, tree, offset);
2185 static const int *sflow_lag_port_state_flags[] = {
2186 &hf_sflow_lag_port_actoradminstate,
2187 &hf_sflow_lag_port_actoroperstate,
2188 &hf_sflow_lag_port_partneradminstate,
2189 &hf_sflow_lag_port_partneroperstate,
2190 &hf_sflow_lag_port_reserved,
2195 /* dissect an LAG Port Stats ( http://www.sflow.org/sflow_lag.txt ) */
2197 dissect_sflow_5_lag_port_stats(tvbuff_t *tvb, proto_tree *tree, gint offset, proto_item *parent _U_) {
2199 proto_tree_add_item(tree, hf_sflow_lag_port_actorsystemid, tvb, offset, 6, ENC_NA);
2202 proto_tree_add_item(tree, hf_sflow_lag_port_partneropersystemid, tvb, offset, 6, ENC_NA);
2205 proto_tree_add_item(tree, hf_sflow_lag_port_attachedaggid, tvb, offset, 4, ENC_BIG_ENDIAN);
2208 proto_tree_add_bitmask(tree, tvb, offset, hf_sflow_lag_port_state, ett_sflow_lag_port_state_flags, sflow_lag_port_state_flags, ENC_BIG_ENDIAN);
2211 proto_tree_add_item(tree, hf_sflow_lag_port_stats_lacpdusrx, tvb, offset, 4, ENC_BIG_ENDIAN);
2214 proto_tree_add_item(tree, hf_sflow_lag_port_stats_markerpdusrx, tvb, offset, 4, ENC_BIG_ENDIAN);
2217 proto_tree_add_item(tree, hf_sflow_lag_port_stats_markerresponsepdusrx, tvb, offset, 4, ENC_BIG_ENDIAN);
2220 proto_tree_add_item(tree, hf_sflow_lag_port_stats_unknownrx, tvb, offset, 4, ENC_BIG_ENDIAN);
2223 proto_tree_add_item(tree, hf_sflow_lag_port_stats_illegalrx, tvb, offset, 4, ENC_BIG_ENDIAN);
2226 proto_tree_add_item(tree, hf_sflow_lag_port_stats_lacpdustx, tvb, offset, 4, ENC_BIG_ENDIAN);
2229 proto_tree_add_item(tree, hf_sflow_lag_port_stats_markerpdustx, tvb, offset, 4, ENC_BIG_ENDIAN);
2232 proto_tree_add_item(tree, hf_sflow_lag_port_stats_markerresponsepdustx, tvb, offset, 4, ENC_BIG_ENDIAN);
2236 /* Code to dissect the sflow v2/4/5 samples */
2238 dissect_sflow_245_samples(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint offset, guint32 version) {
2239 proto_tree *sflow_245_sample_tree;
2240 proto_item *ti; /* tree item */
2241 guint32 sample_type, enterprise, format, length;
2243 /* decide what kind of sample it is. */
2244 sample_type = tvb_get_ntohl(tvb, offset);
2246 enterprise = sample_type >> 12;
2247 format = sample_type & 0x00000fff;
2249 if (enterprise == ENTERPRISE_DEFAULT) { /* only accept default enterprise 0 (InMon sFlow) */
2250 sflow_245_sample_tree = proto_tree_add_subtree(tree, tvb, offset, -1, ett_sflow_245_sample, &ti,
2251 val_to_str_const(format, sflow_245_sampletype, "Unknown sample format"));
2253 proto_tree_add_uint_format_value(sflow_245_sample_tree, hf_sflow_enterprise, tvb, offset, 4, enterprise, "standard sFlow (%u)", enterprise);
2254 proto_tree_add_item(sflow_245_sample_tree, hf_sflow_245_sampletype12, tvb, offset, 4, ENC_BIG_ENDIAN);
2257 length = tvb_get_ntohl(tvb, offset);
2258 proto_tree_add_item(sflow_245_sample_tree, hf_sflow_5_sample_length, tvb, offset, 4, ENC_BIG_ENDIAN);
2263 dissect_sflow_5_flow_sample(tvb, pinfo, sflow_245_sample_tree, offset, ti);
2265 case COUNTERSSAMPLE:
2266 dissect_sflow_5_counters_sample(tvb, sflow_245_sample_tree, offset, ti);
2268 case EXPANDED_FLOWSAMPLE:
2269 dissect_sflow_5_expanded_flow_sample(tvb, pinfo, sflow_245_sample_tree, offset, ti);
2271 case EXPANDED_COUNTERSSAMPLE:
2272 dissect_sflow_5_expanded_counters_sample(tvb, sflow_245_sample_tree, offset, ti);
2274 case LAG_PORT_STATS:
2275 dissect_sflow_5_lag_port_stats(tvb, sflow_245_sample_tree, offset, ti);
2280 /* Make sure the length doesn't run past the end of the packet */
2281 tvb_ensure_bytes_exist(tvb, offset, length);
2282 /* current offset points to sample length field, which is 4 bytes from the beginning of the packet*/
2284 } else { /* unknown enterprise format, what to do?? */
2285 sflow_245_sample_tree = proto_tree_add_subtree(tree, tvb, offset, -1,
2286 ett_sflow_245_sample, &ti, "Unknown enterprise format");
2287 proto_tree_add_uint_format_value(sflow_245_sample_tree, hf_sflow_enterprise, tvb, offset, 4,
2288 enterprise, "Non-standard sFlow (%u)", enterprise);
2289 offset = tvb_captured_length(tvb);
2292 } else { /* version 2 or 4 */
2293 sflow_245_sample_tree = proto_tree_add_subtree(tree, tvb, offset, -1, ett_sflow_245_sample, &ti,
2294 val_to_str_const(sample_type, sflow_245_sampletype, "Unknown sample type"));
2296 proto_tree_add_item(sflow_245_sample_tree, hf_sflow_245_sampletype, tvb, offset, 4, ENC_BIG_ENDIAN);
2299 switch (sample_type) {
2301 offset = dissect_sflow_24_flow_sample(tvb, pinfo, sflow_245_sample_tree, offset, ti);
2303 case COUNTERSSAMPLE:
2304 offset = dissect_sflow_24_counters_sample(tvb, sflow_245_sample_tree, offset, ti);
2310 proto_item_set_end(ti, tvb, offset);
2315 /* Code to actually dissect the packets */
2317 dissect_sflow_245(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
2319 /* Set up structures needed to add the protocol subtree and manage it */
2321 proto_tree *sflow_245_tree;
2322 guint32 version, sub_agent_id, seqnum;
2323 address addr_details;
2324 int sflow_addr_type;
2325 struct sflow_address_type addr_type;
2331 addr_type.hf_addr_v4 = hf_sflow_agent_address_v4;
2332 addr_type.hf_addr_v6 = hf_sflow_agent_address_v6;
2335 * We fetch the version and address type so that we can determine,
2336 * ahead of time, whether this is an sFlow packet or not, before
2337 * we do *anything* to the columns or the protocol tree.
2339 * XXX - we might want to deem this "not sFlow" if we don't have at
2340 * least 8 bytes worth of data.
2342 version = tvb_get_ntohl(tvb, offset);
2343 if (version != 2 && version != 4 && version != 5) {
2344 /* Unknown version; assume it's not an sFlow packet. */
2348 sflow_addr_type = tvb_get_ntohl(tvb, offset + 4);
2349 switch (sflow_addr_type) {
2350 case ADDR_TYPE_UNKNOWN:
2351 case ADDR_TYPE_IPV4:
2352 case ADDR_TYPE_IPV6:
2357 * Address type we don't know about; assume it's not an sFlow
2362 /* Make entries in Protocol column and Info column on summary display */
2363 col_set_str(pinfo->cinfo, COL_PROTOCOL, "sFlow");
2365 /* create display subtree for the protocol */
2366 ti = proto_tree_add_item(tree, proto_sflow, tvb, 0, -1, ENC_NA);
2368 sflow_245_tree = proto_item_add_subtree(ti, ett_sflow_245);
2370 col_add_fstr(pinfo->cinfo, COL_INFO, "V%u", version);
2371 proto_tree_add_item(sflow_245_tree, hf_sflow_version, tvb, offset, 4, ENC_BIG_ENDIAN);
2374 proto_tree_add_item(sflow_245_tree, hf_sflow_agent_address_type, tvb, offset, 4, ENC_BIG_ENDIAN);
2375 offset = dissect_sflow_245_address_type(tvb, pinfo, sflow_245_tree, offset,
2376 &addr_type, &addr_details);
2377 switch (sflow_addr_type) {
2378 case ADDR_TYPE_UNKNOWN:
2380 case ADDR_TYPE_IPV4:
2381 case ADDR_TYPE_IPV6:
2382 col_append_fstr(pinfo->cinfo, COL_INFO, ", agent %s", address_to_str(wmem_packet_scope(), &addr_details));
2387 sub_agent_id = tvb_get_ntohl(tvb, offset);
2388 col_append_fstr(pinfo->cinfo, COL_INFO, ", sub-agent ID %u", sub_agent_id);
2389 proto_tree_add_uint(sflow_245_tree, hf_sflow_5_sub_agent_id, tvb, offset, 4, sub_agent_id);
2392 seqnum = tvb_get_ntohl(tvb, offset);
2393 col_append_fstr(pinfo->cinfo, COL_INFO, ", seq %u", seqnum);
2394 proto_tree_add_uint(sflow_245_tree, hf_sflow_245_seqnum, tvb, offset, 4, seqnum);
2396 proto_tree_add_item(sflow_245_tree, hf_sflow_245_sysuptime, tvb, offset, 4, ENC_BIG_ENDIAN);
2398 numsamples = tvb_get_ntohl(tvb, offset);
2399 col_append_fstr(pinfo->cinfo, COL_INFO, ", %u samples", numsamples);
2400 proto_tree_add_uint(sflow_245_tree, hf_sflow_245_numsamples, tvb, offset, 4, numsamples);
2403 /* Ok, we're now at the end of the sflow_245 datagram header;
2404 * everything from here out should be samples. Loop over
2405 * the expected number of samples, and pass them to the appropriate
2409 /* limit number of samples to 255 to avoid huge number of loops
2410 * caused by corrupted data */
2411 for (i = 0; i < (numsamples & 0x000000ff); i++) {
2412 offset = dissect_sflow_245_samples(tvb, pinfo, sflow_245_tree, offset, version);
2415 return tvb_captured_length(tvb);
2418 /* Register the protocol with Wireshark */
2421 proto_register_sflow(void) {
2423 module_t *sflow_245_module;
2425 /* Setup list of header fields See Section 1.6.1 for details*/
2426 static hf_register_info hf[] = {
2427 { &hf_sflow_version,
2428 { "Datagram version", "sflow_245.version",
2429 FT_UINT32, BASE_DEC, NULL, 0x0,
2430 "sFlow datagram version", HFILL}},
2431 { &hf_sflow_agent_address_type,
2432 { "Agent address type", "sflow_245.agenttype",
2433 FT_UINT32, BASE_DEC, VALS(sflow_agent_address_types), 0x0,
2434 "sFlow agent address type", HFILL}},
2435 { &hf_sflow_agent_address_v4,
2436 { "Agent address", "sflow_245.agent",
2437 FT_IPv4, BASE_NONE, NULL, 0x0,
2438 "sFlow Agent IP address", HFILL}},
2439 { &hf_sflow_agent_address_v6,
2440 { "Agent address", "sflow_245.agent.v6",
2441 FT_IPv6, BASE_NONE, NULL, 0x0,
2442 "sFlow Agent IPv6 address", HFILL}},
2443 { &hf_sflow_5_sub_agent_id,
2444 { "Sub-agent ID", "sflow_245.sub_agent_id",
2445 FT_UINT32, BASE_DEC, NULL, 0x0,
2446 "sFlow sub-agent ID", HFILL}},
2447 { &hf_sflow_5_sample_length,
2448 { "Sample length (byte)", "sflow_5.sample_length",
2449 FT_UINT32, BASE_DEC, NULL, 0x0,
2450 "sFlow sample length", HFILL}},
2451 { &hf_sflow_5_flow_data_length,
2452 { "Flow data length (byte)", "sflow_5.flow_data_length",
2453 FT_UINT32, BASE_DEC, NULL, 0x0,
2454 "sFlow flow data length", HFILL}},
2456 { &hf_sflow_5_counters_data_length,
2457 { "Counters data length (byte)", "sflow_5.counter_data_length",
2458 FT_UINT32, BASE_DEC, NULL, 0x0,
2459 "sFlow counters data length", HFILL}},
2461 { &hf_sflow_245_seqnum,
2462 { "Sequence number", "sflow_245.sequence_number",
2463 FT_UINT32, BASE_DEC, NULL, 0x0,
2464 "sFlow datagram sequence number", HFILL}},
2465 { &hf_sflow_245_sysuptime,
2466 { "SysUptime", "sflow_245.sysuptime",
2467 FT_UINT32, BASE_DEC, NULL, 0x0,
2468 "System Uptime", HFILL}},
2469 { &hf_sflow_245_numsamples,
2470 { "NumSamples", "sflow_245.numsamples",
2471 FT_UINT32, BASE_DEC, NULL, 0x0,
2472 "Number of samples in sFlow datagram", HFILL}},
2473 { &hf_sflow_245_sampletype,
2474 { "sFlow sample type", "sflow_245.sampletype",
2475 FT_UINT32, BASE_DEC, VALS(sflow_245_sampletype), 0x0,
2476 "Type of sFlow sample", HFILL}},
2477 { &hf_sflow_245_sampletype12,
2478 { "sFlow sample type", "sflow_245.sampletype",
2479 FT_UINT32, BASE_DEC, VALS(sflow_245_sampletype), 0x00000FFF,
2480 "Type of sFlow sample", HFILL}},
2482 { &hf_sflow_5_ieee80211_version,
2483 { "Version", "sflow_245.ieee80211_version",
2484 FT_UINT32, BASE_DEC, VALS(sflow_5_ieee80211_versions), 0x0,
2485 "IEEE 802.11 Version", HFILL}},
2487 { &hf_sflow_245_ipv4_precedence_type,
2488 { "Precedence", "sflow_245.ipv4_precedence_type",
2489 FT_UINT8, BASE_DEC, VALS(sflow_245_ipv4_precedence_types), 0xE0,
2490 "IPv4 Precedence Type", HFILL}},
2491 { &hf_sflow_5_flow_record_format,
2492 { "Format", "sflow_245.flow_record_format",
2493 FT_UINT32, BASE_DEC | BASE_EXT_STRING, &sflow_5_flow_record_type_ext, 0x0,
2494 "Format of sFlow flow record", HFILL}},
2495 { &hf_sflow_5_counters_record_format,
2496 { "Format", "sflow_245.counters_record_format",
2497 FT_UINT32, BASE_DEC, VALS(sflow_5_counters_record_type), 0x00000FFF,
2498 "Format of sFlow counters record", HFILL}},
2499 { &hf_sflow_245_header_protocol,
2500 { "Header protocol", "sflow_245.header_protocol",
2501 FT_UINT32, BASE_DEC | BASE_EXT_STRING, &sflow_245_header_protocol_ext, 0x0,
2502 "Protocol of sampled header", HFILL}},
2503 { &hf_sflow_245_header,
2504 { "Header of sampled packet", "sflow_245.header",
2505 FT_BYTES, BASE_NONE, NULL, 0x0,
2506 "Data from sampled header", HFILL}},
2507 { &hf_sflow_245_packet_information_type,
2508 { "Sample type", "sflow_245.packet_information_type",
2509 FT_UINT32, BASE_DEC, VALS(sflow_245_packet_information_type), 0x0,
2510 "Type of sampled information", HFILL}},
2511 { &hf_sflow_245_extended_information_type,
2512 { "Extended information type", "sflow_245.extended_information_type",
2513 FT_UINT32, BASE_DEC, VALS(sflow_245_extended_data_types), 0x0,
2514 "Type of extended information", HFILL}},
2515 { &hf_sflow_245_vlan_in,
2516 { "Incoming 802.1Q VLAN", "sflow_245.vlan.in",
2517 FT_UINT32, BASE_DEC, NULL, 0x0,
2518 "Incoming VLAN ID", HFILL}},
2519 { &hf_sflow_245_vlan_out,
2520 { "Outgoing 802.1Q VLAN", "sflow_245.vlan.out",
2521 FT_UINT32, BASE_DEC, NULL, 0x0,
2522 "Outgoing VLAN ID", HFILL}},
2523 { &hf_sflow_245_pri_in,
2524 { "Incoming 802.1p priority", "sflow_245.pri.in",
2525 FT_UINT32, BASE_DEC, NULL, 0x0,
2527 { &hf_sflow_245_pri_out,
2528 { "Outgoing 802.1p priority", "sflow_245.pri.out",
2529 FT_UINT32, BASE_DEC, NULL, 0x0,
2531 { &hf_sflow_245_nexthop_v4,
2532 { "Next hop", "sflow_245.nexthop",
2533 FT_IPv4, BASE_NONE, NULL, 0x0,
2534 "Next hop address", HFILL}},
2535 { &hf_sflow_245_ipv4_src,
2536 { "Source IP address", "sflow_245.ipv4_src",
2537 FT_IPv4, BASE_NONE, NULL, 0x0,
2538 "Source IPv4 address", HFILL}},
2539 { &hf_sflow_245_ipv4_dst,
2540 { "Destination IP address", "sflow_245.ipv4_dst",
2541 FT_IPv4, BASE_NONE, NULL, 0x0,
2542 "Destination IPv4 address", HFILL}},
2543 { &hf_sflow_245_nexthop_v6,
2544 { "Next hop", "sflow_245.nexthop.v6",
2545 FT_IPv6, BASE_NONE, NULL, 0x0,
2546 "Next hop address", HFILL}},
2547 { &hf_sflow_245_ipv6_src,
2548 { "Source IP address", "sflow_245.ipv6_src",
2549 FT_IPv6, BASE_NONE, NULL, 0x0,
2550 "Source IPv6 address", HFILL}},
2551 { &hf_sflow_245_ipv6_dst,
2552 { "Destination IP address", "sflow_245.ipv6_dst",
2553 FT_IPv6, BASE_NONE, NULL, 0x0,
2554 "Destination IPv6 address", HFILL}},
2555 { &hf_sflow_245_nexthop_src_mask,
2556 { "Next hop source mask", "sflow_245.nexthop.src_mask",
2557 FT_UINT32, BASE_DEC, NULL, 0x0,
2558 "Next hop source mask bits", HFILL}},
2559 { &hf_sflow_245_nexthop_dst_mask,
2560 { "Next hop destination mask", "sflow_245.nexthop.dst_mask",
2561 FT_UINT32, BASE_DEC, NULL, 0x0,
2562 "Next hop destination mask bits", HFILL}},
2563 { &hf_sflow_245_ifindex,
2564 { "Interface index", "sflow_245.ifindex",
2565 FT_UINT32, BASE_DEC, NULL, 0x0,
2568 { "AS Router", "sflow_245.as",
2569 FT_UINT32, BASE_DEC, NULL, 0x0,
2570 "Autonomous System of Router", HFILL}},
2571 { &hf_sflow_245_src_as,
2572 { "AS Source", "sflow_245.srcAS",
2573 FT_UINT32, BASE_DEC, NULL, 0x0,
2574 "Autonomous System of Source", HFILL}},
2575 { &hf_sflow_245_src_peer_as,
2576 { "AS Peer", "sflow_245.peerAS",
2577 FT_UINT32, BASE_DEC, NULL, 0x0,
2578 "Autonomous System of Peer", HFILL}},
2579 { &hf_sflow_245_dst_as_entries,
2580 { "AS Destinations", "sflow_245.dstASentries",
2581 FT_UINT32, BASE_DEC, NULL, 0x0,
2582 "Autonomous System destinations", HFILL}},
2583 { &hf_sflow_245_dst_as,
2584 { "AS Destination", "sflow_245.dstAS",
2585 FT_UINT32, BASE_DEC, NULL, 0x0,
2586 "Autonomous System destination", HFILL}},
2587 /* Needed for sFlow >= 4. If I had a capture to test... */
2588 { &hf_sflow_245_community_entries,
2589 { "Gateway Communities", "sflow_245.communityEntries",
2590 FT_UINT32, BASE_DEC, NULL, 0x0,
2593 { &hf_sflow_245_community,
2594 { "Gateway Community", "sflow_245.community",
2595 FT_UINT32, BASE_DEC, NULL, 0x0,
2596 "Gateway Communities", HFILL}},
2598 { &hf_sflow_245_localpref,
2599 { "localpref", "sflow_245.localpref",
2600 FT_UINT32, BASE_DEC, NULL, 0x0,
2601 "Local preferences of AS route", HFILL}},
2603 { &hf_sflow_245_iftype,
2604 { "Interface Type", "sflow_245.iftype",
2605 FT_UINT32, BASE_DEC, NULL, 0x0,
2607 { &hf_sflow_245_ifspeed,
2608 { "Interface Speed", "sflow_245.ifspeed",
2609 FT_UINT64, BASE_DEC, NULL, 0x0,
2611 { &hf_sflow_245_ifdirection,
2612 { "Interface Direction", "sflow_245.ifdirection",
2613 FT_UINT32, BASE_DEC, VALS(sflow_ifdirection_vals), 0x0,
2615 { &hf_sflow_245_ifadmin_status,
2616 { "IfAdminStatus", "sflow_245.ifadmin_status",
2617 FT_BOOLEAN, 32, TFS(&tfs_up_down), 0x00000001,
2619 { &hf_sflow_245_ifoper_status,
2620 { "IfOperStatus", "sflow_245.ifoper_status",
2621 FT_BOOLEAN, 32, TFS(&tfs_up_down), 0x00000002,
2623 { &hf_sflow_245_ifinoct,
2624 { "Input Octets", "sflow_245.ifinoct",
2625 FT_UINT64, BASE_DEC, NULL, 0x0,
2627 { &hf_sflow_245_ifinpkt,
2628 { "Input Packets", "sflow_245.ifinpkt",
2629 FT_UINT32, BASE_DEC, NULL, 0x0,
2631 { &hf_sflow_245_ifinmcast,
2632 { "Input Multicast Packets", "sflow_245.ifinmcast",
2633 FT_UINT32, BASE_DEC, NULL, 0x0,
2635 { &hf_sflow_245_ifinbcast,
2636 { "Input Broadcast Packets", "sflow_245.ifinbcast",
2637 FT_UINT32, BASE_DEC, NULL, 0x0,
2639 { &hf_sflow_245_ifindisc,
2640 { "Input Discarded Packets", "sflow_245.ifindisc",
2641 FT_UINT32, BASE_DEC, NULL, 0x0,
2643 { &hf_sflow_245_ifinerr,
2644 { "Input Errors", "sflow_245.ifinerr",
2645 FT_UINT32, BASE_DEC, NULL, 0x0,
2647 { &hf_sflow_245_ifinunk,
2648 { "Input Unknown Protocol Packets", "sflow_245.ifinunk",
2649 FT_UINT32, BASE_DEC, NULL, 0x0,
2651 { &hf_sflow_245_ifoutoct,
2652 { "Output Octets", "sflow_245.ifoutoct",
2653 FT_UINT64, BASE_DEC, NULL, 0x0,
2655 { &hf_sflow_245_ifoutpkt,
2656 { "Output Packets", "sflow_245.ifoutpkt",
2657 FT_UINT32, BASE_DEC, NULL, 0x0,
2659 { &hf_sflow_245_ifoutmcast,
2660 { "Output Multicast Packets", "sflow_245.ifoutmcast",
2661 FT_UINT32, BASE_DEC, NULL, 0x0,
2663 { &hf_sflow_245_ifoutbcast,
2664 { "Output Broadcast Packets", "sflow_245.ifoutbcast",
2665 FT_UINT32, BASE_DEC, NULL, 0x0,
2667 { &hf_sflow_245_ifoutdisc,
2668 { "Output Discarded Packets", "sflow_245.ifoutdisc",
2669 FT_UINT32, BASE_DEC, NULL, 0x0,
2671 { &hf_sflow_245_ifouterr,
2672 { "Output Errors", "sflow_245.ifouterr",
2673 FT_UINT32, BASE_DEC, NULL, 0x0,
2675 { &hf_sflow_245_ifpromisc,
2676 { "Promiscuous Mode", "sflow_245.ifpromisc",
2677 FT_UINT32, BASE_DEC, NULL, 0x0,
2679 { &hf_sflow_245_dot3StatsAlignmentErrors,
2680 { "Alignment Errors", "sflow_245.dot3StatsAlignmentErrors",
2681 FT_UINT32, BASE_DEC, NULL, 0x0,
2682 "dot3 Stats Alignment Errors", HFILL}},
2683 { &hf_sflow_245_dot3StatsFCSErrors,
2684 { "FCS Errors", "sflow_245.dot3StatsFCSErrors",
2685 FT_UINT32, BASE_DEC, NULL, 0x0,
2686 "dot3 Stats FCS Errors", HFILL}},
2687 { &hf_sflow_245_dot3StatsSingleCollisionFrames,
2688 { "Single Collision Frames", "sflow_245.dot3StatsSingleCollisionFrames",
2689 FT_UINT32, BASE_DEC, NULL, 0x0,
2690 "dot3 Stats Single Collision Frames", HFILL}},
2691 { &hf_sflow_245_dot3StatsMultipleCollisionFrames,
2692 { "Multiple Collision Frames", "sflow_245.dot3StatsMultipleCollisionFrames",
2693 FT_UINT32, BASE_DEC, NULL, 0x0,
2694 "dot3 Stats Multiple Collision Frames", HFILL}},
2695 { &hf_sflow_245_dot3StatsSQETestErrors,
2696 { "SQE Test Errors", "sflow_245.dot3StatsSQETestErrors",
2697 FT_UINT32, BASE_DEC, NULL, 0x0,
2698 "dot3 Stats SQE Test Errors", HFILL}},
2699 { &hf_sflow_245_dot3StatsDeferredTransmissions,
2700 { "Deferred Transmissions", "sflow_245.dot3StatsDeferredTransmissions",
2701 FT_UINT32, BASE_DEC, NULL, 0x0,
2702 "dot3 Stats Deferred Transmissions", HFILL}},
2703 { &hf_sflow_245_dot3StatsLateCollisions,
2704 { "Late Collisions", "sflow_245.dot3StatsLateCollisions",
2705 FT_UINT32, BASE_DEC, NULL, 0x0,
2706 "dot3 Stats Late Collisions", HFILL}},
2707 { &hf_sflow_245_dot3StatsExcessiveCollisions,
2708 { "Excessive Collisions", "sflow_245.dot3StatsExcessiveCollisions",
2709 FT_UINT32, BASE_DEC, NULL, 0x0,
2710 "dot3 Stats Excessive Collisions", HFILL}},
2711 { &hf_sflow_245_dot3StatsInternalMacTransmitErrors,
2712 { "Internal Mac Transmit Errors", "sflow_245.dot3StatsInternalMacTransmitErrors",
2713 FT_UINT32, BASE_DEC, NULL, 0x0,
2714 "dot3 Stats Internal Mac Transmit Errors", HFILL}},
2715 { &hf_sflow_245_dot3StatsCarrierSenseErrors,
2716 { "Carrier Sense Errors", "sflow_245.dot3StatsCarrierSenseErrors",
2717 FT_UINT32, BASE_DEC, NULL, 0x0,
2718 "dot3 Stats Carrier Sense Errors", HFILL}},
2719 { &hf_sflow_245_dot3StatsFrameTooLongs,
2720 { "Frame Too Longs", "sflow_245.dot3StatsFrameTooLongs",
2721 FT_UINT32, BASE_DEC, NULL, 0x0,
2722 "dot3 Stats Frame Too Longs", HFILL}},
2723 { &hf_sflow_245_dot3StatsInternalMacReceiveErrors,
2724 { "Internal Mac Receive Errors", "sflow_245.dot3StatsInternalMacReceiveErrors",
2725 FT_UINT32, BASE_DEC, NULL, 0x0,
2726 "dot3 Stats Internal Mac Receive Errors", HFILL}},
2727 { &hf_sflow_245_dot3StatsSymbolErrors,
2728 { "Symbol Errors", "sflow_245.dot3StatsSymbolErrors",
2729 FT_UINT32, BASE_DEC, NULL, 0x0,
2730 "dot3 Stats Symbol Errors", HFILL}},
2731 { &hf_sflow_245_dot5StatsLineErrors,
2732 { "Line Errors", "sflow_245.dot5StatsLineErrors",
2733 FT_UINT32, BASE_DEC, NULL, 0x0,
2734 "dot5 Stats Line Errors", HFILL}},
2735 { &hf_sflow_245_dot5StatsBurstErrors,
2736 { "Burst Errors", "sflow_245.dot5StatsBurstErrors",
2737 FT_UINT32, BASE_DEC, NULL, 0x0,
2738 "dot5 Stats Burst Errors", HFILL}},
2739 { &hf_sflow_245_dot5StatsACErrors,
2740 { "AC Errors", "sflow_245.dot5StatsACErrors",
2741 FT_UINT32, BASE_DEC, NULL, 0x0,
2742 "dot5 Stats AC Errors", HFILL}},
2743 { &hf_sflow_245_dot5StatsAbortTransErrors,
2744 { "Abort Trans Errors", "sflow_245.dot5StatsAbortTransErrors",
2745 FT_UINT32, BASE_DEC, NULL, 0x0,
2746 "dot5 Stats Abort Trans Errors", HFILL}},
2747 { &hf_sflow_245_dot5StatsInternalErrors,
2748 { "Internal Errors", "sflow_245.dot5StatsInternalErrors",
2749 FT_UINT32, BASE_DEC, NULL, 0x0,
2750 "dot5 Stats Internal Errors", HFILL}},
2751 { &hf_sflow_245_dot5StatsLostFrameErrors,
2752 { "Lost Frame Errors", "sflow_245.dot5StatsLostFrameErrors",
2753 FT_UINT32, BASE_DEC, NULL, 0x0,
2754 "dot5 Stats Lost Frame Errors", HFILL}},
2755 { &hf_sflow_245_dot5StatsReceiveCongestions,
2756 { "Receive Congestions", "sflow_245.dot5StatsReceiveCongestions",
2757 FT_UINT32, BASE_DEC, NULL, 0x0,
2758 "dot5 Stats Receive Congestions", HFILL}},
2759 { &hf_sflow_245_dot5StatsFrameCopiedErrors,
2760 { "Frame Copied Errors", "sflow_245.dot5StatsFrameCopiedErrors",
2761 FT_UINT32, BASE_DEC, NULL, 0x0,
2762 "dot5 Stats Frame Copied Errors", HFILL}},
2763 { &hf_sflow_245_dot5StatsTokenErrors,
2764 { "Token Errors", "sflow_245.dot5StatsTokenErrors",
2765 FT_UINT32, BASE_DEC, NULL, 0x0,
2766 "dot5 Stats Token Errors", HFILL}},
2767 { &hf_sflow_245_dot5StatsSoftErrors,
2768 { "Soft Errors", "sflow_245.dot5StatsSoftErrors",
2769 FT_UINT32, BASE_DEC, NULL, 0x0,
2770 "dot5 Stats Soft Errors", HFILL}},
2771 { &hf_sflow_245_dot5StatsHardErrors,
2772 { "Hard Errors", "sflow_245.dot5StatsHardErrors",
2773 FT_UINT32, BASE_DEC, NULL, 0x0,
2774 "dot5 Stats Hard Errors", HFILL}},
2775 { &hf_sflow_245_dot5StatsSignalLoss,
2776 { "Signal Loss", "sflow_245.dot5StatsSignalLoss",
2777 FT_UINT32, BASE_DEC, NULL, 0x0,
2778 "dot5 Stats Signal Loss", HFILL}},
2779 { &hf_sflow_245_dot5StatsTransmitBeacons,
2780 { "Transmit Beacons", "sflow_245.dot5StatsTransmitBeacons",
2781 FT_UINT32, BASE_DEC, NULL, 0x0,
2782 "dot5 Stats Transmit Beacons", HFILL}},
2783 { &hf_sflow_245_dot5StatsRecoveries,
2784 { "Recoveries", "sflow_245.dot5StatsRecoveries",
2785 FT_UINT32, BASE_DEC, NULL, 0x0,
2786 "dot5 Stats Recoveries", HFILL}},
2787 { &hf_sflow_245_dot5StatsLobeWires,
2788 { "Lobe Wires", "sflow_245.dot5StatsLobeWires",
2789 FT_UINT32, BASE_DEC, NULL, 0x0,
2790 "dot5 Stats Lobe Wires", HFILL}},
2791 { &hf_sflow_245_dot5StatsRemoves,
2792 { "Removes", "sflow_245.dot5StatsRemoves",
2793 FT_UINT32, BASE_DEC, NULL, 0x0,
2794 "dot5 Stats Removes", HFILL}},
2795 { &hf_sflow_245_dot5StatsSingles,
2796 { "Singles", "sflow_245.dot5StatsSingles",
2797 FT_UINT32, BASE_DEC, NULL, 0x0,
2798 "dot5 Stats Singles", HFILL}},
2799 { &hf_sflow_245_dot5StatsFreqErrors,
2800 { "Freq Errors", "sflow_245.dot5StatsFreqErrors",
2801 FT_UINT32, BASE_DEC, NULL, 0x0,
2802 "dot5 Stats Freq Errors", HFILL}},
2803 { &hf_sflow_245_dot12InHighPriorityFrames,
2804 { "In High Priority Frames", "sflow_245.dot12InHighPriorityFrames",
2805 FT_UINT32, BASE_DEC, NULL, 0x0,
2806 "dot12 Input High Priority Frames", HFILL}},
2807 { &hf_sflow_245_dot12InHighPriorityOctets,
2808 { "In High Priority Octets", "sflow_245.dot12InHighPriorityOctets",
2809 FT_UINT64, BASE_DEC, NULL, 0x0,
2810 "dot12 Input High Priority Octets", HFILL}},
2811 { &hf_sflow_245_dot12InNormPriorityFrames,
2812 { "In Normal Priority Frames", "sflow_245.dot12InNormPriorityFrames",
2813 FT_UINT32, BASE_DEC, NULL, 0x0,
2814 "dot12 Input Normal Priority Frames", HFILL}},
2815 { &hf_sflow_245_dot12InNormPriorityOctets,
2816 { "In Normal Priority Octets", "sflow_245.dot12InNormPriorityOctets",
2817 FT_UINT64, BASE_DEC, NULL, 0x0,
2818 "dot12 Input Normal Priority Octets", HFILL}},
2819 { &hf_sflow_245_dot12InIPMErrors,
2820 { "In IPM Errors", "sflow_245.dot12InIPMErrors",
2821 FT_UINT32, BASE_DEC, NULL, 0x0,
2822 "dot12 Input IPM Errors", HFILL}},
2823 { &hf_sflow_245_dot12InOversizeFrameErrors,
2824 { "In Oversize Frame Errors", "sflow_245.dot12InOversizeFrameErrors",
2825 FT_UINT32, BASE_DEC, NULL, 0x0,
2826 "dot12 Input Oversize Frame Errors", HFILL}},
2827 { &hf_sflow_245_dot12InDataErrors,
2828 { "In Data Errors", "sflow_245.dot12InDataErrors",
2829 FT_UINT32, BASE_DEC, NULL, 0x0,
2830 "dot12 Input Data Errors", HFILL}},
2831 { &hf_sflow_245_dot12InNullAddressedFrames,
2832 { "In Null Addressed Frames", "sflow_245.dot12InNullAddressedFrames",
2833 FT_UINT32, BASE_DEC, NULL, 0x0,
2834 "dot12 Input Null Addressed Frames", HFILL}},
2835 { &hf_sflow_245_dot12OutHighPriorityFrames,
2836 { "Out High Priority Frames", "sflow_245.dot12OutHighPriorityFrames",
2837 FT_UINT32, BASE_DEC, NULL, 0x0,
2838 "dot12 Output High Priority Frames", HFILL}},
2839 { &hf_sflow_245_dot12OutHighPriorityOctets,
2840 { "Out High Priority Octets", "sflow_245.dot12OutHighPriorityOctets",
2841 FT_UINT64, BASE_DEC, NULL, 0x0,
2842 "dot12 Out High Priority Octets", HFILL}},
2843 { &hf_sflow_245_dot12TransitionIntoTrainings,
2844 { "Transition Into Trainings", "sflow_245.dot12TransitionIntoTrainings",
2845 FT_UINT32, BASE_DEC, NULL, 0x0,
2846 "dot12 Transition Into Trainings", HFILL}},
2847 { &hf_sflow_245_dot12HCInHighPriorityOctets,
2848 { "HC In High Priority Octets", "sflow_245.dot12HCInHighPriorityOctets",
2849 FT_UINT64, BASE_DEC, NULL, 0x0,
2850 "dot12 HC Input High Priority Octets", HFILL}},
2851 { &hf_sflow_245_dot12HCInNormPriorityOctets,
2852 { "HC In Normal Priority Octets", "sflow_245.dot12HCInNormPriorityOctets",
2853 FT_UINT64, BASE_DEC, NULL, 0x0,
2854 "dot12 HC Input Normal Priority Octets", HFILL}},
2855 { &hf_sflow_245_dot12HCOutHighPriorityOctets,
2856 { "HC Out High Priority Octets", "sflow_245.dot12HCOutHighPriorityOctets",
2857 FT_UINT64, BASE_DEC, NULL, 0x0,
2858 "dot12 HC Output High Priority Octets", HFILL}},
2859 { &hf_sflow_245_vlan_id,
2860 { "VLAN ID", "sflow_245.vlan_id",
2861 FT_UINT32, BASE_DEC, NULL, 0x0,
2863 { &hf_sflow_245_octets,
2864 { "Octets", "sflow_245.octets",
2865 FT_UINT64, BASE_DEC, NULL, 0x0,
2867 { &hf_sflow_245_ucastPkts,
2868 { "Unicast Packets", "sflow_245.ucastPkts",
2869 FT_UINT32, BASE_DEC, NULL, 0x0,
2871 { &hf_sflow_245_multicastPkts,
2872 { "Multicast Packets", "sflow_245.multicastPkts",
2873 FT_UINT32, BASE_DEC, NULL, 0x0,
2875 { &hf_sflow_245_broadcastPkts,
2876 { "Broadcast Packets", "sflow_245.broadcastPkts",
2877 FT_UINT32, BASE_DEC, NULL, 0x0,
2879 { &hf_sflow_245_discards,
2880 { "Discards", "sflow_245.discards",
2881 FT_UINT32, BASE_DEC, NULL, 0x0,
2883 { &hf_sflow_5_dot11TransmittedFragmentCount,
2884 { "Transmitted Fragment Count", "sflow_5.dot11TransmittedFragmentCount",
2885 FT_UINT32, BASE_DEC, NULL, 0x0,
2887 { &hf_sflow_5_dot11MulticastTransmittedFrameCount,
2888 { "Multicast Transmitted Frame Count", "sflow_5.dot11MulticastTransmittedFrameCount",
2889 FT_UINT32, BASE_DEC, NULL, 0x0,
2891 { &hf_sflow_5_dot11FailedCount,
2892 { "Failed Count", "sflow_5.dot11FailedCount",
2893 FT_UINT32, BASE_DEC, NULL, 0x0,
2895 { &hf_sflow_5_dot11RetryCount,
2896 { "Retry Count", "sflow_5.dot11RetryCount",
2897 FT_UINT32, BASE_DEC, NULL, 0x0,
2899 { &hf_sflow_5_dot11MultipleRetryCount,
2900 { "Multiple Retry Count", "sflow_5.dot11MultipleRetryCount",
2901 FT_UINT32, BASE_DEC, NULL, 0x0,
2903 { &hf_sflow_5_dot11FrameDuplicateCount,
2904 { "Frame Duplicate Count", "sflow_5.dot11FrameDuplicateCount",
2905 FT_UINT32, BASE_DEC, NULL, 0x0,
2907 { &hf_sflow_5_dot11RTSSuccessCount,
2908 { "RTS Success Count", "sflow_5.dot11RTSSuccessCount",
2909 FT_UINT32, BASE_DEC, NULL, 0x0,
2911 { &hf_sflow_5_dot11RTSFailureCount,
2912 { "Failure Count", "sflow_5.dot11RTSFailureCount",
2913 FT_UINT32, BASE_DEC, NULL, 0x0,
2915 { &hf_sflow_5_dot11ACKFailureCount,
2916 { "ACK Failure Count", "sflow_5.dot11ACKFailureCount",
2917 FT_UINT32, BASE_DEC, NULL, 0x0,
2919 { &hf_sflow_5_dot11ReceivedFragmentCount,
2920 { "Received Fragment Count", "sflow_5.dot11ReceivedFragmentCount",
2921 FT_UINT32, BASE_DEC, NULL, 0x0,
2923 { &hf_sflow_5_dot11MulticastReceivedFrameCount,
2924 { "Multicast Received Frame Count", "sflow_5.dot11MulticastReceivedFrameCount",
2925 FT_UINT32, BASE_DEC, NULL, 0x0,
2927 { &hf_sflow_5_dot11FCSErrorCount,
2928 { "FCS Error Count", "sflow_5.dot11FCSErrorCount",
2929 FT_UINT32, BASE_DEC, NULL, 0x0,
2931 { &hf_sflow_5_dot11TransmittedFrameCount,
2932 { "Transmitted Frame Count", "sflow_5.dot11TransmittedFrameCount",
2933 FT_UINT32, BASE_DEC, NULL, 0x0,
2935 { &hf_sflow_5_dot11WEPUndecryptableCount,
2936 { "WEP Undecryptable Count", "sflow_5.dot11WEPUndecryptableCount",
2937 FT_UINT32, BASE_DEC, NULL, 0x0,
2939 { &hf_sflow_5_dot11QoSDiscardedFragmentCount,
2940 { "QoS Discarded Fragment Count", "sflow_5.dot11QoSDiscardedFragmentCount",
2941 FT_UINT32, BASE_DEC, NULL, 0x0,
2943 { &hf_sflow_5_dot11AssociatedStationCount,
2944 { "Associated Station Count", "sflow_5.dot11AssociatedStationCount",
2945 FT_UINT32, BASE_DEC, NULL, 0x0,
2947 { &hf_sflow_5_dot11QoSCFPollsReceivedCount,
2948 { "QoS CF Polls Received Count", "sflow_5.dot11QoSCFPollsReceivedCount",
2949 FT_UINT32, BASE_DEC, NULL, 0x0,
2951 { &hf_sflow_5_dot11QoSCFPollsUnusedCount,
2952 { "QoS CF Polls Unused Count", "sflow_5.dot11QoSCFPollsUnusedCount",
2953 FT_UINT32, BASE_DEC, NULL, 0x0,
2955 { &hf_sflow_5_dot11QoSCFPollsUnusableCount,
2956 { "QoS CF Polls Unusable Count", "sflow_5.dot11QoSCFPollsUnusableCount",
2957 FT_UINT32, BASE_DEC, NULL, 0x0,
2959 { &hf_sflow_5_dot11QoSCFPollsLostCount,
2960 { "QoS CF Polls Lost Count", "sflow_5.dot11QoSCFPollsLostCount",
2961 FT_UINT32, BASE_DEC, NULL, 0x0,
2963 { &hf_sflow_5_cpu_5s,
2964 { "5s CPU Load (100 = 1%)", "sflow_5.cpu_5s",
2965 FT_UINT32, BASE_DEC, NULL, 0x0,
2966 "Average CPU Load Over 5 Seconds (100 = 1%)", HFILL}},
2967 { &hf_sflow_5_cpu_1m,
2968 { "1m CPU Load (100 = 1%)", "sflow_5.cpu_1m",
2969 FT_UINT32, BASE_DEC, NULL, 0x0,
2970 "Average CPU Load Over 1 Minute (100 = 1%)", HFILL}},
2971 { &hf_sflow_5_cpu_5m,
2972 { "5m CPU Load (100 = 1%)", "sflow_5.cpu_5m",
2973 FT_UINT32, BASE_DEC, NULL, 0x0,
2974 "Average CPU Load Over 5 Minutes (100 = 1%)", HFILL}},
2975 { &hf_sflow_5_total_memory,
2976 { "Total Memory", "sflow_5.total_memory",
2977 FT_UINT64, BASE_DEC, NULL, 0x0,
2979 { &hf_sflow_5_free_memory,
2980 { "Free Memory", "sflow_5.free_memory",
2981 FT_UINT64, BASE_DEC, NULL, 0x0,
2983 { &hf_sflow_5_elapsed_time,
2984 { "Elapsed Time (ms)", "sflow_5.elapsed_time",
2985 FT_UINT32, BASE_DEC, NULL, 0x0,
2986 "Elapsed Time in ms", HFILL}},
2987 { &hf_sflow_5_on_channel_time,
2988 { "On Channel (ms)", "sflow_5.on_channel_time",
2989 FT_UINT32, BASE_DEC, NULL, 0x0,
2990 "Time in ms Spent on Channel", HFILL}},
2991 { &hf_sflow_5_on_channel_busy_time,
2992 { "On Channel Busy (ms)", "sflow_5.channel_busy_time",
2993 FT_UINT32, BASE_DEC, NULL, 0x0,
2994 "Time in ms Spent on Channel and Busy", HFILL}},
2996 /* Generated from convert_proto_tree_add_text.pl */
2997 { &hf_sflow_245_header_frame_length,
2998 { "Frame Length", "sflow_245.header.frame_length",
2999 FT_UINT32, BASE_DEC, NULL, 0x0,
3002 { &hf_sflow_245_header_payload_removed,
3003 { "Payload removed", "sflow_245.header.payload_removed",
3004 FT_UINT32, BASE_DEC, NULL, 0x0,
3007 { &hf_sflow_245_original_packet_header_length,
3008 { "Original packet length", "sflow_245.header.original_packet_header_length",
3009 FT_UINT32, BASE_DEC, NULL, 0x0,
3012 { &hf_sflow_245_extended_mpls_in_label_stack_entries,
3013 { "In Label Stack Entries", "sflow_245.extended_mpls.in_label_stack_entries",
3014 FT_UINT32, BASE_DEC, NULL, 0x0,
3017 { &hf_sflow_245_extended_mpls_in_label,
3018 { "Label", "sflow_245.extended_mpls.in_label",
3019 FT_UINT32, BASE_DEC, NULL, 0x0,
3022 { &hf_sflow_245_extended_mpls_out_label_stack_entries,
3023 { "Out Label Stack Entries", "sflow_245.extended_mpls.out_label_stack_entries",
3024 FT_UINT32, BASE_DEC, NULL, 0x0,
3027 { &hf_sflow_245_extended_mpls_out_label,
3028 { "Label", "sflow_245.extended_mpls.out_label",
3029 FT_UINT32, BASE_DEC, NULL, 0x0,
3032 { &hf_sflow_245_ethernet_length_of_mac_packet,
3033 { "Length of MAC Packet", "sflow_245.ethernet.length",
3034 FT_UINT32, BASE_DEC, NULL, 0x0,
3037 { &hf_sflow_245_ethernet_source_mac_address,
3038 { "Source MAC Address", "sflow_245.ethernet.source_mac_address",
3039 FT_ETHER, BASE_NONE, NULL, 0x0,
3042 { &hf_sflow_245_ethernet_destination_mac_address,
3043 { "Destination MAC Address", "sflow_245.ethernet.destination_mac_address",
3044 FT_ETHER, BASE_NONE, NULL, 0x0,
3047 { &hf_sflow_245_ethernet_packet_type,
3048 { "Ethernet Packet Type", "sflow_245.ethernet.packet_type",
3049 FT_UINT32, BASE_DEC, NULL, 0x0,
3052 { &hf_sflow_245_length_of_ip_packet,
3053 { "Length of IP Packet", "sflow_245.ip.length",
3054 FT_UINT32, BASE_DEC, NULL, 0x0,
3057 { &hf_sflow_245_ip_source_port,
3058 { "Source Port", "sflow_245.ip.source_port",
3059 FT_UINT32, BASE_DEC, NULL, 0x0,
3062 { &hf_sflow_245_ip_destination_port,
3063 { "Destination Port", "sflow.ip.destination_port",
3064 FT_UINT32, BASE_DEC, NULL, 0x0,
3067 { &hf_sflow_245_ip_tcp_flag_cwr,
3068 { "TCP Flag (CWR)", "sflow_245.ip.tcp_flag.cwr",
3069 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x80,
3072 { &hf_sflow_245_ip_tcp_flag_ece,
3073 { "TCP Flag (ECE)", "sflow_245.ip.tcp_flag.ece",
3074 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x40,
3077 { &hf_sflow_245_ip_tcp_flag_urg,
3078 { "TCP Flag (URG)", "sflow_245.ip.tcp_flag.urg",
3079 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x20,
3082 { &hf_sflow_245_ip_tcp_flag_ack,
3083 { "TCP Flag (ACK)", "sflow_245.ip.tcp_flag.ack",
3084 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x10,
3087 { &hf_sflow_245_ip_tcp_flag_psh,
3088 { "TCP Flag (PSH)", "sflow_245.ip.tcp_flag.psh",
3089 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x08,
3092 { &hf_sflow_245_ip_tcp_flag_rst,
3093 { "TCP Flag (RST)", "sflow_245.ip.tcp_flag.rst",
3094 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x04,
3097 { &hf_sflow_245_ip_tcp_flag_syn,
3098 { "TCP Flag (SYN)", "sflow_245.ip.tcp_flag.syn",
3099 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x02,
3102 { &hf_sflow_245_ip_tcp_flag_fin,
3103 { "TCP Flag (FIN)", "sflow_245.ip.tcp_flag.fin",
3104 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x01,
3107 { &hf_sflow_245_ipv4_delay,
3108 { "Delay", "sflow_245.ipv4_delay",
3109 FT_BOOLEAN, 8, TFS(&tfs_low_normal), 0x10,
3112 { &hf_sflow_245_ipv4_throughput,
3113 { "Throughput", "sflow_245.ipv4_throughput",
3114 FT_BOOLEAN, 8, TFS(&tfs_high_normal), 0x08,
3117 { &hf_sflow_245_ipv4_reliability,
3118 { "Reliability", "sflow_245.ipv4_reliability",
3119 FT_BOOLEAN, 8, TFS(&tfs_high_normal), 0x04,
3122 { &hf_sflow_245_ipv4_cost,
3123 { "Cost (RFC1349)", "sflow_245.ipv4_cost",
3124 FT_BOOLEAN, 8, TFS(&tfs_minimize_monetary_normal), 0x02,
3127 { &hf_sflow_245_ipv6_priority,
3128 { "Priority", "sflow_245.ipv6_priority",
3129 FT_UINT32, BASE_DEC, NULL, 0x0,
3132 { &hf_sflow_5_extended_user_source_character_set,
3133 { "Source Character Set", "sflow_5.extended_user.source_character_set",
3134 FT_UINT32, BASE_DEC, NULL, 0x0,
3137 { &hf_sflow_5_extended_user_source_user_string_length,
3138 { "Source User String Length (bytes)", "sflow_5.extended_user.source_user_string_length",
3139 FT_UINT32, BASE_DEC, NULL, 0x0,
3142 { &hf_sflow_5_extended_user_destination_character_set,
3143 { "Destination Character Set", "sflow_5.extended_user.destination_character_set",
3144 FT_UINT32, BASE_DEC, NULL, 0x0,
3147 { &hf_sflow_5_extended_user_destination_user_string_length,
3148 { "Destination User String Length (bytes)", "sflow_5.extended_user.destination_user_string_length",
3149 FT_UINT32, BASE_DEC, NULL, 0x0,
3152 { &hf_sflow_5_extended_url_url_length,
3153 { "URL Length (bytes)", "sflow_5.extended_url.url_length",
3154 FT_UINT32, BASE_DEC, NULL, 0x0,
3157 { &hf_sflow_5_extended_url_host_length,
3158 { "Host Length (bytes)", "sflow_5.extended_url.host_length",
3159 FT_UINT32, BASE_DEC, NULL, 0x0,
3162 { &hf_sflow_5_extended_mpls_tunnel_name_length,
3163 { "Tunnel Name Length (bytes)", "sflow_5.extended_mpls_tunnel.name_length",
3164 FT_UINT32, BASE_DEC, NULL, 0x0,
3167 { &hf_sflow_5_extended_mpls_tunnel_id,
3168 { "Tunnel ID", "sflow_5.extended_mpls_tunnel.id",
3169 FT_UINT32, BASE_DEC, NULL, 0x0,
3172 { &hf_sflow_5_extended_mpls_tunnel_cos_value,
3173 { "Tunnel COS Value", "sflow_5.extended_mpls_tunnel.cos_value",
3174 FT_UINT32, BASE_DEC, NULL, 0x0,
3177 { &hf_sflow_5_extended_mpls_vc_instance_name_length,
3178 { "VC Instance Name Length (bytes)", "sflow_5.extended_mpls_vc.instance_name_length",
3179 FT_UINT32, BASE_DEC, NULL, 0x0,
3182 { &hf_sflow_5_extended_mpls_vc_id,
3183 { "VLL/VC ID", "sflow_5.extended_mpls_vc.id",
3184 FT_UINT32, BASE_DEC, NULL, 0x0,
3187 { &hf_sflow_5_extended_mpls_vc_label_cos_value,
3188 { "VC Label COS Value", "sflow_5.extended_mpls_vc.label_cos_value",
3189 FT_UINT32, BASE_DEC, NULL, 0x0,
3192 { &hf_sflow_5_extended_mpls_ftn_description_length,
3193 { "MPLS FTN Description Length (bytes)", "sflow_5.extended_mpls.ftn_description_length",
3194 FT_UINT32, BASE_DEC, NULL, 0x0,
3197 { &hf_sflow_5_extended_mpls_ftn_mask,
3198 { "MPLS FTN Mask", "sflow_5.extended_mpls.ftn_mask",
3199 FT_UINT32, BASE_DEC, NULL, 0x0,
3202 { &hf_sflow_5_extended_mpls_fec_address_prefix_length,
3203 { "MPLS FEC Address Prefix Length (bytes)", "sflow_5.extended_mpls.fec_address_prefix_length",
3204 FT_UINT32, BASE_DEC, NULL, 0x0,
3207 { &hf_sflow_5_extended_vlan_tunnel_number_of_layers,
3208 { "Number of Layers", "sflow_5.extended_vlan_tunnel.number_of_layers",
3209 FT_UINT32, BASE_DEC, NULL, 0x0,
3212 { &hf_sflow_5_extended_vlan_tunnel_tpid_tci_pair,
3213 { "TPID/TCI Pair as Integer", "sflow_5.extended_vlan_tunnel.tpid_tci_pair",
3214 FT_UINT32, BASE_DEC, NULL, 0x0,
3217 { &hf_sflow_5_extended_80211_oui,
3218 { "OUI", "sflow_5.extended_80211.oui",
3219 FT_UINT24, BASE_HEX, NULL, 0x0,
3222 { &hf_sflow_5_extended_80211_suite_type,
3223 { "Suite Type", "sflow_5.extended_80211.suite_type",
3224 FT_UINT8, BASE_DEC, VALS(extended_80211_suite_type_vals), 0x0,
3227 { &hf_sflow_5_extended_80211_payload_length,
3228 { "Payload Length", "sflow_5.extended_80211.payload_length",
3229 FT_UINT32, BASE_DEC, NULL, 0x0,
3232 { &hf_sflow_5_extended_80211_rx_bssid,
3233 { "BSSID", "sflow_5.extended_80211.rx.bssid",
3234 FT_ETHER, BASE_NONE, NULL, 0x0,
3237 { &hf_sflow_5_extended_80211_rx_version,
3238 { "Version", "sflow_5.extended_80211.rx.version",
3239 FT_UINT32, BASE_DEC, VALS(sflow_5_ieee80211_versions), 0x0,
3242 { &hf_sflow_5_extended_80211_rx_channel,
3243 { "Channel", "sflow_5.extended_80211.rx.channel",
3244 FT_UINT32, BASE_DEC, NULL, 0x0,
3247 { &hf_sflow_5_extended_80211_rx_speed,
3248 { "Speed", "sflow_5.extended_80211.rx.speed",
3249 FT_UINT64, BASE_DEC, NULL, 0x0,
3252 { &hf_sflow_5_extended_80211_rx_rsni,
3253 { "RSNI", "sflow_5.extended_80211.rx.rsni",
3254 FT_UINT32, BASE_DEC, NULL, 0x0,
3257 { &hf_sflow_5_extended_80211_rx_rcpi,
3258 { "RCPI", "sflow_5.extended_80211.rx.rcpi",
3259 FT_UINT32, BASE_DEC, NULL, 0x0,
3262 { &hf_sflow_5_extended_80211_rx_packet_duration,
3263 { "Packet Duration (ms)", "sflow_5.extended_80211.rx.packet_duration",
3264 FT_UINT32, BASE_DEC, NULL, 0x0,
3267 { &hf_sflow_5_extended_80211_tx_bssid,
3268 { "BSSID", "sflow_5.extended_80211.tx.bssid",
3269 FT_ETHER, BASE_NONE, NULL, 0x0,
3272 { &hf_sflow_5_extended_80211_tx_version,
3273 { "Version", "sflow_5.extended_80211.tx.version",
3274 FT_UINT32, BASE_DEC, VALS(sflow_5_ieee80211_versions), 0x0,
3277 { &hf_sflow_5_extended_80211_tx_retransmissions,
3278 { "Retransmissions", "sflow_5.extended_80211.tx.retransmissions",
3279 FT_UINT32, BASE_DEC, NULL, 0x0,
3282 { &hf_sflow_5_extended_80211_tx_packet_duration,
3283 { "Packet Duration (ms)", "sflow_5.extended_80211.tx.packet_duration",
3284 FT_UINT32, BASE_DEC, NULL, 0x0,
3287 { &hf_sflow_5_extended_80211_tx_retransmission_duration,
3288 { "Retransmission Duration (ms)", "sflow_5.extended_80211.tx.retransmission_duration",
3289 FT_UINT32, BASE_DEC, NULL, 0x0,
3292 { &hf_sflow_5_extended_80211_tx_channel,
3293 { "Channel", "sflow_5.extended_80211.tx.channel",
3294 FT_UINT32, BASE_DEC, NULL, 0x0,
3297 { &hf_sflow_5_extended_80211_tx_speed,
3298 { "Speed", "sflow_5.extended_80211.tx.speed",
3299 FT_UINT64, BASE_DEC, NULL, 0x0,
3302 { &hf_sflow_5_extended_80211_tx_power,
3303 { "Power", "sflow_5.extended_80211.tx.power",
3304 FT_UINT32, BASE_DEC, NULL, 0x0,
3307 { &hf_sflow_flow_sample_sequence_number,
3308 { "Sequence number", "sflow.flow_sample.sequence_number",
3309 FT_UINT32, BASE_DEC, NULL, 0x0,
3312 { &hf_sflow_flow_sample_source_id_class,
3313 { "Source ID class", "sflow.flow_sample.source_id_class",
3314 FT_UINT32, BASE_DEC, NULL, 0xFF000000,
3317 { &hf_sflow_flow_sample_sampling_rate,
3318 { "Sampling rate", "sflow.flow_sample.sampling_rate",
3319 FT_UINT32, BASE_DEC, NULL, 0x0,
3322 { &hf_sflow_flow_sample_sample_pool,
3323 { "Sample pool", "sflow.flow_sample.sample_pool",
3324 FT_UINT32, BASE_DEC, NULL, 0x0,
3327 { &hf_sflow_flow_sample_dropped_packets,
3328 { "Dropped packets", "sflow.flow_sample.dropped_packets",
3329 FT_UINT32, BASE_DEC, NULL, 0x0,
3332 { &hf_sflow_flow_sample_input_interface,
3333 { "Input interface (ifIndex)", "sflow.flow_sample.input_interface",
3334 FT_UINT32, BASE_DEC, NULL, 0x0,
3337 { &hf_sflow_flow_sample_multiple_outputs,
3338 { "Multiple outputs", "sflow.flow_sample.multiple_outputs",
3339 FT_UINT32, BASE_DEC, NULL, 0x0,
3342 { &hf_sflow_flow_sample_output_interface,
3343 { "Output interface (ifIndex)", "sflow.flow_sample.output_interface",
3344 FT_UINT32, BASE_DEC, NULL, 0x7fffffff,
3347 { &hf_sflow_enterprise,
3348 { "Enterprise", "sflow.enterprise",
3349 FT_UINT32, BASE_DEC, NULL, 0xFFFFF000,
3352 { &hf_sflow_flow_sample_flow_record,
3353 { "Flow record", "sflow.flow_sample.flow_record",
3354 FT_UINT32, BASE_DEC, NULL, 0x0,
3357 { &hf_sflow_flow_sample_source_id_type,
3358 { "Source ID type", "sflow.flow_sample.source_id_type",
3359 FT_UINT32, BASE_DEC, NULL, 0x0,
3362 { &hf_sflow_flow_sample_source_id_index,
3363 { "Source ID index", "sflow.flow_sample.source_id_index",
3364 FT_UINT32, BASE_DEC, NULL, 0x0,
3367 { &hf_sflow_flow_sample_input_interface_format,
3368 { "Input interface format", "sflow.flow_sample.input_interface_format",
3369 FT_UINT32, BASE_DEC, NULL, 0x0,
3372 { &hf_sflow_flow_sample_input_interface_value,
3373 { "Input interface value", "sflow.flow_sample.input_interface_value",
3374 FT_UINT32, BASE_DEC, NULL, 0x0,
3377 { &hf_sflow_flow_sample_output_interface_format,
3378 { "Output interface format", "sflow.flow_sample.output_interface_format",
3379 FT_UINT32, BASE_DEC, NULL, 0x0,
3382 { &hf_sflow_flow_sample_output_interface_value,
3383 { "Output interface value", "sflow.flow_sample.output_interface_value",
3384 FT_UINT32, BASE_DEC, NULL, 0x0,
3387 { &hf_sflow_counters_sample_sequence_number,
3388 { "Sequence number", "sflow.counters_sample.sequence_number",
3389 FT_UINT32, BASE_DEC, NULL, 0x0,
3392 { &hf_sflow_counters_sample_source_id_class,
3393 { "Source ID class", "sflow.counters_sample.source_id_class",
3394 FT_UINT32, BASE_DEC, NULL, 0xFF000000,
3397 { &hf_sflow_counters_sample_sampling_interval,
3398 { "Sampling Interval", "sflow.counters_sample.sampling_interval",
3399 FT_UINT32, BASE_DEC, NULL, 0x0,
3402 { &hf_sflow_counters_sample_counters_type,
3403 { "Counters type", "sflow.counters_sample.counters_type",
3404 FT_UINT32, BASE_DEC, VALS(sflow_245_counterstype), 0x0,
3407 { &hf_sflow_counters_sample_source_id_type,
3408 { "Source ID type", "sflow.counters_sample.source_id_type",
3409 FT_UINT32, BASE_DEC, NULL, 0xFF000000,
3412 { &hf_sflow_counters_sample_source_id_index,
3413 { "Source ID index", "sflow.counters_sample.source_id_index",
3414 FT_UINT32, BASE_DEC, NULL, 0x00FFFFFF,
3417 { &hf_sflow_counters_sample_counters_records,
3418 { "Counters records", "sflow.counters_sample.counters_records",
3419 FT_UINT32, BASE_DEC, NULL, 0x0,
3422 { &hf_sflow_counters_sample_expanded_source_id_type,
3423 { "Source ID type", "sflow.counters_sample.source_id_type",
3424 FT_UINT32, BASE_DEC, NULL, 0x0,
3427 { &hf_sflow_counters_sample_expanded_source_id_index,
3428 { "Source ID index", "sflow.counters_sample.source_id_index",
3429 FT_UINT32, BASE_DEC, NULL, 0x0,
3433 { &hf_sflow_lag_port_actorsystemid,
3434 { "Actor System ID", "sflow.lag_port.actor_system_id",
3435 FT_ETHER, BASE_NONE, NULL, 0x0,
3438 { &hf_sflow_lag_port_partneropersystemid,
3439 { "Partner Oper System ID", "sflow.lag_port.partner_oper_system_id",
3440 FT_ETHER, BASE_NONE, NULL, 0x0,
3443 { &hf_sflow_lag_port_attachedaggid,
3444 { "Port Attached Agg ID", "sflow.lag_port.attached_agg_id",
3445 FT_UINT32, BASE_DEC, NULL, 0x0,
3448 { &hf_sflow_lag_port_state,
3449 { "State", "sflow.lag_port.state",
3450 FT_UINT32, BASE_HEX, NULL, 0x0,
3453 { &hf_sflow_lag_port_actoradminstate,
3454 { "Actor Admin State", "sflow.lag_port.actor_admin_state",
3455 FT_BOOLEAN, 32, NULL, 0x00000001,
3458 { &hf_sflow_lag_port_actoroperstate,
3459 { "Actor Oper State", "sflow.lag_port.actor_oper_state",
3460 FT_BOOLEAN, 32, NULL, 0x00000002,
3463 { &hf_sflow_lag_port_partneradminstate,
3464 { "Partner Admin State", "sflow.lag_port.partner_admin_state",
3465 FT_BOOLEAN, 32, NULL, 0x00000004,
3468 { &hf_sflow_lag_port_partneroperstate,
3469 { "Partner Oper State", "sflow.lag_port.partner_oper_state",
3470 FT_BOOLEAN, 32, NULL, 0x00000008,
3473 { &hf_sflow_lag_port_reserved,
3474 { "Reserved", "sflow.lag_port.reserved",
3475 FT_UINT32, BASE_HEX, NULL, 0xFFFFFFF0,
3478 { &hf_sflow_lag_port_stats_lacpdusrx,
3479 { "LACPDUs Rx", "sflow.lag_port.lacpdus.rx",
3480 FT_UINT32, BASE_DEC, NULL, 0x0,
3483 { &hf_sflow_lag_port_stats_markerpdusrx,
3484 { "Marker PDUs Rx", "sflow.lag_port.marker_pdus.rx",
3485 FT_UINT32, BASE_DEC, NULL, 0x0,
3488 { &hf_sflow_lag_port_stats_markerresponsepdusrx,
3489 { "Marker Response PDUs Rx", "sflow.lag_port.marker_response_pdus.rx",
3490 FT_UINT32, BASE_DEC, NULL, 0x0,
3493 { &hf_sflow_lag_port_stats_unknownrx,
3494 { "Unknown Rx", "sflow.lag_port.unknown.rx",
3495 FT_UINT32, BASE_DEC, NULL, 0x0,
3498 { &hf_sflow_lag_port_stats_illegalrx,
3499 { "Illegal Rx", "sflow.lag_port.illegal.rx",
3500 FT_UINT32, BASE_DEC, NULL, 0x0,
3503 { &hf_sflow_lag_port_stats_lacpdustx,
3504 { "LACPDUs Tx", "sflow.lag_port.lacpdus.tx",
3505 FT_UINT32, BASE_DEC, NULL, 0x0,
3508 { &hf_sflow_lag_port_stats_markerpdustx,
3509 { "Marker PDUs Tx", "sflow.lag_port.marker_pdus.tx",
3510 FT_UINT32, BASE_DEC, NULL, 0x0,
3513 { &hf_sflow_lag_port_stats_markerresponsepdustx,
3514 { "Marker Response PDUs Tx", "sflow.lag_port.marker_response_pdus.tx",
3515 FT_UINT32, BASE_DEC, NULL, 0x0,
3519 { &hf_sflow_245_as_type,
3520 { "AS Type", "sflow.as_type",
3521 FT_UINT32, BASE_DEC, VALS(sflow_245_as_types), 0x0,
3524 { &hf_sflow_245_ip_protocol,
3525 { "IP Protocol", "sflow.ip_protocol",
3526 FT_UINT32, BASE_DEC|BASE_EXT_STRING, &ipproto_val_ext, 0x0,
3529 { &hf_sflow_5_extended_user_source_user,
3530 { "Source User", "sflow_5.extended_user.source_user",
3531 FT_STRING, BASE_NONE, NULL, 0x0,
3534 { &hf_sflow_5_extended_user_destination_user,
3535 { "Destination User", "sflow_5.extended_user.destination_user",
3536 FT_STRING, BASE_NONE, NULL, 0x0,
3539 { &hf_sflow_5_extended_url_direction,
3540 { "Direction", "sflow_5.extended_url.direction",
3541 FT_UINT32, BASE_DEC, NULL, 0x0,
3544 { &hf_sflow_5_extended_url_url,
3545 { "URL", "sflow_5.extended_url.url",
3546 FT_STRING, BASE_NONE, NULL, 0x0,
3549 { &hf_sflow_5_extended_url_host,
3550 { "Host", "sflow_5.extended_url.host",
3551 FT_STRING, BASE_NONE, NULL, 0x0,
3554 { &hf_sflow_5_extended_mpls_tunnel_name,
3555 { "Tunnel Name", "sflow_5.extended_mpls_tunnel.tunnel_name",
3556 FT_STRING, BASE_NONE, NULL, 0x0,
3559 { &hf_sflow_5_extended_mpls_vc_instance_name,
3560 { "VC Instance Name", "sflow_5.extended_mpls_vc.vc_instance_name",
3561 FT_STRING, BASE_NONE, NULL, 0x0,
3564 { &hf_sflow_5_extended_mpls_ftn_description,
3565 { "MPLS FTN Description", "sflow_5.extended_mpls.ftn_description",
3566 FT_STRING, BASE_NONE, NULL, 0x0,
3569 { &hf_sflow_5_extended_80211_payload,
3570 { "Payload", "sflow_5.extended_80211.payload",
3571 FT_BYTES, BASE_NONE, NULL, 0x0,
3574 { &hf_sflow_5_extended_80211_rx_ssid,
3575 { "SSID", "sflow_5.extended_80211.rx.ssid",
3576 FT_STRING, BASE_NONE, NULL, 0x0,
3579 { &hf_sflow_5_extended_80211_tx_ssid,
3580 { "SSID", "sflow_5.extended_80211.tx.ssid",
3581 FT_STRING, BASE_NONE, NULL, 0x0,
3584 { &hf_sflow_flow_sample_index,
3585 { "Index", "sflow.flow_sample.index",
3586 FT_UINT32, BASE_DEC, NULL, 0x00FFFFFF,
3589 { &hf_sflow_counters_sample_index,
3590 { "Index", "sflow.counters_sample.index",
3591 FT_UINT32, BASE_DEC, NULL, 0x0,
3596 /* Setup protocol subtree array */
3597 static gint * ett[] = {
3599 &ett_sflow_245_sample,
3600 &ett_sflow_5_flow_record,
3601 &ett_sflow_5_counters_record,
3602 &ett_sflow_5_mpls_in_label_stack,
3603 &ett_sflow_5_mpls_out_label_stack,
3604 &ett_sflow_245_extended_data,
3605 &ett_sflow_245_gw_as_dst,
3606 &ett_sflow_245_gw_as_dst_seg,
3607 &ett_sflow_245_gw_community,
3608 &ett_sflow_245_sampled_header,
3609 &ett_sflow_lag_port_state_flags,
3612 static ei_register_info ei[] = {
3613 { &ei_sflow_invalid_address_type, { "sflow.invalid_address_type", PI_MALFORMED, PI_ERROR, "Unknown/invalid address type", EXPFILL }},
3616 expert_module_t* expert_sflow;
3618 /* Register the protocol name and description */
3619 proto_sflow = proto_register_protocol("InMon sFlow", "sFlow", "sflow");
3621 /* Required function calls to register the header fields and subtrees used */
3622 proto_register_field_array(proto_sflow, hf, array_length(hf));
3623 proto_register_subtree_array(ett, array_length(ett));
3624 expert_sflow = expert_register_protocol(proto_sflow);
3625 expert_register_field_array(expert_sflow, ei, array_length(ei));
3627 header_subdissector_table = register_dissector_table("sflow_245.header_protocol", "SFLOW header protocol", proto_sflow, FT_UINT32, BASE_DEC);
3629 /* Register our configuration options for sFlow */
3630 sflow_245_module = prefs_register_protocol(proto_sflow, NULL);
3633 If I use a filter like "ip.src == 10.1.1.1" this will, in
3634 addition to the usual suspects, find every sFlow packet
3635 where *any* of the payload headers contain 10.1.1.1 as a
3636 src addr. I think this may not be the desired behavior.
3637 It can certainly be confusing since the ip.src being found
3638 is buried about 3 subtrees deep and the subtrees might be
3639 under any one of the sampled (payload) header trees. It is
3640 certainly not quickly obvious why the filter matched.
3642 prefs_register_bool_preference(sflow_245_module, "enable_dissection",
3643 "Dissect data in sampled headers",
3644 "Enabling dissection makes it easy to view protocol details in each of the sampled headers."
3645 " Disabling dissection may reduce noise caused when display filters match the contents of"
3646 " any sampled header(s).",
3647 &global_dissect_samp_headers);
3649 It is not clear to me that it *ever* makes sense to enable
3650 this option. However, it was previously the default
3651 behavior so I'll leave it as an option if someone thinks
3652 they have a use for it.
3654 prefs_register_bool_preference(sflow_245_module, "enable_analysis",
3655 "Analyze data in sampled IP headers",
3656 "This option only makes sense if dissection of sampled headers is enabled and probably not even then.",
3657 &global_analyze_samp_ip_headers);
3661 proto_reg_handoff_sflow_245(void) {
3663 sflow_handle = create_dissector_handle(dissect_sflow_245, proto_sflow);
3664 dissector_add_uint_range_with_preference("udp.port", SFLOW_UDP_PORTS, sflow_handle);
3668 * Editor modelines - http://www.wireshark.org/tools/modelines.html
3673 * indent-tabs-mode: nil
3676 * vi: set shiftwidth=4 tabstop=8 expandtab:
3677 * :indentSize=4:tabSize=8:noTabs=true: