@@ -86,6 +86,11 @@ struct netdev_flow_api {
/* Initializies the netdev flow api.
* Return 0 if successful, otherwise returns a positive errno value. */
int (*init_flow_api)(struct netdev *);
+
+ /* Query sFlow attribute by group ID.
+ *
+ * On success returns a const pointer, on failure returns NULL */
+ const struct dpif_sflow_attr *(*sflow_attr_get)(uint32_t gid);
};
int netdev_register_flow_api_provider(const struct netdev_flow_api *);
@@ -666,3 +666,14 @@ netdev_set_flow_api_enabled(const struct smap *ovs_other_config)
}
}
}
+
+const struct dpif_sflow_attr *
+netdev_sflow_attr_get(struct netdev *netdev, uint32_t gid)
+{
+ const struct netdev_flow_api *flow_api =
+ ovsrcu_get(const struct netdev_flow_api *, &netdev->flow_api);
+
+ return (flow_api && flow_api->sflow_attr_get)
+ ? flow_api->sflow_attr_get(gid)
+ : NULL;
+}
@@ -124,6 +124,7 @@ int netdev_ports_flow_get(const char *dpif_type, struct match *match,
struct dpif_flow_stats *stats,
struct dpif_flow_attrs *attrs,
struct ofpbuf *buf);
+const struct dpif_sflow_attr *netdev_sflow_attr_get(struct netdev *, uint32_t);
#ifdef __cplusplus
}