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

Function streamcls

scapy/sessions.py:165–176  ·  view source on GitHub ↗

Wraps a class for use when dissecting streams.

(cls: Type[Packet])

Source from the content-addressed store, hash-verified

163
164
165def streamcls(cls: Type[Packet]) -> Callable[
166 [bytes, Dict[str, Any], Dict[str, Any]],
167 Optional[Packet],
168]:
169 """
170 Wraps a class for use when dissecting streams.
171 """
172 if hasattr(cls, "tcp_reassemble"):
173 return cls.tcp_reassemble # type: ignore
174 else:
175 # There is no tcp_reassemble. Just dissect the packet
176 return lambda data, *_: data and cls(data)
177
178
179class TCPSession(IPSession):

Callers 2

__init__Method · 0.90
processMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected