blob: 7b8fa339de30348508ab3810c4c1aa3ca1573662 [file] [log] [blame]
David Howells607ca462012-10-13 10:46:48 +01001/*
2 * include/linux/if_team.h - Network team device driver header
3 * Copyright (c) 2011 Jiri Pirko <jpirko@redhat.com>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 */
10
11#ifndef _UAPI_LINUX_IF_TEAM_H_
12#define _UAPI_LINUX_IF_TEAM_H_
13
14
15#define TEAM_STRING_MAX_LEN 32
16
17/**********************************
18 * NETLINK_GENERIC netlink family.
19 **********************************/
20
21enum {
22 TEAM_CMD_NOOP,
23 TEAM_CMD_OPTIONS_SET,
24 TEAM_CMD_OPTIONS_GET,
25 TEAM_CMD_PORT_LIST_GET,
26
27 __TEAM_CMD_MAX,
28 TEAM_CMD_MAX = (__TEAM_CMD_MAX - 1),
29};
30
31enum {
32 TEAM_ATTR_UNSPEC,
33 TEAM_ATTR_TEAM_IFINDEX, /* u32 */
34 TEAM_ATTR_LIST_OPTION, /* nest */
35 TEAM_ATTR_LIST_PORT, /* nest */
36
37 __TEAM_ATTR_MAX,
38 TEAM_ATTR_MAX = __TEAM_ATTR_MAX - 1,
39};
40
41/* Nested layout of get/set msg:
42 *
43 * [TEAM_ATTR_LIST_OPTION]
44 * [TEAM_ATTR_ITEM_OPTION]
45 * [TEAM_ATTR_OPTION_*], ...
46 * [TEAM_ATTR_ITEM_OPTION]
47 * [TEAM_ATTR_OPTION_*], ...
48 * ...
49 * [TEAM_ATTR_LIST_PORT]
50 * [TEAM_ATTR_ITEM_PORT]
51 * [TEAM_ATTR_PORT_*], ...
52 * [TEAM_ATTR_ITEM_PORT]
53 * [TEAM_ATTR_PORT_*], ...
54 * ...
55 */
56
57enum {
58 TEAM_ATTR_ITEM_OPTION_UNSPEC,
59 TEAM_ATTR_ITEM_OPTION, /* nest */
60
61 __TEAM_ATTR_ITEM_OPTION_MAX,
62 TEAM_ATTR_ITEM_OPTION_MAX = __TEAM_ATTR_ITEM_OPTION_MAX - 1,
63};
64
65enum {
66 TEAM_ATTR_OPTION_UNSPEC,
67 TEAM_ATTR_OPTION_NAME, /* string */
68 TEAM_ATTR_OPTION_CHANGED, /* flag */
69 TEAM_ATTR_OPTION_TYPE, /* u8 */
70 TEAM_ATTR_OPTION_DATA, /* dynamic */
71 TEAM_ATTR_OPTION_REMOVED, /* flag */
72 TEAM_ATTR_OPTION_PORT_IFINDEX, /* u32 */ /* for per-port options */
73 TEAM_ATTR_OPTION_ARRAY_INDEX, /* u32 */ /* for array options */
74
75 __TEAM_ATTR_OPTION_MAX,
76 TEAM_ATTR_OPTION_MAX = __TEAM_ATTR_OPTION_MAX - 1,
77};
78
79enum {
80 TEAM_ATTR_ITEM_PORT_UNSPEC,
81 TEAM_ATTR_ITEM_PORT, /* nest */
82
83 __TEAM_ATTR_ITEM_PORT_MAX,
84 TEAM_ATTR_ITEM_PORT_MAX = __TEAM_ATTR_ITEM_PORT_MAX - 1,
85};
86
87enum {
88 TEAM_ATTR_PORT_UNSPEC,
89 TEAM_ATTR_PORT_IFINDEX, /* u32 */
90 TEAM_ATTR_PORT_CHANGED, /* flag */
91 TEAM_ATTR_PORT_LINKUP, /* flag */
92 TEAM_ATTR_PORT_SPEED, /* u32 */
93 TEAM_ATTR_PORT_DUPLEX, /* u8 */
94 TEAM_ATTR_PORT_REMOVED, /* flag */
95
96 __TEAM_ATTR_PORT_MAX,
97 TEAM_ATTR_PORT_MAX = __TEAM_ATTR_PORT_MAX - 1,
98};
99
100/*
101 * NETLINK_GENERIC related info
102 */
103#define TEAM_GENL_NAME "team"
104#define TEAM_GENL_VERSION 0x1
105#define TEAM_GENL_CHANGE_EVENT_MC_GRP_NAME "change_event"
106
107#endif /* _UAPI_LINUX_IF_TEAM_H_ */