1 /* Copyright (c) 2002-2009 InMon Corp. Licensed under the terms of either the
2 * Sun Industry Standards Source License 1.1, that is available at:
3 * http://host-sflow.sourceforge.net/sissl.html
4 * or the InMon sFlow License, that is available at:
5 * http://www.inmon.com/technology/sflowlicense.txt
15 #include "openvswitch/types.h"
18 SFL_DSCLASS_IFINDEX
= 0,
20 SFL_DSCLASS_PHYSICAL_ENTITY
= 2,
21 SFL_DSCLASS_LOGICAL_ENTITY
= 3
24 enum SFLAddress_type
{
25 SFLADDRESSTYPE_IP_V4
= 1,
26 SFLADDRESSTYPE_IP_V6
= 2
37 typedef union _SFLAddress_value
{
42 typedef struct _SFLAddress
{
43 u_int32_t type
; /* enum SFLAddress_type */
44 SFLAddress_value address
;
47 /* Packet header data */
49 #define SFL_DEFAULT_HEADER_SIZE 128
50 #define SFL_DEFAULT_COLLECTOR_PORT 6343
51 #define SFL_DEFAULT_SAMPLING_RATE 400
52 #define SFL_DEFAULT_POLLING_INTERVAL 30
54 /* The header protocol describes the format of the sampled header */
55 enum SFLHeader_protocol
{
56 SFLHEADER_ETHERNET_ISO8023
= 1,
57 SFLHEADER_ISO88024_TOKENBUS
= 2,
58 SFLHEADER_ISO88025_TOKENRING
= 3,
60 SFLHEADER_FRAME_RELAY
= 5,
65 SFLHEADER_AAL5_IP
= 10, /* e.g. Cisco AAL5 mux */
71 /* raw sampled header */
73 typedef struct _SFLSampled_header
{
74 u_int32_t header_protocol
; /* (enum SFLHeader_protocol) */
75 u_int32_t frame_length
; /* Original length of packet before sampling */
76 u_int32_t stripped
; /* header/trailer bytes stripped by sender */
77 u_int32_t header_length
; /* length of sampled header bytes to follow */
78 u_int8_t
*header_bytes
; /* Header bytes */
81 /* decoded ethernet header */
83 typedef struct _SFLSampled_ethernet
{
84 u_int32_t eth_len
; /* The length of the MAC packet excluding
85 lower layer encapsulations */
86 struct eth_addr src_mac
; /* 6 bytes */
87 u_int8_t pad1
[2]; /* 2 pad */
88 struct eth_addr dst_mac
;
91 } SFLSampled_ethernet
;
93 /* decoded IP version 4 header */
95 typedef struct _SFLSampled_ipv4
{
96 u_int32_t length
; /* The length of the IP packet
97 excluding lower layer encapsulations */
98 u_int32_t protocol
; /* IP Protocol type (for example, TCP = 6, UDP = 17) */
99 SFLIPv4 src_ip
; /* Source IP Address */
100 SFLIPv4 dst_ip
; /* Destination IP Address */
101 u_int32_t src_port
; /* TCP/UDP source port number or equivalent */
102 u_int32_t dst_port
; /* TCP/UDP destination port number or equivalent */
103 u_int32_t tcp_flags
; /* TCP flags */
104 u_int32_t tos
; /* IP type of service */
107 /* decoded IP version 6 data */
109 typedef struct _SFLSampled_ipv6
{
110 u_int32_t length
; /* The length of the IP packet
111 excluding lower layer encapsulations */
112 u_int32_t protocol
; /* IP Protocol type (for example, TCP = 6, UDP = 17) */
113 SFLIPv6 src_ip
; /* Source IP Address */
114 SFLIPv6 dst_ip
; /* Destination IP Address */
115 u_int32_t src_port
; /* TCP/UDP source port number or equivalent */
116 u_int32_t dst_port
; /* TCP/UDP destination port number or equivalent */
117 u_int32_t tcp_flags
; /* TCP flags */
118 u_int32_t priority
; /* IP priority */
121 /* Extended data types */
123 /* Extended switch data */
125 typedef struct _SFLExtended_switch
{
126 u_int32_t src_vlan
; /* The 802.1Q VLAN id of incomming frame */
127 u_int32_t src_priority
; /* The 802.1p priority */
128 u_int32_t dst_vlan
; /* The 802.1Q VLAN id of outgoing frame */
129 u_int32_t dst_priority
; /* The 802.1p priority */
130 } SFLExtended_switch
;
132 /* Extended router data */
134 typedef struct _SFLExtended_router
{
135 SFLAddress nexthop
; /* IP address of next hop router */
136 u_int32_t src_mask
; /* Source address prefix mask bits */
137 u_int32_t dst_mask
; /* Destination address prefix mask bits */
138 } SFLExtended_router
;
140 /* Extended gateway data */
141 enum SFLExtended_as_path_segment_type
{
142 SFLEXTENDED_AS_SET
= 1, /* Unordered set of ASs */
143 SFLEXTENDED_AS_SEQUENCE
= 2 /* Ordered sequence of ASs */
146 typedef struct _SFLExtended_as_path_segment
{
147 u_int32_t type
; /* enum SFLExtended_as_path_segment_type */
148 u_int32_t length
; /* number of AS numbers in set/sequence */
153 } SFLExtended_as_path_segment
;
155 typedef struct _SFLExtended_gateway
{
156 SFLAddress nexthop
; /* Address of the border router that should
157 be used for the destination network */
158 u_int32_t as
; /* AS number for this gateway */
159 u_int32_t src_as
; /* AS number of source (origin) */
160 u_int32_t src_peer_as
; /* AS number of source peer */
161 u_int32_t dst_as_path_segments
; /* number of segments in path */
162 SFLExtended_as_path_segment
*dst_as_path
; /* list of seqs or sets */
163 u_int32_t communities_length
; /* number of communities */
164 u_int32_t
*communities
; /* set of communities */
165 u_int32_t localpref
; /* LocalPref associated with this route */
166 } SFLExtended_gateway
;
168 typedef struct _SFLString
{
173 /* Extended user data */
175 typedef struct _SFLExtended_user
{
176 u_int32_t src_charset
; /* MIBEnum value of character set used to encode a string - See RFC 2978
177 Where possible UTF-8 encoding (MIBEnum=106) should be used. A value
178 of zero indicates an unknown encoding. */
180 u_int32_t dst_charset
;
184 /* Extended URL data */
186 enum SFLExtended_url_direction
{
187 SFLEXTENDED_URL_SRC
= 1, /* URL is associated with source address */
188 SFLEXTENDED_URL_DST
= 2 /* URL is associated with destination address */
191 typedef struct _SFLExtended_url
{
192 u_int32_t direction
; /* enum SFLExtended_url_direction */
193 SFLString url
; /* URL associated with the packet flow.
194 Must be URL encoded */
195 SFLString host
; /* The host field from the HTTP header */
198 /* Extended MPLS data */
200 typedef struct _SFLLabelStack
{
202 u_int32_t
*stack
; /* first entry is top of stack - see RFC 3032 for encoding */
205 typedef struct _SFLExtended_mpls
{
206 SFLAddress nextHop
; /* Address of the next hop */
207 SFLLabelStack in_stack
;
208 SFLLabelStack out_stack
;
212 Packet header records report addresses as seen at the sFlowDataSource.
213 The extended_nat structure reports on translated source and/or destination
214 addesses for this packet. If an address was not translated it should
215 be equal to that reported for the header. */
217 typedef struct _SFLExtended_nat
{
218 SFLAddress src
; /* Source address */
219 SFLAddress dst
; /* Destination address */
222 /* additional Extended MPLS stucts */
224 typedef struct _SFLExtended_mpls_tunnel
{
225 SFLString tunnel_lsp_name
; /* Tunnel name */
226 u_int32_t tunnel_id
; /* Tunnel ID */
227 u_int32_t tunnel_cos
; /* Tunnel COS value */
228 } SFLExtended_mpls_tunnel
;
230 typedef struct _SFLExtended_mpls_vc
{
231 SFLString vc_instance_name
; /* VC instance name */
232 u_int32_t vll_vc_id
; /* VLL/VC instance ID */
233 u_int32_t vc_label_cos
; /* VC Label COS value */
234 } SFLExtended_mpls_vc
;
237 - Definitions from MPLS-FTN-STD-MIB mplsFTNTable */
239 typedef struct _SFLExtended_mpls_FTN
{
240 SFLString mplsFTNDescr
;
241 u_int32_t mplsFTNMask
;
242 } SFLExtended_mpls_FTN
;
244 /* Extended MPLS LVP FEC
245 - Definition from MPLS-LDP-STD-MIB mplsFecTable
246 Note: mplsFecAddrType, mplsFecAddr information available
247 from packet header */
249 typedef struct _SFLExtended_mpls_LDP_FEC
{
250 u_int32_t mplsFecAddrPrefixLength
;
251 } SFLExtended_mpls_LDP_FEC
;
253 /* Extended VLAN tunnel information
254 Record outer VLAN encapsulations that have
255 been stripped. extended_vlantunnel information
256 should only be reported if all the following conditions are satisfied:
257 1. The packet has nested vlan tags, AND
258 2. The reporting device is VLAN aware, AND
259 3. One or more VLAN tags have been stripped, either
260 because they represent proprietary encapsulations, or
261 because switch hardware automatically strips the outer VLAN
263 Reporting extended_vlantunnel information is not a substitute for
264 reporting extended_switch information. extended_switch data must
265 always be reported to describe the ingress/egress VLAN information
266 for the packet. The extended_vlantunnel information only applies to
267 nested VLAN tags, and then only when one or more tags has been
270 typedef SFLLabelStack SFLVlanStack
;
271 typedef struct _SFLExtended_vlan_tunnel
{
272 SFLVlanStack stack
; /* List of stripped 802.1Q TPID/TCI layers. Each
273 TPID,TCI pair is represented as a single 32 bit
274 integer. Layers listed from outermost to
276 } SFLExtended_vlan_tunnel
;
278 typedef struct _SFLExtended_vni
{
279 uint32_t vni
; /* virtual network identifier */
282 enum SFLFlow_type_tag
{
283 /* enterprise = 0, format = ... */
284 SFLFLOW_HEADER
= 1, /* Packet headers are sampled */
285 SFLFLOW_ETHERNET
= 2, /* MAC layer information */
286 SFLFLOW_IPV4
= 3, /* IP version 4 data */
287 SFLFLOW_IPV6
= 4, /* IP version 6 data */
288 SFLFLOW_EX_SWITCH
= 1001, /* Extended switch information */
289 SFLFLOW_EX_ROUTER
= 1002, /* Extended router information */
290 SFLFLOW_EX_GATEWAY
= 1003, /* Extended gateway router information */
291 SFLFLOW_EX_USER
= 1004, /* Extended TACAS/RADIUS user information */
292 SFLFLOW_EX_URL
= 1005, /* Extended URL information */
293 SFLFLOW_EX_MPLS
= 1006, /* Extended MPLS information */
294 SFLFLOW_EX_NAT
= 1007, /* Extended NAT information */
295 SFLFLOW_EX_MPLS_TUNNEL
= 1008, /* additional MPLS information */
296 SFLFLOW_EX_MPLS_VC
= 1009,
297 SFLFLOW_EX_MPLS_FTN
= 1010,
298 SFLFLOW_EX_MPLS_LDP_FEC
= 1011,
299 SFLFLOW_EX_VLAN_TUNNEL
= 1012, /* VLAN stack */
300 SFLFLOW_EX_IPV4_TUNNEL_EGRESS
= 1023, /* http://sflow.org/sflow_tunnels.txt */
301 SFLFLOW_EX_IPV4_TUNNEL_INGRESS
= 1024,
302 SFLFLOW_EX_VNI_EGRESS
= 1029,
303 SFLFLOW_EX_VNI_INGRESS
= 1030,
306 typedef union _SFLFlow_type
{
307 SFLSampled_header header
;
308 SFLSampled_ethernet ethernet
;
309 SFLSampled_ipv4 ipv4
;
310 SFLSampled_ipv6 ipv6
;
311 SFLExtended_switch sw
;
312 SFLExtended_router router
;
313 SFLExtended_gateway gateway
;
314 SFLExtended_user user
;
316 SFLExtended_mpls mpls
;
318 SFLExtended_mpls_tunnel mpls_tunnel
;
319 SFLExtended_mpls_vc mpls_vc
;
320 SFLExtended_mpls_FTN mpls_ftn
;
321 SFLExtended_mpls_LDP_FEC mpls_ldp_fec
;
322 SFLExtended_vlan_tunnel vlan_tunnel
;
323 SFLExtended_vni tunnel_vni
;
326 typedef struct _SFLFlow_sample_element
{
327 struct _SFLFlow_sample_element
*nxt
;
328 u_int32_t tag
; /* SFLFlow_type_tag */
330 SFLFlow_type flowType
;
331 } SFLFlow_sample_element
;
333 enum SFL_sample_tag
{
334 SFLFLOW_SAMPLE
= 1, /* enterprise = 0 : format = 1 */
335 SFLCOUNTERS_SAMPLE
= 2, /* enterprise = 0 : format = 2 */
336 SFLFLOW_SAMPLE_EXPANDED
= 3, /* enterprise = 0 : format = 3 */
337 SFLCOUNTERS_SAMPLE_EXPANDED
= 4 /* enterprise = 0 : format = 4 */
340 /* Format of a single flow sample */
342 typedef struct _SFLFlow_sample
{
343 /* u_int32_t tag; */ /* SFL_sample_tag -- enterprise = 0 : format = 1 */
344 /* u_int32_t length; */
345 u_int32_t sequence_number
; /* Incremented with each flow sample
347 u_int32_t source_id
; /* fsSourceId */
348 u_int32_t sampling_rate
; /* fsPacketSamplingRate */
349 u_int32_t sample_pool
; /* Total number of packets that could have been
350 sampled (i.e. packets skipped by sampling
351 process + total number of samples) */
352 u_int32_t drops
; /* Number of times a packet was dropped due to
354 u_int32_t input
; /* SNMP ifIndex of input interface.
355 0 if interface is not known. */
356 u_int32_t output
; /* SNMP ifIndex of output interface,
357 0 if interface is not known.
358 Set most significant bit to indicate
359 multiple destination interfaces
360 (i.e. in case of broadcast or multicast)
361 and set lower order bits to indicate
362 number of destination interfaces.
364 0x00000002 indicates ifIndex = 2
365 0x00000000 ifIndex unknown.
366 0x80000007 indicates a packet sent
368 0x80000000 indicates a packet sent to
370 interfaces greater than 1.*/
371 u_int32_t num_elements
;
372 SFLFlow_sample_element
*elements
;
375 /* same thing, but the expanded version (for full 32-bit ifIndex numbers) */
377 typedef struct _SFLFlow_sample_expanded
{
378 /* u_int32_t tag; */ /* SFL_sample_tag -- enterprise = 0 : format = 1 */
379 /* u_int32_t length; */
380 u_int32_t sequence_number
; /* Incremented with each flow sample
382 u_int32_t ds_class
; /* EXPANDED */
383 u_int32_t ds_index
; /* EXPANDED */
384 u_int32_t sampling_rate
; /* fsPacketSamplingRate */
385 u_int32_t sample_pool
; /* Total number of packets that could have been
386 sampled (i.e. packets skipped by sampling
387 process + total number of samples) */
388 u_int32_t drops
; /* Number of times a packet was dropped due to
390 u_int32_t inputFormat
; /* EXPANDED */
391 u_int32_t input
; /* SNMP ifIndex of input interface.
392 0 if interface is not known. */
393 u_int32_t outputFormat
; /* EXPANDED */
394 u_int32_t output
; /* SNMP ifIndex of output interface,
395 0 if interface is not known. */
396 u_int32_t num_elements
;
397 SFLFlow_sample_element
*elements
;
398 } SFLFlow_sample_expanded
;
402 #define SFL_UNDEF_COUNTER(c) c=-1
403 #define SFL_UNDEF_GAUGE(c) c=0
405 /* Generic interface counters - see RFC 1573, 2233 */
407 typedef struct _SFLIf_counters
{
411 u_int32_t ifDirection
; /* Derived from MAU MIB (RFC 2668)
412 0 = unknown, 1 = full-duplex,
413 2 = half-duplex, 3 = in, 4 = out */
414 u_int32_t ifStatus
; /* bit field with the following bits assigned:
415 bit 0 = ifAdminStatus (0 = down, 1 = up)
416 bit 1 = ifOperStatus (0 = down, 1 = up) */
417 u_int64_t ifInOctets
;
418 u_int32_t ifInUcastPkts
;
419 u_int32_t ifInMulticastPkts
;
420 u_int32_t ifInBroadcastPkts
;
421 u_int32_t ifInDiscards
;
422 u_int32_t ifInErrors
;
423 u_int32_t ifInUnknownProtos
;
424 u_int64_t ifOutOctets
;
425 u_int32_t ifOutUcastPkts
;
426 u_int32_t ifOutMulticastPkts
;
427 u_int32_t ifOutBroadcastPkts
;
428 u_int32_t ifOutDiscards
;
429 u_int32_t ifOutErrors
;
430 u_int32_t ifPromiscuousMode
;
433 #define SFL_CTR_GENERIC_XDR_SIZE 88
435 /* Ethernet interface counters - see RFC 2358 */
436 typedef struct _SFLEthernet_counters
{
437 u_int32_t dot3StatsAlignmentErrors
;
438 u_int32_t dot3StatsFCSErrors
;
439 u_int32_t dot3StatsSingleCollisionFrames
;
440 u_int32_t dot3StatsMultipleCollisionFrames
;
441 u_int32_t dot3StatsSQETestErrors
;
442 u_int32_t dot3StatsDeferredTransmissions
;
443 u_int32_t dot3StatsLateCollisions
;
444 u_int32_t dot3StatsExcessiveCollisions
;
445 u_int32_t dot3StatsInternalMacTransmitErrors
;
446 u_int32_t dot3StatsCarrierSenseErrors
;
447 u_int32_t dot3StatsFrameTooLongs
;
448 u_int32_t dot3StatsInternalMacReceiveErrors
;
449 u_int32_t dot3StatsSymbolErrors
;
450 } SFLEthernet_counters
;
452 #define SFL_CTR_ETHERNET_XDR_SIZE 52
454 /* Token ring counters - see RFC 1748 */
456 typedef struct _SFLTokenring_counters
{
457 u_int32_t dot5StatsLineErrors
;
458 u_int32_t dot5StatsBurstErrors
;
459 u_int32_t dot5StatsACErrors
;
460 u_int32_t dot5StatsAbortTransErrors
;
461 u_int32_t dot5StatsInternalErrors
;
462 u_int32_t dot5StatsLostFrameErrors
;
463 u_int32_t dot5StatsReceiveCongestions
;
464 u_int32_t dot5StatsFrameCopiedErrors
;
465 u_int32_t dot5StatsTokenErrors
;
466 u_int32_t dot5StatsSoftErrors
;
467 u_int32_t dot5StatsHardErrors
;
468 u_int32_t dot5StatsSignalLoss
;
469 u_int32_t dot5StatsTransmitBeacons
;
470 u_int32_t dot5StatsRecoverys
;
471 u_int32_t dot5StatsLobeWires
;
472 u_int32_t dot5StatsRemoves
;
473 u_int32_t dot5StatsSingles
;
474 u_int32_t dot5StatsFreqErrors
;
475 } SFLTokenring_counters
;
477 /* 100 BaseVG interface counters - see RFC 2020 */
479 typedef struct _SFLVg_counters
{
480 u_int32_t dot12InHighPriorityFrames
;
481 u_int64_t dot12InHighPriorityOctets
;
482 u_int32_t dot12InNormPriorityFrames
;
483 u_int64_t dot12InNormPriorityOctets
;
484 u_int32_t dot12InIPMErrors
;
485 u_int32_t dot12InOversizeFrameErrors
;
486 u_int32_t dot12InDataErrors
;
487 u_int32_t dot12InNullAddressedFrames
;
488 u_int32_t dot12OutHighPriorityFrames
;
489 u_int64_t dot12OutHighPriorityOctets
;
490 u_int32_t dot12TransitionIntoTrainings
;
491 u_int64_t dot12HCInHighPriorityOctets
;
492 u_int64_t dot12HCInNormPriorityOctets
;
493 u_int64_t dot12HCOutHighPriorityOctets
;
496 typedef struct _SFLVlan_counters
{
500 u_int32_t multicastPkts
;
501 u_int32_t broadcastPkts
;
507 u_int64_t datapath_id
;
511 #define SFL_CTR_OPENFLOWPORT_XDR_SIZE 12
518 #define SFL_MAX_PORTNAME_LEN 255
520 /* LAG Port Statistics - see http://sflow.org/sflow_lag.txt */
521 /* opaque = counter_data; enterprise = 0; format = 7 */
523 typedef union _SFLLACP_portState
{
528 uint8_t partnerAdmin
;
533 typedef struct _SFLLACP_counters
{
534 struct eth_addr actorSystemID
; /* 6 bytes */
536 struct eth_addr partnerSystemID
; /* 6 bytes */
538 uint32_t attachedAggID
;
539 SFLLACP_portState portState
;
541 uint32_t markerPDUsRx
;
542 uint32_t markerResponsePDUsRx
;
546 uint32_t markerPDUsTx
;
547 uint32_t markerResponsePDUsTx
;
550 #define SFL_CTR_LACP_XDR_SIZE 56
552 /* Application resource counters */
554 typedef struct _SFLAPPResources_counters
{
555 uint32_t user_time
; /* in milliseconds */
556 uint32_t system_time
; /* in milliseconds */
563 } SFLAPPResources_counters
;
565 #define SFL_CTR_APP_RESOURCES_XDR_SIZE 40
567 /* OVS datapath stats */
569 typedef struct _SFLOVSDP_counters
{
578 #define SFL_CTR_OVSDP_XDR_SIZE 24
582 enum SFLCounters_type_tag
{
583 /* enterprise = 0, format = ... */
584 SFLCOUNTERS_GENERIC
= 1,
585 SFLCOUNTERS_ETHERNET
= 2,
586 SFLCOUNTERS_TOKENRING
= 3,
588 SFLCOUNTERS_VLAN
= 5,
589 SFLCOUNTERS_LACP
= 7,
590 SFLCOUNTERS_OPENFLOWPORT
= 1004,
591 SFLCOUNTERS_PORTNAME
= 1005,
592 SFLCOUNTERS_APP_RESOURCES
= 2203,
593 SFLCOUNTERS_OVSDP
= 2207
596 typedef union _SFLCounters_type
{
597 SFLIf_counters generic
;
598 SFLEthernet_counters ethernet
;
599 SFLTokenring_counters tokenring
;
601 SFLVlan_counters vlan
;
602 SFLLACP_counters lacp
;
603 SFLOpenFlowPort ofPort
;
604 SFLPortName portName
;
605 SFLAPPResources_counters appResources
;
606 SFLOVSDP_counters ovsdp
;
609 typedef struct _SFLCounters_sample_element
{
610 struct _SFLCounters_sample_element
*nxt
; /* linked list */
611 u_int32_t tag
; /* SFLCounters_type_tag */
613 SFLCounters_type counterBlock
;
614 } SFLCounters_sample_element
;
616 typedef struct _SFLCounters_sample
{
617 /* u_int32_t tag; */ /* SFL_sample_tag -- enterprise = 0 : format = 2 */
618 /* u_int32_t length; */
619 u_int32_t sequence_number
; /* Incremented with each counters sample
620 generated by this source_id */
621 u_int32_t source_id
; /* fsSourceId */
622 u_int32_t num_elements
;
623 SFLCounters_sample_element
*elements
;
624 } SFLCounters_sample
;
626 /* same thing, but the expanded version, so ds_index can be a full 32 bits */
627 typedef struct _SFLCounters_sample_expanded
{
628 /* u_int32_t tag; */ /* SFL_sample_tag -- enterprise = 0 : format = 2 */
629 /* u_int32_t length; */
630 u_int32_t sequence_number
; /* Incremented with each counters sample
631 generated by this source_id */
632 u_int32_t ds_class
; /* EXPANDED */
633 u_int32_t ds_index
; /* EXPANDED */
634 u_int32_t num_elements
;
635 SFLCounters_sample_element
*elements
;
636 } SFLCounters_sample_expanded
;
638 #define SFLADD_ELEMENT(_sm, _el) do { (_el)->nxt = (_sm)->elements; (_sm)->elements = (_el); } while(0)
640 /* Format of a sample datagram */
642 enum SFLDatagram_version
{
643 SFLDATAGRAM_VERSION2
= 2,
644 SFLDATAGRAM_VERSION4
= 4,
645 SFLDATAGRAM_VERSION5
= 5
648 typedef struct _SFLSample_datagram_hdr
{
649 u_int32_t datagram_version
; /* (enum SFLDatagram_version) = VERSION5 = 5 */
650 SFLAddress agent_address
; /* IP address of sampling agent */
651 u_int32_t sub_agent_id
; /* Used to distinguishing between datagram
652 streams from separate agent sub entities
654 u_int32_t sequence_number
; /* Incremented with each sample datagram
656 u_int32_t uptime
; /* Current time (in milliseconds since device
657 last booted). Should be set as close to
658 datagram transmission time as possible.*/
659 u_int32_t num_records
; /* Number of tag-len-val flow/counter records to follow */
660 } SFLSample_datagram_hdr
;
662 #define SFL_MAX_DATAGRAM_SIZE 1500
663 #define SFL_MIN_DATAGRAM_SIZE 200
664 #define SFL_DEFAULT_DATAGRAM_SIZE 1400
666 #define SFL_DATA_PAD 400