MCPcopy Create free account
hub / github.com/secdev/scapy / get_hdrs_len

Method get_hdrs_len

scapy/contrib/http2.py:1542–1558  ·  view source on GitHub ↗

get_hdrs_len computes the length of the hdrs field To do this computation, the length of the padlen field and the actual padding is subtracted to the string that was provided to the pre_dissect # noqa: E501 fun of the pkt parameter. :return: int; length of the data

(self)

Source from the content-addressed store, hash-verified

1540 ]
1541
1542 def get_hdrs_len(self):
1543 # type: () -> int
1544 """ get_hdrs_len computes the length of the hdrs field
1545
1546 To do this computation, the length of the padlen field and the actual
1547 padding is subtracted to the string that was provided to the pre_dissect # noqa: E501
1548 fun of the pkt parameter.
1549 :return: int; length of the data part of the HTTP/2 frame packet provided as parameter # noqa: E501
1550 :raises: AssertionError
1551 """
1552 padding_len = self.getfieldval('padlen')
1553 fld, fval = self.getfield_and_val('padlen')
1554 padding_len_len = fld.i2len(self, fval)
1555
1556 ret = self.s_len - padding_len_len - padding_len
1557 assert ret >= 0
1558 return ret
1559
1560 def pre_dissect(self, s):
1561 # type: (str) -> str

Callers 3

Calls 3

getfieldvalMethod · 0.45
getfield_and_valMethod · 0.45
i2lenMethod · 0.45

Tested by

no test coverage detected