The two implementations have almost identical structures - vif_device and
mif_device. As a step toward uniforming the mr_tables, eliminate the
mif_device and relocate the vif_device definition into a new common
header file.
Also, introduce a common initializing function for setting most of the
vif_device fields in a new common source file. This requires modifying
the ipv{4,6] Kconfig and ipv4 makefile as we're introducing a new common
config option - CONFIG_IP_MROUTE_COMMON.
Signed-off-by: Yuval Mintz <yuvalm@mellanox.com>
Acked-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
52 lines
1.4 KiB
C
52 lines
1.4 KiB
C
#ifndef __LINUX_MROUTE_BASE_H
|
|
#define __LINUX_MROUTE_BASE_H
|
|
|
|
#include <linux/netdevice.h>
|
|
|
|
/**
|
|
* struct vif_device - interface representor for multicast routing
|
|
* @dev: network device being used
|
|
* @bytes_in: statistic; bytes ingressing
|
|
* @bytes_out: statistic; bytes egresing
|
|
* @pkt_in: statistic; packets ingressing
|
|
* @pkt_out: statistic; packets egressing
|
|
* @rate_limit: Traffic shaping (NI)
|
|
* @threshold: TTL threshold
|
|
* @flags: Control flags
|
|
* @link: Physical interface index
|
|
* @dev_parent_id: device parent id
|
|
* @local: Local address
|
|
* @remote: Remote address for tunnels
|
|
*/
|
|
struct vif_device {
|
|
struct net_device *dev;
|
|
unsigned long bytes_in, bytes_out;
|
|
unsigned long pkt_in, pkt_out;
|
|
unsigned long rate_limit;
|
|
unsigned char threshold;
|
|
unsigned short flags;
|
|
int link;
|
|
|
|
/* Currently only used by ipmr */
|
|
struct netdev_phys_item_id dev_parent_id;
|
|
__be32 local, remote;
|
|
};
|
|
|
|
#ifdef CONFIG_IP_MROUTE_COMMON
|
|
void vif_device_init(struct vif_device *v,
|
|
struct net_device *dev,
|
|
unsigned long rate_limit,
|
|
unsigned char threshold,
|
|
unsigned short flags,
|
|
unsigned short get_iflink_mask);
|
|
#else
|
|
static inline void vif_device_init(struct vif_device *v,
|
|
struct net_device *dev,
|
|
unsigned long rate_limit,
|
|
unsigned char threshold,
|
|
unsigned short flags,
|
|
unsigned short get_iflink_mask)
|
|
{
|
|
}
|
|
#endif
|
|
#endif
|