Docs & rules

secdev/scapyGitHub

This is a public, read-only report. Striff reads this repository's docs, turns each sentence that makes a claim about the code into a rule, and checks the rule against the code on the default branch. How this works

masterd2a43b5Last read Nov 10

Is this yours? Install to manage it

Once installed, Striff checks every pull request.

Rules summary
Documents
Rules
40
9
9
9
9
30
30
3
1
1
1
11
2
1
8
1 broken13
3
1 broken1
46 docs
secdev/scapyOpen repository

secdev/scapy — documented rules

40 of 40 rules, printed November 17, 2026.

The sentence in your docs
Building and dissecting are centralized in Packet (do_build, post_build, do_dissect, guess_payload_class, extract_padding).
5 rules from this sentence
Packet has do_build
checks “Building and dissecting are centralized in Packet (do_build”
Holds
Packet has post_build
Holds
Packet has do_dissect
Holds
Packet has guess_payload_class
Holds
Packet has extract_padding
Holds
IP.post_build: IHL/len/checksum
IP has post_build
Holds
TCP.post_build: data offset + checksum
TCP has post_build
Holds
UDP.post_build: len + checksum
UDP has post_build
Holds
GRE.post_build: conditional checksum
GRE has post_build
Holds
Code in scapy/layers/ should not import scapy/contrib/.
nothing in scapy/layers may depend on scapy/contrib
Broken by
Brokenlayers contrib
class TFTP_read(Automaton): def parse_args(self, filename, server, sport = None, port=69, **kargs):
TFTP_read extends Automaton
Holdslayers automaton.py
The default codec is CBOR_Codecs.CBOR::
CBOR_Codecs has CBOR
Holds
its send(data) generates the event data on the lower canal
CLIFeeder has a send method
Holds
class StrFixedLenField(StrField): def getfield(self, pkt, s):
StrFixedLenField extends StrField
Holds
Then, when it needs to guess the next layer class, it calls the default method Packet.guess_payload_class().
Packet has a guess_payload_class method
Holds
In fact, using raw() rather than show2() or any other method is not a random choice as all the functions building the packet calls Packet.__str__() (or Packet.__bytes__() under Python 3).
2 rules from this sentence
Packet has a __str__ method
checks “Packet.str()”
Holds
Packet has a __bytes__ method
checks “Packet.bytes()”
Holds
The glue is provided by Packet.do_build() which calls Field.addfield() for each field in the layer, which in turn calls Field.i2m(): the layer is built IF a value was available.
Packet depends on Field
Holds
MSBExtendedField, LSBExtendedField # Special cases of BitExtendedField
2 rules from this sentence
MSBExtendedField extends BitExtendedField
Holds
LSBExtendedField extends BitExtendedField
Holds
MACField DestMACField(MACField) SourceMACField(MACField)
2 rules from this sentence
DestMACField extends MACField
Holdslayers fields.py
SourceMACField extends MACField
Holdslayers fields.py
NetBIOSNameField # NetBIOS (StrFixedLenField)
NetBIOSNameField extends StrFixedLenField
Holds
ISAKMPTransformSetField # ISAKMP (StrLenField)
ISAKMPTransformSetField extends StrLenField
Holdslayers fields.py
TimeStampField # NTP (BitField)
TimeStampField extends BitField
Holdslayers fields.py
To be precise, scapy/layers protocols should not be importing scapy/contrib protocols, whereas scapy/contrib protocols may import both scapy/contrib and scapy/layers protocols.
nothing in scapy/layers may depend on scapy/contrib
Broken by
Brokenlayers contrib
CCP is derived from CAN. The CAN-header is part of a CCP frame.
CCP extends CAN
Holdscontrib layers
OBD is implemented on top of ISOTP.
something in scapy/contrib/automotive/obd depends on something in scapy/contrib/isotp
Holdsautomotive isotp
LDAPHero (LDAPéro in French) is a graphical wrapper around Scapy's :class:~scapy.layers.ldap.LDAP_Client, that works on all plateforms.
LDAPHero depends on LDAP_Client
Holdsmodules layers
By default, the :class:~scapy.layers.smbclient.smbclient class will use a :class:~scapy.layers.spnego.SPNEGOSSP and provide ask for both NTLM and Kerberos.
smbclient depends on SPNEGOSSP
Holds
This Automaton is wrapped into a :class:~scapy.layers.smbclient.SMB_SOCKET object which provides access to basic SMB commands such as open, read, write, close, etc.
smbclient depends on SMB_SOCKET
Holds
Again, you can instantiate the object directly or via the :meth:~scapy.layers.smbclient.SMB_Client.from_tcpsock helper.
SMB_Client has from_tcpsock
Holds
It's also accessible as the ins attribute of a SMB_SOCKET, or the sock attribute of a smbclient.
2 rules from this sentence
SMB_SOCKET has an ins field
checks “the ins attribute of a ``SMB_SOCKET”
Holds
smbclient has a sock field
checks “the sock attribute of a ``smbclient”
Holds
A share is identified by a name and a path (+ an optional description called remark).
3 rules from this sentence
SMBShare has name
checks “identified by a ``name”
Holds
SMBShare has path
checks “and a ``path”
Holds
SMBShare has remark
checks “an optional description called ``remark”
Holds
It provides a few utility functions such as :py:attr:dev_from_networkname() <scapy.interfaces.NetworkInterfaceDict.dev_from_networkname>, :py:attr:dev_from_name() <scapy.interfaces.NetworkInterfaceDict.dev_from_name> or :py:attr:dev_from_index() <scapy.interfaces.NetworkInterfaceDict.dev_from_index> in order to access those.
3 rules from this sentence
NetworkInterfaceDict has a dev_from_networkname method
Holds
NetworkInterfaceDict has a dev_from_name method
Holds
NetworkInterfaceDict has a dev_from_index method
Holds
40 rules from 10 docs

More open-source reports

Every report →

Other public repositories whose docs Striff read and checked against their code.