nlmon.c (a402eae64d0ad12b1c4a411f250d6c161e67f623) nlmon.c (bc1f44709cf27fb2a5766cadafe7e2ad5e9cb221)
1#include <linux/module.h>
2#include <linux/kernel.h>
3#include <linux/netdevice.h>
4#include <linux/netlink.h>
5#include <net/net_namespace.h>
6#include <linux/if_arp.h>
7#include <net/rtnetlink.h>
8

--- 44 unchanged lines hidden (view full) ---

53
54static int nlmon_close(struct net_device *dev)
55{
56 struct nlmon *nlmon = netdev_priv(dev);
57
58 return netlink_remove_tap(&nlmon->nt);
59}
60
1#include <linux/module.h>
2#include <linux/kernel.h>
3#include <linux/netdevice.h>
4#include <linux/netlink.h>
5#include <net/net_namespace.h>
6#include <linux/if_arp.h>
7#include <net/rtnetlink.h>
8

--- 44 unchanged lines hidden (view full) ---

53
54static int nlmon_close(struct net_device *dev)
55{
56 struct nlmon *nlmon = netdev_priv(dev);
57
58 return netlink_remove_tap(&nlmon->nt);
59}
60
61static struct rtnl_link_stats64 *
61static void
62nlmon_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *stats)
63{
64 int i;
65 u64 bytes = 0, packets = 0;
66
67 for_each_possible_cpu(i) {
68 const struct pcpu_lstats *nl_stats;
69 u64 tbytes, tpackets;

--- 11 unchanged lines hidden (view full) ---

81 bytes += tbytes;
82 }
83
84 stats->rx_packets = packets;
85 stats->tx_packets = 0;
86
87 stats->rx_bytes = bytes;
88 stats->tx_bytes = 0;
62nlmon_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *stats)
63{
64 int i;
65 u64 bytes = 0, packets = 0;
66
67 for_each_possible_cpu(i) {
68 const struct pcpu_lstats *nl_stats;
69 u64 tbytes, tpackets;

--- 11 unchanged lines hidden (view full) ---

81 bytes += tbytes;
82 }
83
84 stats->rx_packets = packets;
85 stats->tx_packets = 0;
86
87 stats->rx_bytes = bytes;
88 stats->tx_bytes = 0;
89
90 return stats;
91}
92
93static u32 always_on(struct net_device *dev)
94{
95 return 1;
96}
97
98static const struct ethtool_ops nlmon_ethtool_ops = {

--- 65 unchanged lines hidden ---
89}
90
91static u32 always_on(struct net_device *dev)
92{
93 return 1;
94}
95
96static const struct ethtool_ops nlmon_ethtool_ops = {

--- 65 unchanged lines hidden ---