Loading Documentation/netlink/genetlink-c.yaml +2 −1 Original line number Diff line number Diff line Loading @@ -149,7 +149,8 @@ properties: name: type: string type: &attr-type enum: [ unused, pad, flag, binary, u8, u16, u32, u64, s32, s64, enum: [ unused, pad, flag, binary, uint, sint, u8, u16, u32, u64, s32, s64, string, nest, array-nest, nest-type-value ] doc: description: Documentation of the attribute. Loading Documentation/netlink/genetlink-legacy.yaml +2 −1 Original line number Diff line number Diff line Loading @@ -192,7 +192,8 @@ properties: type: string type: &attr-type description: The netlink attribute type enum: [ unused, pad, flag, binary, u8, u16, u32, u64, s32, s64, enum: [ unused, pad, flag, binary, uint, sint, u8, u16, u32, u64, s32, s64, string, nest, array-nest, nest-type-value ] doc: description: Documentation of the attribute. Loading Documentation/netlink/genetlink.yaml +2 −1 Original line number Diff line number Diff line Loading @@ -122,7 +122,8 @@ properties: name: type: string type: &attr-type enum: [ unused, pad, flag, binary, u8, u16, u32, u64, s32, s64, enum: [ unused, pad, flag, binary, uint, sint, u8, u16, u32, u64, s32, s64, string, nest, array-nest, nest-type-value ] doc: description: Documentation of the attribute. Loading tools/net/ynl/lib/nlspec.py +6 −0 Original line number Diff line number Diff line Loading @@ -149,6 +149,7 @@ class SpecAttr(SpecElement): Represents a single attribute type within an attr space. Attributes: type string, attribute type value numerical ID when serialized attr_set Attribute Set containing this attr is_multi bool, attr may repeat multiple times Loading @@ -157,10 +158,13 @@ class SpecAttr(SpecElement): len integer, optional byte length of binary types display_hint string, hint to help choose format specifier when displaying the value is_auto_scalar bool, attr is a variable-size scalar """ def __init__(self, family, attr_set, yaml, value): super().__init__(family, yaml) self.type = yaml['type'] self.value = value self.attr_set = attr_set self.is_multi = yaml.get('multi-attr', False) Loading @@ -170,6 +174,8 @@ class SpecAttr(SpecElement): self.len = yaml.get('len') self.display_hint = yaml.get('display-hint') self.is_auto_scalar = self.type == "sint" or self.type == "uint" class SpecAttrSet(SpecElement): """ Netlink Attribute Set class. Loading tools/net/ynl/lib/ynl.c +6 −0 Original line number Diff line number Diff line Loading @@ -352,6 +352,12 @@ int ynl_attr_validate(struct ynl_parse_arg *yarg, const struct nlattr *attr) yerr(yarg->ys, YNL_ERROR_ATTR_INVALID, "Invalid attribute (u64 %s)", policy->name); return -1; case YNL_PT_UINT: if (len == sizeof(__u32) || len == sizeof(__u64)) break; yerr(yarg->ys, YNL_ERROR_ATTR_INVALID, "Invalid attribute (uint %s)", policy->name); return -1; case YNL_PT_FLAG: /* Let flags grow into real attrs, why not.. */ break; Loading Loading
Documentation/netlink/genetlink-c.yaml +2 −1 Original line number Diff line number Diff line Loading @@ -149,7 +149,8 @@ properties: name: type: string type: &attr-type enum: [ unused, pad, flag, binary, u8, u16, u32, u64, s32, s64, enum: [ unused, pad, flag, binary, uint, sint, u8, u16, u32, u64, s32, s64, string, nest, array-nest, nest-type-value ] doc: description: Documentation of the attribute. Loading
Documentation/netlink/genetlink-legacy.yaml +2 −1 Original line number Diff line number Diff line Loading @@ -192,7 +192,8 @@ properties: type: string type: &attr-type description: The netlink attribute type enum: [ unused, pad, flag, binary, u8, u16, u32, u64, s32, s64, enum: [ unused, pad, flag, binary, uint, sint, u8, u16, u32, u64, s32, s64, string, nest, array-nest, nest-type-value ] doc: description: Documentation of the attribute. Loading
Documentation/netlink/genetlink.yaml +2 −1 Original line number Diff line number Diff line Loading @@ -122,7 +122,8 @@ properties: name: type: string type: &attr-type enum: [ unused, pad, flag, binary, u8, u16, u32, u64, s32, s64, enum: [ unused, pad, flag, binary, uint, sint, u8, u16, u32, u64, s32, s64, string, nest, array-nest, nest-type-value ] doc: description: Documentation of the attribute. Loading
tools/net/ynl/lib/nlspec.py +6 −0 Original line number Diff line number Diff line Loading @@ -149,6 +149,7 @@ class SpecAttr(SpecElement): Represents a single attribute type within an attr space. Attributes: type string, attribute type value numerical ID when serialized attr_set Attribute Set containing this attr is_multi bool, attr may repeat multiple times Loading @@ -157,10 +158,13 @@ class SpecAttr(SpecElement): len integer, optional byte length of binary types display_hint string, hint to help choose format specifier when displaying the value is_auto_scalar bool, attr is a variable-size scalar """ def __init__(self, family, attr_set, yaml, value): super().__init__(family, yaml) self.type = yaml['type'] self.value = value self.attr_set = attr_set self.is_multi = yaml.get('multi-attr', False) Loading @@ -170,6 +174,8 @@ class SpecAttr(SpecElement): self.len = yaml.get('len') self.display_hint = yaml.get('display-hint') self.is_auto_scalar = self.type == "sint" or self.type == "uint" class SpecAttrSet(SpecElement): """ Netlink Attribute Set class. Loading
tools/net/ynl/lib/ynl.c +6 −0 Original line number Diff line number Diff line Loading @@ -352,6 +352,12 @@ int ynl_attr_validate(struct ynl_parse_arg *yarg, const struct nlattr *attr) yerr(yarg->ys, YNL_ERROR_ATTR_INVALID, "Invalid attribute (u64 %s)", policy->name); return -1; case YNL_PT_UINT: if (len == sizeof(__u32) || len == sizeof(__u64)) break; yerr(yarg->ys, YNL_ERROR_ATTR_INVALID, "Invalid attribute (uint %s)", policy->name); return -1; case YNL_PT_FLAG: /* Let flags grow into real attrs, why not.. */ break; Loading