#define pr_fmt(fmt) …
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/device.h>
#include <linux/sched/signal.h>
#include <linux/fs.h>
#include <linux/types.h>
#include <linux/string.h>
#include <linux/netdevice.h>
#include <linux/inetdevice.h>
#include <linux/in.h>
#include <linux/sysfs.h>
#include <linux/ctype.h>
#include <linux/inet.h>
#include <linux/rtnetlink.h>
#include <linux/etherdevice.h>
#include <net/net_namespace.h>
#include <net/netns/generic.h>
#include <linux/nsproxy.h>
#include <net/bonding.h>
#define to_bond(cd) …
static ssize_t bonding_show_bonds(const struct class *cls,
const struct class_attribute *attr,
char *buf)
{ … }
static struct net_device *bond_get_by_name(const struct bond_net *bn, const char *ifname)
{ … }
static ssize_t bonding_store_bonds(const struct class *cls,
const struct class_attribute *attr,
const char *buffer, size_t count)
{ … }
static const struct class_attribute class_attr_bonding_masters = …;
static ssize_t bonding_sysfs_store_option(struct device *d,
struct device_attribute *attr,
const char *buffer, size_t count)
{ … }
static ssize_t bonding_show_slaves(struct device *d,
struct device_attribute *attr, char *buf)
{ … }
static DEVICE_ATTR(slaves, 0644, bonding_show_slaves,
bonding_sysfs_store_option);
static ssize_t bonding_show_mode(struct device *d,
struct device_attribute *attr, char *buf)
{ … }
static DEVICE_ATTR(mode, 0644, bonding_show_mode, bonding_sysfs_store_option);
static ssize_t bonding_show_xmit_hash(struct device *d,
struct device_attribute *attr,
char *buf)
{ … }
static DEVICE_ATTR(xmit_hash_policy, 0644,
bonding_show_xmit_hash, bonding_sysfs_store_option);
static ssize_t bonding_show_arp_validate(struct device *d,
struct device_attribute *attr,
char *buf)
{ … }
static DEVICE_ATTR(arp_validate, 0644, bonding_show_arp_validate,
bonding_sysfs_store_option);
static ssize_t bonding_show_arp_all_targets(struct device *d,
struct device_attribute *attr,
char *buf)
{ … }
static DEVICE_ATTR(arp_all_targets, 0644,
bonding_show_arp_all_targets, bonding_sysfs_store_option);
static ssize_t bonding_show_fail_over_mac(struct device *d,
struct device_attribute *attr,
char *buf)
{ … }
static DEVICE_ATTR(fail_over_mac, 0644,
bonding_show_fail_over_mac, bonding_sysfs_store_option);
static ssize_t bonding_show_arp_interval(struct device *d,
struct device_attribute *attr,
char *buf)
{ … }
static DEVICE_ATTR(arp_interval, 0644,
bonding_show_arp_interval, bonding_sysfs_store_option);
static ssize_t bonding_show_arp_targets(struct device *d,
struct device_attribute *attr,
char *buf)
{ … }
static DEVICE_ATTR(arp_ip_target, 0644,
bonding_show_arp_targets, bonding_sysfs_store_option);
static ssize_t bonding_show_missed_max(struct device *d,
struct device_attribute *attr,
char *buf)
{ … }
static DEVICE_ATTR(arp_missed_max, 0644,
bonding_show_missed_max, bonding_sysfs_store_option);
static ssize_t bonding_show_downdelay(struct device *d,
struct device_attribute *attr,
char *buf)
{ … }
static DEVICE_ATTR(downdelay, 0644,
bonding_show_downdelay, bonding_sysfs_store_option);
static ssize_t bonding_show_updelay(struct device *d,
struct device_attribute *attr,
char *buf)
{ … }
static DEVICE_ATTR(updelay, 0644,
bonding_show_updelay, bonding_sysfs_store_option);
static ssize_t bonding_show_peer_notif_delay(struct device *d,
struct device_attribute *attr,
char *buf)
{ … }
static DEVICE_ATTR(peer_notif_delay, 0644,
bonding_show_peer_notif_delay, bonding_sysfs_store_option);
static ssize_t bonding_show_lacp_active(struct device *d,
struct device_attribute *attr,
char *buf)
{ … }
static DEVICE_ATTR(lacp_active, 0644,
bonding_show_lacp_active, bonding_sysfs_store_option);
static ssize_t bonding_show_lacp_rate(struct device *d,
struct device_attribute *attr,
char *buf)
{ … }
static DEVICE_ATTR(lacp_rate, 0644,
bonding_show_lacp_rate, bonding_sysfs_store_option);
static ssize_t bonding_show_min_links(struct device *d,
struct device_attribute *attr,
char *buf)
{ … }
static DEVICE_ATTR(min_links, 0644,
bonding_show_min_links, bonding_sysfs_store_option);
static ssize_t bonding_show_ad_select(struct device *d,
struct device_attribute *attr,
char *buf)
{ … }
static DEVICE_ATTR(ad_select, 0644,
bonding_show_ad_select, bonding_sysfs_store_option);
static ssize_t bonding_show_num_peer_notif(struct device *d,
struct device_attribute *attr,
char *buf)
{ … }
static DEVICE_ATTR(num_grat_arp, 0644,
bonding_show_num_peer_notif, bonding_sysfs_store_option);
static DEVICE_ATTR(num_unsol_na, 0644,
bonding_show_num_peer_notif, bonding_sysfs_store_option);
static ssize_t bonding_show_miimon(struct device *d,
struct device_attribute *attr,
char *buf)
{ … }
static DEVICE_ATTR(miimon, 0644,
bonding_show_miimon, bonding_sysfs_store_option);
static ssize_t bonding_show_primary(struct device *d,
struct device_attribute *attr,
char *buf)
{ … }
static DEVICE_ATTR(primary, 0644,
bonding_show_primary, bonding_sysfs_store_option);
static ssize_t bonding_show_primary_reselect(struct device *d,
struct device_attribute *attr,
char *buf)
{ … }
static DEVICE_ATTR(primary_reselect, 0644,
bonding_show_primary_reselect, bonding_sysfs_store_option);
static ssize_t bonding_show_carrier(struct device *d,
struct device_attribute *attr,
char *buf)
{ … }
static DEVICE_ATTR(use_carrier, 0644,
bonding_show_carrier, bonding_sysfs_store_option);
static ssize_t bonding_show_active_slave(struct device *d,
struct device_attribute *attr,
char *buf)
{ … }
static DEVICE_ATTR(active_slave, 0644,
bonding_show_active_slave, bonding_sysfs_store_option);
static ssize_t bonding_show_mii_status(struct device *d,
struct device_attribute *attr,
char *buf)
{ … }
static DEVICE_ATTR(mii_status, 0444, bonding_show_mii_status, NULL);
static ssize_t bonding_show_ad_aggregator(struct device *d,
struct device_attribute *attr,
char *buf)
{ … }
static DEVICE_ATTR(ad_aggregator, 0444, bonding_show_ad_aggregator, NULL);
static ssize_t bonding_show_ad_num_ports(struct device *d,
struct device_attribute *attr,
char *buf)
{ … }
static DEVICE_ATTR(ad_num_ports, 0444, bonding_show_ad_num_ports, NULL);
static ssize_t bonding_show_ad_actor_key(struct device *d,
struct device_attribute *attr,
char *buf)
{ … }
static DEVICE_ATTR(ad_actor_key, 0444, bonding_show_ad_actor_key, NULL);
static ssize_t bonding_show_ad_partner_key(struct device *d,
struct device_attribute *attr,
char *buf)
{ … }
static DEVICE_ATTR(ad_partner_key, 0444, bonding_show_ad_partner_key, NULL);
static ssize_t bonding_show_ad_partner_mac(struct device *d,
struct device_attribute *attr,
char *buf)
{ … }
static DEVICE_ATTR(ad_partner_mac, 0444, bonding_show_ad_partner_mac, NULL);
static ssize_t bonding_show_queue_id(struct device *d,
struct device_attribute *attr,
char *buf)
{ … }
static DEVICE_ATTR(queue_id, 0644, bonding_show_queue_id,
bonding_sysfs_store_option);
static ssize_t bonding_show_slaves_active(struct device *d,
struct device_attribute *attr,
char *buf)
{ … }
static DEVICE_ATTR(all_slaves_active, 0644,
bonding_show_slaves_active, bonding_sysfs_store_option);
static ssize_t bonding_show_resend_igmp(struct device *d,
struct device_attribute *attr,
char *buf)
{ … }
static DEVICE_ATTR(resend_igmp, 0644,
bonding_show_resend_igmp, bonding_sysfs_store_option);
static ssize_t bonding_show_lp_interval(struct device *d,
struct device_attribute *attr,
char *buf)
{ … }
static DEVICE_ATTR(lp_interval, 0644,
bonding_show_lp_interval, bonding_sysfs_store_option);
static ssize_t bonding_show_tlb_dynamic_lb(struct device *d,
struct device_attribute *attr,
char *buf)
{ … }
static DEVICE_ATTR(tlb_dynamic_lb, 0644,
bonding_show_tlb_dynamic_lb, bonding_sysfs_store_option);
static ssize_t bonding_show_packets_per_slave(struct device *d,
struct device_attribute *attr,
char *buf)
{ … }
static DEVICE_ATTR(packets_per_slave, 0644,
bonding_show_packets_per_slave, bonding_sysfs_store_option);
static ssize_t bonding_show_ad_actor_sys_prio(struct device *d,
struct device_attribute *attr,
char *buf)
{ … }
static DEVICE_ATTR(ad_actor_sys_prio, 0644,
bonding_show_ad_actor_sys_prio, bonding_sysfs_store_option);
static ssize_t bonding_show_ad_actor_system(struct device *d,
struct device_attribute *attr,
char *buf)
{ … }
static DEVICE_ATTR(ad_actor_system, 0644,
bonding_show_ad_actor_system, bonding_sysfs_store_option);
static ssize_t bonding_show_ad_user_port_key(struct device *d,
struct device_attribute *attr,
char *buf)
{ … }
static DEVICE_ATTR(ad_user_port_key, 0644,
bonding_show_ad_user_port_key, bonding_sysfs_store_option);
static struct attribute *per_bond_attrs[] = …;
static const struct attribute_group bonding_group = …;
int __net_init bond_create_sysfs(struct bond_net *bn)
{ … }
void __net_exit bond_destroy_sysfs(struct bond_net *bn)
{ … }
void bond_prepare_sysfs_group(struct bonding *bond)
{ … }