Blame include/uapi/linux/if_bonding.h

Packit Service 3880ab
/* SPDX-License-Identifier: GPL-1.0+ WITH Linux-syscall-note */
Packit Service 3880ab
/*
Packit Service 3880ab
 * Bond several ethernet interfaces into a Cisco, running 'Etherchannel'.
Packit Service 3880ab
 *
Packit Service 3880ab
 *
Packit Service 3880ab
 * Portions are (c) Copyright 1995 Simon "Guru Aleph-Null" Janes
Packit Service 3880ab
 * NCM: Network and Communications Management, Inc.
Packit Service 3880ab
 *
Packit Service 3880ab
 * BUT, I'm the one who modified it for ethernet, so:
Packit Service 3880ab
 * (c) Copyright 1999, Thomas Davis, tadavis@lbl.gov
Packit Service 3880ab
 *
Packit Service 3880ab
 *	This software may be used and distributed according to the terms
Packit Service 3880ab
 *	of the GNU Public License, incorporated herein by reference.
Packit Service 3880ab
 *
Packit Service 3880ab
 * 2003/03/18 - Amir Noam <amir.noam at intel dot com>
Packit Service 3880ab
 *	- Added support for getting slave's speed and duplex via ethtool.
Packit Service 3880ab
 *	  Needed for 802.3ad and other future modes.
Packit Service 3880ab
 *
Packit Service 3880ab
 * 2003/03/18 - Tsippy Mendelson <tsippy.mendelson at intel dot com> and
Packit Service 3880ab
 *		Shmulik Hen <shmulik.hen at intel dot com>
Packit Service 3880ab
 *	- Enable support of modes that need to use the unique mac address of
Packit Service 3880ab
 *	  each slave.
Packit Service 3880ab
 *
Packit Service 3880ab
 * 2003/03/18 - Tsippy Mendelson <tsippy.mendelson at intel dot com> and
Packit Service 3880ab
 *		Amir Noam <amir.noam at intel dot com>
Packit Service 3880ab
 *	- Moved driver's private data types to bonding.h
Packit Service 3880ab
 *
Packit Service 3880ab
 * 2003/03/18 - Amir Noam <amir.noam at intel dot com>,
Packit Service 3880ab
 *		Tsippy Mendelson <tsippy.mendelson at intel dot com> and
Packit Service 3880ab
 *		Shmulik Hen <shmulik.hen at intel dot com>
Packit Service 3880ab
 *	- Added support for IEEE 802.3ad Dynamic link aggregation mode.
Packit Service 3880ab
 *
Packit Service 3880ab
 * 2003/05/01 - Amir Noam <amir.noam at intel dot com>
Packit Service 3880ab
 *	- Added ABI version control to restore compatibility between
Packit Service 3880ab
 *	  new/old ifenslave and new/old bonding.
Packit Service 3880ab
 *
Packit Service 3880ab
 * 2003/12/01 - Shmulik Hen <shmulik.hen at intel dot com>
Packit Service 3880ab
 *	- Code cleanup and style changes
Packit Service 3880ab
 *
Packit Service 3880ab
 * 2005/05/05 - Jason Gabler <jygabler at lbl dot gov>
Packit Service 3880ab
 *      - added definitions for various XOR hashing policies
Packit Service 3880ab
 */
Packit Service 3880ab
Packit Service 3880ab
#ifndef _LINUX_IF_BONDING_H
Packit Service 3880ab
#define _LINUX_IF_BONDING_H
Packit Service 3880ab
Packit Service 3880ab
#include <linux/if.h>
Packit Service 3880ab
#include <linux/types.h>
Packit Service 3880ab
#include <linux/if_ether.h>
Packit Service 3880ab
Packit Service 3880ab
/* userland - kernel ABI version (2003/05/08) */
Packit Service 3880ab
#define BOND_ABI_VERSION 2
Packit Service 3880ab
Packit Service 3880ab
/*
Packit Service 3880ab
 * We can remove these ioctl definitions in 2.5.  People should use the
Packit Service 3880ab
 * SIOC*** versions of them instead
Packit Service 3880ab
 */
