Constructing TCP from keyword arguments fails:
>>> from pcapkit.protocols.transport.tcp import TCP
>>> TCP(srcport=80, dstport=443)
AttributeError: 'int' object has no attribute 'port'
Raised at pcapkit/protocols/transport/tcp.py:479, which reads .port off a
value it was handed as a plain int.
Reproduced on main. This is the documented construction path for every other
protocol, so either the argument handling needs to accept the integer form it
advertises, or the expectation needs stating — but an AttributeError naming
int tells the caller nothing about what it should have passed.
Found while profiling for #420 (not a performance issue — noticed in passing).
Constructing TCP from keyword arguments fails:
Raised at
pcapkit/protocols/transport/tcp.py:479, which reads.portoff avalue it was handed as a plain
int.Reproduced on
main. This is the documented construction path for every otherprotocol, so either the argument handling needs to accept the integer form it
advertises, or the expectation needs stating — but an
AttributeErrornaminginttells the caller nothing about what it should have passed.Found while profiling for #420 (not a performance issue — noticed in passing).