Lines Matching full:raw

126     def __init__(self, raw, offset):  argument
127 self._len, self._type = struct.unpack("HH", raw[offset : offset + 4])
132 self.raw = raw[offset + 4 : offset + self.payload_len]
144 return format.unpack(self.raw)[0]
147 if len(self.raw) != 4 and len(self.raw) != 8:
148 raise Exception(f"Auto-scalar len payload be 4 or 8 bytes, got {len(self.raw)}")
149 real_type = attr_type[0] + str(len(self.raw) * 8)
151 return format.unpack(self.raw)[0]
154 return self.raw.decode('ascii')[:-1]
157 return self.raw
161 return [ x[0] for x in format.iter_unpack(self.raw) ]
164 return f"[type:{self.type} len:{self._len}] {self.raw}"
195 self.raw = msg[offset + 16 : offset + self.nl_len]
202 self.error = struct.unpack("i", self.raw[0:4])[0]
206 self.error = struct.unpack("i", self.raw[0:4])[0]
213 extack_attrs = NlAttrs(self.raw[extack_off:])
224 self.extack['policy'] = self._decode_policy(extack.raw)
240 def _decode_policy(self, raw): argument
242 for attr in NlAttrs(raw):
268 …msg = f"nl_len = {self.nl_len} ({len(self.raw)}) nl_flags = 0x{self.nl_flags:x} nl_type = {self.nl…
332 for attr in NlAttrs(gm.raw):
341 for entry in NlAttrs(attr.raw):
344 for entry_attr in NlAttrs(entry.raw):
358 self.genl_cmd, self.genl_version, _ = struct.unpack_from("BBH", nl_msg.raw, 0)
359 self.raw = nl_msg.raw[4:]
394 msg.raw_attrs = NlAttrs(msg.raw, fixed_header_size)
467 if self.proto == "netlink-raw":
608 def _decode_enum(self, raw, attr_spec): argument
613 while raw:
614 if raw & 1:
616 raw >>= 1
619 value = enum.entries_by_val[raw].name
624 decoded = self._decode_struct(attr.raw, attr_spec.struct_name)
636 while offset < len(attr.raw):
637 item = NlAttr(attr.raw, offset)
641 subattrs = self._decode(NlAttrs(item.raw), attr_spec['nested-attributes'])
661 value = NlAttr(value.raw, 0)
663 subattrs = self._decode(NlAttrs(value.raw), attr_spec['nested-attributes'])
669 return self._decode(NlAttrs(attr.raw), None)
707 decoded.update(self._decode_struct(attr.raw, msg_format.fixed_header));
711 subdict = self._decode(NlAttrs(attr.raw, offset), msg_format.attr_set)
734 … subdict = self._decode(NlAttrs(attr.raw), attr_spec['nested-attributes'], search_attrs)
753 value, selector = struct.unpack("II", attr.raw)
788 subpath = self._decode_extack_path(NlAttrs(attr.raw),
879 def _formatted_string(self, raw, display_hint): argument
881 formatted = ':'.join('%02x' % b for b in raw)
883 if isinstance(raw, int):
884 formatted = hex(raw)
886 formatted = bytes.hex(raw, ' ')
888 formatted = format(ipaddress.ip_address(raw))
890 formatted = str(uuid.UUID(bytes=raw))
892 formatted = raw
898 msg['raw'] = decoded
902 attrs.update(self._decode_struct(decoded.raw, op.fixed_header))
1021 rsp_msg.update(self._decode_struct(decoded.raw, op.fixed_header))