Commit fb984d17 authored by Jakub Kicinski's avatar Jakub Kicinski

Merge branch 'doc-netlink-specs-add-vlan-support'

Hangbin Liu says:

====================
doc/netlink/specs: Add vlan support

Add vlan support in rt_link spec.
====================

Link: https://lore.kernel.org/r/20240327123130.1322921-1-liuhangbin@gmail.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parents 51cf49f6 782c1084
......@@ -50,7 +50,16 @@ definitions:
name: dormant
-
name: echo
-
name: vlan-protocols
type: enum
entries:
-
name: 8021q
value: 33024
-
name: 8021ad
value: 34984
-
name: rtgenmsg
type: struct
......@@ -729,7 +738,38 @@ definitions:
-
name: filter-mask
type: u32
-
name: ifla-vlan-flags
type: struct
members:
-
name: flags
type: u32
enum: vlan-flags
enum-as-flags: true
-
name: mask
type: u32
display-hint: hex
-
name: vlan-flags
type: flags
entries:
- reorder-hdr
- gvrp
- loose-binding
- mvrp
- bridge-binding
-
name: ifla-vlan-qos-mapping
type: struct
members:
-
name: from
type: u32
-
name: to
type: u32
attribute-sets:
-
......@@ -1507,6 +1547,39 @@ attribute-sets:
-
name: num-disabled-queues
type: u32
-
name: linkinfo-vlan-attrs
name-prefix: ifla-vlan-
attributes:
-
name: id
type: u16
-
name: flag
type: binary
struct: ifla-vlan-flags
-
name: egress-qos
type: nest
nested-attributes: ifla-vlan-qos
-
name: ingress-qos
type: nest
nested-attributes: ifla-vlan-qos
-
name: protocol
type: u16
enum: vlan-protocols
byte-order: big-endian
-
name: ifla-vlan-qos
name-prefix: ifla-vlan-qos
attributes:
-
name: mapping
type: binary
multi-attr: true
struct: ifla-vlan-qos-mapping
-
name: linkinfo-vrf-attrs
name-prefix: ifla-vrf-
......@@ -1666,6 +1739,9 @@ sub-messages:
-
value: tun
attribute-set: linkinfo-tun-attrs
-
value: vlan
attribute-set: linkinfo-vlan-attrs
-
value: vrf
attribute-set: linkinfo-vrf-attrs
......
......@@ -819,7 +819,10 @@ class YnlFamily(SpecFamily):
if display_hint == 'mac':
formatted = ':'.join('%02x' % b for b in raw)
elif display_hint == 'hex':
formatted = bytes.hex(raw, ' ')
if isinstance(raw, int):
formatted = hex(raw)
else:
formatted = bytes.hex(raw, ' ')
elif display_hint in [ 'ipv4', 'ipv6' ]:
formatted = format(ipaddress.ip_address(raw))
elif display_hint == 'uuid':
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment