Skip to content

Commit 737eab7

Browse files
donaldhkuba-moo
authored andcommitted
netlink: specs: add display-hint to schema definitions
Add a display-hint property to the netlink schema that is for providing optional hints to generic netlink clients about how to display attribute values. A display-hint on an attribute definition is intended for letting a client such as ynl know that, for example, a u32 should be rendered as an ipv4 address. The display-hint enumeration includes a small number of networking domain-specific value types. Signed-off-by: Donald Hunter <donald.hunter@gmail.com> Link: https://lore.kernel.org/r/20230623201928.14275-2-donald.hunter@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent 2ffecf1 commit 737eab7

3 files changed

Lines changed: 22 additions & 1 deletion

File tree

Documentation/netlink/genetlink-c.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,12 @@ properties:
195195
description: Max length for a string or a binary attribute.
196196
$ref: '#/$defs/len-or-define'
197197
sub-type: *attr-type
198+
display-hint: &display-hint
199+
description: |
200+
Optional format indicator that is intended only for choosing
201+
the right formatting mechanism when displaying values of this
202+
type.
203+
enum: [ hex, mac, fddi, ipv4, ipv6, uuid ]
198204
# Start genetlink-c
199205
name-prefix:
200206
type: string

Documentation/netlink/genetlink-legacy.yaml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,8 @@ properties:
119119
name:
120120
type: string
121121
type:
122-
enum: [ u8, u16, u32, u64, s8, s16, s32, s64, string ]
122+
description: The netlink attribute type
123+
enum: [ u8, u16, u32, u64, s8, s16, s32, s64, string, binary ]
123124
len:
124125
$ref: '#/$defs/len-or-define'
125126
byte-order:
@@ -130,6 +131,12 @@ properties:
130131
enum:
131132
description: Name of the enum type used for the attribute.
132133
type: string
134+
display-hint: &display-hint
135+
description: |
136+
Optional format indicator that is intended only for choosing
137+
the right formatting mechanism when displaying values of this
138+
type.
139+
enum: [ hex, mac, fddi, ipv4, ipv6, uuid ]
133140
# End genetlink-legacy
134141

135142
attribute-sets:
@@ -179,6 +186,7 @@ properties:
179186
name:
180187
type: string
181188
type: &attr-type
189+
description: The netlink attribute type
182190
enum: [ unused, pad, flag, binary, u8, u16, u32, u64, s32, s64,
183191
string, nest, array-nest, nest-type-value ]
184192
doc:
@@ -226,6 +234,7 @@ properties:
226234
description: Max length for a string or a binary attribute.
227235
$ref: '#/$defs/len-or-define'
228236
sub-type: *attr-type
237+
display-hint: *display-hint
229238
# Start genetlink-c
230239
name-prefix:
231240
type: string

Documentation/netlink/genetlink.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,12 @@ properties:
168168
description: Max length for a string or a binary attribute.
169169
$ref: '#/$defs/len-or-define'
170170
sub-type: *attr-type
171+
display-hint: &display-hint
172+
description: |
173+
Optional format indicator that is intended only for choosing
174+
the right formatting mechanism when displaying values of this
175+
type.
176+
enum: [ hex, mac, fddi, ipv4, ipv6, uuid ]
171177

172178
# Make sure name-prefix does not appear in subsets (subsets inherit naming)
173179
dependencies:

0 commit comments

Comments
 (0)