+/* Attempts to change the stats for 'netdev' to those provided in 'stats'.
+ * Returns 0 if successful, otherwise a positive errno value.
+ *
+ * This will probably fail for most network devices. Some devices might only
+ * allow setting their stats to 0. */
+int
+netdev_set_stats(struct netdev *netdev, const struct netdev_stats *stats)
+{
+ return (netdev_get_dev(netdev)->netdev_class->set_stats
+ ? netdev_get_dev(netdev)->netdev_class->set_stats(netdev, stats)
+ : EOPNOTSUPP);
+}
+