Computes the value of this field based on the provided packet and the length_of field and the adjust callback :param packet.Packet pkt: the packet from which is computed this field value. # noqa: E501 :return: int: the computed value for this field. :raises: KeyErr
(self, pkt)
| 615 | return super(FieldUVarLenField, self).i2m(pkt, x) |
| 616 | |
| 617 | def _compute_value(self, pkt): |
| 618 | # type: (packet.Packet) -> int |
| 619 | """ Computes the value of this field based on the provided packet and |
| 620 | the length_of field and the adjust callback |
| 621 | |
| 622 | :param packet.Packet pkt: the packet from which is computed this field value. # noqa: E501 |
| 623 | :return: int: the computed value for this field. |
| 624 | :raises: KeyError: the packet nor its payload do not contain an attribute |
| 625 | with the length_of name. |
| 626 | :raises: AssertionError |
| 627 | :raises: KeyError if _length_of is not one of pkt fields |
| 628 | """ |
| 629 | fld, fval = pkt.getfield_and_val(self._length_of) |
| 630 | val = fld.i2len(pkt, fval) |
| 631 | ret = self._adjust(val) |
| 632 | assert ret >= 0 |
| 633 | return ret |
| 634 | |
| 635 | ############################################################################### |
| 636 | # HPACK String Fields # |
no test coverage detected