hc
2024-05-10 10ebd8556b7990499c896a550e3d416b444211e6
kernel/include/uapi/linux/if_bridge.h
....@@ -120,6 +120,7 @@
120120 IFLA_BRIDGE_MODE,
121121 IFLA_BRIDGE_VLAN_INFO,
122122 IFLA_BRIDGE_VLAN_TUNNEL_INFO,
123
+ IFLA_BRIDGE_MRP,
123124 __IFLA_BRIDGE_MAX,
124125 };
125126 #define IFLA_BRIDGE_MAX (__IFLA_BRIDGE_MAX - 1)
....@@ -130,6 +131,7 @@
130131 #define BRIDGE_VLAN_INFO_RANGE_BEGIN (1<<3) /* VLAN is start of vlan range */
131132 #define BRIDGE_VLAN_INFO_RANGE_END (1<<4) /* VLAN is end of vlan range */
132133 #define BRIDGE_VLAN_INFO_BRENTRY (1<<5) /* Global bridge VLAN entry */
134
+#define BRIDGE_VLAN_INFO_ONLY_OPTS (1<<6) /* Skip create/delete/flags */
133135
134136 struct bridge_vlan_info {
135137 __u16 flags;
....@@ -155,6 +157,261 @@
155157 __u16 flags;
156158 __u32 pad2;
157159 };
160
+
161
+enum {
162
+ IFLA_BRIDGE_MRP_UNSPEC,
163
+ IFLA_BRIDGE_MRP_INSTANCE,
164
+ IFLA_BRIDGE_MRP_PORT_STATE,
165
+ IFLA_BRIDGE_MRP_PORT_ROLE,
166
+ IFLA_BRIDGE_MRP_RING_STATE,
167
+ IFLA_BRIDGE_MRP_RING_ROLE,
168
+ IFLA_BRIDGE_MRP_START_TEST,
169
+ IFLA_BRIDGE_MRP_INFO,
170
+ IFLA_BRIDGE_MRP_IN_ROLE,
171
+ IFLA_BRIDGE_MRP_IN_STATE,
172
+ IFLA_BRIDGE_MRP_START_IN_TEST,
173
+ __IFLA_BRIDGE_MRP_MAX,
174
+};
175
+
176
+#define IFLA_BRIDGE_MRP_MAX (__IFLA_BRIDGE_MRP_MAX - 1)
177
+
178
+enum {
179
+ IFLA_BRIDGE_MRP_INSTANCE_UNSPEC,
180
+ IFLA_BRIDGE_MRP_INSTANCE_RING_ID,
181
+ IFLA_BRIDGE_MRP_INSTANCE_P_IFINDEX,
182
+ IFLA_BRIDGE_MRP_INSTANCE_S_IFINDEX,
183
+ IFLA_BRIDGE_MRP_INSTANCE_PRIO,
184
+ __IFLA_BRIDGE_MRP_INSTANCE_MAX,
185
+};
186
+
187
+#define IFLA_BRIDGE_MRP_INSTANCE_MAX (__IFLA_BRIDGE_MRP_INSTANCE_MAX - 1)
188
+
189
+enum {
190
+ IFLA_BRIDGE_MRP_PORT_STATE_UNSPEC,
191
+ IFLA_BRIDGE_MRP_PORT_STATE_STATE,
192
+ __IFLA_BRIDGE_MRP_PORT_STATE_MAX,
193
+};
194
+
195
+#define IFLA_BRIDGE_MRP_PORT_STATE_MAX (__IFLA_BRIDGE_MRP_PORT_STATE_MAX - 1)
196
+
197
+enum {
198
+ IFLA_BRIDGE_MRP_PORT_ROLE_UNSPEC,
199
+ IFLA_BRIDGE_MRP_PORT_ROLE_ROLE,
200
+ __IFLA_BRIDGE_MRP_PORT_ROLE_MAX,
201
+};
202
+
203
+#define IFLA_BRIDGE_MRP_PORT_ROLE_MAX (__IFLA_BRIDGE_MRP_PORT_ROLE_MAX - 1)
204
+
205
+enum {
206
+ IFLA_BRIDGE_MRP_RING_STATE_UNSPEC,
207
+ IFLA_BRIDGE_MRP_RING_STATE_RING_ID,
208
+ IFLA_BRIDGE_MRP_RING_STATE_STATE,
209
+ __IFLA_BRIDGE_MRP_RING_STATE_MAX,
210
+};
211
+
212
+#define IFLA_BRIDGE_MRP_RING_STATE_MAX (__IFLA_BRIDGE_MRP_RING_STATE_MAX - 1)
213
+
214
+enum {
215
+ IFLA_BRIDGE_MRP_RING_ROLE_UNSPEC,
216
+ IFLA_BRIDGE_MRP_RING_ROLE_RING_ID,
217
+ IFLA_BRIDGE_MRP_RING_ROLE_ROLE,
218
+ __IFLA_BRIDGE_MRP_RING_ROLE_MAX,
219
+};
220
+
221
+#define IFLA_BRIDGE_MRP_RING_ROLE_MAX (__IFLA_BRIDGE_MRP_RING_ROLE_MAX - 1)
222
+
223
+enum {
224
+ IFLA_BRIDGE_MRP_START_TEST_UNSPEC,
225
+ IFLA_BRIDGE_MRP_START_TEST_RING_ID,
226
+ IFLA_BRIDGE_MRP_START_TEST_INTERVAL,
227
+ IFLA_BRIDGE_MRP_START_TEST_MAX_MISS,
228
+ IFLA_BRIDGE_MRP_START_TEST_PERIOD,
229
+ IFLA_BRIDGE_MRP_START_TEST_MONITOR,
230
+ __IFLA_BRIDGE_MRP_START_TEST_MAX,
231
+};
232
+
233
+#define IFLA_BRIDGE_MRP_START_TEST_MAX (__IFLA_BRIDGE_MRP_START_TEST_MAX - 1)
234
+
235
+enum {
236
+ IFLA_BRIDGE_MRP_INFO_UNSPEC,
237
+ IFLA_BRIDGE_MRP_INFO_RING_ID,
238
+ IFLA_BRIDGE_MRP_INFO_P_IFINDEX,
239
+ IFLA_BRIDGE_MRP_INFO_S_IFINDEX,
240
+ IFLA_BRIDGE_MRP_INFO_PRIO,
241
+ IFLA_BRIDGE_MRP_INFO_RING_STATE,
242
+ IFLA_BRIDGE_MRP_INFO_RING_ROLE,
243
+ IFLA_BRIDGE_MRP_INFO_TEST_INTERVAL,
244
+ IFLA_BRIDGE_MRP_INFO_TEST_MAX_MISS,
245
+ IFLA_BRIDGE_MRP_INFO_TEST_MONITOR,
246
+ IFLA_BRIDGE_MRP_INFO_I_IFINDEX,
247
+ IFLA_BRIDGE_MRP_INFO_IN_STATE,
248
+ IFLA_BRIDGE_MRP_INFO_IN_ROLE,
249
+ IFLA_BRIDGE_MRP_INFO_IN_TEST_INTERVAL,
250
+ IFLA_BRIDGE_MRP_INFO_IN_TEST_MAX_MISS,
251
+ __IFLA_BRIDGE_MRP_INFO_MAX,
252
+};
253
+
254
+#define IFLA_BRIDGE_MRP_INFO_MAX (__IFLA_BRIDGE_MRP_INFO_MAX - 1)
255
+
256
+enum {
257
+ IFLA_BRIDGE_MRP_IN_STATE_UNSPEC,
258
+ IFLA_BRIDGE_MRP_IN_STATE_IN_ID,
259
+ IFLA_BRIDGE_MRP_IN_STATE_STATE,
260
+ __IFLA_BRIDGE_MRP_IN_STATE_MAX,
261
+};
262
+
263
+#define IFLA_BRIDGE_MRP_IN_STATE_MAX (__IFLA_BRIDGE_MRP_IN_STATE_MAX - 1)
264
+
265
+enum {
266
+ IFLA_BRIDGE_MRP_IN_ROLE_UNSPEC,
267
+ IFLA_BRIDGE_MRP_IN_ROLE_RING_ID,
268
+ IFLA_BRIDGE_MRP_IN_ROLE_IN_ID,
269
+ IFLA_BRIDGE_MRP_IN_ROLE_ROLE,
270
+ IFLA_BRIDGE_MRP_IN_ROLE_I_IFINDEX,
271
+ __IFLA_BRIDGE_MRP_IN_ROLE_MAX,
272
+};
273
+
274
+#define IFLA_BRIDGE_MRP_IN_ROLE_MAX (__IFLA_BRIDGE_MRP_IN_ROLE_MAX - 1)
275
+
276
+enum {
277
+ IFLA_BRIDGE_MRP_START_IN_TEST_UNSPEC,
278
+ IFLA_BRIDGE_MRP_START_IN_TEST_IN_ID,
279
+ IFLA_BRIDGE_MRP_START_IN_TEST_INTERVAL,
280
+ IFLA_BRIDGE_MRP_START_IN_TEST_MAX_MISS,
281
+ IFLA_BRIDGE_MRP_START_IN_TEST_PERIOD,
282
+ __IFLA_BRIDGE_MRP_START_IN_TEST_MAX,
283
+};
284
+
285
+#define IFLA_BRIDGE_MRP_START_IN_TEST_MAX (__IFLA_BRIDGE_MRP_START_IN_TEST_MAX - 1)
286
+
287
+struct br_mrp_instance {
288
+ __u32 ring_id;
289
+ __u32 p_ifindex;
290
+ __u32 s_ifindex;
291
+ __u16 prio;
292
+};
293
+
294
+struct br_mrp_ring_state {
295
+ __u32 ring_id;
296
+ __u32 ring_state;
297
+};
298
+
299
+struct br_mrp_ring_role {
300
+ __u32 ring_id;
301
+ __u32 ring_role;
302
+};
303
+
304
+struct br_mrp_start_test {
305
+ __u32 ring_id;
306
+ __u32 interval;
307
+ __u32 max_miss;
308
+ __u32 period;
309
+ __u32 monitor;
310
+};
311
+
312
+struct br_mrp_in_state {
313
+ __u32 in_state;
314
+ __u16 in_id;
315
+};
316
+
317
+struct br_mrp_in_role {
318
+ __u32 ring_id;
319
+ __u32 in_role;
320
+ __u32 i_ifindex;
321
+ __u16 in_id;
322
+};
323
+
324
+struct br_mrp_start_in_test {
325
+ __u32 interval;
326
+ __u32 max_miss;
327
+ __u32 period;
328
+ __u16 in_id;
329
+};
330
+
331
+struct bridge_stp_xstats {
332
+ __u64 transition_blk;
333
+ __u64 transition_fwd;
334
+ __u64 rx_bpdu;
335
+ __u64 tx_bpdu;
336
+ __u64 rx_tcn;
337
+ __u64 tx_tcn;
338
+};
339
+
340
+/* Bridge vlan RTM header */
341
+struct br_vlan_msg {
342
+ __u8 family;
343
+ __u8 reserved1;
344
+ __u16 reserved2;
345
+ __u32 ifindex;
346
+};
347
+
348
+enum {
349
+ BRIDGE_VLANDB_DUMP_UNSPEC,
350
+ BRIDGE_VLANDB_DUMP_FLAGS,
351
+ __BRIDGE_VLANDB_DUMP_MAX,
352
+};
353
+#define BRIDGE_VLANDB_DUMP_MAX (__BRIDGE_VLANDB_DUMP_MAX - 1)
354
+
355
+/* flags used in BRIDGE_VLANDB_DUMP_FLAGS attribute to affect dumps */
356
+#define BRIDGE_VLANDB_DUMPF_STATS (1 << 0) /* Include stats in the dump */
357
+
358
+/* Bridge vlan RTM attributes
359
+ * [BRIDGE_VLANDB_ENTRY] = {
360
+ * [BRIDGE_VLANDB_ENTRY_INFO]
361
+ * ...
362
+ * }
363
+ */
364
+enum {
365
+ BRIDGE_VLANDB_UNSPEC,
366
+ BRIDGE_VLANDB_ENTRY,
367
+ __BRIDGE_VLANDB_MAX,
368
+};
369
+#define BRIDGE_VLANDB_MAX (__BRIDGE_VLANDB_MAX - 1)
370
+
371
+enum {
372
+ BRIDGE_VLANDB_ENTRY_UNSPEC,
373
+ BRIDGE_VLANDB_ENTRY_INFO,
374
+ BRIDGE_VLANDB_ENTRY_RANGE,
375
+ BRIDGE_VLANDB_ENTRY_STATE,
376
+ BRIDGE_VLANDB_ENTRY_TUNNEL_INFO,
377
+ BRIDGE_VLANDB_ENTRY_STATS,
378
+ __BRIDGE_VLANDB_ENTRY_MAX,
379
+};
380
+#define BRIDGE_VLANDB_ENTRY_MAX (__BRIDGE_VLANDB_ENTRY_MAX - 1)
381
+
382
+/* [BRIDGE_VLANDB_ENTRY] = {
383
+ * [BRIDGE_VLANDB_ENTRY_TUNNEL_INFO] = {
384
+ * [BRIDGE_VLANDB_TINFO_ID]
385
+ * ...
386
+ * }
387
+ * }
388
+ */
389
+enum {
390
+ BRIDGE_VLANDB_TINFO_UNSPEC,
391
+ BRIDGE_VLANDB_TINFO_ID,
392
+ BRIDGE_VLANDB_TINFO_CMD,
393
+ __BRIDGE_VLANDB_TINFO_MAX,
394
+};
395
+#define BRIDGE_VLANDB_TINFO_MAX (__BRIDGE_VLANDB_TINFO_MAX - 1)
396
+
397
+/* [BRIDGE_VLANDB_ENTRY] = {
398
+ * [BRIDGE_VLANDB_ENTRY_STATS] = {
399
+ * [BRIDGE_VLANDB_STATS_RX_BYTES]
400
+ * ...
401
+ * }
402
+ * ...
403
+ * }
404
+ */
405
+enum {
406
+ BRIDGE_VLANDB_STATS_UNSPEC,
407
+ BRIDGE_VLANDB_STATS_RX_BYTES,
408
+ BRIDGE_VLANDB_STATS_RX_PACKETS,
409
+ BRIDGE_VLANDB_STATS_TX_BYTES,
410
+ BRIDGE_VLANDB_STATS_TX_PACKETS,
411
+ BRIDGE_VLANDB_STATS_PAD,
412
+ __BRIDGE_VLANDB_STATS_MAX,
413
+};
414
+#define BRIDGE_VLANDB_STATS_MAX (__BRIDGE_VLANDB_STATS_MAX - 1)
158415
159416 /* Bridge multicast database attributes
160417 * [MDBA_MDB] = {
....@@ -198,9 +455,32 @@
198455 enum {
199456 MDBA_MDB_EATTR_UNSPEC,
200457 MDBA_MDB_EATTR_TIMER,
458
+ MDBA_MDB_EATTR_SRC_LIST,
459
+ MDBA_MDB_EATTR_GROUP_MODE,
460
+ MDBA_MDB_EATTR_SOURCE,
461
+ MDBA_MDB_EATTR_RTPROT,
201462 __MDBA_MDB_EATTR_MAX
202463 };
203464 #define MDBA_MDB_EATTR_MAX (__MDBA_MDB_EATTR_MAX - 1)
465
+
466
+/* per mdb entry source */
467
+enum {
468
+ MDBA_MDB_SRCLIST_UNSPEC,
469
+ MDBA_MDB_SRCLIST_ENTRY,
470
+ __MDBA_MDB_SRCLIST_MAX
471
+};
472
+#define MDBA_MDB_SRCLIST_MAX (__MDBA_MDB_SRCLIST_MAX - 1)
473
+
474
+/* per mdb entry per source attributes
475
+ * these are embedded in MDBA_MDB_SRCLIST_ENTRY
476
+ */
477
+enum {
478
+ MDBA_MDB_SRCATTR_UNSPEC,
479
+ MDBA_MDB_SRCATTR_ADDRESS,
480
+ MDBA_MDB_SRCATTR_TIMER,
481
+ __MDBA_MDB_SRCATTR_MAX
482
+};
483
+#define MDBA_MDB_SRCATTR_MAX (__MDBA_MDB_SRCATTR_MAX - 1)
204484
205485 /* multicast router types */
206486 enum {
....@@ -237,6 +517,9 @@
237517 #define MDB_PERMANENT 1
238518 __u8 state;
239519 #define MDB_FLAGS_OFFLOAD (1 << 0)
520
+#define MDB_FLAGS_FAST_LEAVE (1 << 1)
521
+#define MDB_FLAGS_STAR_EXCL (1 << 2)
522
+#define MDB_FLAGS_BLOCKED (1 << 3)
240523 __u8 flags;
241524 __u16 vid;
242525 struct {
....@@ -251,9 +534,22 @@
251534 enum {
252535 MDBA_SET_ENTRY_UNSPEC,
253536 MDBA_SET_ENTRY,
537
+ MDBA_SET_ENTRY_ATTRS,
254538 __MDBA_SET_ENTRY_MAX,
255539 };
256540 #define MDBA_SET_ENTRY_MAX (__MDBA_SET_ENTRY_MAX - 1)
541
+
542
+/* [MDBA_SET_ENTRY_ATTRS] = {
543
+ * [MDBE_ATTR_xxx]
544
+ * ...
545
+ * }
546
+ */
547
+enum {
548
+ MDBE_ATTR_UNSPEC,
549
+ MDBE_ATTR_SOURCE,
550
+ __MDBE_ATTR_MAX,
551
+};
552
+#define MDBE_ATTR_MAX (__MDBE_ATTR_MAX - 1)
257553
258554 /* Embedded inside LINK_XSTATS_TYPE_BRIDGE */
259555 enum {
....@@ -261,6 +557,7 @@
261557 BRIDGE_XSTATS_VLAN,
262558 BRIDGE_XSTATS_MCAST,
263559 BRIDGE_XSTATS_PAD,
560
+ BRIDGE_XSTATS_STP,
264561 __BRIDGE_XSTATS_MAX
265562 };
266563 #define BRIDGE_XSTATS_MAX (__BRIDGE_XSTATS_MAX - 1)
....@@ -292,4 +589,25 @@
292589 __u64 mcast_bytes[BR_MCAST_DIR_SIZE];
293590 __u64 mcast_packets[BR_MCAST_DIR_SIZE];
294591 };
592
+
593
+/* bridge boolean options
594
+ * BR_BOOLOPT_NO_LL_LEARN - disable learning from link-local packets
595
+ *
596
+ * IMPORTANT: if adding a new option do not forget to handle
597
+ * it in br_boolopt_toggle/get and bridge sysfs
598
+ */
599
+enum br_boolopt_id {
600
+ BR_BOOLOPT_NO_LL_LEARN,
601
+ BR_BOOLOPT_MAX
602
+};
603
+
604
+/* struct br_boolopt_multi - change multiple bridge boolean options
605
+ *
606
+ * @optval: new option values (bit per option)
607
+ * @optmask: options to change (bit per option)
608
+ */
609
+struct br_boolopt_multi {
610
+ __u32 optval;
611
+ __u32 optmask;
612
+};
295613 #endif /* _UAPI_LINUX_IF_BRIDGE_H */