Packit Service 3880ab
#define BOND_ENSLAVE_OLD		(SIOCDEVPRIVATE)
Packit Service 3880ab
#define BOND_RELEASE_OLD		(SIOCDEVPRIVATE + 1)
Packit Service 3880ab
#define BOND_SETHWADDR_OLD		(SIOCDEVPRIVATE + 2)
Packit Service 3880ab
#define BOND_SLAVE_INFO_QUERY_OLD	(SIOCDEVPRIVATE + 11)
Packit Service 3880ab
#define BOND_INFO_QUERY_OLD		(SIOCDEVPRIVATE + 12)
Packit Service 3880ab
#define BOND_CHANGE_ACTIVE_OLD		(SIOCDEVPRIVATE + 13)
Packit Service 3880ab
Packit Service 3880ab
#define BOND_CHECK_MII_STATUS	(SIOCGMIIPHY)
Packit Service 3880ab
Packit Service 3880ab
#define BOND_MODE_ROUNDROBIN	0
Packit Service 3880ab
#define BOND_MODE_ACTIVEBACKUP	1
Packit Service 3880ab
#define BOND_MODE_XOR		2
Packit Service 3880ab
#define BOND_MODE_BROADCAST	3
Packit Service 3880ab
#define BOND_MODE_8023AD        4
Packit Service 3880ab
#define BOND_MODE_TLB           5
Packit Service 3880ab
#define BOND_MODE_ALB		6 /* TLB + RLB (receive load balancing) */
Packit Service 3880ab
Packit Service 3880ab
/* each slave's link has 4 states */
Packit Service 3880ab
#define BOND_LINK_UP    0           /* link is up and running */
Packit Service 3880ab
#define BOND_LINK_FAIL  1           /* link has just gone down */
Packit Service 3880ab
#define BOND_LINK_DOWN  2           /* link has been down for too long time */
Packit Service 3880ab
#define BOND_LINK_BACK  3           /* link is going back */
Packit Service 3880ab
Packit Service 3880ab
/* each slave has several states */
Packit Service 3880ab
#define BOND_STATE_ACTIVE       0   /* link is active */
Packit Service 3880ab
#define BOND_STATE_BACKUP       1   /* link is backup */
Packit Service 3880ab
Packit Service 3880ab
#define BOND_DEFAULT_MAX_BONDS  1   /* Default maximum number of devices to support */
Packit Service 3880ab
Packit Service 3880ab
#define BOND_DEFAULT_TX_QUEUES 16   /* Default number of tx queues per device */
Packit Service 3880ab
Packit Service 3880ab
#define BOND_DEFAULT_RESEND_IGMP	1 /* Default number of IGMP membership reports */
Packit Service 3880ab
Packit Service 3880ab
/* hashing types */
Packit Service 3880ab
#define BOND_XMIT_POLICY_LAYER2		0 /* layer 2 (MAC only), default */
Packit Service 3880ab
#define BOND_XMIT_POLICY_LAYER34	1 /* layer 3+4 (IP ^ (TCP || UDP)) */
Packit Service 3880ab
#define BOND_XMIT_POLICY_LAYER23	2 /* layer 2+3 (IP ^ MAC) */
Packit Service 3880ab
#define BOND_XMIT_POLICY_ENCAP23	3 /* encapsulated layer 2+3 */
Packit Service 3880ab
#define BOND_XMIT_POLICY_ENCAP34	4 /* encapsulated layer 3+4 */
Packit Service 3880ab
Packit Service 3880ab
/* 802.3ad port state definitions (43.4.2.2 in the 802.3ad standard) */
Packit Service 3880ab
#define LACP_STATE_LACP_ACTIVITY   0x1
Packit Service 3880ab
#define LACP_STATE_LACP_TIMEOUT    0x2
Packit Service 3880ab
#define LACP_STATE_AGGREGATION     0x4
Packit Service 3880ab
#define LACP_STATE_SYNCHRONIZATION 0x8
Packit Service 3880ab
#define LACP_STATE_COLLECTING      0x10
Packit Service 3880ab
#define LACP_STATE_DISTRIBUTING    0x20
Packit Service 3880ab
#define LACP_STATE_DEFAULTED       0x40
Packit Service 3880ab
#define LACP_STATE_EXPIRED         0x80
Packit Service 3880ab
Packit Service 3880ab
typedef struct ifbond {
Packit Service 3880ab
	__s32 bond_mode;
Packit Service 3880ab
	__s32 num_slaves;
Packit Service 3880ab
	__s32 miimon;
Packit Service 3880ab
} ifbond;
Packit Service 3880ab
Packit Service 3880ab
typedef struct ifslave {
Packit Service 3880ab
	__s32 slave_id; /* Used as an IN param to the BOND_SLAVE_INFO_QUERY ioctl */
Packit Service 3880ab
	char slave_name[IFNAMSIZ];
Packit Service 3880ab
	__s8 link;
Packit Service 3880ab
	__s8 state;
Packit Service 3880ab
	__u32  link_failure_count;
Packit Service 3880ab
} ifslave;
Packit Service 3880ab
Packit Service 3880ab
struct ad_info {
Packit Service 3880ab
	__u16 aggregator_id;
Packit Service 3880ab
	__u16 ports;
Packit Service 3880ab
	__u16 actor_key;
Packit Service 3880ab
	__u16 partner_key;
Packit Service 3880ab
	__u8 partner_system[ETH_ALEN];
Packit Service 3880ab
};
Packit Service 3880ab
Packit Service 3880ab
/* Embedded inside LINK_XSTATS_TYPE_BOND */
Packit Service 3880ab
enum {
Packit Service 3880ab
	BOND_XSTATS_UNSPEC,
Packit Service 3880ab
	BOND_XSTATS_3AD,
Packit Service 3880ab
	__BOND_XSTATS_MAX
Packit Service 3880ab
};
Packit Service 3880ab
#define BOND_XSTATS_MAX (__BOND_XSTATS_MAX - 1)
Packit Service 3880ab
Packit Service 3880ab
/* Embedded inside BOND_XSTATS_3AD */
Packit Service 3880ab
enum {
Packit Service 3880ab
	BOND_3AD_STAT_LACPDU_RX,
Packit Service 3880ab
	BOND_3AD_STAT_LACPDU_TX,
Packit Service 3880ab
	BOND_3AD_STAT_LACPDU_UNKNOWN_RX,
Packit Service 3880ab
	BOND_3AD_STAT_LACPDU_ILLEGAL_RX,
Packit Service 3880ab
	BOND_3AD_STAT_MARKER_RX,
Packit Service 3880ab
	BOND_3AD_STAT_MARKER_TX,
Packit Service 3880ab
	BOND_3AD_STAT_MARKER_RESP_RX,
Packit Service 3880ab
	BOND_3AD_STAT_MARKER_RESP_TX,
Packit Service 3880ab
	BOND_3AD_STAT_MARKER_UNKNOWN_RX,
Packit Service 3880ab
	BOND_3AD_STAT_PAD,
Packit Service 3880ab
	__BOND_3AD_STAT_MAX
Packit Service 3880ab
};
Packit Service 3880ab
#define BOND_3AD_STAT_MAX (__BOND_3AD_STAT_MAX - 1)
Packit Service 3880ab
Packit Service 3880ab
#endif /* _LINUX_IF_BONDING_H */
Packit Service 3880ab
Packit Service 3880ab
/*
Packit Service 3880ab
 * Local variables:
Packit Service 3880ab
 *  version-control: t
Packit Service 3880ab
 *  kept-new-versions: 5
Packit Service 3880ab
 *  c-indent-level: 8
Packit Service 3880ab
 *  c-basic-offset: 8
Packit Service 3880ab
 *  tab-width: 8
Packit Service 3880ab
 * End:
Packit Service 3880ab
 */
Packit Service 3880ab