def _inner_parse(self, data): super()._inner_parse(data) # Parse L4 header self.l4_hdr = parse_l4_hdr(self._l4_proto, data, src=self.addrs.src, dst=self.addrs.dst)
def test_scmp(self, scmp_hdr): data = create_mock(["get", "pop"]) # Call ntools.eq_(parse_l4_hdr(L4Proto.SCMP, data, "src addr", "dst addr"), scmp_hdr.return_value) # Tests scmp_hdr.assert_called_once_with( ("src addr", "dst addr", data.pop.return_value))
def test_other_l4(self): # Call ntools.eq_(parse_l4_hdr(L4Proto.TCP, "data"), None)