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 * SPDX-License-Identifier: GPL-2.0-or-later
24 * This file (mostly) implements a dissector for sFlow (RFC3176),
25 * from the version 4 spec at http://www.sflow.org/SFLOW-DATAGRAM.txt .
28 * Fix the highlighting of the datastream when bits are selected
29 * split things out into packet-sflow.h ?
30 * make routines more consistent as to whether they return
31 * 'offset' or bytes consumed ('len') (sFlow v2/4)
32 * implement sampled_ipv4 and sampled_ipv6 packet data types (sFlow v2/4)
33 * implement extended_user (sFlow v2/4)
34 * implement extended_url (sFlow v2/4)
35 * implement non-generic counters sampling (sFlow v2/4)
40 #include <epan/packet.h>
41 #include <epan/exceptions.h>
42 #include <epan/prefs.h>
43 #include <epan/expert.h>
44 #include <epan/to_str.h>
45 #include <epan/ipproto.h>
47 #include <epan/unit_strings.h>
49 #include <wsutil/array.h>
50 #include "packet-sflow.h"
52 #define SFLOW_UDP_PORTS "6343"
54 void proto_register_sflow(void);
56 static dissector_handle_t sflow_handle
;
59 * sflow_245_ports : holds the currently used range of ports for sflow
61 static bool global_dissect_samp_headers
= true;
62 static bool global_analyze_samp_ip_headers
;
64 #define ENTERPRISE_DEFAULT 0
66 #define ADDR_TYPE_UNKNOWN 0
67 #define ADDR_TYPE_IPV4 1
68 #define ADDR_TYPE_IPV6 2
71 #define COUNTERSSAMPLE 2
72 #define EXPANDED_FLOWSAMPLE 3
73 #define EXPANDED_COUNTERSSAMPLE 4
74 #define LAG_PORT_STATS 7
76 static const value_string sflow_agent_address_types
[] = {
77 { ADDR_TYPE_IPV4
, "IPv4" },
78 { ADDR_TYPE_IPV6
, "IPv6" },
82 static const value_string sflow_245_sampletype
[] = {
83 { FLOWSAMPLE
, "Flow sample"},
84 { COUNTERSSAMPLE
, "Counters sample"},
85 { EXPANDED_FLOWSAMPLE
, "Expanded flow sample"},
86 { EXPANDED_COUNTERSSAMPLE
, "Expanded counters sample"},
87 { LAG_PORT_STATS
, "Lag Port stats"},
91 #define SFLOW_5_IEEE80211_VERSION_A 1
92 #define SFLOW_5_IEEE80211_VERSION_B 2
93 #define SFLOW_5_IEEE80211_VERSION_G 3
94 #define SFLOW_5_IEEE80211_VERSION_N 4
96 static const value_string sflow_5_ieee80211_versions
[] = {
97 { SFLOW_5_IEEE80211_VERSION_A
, "802.11a"},
98 { SFLOW_5_IEEE80211_VERSION_B
, "802.11b"},
99 { SFLOW_5_IEEE80211_VERSION_G
, "802.11g"},
100 { SFLOW_5_IEEE80211_VERSION_N
, "802.11n"},
104 /* interface counter types */
105 #define SFLOW_245_COUNTERS_GENERIC 1
106 #define SFLOW_245_COUNTERS_ETHERNET 2
107 #define SFLOW_245_COUNTERS_TOKENRING 3
108 #define SFLOW_245_COUNTERS_FDDI 4
109 #define SFLOW_245_COUNTERS_VG 5
110 #define SFLOW_245_COUNTERS_WAN 6
111 #define SFLOW_245_COUNTERS_VLAN 7
113 static const value_string sflow_245_counterstype
[] = {
114 { SFLOW_245_COUNTERS_GENERIC
, "Generic counters"},
115 { SFLOW_245_COUNTERS_ETHERNET
, "Ethernet counters"},
116 { SFLOW_245_COUNTERS_TOKENRING
,"Token Ring counters"},
117 { SFLOW_245_COUNTERS_FDDI
, "FDDI counters"},
118 { SFLOW_245_COUNTERS_VG
, "100baseVG counters"},
119 { SFLOW_245_COUNTERS_WAN
, "WAN counters"},
120 { SFLOW_245_COUNTERS_VLAN
, "VLAN counters"},
124 #define MAX_HEADER_SIZE 256
126 #define SFLOW_245_PACKET_DATA_TYPE_HEADER 1
127 #define SFLOW_245_PACKET_DATA_TYPE_IPV4 2
128 #define SFLOW_245_PACKET_DATA_TYPE_IPV6 3
130 static const value_string sflow_245_packet_information_type
[] = {
131 { SFLOW_245_PACKET_DATA_TYPE_HEADER
, "Packet headers are sampled"},
132 { SFLOW_245_PACKET_DATA_TYPE_IPV4
, "IP Version 4 data"},
133 { SFLOW_245_PACKET_DATA_TYPE_IPV6
, "IP Version 6 data"},
137 static const value_string extended_80211_suite_type_vals
[] = {
138 { 0, "Use group cipher suite"},
146 static const value_string sflow_ifdirection_vals
[] = {
154 static const true_false_string tfs_minimize_monetary_normal
= { "Minimize Monetary", "Normal" };
156 static const value_string sflow_245_header_protocol
[] = {
157 { SFLOW_245_HEADER_ETHERNET
, "Ethernet"},
158 { SFLOW_245_HEADER_TOKENBUS
, "Token Bus"},
159 { SFLOW_245_HEADER_TOKENRING
, "Token Ring"},
160 { SFLOW_245_HEADER_FDDI
, "FDDI"},
161 { SFLOW_245_HEADER_FRAME_RELAY
, "Frame Relay"},
162 { SFLOW_245_HEADER_X25
, "X.25"},
163 { SFLOW_245_HEADER_PPP
, "PPP"},
164 { SFLOW_245_HEADER_SMDS
, "SMDS"},
165 { SFLOW_245_HEADER_AAL5
, "ATM AAL5"},
166 { SFLOW_245_HEADER_AAL5_IP
, "ATM AAL5-IP (e.g., Cisco AAL5 mux)"},
167 { SFLOW_245_HEADER_IPv4
, "IPv4"},
168 { SFLOW_245_HEADER_IPv6
, "IPv6"},
169 { SFLOW_245_HEADER_MPLS
, "MPLS"},
170 { SFLOW_5_HEADER_POS
, "PPP over SONET/SDH (RFC 1662, 2615)"},
171 { SFLOW_5_HEADER_80211_MAC
, "802.11 MAC"},
172 { SFLOW_5_HEADER_80211_AMPDU
, "802.11n Aggregated MPDU"},
173 { SFLOW_5_HEADER_80211_AMSDU_SUBFRAME
, "A-MSDU Subframe"},
176 static value_string_ext sflow_245_header_protocol_ext
= VALUE_STRING_EXT_INIT(sflow_245_header_protocol
);
178 /* extended packet data types */
179 #define SFLOW_245_EXTENDED_SWITCH 1
180 #define SFLOW_245_EXTENDED_ROUTER 2
181 #define SFLOW_245_EXTENDED_GATEWAY 3
182 #define SFLOW_245_EXTENDED_USER 4
183 #define SFLOW_245_EXTENDED_URL 5
185 static const value_string sflow_245_extended_data_types
[] = {
186 { SFLOW_245_EXTENDED_SWITCH
, "Extended switch information"},
187 { SFLOW_245_EXTENDED_ROUTER
, "Extended router information"},
188 { SFLOW_245_EXTENDED_GATEWAY
, "Extended gateway information"},
189 { SFLOW_245_EXTENDED_USER
, "Extended user information"},
190 { SFLOW_245_EXTENDED_URL
, "Extended URL information"},
195 #define SFLOW_245_AS_SET 1
196 #define SFLOW_245_AS_SEQUENCE 2
198 static const value_string sflow_245_as_types
[] = {
199 { SFLOW_245_AS_SET
, "AS Set"},
200 { SFLOW_245_AS_SEQUENCE
, "AS Sequence"},
204 #define SFLOW_245_IPV4_PRECEDENCE_ROUTINE 0
205 #define SFLOW_245_IPV4_PRECEDENCE_PRIORITY 1
206 #define SFLOW_245_IPV4_PRECEDENCE_IMMEDIATE 2
207 #define SFLOW_245_IPV4_PRECEDENCE_FLASH 3
208 #define SFLOW_245_IPV4_PRECEDENCE_FLASH_OVERRIDE 4
209 #define SFLOW_245_IPV4_PRECEDENCE_CRITIC_ECP 5
210 #define SFLOW_245_IPV4_PRECEDENCE_INTERNETWORK_CONTROL 6
211 #define SFLOW_245_IPV4_PRECEDENCE_NETWORK_CONTROL 7
213 static const value_string sflow_245_ipv4_precedence_types
[] = {
214 { SFLOW_245_IPV4_PRECEDENCE_ROUTINE
, "Routine"},
215 { SFLOW_245_IPV4_PRECEDENCE_PRIORITY
, "Priority"},
216 { SFLOW_245_IPV4_PRECEDENCE_IMMEDIATE
, "Immediate"},
217 { SFLOW_245_IPV4_PRECEDENCE_FLASH
, "Flash"},
218 { SFLOW_245_IPV4_PRECEDENCE_FLASH_OVERRIDE
, "Flash Override"},
219 { SFLOW_245_IPV4_PRECEDENCE_CRITIC_ECP
, "CRITIC/ECP"},
220 { SFLOW_245_IPV4_PRECEDENCE_INTERNETWORK_CONTROL
, "Internetwork Control"},
221 { SFLOW_245_IPV4_PRECEDENCE_NETWORK_CONTROL
, "Network Control"},
225 /* sFlow v5 flow record formats */
226 #define SFLOW_5_RAW_PACKET_HEADER 1
227 #define SFLOW_5_ETHERNET_FRAME 2
228 #define SFLOW_5_IPV4 3
229 #define SFLOW_5_IPV6 4
230 #define SFLOW_5_SWITCH 1001
231 #define SFLOW_5_ROUTER 1002
232 #define SFLOW_5_GATEWAY 1003
233 #define SFLOW_5_USER 1004
234 #define SFLOW_5_URL 1005
235 #define SFLOW_5_MPLS_DATA 1006
236 #define SFLOW_5_NAT 1007
237 #define SFLOW_5_MPLS_TUNNEL 1008
238 #define SFLOW_5_MPLS_VC 1009
239 #define SFLOW_5_MPLS_FEC 1010
240 #define SFLOW_5_MPLS_LVP_FEC 1011
241 #define SFLOW_5_VLAN_TUNNEL 1012
242 #define SFLOW_5_80211_PAYLOAD 1013
243 #define SFLOW_5_80211_RX 1014
244 #define SFLOW_5_80211_TX 1015
245 #define SFLOW_5_80211_AGGREGATION 1016
248 static const value_string sflow_5_flow_record_type
[] = {
249 { SFLOW_5_RAW_PACKET_HEADER
, "Raw packet header"},
250 { SFLOW_5_ETHERNET_FRAME
, "Ethernet frame data"},
251 { SFLOW_5_IPV4
, "IPv4 data"},
252 { SFLOW_5_IPV6
, "IPv6 data"},
253 { SFLOW_5_SWITCH
, "Extended switch data"},
254 { SFLOW_5_ROUTER
, "Extended router data"},
255 { SFLOW_5_GATEWAY
, "Extended gateway data"},
256 { SFLOW_5_USER
, "Extended user data"},
257 { SFLOW_5_URL
, "Extended URL data"},
258 { SFLOW_5_MPLS_DATA
, "Extended MPLS data"},
259 { SFLOW_5_NAT
, "Extended NAT data"},
260 { SFLOW_5_MPLS_TUNNEL
, "Extended MPLS tunnel data"},
261 { SFLOW_5_MPLS_VC
, "Extended MPLS VC data"},
262 { SFLOW_5_MPLS_FEC
, "Extended MPLS FEC data"},
263 { SFLOW_5_MPLS_LVP_FEC
, "Extended MPLS LVP FEC data"},
264 { SFLOW_5_VLAN_TUNNEL
, "Extended VLAN tunnel"},
265 { SFLOW_5_80211_PAYLOAD
, "Extended 802.11 payload"},
266 { SFLOW_5_80211_RX
, "Extended 802.11 RX"},
267 { SFLOW_5_80211_TX
, "Extended 802.11 TX"},
268 { SFLOW_5_80211_AGGREGATION
, "Extended 802.11 aggregation"},
271 static value_string_ext sflow_5_flow_record_type_ext
= VALUE_STRING_EXT_INIT(sflow_5_flow_record_type
);
273 /* sFlow v5 counters record formats */
274 #define SFLOW_5_GENERIC_INTERFACE 1
275 #define SFLOW_5_ETHERNET_INTERFACE 2
276 #define SFLOW_5_TOKEN_RING 3
277 #define SFLOW_5_100BASE_VG_INTERFACE 4
278 #define SFLOW_5_VLAN 5
279 #define SFLOW_5_80211_COUNTERS 6
280 #define SFLOW_5_LAG 7
281 #define SFLOW_5_PROCESSOR 1001
282 #define SFLOW_5_RADIO_UTILIZATION 1002
284 static const value_string sflow_5_counters_record_type
[] = {
285 { SFLOW_5_GENERIC_INTERFACE
, "Generic interface counters"},
286 { SFLOW_5_ETHERNET_INTERFACE
, "Ethernet interface counters"},
287 { SFLOW_5_TOKEN_RING
, "Token ring counters"},
288 { SFLOW_5_100BASE_VG_INTERFACE
, "100 Base VG interface counters"},
289 { SFLOW_5_VLAN
, "VLAN counters"},
290 { SFLOW_5_LAG
, "LAG counters"},
291 { SFLOW_5_80211_COUNTERS
, "IEEE 802.11 counters"},
292 { SFLOW_5_PROCESSOR
, "Processor information"},
293 { SFLOW_5_RADIO_UTILIZATION
, "Radio utilization"},
297 /* sFlow v5 interface formats */
298 #define SFLOW_5_INT_FORMAT 0xC0000000
299 #define SFLOW_5_INT_VALUE 0x3FFFFFFF
301 #define SFLOW_5_INT_FORMAT_IFINDEX 0
302 #define SFLOW_5_INT_FORMAT_DISCARD 1
303 #define SFLOW_5_INT_FORMAT_MULTIPLE 2
305 static const value_string interface_format
[] = {
306 { SFLOW_5_INT_FORMAT_IFINDEX
, "ifindex"},
307 { SFLOW_5_INT_FORMAT_DISCARD
, "packet discarded"},
308 { SFLOW_5_INT_FORMAT_MULTIPLE
, "multiple interfaces"},
312 static const value_string interface_discard
[] = {
313 { 0, "Net Unreachable"},
314 { 1, "Host Unreachable"},
315 { 2, "Protocol Unreachable"},
316 { 3, "Port Unreachable"},
317 { 4, "Fragmentation Needed and Don't Fragment was Set"},
318 { 5, "Source Route Failed"},
319 { 6, "Destination Network Unknown"},
320 { 7, "Destination Host Unknown"},
321 { 8, "Source Host Isolated"},
322 { 9, "Communication with Destination Network is Administratively Prohibited"},
323 { 10, "Communication with Destination Host is Administratively Prohibited"},
324 { 11, "Destination Network Unreachable for Type of Service"},
325 { 12, "Destination Host Unreachable for Type of Service"},
326 { 13, "Communication Administratively Prohibited"},
327 { 14, "Host Precedence Violation"},
328 { 15, "Precedence cutoff in effect"},
330 { 257, "ttl exceeded"},
332 { 259, "no buffer space"},
334 { 261, "traffic shaping/rate limiting"},
335 { 262, "packet too big (for protocols that don't support fragmentation)"},
339 /* ethernet counters. These will be preceded by generic counters. */
340 struct ethernet_counters
{
341 uint32_t dot3StatsAlignmentErrors
;
342 uint32_t dot3StatsFCSErrors
;
343 uint32_t dot3StatsSingleCollisionFrames
;
344 uint32_t dot3StatsMultipleCollisionFrames
;
345 uint32_t dot3StatsSQETestErrors
;
346 uint32_t dot3StatsDeferredTransmissions
;
347 uint32_t dot3StatsLateCollisions
;
348 uint32_t dot3StatsExcessiveCollisions
;
349 uint32_t dot3StatsInternalMacTransmitErrors
;
350 uint32_t dot3StatsCarrierSenseErrors
;
351 uint32_t dot3StatsFrameTooLongs
;
352 uint32_t dot3StatsInternalMacReceiveErrors
;
353 uint32_t dot3StatsSymbolErrors
;
356 struct sflow_address_type
{
362 /* Initialize the protocol and registered fields */
363 static int proto_sflow
;
364 static int hf_sflow_version
;
365 static int hf_sflow_agent_address_type
;
366 static int hf_sflow_agent_address_v4
;
367 static int hf_sflow_agent_address_v6
;
368 static int hf_sflow_5_sub_agent_id
;
369 static int hf_sflow_5_sample_length
;
370 static int hf_sflow_5_flow_data_length
;
371 /* static int hf_sflow_5_counters_data_length; */
372 static int hf_sflow_245_seqnum
;
373 static int hf_sflow_245_sysuptime
;
374 static int hf_sflow_245_numsamples
;
375 static int hf_sflow_245_header_protocol
;
376 static int hf_sflow_245_sampletype
;
377 static int hf_sflow_245_sampletype12
;
378 static int hf_sflow_245_ipv4_precedence_type
;
379 static int hf_sflow_5_flow_record_format
;
380 static int hf_sflow_5_counters_record_format
;
381 static int hf_sflow_245_header
;
382 static int hf_sflow_245_packet_information_type
;
383 static int hf_sflow_245_extended_information_type
;
384 static int hf_sflow_245_vlan_in
; /* incoming 802.1Q VLAN ID */
385 static int hf_sflow_245_vlan_out
; /* outgoing 802.1Q VLAN ID */
386 static int hf_sflow_245_pri_in
; /* incoming 802.1p priority */
387 static int hf_sflow_245_pri_out
; /* outgoing 802.1p priority */
388 static int hf_sflow_245_nexthop_v4
; /* nexthop address */
389 static int hf_sflow_245_nexthop_v6
; /* nexthop address */
390 static int hf_sflow_245_ipv4_src
;
391 static int hf_sflow_245_ipv4_dst
;
392 static int hf_sflow_245_ipv6_src
;
393 static int hf_sflow_245_ipv6_dst
;
394 static int hf_sflow_245_nexthop_src_mask
;
395 static int hf_sflow_245_nexthop_dst_mask
;
398 /* extended gateway (all versions) */
399 static int hf_sflow_245_as
;
400 static int hf_sflow_245_src_as
;
401 static int hf_sflow_245_src_peer_as
;
402 static int hf_sflow_245_dst_as_entries
; /* aka length */
403 static int hf_sflow_245_dst_as
;
404 /* extended gateway (>= version 4) */
405 static int hf_sflow_245_community_entries
;
406 /* static int hf_sflow_245_community; */
407 static int hf_sflow_245_localpref
;
409 /* generic interface counter */
410 static int hf_sflow_245_ifindex
;
411 static int hf_sflow_245_iftype
;
412 static int hf_sflow_245_ifspeed
;
413 static int hf_sflow_245_ifdirection
;
414 static int hf_sflow_245_ifadmin_status
;
415 static int hf_sflow_245_ifoper_status
;
416 static int hf_sflow_245_ifinoct
;
417 static int hf_sflow_245_ifinpkt
;
418 static int hf_sflow_245_ifinmcast
;
419 static int hf_sflow_245_ifinbcast
;
420 static int hf_sflow_245_ifinerr
;
421 static int hf_sflow_245_ifindisc
;
422 static int hf_sflow_245_ifinunk
;
423 static int hf_sflow_245_ifoutoct
;
424 static int hf_sflow_245_ifoutpkt
;
425 static int hf_sflow_245_ifoutmcast
;
426 static int hf_sflow_245_ifoutbcast
;
427 static int hf_sflow_245_ifoutdisc
;
428 static int hf_sflow_245_ifouterr
;
429 static int hf_sflow_245_ifpromisc
;
431 /* ethernet interface counter */
432 static int hf_sflow_245_dot3StatsAlignmentErrors
;
433 static int hf_sflow_245_dot3StatsFCSErrors
;
434 static int hf_sflow_245_dot3StatsSingleCollisionFrames
;
435 static int hf_sflow_245_dot3StatsMultipleCollisionFrames
;
436 static int hf_sflow_245_dot3StatsSQETestErrors
;
437 static int hf_sflow_245_dot3StatsDeferredTransmissions
;
438 static int hf_sflow_245_dot3StatsLateCollisions
;
439 static int hf_sflow_245_dot3StatsExcessiveCollisions
;
440 static int hf_sflow_245_dot3StatsInternalMacTransmitErrors
;
441 static int hf_sflow_245_dot3StatsCarrierSenseErrors
;
442 static int hf_sflow_245_dot3StatsFrameTooLongs
;
443 static int hf_sflow_245_dot3StatsInternalMacReceiveErrors
;
444 static int hf_sflow_245_dot3StatsSymbolErrors
;
446 /* token ring counter */
447 static int hf_sflow_245_dot5StatsLineErrors
;
448 static int hf_sflow_245_dot5StatsBurstErrors
;
449 static int hf_sflow_245_dot5StatsACErrors
;
450 static int hf_sflow_245_dot5StatsAbortTransErrors
;
451 static int hf_sflow_245_dot5StatsInternalErrors
;
452 static int hf_sflow_245_dot5StatsLostFrameErrors
;
453 static int hf_sflow_245_dot5StatsReceiveCongestions
;
454 static int hf_sflow_245_dot5StatsFrameCopiedErrors
;
455 static int hf_sflow_245_dot5StatsTokenErrors
;
456 static int hf_sflow_245_dot5StatsSoftErrors
;
457 static int hf_sflow_245_dot5StatsHardErrors
;
458 static int hf_sflow_245_dot5StatsSignalLoss
;
459 static int hf_sflow_245_dot5StatsTransmitBeacons
;
460 static int hf_sflow_245_dot5StatsRecoveries
;
461 static int hf_sflow_245_dot5StatsLobeWires
;
462 static int hf_sflow_245_dot5StatsRemoves
;
463 static int hf_sflow_245_dot5StatsSingles
;
464 static int hf_sflow_245_dot5StatsFreqErrors
;
466 /* 100 BaseVG interface counters */
467 static int hf_sflow_245_dot12InHighPriorityFrames
;
468 static int hf_sflow_245_dot12InHighPriorityOctets
;
469 static int hf_sflow_245_dot12InNormPriorityFrames
;
470 static int hf_sflow_245_dot12InNormPriorityOctets
;
471 static int hf_sflow_245_dot12InIPMErrors
;
472 static int hf_sflow_245_dot12InOversizeFrameErrors
;
473 static int hf_sflow_245_dot12InDataErrors
;
474 static int hf_sflow_245_dot12InNullAddressedFrames
;
475 static int hf_sflow_245_dot12OutHighPriorityFrames
;
476 static int hf_sflow_245_dot12OutHighPriorityOctets
;
477 static int hf_sflow_245_dot12TransitionIntoTrainings
;
478 static int hf_sflow_245_dot12HCInHighPriorityOctets
;
479 static int hf_sflow_245_dot12HCInNormPriorityOctets
;
480 static int hf_sflow_245_dot12HCOutHighPriorityOctets
;
483 static int hf_sflow_245_vlan_id
;
484 static int hf_sflow_245_octets
;
485 static int hf_sflow_245_ucastPkts
;
486 static int hf_sflow_245_multicastPkts
;
487 static int hf_sflow_245_broadcastPkts
;
488 static int hf_sflow_245_discards
;
490 /* 802.11 interface counters */
491 static int hf_sflow_5_dot11TransmittedFragmentCount
;
492 static int hf_sflow_5_dot11MulticastTransmittedFrameCount
;
493 static int hf_sflow_5_dot11FailedCount
;
494 static int hf_sflow_5_dot11RetryCount
;
495 static int hf_sflow_5_dot11MultipleRetryCount
;
496 static int hf_sflow_5_dot11FrameDuplicateCount
;
497 static int hf_sflow_5_dot11RTSSuccessCount
;
498 static int hf_sflow_5_dot11RTSFailureCount
;
499 static int hf_sflow_5_dot11ACKFailureCount
;
500 static int hf_sflow_5_dot11ReceivedFragmentCount
;
501 static int hf_sflow_5_dot11MulticastReceivedFrameCount
;
502 static int hf_sflow_5_dot11FCSErrorCount
;
503 static int hf_sflow_5_dot11TransmittedFrameCount
;
504 static int hf_sflow_5_dot11WEPUndecryptableCount
;
505 static int hf_sflow_5_dot11QoSDiscardedFragmentCount
;
506 static int hf_sflow_5_dot11AssociatedStationCount
;
507 static int hf_sflow_5_dot11QoSCFPollsReceivedCount
;
508 static int hf_sflow_5_dot11QoSCFPollsUnusedCount
;
509 static int hf_sflow_5_dot11QoSCFPollsUnusableCount
;
510 static int hf_sflow_5_dot11QoSCFPollsLostCount
;
511 /* static int hf_sflow_5_ieee80211_version; */
514 /* processor information */
515 static int hf_sflow_5_cpu_5s
;
516 static int hf_sflow_5_cpu_1m
;
517 static int hf_sflow_5_cpu_5m
;
518 static int hf_sflow_5_total_memory
;
519 static int hf_sflow_5_free_memory
;
521 /* radio utilisation */
522 static int hf_sflow_5_elapsed_time
;
523 static int hf_sflow_5_on_channel_time
;
524 static int hf_sflow_5_on_channel_busy_time
;
526 /* Generated from convert_proto_tree_add_text.pl */
527 static int hf_sflow_5_extended_80211_suite_type
;
528 static int hf_sflow_5_extended_80211_rx_channel
;
529 static int hf_sflow_flow_sample_input_interface
;
530 static int hf_sflow_counters_sample_sampling_interval
;
531 static int hf_sflow_5_extended_url_host_length
;
532 static int hf_sflow_245_ip_tcp_flag_syn
;
533 static int hf_sflow_24_flow_sample_output_interface
;
534 static int hf_sflow_5_flow_sample_output_interface
;
535 static int hf_sflow_5_flow_sample_output_interface_form
;
536 static int hf_sflow_5_flow_sample_output_interface_val
;
537 static int hf_sflow_5_flow_sample_output_interface_val_discard
;
538 static int hf_sflow_245_length_of_ip_packet
;
539 static int hf_sflow_counters_sample_counters_type
;
540 static int hf_sflow_5_extended_mpls_tunnel_id
;
541 static int hf_sflow_flow_sample_sample_pool
;
542 static int hf_sflow_5_extended_80211_tx_speed
;
543 static int hf_sflow_5_extended_vlan_tunnel_tpid_tci_pair
;
544 static int hf_sflow_245_extended_mpls_out_label_stack_entries
;
545 static int hf_sflow_flow_sample_input_interface_value
;
546 static int hf_sflow_flow_sample_sampling_rate
;
547 static int hf_sflow_5_extended_80211_rx_rcpi
;
548 static int hf_sflow_enterprise
;
549 static int hf_sflow_enterprise_length
;
550 static int hf_sflow_enterprise_data
;
551 static int hf_sflow_245_header_frame_length
;
552 static int hf_sflow_5_extended_user_destination_character_set
;
553 static int hf_sflow_5_extended_80211_rx_bssid
;
554 static int hf_sflow_5_extended_80211_tx_retransmission_duration
;
555 static int hf_sflow_245_ethernet_length_of_mac_packet
;
556 static int hf_sflow_245_ip_tcp_flag_psh
;
557 static int hf_sflow_flow_sample_flow_record
;
558 static int hf_sflow_245_extended_mpls_in_label
;
559 static int hf_sflow_5_extended_user_source_character_set
;
560 static int hf_sflow_5_extended_user_destination_user_string_length
;
561 static int hf_sflow_counters_sample_sequence_number
;
562 static int hf_sflow_5_extended_80211_rx_speed
;
563 static int hf_sflow_5_extended_80211_rx_rsni
;
564 static int hf_sflow_flow_sample_source_id_index
;
565 static int hf_sflow_245_ip_tcp_flag_ece
;
566 static int hf_sflow_245_ipv4_throughput
;
567 static int hf_sflow_5_extended_80211_oui
;
568 static int hf_sflow_counters_sample_source_id_type
;
569 static int hf_sflow_flow_sample_input_interface_format
;
570 static int hf_sflow_5_extended_80211_tx_channel
;
571 static int hf_sflow_245_ip_tcp_flag_urg
;
572 static int hf_sflow_5_extended_mpls_tunnel_name_length
;
573 static int hf_sflow_5_extended_80211_tx_version
;
574 static int hf_sflow_245_ipv4_delay
;
575 static int hf_sflow_flow_sample_source_id_class
;
576 static int hf_sflow_245_ethernet_source_mac_address
;
577 static int hf_sflow_5_extended_mpls_ftn_mask
;
578 static int hf_sflow_245_extended_mpls_out_label
;
579 static int hf_sflow_245_ipv6_priority
;
580 static int hf_sflow_245_ip_tcp_flag_fin
;
581 static int hf_sflow_245_ip_destination_port
;
582 static int hf_sflow_5_extended_mpls_vc_label_cos_value
;
583 static int hf_sflow_5_extended_80211_rx_packet_duration
;
584 static int hf_sflow_5_extended_80211_tx_packet_duration
;
585 static int hf_sflow_245_ipv4_reliability
;
586 static int hf_sflow_5_extended_80211_tx_power
;
587 static int hf_sflow_24_flow_sample_multiple_outputs
;
588 static int hf_sflow_5_extended_user_source_user_string_length
;
589 static int hf_sflow_5_extended_80211_payload_length
;
590 static int hf_sflow_24_flow_sample_output_interface_format
;
591 static int hf_sflow_5_flow_sample_output_interface_expanded_format
;
592 static int hf_sflow_245_ethernet_packet_type
;
593 static int hf_sflow_counters_sample_expanded_source_id_type
;
594 static int hf_sflow_245_ip_source_port
;
595 static int hf_sflow_245_extended_mpls_in_label_stack_entries
;
596 static int hf_sflow_5_extended_mpls_vc_instance_name_length
;
597 static int hf_sflow_245_ipv4_cost
;
598 static int hf_sflow_5_extended_mpls_ftn_description_length
;
599 static int hf_sflow_5_extended_vlan_tunnel_number_of_layers
;
600 static int hf_sflow_5_extended_80211_tx_bssid
;
601 static int hf_sflow_245_ip_tcp_flag_rst
;
602 static int hf_sflow_245_ip_tcp_flag_ack
;
603 static int hf_sflow_245_ip_tcp_flag_cwr
;
604 static int hf_sflow_5_extended_80211_tx_retransmissions
;
605 static int hf_sflow_5_extended_80211_rx_version
;
606 static int hf_sflow_flow_sample_dropped_packets
;
607 static int hf_sflow_counters_sample_expanded_source_id_index
;
608 static int hf_sflow_245_header_payload_stripped
;
609 static int hf_sflow_245_sampled_header_length
;
610 static int hf_sflow_245_ethernet_destination_mac_address
;
611 static int hf_sflow_counters_sample_source_id_class
;
612 static int hf_sflow_5_extended_url_url_length
;
613 static int hf_sflow_flow_sample_source_id_type
;
614 static int hf_sflow_5_extended_mpls_fec_address_prefix_length
;
615 static int hf_sflow_flow_sample_sequence_number
;
616 static int hf_sflow_counters_sample_source_id_index
;
617 static int hf_sflow_counters_sample_counters_records
;
618 static int hf_sflow_5_extended_mpls_tunnel_cos_value
;
619 static int hf_sflow_5_extended_mpls_vc_id
;
620 static int hf_sflow_24_flow_sample_output_interface_value
;
621 static int hf_sflow_5_flow_sample_output_interface_expanded_value
;
622 static int hf_sflow_5_extended_user_destination_user
;
623 static int hf_sflow_245_as_type
;
624 static int hf_sflow_counters_sample_index
;
625 static int hf_sflow_5_extended_url_url
;
626 static int hf_sflow_flow_sample_index
;
627 static int hf_sflow_5_extended_80211_rx_ssid
;
628 static int hf_sflow_5_extended_mpls_vc_instance_name
;
629 static int hf_sflow_5_extended_mpls_tunnel_name
;
630 static int hf_sflow_5_extended_80211_payload
;
631 static int hf_sflow_5_extended_user_source_user
;
632 static int hf_sflow_5_extended_url_host
;
633 static int hf_sflow_5_extended_80211_tx_ssid
;
634 static int hf_sflow_5_extended_url_direction
;
635 static int hf_sflow_5_extended_mpls_ftn_description
;
636 static int hf_sflow_245_ip_protocol
;
638 static int hf_sflow_lag_port_padding
;
639 static int hf_sflow_lag_port_actorsystemid
;
640 static int hf_sflow_lag_port_partneropersystemid
;
641 static int hf_sflow_lag_port_attachedaggid
;
642 static int hf_sflow_lag_port_state
;
643 static int hf_sflow_lag_port_actoradminstate
;
644 static int hf_sflow_lag_port_actoroperstate
;
645 static int hf_sflow_lag_port_partneradminstate
;
646 static int hf_sflow_lag_port_partneroperstate
;
647 static int hf_sflow_lag_port_reserved
;
648 static int hf_sflow_5_lag_port_actoradminstate
;
649 static int hf_sflow_5_lag_port_actoroperstate
;
650 static int hf_sflow_5_lag_port_partneradminstate
;
651 static int hf_sflow_5_lag_port_partneroperstate
;
652 static int hf_sflow_lag_port_stats_lacpdusrx
;
653 static int hf_sflow_lag_port_stats_markerpdusrx
;
654 static int hf_sflow_lag_port_stats_markerresponsepdusrx
;
655 static int hf_sflow_lag_port_stats_unknownrx
;
656 static int hf_sflow_lag_port_stats_illegalrx
;
657 static int hf_sflow_lag_port_stats_lacpdustx
;
658 static int hf_sflow_lag_port_stats_markerpdustx
;
659 static int hf_sflow_lag_port_stats_markerresponsepdustx
;
661 /* Initialize the subtree pointers */
662 static int ett_sflow_245
;
663 static int ett_sflow_245_sample
;
664 static int ett_sflow_5_flow_record
;
665 static int ett_sflow_5_counters_record
;
666 static int ett_sflow_5_mpls_in_label_stack
;
667 static int ett_sflow_5_mpls_out_label_stack
;
668 static int ett_sflow_245_extended_data
;
669 static int ett_sflow_245_gw_as_dst
;
670 static int ett_sflow_245_gw_as_dst_seg
;
671 static int ett_sflow_245_gw_community
;
672 static int ett_sflow_245_sampled_header
;
673 static int ett_sflow_lag_port_state_flags
;
674 static int ett_sflow_5_output_interface
;
676 static expert_field ei_sflow_invalid_address_type
;
678 static dissector_table_t header_subdissector_table
;
680 static const unit_name_string units_total_packets
= { " total packet", " total packets" };
682 void proto_reg_handoff_sflow_245(void);
684 /* dissect a sampled header - layer 2 protocols */
686 dissect_sflow_245_sampled_header(tvbuff_t
*tvb
, packet_info
*pinfo
,
687 proto_tree
*tree
, volatile int offset
) {
688 uint32_t version
, header_proto
, frame_length
;
689 uint32_t header_length
;
691 proto_tree
*sflow_245_header_tree
;
693 /* stuff for saving column state before calling other dissectors.
694 * Thanks to Guy Harris for the tip. */
696 bool save_in_error_pkt
;
697 address save_dl_src
, save_dl_dst
, save_net_src
, save_net_dst
, save_src
, save_dst
;
699 version
= tvb_get_ntohl(tvb
, 0);
700 header_proto
= tvb_get_ntohl(tvb
, offset
);
701 proto_tree_add_item(tree
, hf_sflow_245_header_protocol
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
703 frame_length
= tvb_get_ntohl(tvb
, offset
);
704 proto_tree_add_item(tree
, hf_sflow_245_header_frame_length
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
708 proto_tree_add_item(tree
, hf_sflow_245_header_payload_stripped
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
712 proto_tree_add_item_ret_uint(tree
, hf_sflow_245_sampled_header_length
, tvb
, offset
, 4, ENC_BIG_ENDIAN
, &header_length
);
715 if (header_length
% 4) /* XDR requires 4-byte alignment */
716 header_length
+= (4 - (header_length
% 4));
719 ti
= proto_tree_add_item(tree
, hf_sflow_245_header
, tvb
, offset
, header_length
, ENC_NA
);
720 sflow_245_header_tree
= proto_item_add_subtree(ti
, ett_sflow_245_sampled_header
);
722 /* hand the header off to the appropriate dissector. It's probably
723 * a short frame, so ignore any exceptions. */
724 next_tvb
= tvb_new_subset_length_caplen(tvb
, offset
, header_length
, frame_length
);
726 /* save some state */
727 save_writable
= col_get_writable(pinfo
->cinfo
, -1);
730 If sFlow samples a TCP packet it is very likely that the
731 TCP analysis will flag the packet as having some error with
732 the sequence numbers. sFlow only report on a "sample" of
733 traffic so many packets will not be reported on. This is
734 most obvious if the colorizing rules are on, but will also
735 cause confusion if you attempt to filter on
736 "tcp.analysis.flags".
738 The following only works to suppress IP/TCP errors, but
739 it is a start anyway. Other protocols carried as payloads
740 may exhibit similar issues.
742 I think what is really needed is a more general
743 "protocol_as_payload" flag. Of course then someone has to
744 play whack-a-mole and add code to implement it to any
745 protocols that could be carried as a payload. In the case
746 of sFlow that pretty much means anything on your network.
748 save_in_error_pkt
= pinfo
->flags
.in_error_pkt
;
749 if (!global_analyze_samp_ip_headers
) {
750 pinfo
->flags
.in_error_pkt
= true;
753 col_set_writable(pinfo
->cinfo
, -1, false);
754 copy_address_shallow(&save_dl_src
, &pinfo
->dl_src
);
755 copy_address_shallow(&save_dl_dst
, &pinfo
->dl_dst
);
756 copy_address_shallow(&save_net_src
, &pinfo
->net_src
);
757 copy_address_shallow(&save_net_dst
, &pinfo
->net_dst
);
758 copy_address_shallow(&save_src
, &pinfo
->src
);
759 copy_address_shallow(&save_dst
, &pinfo
->dst
);
763 if ((global_dissect_samp_headers
== false) ||
764 !dissector_try_uint(header_subdissector_table
, header_proto
, next_tvb
, pinfo
, sflow_245_header_tree
))
766 call_data_dissector(next_tvb
, pinfo
, sflow_245_header_tree
);
770 CATCH_BOUNDS_ERRORS
{
774 /* restore saved state */
775 col_set_writable(pinfo
->cinfo
, -1, save_writable
);
776 pinfo
->flags
.in_error_pkt
= save_in_error_pkt
;
777 copy_address_shallow(&pinfo
->dl_src
, &save_dl_src
);
778 copy_address_shallow(&pinfo
->dl_dst
, &save_dl_dst
);
779 copy_address_shallow(&pinfo
->net_src
, &save_net_src
);
780 copy_address_shallow(&pinfo
->net_dst
, &save_net_dst
);
781 copy_address_shallow(&pinfo
->src
, &save_src
);
782 copy_address_shallow(&pinfo
->dst
, &save_dst
);
784 offset
+= header_length
;
789 dissect_sflow_245_address_type(tvbuff_t
*tvb
, packet_info
*pinfo
,
790 proto_tree
*tree
, int offset
,
791 struct sflow_address_type
*hf_type
,
796 addr_type
= tvb_get_ntohl(tvb
, offset
);
800 case ADDR_TYPE_UNKNOWN
:
805 proto_tree_add_item(tree
, hf_type
->hf_addr_v4
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
809 proto_tree_add_item(tree
, hf_type
->hf_addr_v6
, tvb
, offset
, 16, ENC_NA
);
812 /* Invalid address type, or a type we don't understand; we don't
813 know the length. We treat it as having no contents; that
814 doesn't trap us in an endless loop, as we at least include
815 the address type and thus at least advance the offset by 4.
816 Note that we have a problem, though. */
818 proto_tree_add_expert_format(tree
, pinfo
, &ei_sflow_invalid_address_type
, tvb
,
819 offset
- 4, 4, "Unknown address type (%u)", addr_type
);
828 set_address_tvb(addr
, AT_IPv4
, len
, tvb
, offset
);
831 set_address_tvb(addr
, AT_IPv6
, len
, tvb
, offset
);
839 /* extended switch data, after the packet data */
841 dissect_sflow_245_extended_switch(tvbuff_t
*tvb
, proto_tree
*tree
, int offset
) {
842 proto_tree_add_item(tree
, hf_sflow_245_vlan_in
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
844 proto_tree_add_item(tree
, hf_sflow_245_pri_in
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
846 proto_tree_add_item(tree
, hf_sflow_245_vlan_out
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
848 proto_tree_add_item(tree
, hf_sflow_245_pri_out
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
854 /* extended router data, after the packet data */
856 dissect_sflow_245_extended_router(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, int offset
) {
857 struct sflow_address_type addr_type
;
859 addr_type
.hf_addr_v4
= hf_sflow_245_nexthop_v4
;
860 addr_type
.hf_addr_v6
= hf_sflow_245_nexthop_v6
;
862 offset
= dissect_sflow_245_address_type(tvb
, pinfo
, tree
, offset
, &addr_type
, NULL
);
863 proto_tree_add_item(tree
, hf_sflow_245_nexthop_src_mask
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
865 proto_tree_add_item(tree
, hf_sflow_245_nexthop_dst_mask
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
870 /* extended MPLS data */
872 dissect_sflow_5_extended_mpls_data(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, int offset
) {
873 uint32_t in_label_count
, out_label_count
, label
, i
, j
;
874 proto_tree
*in_stack
;
875 proto_tree
*out_stack
;
876 struct sflow_address_type addr_type
;
878 addr_type
.hf_addr_v4
= hf_sflow_245_nexthop_v4
;
879 addr_type
.hf_addr_v6
= hf_sflow_245_nexthop_v6
;
881 offset
= dissect_sflow_245_address_type(tvb
, pinfo
, tree
, offset
, &addr_type
, NULL
);
883 in_label_count
= tvb_get_ntohl(tvb
, offset
);
884 proto_tree_add_item(tree
, hf_sflow_245_extended_mpls_in_label_stack_entries
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
887 in_stack
= proto_tree_add_subtree(tree
, tvb
, offset
, -1, ett_sflow_5_mpls_in_label_stack
, NULL
, "In Label Stack");
889 /* by applying the mask, we avoid possible corrupted data that causes huge number of loops
890 * 255 is a sensible limit of label count */
891 for (i
= 0, j
= 0; i
< (in_label_count
& 0x000000ff); i
++, j
+= 4) {
892 label
= tvb_get_ntohl(tvb
, offset
+ j
);
893 proto_tree_add_uint_format(in_stack
, hf_sflow_245_extended_mpls_in_label
, tvb
, offset
, 4,
894 label
, "Label %u: %u", i
+ 1, label
);
896 offset
+= (in_label_count
* 4);
898 out_label_count
= tvb_get_ntohl(tvb
, offset
);
899 proto_tree_add_item(tree
, hf_sflow_245_extended_mpls_out_label_stack_entries
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
902 out_stack
= proto_tree_add_subtree(tree
, tvb
, offset
, -1, ett_sflow_5_mpls_in_label_stack
, NULL
, "Out Label Stack");
904 /* by applying the mask, we avoid possible corrupted data that causes huge number of loops
905 * 255 is a sensible limit of label count */
906 for (i
= 0, j
= 0; i
< (out_label_count
& 0x000000ff); i
++, j
+= 4) {
907 label
= tvb_get_ntohl(tvb
, offset
+ j
);
908 proto_tree_add_uint_format(out_stack
, hf_sflow_245_extended_mpls_out_label
, tvb
, offset
, 4,
909 label
, "Label %u: %u", i
+ 1, label
);
911 offset
= offset
+ out_label_count
* 4;
916 /* extended NAT data */
918 dissect_sflow_5_extended_nat(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, int offset
) {
919 struct sflow_address_type addr_type
;
921 addr_type
.hf_addr_v4
= hf_sflow_245_ipv4_src
;
922 addr_type
.hf_addr_v6
= hf_sflow_245_ipv6_src
;
924 offset
= dissect_sflow_245_address_type(tvb
, pinfo
, tree
, offset
, &addr_type
, NULL
);
926 addr_type
.hf_addr_v4
= hf_sflow_245_ipv4_dst
;
927 addr_type
.hf_addr_v6
= hf_sflow_245_ipv6_dst
;
929 offset
= dissect_sflow_245_address_type(tvb
, pinfo
, tree
, offset
, &addr_type
, NULL
);
934 /* extended gateway data, after the packet data */
936 dissect_sflow_245_extended_gateway(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, int offset
) {
938 int32_t i
, j
, comm_len
, dst_len
, dst_seg_len
;
942 uint32_t version
= tvb_get_ntohl(tvb
, 0); /* get sFlow version */
944 proto_tree
*sflow_245_dst_as_tree
;
945 proto_tree
*sflow_245_comm_tree
;
946 proto_tree
*sflow_245_dst_as_seg_tree
;
948 /* sFlow v5 contains next hop router IP address */
950 struct sflow_address_type addr_type
;
952 addr_type
.hf_addr_v4
= hf_sflow_245_nexthop_v4
;
953 addr_type
.hf_addr_v6
= hf_sflow_245_nexthop_v6
;
955 offset
= dissect_sflow_245_address_type(tvb
, pinfo
, tree
, offset
, &addr_type
, NULL
);
958 proto_tree_add_item(tree
, hf_sflow_245_as
, tvb
, offset
+ len
, 4, ENC_BIG_ENDIAN
);
961 proto_tree_add_item(tree
, hf_sflow_245_src_as
, tvb
, offset
+ len
, 4, ENC_BIG_ENDIAN
);
964 proto_tree_add_item(tree
, hf_sflow_245_src_peer_as
, tvb
, offset
+ len
, 4, ENC_BIG_ENDIAN
);
967 dst_len
= tvb_get_ntohl(tvb
, offset
+ len
);
968 ti
= proto_tree_add_uint(tree
, hf_sflow_245_dst_as_entries
, tvb
, offset
+ len
, 4, dst_len
);
969 sflow_245_dst_as_tree
= proto_item_add_subtree(ti
, ett_sflow_245_gw_as_dst
);
972 for (i
= 0; i
< dst_len
; i
++) {
974 /* Version 2 AS paths are different than versions >= 4 as
977 There is no type encoded in the packet.
979 The destination ASs are encoded as an array of integers
980 rather as an array of arrays of integers. I just
981 pretended they were encoded as an array of arrays with
982 an implicit length of 1 to not have to do two
983 completely separate blocks for the different versions.
985 Having a subtree for "arrays" guaranteed to have only a
986 single element proved cumbersome to navigate so I moved
987 the creation of the subtree to only happen for versions
991 sflow_245_dst_as_seg_tree
= sflow_245_dst_as_tree
;
993 path_type
= tvb_get_ntohl(tvb
, offset
+ len
);
995 dst_seg_len
= tvb_get_ntohl(tvb
, offset
+ len
);
998 ti
= proto_tree_add_uint_format(tree
, hf_sflow_245_as_type
, tvb
, offset
+ len
- kludge
, kludge
, path_type
,
999 "%s, (%u entries)", val_to_str_const(path_type
, sflow_245_as_types
, "Unknown AS type"), dst_seg_len
);
1000 sflow_245_dst_as_seg_tree
= proto_item_add_subtree(ti
, ett_sflow_245_gw_as_dst_seg
);
1003 for (j
= 0; j
< dst_seg_len
; j
++) {
1004 proto_tree_add_item(sflow_245_dst_as_seg_tree
, hf_sflow_245_dst_as
, tvb
, offset
+ len
, 4, ENC_BIG_ENDIAN
);
1011 comm_len
= tvb_get_ntohl(tvb
, offset
+ len
);
1013 ti
= proto_tree_add_uint(tree
, hf_sflow_245_community_entries
, tvb
, offset
+ len
, 4, comm_len
);
1014 sflow_245_comm_tree
= proto_item_add_subtree(ti
, ett_sflow_245_gw_community
);
1016 for (i
= 0; i
< comm_len
; i
++) {
1017 proto_tree_add_item(sflow_245_comm_tree
,
1018 hf_sflow_245_dst_as
, tvb
, offset
+ len
,
1023 proto_tree_add_item(tree
, hf_sflow_245_localpref
, tvb
, offset
+ len
, 4, ENC_BIG_ENDIAN
);
1028 return offset
+ len
;
1031 /* sflow v5 ethernet frame data */
1033 dissect_sflow_5_ethernet_frame(tvbuff_t
*tvb
, proto_tree
*tree
, int offset
) {
1035 proto_tree_add_item(tree
, hf_sflow_245_ethernet_length_of_mac_packet
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1038 proto_tree_add_item(tree
, hf_sflow_245_ethernet_source_mac_address
, tvb
, offset
, 6, ENC_NA
);
1039 /* Padded to 4 byte offset */
1042 proto_tree_add_item(tree
, hf_sflow_245_ethernet_destination_mac_address
, tvb
, offset
, 6, ENC_NA
);
1043 /* Padded to 4 byte offset */
1046 proto_tree_add_item(tree
, hf_sflow_245_ethernet_packet_type
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1052 /* sflow v5 IPv4 data */
1054 dissect_sflow_5_ipv4(tvbuff_t
*tvb
, proto_tree
*tree
, int offset
) {
1056 proto_tree_add_item(tree
, hf_sflow_245_length_of_ip_packet
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1059 proto_tree_add_item(tree
, hf_sflow_245_ip_protocol
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1062 proto_tree_add_item(tree
, hf_sflow_245_ipv4_src
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1065 proto_tree_add_item(tree
, hf_sflow_245_ipv4_dst
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1068 proto_tree_add_item(tree
, hf_sflow_245_ip_source_port
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1071 proto_tree_add_item(tree
, hf_sflow_245_ip_destination_port
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1074 proto_tree_add_item(tree
, hf_sflow_245_ip_tcp_flag_cwr
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1075 proto_tree_add_item(tree
, hf_sflow_245_ip_tcp_flag_ece
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1076 proto_tree_add_item(tree
, hf_sflow_245_ip_tcp_flag_urg
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1077 proto_tree_add_item(tree
, hf_sflow_245_ip_tcp_flag_ack
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1078 proto_tree_add_item(tree
, hf_sflow_245_ip_tcp_flag_psh
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1079 proto_tree_add_item(tree
, hf_sflow_245_ip_tcp_flag_rst
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1080 proto_tree_add_item(tree
, hf_sflow_245_ip_tcp_flag_syn
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1081 proto_tree_add_item(tree
, hf_sflow_245_ip_tcp_flag_fin
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1084 /* 7 bits for type of service, plus 1 reserved bit */
1085 proto_tree_add_item(tree
, hf_sflow_245_ipv4_precedence_type
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1086 proto_tree_add_item(tree
, hf_sflow_245_ipv4_delay
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1087 proto_tree_add_item(tree
, hf_sflow_245_ipv4_throughput
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1088 proto_tree_add_item(tree
, hf_sflow_245_ipv4_reliability
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1089 proto_tree_add_item(tree
, hf_sflow_245_ipv4_cost
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1095 /* sflow v5 IPv6 data */
1097 dissect_sflow_5_ipv6(tvbuff_t
*tvb
, proto_tree
*tree
, int offset
) {
1099 proto_tree_add_item(tree
, hf_sflow_245_length_of_ip_packet
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1102 proto_tree_add_item(tree
, hf_sflow_245_ip_protocol
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1105 proto_tree_add_item(tree
, hf_sflow_245_ipv6_src
, tvb
, offset
, 16, ENC_NA
);
1108 proto_tree_add_item(tree
, hf_sflow_245_ipv6_dst
, tvb
, offset
, 16, ENC_NA
);
1111 proto_tree_add_item(tree
, hf_sflow_245_ip_source_port
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1114 proto_tree_add_item(tree
, hf_sflow_245_ip_destination_port
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1117 proto_tree_add_item(tree
, hf_sflow_245_ip_tcp_flag_cwr
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1118 proto_tree_add_item(tree
, hf_sflow_245_ip_tcp_flag_ece
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1119 proto_tree_add_item(tree
, hf_sflow_245_ip_tcp_flag_urg
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1120 proto_tree_add_item(tree
, hf_sflow_245_ip_tcp_flag_ack
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1121 proto_tree_add_item(tree
, hf_sflow_245_ip_tcp_flag_psh
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1122 proto_tree_add_item(tree
, hf_sflow_245_ip_tcp_flag_rst
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1123 proto_tree_add_item(tree
, hf_sflow_245_ip_tcp_flag_syn
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1124 proto_tree_add_item(tree
, hf_sflow_245_ip_tcp_flag_fin
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1127 /* Priority -- Traffic class field enables a source to identify the desired
1128 delivery priority of the packets. Priority values are divided into
1129 ranges: traffic where the source provides congestion control and
1130 non-congestion control traffic.
1132 It is displayed as unsigned integer here according to sFlow specification */
1134 proto_tree_add_item(tree
, hf_sflow_245_ipv6_priority
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1140 /* sflow v5 user data */
1142 dissect_sflow_5_extended_user(tvbuff_t
*tvb
, proto_tree
*tree
, int offset
) {
1143 uint32_t src_length
, dest_length
;
1145 /* charset is not processed here, all chars are assumed to be ASCII */
1146 proto_tree_add_item(tree
, hf_sflow_5_extended_user_source_character_set
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1149 src_length
= tvb_get_ntohl(tvb
, offset
);
1150 proto_tree_add_item(tree
, hf_sflow_5_extended_user_source_user_string_length
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1153 /* extract source user info char by char */
1154 proto_tree_add_item(tree
, hf_sflow_5_extended_user_source_user
, tvb
, offset
, src_length
, ENC_NA
|ENC_ASCII
);
1155 offset
+= src_length
;
1156 /* get the correct offset by adding padding byte count */
1158 offset
+= (4 - src_length
% 4);
1160 /* charset is not processed here, all chars are assumed to be ASCII */
1161 proto_tree_add_item(tree
, hf_sflow_5_extended_user_destination_character_set
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1164 dest_length
= tvb_get_ntohl(tvb
, offset
);
1165 proto_tree_add_item(tree
, hf_sflow_5_extended_user_destination_user_string_length
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1168 /* extract destination user info char by char */
1169 proto_tree_add_item(tree
, hf_sflow_5_extended_user_destination_user
, tvb
, offset
, dest_length
, ENC_NA
|ENC_ASCII
);
1170 offset
+= dest_length
;
1171 /* get the correct offset by adding padding byte count */
1172 if (dest_length
% 4)
1173 offset
+= (4 - dest_length
% 4);
1178 /* sflow v5 URL data */
1180 dissect_sflow_5_extended_url(tvbuff_t
*tvb
, proto_tree
*tree
, int offset
) {
1181 uint32_t direction
, url_length
, host_length
;
1183 direction
= tvb_get_ntohl(tvb
, offset
);
1184 switch (direction
) {
1186 proto_tree_add_uint_format(tree
, hf_sflow_5_extended_url_direction
, tvb
, offset
, 4, direction
,
1187 "Source Address is Server(%u)", direction
);
1190 proto_tree_add_uint_format(tree
, hf_sflow_5_extended_url_direction
, tvb
, offset
, 4, direction
,
1191 "Destination Address is Server (%u)", direction
);
1194 proto_tree_add_uint_format(tree
, hf_sflow_5_extended_url_direction
, tvb
, offset
, 4, direction
,
1195 "Server Unspecified (%u)", direction
);
1200 url_length
= tvb_get_ntohl(tvb
, offset
);
1201 proto_tree_add_item(tree
, hf_sflow_5_extended_url_url_length
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1204 /* extract URL char by char */
1205 proto_tree_add_item(tree
, hf_sflow_5_extended_url_url
, tvb
, offset
, url_length
, ENC_NA
|ENC_ASCII
);
1206 offset
+= url_length
;
1207 /* get the correct offset by adding padding byte count */
1209 offset
+= (4 - url_length
% 4);
1211 host_length
= tvb_get_ntohl(tvb
, offset
);
1212 proto_tree_add_item(tree
, hf_sflow_5_extended_url_host_length
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1215 /* extract host info char by char */
1216 proto_tree_add_item(tree
, hf_sflow_5_extended_url_host
, tvb
, offset
, host_length
, ENC_NA
|ENC_ASCII
);
1217 offset
+= host_length
;
1218 /* get the correct offset by adding padding byte count */
1219 if (host_length
% 4)
1220 offset
+= (4 - host_length
% 4);
1225 /* sflow v5 MPLS tunnel */
1227 dissect_sflow_5_extended_mpls_tunnel(tvbuff_t
*tvb
, proto_tree
*tree
, int offset
) {
1228 uint32_t name_length
;
1230 name_length
= tvb_get_ntohl(tvb
, offset
);
1231 proto_tree_add_item(tree
, hf_sflow_5_extended_mpls_tunnel_name_length
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1234 /* extract tunnel name char by char */
1235 proto_tree_add_item(tree
, hf_sflow_5_extended_mpls_tunnel_name
, tvb
, offset
, name_length
, ENC_NA
|ENC_ASCII
);
1236 offset
+= name_length
;
1237 /* get the correct offset by adding padding byte count */
1238 if (name_length
% 4)
1239 offset
+= (4 - name_length
% 4);
1241 proto_tree_add_item(tree
, hf_sflow_5_extended_mpls_tunnel_id
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1244 proto_tree_add_item(tree
, hf_sflow_5_extended_mpls_tunnel_cos_value
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1250 /* sflow v5 MPLS VC */
1252 dissect_sflow_5_extended_mpls_vc(tvbuff_t
*tvb
, proto_tree
*tree
, int offset
) {
1253 uint32_t name_length
;
1255 name_length
= tvb_get_ntohl(tvb
, offset
);
1256 proto_tree_add_item(tree
, hf_sflow_5_extended_mpls_vc_instance_name_length
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1259 /* extract source user info char by char */
1260 proto_tree_add_item(tree
, hf_sflow_5_extended_mpls_vc_instance_name
, tvb
, offset
, name_length
, ENC_NA
|ENC_ASCII
);
1261 offset
+= name_length
;
1262 /* get the correct offset by adding padding byte count */
1263 if (name_length
% 4)
1264 offset
+= (4 - name_length
% 4);
1266 proto_tree_add_item(tree
, hf_sflow_5_extended_mpls_vc_id
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1269 proto_tree_add_item(tree
, hf_sflow_5_extended_mpls_vc_label_cos_value
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1275 /* sflow v5 MPLS FEC */
1277 dissect_sflow_5_extended_mpls_fec(tvbuff_t
*tvb
, proto_tree
*tree
, int offset
) {
1280 length
= tvb_get_ntohl(tvb
, offset
);
1281 proto_tree_add_item(tree
, hf_sflow_5_extended_mpls_ftn_description_length
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1284 /* extract MPLS FTN description char by char */
1285 proto_tree_add_item(tree
, hf_sflow_5_extended_mpls_ftn_description
, tvb
, offset
, length
, ENC_NA
|ENC_ASCII
);
1287 /* get the correct offset by adding padding byte count */
1289 offset
+= (4 - length
% 4);
1291 proto_tree_add_item(tree
, hf_sflow_5_extended_mpls_ftn_mask
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1297 /* sflow v5 MPLS LVP FEC */
1299 dissect_sflow_5_extended_mpls_lvp_fec(tvbuff_t
*tvb
, proto_tree
*tree
, int offset
) {
1301 proto_tree_add_item(tree
, hf_sflow_5_extended_mpls_fec_address_prefix_length
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1306 /* sflow v5 extended VLAN tunnel */
1308 dissect_sflow_5_extended_vlan_tunnel(tvbuff_t
*tvb
, proto_tree
*tree
, int offset
) {
1311 num
= tvb_get_ntohl(tvb
, offset
);
1312 proto_tree_add_item(tree
, hf_sflow_5_extended_vlan_tunnel_number_of_layers
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1315 /* loop strip 802.1Q TPID/TCI layers. each TPID/TCI pair is represented as a
1316 single 32 bit integer layers listed from outermost to innermost */
1317 for (i
= 0; i
< num
; i
++) {
1318 proto_tree_add_item(tree
, hf_sflow_5_extended_vlan_tunnel_tpid_tci_pair
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1325 /* sflow v5 extended 802.11 payload */
1327 dissect_sflow_5_extended_80211_payload(tvbuff_t
*tvb
, proto_tree
*tree
, int offset
) {
1328 uint32_t cipher_suite
, OUI
, suite_type
, length
;
1330 cipher_suite
= tvb_get_ntohl(tvb
, offset
);
1331 OUI
= cipher_suite
>> 8;
1332 suite_type
= cipher_suite
& 0x000000ff;
1334 if (OUI
== 0x000FAC) {
1335 proto_tree_add_uint_format_value(tree
, hf_sflow_5_extended_80211_oui
, tvb
, offset
, 3, OUI
, "Default (0x%X)", OUI
);
1337 proto_tree_add_item(tree
, hf_sflow_5_extended_80211_suite_type
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1339 proto_tree_add_uint_format_value(tree
, hf_sflow_5_extended_80211_oui
, tvb
, offset
, 3, OUI
, "Other vendor (0x%X)", OUI
);
1341 proto_tree_add_uint_format_value(tree
, hf_sflow_5_extended_80211_suite_type
, tvb
, offset
, 1,
1342 suite_type
, "vendor specific (%u)", suite_type
);
1346 length
= tvb_get_ntohl(tvb
, offset
);
1347 proto_tree_add_item(tree
, hf_sflow_5_extended_80211_payload_length
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1350 /* extract data byte by byte */
1351 proto_tree_add_item(tree
, hf_sflow_5_extended_80211_payload
, tvb
, offset
, length
, ENC_NA
);
1353 /* get the correct offset by adding padding byte count */
1355 offset
+= (4 - length
% 4);
1360 /* sflow v5 extended 802.11 rx */
1362 dissect_sflow_5_extended_80211_rx(tvbuff_t
*tvb
, proto_tree
*tree
, int offset
) {
1363 uint32_t ssid_length
, duration
;
1365 /* extract SSID char by char. max char count = 32 */
1366 ssid_length
= tvb_get_ntohl(tvb
, offset
);
1368 proto_tree_add_item(tree
, hf_sflow_5_extended_80211_rx_ssid
, tvb
, offset
, ssid_length
, ENC_NA
|ENC_ASCII
);
1369 offset
+= ssid_length
;
1370 /* get the correct offset by adding padding byte count */
1371 if (ssid_length
% 4)
1372 offset
+= (4 - ssid_length
% 4);
1374 proto_tree_add_item(tree
, hf_sflow_5_extended_80211_rx_bssid
, tvb
, offset
, 6, ENC_NA
);
1375 /* Padded to 4 byte offset */
1378 proto_tree_add_item(tree
, hf_sflow_5_extended_80211_rx_version
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1381 proto_tree_add_item(tree
, hf_sflow_5_extended_80211_rx_channel
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1384 proto_tree_add_item(tree
, hf_sflow_5_extended_80211_rx_speed
, tvb
, offset
, 8, ENC_BIG_ENDIAN
);
1387 proto_tree_add_item(tree
, hf_sflow_5_extended_80211_rx_rsni
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1390 proto_tree_add_item(tree
, hf_sflow_5_extended_80211_rx_rcpi
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1393 duration
= tvb_get_ntohl(tvb
, offset
);
1394 if (duration
== 0) {
1395 proto_tree_add_uint_format_value(tree
, hf_sflow_5_extended_80211_rx_packet_duration
, tvb
, offset
, 4, duration
, "Unknown");
1397 proto_tree_add_item(tree
, hf_sflow_5_extended_80211_rx_packet_duration
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1404 /* sflow v5 extended 802.11 tx */
1406 dissect_sflow_5_extended_80211_tx(tvbuff_t
*tvb
, proto_tree
*tree
, int offset
) {
1407 uint32_t ssid_length
, transmissions
, packet_duration
, retrans_duration
;
1409 /* extract SSID char by char. max char count = 32 */
1410 ssid_length
= tvb_get_ntohl(tvb
, offset
);
1411 if (ssid_length
> 32)
1414 proto_tree_add_item(tree
, hf_sflow_5_extended_80211_tx_ssid
, tvb
, offset
, ssid_length
, ENC_NA
|ENC_ASCII
);
1415 offset
+= ssid_length
;
1416 /* get the correct offset by adding padding byte count */
1417 if (ssid_length
% 4)
1418 offset
+= (4 - ssid_length
% 4);
1420 proto_tree_add_item(tree
, hf_sflow_5_extended_80211_tx_bssid
, tvb
, offset
, 6, ENC_NA
);
1421 /* Padded to 4 byte offset */
1424 proto_tree_add_item(tree
, hf_sflow_5_extended_80211_tx_version
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1427 transmissions
= tvb_get_ntohl(tvb
, offset
);
1428 switch (transmissions
) {
1430 proto_tree_add_uint_format_value(tree
, hf_sflow_5_extended_80211_tx_retransmissions
, tvb
, offset
, 4,
1434 proto_tree_add_uint_format_value(tree
, hf_sflow_5_extended_80211_tx_retransmissions
, tvb
, offset
, 4,
1435 1, "Packet transmitted successfully on first attempt");
1438 proto_tree_add_uint(tree
, hf_sflow_5_extended_80211_tx_retransmissions
, tvb
, offset
, 4, transmissions
- 1);
1443 packet_duration
= tvb_get_ntohl(tvb
, offset
);
1444 if (packet_duration
== 0) {
1445 proto_tree_add_uint_format_value(tree
, hf_sflow_5_extended_80211_tx_packet_duration
, tvb
, offset
, 4, packet_duration
, "Unknown");
1447 proto_tree_add_item(tree
, hf_sflow_5_extended_80211_tx_packet_duration
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1451 retrans_duration
= tvb_get_ntohl(tvb
, offset
);
1452 if (retrans_duration
== 0) {
1453 proto_tree_add_uint_format_value(tree
, hf_sflow_5_extended_80211_tx_retransmission_duration
, tvb
, offset
, 4, retrans_duration
, "Unknown");
1455 proto_tree_add_item(tree
, hf_sflow_5_extended_80211_tx_retransmission_duration
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1459 proto_tree_add_item(tree
, hf_sflow_5_extended_80211_tx_channel
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1462 proto_tree_add_item(tree
, hf_sflow_5_extended_80211_tx_speed
, tvb
, offset
, 8, ENC_BIG_ENDIAN
);
1465 proto_tree_add_item(tree
, hf_sflow_5_extended_80211_tx_power
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1471 /* sflow v5 extended 802.11 aggregation */
1473 dissect_sflow_5_extended_80211_aggregation(tvbuff_t
*tvb _U_
, proto_tree
*tree _U_
, int offset
) {
1478 /* dissect an sflow v2/4 flow sample */
1480 dissect_sflow_24_flow_sample(tvbuff_t
*tvb
, packet_info
*pinfo
,
1481 proto_tree
*tree
, int offset
, proto_item
*parent
) {
1482 uint32_t sequence_number
, sampling_rate
, output
;
1484 proto_tree
*extended_data_tree
;
1486 uint32_t packet_type
, extended_data
, ext_type
, i
;
1488 sequence_number
= tvb_get_ntohl(tvb
, offset
);
1489 proto_tree_add_item(tree
, hf_sflow_flow_sample_sequence_number
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1490 proto_item_append_text(parent
, ", seq %u", sequence_number
);
1491 proto_tree_add_item(tree
, hf_sflow_flow_sample_source_id_class
, tvb
, offset
+ 4, 4, ENC_BIG_ENDIAN
);
1492 proto_tree_add_item(tree
, hf_sflow_flow_sample_index
, tvb
, offset
+ 4, 4, ENC_BIG_ENDIAN
);
1493 sampling_rate
= tvb_get_ntohl(tvb
, offset
+ 8);
1494 proto_tree_add_uint_format_value(tree
, hf_sflow_flow_sample_sampling_rate
, tvb
, offset
+ 8, 4,
1495 sampling_rate
, "1 out of %u packets",
1498 proto_tree_add_item(tree
, hf_sflow_flow_sample_sample_pool
, tvb
, offset
+ 12, 4, ENC_BIG_ENDIAN
);
1499 proto_tree_add_item(tree
, hf_sflow_flow_sample_dropped_packets
, tvb
, offset
+ 16, 4, ENC_BIG_ENDIAN
);
1500 proto_tree_add_item(tree
, hf_sflow_flow_sample_input_interface
, tvb
, offset
+ 20, 4, ENC_BIG_ENDIAN
);
1501 output
= tvb_get_ntohl(tvb
, offset
+ 24);
1502 if (output
& 0x80000000) {
1503 output
& 0x7fffffff ?
1504 proto_tree_add_uint_format_value(tree
, hf_sflow_24_flow_sample_multiple_outputs
, tvb
, offset
+ 24, 4,
1505 output
& 0x7fffffff, "%u interfaces", output
& 0x7fffffff) :
1506 proto_tree_add_uint_format_value(tree
, hf_sflow_24_flow_sample_multiple_outputs
, tvb
, offset
+ 24, 4,
1507 0x80000000, "unknown number");
1509 proto_tree_add_item(tree
, hf_sflow_24_flow_sample_output_interface
, tvb
, offset
+ 24, 4, ENC_BIG_ENDIAN
);
1513 /* what kind of flow sample is it? */
1514 packet_type
= tvb_get_ntohl(tvb
, offset
);
1515 proto_tree_add_item(tree
, hf_sflow_245_packet_information_type
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1517 switch (packet_type
) {
1518 case SFLOW_245_PACKET_DATA_TYPE_HEADER
:
1519 offset
= dissect_sflow_245_sampled_header(tvb
, pinfo
, tree
, offset
);
1521 case SFLOW_245_PACKET_DATA_TYPE_IPV4
:
1522 case SFLOW_245_PACKET_DATA_TYPE_IPV6
:
1526 /* still need to dissect extended data */
1527 extended_data
= tvb_get_ntohl(tvb
, offset
);
1530 for (i
= 0; i
< extended_data
; i
++) {
1531 /* figure out what kind of extended data it is */
1532 ext_type
= tvb_get_ntohl(tvb
, offset
);
1534 /* create a subtree. Might want to move this to
1535 * the end, so more info can be correct.
1537 ti
= proto_tree_add_uint(tree
, hf_sflow_245_extended_information_type
, tvb
, offset
, 4, ext_type
);
1538 extended_data_tree
= proto_item_add_subtree(ti
, ett_sflow_245_extended_data
);
1542 case SFLOW_245_EXTENDED_SWITCH
:
1543 offset
= dissect_sflow_245_extended_switch(tvb
, extended_data_tree
, offset
);
1545 case SFLOW_245_EXTENDED_ROUTER
:
1546 offset
= dissect_sflow_245_extended_router(tvb
, pinfo
, extended_data_tree
, offset
);
1548 case SFLOW_245_EXTENDED_GATEWAY
:
1549 offset
= dissect_sflow_245_extended_gateway(tvb
, pinfo
, extended_data_tree
, offset
);
1551 case SFLOW_245_EXTENDED_USER
:
1553 case SFLOW_245_EXTENDED_URL
:
1558 proto_item_set_end(ti
, tvb
, offset
);
1564 /* dissect an sflow v5 flow record */
1566 dissect_sflow_5_flow_record(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, int offset
) {
1567 proto_tree
*flow_data_tree
;
1569 uint32_t enterprise_format
, enterprise
, format
;
1571 /* what kind of flow sample is it? */
1572 enterprise_format
= tvb_get_ntohl(tvb
, offset
);
1573 enterprise
= enterprise_format
>> 12;
1574 format
= enterprise_format
& 0x00000fff;
1576 /* only accept default enterprise 0 (InMon sFlow) */
1577 if (enterprise
== ENTERPRISE_DEFAULT
) {
1578 flow_data_tree
= proto_tree_add_subtree(tree
, tvb
, offset
, -1, ett_sflow_5_flow_record
, &ti
,
1579 val_to_str_ext_const(format
, &sflow_5_flow_record_type_ext
, "Unknown sample format"));
1581 proto_tree_add_uint_format_value(flow_data_tree
, hf_sflow_enterprise
, tvb
, offset
, 4,
1582 enterprise
, "standard sFlow (%u)", enterprise
);
1583 proto_tree_add_item(flow_data_tree
, hf_sflow_5_flow_record_format
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1586 proto_tree_add_item(flow_data_tree
, hf_sflow_5_flow_data_length
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1590 case SFLOW_5_RAW_PACKET_HEADER
:
1591 offset
= dissect_sflow_245_sampled_header(tvb
, pinfo
, flow_data_tree
, offset
);
1593 case SFLOW_5_ETHERNET_FRAME
:
1594 offset
= dissect_sflow_5_ethernet_frame(tvb
, flow_data_tree
, offset
);
1597 offset
= dissect_sflow_5_ipv4(tvb
, flow_data_tree
, offset
);
1600 offset
= dissect_sflow_5_ipv6(tvb
, flow_data_tree
, offset
);
1602 case SFLOW_5_SWITCH
:
1603 offset
= dissect_sflow_245_extended_switch(tvb
, flow_data_tree
, offset
);
1605 case SFLOW_5_ROUTER
:
1606 offset
= dissect_sflow_245_extended_router(tvb
, pinfo
, flow_data_tree
, offset
);
1608 case SFLOW_5_GATEWAY
:
1609 offset
= dissect_sflow_245_extended_gateway(tvb
, pinfo
, flow_data_tree
, offset
);
1612 offset
= dissect_sflow_5_extended_user(tvb
, flow_data_tree
, offset
);
1615 offset
= dissect_sflow_5_extended_url(tvb
, flow_data_tree
, offset
);
1617 case SFLOW_5_MPLS_DATA
:
1618 offset
= dissect_sflow_5_extended_mpls_data(tvb
, pinfo
, flow_data_tree
, offset
);
1621 offset
= dissect_sflow_5_extended_nat(tvb
, pinfo
, flow_data_tree
, offset
);
1623 case SFLOW_5_MPLS_TUNNEL
:
1624 offset
= dissect_sflow_5_extended_mpls_tunnel(tvb
, flow_data_tree
, offset
);
1626 case SFLOW_5_MPLS_VC
:
1627 offset
= dissect_sflow_5_extended_mpls_vc(tvb
, flow_data_tree
, offset
);
1629 case SFLOW_5_MPLS_FEC
:
1630 offset
= dissect_sflow_5_extended_mpls_fec(tvb
, flow_data_tree
, offset
);
1632 case SFLOW_5_MPLS_LVP_FEC
:
1633 offset
= dissect_sflow_5_extended_mpls_lvp_fec(tvb
, flow_data_tree
, offset
);
1635 case SFLOW_5_VLAN_TUNNEL
:
1636 offset
= dissect_sflow_5_extended_vlan_tunnel(tvb
, flow_data_tree
, offset
);
1638 case SFLOW_5_80211_PAYLOAD
:
1639 offset
= dissect_sflow_5_extended_80211_payload(tvb
, flow_data_tree
, offset
);
1641 case SFLOW_5_80211_RX
:
1642 offset
= dissect_sflow_5_extended_80211_rx(tvb
, flow_data_tree
, offset
);
1644 case SFLOW_5_80211_TX
:
1645 offset
= dissect_sflow_5_extended_80211_tx(tvb
, flow_data_tree
, offset
);
1647 case SFLOW_5_80211_AGGREGATION
:
1648 offset
= dissect_sflow_5_extended_80211_aggregation(tvb
, flow_data_tree
, offset
);
1654 /* unknown enterprise format, what to do?? */
1657 flow_data_tree
= proto_tree_add_subtree(tree
, tvb
, offset
, -1,
1658 ett_sflow_5_flow_record
, &ti
, "Unknown enterprise format");
1659 proto_tree_add_uint_format_value(flow_data_tree
, hf_sflow_enterprise
, tvb
, offset
, 4,
1660 enterprise
, "Non-standard sFlow (%u)", enterprise
);
1663 proto_tree_add_item_ret_uint(flow_data_tree
, hf_sflow_enterprise_length
, tvb
, offset
, 4, ENC_BIG_ENDIAN
, &length
);
1665 /* show data as bytes */
1666 proto_tree_add_item(flow_data_tree
, hf_sflow_enterprise_data
, tvb
, offset
, length
, ENC_NA
);
1668 /* get the correct offset by adding padding byte count */
1670 offset
+= (4 - length
% 4);
1672 proto_item_set_end(ti
, tvb
, offset
);
1677 /* dissect generic interface counters */
1679 dissect_sflow_5_generic_interface(proto_tree
*counter_data_tree
, tvbuff_t
*tvb
, int offset
) {
1681 proto_tree_add_item(counter_data_tree
, hf_sflow_245_ifindex
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1683 proto_tree_add_item(counter_data_tree
, hf_sflow_245_iftype
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1685 proto_tree_add_item(counter_data_tree
, hf_sflow_245_ifspeed
, tvb
, offset
, 8, ENC_BIG_ENDIAN
);
1687 proto_tree_add_item(counter_data_tree
, hf_sflow_245_ifdirection
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1689 proto_tree_add_item(counter_data_tree
, hf_sflow_245_ifadmin_status
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1690 proto_tree_add_item(counter_data_tree
, hf_sflow_245_ifoper_status
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1692 proto_tree_add_item(counter_data_tree
, hf_sflow_245_ifinoct
, tvb
, offset
, 8, ENC_BIG_ENDIAN
);
1694 proto_tree_add_item(counter_data_tree
, hf_sflow_245_ifinpkt
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1696 proto_tree_add_item(counter_data_tree
, hf_sflow_245_ifinmcast
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1698 proto_tree_add_item(counter_data_tree
, hf_sflow_245_ifinbcast
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1700 proto_tree_add_item(counter_data_tree
, hf_sflow_245_ifindisc
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1702 proto_tree_add_item(counter_data_tree
, hf_sflow_245_ifinerr
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1704 proto_tree_add_item(counter_data_tree
, hf_sflow_245_ifinunk
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1706 proto_tree_add_item(counter_data_tree
, hf_sflow_245_ifoutoct
, tvb
, offset
, 8, ENC_BIG_ENDIAN
);
1708 proto_tree_add_item(counter_data_tree
, hf_sflow_245_ifoutpkt
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1710 proto_tree_add_item(counter_data_tree
, hf_sflow_245_ifoutmcast
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1712 proto_tree_add_item(counter_data_tree
, hf_sflow_245_ifoutbcast
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1714 proto_tree_add_item(counter_data_tree
, hf_sflow_245_ifoutdisc
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1716 proto_tree_add_item(counter_data_tree
, hf_sflow_245_ifouterr
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1718 proto_tree_add_item(counter_data_tree
, hf_sflow_245_ifpromisc
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1724 /* dissect ethernet interface counters */
1726 dissect_sflow_5_ethernet_interface(proto_tree
*counter_data_tree
, tvbuff_t
*tvb
, int offset
) {
1728 proto_tree_add_item(counter_data_tree
, hf_sflow_245_dot3StatsAlignmentErrors
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1730 proto_tree_add_item(counter_data_tree
, hf_sflow_245_dot3StatsFCSErrors
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1732 proto_tree_add_item(counter_data_tree
, hf_sflow_245_dot3StatsSingleCollisionFrames
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1734 proto_tree_add_item(counter_data_tree
, hf_sflow_245_dot3StatsMultipleCollisionFrames
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1736 proto_tree_add_item(counter_data_tree
, hf_sflow_245_dot3StatsSQETestErrors
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1738 proto_tree_add_item(counter_data_tree
, hf_sflow_245_dot3StatsDeferredTransmissions
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1740 proto_tree_add_item(counter_data_tree
, hf_sflow_245_dot3StatsLateCollisions
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1742 proto_tree_add_item(counter_data_tree
, hf_sflow_245_dot3StatsExcessiveCollisions
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1744 proto_tree_add_item(counter_data_tree
, hf_sflow_245_dot3StatsInternalMacTransmitErrors
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1746 proto_tree_add_item(counter_data_tree
, hf_sflow_245_dot3StatsCarrierSenseErrors
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1748 proto_tree_add_item(counter_data_tree
, hf_sflow_245_dot3StatsFrameTooLongs
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1750 proto_tree_add_item(counter_data_tree
, hf_sflow_245_dot3StatsInternalMacReceiveErrors
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1752 proto_tree_add_item(counter_data_tree
, hf_sflow_245_dot3StatsSymbolErrors
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1758 /* dissect token ring counters */
1760 dissect_sflow_5_token_ring(proto_tree
*counter_data_tree
, tvbuff_t
*tvb
, int offset
) {
1762 proto_tree_add_item(counter_data_tree
, hf_sflow_245_dot5StatsLineErrors
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1764 proto_tree_add_item(counter_data_tree
, hf_sflow_245_dot5StatsBurstErrors
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1766 proto_tree_add_item(counter_data_tree
, hf_sflow_245_dot5StatsACErrors
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1768 proto_tree_add_item(counter_data_tree
, hf_sflow_245_dot5StatsAbortTransErrors
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1770 proto_tree_add_item(counter_data_tree
, hf_sflow_245_dot5StatsInternalErrors
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1772 proto_tree_add_item(counter_data_tree
, hf_sflow_245_dot5StatsLostFrameErrors
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1774 proto_tree_add_item(counter_data_tree
, hf_sflow_245_dot5StatsReceiveCongestions
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1776 proto_tree_add_item(counter_data_tree
, hf_sflow_245_dot5StatsFrameCopiedErrors
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1778 proto_tree_add_item(counter_data_tree
, hf_sflow_245_dot5StatsTokenErrors
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1780 proto_tree_add_item(counter_data_tree
, hf_sflow_245_dot5StatsSoftErrors
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1782 proto_tree_add_item(counter_data_tree
, hf_sflow_245_dot5StatsHardErrors
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1784 proto_tree_add_item(counter_data_tree
, hf_sflow_245_dot5StatsSignalLoss
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1786 proto_tree_add_item(counter_data_tree
, hf_sflow_245_dot5StatsTransmitBeacons
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1788 proto_tree_add_item(counter_data_tree
, hf_sflow_245_dot5StatsRecoveries
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1790 proto_tree_add_item(counter_data_tree
, hf_sflow_245_dot5StatsLobeWires
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1792 proto_tree_add_item(counter_data_tree
, hf_sflow_245_dot5StatsRemoves
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1794 proto_tree_add_item(counter_data_tree
, hf_sflow_245_dot5StatsSingles
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1796 proto_tree_add_item(counter_data_tree
, hf_sflow_245_dot5StatsFreqErrors
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1802 /* dissect 100 BaseVG interface counters */
1804 dissect_sflow_5_vg_interface(proto_tree
*counter_data_tree
, tvbuff_t
*tvb
, int offset
) {
1806 proto_tree_add_item(counter_data_tree
, hf_sflow_245_dot12InHighPriorityFrames
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1808 proto_tree_add_item(counter_data_tree
, hf_sflow_245_dot12InHighPriorityOctets
, tvb
, offset
, 8, ENC_BIG_ENDIAN
);
1810 proto_tree_add_item(counter_data_tree
, hf_sflow_245_dot12InNormPriorityFrames
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1812 proto_tree_add_item(counter_data_tree
, hf_sflow_245_dot12InNormPriorityOctets
, tvb
, offset
, 8, ENC_BIG_ENDIAN
);
1814 proto_tree_add_item(counter_data_tree
, hf_sflow_245_dot12InIPMErrors
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1816 proto_tree_add_item(counter_data_tree
, hf_sflow_245_dot12InOversizeFrameErrors
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1818 proto_tree_add_item(counter_data_tree
, hf_sflow_245_dot12InDataErrors
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1820 proto_tree_add_item(counter_data_tree
, hf_sflow_245_dot12InNullAddressedFrames
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1822 proto_tree_add_item(counter_data_tree
, hf_sflow_245_dot12OutHighPriorityFrames
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1824 proto_tree_add_item(counter_data_tree
, hf_sflow_245_dot12OutHighPriorityOctets
, tvb
, offset
, 8, ENC_BIG_ENDIAN
);
1826 proto_tree_add_item(counter_data_tree
, hf_sflow_245_dot12TransitionIntoTrainings
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1828 proto_tree_add_item(counter_data_tree
, hf_sflow_245_dot12HCInHighPriorityOctets
, tvb
, offset
, 8, ENC_BIG_ENDIAN
);
1830 proto_tree_add_item(counter_data_tree
, hf_sflow_245_dot12HCInNormPriorityOctets
, tvb
, offset
, 8, ENC_BIG_ENDIAN
);
1832 proto_tree_add_item(counter_data_tree
, hf_sflow_245_dot12HCOutHighPriorityOctets
, tvb
, offset
, 8, ENC_BIG_ENDIAN
);
1838 /* dissect VLAN counters */
1840 dissect_sflow_5_vlan(proto_tree
*counter_data_tree
, tvbuff_t
*tvb
, int offset
) {
1842 proto_tree_add_item(counter_data_tree
, hf_sflow_245_vlan_id
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1844 proto_tree_add_item(counter_data_tree
, hf_sflow_245_octets
, tvb
, offset
, 8, ENC_BIG_ENDIAN
);
1846 proto_tree_add_item(counter_data_tree
, hf_sflow_245_ucastPkts
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1848 proto_tree_add_item(counter_data_tree
, hf_sflow_245_multicastPkts
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1850 proto_tree_add_item(counter_data_tree
, hf_sflow_245_broadcastPkts
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1852 proto_tree_add_item(counter_data_tree
, hf_sflow_245_discards
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1858 static int * const sflow_5_lag_port_state_flags
[] = {
1859 &hf_sflow_5_lag_port_actoradminstate
,
1860 &hf_sflow_5_lag_port_actoroperstate
,
1861 &hf_sflow_5_lag_port_partneradminstate
,
1862 &hf_sflow_5_lag_port_partneroperstate
,
1867 dissect_sflow_5_lag(proto_tree
*counter_data_tree
, tvbuff_t
*tvb
, int offset
) {
1868 proto_tree_add_item(counter_data_tree
, hf_sflow_lag_port_actorsystemid
, tvb
, offset
, 6, ENC_NA
);
1870 /* XDR requires 4-byte alignment */
1871 proto_tree_add_item(counter_data_tree
, hf_sflow_lag_port_padding
, tvb
, offset
, 2, ENC_NA
);
1873 proto_tree_add_item(counter_data_tree
, hf_sflow_lag_port_partneropersystemid
, tvb
, offset
, 6, ENC_NA
);
1875 /* XDR requires 4-byte alignment */
1876 proto_tree_add_item(counter_data_tree
, hf_sflow_lag_port_padding
, tvb
, offset
, 2, ENC_NA
);
1878 proto_tree_add_item(counter_data_tree
, hf_sflow_lag_port_attachedaggid
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1880 proto_tree_add_bitmask(counter_data_tree
, tvb
, offset
, hf_sflow_lag_port_state
, ett_sflow_lag_port_state_flags
, sflow_5_lag_port_state_flags
, ENC_BIG_ENDIAN
);
1882 proto_tree_add_item(counter_data_tree
, hf_sflow_lag_port_stats_lacpdusrx
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1884 proto_tree_add_item(counter_data_tree
, hf_sflow_lag_port_stats_markerpdusrx
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1886 proto_tree_add_item(counter_data_tree
, hf_sflow_lag_port_stats_markerresponsepdusrx
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1888 proto_tree_add_item(counter_data_tree
, hf_sflow_lag_port_stats_unknownrx
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1890 proto_tree_add_item(counter_data_tree
, hf_sflow_lag_port_stats_illegalrx
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1892 proto_tree_add_item(counter_data_tree
, hf_sflow_lag_port_stats_lacpdustx
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1894 proto_tree_add_item(counter_data_tree
, hf_sflow_lag_port_stats_markerpdustx
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1896 proto_tree_add_item(counter_data_tree
, hf_sflow_lag_port_stats_markerresponsepdustx
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1902 /* dissect 802.11 counters */
1904 dissect_sflow_5_80211_counters(proto_tree
*counter_data_tree
, tvbuff_t
*tvb
, int offset
) {
1906 proto_tree_add_item(counter_data_tree
, hf_sflow_5_dot11TransmittedFragmentCount
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1908 proto_tree_add_item(counter_data_tree
, hf_sflow_5_dot11MulticastTransmittedFrameCount
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1910 proto_tree_add_item(counter_data_tree
, hf_sflow_5_dot11FailedCount
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1912 proto_tree_add_item(counter_data_tree
, hf_sflow_5_dot11RetryCount
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1914 proto_tree_add_item(counter_data_tree
, hf_sflow_5_dot11MultipleRetryCount
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1916 proto_tree_add_item(counter_data_tree
, hf_sflow_5_dot11FrameDuplicateCount
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1918 proto_tree_add_item(counter_data_tree
, hf_sflow_5_dot11RTSSuccessCount
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1920 proto_tree_add_item(counter_data_tree
, hf_sflow_5_dot11RTSFailureCount
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1922 proto_tree_add_item(counter_data_tree
, hf_sflow_5_dot11ACKFailureCount
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1924 proto_tree_add_item(counter_data_tree
, hf_sflow_5_dot11ReceivedFragmentCount
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1926 proto_tree_add_item(counter_data_tree
, hf_sflow_5_dot11MulticastReceivedFrameCount
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1928 proto_tree_add_item(counter_data_tree
, hf_sflow_5_dot11FCSErrorCount
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1930 proto_tree_add_item(counter_data_tree
, hf_sflow_5_dot11TransmittedFrameCount
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1932 proto_tree_add_item(counter_data_tree
, hf_sflow_5_dot11WEPUndecryptableCount
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1934 proto_tree_add_item(counter_data_tree
, hf_sflow_5_dot11QoSDiscardedFragmentCount
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1936 proto_tree_add_item(counter_data_tree
, hf_sflow_5_dot11AssociatedStationCount
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1938 proto_tree_add_item(counter_data_tree
, hf_sflow_5_dot11QoSCFPollsReceivedCount
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1940 proto_tree_add_item(counter_data_tree
, hf_sflow_5_dot11QoSCFPollsUnusedCount
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1942 proto_tree_add_item(counter_data_tree
, hf_sflow_5_dot11QoSCFPollsUnusableCount
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1944 proto_tree_add_item(counter_data_tree
, hf_sflow_5_dot11QoSCFPollsLostCount
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1950 /* dissect processor information */
1952 dissect_sflow_5_processor_information(proto_tree
*counter_data_tree
, tvbuff_t
*tvb
, int offset
) {
1954 proto_tree_add_item(counter_data_tree
, hf_sflow_5_cpu_5s
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1956 proto_tree_add_item(counter_data_tree
, hf_sflow_5_cpu_1m
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1958 proto_tree_add_item(counter_data_tree
, hf_sflow_5_cpu_5m
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1960 proto_tree_add_item(counter_data_tree
, hf_sflow_5_total_memory
, tvb
, offset
, 8, ENC_BIG_ENDIAN
);
1962 proto_tree_add_item(counter_data_tree
, hf_sflow_5_free_memory
, tvb
, offset
, 8, ENC_BIG_ENDIAN
);
1968 /* dissect radio utilization */
1970 dissect_sflow_5_radio_utilization(proto_tree
*counter_data_tree
, tvbuff_t
*tvb
, int offset
) {
1972 proto_tree_add_item(counter_data_tree
, hf_sflow_5_elapsed_time
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1974 proto_tree_add_item(counter_data_tree
, hf_sflow_5_on_channel_time
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1976 proto_tree_add_item(counter_data_tree
, hf_sflow_5_on_channel_busy_time
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1982 /* dissect an sflow v5 counters record */
1984 dissect_sflow_5_counters_record(tvbuff_t
*tvb
, proto_tree
*tree
, int offset
) {
1985 proto_tree
*counter_data_tree
;
1987 uint32_t enterprise_format
, enterprise
, format
;
1989 /* what kind of flow sample is it? */
1990 enterprise_format
= tvb_get_ntohl(tvb
, offset
);
1991 enterprise
= enterprise_format
>> 12;
1992 format
= enterprise_format
& 0x00000fff;
1994 if (enterprise
== ENTERPRISE_DEFAULT
) { /* only accept default enterprise 0 (InMon sFlow) */
1995 counter_data_tree
= proto_tree_add_subtree(tree
, tvb
, offset
, -1, ett_sflow_5_counters_record
, &ti
,
1996 val_to_str_const(format
, sflow_5_counters_record_type
, "Unknown sample format"));
1998 proto_tree_add_uint_format_value(counter_data_tree
, hf_sflow_enterprise
, tvb
, offset
, 4,
1999 enterprise
, "standard sFlow (%u)", enterprise
);
2001 proto_tree_add_item(counter_data_tree
, hf_sflow_5_counters_record_format
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
2004 proto_tree_add_item(counter_data_tree
, hf_sflow_5_flow_data_length
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
2008 case SFLOW_5_GENERIC_INTERFACE
:
2009 offset
= dissect_sflow_5_generic_interface(counter_data_tree
, tvb
, offset
);
2011 case SFLOW_5_ETHERNET_INTERFACE
:
2012 offset
= dissect_sflow_5_ethernet_interface(counter_data_tree
, tvb
, offset
);
2014 case SFLOW_5_TOKEN_RING
:
2015 offset
= dissect_sflow_5_token_ring(counter_data_tree
, tvb
, offset
);
2017 case SFLOW_5_100BASE_VG_INTERFACE
:
2018 offset
= dissect_sflow_5_vg_interface(counter_data_tree
, tvb
, offset
);
2021 offset
= dissect_sflow_5_vlan(counter_data_tree
, tvb
, offset
);
2024 offset
= dissect_sflow_5_lag(counter_data_tree
, tvb
, offset
);
2026 case SFLOW_5_80211_COUNTERS
:
2027 offset
= dissect_sflow_5_80211_counters(counter_data_tree
, tvb
, offset
);
2029 case SFLOW_5_PROCESSOR
:
2030 offset
= dissect_sflow_5_processor_information(counter_data_tree
, tvb
, offset
);
2032 case SFLOW_5_RADIO_UTILIZATION
:
2033 offset
= dissect_sflow_5_radio_utilization(counter_data_tree
, tvb
, offset
);
2038 } else { /* unknown enterprise format, what to do?? */
2041 counter_data_tree
= proto_tree_add_subtree(tree
, tvb
, offset
, -1,
2042 ett_sflow_5_counters_record
, &ti
, "Unknown enterprise format");
2043 proto_tree_add_uint_format_value(counter_data_tree
, hf_sflow_enterprise
, tvb
, offset
, 4,
2044 enterprise
, "Non-standard sFlow (%u)", enterprise
);
2047 proto_tree_add_item_ret_uint(counter_data_tree
, hf_sflow_enterprise_length
, tvb
, offset
, 4, ENC_BIG_ENDIAN
, &length
);
2049 /* show data as bytes */
2050 proto_tree_add_item(counter_data_tree
, hf_sflow_enterprise_data
, tvb
, offset
, length
, ENC_NA
);
2052 /* get the correct offset by adding padding byte count */
2054 offset
+= (4 - length
% 4);
2056 proto_item_set_end(ti
, tvb
, offset
);
2061 /* dissect an sflow v5 flow sample */
2063 dissect_sflow_5_flow_sample(tvbuff_t
*tvb
, packet_info
*pinfo
,
2064 proto_tree
*tree
, int offset
, proto_item
*parent
) {
2066 uint32_t sequence_number
, sampling_rate
,
2067 output
, records
, i
, output_format
;
2069 proto_tree
*output_interface_tree
;
2071 sequence_number
= tvb_get_ntohl(tvb
, offset
);
2072 proto_tree_add_item(tree
, hf_sflow_flow_sample_sequence_number
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
2074 proto_item_append_text(parent
, ", seq %u", sequence_number
);
2076 proto_tree_add_item(tree
, hf_sflow_flow_sample_source_id_class
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
2077 proto_tree_add_item(tree
, hf_sflow_flow_sample_index
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
2079 sampling_rate
= tvb_get_ntohl(tvb
, offset
);
2080 proto_tree_add_uint_format_value(tree
, hf_sflow_flow_sample_sampling_rate
, tvb
, offset
, 4,
2081 sampling_rate
, "1 out of %u packets", sampling_rate
);
2083 proto_tree_add_item(tree
, hf_sflow_flow_sample_sample_pool
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
2085 proto_tree_add_item(tree
, hf_sflow_flow_sample_dropped_packets
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
2087 proto_tree_add_item(tree
, hf_sflow_flow_sample_input_interface
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
2089 ti
= proto_tree_add_item_ret_uint(tree
, hf_sflow_5_flow_sample_output_interface
, tvb
, offset
, 4, ENC_BIG_ENDIAN
, &output
);
2090 output_interface_tree
= proto_item_add_subtree(ti
, ett_sflow_5_output_interface
);
2091 output_format
= output
>> 30;
2092 proto_tree_add_item(output_interface_tree
, hf_sflow_5_flow_sample_output_interface_form
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
2093 switch(output_format
) {
2094 case SFLOW_5_INT_FORMAT_DISCARD
:
2095 proto_tree_add_item(output_interface_tree
, hf_sflow_5_flow_sample_output_interface_val_discard
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
2097 case SFLOW_5_INT_FORMAT_MULTIPLE
:
2098 ti
=proto_tree_add_item(output_interface_tree
, hf_sflow_5_flow_sample_output_interface_val
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
2099 if (output
== 0x80000000) {
2100 proto_item_append_text(ti
, " unknown number of interfaces greater than 1");
2103 case SFLOW_5_INT_FORMAT_IFINDEX
:
2105 proto_tree_add_item(output_interface_tree
, hf_sflow_5_flow_sample_output_interface_val
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
2109 records
= tvb_get_ntohl(tvb
, offset
);
2110 proto_tree_add_item(tree
, hf_sflow_flow_sample_flow_record
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
2113 /* start loop processing flow records */
2114 /* we set an upper records limit to 255 in case corrupted data causes
2115 * huge number of loops! */
2116 for (i
= 0; i
< (records
&0x000000ff); i
++) {
2117 offset
= dissect_sflow_5_flow_record(tvb
, pinfo
, tree
, offset
);
2122 /* dissect an expanded flow sample */
2124 dissect_sflow_5_expanded_flow_sample(tvbuff_t
*tvb
, packet_info
*pinfo
,
2125 proto_tree
*tree
, int offset
, proto_item
*parent
) {
2127 uint32_t sequence_number
, sampling_rate
, records
, i
;
2129 sequence_number
= tvb_get_ntohl(tvb
, offset
);
2130 proto_tree_add_item(tree
, hf_sflow_flow_sample_sequence_number
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
2132 proto_item_append_text(parent
, ", seq %u", sequence_number
);
2133 proto_tree_add_item(tree
, hf_sflow_flow_sample_source_id_type
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
2135 proto_tree_add_item(tree
, hf_sflow_flow_sample_source_id_index
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
2137 sampling_rate
= tvb_get_ntohl(tvb
, offset
);
2138 proto_tree_add_uint_format_value(tree
, hf_sflow_flow_sample_sampling_rate
, tvb
, offset
, 4,
2139 sampling_rate
, "1 out of %u packets", sampling_rate
);
2141 proto_tree_add_item(tree
, hf_sflow_flow_sample_sample_pool
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
2143 proto_tree_add_item(tree
, hf_sflow_flow_sample_dropped_packets
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
2145 proto_tree_add_item(tree
, hf_sflow_flow_sample_input_interface_format
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
2147 proto_tree_add_item(tree
, hf_sflow_flow_sample_input_interface_value
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
2149 proto_tree_add_item(tree
, hf_sflow_5_flow_sample_output_interface_expanded_format
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
2151 proto_tree_add_item(tree
, hf_sflow_5_flow_sample_output_interface_expanded_value
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
2153 records
= tvb_get_ntohl(tvb
, offset
);
2154 proto_tree_add_item(tree
, hf_sflow_flow_sample_flow_record
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
2157 /* start loop processing flow records
2158 * we limit record count to 255 in case corrupted data may cause huge number of loops */
2159 for (i
= 0; i
< (records
&0x000000ff); i
++) {
2160 offset
= dissect_sflow_5_flow_record(tvb
, pinfo
, tree
, offset
);
2164 /* dissect an sflow v2/4 counters sample */
2166 dissect_sflow_24_counters_sample(tvbuff_t
*tvb
, proto_tree
*tree
, int offset
, proto_item
*parent
) {
2168 uint32_t sequence_number
, counters_type
;
2170 sequence_number
= tvb_get_ntohl(tvb
, offset
);
2171 proto_tree_add_item(tree
, hf_sflow_counters_sample_sequence_number
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
2172 proto_item_append_text(parent
, ", seq %u", sequence_number
);
2174 proto_tree_add_item(tree
, hf_sflow_counters_sample_source_id_class
, tvb
, offset
+ 4, 4, ENC_BIG_ENDIAN
);
2175 proto_tree_add_item(tree
, hf_sflow_counters_sample_index
, tvb
, offset
+ 4, 4, ENC_BIG_ENDIAN
);
2176 proto_tree_add_item(tree
, hf_sflow_counters_sample_sampling_interval
, tvb
, offset
+ 8, 4, ENC_BIG_ENDIAN
);
2177 counters_type
= tvb_get_ntohl(tvb
, offset
+ 12);
2178 proto_tree_add_item(tree
, hf_sflow_counters_sample_counters_type
, tvb
, offset
+ 12, 4, ENC_BIG_ENDIAN
);
2182 /* most counters types have the "generic" counters first */
2183 switch (counters_type
) {
2184 case SFLOW_245_COUNTERS_GENERIC
:
2185 case SFLOW_245_COUNTERS_ETHERNET
:
2186 case SFLOW_245_COUNTERS_TOKENRING
:
2187 case SFLOW_245_COUNTERS_FDDI
:
2188 case SFLOW_245_COUNTERS_VG
:
2189 case SFLOW_245_COUNTERS_WAN
:
2190 proto_tree_add_item(tree
, hf_sflow_245_ifindex
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
2191 proto_item_append_text(parent
, ", ifIndex %u", tvb_get_ntohl(tvb
, offset
));
2193 proto_tree_add_item(tree
, hf_sflow_245_iftype
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
2195 proto_tree_add_item(tree
, hf_sflow_245_ifspeed
, tvb
, offset
, 8, ENC_BIG_ENDIAN
);
2197 proto_tree_add_item(tree
, hf_sflow_245_ifdirection
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
2199 proto_tree_add_item(tree
, hf_sflow_245_ifadmin_status
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
2200 proto_tree_add_item(tree
, hf_sflow_245_ifoper_status
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
2202 proto_tree_add_item(tree
, hf_sflow_245_ifinoct
, tvb
, offset
, 8, ENC_BIG_ENDIAN
);
2204 proto_tree_add_item(tree
, hf_sflow_245_ifinpkt
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
2206 proto_tree_add_item(tree
, hf_sflow_245_ifinmcast
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
2208 proto_tree_add_item(tree
, hf_sflow_245_ifinbcast
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
2210 proto_tree_add_item(tree
, hf_sflow_245_ifindisc
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
2212 proto_tree_add_item(tree
, hf_sflow_245_ifinerr
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
2214 proto_tree_add_item(tree
, hf_sflow_245_ifinunk
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
2216 proto_tree_add_item(tree
, hf_sflow_245_ifoutoct
, tvb
, offset
, 8, ENC_BIG_ENDIAN
);
2218 proto_tree_add_item(tree
, hf_sflow_245_ifoutpkt
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
2220 proto_tree_add_item(tree
, hf_sflow_245_ifoutmcast
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
2222 proto_tree_add_item(tree
, hf_sflow_245_ifoutbcast
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
2224 proto_tree_add_item(tree
, hf_sflow_245_ifoutdisc
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
2226 proto_tree_add_item(tree
, hf_sflow_245_ifouterr
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
2228 proto_tree_add_item(tree
, hf_sflow_245_ifpromisc
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
2233 /* Some counter types have other info to gather */
2234 switch (counters_type
) {
2235 case SFLOW_245_COUNTERS_ETHERNET
:
2236 offset
+= (int)sizeof (struct ethernet_counters
);
2238 case SFLOW_245_COUNTERS_TOKENRING
:
2239 offset
= dissect_sflow_5_token_ring(tree
, tvb
, offset
);
2241 case SFLOW_245_COUNTERS_VG
:
2242 offset
= dissect_sflow_5_vg_interface(tree
, tvb
, offset
);
2244 case SFLOW_245_COUNTERS_VLAN
:
2245 offset
= dissect_sflow_5_vlan(tree
, tvb
, offset
);
2253 /* dissect an sflow v5 counters sample */
2255 dissect_sflow_5_counters_sample(tvbuff_t
*tvb
, proto_tree
*tree
, int offset
, proto_item
*parent
) {
2256 uint32_t sequence_number
, records
, i
;
2258 /* grab the flow header. This will remain in network byte
2259 order, so must convert each item before use */
2260 sequence_number
= tvb_get_ntohl(tvb
, offset
);
2261 proto_tree_add_item(tree
, hf_sflow_counters_sample_sequence_number
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
2262 proto_item_append_text(parent
, ", seq %u", sequence_number
);
2264 proto_tree_add_item(tree
, hf_sflow_counters_sample_source_id_type
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
2265 proto_tree_add_item(tree
, hf_sflow_counters_sample_source_id_index
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
2267 records
= tvb_get_ntohl(tvb
, offset
);
2268 proto_tree_add_item(tree
, hf_sflow_counters_sample_counters_records
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
2271 /* start loop processing counters records
2272 * limit record count to 255 in case corrupted data may cause huge number of loops */
2273 for (i
= 0; i
< (records
&0x000000ff); i
++) {
2274 offset
= dissect_sflow_5_counters_record(tvb
, tree
, offset
);
2278 /* dissect an expanded counters sample */
2280 dissect_sflow_5_expanded_counters_sample(tvbuff_t
*tvb
, proto_tree
*tree
, int offset
, proto_item
*parent
) {
2281 uint32_t sequence_number
, records
, i
;
2283 sequence_number
= tvb_get_ntohl(tvb
, offset
);
2284 proto_tree_add_item(tree
, hf_sflow_counters_sample_sequence_number
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
2285 proto_item_append_text(parent
, ", seq %u", sequence_number
);
2287 proto_tree_add_item(tree
, hf_sflow_counters_sample_expanded_source_id_type
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
2289 proto_tree_add_item(tree
, hf_sflow_counters_sample_expanded_source_id_index
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
2291 records
= tvb_get_ntohl(tvb
, offset
);
2292 proto_tree_add_item(tree
, hf_sflow_counters_sample_counters_records
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
2295 /* start loop processing counters records
2296 * limit record count to 255 in case corrupted data may cause huge number of loops */
2297 for (i
= 0; i
< (records
&0x000000ff); i
++) {
2298 offset
= dissect_sflow_5_counters_record(tvb
, tree
, offset
);
2302 static int * const sflow_lag_port_state_flags
[] = {
2303 &hf_sflow_lag_port_actoradminstate
,
2304 &hf_sflow_lag_port_actoroperstate
,
2305 &hf_sflow_lag_port_partneradminstate
,
2306 &hf_sflow_lag_port_partneroperstate
,
2307 &hf_sflow_lag_port_reserved
,
2311 /* dissect an LAG Port Stats ( http://www.sflow.org/sflow_lag.txt ) */
2313 dissect_sflow_5_lag_port_stats(tvbuff_t
*tvb
, proto_tree
*tree
, int offset
, proto_item
*parent _U_
) {
2315 proto_tree_add_item(tree
, hf_sflow_lag_port_actorsystemid
, tvb
, offset
, 6, ENC_NA
);
2318 proto_tree_add_item(tree
, hf_sflow_lag_port_partneropersystemid
, tvb
, offset
, 6, ENC_NA
);
2321 proto_tree_add_item(tree
, hf_sflow_lag_port_attachedaggid
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
2324 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
);
2327 proto_tree_add_item(tree
, hf_sflow_lag_port_stats_lacpdusrx
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
2330 proto_tree_add_item(tree
, hf_sflow_lag_port_stats_markerpdusrx
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
2333 proto_tree_add_item(tree
, hf_sflow_lag_port_stats_markerresponsepdusrx
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
2336 proto_tree_add_item(tree
, hf_sflow_lag_port_stats_unknownrx
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
2339 proto_tree_add_item(tree
, hf_sflow_lag_port_stats_illegalrx
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
2342 proto_tree_add_item(tree
, hf_sflow_lag_port_stats_lacpdustx
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
2345 proto_tree_add_item(tree
, hf_sflow_lag_port_stats_markerpdustx
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
2348 proto_tree_add_item(tree
, hf_sflow_lag_port_stats_markerresponsepdustx
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
2352 /* Code to dissect the sflow v2/4/5 samples */
2354 dissect_sflow_245_samples(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, int offset
, uint32_t version
) {
2355 proto_tree
*sflow_245_sample_tree
;
2356 proto_item
*ti
; /* tree item */
2357 uint32_t sample_type
, enterprise
, format
, length
;
2359 /* decide what kind of sample it is. */
2360 sample_type
= tvb_get_ntohl(tvb
, offset
);
2362 enterprise
= sample_type
>> 12;
2363 format
= sample_type
& 0x00000fff;
2365 if (enterprise
== ENTERPRISE_DEFAULT
) { /* only accept default enterprise 0 (InMon sFlow) */
2366 sflow_245_sample_tree
= proto_tree_add_subtree(tree
, tvb
, offset
, -1, ett_sflow_245_sample
, &ti
,
2367 val_to_str_const(format
, sflow_245_sampletype
, "Unknown sample format"));
2369 proto_tree_add_uint_format_value(sflow_245_sample_tree
, hf_sflow_enterprise
, tvb
, offset
, 4, enterprise
, "standard sFlow (%u)", enterprise
);
2370 proto_tree_add_item(sflow_245_sample_tree
, hf_sflow_245_sampletype12
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
2373 length
= tvb_get_ntohl(tvb
, offset
);
2374 proto_tree_add_item(sflow_245_sample_tree
, hf_sflow_5_sample_length
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
2379 dissect_sflow_5_flow_sample(tvb
, pinfo
, sflow_245_sample_tree
, offset
, ti
);
2381 case COUNTERSSAMPLE
:
2382 dissect_sflow_5_counters_sample(tvb
, sflow_245_sample_tree
, offset
, ti
);
2384 case EXPANDED_FLOWSAMPLE
:
2385 dissect_sflow_5_expanded_flow_sample(tvb
, pinfo
, sflow_245_sample_tree
, offset
, ti
);
2387 case EXPANDED_COUNTERSSAMPLE
:
2388 dissect_sflow_5_expanded_counters_sample(tvb
, sflow_245_sample_tree
, offset
, ti
);
2390 case LAG_PORT_STATS
:
2391 dissect_sflow_5_lag_port_stats(tvb
, sflow_245_sample_tree
, offset
, ti
);
2396 /* Make sure the length doesn't run past the end of the packet */
2397 tvb_ensure_bytes_exist(tvb
, offset
, length
);
2398 /* current offset points to sample length field, which is 4 bytes from the beginning of the packet*/
2400 } else { /* unknown enterprise format, what to do?? */
2401 sflow_245_sample_tree
= proto_tree_add_subtree(tree
, tvb
, offset
, -1,
2402 ett_sflow_245_sample
, &ti
, "Unknown enterprise format");
2403 proto_tree_add_uint_format_value(sflow_245_sample_tree
, hf_sflow_enterprise
, tvb
, offset
, 4,
2404 enterprise
, "Non-standard sFlow (%u)", enterprise
);
2405 offset
= tvb_captured_length(tvb
);
2408 } else { /* version 2 or 4 */
2409 sflow_245_sample_tree
= proto_tree_add_subtree(tree
, tvb
, offset
, -1, ett_sflow_245_sample
, &ti
,
2410 val_to_str_const(sample_type
, sflow_245_sampletype
, "Unknown sample type"));
2412 proto_tree_add_item(sflow_245_sample_tree
, hf_sflow_245_sampletype
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
2415 switch (sample_type
) {
2417 offset
= dissect_sflow_24_flow_sample(tvb
, pinfo
, sflow_245_sample_tree
, offset
, ti
);
2419 case COUNTERSSAMPLE
:
2420 offset
= dissect_sflow_24_counters_sample(tvb
, sflow_245_sample_tree
, offset
, ti
);
2426 proto_item_set_end(ti
, tvb
, offset
);
2431 /* Code to actually dissect the packets */
2433 dissect_sflow_245(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void *data _U_
)
2435 /* Set up structures needed to add the protocol subtree and manage it */
2437 proto_tree
*sflow_245_tree
;
2438 uint32_t version
, sub_agent_id
, seqnum
;
2439 address addr_details
;
2440 int sflow_addr_type
;
2441 struct sflow_address_type addr_type
;
2444 uint32_t numsamples
;
2445 unsigned offset
= 0;
2448 addr_type
.hf_addr_v4
= hf_sflow_agent_address_v4
;
2449 addr_type
.hf_addr_v6
= hf_sflow_agent_address_v6
;
2452 * We fetch the version and address type so that we can determine,
2453 * ahead of time, whether this is an sFlow packet or not, before
2454 * we do *anything* to the columns or the protocol tree.
2456 * XXX - we might want to deem this "not sFlow" if we don't have at
2457 * least 8 bytes worth of data.
2459 version
= tvb_get_ntohl(tvb
, offset
);
2460 if (version
!= 2 && version
!= 4 && version
!= 5) {
2461 /* Unknown version; assume it's not an sFlow packet. */
2465 sflow_addr_type
= tvb_get_ntohl(tvb
, offset
+ 4);
2466 switch (sflow_addr_type
) {
2467 case ADDR_TYPE_UNKNOWN
:
2468 case ADDR_TYPE_IPV4
:
2469 case ADDR_TYPE_IPV6
:
2474 * Address type we don't know about; assume it's not an sFlow
2479 /* Make entries in Protocol column and Info column on summary display */
2480 col_set_str(pinfo
->cinfo
, COL_PROTOCOL
, "sFlow");
2482 /* create display subtree for the protocol */
2483 ti
= proto_tree_add_item(tree
, proto_sflow
, tvb
, 0, -1, ENC_NA
);
2485 sflow_245_tree
= proto_item_add_subtree(ti
, ett_sflow_245
);
2487 col_add_fstr(pinfo
->cinfo
, COL_INFO
, "V%u", version
);
2488 proto_tree_add_item(sflow_245_tree
, hf_sflow_version
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
2491 proto_tree_add_item(sflow_245_tree
, hf_sflow_agent_address_type
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
2492 offset
= dissect_sflow_245_address_type(tvb
, pinfo
, sflow_245_tree
, offset
,
2493 &addr_type
, &addr_details
);
2494 switch (sflow_addr_type
) {
2495 case ADDR_TYPE_UNKNOWN
:
2497 case ADDR_TYPE_IPV4
:
2498 case ADDR_TYPE_IPV6
:
2499 col_append_fstr(pinfo
->cinfo
, COL_INFO
, ", agent %s", address_to_str(pinfo
->pool
, &addr_details
));
2504 sub_agent_id
= tvb_get_ntohl(tvb
, offset
);
2505 col_append_fstr(pinfo
->cinfo
, COL_INFO
, ", sub-agent ID %u", sub_agent_id
);
2506 proto_tree_add_uint(sflow_245_tree
, hf_sflow_5_sub_agent_id
, tvb
, offset
, 4, sub_agent_id
);
2509 seqnum
= tvb_get_ntohl(tvb
, offset
);
2510 col_append_fstr(pinfo
->cinfo
, COL_INFO
, ", seq %u", seqnum
);
2511 proto_tree_add_uint(sflow_245_tree
, hf_sflow_245_seqnum
, tvb
, offset
, 4, seqnum
);
2513 uptime
= tvb_get_ntohl(tvb
, offset
);
2514 proto_tree_add_uint_format_value(sflow_245_tree
, hf_sflow_245_sysuptime
, tvb
, offset
, 4, uptime
, "%s (%ums)",
2515 unsigned_time_secs_to_str(pinfo
->pool
, uptime
/ 1000), uptime
);
2517 numsamples
= tvb_get_ntohl(tvb
, offset
);
2518 col_append_fstr(pinfo
->cinfo
, COL_INFO
, ", %u samples", numsamples
);
2519 proto_tree_add_uint(sflow_245_tree
, hf_sflow_245_numsamples
, tvb
, offset
, 4, numsamples
);
2522 /* Ok, we're now at the end of the sflow_245 datagram header;
2523 * everything from here out should be samples. Loop over
2524 * the expected number of samples, and pass them to the appropriate
2528 /* limit number of samples to 255 to avoid huge number of loops
2529 * caused by corrupted data */
2530 for (i
= 0; i
< (numsamples
& 0x000000ff); i
++) {
2531 offset
= dissect_sflow_245_samples(tvb
, pinfo
, sflow_245_tree
, offset
, version
);
2534 return tvb_captured_length(tvb
);
2537 /* Register the protocol with Wireshark */
2540 proto_register_sflow(void) {
2542 module_t
*sflow_245_module
;
2544 /* Setup list of header fields See Section 1.6.1 for details*/
2545 static hf_register_info hf
[] = {
2546 { &hf_sflow_version
,
2547 { "Datagram version", "sflow_245.version",
2548 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
2549 "sFlow datagram version", HFILL
}},
2550 { &hf_sflow_agent_address_type
,
2551 { "Agent address type", "sflow_245.agenttype",
2552 FT_UINT32
, BASE_DEC
, VALS(sflow_agent_address_types
), 0x0,
2553 "sFlow agent address type", HFILL
}},
2554 { &hf_sflow_agent_address_v4
,
2555 { "Agent address", "sflow_245.agent",
2556 FT_IPv4
, BASE_NONE
, NULL
, 0x0,
2557 "sFlow Agent IP address", HFILL
}},
2558 { &hf_sflow_agent_address_v6
,
2559 { "Agent address", "sflow_245.agent.v6",
2560 FT_IPv6
, BASE_NONE
, NULL
, 0x0,
2561 "sFlow Agent IPv6 address", HFILL
}},
2562 { &hf_sflow_5_sub_agent_id
,
2563 { "Sub-agent ID", "sflow_245.sub_agent_id",
2564 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
2565 "sFlow sub-agent ID", HFILL
}},
2566 { &hf_sflow_5_sample_length
,
2567 { "Sample length (byte)", "sflow_5.sample_length",
2568 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
2569 "sFlow sample length", HFILL
}},
2570 { &hf_sflow_5_flow_data_length
,
2571 { "Flow data length (byte)", "sflow_5.flow_data_length",
2572 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
2573 "sFlow flow data length", HFILL
}},
2575 { &hf_sflow_5_counters_data_length
,
2576 { "Counters data length (byte)", "sflow_5.counter_data_length",
2577 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
2578 "sFlow counters data length", HFILL
}},
2580 { &hf_sflow_245_seqnum
,
2581 { "Sequence number", "sflow_245.sequence_number",
2582 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
2583 "sFlow datagram sequence number", HFILL
}},
2584 { &hf_sflow_245_sysuptime
,
2585 { "SysUptime", "sflow_245.sysuptime",
2586 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
2587 "System Uptime", HFILL
}},
2588 { &hf_sflow_245_numsamples
,
2589 { "NumSamples", "sflow_245.numsamples",
2590 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
2591 "Number of samples in sFlow datagram", HFILL
}},
2592 { &hf_sflow_245_sampletype
,
2593 { "sFlow sample type", "sflow_245.sampletype",
2594 FT_UINT32
, BASE_DEC
, VALS(sflow_245_sampletype
), 0x0,
2595 "Type of sFlow sample", HFILL
}},
2596 { &hf_sflow_245_sampletype12
,
2597 { "sFlow sample type", "sflow_245.sampletype",
2598 FT_UINT32
, BASE_DEC
, VALS(sflow_245_sampletype
), 0x00000FFF,
2599 "Type of sFlow sample", HFILL
}},
2601 { &hf_sflow_5_ieee80211_version
,
2602 { "Version", "sflow_245.ieee80211_version",
2603 FT_UINT32
, BASE_DEC
, VALS(sflow_5_ieee80211_versions
), 0x0,
2604 "IEEE 802.11 Version", HFILL
}},
2606 { &hf_sflow_245_ipv4_precedence_type
,
2607 { "Precedence", "sflow_245.ipv4_precedence_type",
2608 FT_UINT32
, BASE_DEC
, VALS(sflow_245_ipv4_precedence_types
), 0xE0,
2609 "IPv4 Precedence Type", HFILL
}},
2610 { &hf_sflow_5_flow_record_format
,
2611 { "Format", "sflow_245.flow_record_format",
2612 FT_UINT32
, BASE_DEC
| BASE_EXT_STRING
, &sflow_5_flow_record_type_ext
, 0x0,
2613 "Format of sFlow flow record", HFILL
}},
2614 { &hf_sflow_5_counters_record_format
,
2615 { "Format", "sflow_245.counters_record_format",
2616 FT_UINT32
, BASE_DEC
, VALS(sflow_5_counters_record_type
), 0x00000FFF,
2617 "Format of sFlow counters record", HFILL
}},
2618 { &hf_sflow_245_header_protocol
,
2619 { "Header protocol", "sflow_245.header_protocol",
2620 FT_UINT32
, BASE_DEC
| BASE_EXT_STRING
, &sflow_245_header_protocol_ext
, 0x0,
2621 "Protocol of sampled header", HFILL
}},
2622 { &hf_sflow_245_header
,
2623 { "Header of sampled packet", "sflow_245.header",
2624 FT_BYTES
, BASE_NONE
, NULL
, 0x0,
2625 "Data from sampled header", HFILL
}},
2626 { &hf_sflow_245_packet_information_type
,
2627 { "Sample type", "sflow_245.packet_information_type",
2628 FT_UINT32
, BASE_DEC
, VALS(sflow_245_packet_information_type
), 0x0,
2629 "Type of sampled information", HFILL
}},
2630 { &hf_sflow_245_extended_information_type
,
2631 { "Extended information type", "sflow_245.extended_information_type",
2632 FT_UINT32
, BASE_DEC
, VALS(sflow_245_extended_data_types
), 0x0,
2633 "Type of extended information", HFILL
}},
2634 { &hf_sflow_245_vlan_in
,
2635 { "Incoming 802.1Q VLAN", "sflow_245.vlan.in",
2636 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
2637 "Incoming VLAN ID", HFILL
}},
2638 { &hf_sflow_245_vlan_out
,
2639 { "Outgoing 802.1Q VLAN", "sflow_245.vlan.out",
2640 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
2641 "Outgoing VLAN ID", HFILL
}},
2642 { &hf_sflow_245_pri_in
,
2643 { "Incoming 802.1p priority", "sflow_245.pri.in",
2644 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
2646 { &hf_sflow_245_pri_out
,
2647 { "Outgoing 802.1p priority", "sflow_245.pri.out",
2648 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
2650 { &hf_sflow_245_nexthop_v4
,
2651 { "Next hop", "sflow_245.nexthop",
2652 FT_IPv4
, BASE_NONE
, NULL
, 0x0,
2653 "Next hop address", HFILL
}},
2654 { &hf_sflow_245_ipv4_src
,
2655 { "Source IP address", "sflow_245.ipv4_src",
2656 FT_IPv4
, BASE_NONE
, NULL
, 0x0,
2657 "Source IPv4 address", HFILL
}},
2658 { &hf_sflow_245_ipv4_dst
,
2659 { "Destination IP address", "sflow_245.ipv4_dst",
2660 FT_IPv4
, BASE_NONE
, NULL
, 0x0,
2661 "Destination IPv4 address", HFILL
}},
2662 { &hf_sflow_245_nexthop_v6
,
2663 { "Next hop", "sflow_245.nexthop.v6",
2664 FT_IPv6
, BASE_NONE
, NULL
, 0x0,
2665 "Next hop address", HFILL
}},
2666 { &hf_sflow_245_ipv6_src
,
2667 { "Source IP address", "sflow_245.ipv6_src",
2668 FT_IPv6
, BASE_NONE
, NULL
, 0x0,
2669 "Source IPv6 address", HFILL
}},
2670 { &hf_sflow_245_ipv6_dst
,
2671 { "Destination IP address", "sflow_245.ipv6_dst",
2672 FT_IPv6
, BASE_NONE
, NULL
, 0x0,
2673 "Destination IPv6 address", HFILL
}},
2674 { &hf_sflow_245_nexthop_src_mask
,
2675 { "Next hop source mask", "sflow_245.nexthop.src_mask",
2676 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
2677 "Next hop source mask bits", HFILL
}},
2678 { &hf_sflow_245_nexthop_dst_mask
,
2679 { "Next hop destination mask", "sflow_245.nexthop.dst_mask",
2680 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
2681 "Next hop destination mask bits", HFILL
}},
2682 { &hf_sflow_245_ifindex
,
2683 { "Interface index", "sflow_245.ifindex",
2684 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
2687 { "AS Router", "sflow_245.as",
2688 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
2689 "Autonomous System of Router", HFILL
}},
2690 { &hf_sflow_245_src_as
,
2691 { "AS Source", "sflow_245.srcAS",
2692 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
2693 "Autonomous System of Source", HFILL
}},
2694 { &hf_sflow_245_src_peer_as
,
2695 { "AS Peer", "sflow_245.peerAS",
2696 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
2697 "Autonomous System of Peer", HFILL
}},
2698 { &hf_sflow_245_dst_as_entries
,
2699 { "AS Destinations", "sflow_245.dstASentries",
2700 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
2701 "Autonomous System destinations", HFILL
}},
2702 { &hf_sflow_245_dst_as
,
2703 { "AS Destination", "sflow_245.dstAS",
2704 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
2705 "Autonomous System destination", HFILL
}},
2706 /* Needed for sFlow >= 4. If I had a capture to test... */
2707 { &hf_sflow_245_community_entries
,
2708 { "Gateway Communities", "sflow_245.communityEntries",
2709 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
2712 { &hf_sflow_245_community
,
2713 { "Gateway Community", "sflow_245.community",
2714 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
2715 "Gateway Communities", HFILL
}},
2717 { &hf_sflow_245_localpref
,
2718 { "localpref", "sflow_245.localpref",
2719 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
2720 "Local preferences of AS route", HFILL
}},
2722 { &hf_sflow_245_iftype
,
2723 { "Interface Type", "sflow_245.iftype",
2724 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
2726 { &hf_sflow_245_ifspeed
,
2727 { "Interface Speed", "sflow_245.ifspeed",
2728 FT_UINT64
, BASE_DEC
, NULL
, 0x0,
2730 { &hf_sflow_245_ifdirection
,
2731 { "Interface Direction", "sflow_245.ifdirection",
2732 FT_UINT32
, BASE_DEC
, VALS(sflow_ifdirection_vals
), 0x0,
2734 { &hf_sflow_245_ifadmin_status
,
2735 { "IfAdminStatus", "sflow_245.ifadmin_status",
2736 FT_BOOLEAN
, 32, TFS(&tfs_up_down
), 0x00000001,
2738 { &hf_sflow_245_ifoper_status
,
2739 { "IfOperStatus", "sflow_245.ifoper_status",
2740 FT_BOOLEAN
, 32, TFS(&tfs_up_down
), 0x00000002,
2742 { &hf_sflow_245_ifinoct
,
2743 { "Input Octets", "sflow_245.ifinoct",
2744 FT_UINT64
, BASE_DEC
, NULL
, 0x0,
2746 { &hf_sflow_245_ifinpkt
,
2747 { "Input Packets", "sflow_245.ifinpkt",
2748 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
2750 { &hf_sflow_245_ifinmcast
,
2751 { "Input Multicast Packets", "sflow_245.ifinmcast",
2752 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
2754 { &hf_sflow_245_ifinbcast
,
2755 { "Input Broadcast Packets", "sflow_245.ifinbcast",
2756 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
2758 { &hf_sflow_245_ifindisc
,
2759 { "Input Discarded Packets", "sflow_245.ifindisc",
2760 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
2762 { &hf_sflow_245_ifinerr
,
2763 { "Input Errors", "sflow_245.ifinerr",
2764 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
2766 { &hf_sflow_245_ifinunk
,
2767 { "Input Unknown Protocol Packets", "sflow_245.ifinunk",
2768 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
2770 { &hf_sflow_245_ifoutoct
,
2771 { "Output Octets", "sflow_245.ifoutoct",
2772 FT_UINT64
, BASE_DEC
, NULL
, 0x0,
2774 { &hf_sflow_245_ifoutpkt
,
2775 { "Output Packets", "sflow_245.ifoutpkt",
2776 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
2778 { &hf_sflow_245_ifoutmcast
,
2779 { "Output Multicast Packets", "sflow_245.ifoutmcast",
2780 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
2782 { &hf_sflow_245_ifoutbcast
,
2783 { "Output Broadcast Packets", "sflow_245.ifoutbcast",
2784 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
2786 { &hf_sflow_245_ifoutdisc
,
2787 { "Output Discarded Packets", "sflow_245.ifoutdisc",
2788 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
2790 { &hf_sflow_245_ifouterr
,
2791 { "Output Errors", "sflow_245.ifouterr",
2792 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
2794 { &hf_sflow_245_ifpromisc
,
2795 { "Promiscuous Mode", "sflow_245.ifpromisc",
2796 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
2798 { &hf_sflow_245_dot3StatsAlignmentErrors
,
2799 { "Alignment Errors", "sflow_245.dot3StatsAlignmentErrors",
2800 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
2801 "dot3 Stats Alignment Errors", HFILL
}},
2802 { &hf_sflow_245_dot3StatsFCSErrors
,
2803 { "FCS Errors", "sflow_245.dot3StatsFCSErrors",
2804 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
2805 "dot3 Stats FCS Errors", HFILL
}},
2806 { &hf_sflow_245_dot3StatsSingleCollisionFrames
,
2807 { "Single Collision Frames", "sflow_245.dot3StatsSingleCollisionFrames",
2808 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
2809 "dot3 Stats Single Collision Frames", HFILL
}},
2810 { &hf_sflow_245_dot3StatsMultipleCollisionFrames
,
2811 { "Multiple Collision Frames", "sflow_245.dot3StatsMultipleCollisionFrames",
2812 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
2813 "dot3 Stats Multiple Collision Frames", HFILL
}},
2814 { &hf_sflow_245_dot3StatsSQETestErrors
,
2815 { "SQE Test Errors", "sflow_245.dot3StatsSQETestErrors",
2816 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
2817 "dot3 Stats SQE Test Errors", HFILL
}},
2818 { &hf_sflow_245_dot3StatsDeferredTransmissions
,
2819 { "Deferred Transmissions", "sflow_245.dot3StatsDeferredTransmissions",
2820 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
2821 "dot3 Stats Deferred Transmissions", HFILL
}},
2822 { &hf_sflow_245_dot3StatsLateCollisions
,
2823 { "Late Collisions", "sflow_245.dot3StatsLateCollisions",
2824 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
2825 "dot3 Stats Late Collisions", HFILL
}},
2826 { &hf_sflow_245_dot3StatsExcessiveCollisions
,
2827 { "Excessive Collisions", "sflow_245.dot3StatsExcessiveCollisions",
2828 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
2829 "dot3 Stats Excessive Collisions", HFILL
}},
2830 { &hf_sflow_245_dot3StatsInternalMacTransmitErrors
,
2831 { "Internal Mac Transmit Errors", "sflow_245.dot3StatsInternalMacTransmitErrors",
2832 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
2833 "dot3 Stats Internal Mac Transmit Errors", HFILL
}},
2834 { &hf_sflow_245_dot3StatsCarrierSenseErrors
,
2835 { "Carrier Sense Errors", "sflow_245.dot3StatsCarrierSenseErrors",
2836 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
2837 "dot3 Stats Carrier Sense Errors", HFILL
}},
2838 { &hf_sflow_245_dot3StatsFrameTooLongs
,
2839 { "Frame Too Longs", "sflow_245.dot3StatsFrameTooLongs",
2840 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
2841 "dot3 Stats Frame Too Longs", HFILL
}},
2842 { &hf_sflow_245_dot3StatsInternalMacReceiveErrors
,
2843 { "Internal Mac Receive Errors", "sflow_245.dot3StatsInternalMacReceiveErrors",
2844 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
2845 "dot3 Stats Internal Mac Receive Errors", HFILL
}},
2846 { &hf_sflow_245_dot3StatsSymbolErrors
,
2847 { "Symbol Errors", "sflow_245.dot3StatsSymbolErrors",
2848 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
2849 "dot3 Stats Symbol Errors", HFILL
}},
2850 { &hf_sflow_245_dot5StatsLineErrors
,
2851 { "Line Errors", "sflow_245.dot5StatsLineErrors",
2852 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
2853 "dot5 Stats Line Errors", HFILL
}},
2854 { &hf_sflow_245_dot5StatsBurstErrors
,
2855 { "Burst Errors", "sflow_245.dot5StatsBurstErrors",
2856 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
2857 "dot5 Stats Burst Errors", HFILL
}},
2858 { &hf_sflow_245_dot5StatsACErrors
,
2859 { "AC Errors", "sflow_245.dot5StatsACErrors",
2860 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
2861 "dot5 Stats AC Errors", HFILL
}},
2862 { &hf_sflow_245_dot5StatsAbortTransErrors
,
2863 { "Abort Trans Errors", "sflow_245.dot5StatsAbortTransErrors",
2864 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
2865 "dot5 Stats Abort Trans Errors", HFILL
}},
2866 { &hf_sflow_245_dot5StatsInternalErrors
,
2867 { "Internal Errors", "sflow_245.dot5StatsInternalErrors",
2868 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
2869 "dot5 Stats Internal Errors", HFILL
}},
2870 { &hf_sflow_245_dot5StatsLostFrameErrors
,
2871 { "Lost Frame Errors", "sflow_245.dot5StatsLostFrameErrors",
2872 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
2873 "dot5 Stats Lost Frame Errors", HFILL
}},
2874 { &hf_sflow_245_dot5StatsReceiveCongestions
,
2875 { "Receive Congestions", "sflow_245.dot5StatsReceiveCongestions",
2876 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
2877 "dot5 Stats Receive Congestions", HFILL
}},
2878 { &hf_sflow_245_dot5StatsFrameCopiedErrors
,
2879 { "Frame Copied Errors", "sflow_245.dot5StatsFrameCopiedErrors",
2880 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
2881 "dot5 Stats Frame Copied Errors", HFILL
}},
2882 { &hf_sflow_245_dot5StatsTokenErrors
,
2883 { "Token Errors", "sflow_245.dot5StatsTokenErrors",
2884 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
2885 "dot5 Stats Token Errors", HFILL
}},
2886 { &hf_sflow_245_dot5StatsSoftErrors
,
2887 { "Soft Errors", "sflow_245.dot5StatsSoftErrors",
2888 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
2889 "dot5 Stats Soft Errors", HFILL
}},
2890 { &hf_sflow_245_dot5StatsHardErrors
,
2891 { "Hard Errors", "sflow_245.dot5StatsHardErrors",
2892 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
2893 "dot5 Stats Hard Errors", HFILL
}},
2894 { &hf_sflow_245_dot5StatsSignalLoss
,
2895 { "Signal Loss", "sflow_245.dot5StatsSignalLoss",
2896 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
2897 "dot5 Stats Signal Loss", HFILL
}},
2898 { &hf_sflow_245_dot5StatsTransmitBeacons
,
2899 { "Transmit Beacons", "sflow_245.dot5StatsTransmitBeacons",
2900 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
2901 "dot5 Stats Transmit Beacons", HFILL
}},
2902 { &hf_sflow_245_dot5StatsRecoveries
,
2903 { "Recoveries", "sflow_245.dot5StatsRecoveries",
2904 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
2905 "dot5 Stats Recoveries", HFILL
}},
2906 { &hf_sflow_245_dot5StatsLobeWires
,
2907 { "Lobe Wires", "sflow_245.dot5StatsLobeWires",
2908 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
2909 "dot5 Stats Lobe Wires", HFILL
}},
2910 { &hf_sflow_245_dot5StatsRemoves
,
2911 { "Removes", "sflow_245.dot5StatsRemoves",
2912 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
2913 "dot5 Stats Removes", HFILL
}},
2914 { &hf_sflow_245_dot5StatsSingles
,
2915 { "Singles", "sflow_245.dot5StatsSingles",
2916 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
2917 "dot5 Stats Singles", HFILL
}},
2918 { &hf_sflow_245_dot5StatsFreqErrors
,
2919 { "Freq Errors", "sflow_245.dot5StatsFreqErrors",
2920 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
2921 "dot5 Stats Freq Errors", HFILL
}},
2922 { &hf_sflow_245_dot12InHighPriorityFrames
,
2923 { "In High Priority Frames", "sflow_245.dot12InHighPriorityFrames",
2924 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
2925 "dot12 Input High Priority Frames", HFILL
}},
2926 { &hf_sflow_245_dot12InHighPriorityOctets
,
2927 { "In High Priority Octets", "sflow_245.dot12InHighPriorityOctets",
2928 FT_UINT64
, BASE_DEC
, NULL
, 0x0,
2929 "dot12 Input High Priority Octets", HFILL
}},
2930 { &hf_sflow_245_dot12InNormPriorityFrames
,
2931 { "In Normal Priority Frames", "sflow_245.dot12InNormPriorityFrames",
2932 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
2933 "dot12 Input Normal Priority Frames", HFILL
}},
2934 { &hf_sflow_245_dot12InNormPriorityOctets
,
2935 { "In Normal Priority Octets", "sflow_245.dot12InNormPriorityOctets",
2936 FT_UINT64
, BASE_DEC
, NULL
, 0x0,
2937 "dot12 Input Normal Priority Octets", HFILL
}},
2938 { &hf_sflow_245_dot12InIPMErrors
,
2939 { "In IPM Errors", "sflow_245.dot12InIPMErrors",
2940 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
2941 "dot12 Input IPM Errors", HFILL
}},
2942 { &hf_sflow_245_dot12InOversizeFrameErrors
,
2943 { "In Oversize Frame Errors", "sflow_245.dot12InOversizeFrameErrors",
2944 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
2945 "dot12 Input Oversize Frame Errors", HFILL
}},
2946 { &hf_sflow_245_dot12InDataErrors
,
2947 { "In Data Errors", "sflow_245.dot12InDataErrors",
2948 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
2949 "dot12 Input Data Errors", HFILL
}},
2950 { &hf_sflow_245_dot12InNullAddressedFrames
,
2951 { "In Null Addressed Frames", "sflow_245.dot12InNullAddressedFrames",
2952 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
2953 "dot12 Input Null Addressed Frames", HFILL
}},
2954 { &hf_sflow_245_dot12OutHighPriorityFrames
,
2955 { "Out High Priority Frames", "sflow_245.dot12OutHighPriorityFrames",
2956 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
2957 "dot12 Output High Priority Frames", HFILL
}},
2958 { &hf_sflow_245_dot12OutHighPriorityOctets
,
2959 { "Out High Priority Octets", "sflow_245.dot12OutHighPriorityOctets",
2960 FT_UINT64
, BASE_DEC
, NULL
, 0x0,
2961 "dot12 Out High Priority Octets", HFILL
}},
2962 { &hf_sflow_245_dot12TransitionIntoTrainings
,
2963 { "Transition Into Trainings", "sflow_245.dot12TransitionIntoTrainings",
2964 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
2965 "dot12 Transition Into Trainings", HFILL
}},
2966 { &hf_sflow_245_dot12HCInHighPriorityOctets
,
2967 { "HC In High Priority Octets", "sflow_245.dot12HCInHighPriorityOctets",
2968 FT_UINT64
, BASE_DEC
, NULL
, 0x0,
2969 "dot12 HC Input High Priority Octets", HFILL
}},
2970 { &hf_sflow_245_dot12HCInNormPriorityOctets
,
2971 { "HC In Normal Priority Octets", "sflow_245.dot12HCInNormPriorityOctets",
2972 FT_UINT64
, BASE_DEC
, NULL
, 0x0,
2973 "dot12 HC Input Normal Priority Octets", HFILL
}},
2974 { &hf_sflow_245_dot12HCOutHighPriorityOctets
,
2975 { "HC Out High Priority Octets", "sflow_245.dot12HCOutHighPriorityOctets",
2976 FT_UINT64
, BASE_DEC
, NULL
, 0x0,
2977 "dot12 HC Output High Priority Octets", HFILL
}},
2978 { &hf_sflow_245_vlan_id
,
2979 { "VLAN ID", "sflow_245.vlan_id",
2980 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
2982 { &hf_sflow_245_octets
,
2983 { "Octets", "sflow_245.octets",
2984 FT_UINT64
, BASE_DEC
, NULL
, 0x0,
2986 { &hf_sflow_245_ucastPkts
,
2987 { "Unicast Packets", "sflow_245.ucastPkts",
2988 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
2990 { &hf_sflow_245_multicastPkts
,
2991 { "Multicast Packets", "sflow_245.multicastPkts",
2992 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
2994 { &hf_sflow_245_broadcastPkts
,
2995 { "Broadcast Packets", "sflow_245.broadcastPkts",
2996 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
2998 { &hf_sflow_245_discards
,
2999 { "Discards", "sflow_245.discards",
3000 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
3002 { &hf_sflow_5_dot11TransmittedFragmentCount
,
3003 { "Transmitted Fragment Count", "sflow_5.dot11TransmittedFragmentCount",
3004 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
3006 { &hf_sflow_5_dot11MulticastTransmittedFrameCount
,
3007 { "Multicast Transmitted Frame Count", "sflow_5.dot11MulticastTransmittedFrameCount",
3008 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
3010 { &hf_sflow_5_dot11FailedCount
,
3011 { "Failed Count", "sflow_5.dot11FailedCount",
3012 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
3014 { &hf_sflow_5_dot11RetryCount
,
3015 { "Retry Count", "sflow_5.dot11RetryCount",
3016 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
3018 { &hf_sflow_5_dot11MultipleRetryCount
,
3019 { "Multiple Retry Count", "sflow_5.dot11MultipleRetryCount",
3020 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
3022 { &hf_sflow_5_dot11FrameDuplicateCount
,
3023 { "Frame Duplicate Count", "sflow_5.dot11FrameDuplicateCount",
3024 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
3026 { &hf_sflow_5_dot11RTSSuccessCount
,
3027 { "RTS Success Count", "sflow_5.dot11RTSSuccessCount",
3028 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
3030 { &hf_sflow_5_dot11RTSFailureCount
,
3031 { "Failure Count", "sflow_5.dot11RTSFailureCount",
3032 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
3034 { &hf_sflow_5_dot11ACKFailureCount
,
3035 { "ACK Failure Count", "sflow_5.dot11ACKFailureCount",
3036 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
3038 { &hf_sflow_5_dot11ReceivedFragmentCount
,
3039 { "Received Fragment Count", "sflow_5.dot11ReceivedFragmentCount",
3040 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
3042 { &hf_sflow_5_dot11MulticastReceivedFrameCount
,
3043 { "Multicast Received Frame Count", "sflow_5.dot11MulticastReceivedFrameCount",
3044 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
3046 { &hf_sflow_5_dot11FCSErrorCount
,
3047 { "FCS Error Count", "sflow_5.dot11FCSErrorCount",
3048 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
3050 { &hf_sflow_5_dot11TransmittedFrameCount
,
3051 { "Transmitted Frame Count", "sflow_5.dot11TransmittedFrameCount",
3052 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
3054 { &hf_sflow_5_dot11WEPUndecryptableCount
,
3055 { "WEP Undecryptable Count", "sflow_5.dot11WEPUndecryptableCount",
3056 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
3058 { &hf_sflow_5_dot11QoSDiscardedFragmentCount
,
3059 { "QoS Discarded Fragment Count", "sflow_5.dot11QoSDiscardedFragmentCount",
3060 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
3062 { &hf_sflow_5_dot11AssociatedStationCount
,
3063 { "Associated Station Count", "sflow_5.dot11AssociatedStationCount",
3064 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
3066 { &hf_sflow_5_dot11QoSCFPollsReceivedCount
,
3067 { "QoS CF Polls Received Count", "sflow_5.dot11QoSCFPollsReceivedCount",
3068 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
3070 { &hf_sflow_5_dot11QoSCFPollsUnusedCount
,
3071 { "QoS CF Polls Unused Count", "sflow_5.dot11QoSCFPollsUnusedCount",
3072 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
3074 { &hf_sflow_5_dot11QoSCFPollsUnusableCount
,
3075 { "QoS CF Polls Unusable Count", "sflow_5.dot11QoSCFPollsUnusableCount",
3076 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
3078 { &hf_sflow_5_dot11QoSCFPollsLostCount
,
3079 { "QoS CF Polls Lost Count", "sflow_5.dot11QoSCFPollsLostCount",
3080 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
3082 { &hf_sflow_5_cpu_5s
,
3083 { "5s CPU Load (100 = 1%)", "sflow_5.cpu_5s",
3084 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
3085 "Average CPU Load Over 5 Seconds (100 = 1%)", HFILL
}},
3086 { &hf_sflow_5_cpu_1m
,
3087 { "1m CPU Load (100 = 1%)", "sflow_5.cpu_1m",
3088 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
3089 "Average CPU Load Over 1 Minute (100 = 1%)", HFILL
}},
3090 { &hf_sflow_5_cpu_5m
,
3091 { "5m CPU Load (100 = 1%)", "sflow_5.cpu_5m",
3092 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
3093 "Average CPU Load Over 5 Minutes (100 = 1%)", HFILL
}},
3094 { &hf_sflow_5_total_memory
,
3095 { "Total Memory", "sflow_5.total_memory",
3096 FT_UINT64
, BASE_DEC
, NULL
, 0x0,
3098 { &hf_sflow_5_free_memory
,
3099 { "Free Memory", "sflow_5.free_memory",
3100 FT_UINT64
, BASE_DEC
, NULL
, 0x0,
3102 { &hf_sflow_5_elapsed_time
,
3103 { "Elapsed Time (ms)", "sflow_5.elapsed_time",
3104 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
3105 "Elapsed Time in ms", HFILL
}},
3106 { &hf_sflow_5_on_channel_time
,
3107 { "On Channel (ms)", "sflow_5.on_channel_time",
3108 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
3109 "Time in ms Spent on Channel", HFILL
}},
3110 { &hf_sflow_5_on_channel_busy_time
,
3111 { "On Channel Busy (ms)", "sflow_5.channel_busy_time",
3112 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
3113 "Time in ms Spent on Channel and Busy", HFILL
}},
3115 /* Generated from convert_proto_tree_add_text.pl */
3116 { &hf_sflow_245_header_frame_length
,
3117 { "Frame Length", "sflow_245.header.frame_length",
3118 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
3121 { &hf_sflow_245_header_payload_stripped
,
3122 { "Payload stripped", "sflow_245.header.payload_stripped",
3123 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
3126 { &hf_sflow_245_sampled_header_length
,
3127 { "Sampled header length", "sflow_245.header.sampled_header_length",
3128 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
3131 { &hf_sflow_245_extended_mpls_in_label_stack_entries
,
3132 { "In Label Stack Entries", "sflow_245.extended_mpls.in_label_stack_entries",
3133 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
3136 { &hf_sflow_245_extended_mpls_in_label
,
3137 { "Label", "sflow_245.extended_mpls.in_label",
3138 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
3141 { &hf_sflow_245_extended_mpls_out_label_stack_entries
,
3142 { "Out Label Stack Entries", "sflow_245.extended_mpls.out_label_stack_entries",
3143 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
3146 { &hf_sflow_245_extended_mpls_out_label
,
3147 { "Label", "sflow_245.extended_mpls.out_label",
3148 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
3151 { &hf_sflow_245_ethernet_length_of_mac_packet
,
3152 { "Length of MAC Packet", "sflow_245.ethernet.length",
3153 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
3156 { &hf_sflow_245_ethernet_source_mac_address
,
3157 { "Source MAC Address", "sflow_245.ethernet.source_mac_address",
3158 FT_ETHER
, BASE_NONE
, NULL
, 0x0,
3161 { &hf_sflow_245_ethernet_destination_mac_address
,
3162 { "Destination MAC Address", "sflow_245.ethernet.destination_mac_address",
3163 FT_ETHER
, BASE_NONE
, NULL
, 0x0,
3166 { &hf_sflow_245_ethernet_packet_type
,
3167 { "Ethernet Packet Type", "sflow_245.ethernet.packet_type",
3168 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
3171 { &hf_sflow_245_length_of_ip_packet
,
3172 { "Length of IP Packet", "sflow_245.ip.length",
3173 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
3176 { &hf_sflow_245_ip_source_port
,
3177 { "Source Port", "sflow_245.ip.source_port",
3178 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
3181 { &hf_sflow_245_ip_destination_port
,
3182 { "Destination Port", "sflow.ip.destination_port",
3183 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
3186 { &hf_sflow_245_ip_tcp_flag_cwr
,
3187 { "TCP Flag (CWR)", "sflow_245.ip.tcp_flag.cwr",
3188 FT_BOOLEAN
, 32, TFS(&tfs_set_notset
), 0x00000080,
3191 { &hf_sflow_245_ip_tcp_flag_ece
,
3192 { "TCP Flag (ECE)", "sflow_245.ip.tcp_flag.ece",
3193 FT_BOOLEAN
, 32, TFS(&tfs_set_notset
), 0x00000040,
3196 { &hf_sflow_245_ip_tcp_flag_urg
,
3197 { "TCP Flag (URG)", "sflow_245.ip.tcp_flag.urg",
3198 FT_BOOLEAN
, 32, TFS(&tfs_set_notset
), 0x00000020,
3201 { &hf_sflow_245_ip_tcp_flag_ack
,
3202 { "TCP Flag (ACK)", "sflow_245.ip.tcp_flag.ack",
3203 FT_BOOLEAN
, 32, TFS(&tfs_set_notset
), 0x00000010,
3206 { &hf_sflow_245_ip_tcp_flag_psh
,
3207 { "TCP Flag (PSH)", "sflow_245.ip.tcp_flag.psh",
3208 FT_BOOLEAN
, 32, TFS(&tfs_set_notset
), 0x00000008,
3211 { &hf_sflow_245_ip_tcp_flag_rst
,
3212 { "TCP Flag (RST)", "sflow_245.ip.tcp_flag.rst",
3213 FT_BOOLEAN
, 32, TFS(&tfs_set_notset
), 0x00000004,
3216 { &hf_sflow_245_ip_tcp_flag_syn
,
3217 { "TCP Flag (SYN)", "sflow_245.ip.tcp_flag.syn",
3218 FT_BOOLEAN
, 32, TFS(&tfs_set_notset
), 0x00000002,
3221 { &hf_sflow_245_ip_tcp_flag_fin
,
3222 { "TCP Flag (FIN)", "sflow_245.ip.tcp_flag.fin",
3223 FT_BOOLEAN
, 32, TFS(&tfs_set_notset
), 0x00000001,
3226 { &hf_sflow_245_ipv4_delay
,
3227 { "Delay", "sflow_245.ipv4_delay",
3228 FT_BOOLEAN
, 32, TFS(&tfs_low_normal
), 0x00000010,
3231 { &hf_sflow_245_ipv4_throughput
,
3232 { "Throughput", "sflow_245.ipv4_throughput",
3233 FT_BOOLEAN
, 32, TFS(&tfs_high_normal
), 0x00000008,
3236 { &hf_sflow_245_ipv4_reliability
,
3237 { "Reliability", "sflow_245.ipv4_reliability",
3238 FT_BOOLEAN
, 32, TFS(&tfs_high_normal
), 0x00000004,
3241 { &hf_sflow_245_ipv4_cost
,
3242 { "Cost (RFC1349)", "sflow_245.ipv4_cost",
3243 FT_BOOLEAN
, 32, TFS(&tfs_minimize_monetary_normal
), 0x00000002,
3246 { &hf_sflow_245_ipv6_priority
,
3247 { "Priority", "sflow_245.ipv6_priority",
3248 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
3251 { &hf_sflow_5_extended_user_source_character_set
,
3252 { "Source Character Set", "sflow_5.extended_user.source_character_set",
3253 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
3256 { &hf_sflow_5_extended_user_source_user_string_length
,
3257 { "Source User String Length (bytes)", "sflow_5.extended_user.source_user_string_length",
3258 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
3261 { &hf_sflow_5_extended_user_destination_character_set
,
3262 { "Destination Character Set", "sflow_5.extended_user.destination_character_set",
3263 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
3266 { &hf_sflow_5_extended_user_destination_user_string_length
,
3267 { "Destination User String Length (bytes)", "sflow_5.extended_user.destination_user_string_length",
3268 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
3271 { &hf_sflow_5_extended_url_url_length
,
3272 { "URL Length (bytes)", "sflow_5.extended_url.url_length",
3273 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
3276 { &hf_sflow_5_extended_url_host_length
,
3277 { "Host Length (bytes)", "sflow_5.extended_url.host_length",
3278 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
3281 { &hf_sflow_5_extended_mpls_tunnel_name_length
,
3282 { "Tunnel Name Length (bytes)", "sflow_5.extended_mpls_tunnel.name_length",
3283 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
3286 { &hf_sflow_5_extended_mpls_tunnel_id
,
3287 { "Tunnel ID", "sflow_5.extended_mpls_tunnel.id",
3288 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
3291 { &hf_sflow_5_extended_mpls_tunnel_cos_value
,
3292 { "Tunnel COS Value", "sflow_5.extended_mpls_tunnel.cos_value",
3293 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
3296 { &hf_sflow_5_extended_mpls_vc_instance_name_length
,
3297 { "VC Instance Name Length (bytes)", "sflow_5.extended_mpls_vc.instance_name_length",
3298 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
3301 { &hf_sflow_5_extended_mpls_vc_id
,
3302 { "VLL/VC ID", "sflow_5.extended_mpls_vc.id",
3303 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
3306 { &hf_sflow_5_extended_mpls_vc_label_cos_value
,
3307 { "VC Label COS Value", "sflow_5.extended_mpls_vc.label_cos_value",
3308 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
3311 { &hf_sflow_5_extended_mpls_ftn_description_length
,
3312 { "MPLS FTN Description Length (bytes)", "sflow_5.extended_mpls.ftn_description_length",
3313 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
3316 { &hf_sflow_5_extended_mpls_ftn_mask
,
3317 { "MPLS FTN Mask", "sflow_5.extended_mpls.ftn_mask",
3318 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
3321 { &hf_sflow_5_extended_mpls_fec_address_prefix_length
,
3322 { "MPLS FEC Address Prefix Length (bytes)", "sflow_5.extended_mpls.fec_address_prefix_length",
3323 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
3326 { &hf_sflow_5_extended_vlan_tunnel_number_of_layers
,
3327 { "Number of Layers", "sflow_5.extended_vlan_tunnel.number_of_layers",
3328 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
3331 { &hf_sflow_5_extended_vlan_tunnel_tpid_tci_pair
,
3332 { "TPID/TCI Pair as Integer", "sflow_5.extended_vlan_tunnel.tpid_tci_pair",
3333 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
3336 { &hf_sflow_5_extended_80211_oui
,
3337 { "OUI", "sflow_5.extended_80211.oui",
3338 FT_UINT24
, BASE_HEX
, NULL
, 0x0,
3341 { &hf_sflow_5_extended_80211_suite_type
,
3342 { "Suite Type", "sflow_5.extended_80211.suite_type",
3343 FT_UINT8
, BASE_DEC
, VALS(extended_80211_suite_type_vals
), 0x0,
3346 { &hf_sflow_5_extended_80211_payload_length
,
3347 { "Payload Length", "sflow_5.extended_80211.payload_length",
3348 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
3351 { &hf_sflow_5_extended_80211_rx_bssid
,
3352 { "BSSID", "sflow_5.extended_80211.rx.bssid",
3353 FT_ETHER
, BASE_NONE
, NULL
, 0x0,
3356 { &hf_sflow_5_extended_80211_rx_version
,
3357 { "Version", "sflow_5.extended_80211.rx.version",
3358 FT_UINT32
, BASE_DEC
, VALS(sflow_5_ieee80211_versions
), 0x0,
3361 { &hf_sflow_5_extended_80211_rx_channel
,
3362 { "Channel", "sflow_5.extended_80211.rx.channel",
3363 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
3366 { &hf_sflow_5_extended_80211_rx_speed
,
3367 { "Speed", "sflow_5.extended_80211.rx.speed",
3368 FT_UINT64
, BASE_DEC
, NULL
, 0x0,
3371 { &hf_sflow_5_extended_80211_rx_rsni
,
3372 { "RSNI", "sflow_5.extended_80211.rx.rsni",
3373 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
3376 { &hf_sflow_5_extended_80211_rx_rcpi
,
3377 { "RCPI", "sflow_5.extended_80211.rx.rcpi",
3378 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
3381 { &hf_sflow_5_extended_80211_rx_packet_duration
,
3382 { "Packet Duration (ms)", "sflow_5.extended_80211.rx.packet_duration",
3383 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
3386 { &hf_sflow_5_extended_80211_tx_bssid
,
3387 { "BSSID", "sflow_5.extended_80211.tx.bssid",
3388 FT_ETHER
, BASE_NONE
, NULL
, 0x0,
3391 { &hf_sflow_5_extended_80211_tx_version
,
3392 { "Version", "sflow_5.extended_80211.tx.version",
3393 FT_UINT32
, BASE_DEC
, VALS(sflow_5_ieee80211_versions
), 0x0,
3396 { &hf_sflow_5_extended_80211_tx_retransmissions
,
3397 { "Retransmissions", "sflow_5.extended_80211.tx.retransmissions",
3398 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
3401 { &hf_sflow_5_extended_80211_tx_packet_duration
,
3402 { "Packet Duration (ms)", "sflow_5.extended_80211.tx.packet_duration",
3403 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
3406 { &hf_sflow_5_extended_80211_tx_retransmission_duration
,
3407 { "Retransmission Duration (ms)", "sflow_5.extended_80211.tx.retransmission_duration",
3408 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
3411 { &hf_sflow_5_extended_80211_tx_channel
,
3412 { "Channel", "sflow_5.extended_80211.tx.channel",
3413 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
3416 { &hf_sflow_5_extended_80211_tx_speed
,
3417 { "Speed", "sflow_5.extended_80211.tx.speed",
3418 FT_UINT64
, BASE_DEC
, NULL
, 0x0,
3421 { &hf_sflow_5_extended_80211_tx_power
,
3422 { "Power", "sflow_5.extended_80211.tx.power",
3423 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
3426 { &hf_sflow_flow_sample_sequence_number
,
3427 { "Sequence number", "sflow.flow_sample.sequence_number",
3428 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
3431 { &hf_sflow_flow_sample_source_id_class
,
3432 { "Source ID class", "sflow.flow_sample.source_id_class",
3433 FT_UINT32
, BASE_DEC
, NULL
, 0xFF000000,
3436 { &hf_sflow_flow_sample_sampling_rate
,
3437 { "Sampling rate", "sflow.flow_sample.sampling_rate",
3438 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
3441 { &hf_sflow_flow_sample_sample_pool
,
3442 { "Sample pool", "sflow.flow_sample.sample_pool",
3443 FT_UINT32
, BASE_DEC
|BASE_UNIT_STRING
, UNS(&units_total_packets
), 0x0,
3446 { &hf_sflow_flow_sample_dropped_packets
,
3447 { "Dropped packets", "sflow.flow_sample.dropped_packets",
3448 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
3451 { &hf_sflow_flow_sample_input_interface
,
3452 { "Input interface (ifIndex)", "sflow.flow_sample.input_interface",
3453 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
3456 { &hf_sflow_24_flow_sample_multiple_outputs
,
3457 { "Multiple outputs", "sflow.flow_sample.multiple_outputs",
3458 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
3461 { &hf_sflow_24_flow_sample_output_interface_format
,
3462 { "Output interface format", "sflow.flow_sample.output_interface.format",
3463 FT_UINT32
, BASE_DEC
, NULL
, 0x7fffffff,
3466 { &hf_sflow_5_flow_sample_output_interface_expanded_format
,
3467 { "Output interface expanded format", "sflow.flow_sample.output_interface.expanded.format",
3468 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
3471 { &hf_sflow_24_flow_sample_output_interface
,
3472 { "Output interface (ifIndex)", "sflow.flow_sample.output_interface",
3473 FT_UINT32
, BASE_DEC
, NULL
, 0x7fffffff,
3476 { &hf_sflow_5_flow_sample_output_interface
,
3477 { "Output interface", "sflow.flow_sample.output_interface",
3478 FT_UINT32
, BASE_HEX
, NULL
, 0x0,
3481 { &hf_sflow_5_flow_sample_output_interface_form
,
3482 { "Output interface format", "sflow.flow_sample.output_interface_format",
3483 FT_UINT32
, BASE_DEC
, VALS(interface_format
), SFLOW_5_INT_FORMAT
,
3486 { &hf_sflow_5_flow_sample_output_interface_val
,
3487 { "Output interface value", "sflow.flow_sample.output_interface_value",
3488 FT_UINT32
, BASE_DEC
, NULL
, SFLOW_5_INT_VALUE
,
3491 { &hf_sflow_5_flow_sample_output_interface_val_discard
,
3492 { "Output interface value", "sflow.flow_sample.output_interface_value",
3493 FT_UINT32
, BASE_DEC
, VALS(interface_discard
), SFLOW_5_INT_VALUE
,
3496 { &hf_sflow_enterprise
,
3497 { "Enterprise", "sflow.enterprise",
3498 FT_UINT32
, BASE_DEC
, NULL
, 0xFFFFF000,
3501 { &hf_sflow_enterprise_length
,
3502 { "Length", "sflow.enterprise.length",
3503 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
3506 { &hf_sflow_enterprise_data
,
3507 { "Data", "sflow.enterprise.data",
3508 FT_BYTES
, BASE_NONE
, NULL
, 0x0,
3511 { &hf_sflow_flow_sample_flow_record
,
3512 { "Flow record", "sflow.flow_sample.flow_record",
3513 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
3516 { &hf_sflow_flow_sample_source_id_type
,
3517 { "Source ID type", "sflow.flow_sample.source_id_type",
3518 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
3521 { &hf_sflow_flow_sample_source_id_index
,
3522 { "Source ID index", "sflow.flow_sample.source_id_index",
3523 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
3526 { &hf_sflow_flow_sample_input_interface_format
,
3527 { "Input interface format", "sflow.flow_sample.input_interface_format",
3528 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
3531 { &hf_sflow_flow_sample_input_interface_value
,
3532 { "Input interface value", "sflow.flow_sample.input_interface_value",
3533 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
3536 { &hf_sflow_24_flow_sample_output_interface_value
,
3537 { "Output interface value", "sflow.flow_sample.output_interface_value",
3538 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
3541 { &hf_sflow_5_flow_sample_output_interface_expanded_value
,
3542 { "Output interface expanded value", "sflow.flow_sample.output_interface_expanded.value",
3543 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
3546 { &hf_sflow_counters_sample_sequence_number
,
3547 { "Sequence number", "sflow.counters_sample.sequence_number",
3548 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
3551 { &hf_sflow_counters_sample_source_id_class
,
3552 { "Source ID class", "sflow.counters_sample.source_id_class",
3553 FT_UINT32
, BASE_DEC
, NULL
, 0xFF000000,
3556 { &hf_sflow_counters_sample_sampling_interval
,
3557 { "Sampling Interval", "sflow.counters_sample.sampling_interval",
3558 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
3561 { &hf_sflow_counters_sample_counters_type
,
3562 { "Counters type", "sflow.counters_sample.counters_type",
3563 FT_UINT32
, BASE_DEC
, VALS(sflow_245_counterstype
), 0x0,
3566 { &hf_sflow_counters_sample_source_id_type
,
3567 { "Source ID type", "sflow.counters_sample.source_id_type",
3568 FT_UINT32
, BASE_DEC
, NULL
, 0xFF000000,
3571 { &hf_sflow_counters_sample_source_id_index
,
3572 { "Source ID index", "sflow.counters_sample.source_id_index",
3573 FT_UINT32
, BASE_DEC
, NULL
, 0x00FFFFFF,
3576 { &hf_sflow_counters_sample_counters_records
,
3577 { "Counters records", "sflow.counters_sample.counters_records",
3578 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
3581 { &hf_sflow_counters_sample_expanded_source_id_type
,
3582 { "Source ID type", "sflow.counters_sample.source_id_type",
3583 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
3586 { &hf_sflow_counters_sample_expanded_source_id_index
,
3587 { "Source ID index", "sflow.counters_sample.source_id_index",
3588 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
3591 { &hf_sflow_lag_port_padding
,
3592 { "Padding", "sflow.lag_port.padding",
3593 FT_BYTES
, BASE_NONE
, NULL
, 0x0,
3596 { &hf_sflow_lag_port_actorsystemid
,
3597 { "Actor System ID", "sflow.lag_port.actor_system_id",
3598 FT_ETHER
, BASE_NONE
, NULL
, 0x0,
3601 { &hf_sflow_lag_port_partneropersystemid
,
3602 { "Partner Oper System ID", "sflow.lag_port.partner_oper_system_id",
3603 FT_ETHER
, BASE_NONE
, NULL
, 0x0,
3606 { &hf_sflow_lag_port_attachedaggid
,
3607 { "Port Attached Agg ID", "sflow.lag_port.attached_agg_id",
3608 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
3611 { &hf_sflow_lag_port_state
,
3612 { "State", "sflow.lag_port.state",
3613 FT_UINT32
, BASE_HEX
, NULL
, 0x0,
3616 { &hf_sflow_lag_port_actoradminstate
,
3617 { "Actor Admin State", "sflow.lag_port.actor_admin_state",
3618 FT_BOOLEAN
, 32, NULL
, 0x00000001,
3621 { &hf_sflow_lag_port_actoroperstate
,
3622 { "Actor Oper State", "sflow.lag_port.actor_oper_state",
3623 FT_BOOLEAN
, 32, NULL
, 0x00000002,
3626 { &hf_sflow_lag_port_partneradminstate
,
3627 { "Partner Admin State", "sflow.lag_port.partner_admin_state",
3628 FT_BOOLEAN
, 32, NULL
, 0x00000004,
3631 { &hf_sflow_lag_port_partneroperstate
,
3632 { "Partner Oper State", "sflow.lag_port.partner_oper_state",
3633 FT_BOOLEAN
, 32, NULL
, 0x00000008,
3636 { &hf_sflow_lag_port_reserved
,
3637 { "Reserved", "sflow.lag_port.reserved",
3638 FT_UINT32
, BASE_HEX
, NULL
, 0xFFFFFFF0,
3641 { &hf_sflow_5_lag_port_actoradminstate
,
3642 { "Actor Admin State", "sflow.lag_port.actor_admin_state",
3643 FT_BOOLEAN
, 32, NULL
, 0x000000FF,
3646 { &hf_sflow_5_lag_port_actoroperstate
,
3647 { "Actor Oper State", "sflow.lag_port.actor_oper_state",
3648 FT_BOOLEAN
, 32, NULL
, 0x0000FF00,
3651 { &hf_sflow_5_lag_port_partneradminstate
,
3652 { "Partner Admin State", "sflow.lag_port.partner_admin_state",
3653 FT_BOOLEAN
, 32, NULL
, 0x00FF0000,
3656 { &hf_sflow_5_lag_port_partneroperstate
,
3657 { "Partner Oper State", "sflow.lag_port.partner_oper_state",
3658 FT_BOOLEAN
, 32, NULL
, 0xFF000000,
3661 { &hf_sflow_lag_port_stats_lacpdusrx
,
3662 { "LACPDUs Rx", "sflow.lag_port.lacpdus.rx",
3663 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
3666 { &hf_sflow_lag_port_stats_markerpdusrx
,
3667 { "Marker PDUs Rx", "sflow.lag_port.marker_pdus.rx",
3668 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
3671 { &hf_sflow_lag_port_stats_markerresponsepdusrx
,
3672 { "Marker Response PDUs Rx", "sflow.lag_port.marker_response_pdus.rx",
3673 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
3676 { &hf_sflow_lag_port_stats_unknownrx
,
3677 { "Unknown Rx", "sflow.lag_port.unknown.rx",
3678 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
3681 { &hf_sflow_lag_port_stats_illegalrx
,
3682 { "Illegal Rx", "sflow.lag_port.illegal.rx",
3683 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
3686 { &hf_sflow_lag_port_stats_lacpdustx
,
3687 { "LACPDUs Tx", "sflow.lag_port.lacpdus.tx",
3688 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
3691 { &hf_sflow_lag_port_stats_markerpdustx
,
3692 { "Marker PDUs Tx", "sflow.lag_port.marker_pdus.tx",
3693 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
3696 { &hf_sflow_lag_port_stats_markerresponsepdustx
,
3697 { "Marker Response PDUs Tx", "sflow.lag_port.marker_response_pdus.tx",
3698 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
3702 { &hf_sflow_245_as_type
,
3703 { "AS Type", "sflow.as_type",
3704 FT_UINT32
, BASE_DEC
, VALS(sflow_245_as_types
), 0x0,
3707 { &hf_sflow_245_ip_protocol
,
3708 { "IP Protocol", "sflow.ip_protocol",
3709 FT_UINT32
, BASE_DEC
|BASE_EXT_STRING
, &ipproto_val_ext
, 0x0,
3712 { &hf_sflow_5_extended_user_source_user
,
3713 { "Source User", "sflow_5.extended_user.source_user",
3714 FT_STRING
, BASE_NONE
, NULL
, 0x0,
3717 { &hf_sflow_5_extended_user_destination_user
,
3718 { "Destination User", "sflow_5.extended_user.destination_user",
3719 FT_STRING
, BASE_NONE
, NULL
, 0x0,
3722 { &hf_sflow_5_extended_url_direction
,
3723 { "Direction", "sflow_5.extended_url.direction",
3724 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
3727 { &hf_sflow_5_extended_url_url
,
3728 { "URL", "sflow_5.extended_url.url",
3729 FT_STRING
, BASE_NONE
, NULL
, 0x0,
3732 { &hf_sflow_5_extended_url_host
,
3733 { "Host", "sflow_5.extended_url.host",
3734 FT_STRING
, BASE_NONE
, NULL
, 0x0,
3737 { &hf_sflow_5_extended_mpls_tunnel_name
,
3738 { "Tunnel Name", "sflow_5.extended_mpls_tunnel.tunnel_name",
3739 FT_STRING
, BASE_NONE
, NULL
, 0x0,
3742 { &hf_sflow_5_extended_mpls_vc_instance_name
,
3743 { "VC Instance Name", "sflow_5.extended_mpls_vc.vc_instance_name",
3744 FT_STRING
, BASE_NONE
, NULL
, 0x0,
3747 { &hf_sflow_5_extended_mpls_ftn_description
,
3748 { "MPLS FTN Description", "sflow_5.extended_mpls.ftn_description",
3749 FT_STRING
, BASE_NONE
, NULL
, 0x0,
3752 { &hf_sflow_5_extended_80211_payload
,
3753 { "Payload", "sflow_5.extended_80211.payload",
3754 FT_BYTES
, BASE_NONE
, NULL
, 0x0,
3757 { &hf_sflow_5_extended_80211_rx_ssid
,
3758 { "SSID", "sflow_5.extended_80211.rx.ssid",
3759 FT_STRING
, BASE_NONE
, NULL
, 0x0,
3762 { &hf_sflow_5_extended_80211_tx_ssid
,
3763 { "SSID", "sflow_5.extended_80211.tx.ssid",
3764 FT_STRING
, BASE_NONE
, NULL
, 0x0,
3767 { &hf_sflow_flow_sample_index
,
3768 { "Index", "sflow.flow_sample.index",
3769 FT_UINT32
, BASE_DEC
, NULL
, 0x00FFFFFF,
3772 { &hf_sflow_counters_sample_index
,
3773 { "Index", "sflow.counters_sample.index",
3774 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
3779 /* Setup protocol subtree array */
3780 static int * ett
[] = {
3782 &ett_sflow_245_sample
,
3783 &ett_sflow_5_flow_record
,
3784 &ett_sflow_5_counters_record
,
3785 &ett_sflow_5_mpls_in_label_stack
,
3786 &ett_sflow_5_mpls_out_label_stack
,
3787 &ett_sflow_245_extended_data
,
3788 &ett_sflow_245_gw_as_dst
,
3789 &ett_sflow_245_gw_as_dst_seg
,
3790 &ett_sflow_245_gw_community
,
3791 &ett_sflow_245_sampled_header
,
3792 &ett_sflow_lag_port_state_flags
,
3793 &ett_sflow_5_output_interface
,
3796 static ei_register_info ei
[] = {
3797 { &ei_sflow_invalid_address_type
, { "sflow.invalid_address_type", PI_MALFORMED
, PI_ERROR
, "Unknown/invalid address type", EXPFILL
}},
3800 expert_module_t
* expert_sflow
;
3802 /* Register the protocol name and description */
3803 proto_sflow
= proto_register_protocol("InMon sFlow", "sFlow", "sflow");
3805 /* Required function calls to register the header fields and subtrees used */
3806 proto_register_field_array(proto_sflow
, hf
, array_length(hf
));
3807 proto_register_subtree_array(ett
, array_length(ett
));
3808 expert_sflow
= expert_register_protocol(proto_sflow
);
3809 expert_register_field_array(expert_sflow
, ei
, array_length(ei
));
3811 header_subdissector_table
= register_dissector_table("sflow_245.header_protocol", "SFLOW header protocol", proto_sflow
, FT_UINT32
, BASE_DEC
);
3813 /* Register our dissector handle */
3814 sflow_handle
= register_dissector("sflow", dissect_sflow_245
, proto_sflow
);
3816 /* Register our configuration options for sFlow */
3817 sflow_245_module
= prefs_register_protocol(proto_sflow
, NULL
);
3820 If I use a filter like "ip.src == 10.1.1.1" this will, in
3821 addition to the usual suspects, find every sFlow packet
3822 where *any* of the payload headers contain 10.1.1.1 as a
3823 src addr. I think this may not be the desired behavior.
3824 It can certainly be confusing since the ip.src being found
3825 is buried about 3 subtrees deep and the subtrees might be
3826 under any one of the sampled (payload) header trees. It is
3827 certainly not quickly obvious why the filter matched.
3829 prefs_register_bool_preference(sflow_245_module
, "enable_dissection",
3830 "Dissect data in sampled headers",
3831 "Enabling dissection makes it easy to view protocol details in each of the sampled headers."
3832 " Disabling dissection may reduce noise caused when display filters match the contents of"
3833 " any sampled header(s).",
3834 &global_dissect_samp_headers
);
3836 It is not clear to me that it *ever* makes sense to enable
3837 this option. However, it was previously the default
3838 behavior so I'll leave it as an option if someone thinks
3839 they have a use for it.
3841 prefs_register_bool_preference(sflow_245_module
, "enable_analysis",
3842 "Analyze data in sampled IP headers",
3843 "This option only makes sense if dissection of sampled headers is enabled and probably not even then.",
3844 &global_analyze_samp_ip_headers
);
3848 proto_reg_handoff_sflow_245(void) {
3850 dissector_add_uint_range_with_preference("udp.port", SFLOW_UDP_PORTS
, sflow_handle
);
3854 * Editor modelines - https://www.wireshark.org/tools/modelines.html
3859 * indent-tabs-mode: nil
3862 * vi: set shiftwidth=4 tabstop=8 expandtab:
3863 * :indentSize=4:tabSize=8:noTabs=true: