Lines Matching full:raw

129     def __init__(self, raw, offset):  argument
130 self._len, self._type = struct.unpack("HH", raw[offset : offset + 4])
135 self.raw = raw[offset + 4 : offset + self.payload_len]
147 return format.unpack(self.raw)[0]
150 if len(self.raw) != 4 and len(self.raw) != 8:
151 raise Exception(f"Auto-scalar len payload be 4 or 8 bytes, got {len(self.raw)}")
152 real_type = attr_type[0] + str(len(self.raw) * 8)
154 return format.unpack(self.raw)[0]
157 return self.raw.decode('ascii')[:-1]
160 return self.raw
164 return [ x[0] for x in format.iter_unpack(self.raw) ]
167 return f"[type:{self.type} len:{self._len}] {self.raw}"
198 self.raw = msg[offset + 16 : offset + self.nl_len]
205 self.error = struct.unpack("i", self.raw[0:4])[0]
209 self.error = struct.unpack("i", self.raw[0:4])[0]
216 extack_attrs = NlAttrs(self.raw[extack_off:])
227 self.extack['policy'] = self._decode_policy(extack.raw)
243 def _decode_policy(self, raw): argument
245 for attr in NlAttrs(raw):
271 …msg = f"nl_len = {self.nl_len} ({len(self.raw)}) nl_flags = 0x{self.nl_flags:x} nl_type = {self.nl…
335 for attr in NlAttrs(gm.raw):
344 for entry in NlAttrs(attr.raw):
347 for entry_attr in NlAttrs(entry.raw):
361 self.genl_cmd, self.genl_version, _ = struct.unpack_from("BBH", nl_msg.raw, 0)
362 self.raw = nl_msg.raw[4:]
397 msg.raw_attrs = NlAttrs(msg.raw, fixed_header_size)
470 if self.proto == "netlink-raw":
611 def _decode_enum(self, raw, attr_spec): argument
616 while raw:
617 if raw & 1:
619 raw >>= 1
622 value = enum.entries_by_val[raw].name
627 decoded = self._decode_struct(attr.raw, attr_spec.struct_name)
639 while offset < len(attr.raw):
640 item = NlAttr(attr.raw, offset)
644 subattrs = self._decode(NlAttrs(item.raw), attr_spec['nested-attributes'])
664 value = NlAttr(value.raw, 0)
666 subattrs = self._decode(NlAttrs(value.raw), attr_spec['nested-attributes'])
672 return self._decode(NlAttrs(attr.raw), None)
710 decoded.update(self._decode_struct(attr.raw, msg_format.fixed_header));
714 subdict = self._decode(NlAttrs(attr.raw, offset), msg_format.attr_set)
738 … subdict = self._decode(NlAttrs(attr.raw), attr_spec['nested-attributes'], search_attrs)
757 value, selector = struct.unpack("II", attr.raw)
795 subpath = self._decode_extack_path(NlAttrs(attr.raw),
886 def _formatted_string(self, raw, display_hint): argument
888 formatted = ':'.join('%02x' % b for b in raw)
890 if isinstance(raw, int):
891 formatted = hex(raw)
893 formatted = bytes.hex(raw, ' ')
895 formatted = format(ipaddress.ip_address(raw))
897 formatted = str(uuid.UUID(bytes=raw))
899 formatted = raw
905 msg['raw'] = decoded
909 attrs.update(self._decode_struct(decoded.raw, op.fixed_header))
1047 rsp_msg.update(self._decode_struct(decoded.raw, op.fixed_header))