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

Method addfield

scapy/fields.py:1893–1898  ·  view source on GitHub ↗
(self, pkt, s, val)

Source from the content-addressed store, hash-verified

1891 return s[len_pkt:], self.m2i(pkt, s[:len_pkt])
1892
1893 def addfield(self, pkt, s, val):
1894 # type: (Packet, bytes, Optional[bytes]) -> bytes
1895 len_pkt = self.length_from(pkt)
1896 if len_pkt is None:
1897 return s + self.i2m(pkt, val)
1898 return s + struct.pack("%is" % len_pkt, self.i2m(pkt, val))
1899
1900 def randval(self):
1901 # type: () -> RandBin

Callers

nothing calls this directly

Calls 2

length_fromMethod · 0.45
i2mMethod · 0.45

Tested by

no test coverage detected