MCPcopy Index your code
hub / github.com/secdev/scapy / do_build_ps

Method do_build_ps

scapy/packet.py:806–826  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

804 return self.payload.build_done(p)
805
806 def do_build_ps(self):
807 # type: () -> Tuple[bytes, List[Tuple[Packet, List[Tuple[Field[Any, Any], str, bytes]]]]] # noqa: E501
808 p = b""
809 pl = []
810 q = b""
811 for f in self.fields_desc:
812 if isinstance(f, ConditionalField) and not f._evalcond(self):
813 continue
814 p = f.addfield(self, p, self.getfieldval(f.name))
815 if isinstance(p, bytes):
816 r = p[len(q):]
817 q = p
818 else:
819 r = b""
820 pl.append((f, f.i2repr(self, self.getfieldval(f.name)), r))
821
822 pkt, lst = self.payload.build_ps(internal=1)
823 p += pkt
824 lst.append((self, pl))
825
826 return p, lst
827
828 def build_ps(self, internal=0):
829 # type: (int) -> Tuple[bytes, List[Tuple[Packet, List[Tuple[Any, Any, bytes]]]]] # noqa: E501

Callers 1

build_psMethod · 0.95

Calls 6

getfieldvalMethod · 0.95
_evalcondMethod · 0.80
addfieldMethod · 0.45
appendMethod · 0.45
i2reprMethod · 0.45
build_psMethod · 0.45

Tested by

no test coverage detected