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

Method get_data_len

scapy/contrib/http2.py:1461–1477  ·  view source on GitHub ↗

get_data_len computes the length of the data 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

1459 ]
1460
1461 def get_data_len(self):
1462 # type: () -> int
1463 """ get_data_len computes the length of the data field
1464
1465 To do this computation, the length of the padlen field and the actual
1466 padding is subtracted to the string that was provided to the pre_dissect # noqa: E501
1467 fun of the pkt parameter
1468 :return: int; length of the data part of the HTTP/2 frame packet provided as parameter # noqa: E501
1469 :raises: AssertionError
1470 """
1471 padding_len = self.getfieldval('padlen')
1472 fld, fval = self.getfield_and_val('padlen')
1473 padding_len_len = fld.i2len(self, fval)
1474
1475 ret = self.s_len - padding_len_len - padding_len
1476 assert ret >= 0
1477 return ret
1478
1479 def pre_dissect(self, s):
1480 # type: (str) -> str

Callers 1

H2PaddedDataFrameClass · 0.80

Calls 3

getfieldvalMethod · 0.45
getfield_and_valMethod · 0.45
i2lenMethod · 0.45

Tested by

no test coverage detected