aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/if_link.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/if_link.h')
-rw-r--r--include/linux/if_link.h87
1 files changed, 69 insertions, 18 deletions
diff --git a/include/linux/if_link.h b/include/linux/if_link.h
index 176c5182c515..d94963b379d9 100644
--- a/include/linux/if_link.h
+++ b/include/linux/if_link.h
@@ -5,8 +5,7 @@
5#include <linux/netlink.h> 5#include <linux/netlink.h>
6 6
7/* The struct should be in sync with struct net_device_stats */ 7/* The struct should be in sync with struct net_device_stats */
8struct rtnl_link_stats 8struct rtnl_link_stats {
9{
10 __u32 rx_packets; /* total packets received */ 9 __u32 rx_packets; /* total packets received */
11 __u32 tx_packets; /* total packets transmitted */ 10 __u32 tx_packets; /* total packets transmitted */
12 __u32 rx_bytes; /* total bytes received */ 11 __u32 rx_bytes; /* total bytes received */
@@ -39,8 +38,7 @@ struct rtnl_link_stats
39}; 38};
40 39
41/* The struct should be in sync with struct ifmap */ 40/* The struct should be in sync with struct ifmap */
42struct rtnl_link_ifmap 41struct rtnl_link_ifmap {
43{
44 __u64 mem_start; 42 __u64 mem_start;
45 __u64 mem_end; 43 __u64 mem_end;
46 __u64 base_addr; 44 __u64 base_addr;
@@ -49,8 +47,7 @@ struct rtnl_link_ifmap
49 __u8 port; 47 __u8 port;
50}; 48};
51 49
52enum 50enum {
53{
54 IFLA_UNSPEC, 51 IFLA_UNSPEC,
55 IFLA_ADDRESS, 52 IFLA_ADDRESS,
56 IFLA_BROADCAST, 53 IFLA_BROADCAST,
@@ -81,6 +78,8 @@ enum
81#define IFLA_LINKINFO IFLA_LINKINFO 78#define IFLA_LINKINFO IFLA_LINKINFO
82 IFLA_NET_NS_PID, 79 IFLA_NET_NS_PID,
83 IFLA_IFALIAS, 80 IFLA_IFALIAS,
81 IFLA_NUM_VF, /* Number of VFs if device is SR-IOV PF */
82 IFLA_VFINFO_LIST,
84 __IFLA_MAX 83 __IFLA_MAX
85}; 84};
86 85
@@ -123,8 +122,7 @@ enum
123 */ 122 */
124 123
125/* Subtype attributes for IFLA_PROTINFO */ 124/* Subtype attributes for IFLA_PROTINFO */
126enum 125enum {
127{
128 IFLA_INET6_UNSPEC, 126 IFLA_INET6_UNSPEC,
129 IFLA_INET6_FLAGS, /* link flags */ 127 IFLA_INET6_FLAGS, /* link flags */
130 IFLA_INET6_CONF, /* sysctl parameters */ 128 IFLA_INET6_CONF, /* sysctl parameters */
@@ -137,16 +135,14 @@ enum
137 135
138#define IFLA_INET6_MAX (__IFLA_INET6_MAX - 1) 136#define IFLA_INET6_MAX (__IFLA_INET6_MAX - 1)
139 137
140struct ifla_cacheinfo 138struct ifla_cacheinfo {
141{
142 __u32 max_reasm_len; 139 __u32 max_reasm_len;
143 __u32 tstamp; /* ipv6InterfaceTable updated timestamp */ 140 __u32 tstamp; /* ipv6InterfaceTable updated timestamp */
144 __u32 reachable_time; 141 __u32 reachable_time;
145 __u32 retrans_time; 142 __u32 retrans_time;
146}; 143};
147 144
148enum 145enum {
149{
150 IFLA_INFO_UNSPEC, 146 IFLA_INFO_UNSPEC,
151 IFLA_INFO_KIND, 147 IFLA_INFO_KIND,
152 IFLA_INFO_DATA, 148 IFLA_INFO_DATA,
@@ -158,8 +154,7 @@ enum
158 154
159/* VLAN section */ 155/* VLAN section */
160 156
161enum 157enum {
162{
163 IFLA_VLAN_UNSPEC, 158 IFLA_VLAN_UNSPEC,
164 IFLA_VLAN_ID, 159 IFLA_VLAN_ID,
165 IFLA_VLAN_FLAGS, 160 IFLA_VLAN_FLAGS,
@@ -175,8 +170,7 @@ struct ifla_vlan_flags {
175 __u32 mask; 170 __u32 mask;
176}; 171};
177 172
178enum 173enum {
179{
180 IFLA_VLAN_QOS_UNSPEC, 174 IFLA_VLAN_QOS_UNSPEC,
181 IFLA_VLAN_QOS_MAPPING, 175 IFLA_VLAN_QOS_MAPPING,
182 __IFLA_VLAN_QOS_MAX 176 __IFLA_VLAN_QOS_MAX
@@ -184,10 +178,67 @@ enum
184 178
185#define IFLA_VLAN_QOS_MAX (__IFLA_VLAN_QOS_MAX - 1) 179#define IFLA_VLAN_QOS_MAX (__IFLA_VLAN_QOS_MAX - 1)
186 180
187struct ifla_vlan_qos_mapping 181struct ifla_vlan_qos_mapping {
188{
189 __u32 from; 182 __u32 from;
190 __u32 to; 183 __u32 to;
191}; 184};
192 185
186/* MACVLAN section */
187enum {
188 IFLA_MACVLAN_UNSPEC,
189 IFLA_MACVLAN_MODE,
190 __IFLA_MACVLAN_MAX,
191};
192
193#define IFLA_MACVLAN_MAX (__IFLA_MACVLAN_MAX - 1)
194
195enum macvlan_mode {
196 MACVLAN_MODE_PRIVATE = 1, /* don't talk to other macvlans */
197 MACVLAN_MODE_VEPA = 2, /* talk to other ports through ext bridge */
198 MACVLAN_MODE_BRIDGE = 4, /* talk to bridge ports directly */
199};
200
201/* SR-IOV virtual function managment section */
202
203enum {
204 IFLA_VF_INFO_UNSPEC,
205 IFLA_VF_INFO,
206 __IFLA_VF_INFO_MAX,
207};
208
209#define IFLA_VF_INFO_MAX (__IFLA_VF_INFO_MAX - 1)
210
211enum {
212 IFLA_VF_UNSPEC,
213 IFLA_VF_MAC, /* Hardware queue specific attributes */
214 IFLA_VF_VLAN,
215 IFLA_VF_TX_RATE, /* TX Bandwidth Allocation */
216 __IFLA_VF_MAX,
217};
218
219#define IFLA_VF_MAX (__IFLA_VF_MAX - 1)
220
221struct ifla_vf_mac {
222 __u32 vf;
223 __u8 mac[32]; /* MAX_ADDR_LEN */
224};
225
226struct ifla_vf_vlan {
227 __u32 vf;
228 __u32 vlan; /* 0 - 4095, 0 disables VLAN filter */
229 __u32 qos;
230};
231
232struct ifla_vf_tx_rate {
233 __u32 vf;
234 __u32 rate; /* Max TX bandwidth in Mbps, 0 disables throttling */
235};
236
237struct ifla_vf_info {
238 __u32 vf;
239 __u8 mac[32];
240 __u32 vlan;
241 __u32 qos;
242 __u32 tx_rate;
243};
193#endif /* _LINUX_IF_LINK_H */ 244#endif /* _LINUX_IF_LINK_H */