scapy.base_classes

Generators and packet meta classes.

class scapy.base_classes.BasePacket(*args, **kwds)[source]

Bases: scapy.base_classes.Gen[scapy.packet.Packet]

class scapy.base_classes.BasePacketList(*args, **kwds)[source]

Bases: scapy.base_classes.Gen[scapy.base_classes._T]

class scapy.base_classes.Field_metaclass(name, bases, dct)[source]

Bases: scapy.compat._Generic_metaclass

class scapy.base_classes.Gen(*args, **kwds)[source]

Bases: Generic[scapy.base_classes._T]

class scapy.base_classes.Net(net)[source]

Bases: scapy.base_classes.Gen[str]

Generate a list of IPs from a network address or a name

choice()[source]
ip_regex = re.compile('^(\\*|[0-2]?[0-9]?[0-9](-[0-2]?[0-9]?[0-9])?)\\.(\\*|[0-2]?[0-9]?[0-9](-[0-2]?[0-9]?[0-9])?)\\.(\\*|[0-2]?[0-9]?[0-9](-[0-2]?[0-9]?[0-9])?)\\.(\\*|[0-2]?[0-9]?[0-9](-[0-2]?[0-9]?[0-9])?)(/[0-3]?[0-9])
name = 'ip'
class scapy.base_classes.OID(oid)[source]

Bases: scapy.base_classes.Gen[str]

name = 'OID'
scapy.base_classes.PacketList_metaclass[source]

alias of scapy.base_classes.Field_metaclass

class scapy.base_classes.Packet_metaclass(name, bases, dct)[source]

Bases: scapy.compat._Generic_metaclass

class scapy.base_classes.SetGen(values, _iterpacket=1)[source]

Bases: scapy.base_classes.Gen[scapy.base_classes._T]