summaryrefslogtreecommitdiff
path: root/lib/sflow.h
diff options
context:
space:
mode:
authorNeil McKee <neil.mckee@inmon.com>2014-06-27 11:19:59 -0700
committerBen Pfaff <blp@nicira.com>2014-11-11 13:28:40 -0800
commit50b9699fe49b66de64d0d0b1803bb13e95ca2c2e (patch)
tree97b6c4d020511efe85a9f6f6596d6a1e03e26f86 /lib/sflow.h
parentafc63bb4bc0692af8bfa16d2a573b8b3bce52895 (diff)
downloadopenvswitch-50b9699fe49b66de64d0d0b1803bb13e95ca2c2e.tar.gz
sflow: Export LAG, PORTNAME, and OPENFLOWPORT information also.
Export standard sFlow LAG, PORTNAME and OPENFLOWPORT structures with each counter-sample. Add unit-test for sFlow-LAG. Adjust other unit-tests to accommodate these new annotations. The sFlow-LAG structures are important for topology discovery, for troubleshooting LAG instability, and for correctly combining sFlow feeds from multiple sources. The OPENFLOWPORT and PORTNAME structures are important for systems that aim to combine sFlow monitoring with OpenFlow controls, as they provide straightforward mapping (1) between sFlow agent IP and OpenFlow datapath-id, and (2) between interface name,ifIndex and OpenFlow port number. Signed-off-by: Neil McKee <neil.mckee@inmon.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
Diffstat (limited to 'lib/sflow.h')
-rw-r--r--lib/sflow.h69
1 files changed, 68 insertions, 1 deletions
diff --git a/lib/sflow.h b/lib/sflow.h
index c6cde7f23..dfe138f10 100644
--- a/lib/sflow.h
+++ b/lib/sflow.h
@@ -271,6 +271,10 @@ typedef struct _SFLExtended_vlan_tunnel {
innermost. */
} SFLExtended_vlan_tunnel;
+typedef struct _SFLExtended_vni {
+ uint32_t vni; /* virtual network identifier */
+} SFLExtended_vni;
+
enum SFLFlow_type_tag {
/* enterprise = 0, format = ... */
SFLFLOW_HEADER = 1, /* Packet headers are sampled */
@@ -289,6 +293,10 @@ enum SFLFlow_type_tag {
SFLFLOW_EX_MPLS_FTN = 1010,
SFLFLOW_EX_MPLS_LDP_FEC = 1011,
SFLFLOW_EX_VLAN_TUNNEL = 1012, /* VLAN stack */
+ SFLFLOW_EX_IPV4_TUNNEL_EGRESS = 1023, /* http://sflow.org/sflow_tunnels.txt */
+ SFLFLOW_EX_IPV4_TUNNEL_INGRESS = 1024,
+ SFLFLOW_EX_VNI_EGRESS = 1029,
+ SFLFLOW_EX_VNI_INGRESS = 1030,
};
typedef union _SFLFlow_type {
@@ -308,6 +316,7 @@ typedef union _SFLFlow_type {
SFLExtended_mpls_FTN mpls_ftn;
SFLExtended_mpls_LDP_FEC mpls_ldp_fec;
SFLExtended_vlan_tunnel vlan_tunnel;
+ SFLExtended_vni tunnel_vni;
} SFLFlow_type;
typedef struct _SFLFlow_sample_element {
@@ -386,6 +395,9 @@ typedef struct _SFLFlow_sample_expanded {
/* Counter types */
+#define SFL_UNDEF_COUNTER(c) c=-1
+#define SFL_UNDEF_GAUGE(c) c=0
+
/* Generic interface counters - see RFC 1573, 2233 */
typedef struct _SFLIf_counters {
@@ -414,6 +426,8 @@ typedef struct _SFLIf_counters {
u_int32_t ifPromiscuousMode;
} SFLIf_counters;
+#define SFL_CTR_GENERIC_XDR_SIZE 88
+
/* Ethernet interface counters - see RFC 2358 */
typedef struct _SFLEthernet_counters {
u_int32_t dot3StatsAlignmentErrors;
@@ -431,6 +445,8 @@ typedef struct _SFLEthernet_counters {
u_int32_t dot3StatsSymbolErrors;
} SFLEthernet_counters;
+#define SFL_CTR_ETHERNET_XDR_SIZE 52
+
/* Token ring counters - see RFC 1748 */
typedef struct _SFLTokenring_counters {
@@ -482,6 +498,51 @@ typedef struct _SFLVlan_counters {
u_int32_t discards;
} SFLVlan_counters;
+/* OpenFlow port */
+typedef struct {
+ u_int64_t datapath_id;
+ u_int32_t port_no;
+} SFLOpenFlowPort;
+
+#define SFL_CTR_OPENFLOWPORT_XDR_SIZE 12
+
+/* port name */
+typedef struct {
+ SFLString portName;
+} SFLPortName;
+
+#define SFL_MAX_PORTNAME_LEN 255
+
+/* LAG Port Statistics - see http://sflow.org/sflow_lag.txt */
+/* opaque = counter_data; enterprise = 0; format = 7 */
+
+typedef union _SFLLACP_portState {
+ uint32_t all;
+ struct {
+ uint8_t actorAdmin;
+ uint8_t actorOper;
+ uint8_t partnerAdmin;
+ uint8_t partnerOper;
+ } v;
+} SFLLACP_portState;
+
+typedef struct _SFLLACP_counters {
+ uint8_t actorSystemID[8]; /* 6 bytes + 2 pad */
+ uint8_t partnerSystemID[8]; /* 6 bytes + 2 pad */
+ uint32_t attachedAggID;
+ SFLLACP_portState portState;
+ uint32_t LACPDUsRx;
+ uint32_t markerPDUsRx;
+ uint32_t markerResponsePDUsRx;
+ uint32_t unknownRx;
+ uint32_t illegalRx;
+ uint32_t LACPDUsTx;
+ uint32_t markerPDUsTx;
+ uint32_t markerResponsePDUsTx;
+} SFLLACP_counters;
+
+#define SFL_CTR_LACP_XDR_SIZE 56
+
/* Counters data */
enum SFLCounters_type_tag {
@@ -490,7 +551,10 @@ enum SFLCounters_type_tag {
SFLCOUNTERS_ETHERNET = 2,
SFLCOUNTERS_TOKENRING = 3,
SFLCOUNTERS_VG = 4,
- SFLCOUNTERS_VLAN = 5
+ SFLCOUNTERS_VLAN = 5,
+ SFLCOUNTERS_LACP = 7,
+ SFLCOUNTERS_OPENFLOWPORT = 1004,
+ SFLCOUNTERS_PORTNAME = 1005
};
typedef union _SFLCounters_type {
@@ -499,6 +563,9 @@ typedef union _SFLCounters_type {
SFLTokenring_counters tokenring;
SFLVg_counters vg;
SFLVlan_counters vlan;
+ SFLLACP_counters lacp;
+ SFLOpenFlowPort ofPort;
+ SFLPortName portName;
} SFLCounters_type;
typedef struct _SFLCounters_sample_element {