Lines Matching +full:enum +full:- +full:name
1 # SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause
28 name name of the entity as listed in the spec (optional)
29 ident_name name which can be safely used as identifier in code (optional)
35 if 'name' in self.yaml:
36 self.name = self.yaml['name']
37 self.ident_name = self.name.replace('-', '_')
61 """ Entry within an enum declared in the Netlink spec.
65 enum_set back reference to the enum
66 value numerical value of this enum (use accessors in most situations!)
69 raw_value raw value, i.e. the id in the enum, unlike user value which is a mask for flags
74 yaml = {'name': yaml}
101 """ Enum type
107 type enum or flags
108 entries entries by name
119 value_start = self.yaml.get('value-start', 0)
124 self.entries[e.name] = e
155 struct_name string, name of struct definition
156 sub_type string, name of sub type
166 self.is_multi = yaml.get('multi-attr', False)
168 self.sub_type = yaml.get('sub-type')
169 self.byte_order = yaml.get('byte-order')
171 self.display_hint = yaml.get('display-hint')
180 via the dictionary interface Attribute Set exposes attributes by name.
183 attrs ordered dict of all attributes (indexed by name)
190 self.subset_of = self.yaml.get('subset-of', None)
202 self.attrs[attr.name] = attr
208 attr = real_set[elem['name']]
209 self.attrs[attr.name] = attr
236 enum string, name of the enum definition
244 self.byte_order = yaml.get('byte-order')
245 self.enum = yaml.get('enum')
247 self.display_hint = yaml.get('display-hint')
283 req_value numerical ID when serialized, user -> kernel
284 rsp_value numerical ID when serialized, user <- kernel
288 attr_set attribute set name
289 fixed_header string, optional name of fixed header struct
303 self.fixed_header = self.yaml.get('fixed-header', family.fixed_header)
312 if 'attribute-set' in self.yaml:
313 attr_set_name = self.yaml['attribute-set']
316 attr_set_name = msg['attribute-set']
320 raise Exception(f"Can't resolve attribute set for op '{self.name}'")
331 netlink-raw schema. Genetlink families use dynamic ID allocation
336 name name of the mulitcast group
337 value integer id of this multicast group for netlink-raw or None
357 msg_id_model enum-model for operations (unified, directional etc.)
361 msgs dict of all messages (index by name)
365 fixed_header string, optional name of family default fixed header struct
366 mcast_groups dict of all multicast groups (index by name)
370 prefix = '# SPDX-License-Identifier: '
386 self.msg_id_model = self.yaml['operations'].get('enum-model', 'unified')
448 self.fixed_header = self.yaml['operations'].get('fixed-header')
457 self.msgs[op.name] = op
460 self.fixed_header = self.yaml['operations'].get('fixed-header')
492 skip |= bool(exclude.match(elem['name']))
499 self.msgs[op.name] = op
501 def find_operation(self, name): argument
503 For a given operation name, find and return operation spec.
506 if name == op['name']:
515 if elem['type'] == 'enum' or elem['type'] == 'flags':
516 self.consts[elem['name']] = self.new_enum(elem)
518 self.consts[elem['name']] = self.new_struct(elem)
520 self.consts[elem['name']] = elem
522 for elem in self.yaml['attribute-sets']:
524 self.attr_sets[elem['name']] = attr_set
536 if not op.is_async and 'attribute-set' in op:
537 self.ops[op.name] = op
539 self.ntfs[op.name] = op
541 mcgs = self.yaml.get('mcast-groups')
545 self.mcast_groups[elem['name']] = mcg