From ed95a6a3cea25583d339e564b7c93bdbcbbf9483 Mon Sep 17 00:00:00 2001 From: Guillaume Valadon <guillaume.valadon@ssi.gouv.fr> Date: Tue, 15 Nov 2016 12:40:56 +0100 Subject: [PATCH] Python files spell checked --- scapy/ansmachine.py | 2 +- scapy/arch/unix.py | 2 +- scapy/autorun.py | 2 +- scapy/base_classes.py | 2 +- scapy/config.py | 10 +++++----- scapy/contrib/gsm_um.py | 2 +- scapy/contrib/igmp.py | 6 +++--- scapy/contrib/igmpv3.py | 6 +++--- scapy/contrib/isis.py | 2 +- scapy/contrib/pnio_rtc.py | 2 +- scapy/dadict.py | 2 +- scapy/error.py | 2 +- scapy/fields.py | 2 +- scapy/layers/dhcp6.py | 6 +++--- scapy/main.py | 2 +- scapy/packet.py | 6 +++--- scapy/plist.py | 6 +++--- scapy/pton_ntop.py | 2 +- scapy/sendrecv.py | 14 +++++++------- scapy/supersocket.py | 2 +- scapy/themes.py | 2 +- scapy/tools/UTscapy.py | 2 +- scapy/utils.py | 6 +++--- scapy/utils6.py | 10 +++++----- scapy/volatile.py | 2 +- 25 files changed, 51 insertions(+), 51 deletions(-) diff --git a/scapy/ansmachine.py b/scapy/ansmachine.py index 7f570cbf..d8d2f188 100644 --- a/scapy/ansmachine.py +++ b/scapy/ansmachine.py @@ -110,7 +110,7 @@ class AnsweringMachine(object): self.print_reply(pkt, reply) def run(self, *args, **kargs): - log_interactive.warning("run() method deprecated. The intance is now callable") + log_interactive.warning("run() method deprecated. The instance is now callable") self(*args,**kargs) def __call__(self, *args, **kargs): diff --git a/scapy/arch/unix.py b/scapy/arch/unix.py index 04449edd..66400ad9 100644 --- a/scapy/arch/unix.py +++ b/scapy/arch/unix.py @@ -261,7 +261,7 @@ def read_routes6(): # Check flags if not "U" in flags: # usable route continue - if "R" in flags: # Host or net unrechable + if "R" in flags: # Host or net unreachable continue if "m" in flags: # multicast address # Note: multicast routing is handled in Route6.route() diff --git a/scapy/autorun.py b/scapy/autorun.py index b3b5c568..354cd538 100644 --- a/scapy/autorun.py +++ b/scapy/autorun.py @@ -47,7 +47,7 @@ def autorun_commands(cmds,my_globals=None,verb=0): interp = ScapyAutorunInterpreter(my_globals) cmd = "" cmds = cmds.splitlines() - cmds.append("") # ensure we finish multiline commands + cmds.append("") # ensure we finish multi-line commands cmds.reverse() __builtin__.__dict__["_"] = None while 1: diff --git a/scapy/base_classes.py b/scapy/base_classes.py index a810c085..636f28d1 100644 --- a/scapy/base_classes.py +++ b/scapy/base_classes.py @@ -257,7 +257,7 @@ class BasePacket(Gen): ############################# -## Packet list base classe ## +## Packet list base class ## ############################# class BasePacketList(object): diff --git a/scapy/config.py b/scapy/config.py index 5f5d5a61..d66a6443 100755 --- a/scapy/config.py +++ b/scapy/config.py @@ -282,7 +282,7 @@ def _prompt_changer(attr,val): try: ct = val if isinstance(ct, themes.AnsiColorTheme) and ct.prompt(""): - ## ^A and ^B delimit invisible caracters for readline to count right. + ## ^A and ^B delimit invisible characters for readline to count right. ## And we need ct.prompt() to do change something or else ^A and ^B will be ## displayed prompt = "\001%s\002" % ct.prompt("\002"+prompt+"\001") @@ -293,7 +293,7 @@ def _prompt_changer(attr,val): sys.ps1 = prompt class Conf(ConfClass): - """This object contains the configuration of scapy. + """This object contains the configuration of Scapy. session : filename where the session will be saved interactive_shell : If set to "ipython", use IPython as shell. Default: Python stealth : if 1, prevents any unwanted packet to go out (ARP, DNS, ...) @@ -308,13 +308,13 @@ promisc : default mode for listening socket (to get answers if you spoof on a l sniff_promisc : default mode for sniff() filter : bpf filter added to every sniffing socket to exclude traffic from analysis histfile : history file -padding : includes padding in desassembled packets +padding : includes padding in disassembled packets except_filter : BPF filter for packets to ignore debug_match : when 1, store received packet that are not matched into debug.recv route : holds the Scapy routing table and provides methods to manipulate it warning_threshold : how much time between warnings from the same place ASN1_default_codec: Codec used by default for ASN1 objects -mib : holds MIB direct access dictionnary +mib : holds MIB direct access dictionary resolve : holds list of fields for which resolution should be done noenum : holds list of enum fields for which conversion to string should NOT be done AS_resolver: choose the AS resolver class to use @@ -390,7 +390,7 @@ contribs: a dict which can be used by contrib layers to store local configuratio if not Conf.ipv6_enabled: - log_scapy.warning("IPv6 support disabled in Python. Cannot load scapy IPv6 layers.") + log_scapy.warning("IPv6 support disabled in Python. Cannot load Scapy IPv6 layers.") for m in ["inet6","dhcp6"]: if m in Conf.load_layers: Conf.load_layers.remove(m) diff --git a/scapy/contrib/gsm_um.py b/scapy/contrib/gsm_um.py index 36b6a411..c1f919e0 100644 --- a/scapy/contrib/gsm_um.py +++ b/scapy/contrib/gsm_um.py @@ -9888,7 +9888,7 @@ class MultiRateConfiguration(Packet): """ MultiRate configuration Section 10.5.2.21aa""" name = "MultiRate Configuration" # This packet has a variable length and hence structure. This packet - # implements the longuest possible packet. If you biuild a shorter + # implements the longest possible packet. If you build a shorter # packet, for example having only 6 bytes, the last 4 bytes are named # "Spare" in the specs. Here they are named "threshold2" fields_desc = [ diff --git a/scapy/contrib/igmp.py b/scapy/contrib/igmp.py index fe7b225b..705e0de5 100644 --- a/scapy/contrib/igmp.py +++ b/scapy/contrib/igmp.py @@ -78,7 +78,7 @@ IGMPv2 message format http://www.faqs.org/rfcs/rfc2236.html #-------------------------------------------------------------------------- def igmpize(self, ip=None, ether=None): - """Called to explicitely fixup associated IP and Ethernet headers + """Called to explicitly fixup associated IP and Ethernet headers Parameters: self The instantiation of an IGMP class. @@ -110,7 +110,7 @@ IGMPv2 message format http://www.faqs.org/rfcs/rfc2236.html #-------------------------------------------------------------------------- def adjust_ether (self, ip=None, ether=None): - """Called to explicitely fixup an associated Ethernet header + """Called to explicitly fixup an associated Ethernet header The function adjusts the ethernet header destination MAC address based on the destination IP address. @@ -127,7 +127,7 @@ IGMPv2 message format http://www.faqs.org/rfcs/rfc2236.html #-------------------------------------------------------------------------- def adjust_ip (self, ip=None): - """Called to explicitely fixup an associated IP header + """Called to explicitly fixup an associated IP header The function adjusts the IP header based on conformance rules and the group address encoded in the IGMP message. diff --git a/scapy/contrib/igmpv3.py b/scapy/contrib/igmpv3.py index dd41f992..e7037291 100644 --- a/scapy/contrib/igmpv3.py +++ b/scapy/contrib/igmpv3.py @@ -170,7 +170,7 @@ class IGMPv3(Packet): #-------------------------------------------------------------------------- def igmpize(self, ip=None, ether=None): - """Called to explicitely fixup associated IP and Ethernet headers + """Called to explicitly fixup associated IP and Ethernet headers Parameters: self The instantiation of an IGMP class. @@ -208,7 +208,7 @@ class IGMPv3(Packet): #-------------------------------------------------------------------------- def adjust_ether (self, ip=None, ether=None): - """Called to explicitely fixup an associated Ethernet header + """Called to explicitly fixup an associated Ethernet header The function adjusts the ethernet header destination MAC address based on the destination IP address. @@ -225,7 +225,7 @@ class IGMPv3(Packet): #-------------------------------------------------------------------------- def adjust_ip (self, ip=None): - """Called to explicitely fixup an associated IP header + """Called to explicitly fixup an associated IP header The function adjusts the IP header based on conformance rules and the group address encoded in the IGMP message. diff --git a/scapy/contrib/isis.py b/scapy/contrib/isis.py index c37dd163..8f951e14 100644 --- a/scapy/contrib/isis.py +++ b/scapy/contrib/isis.py @@ -29,7 +29,7 @@ * RFC 1195 (only the TCP/IP related part) * RFC 3358 (optional checksums) * RFC 5301 (dynamic hostname extension) - * RFC 5302 (domain-wide prefix destribution) + * RFC 5302 (domain-wide prefix distribution) * RFC 5303 (three-way handshake) * RFC 5304 (cryptographic authentication) * RFC 5308 (routing IPv6 with IS-IS) diff --git a/scapy/contrib/pnio_rtc.py b/scapy/contrib/pnio_rtc.py index 6bd99d77..026b6e0f 100644 --- a/scapy/contrib/pnio_rtc.py +++ b/scapy/contrib/pnio_rtc.py @@ -244,7 +244,7 @@ class PNIORealTime(Packet): @staticmethod def find_data(packets): """Analyse a packet list to extract data offsets from packets data.""" - # a dictionnary to count data offsets (ie != 0x80) + # a dictionary to count data offsets (ie != 0x80) # It's formatted: {(src, dst): (total, [count for offset in len])} heuristic = {} diff --git a/scapy/dadict.py b/scapy/dadict.py index 62addb31..96c8faab 100644 --- a/scapy/dadict.py +++ b/scapy/dadict.py @@ -10,7 +10,7 @@ Direct Access dictionary. from scapy.error import Scapy_Exception ############################### -## Direct Access dictionnary ## +## Direct Access dictionary ## ############################### def fixname(x): diff --git a/scapy/error.py b/scapy/error.py index c5b43bfd..ac9bfa65 100644 --- a/scapy/error.py +++ b/scapy/error.py @@ -58,7 +58,7 @@ log_scapy.addHandler(NullHandler()) log_runtime = logging.getLogger("scapy.runtime") # logs at runtime log_runtime.addFilter(ScapyFreqFilter()) log_interactive = logging.getLogger("scapy.interactive") # logs in interactive functions -log_loading = logging.getLogger("scapy.loading") # logs when loading scapy +log_loading = logging.getLogger("scapy.loading") # logs when loading Scapy def warning(x): diff --git a/scapy/fields.py b/scapy/fields.py index 336eca95..4299827b 100644 --- a/scapy/fields.py +++ b/scapy/fields.py @@ -153,7 +153,7 @@ class ConditionalField(object): class PadField(object): """Add bytes after the proxified field so that it ends at the specified - alignment from its begining""" + alignment from its beginning""" __slots__ = ["_fld", "_align", "_padwith"] def __init__(self, fld, align, padwith=None): self._fld = fld diff --git a/scapy/layers/dhcp6.py b/scapy/layers/dhcp6.py index d214cc0e..4cb92910 100644 --- a/scapy/layers/dhcp6.py +++ b/scapy/layers/dhcp6.py @@ -211,7 +211,7 @@ class DUID_LLT(Packet): # sect 9.2 RFC 3315 _LLAddrField("lladdr", ETHER_ANY) ] # In fact, IANA enterprise-numbers file available at -# http//www.iana.org/asignments/enterprise-numbers) +# http://www.iana.org/assignments/enterprise-numbers # is simply huge (more than 2Mo and 600Ko in bz2). I'll # add only most common vendors, and encountered values. # -- arno @@ -943,7 +943,7 @@ class DHCP6_Advertise(DHCP6): # - When the server receives a Request message via unicast from a # client to which the server has not sent a unicast option, the server # discards the Request message and responds with a Reply message -# containinig Status Code option with the value UseMulticast, a Server +# containing Status Code option with the value UseMulticast, a Server # Identifier Option containing the server's DUID, the client # Identifier option from the client message and no other option. @@ -954,7 +954,7 @@ class DHCP6_Request(DHCP6): ##################################################################### # Confirm Message # - sent by clients -# - must include a clien identifier option +# - must include a client identifier option # - When the server receives a Confirm Message, the server determines # whether the addresses in the Confirm message are appropriate for the # link to which the client is attached. cf p50 diff --git a/scapy/main.py b/scapy/main.py index c5882637..cea40f24 100644 --- a/scapy/main.py +++ b/scapy/main.py @@ -189,7 +189,7 @@ def scapy_write_history_file(readline): readline.write_history_file(tmp) warning("Wrote history to [%s]" % tmp) except: - warning("Cound not write history to [%s]. Discarded" % tmp) + warning("Could not write history to [%s]. Discarded" % tmp) def interact(mydict=None,argv=None,mybanner=None,loglevel=20): diff --git a/scapy/packet.py b/scapy/packet.py index f1a43bee..fba95693 100644 --- a/scapy/packet.py +++ b/scapy/packet.py @@ -840,7 +840,7 @@ Creates an EPS file describing a packet. If filename is not provided a temporary def _show_or_dump(self, dump=False, indent=3, lvl="", label_lvl="", first_call=True): """ - Internal method that shows or dumps a hierachical view of a packet. + Internal method that shows or dumps a hierarchical view of a packet. Called by show. """ @@ -907,10 +907,10 @@ Special case : "%.time%" is the creation time. Ex : p.sprintf("%.time% %-15s,IP.src% -> %-15s,IP.dst% %IP.chksum% " "%03xr,IP.proto% %r,TCP.flags%") -Moreover, the format string can include conditionnal statements. A conditionnal +Moreover, the format string can include conditional statements. A conditional statement looks like : {layer:string} where layer is a layer name, and string is the string to insert in place of the condition if it is true, i.e. if layer -is present. If layer is preceded by a "!", the result si inverted. Conditions +is present. If layer is preceded by a "!", the result is inverted. Conditions can be imbricated. A valid statement can be : p.sprintf("This is a{TCP: TCP}{UDP: UDP}{ICMP:n ICMP} packet") p.sprintf("{IP:%IP.dst% {ICMP:%ICMP.type%}{TCP:%TCP.dport%}}") diff --git a/scapy/plist.py b/scapy/plist.py index 32fc712d..ea9464c5 100644 --- a/scapy/plist.py +++ b/scapy/plist.py @@ -125,7 +125,7 @@ lfilter: truth function to apply to each packet to decide whether it will be dis return self.__class__(filter(func,self.res), name="filtered %s"%self.listname) def make_table(self, *args, **kargs): - """Prints a table using a function that returs for each packet its head column value, head row value and displayed value + """Prints a table using a function that returns for each packet its head column value, head row value and displayed value ex: p.make_table(lambda x:(x[IP].dst, x[TCP].dport, x[TCP].sprintf("%flags%")) """ return make_table(self.res, *args, **kargs) def make_lined_table(self, *args, **kargs): @@ -139,7 +139,7 @@ lfilter: truth function to apply to each packet to decide whether it will be dis """Applies a function to each packet to get a value that will be plotted with matplotlib. A list of matplotlib.lines.Line2D is returned. - lfilter: a truth function that decides whether a packet must be ploted + lfilter: a truth function that decides whether a packet must be plotted """ # Get the list of packets @@ -422,7 +422,7 @@ lfilter: truth function to apply to each packet to decide whether it will be dis def psdump(self, filename = None, **kargs): - """Creates a multipage poscript file with a psdump of every packet + """Creates a multi-page postcript file with a psdump of every packet filename: name of the file to write to. If empty, a temporary file is used and conf.prog.psreader is called""" d = self._dump_document(**kargs) diff --git a/scapy/pton_ntop.py b/scapy/pton_ntop.py index ce93b676..19f64afb 100644 --- a/scapy/pton_ntop.py +++ b/scapy/pton_ntop.py @@ -61,7 +61,7 @@ def inet_pton(af, addr): def inet_ntop(af, addr): - """Convert an IP address from binary form into text represenation""" + """Convert an IP address from binary form into text representation""" if af == socket.AF_INET: return socket.inet_ntoa(addr) elif af == socket.AF_INET6: diff --git a/scapy/sendrecv.py b/scapy/sendrecv.py index 516262c8..cf109f33 100644 --- a/scapy/sendrecv.py +++ b/scapy/sendrecv.py @@ -283,7 +283,7 @@ def sendpfast(x, pps=None, mbps=None, realtime=None, loop=0, file_cache=False, i """Send packets at layer 2 using tcpreplay for performance pps: packets per second mpbs: MBits per second - realtime: use packet's timestamp, bending time with realtime value + realtime: use packet's timestamp, bending time with real-time value loop: number of times to process the packet list file_cache: cache packets in RAM instead of reading from disk at each iteration iface: output interface """ @@ -323,7 +323,7 @@ def sendpfast(x, pps=None, mbps=None, realtime=None, loop=0, file_cache=False, i @conf.commands.register def sr(x,filter=None, iface=None, nofilter=0, *args,**kargs): """Send and receive packets at layer 3 -nofilter: put 1 to avoid use of bpf filters +nofilter: put 1 to avoid use of BPF filters retry: if positive, how many times to resend unanswered packets if negative, how many times to retry when no more packets are answered timeout: how much time to wait after the last packet has been sent @@ -341,7 +341,7 @@ iface: listen answers only on the given interface""" @conf.commands.register def sr1(x,filter=None,iface=None, nofilter=0, *args,**kargs): """Send packets at layer 3 and return only the first answer -nofilter: put 1 to avoid use of bpf filters +nofilter: put 1 to avoid use of BPF filters retry: if positive, how many times to resend unanswered packets if negative, how many times to retry when no more packets are answered timeout: how much time to wait after the last packet has been sent @@ -362,7 +362,7 @@ iface: listen answers only on the given interface""" @conf.commands.register def srp(x,iface=None, iface_hint=None, filter=None, nofilter=0, type=ETH_P_ALL, *args,**kargs): """Send and receive packets at layer 2 -nofilter: put 1 to avoid use of bpf filters +nofilter: put 1 to avoid use of BPF filters retry: if positive, how many times to resend unanswered packets if negative, how many times to retry when no more packets are answered timeout: how much time to wait after the last packet has been sent @@ -382,7 +382,7 @@ iface: work only on the given interface""" @conf.commands.register def srp1(*args,**kargs): """Send and receive packets at layer 2 and return only the first answer -nofilter: put 1 to avoid use of bpf filters +nofilter: put 1 to avoid use of BPF filters retry: if positive, how many times to resend unanswered packets if negative, how many times to retry when no more packets are answered timeout: how much time to wait after the last packet has been sent @@ -521,7 +521,7 @@ def srflood(x,filter=None, iface=None, nofilter=None, *args,**kargs): prn: function applied to packets received. Ret val is printed if not None store: if 1 (default), store answers and return them unique: only consider packets whose print -nofilter: put 1 to avoid use of bpf filters +nofilter: put 1 to avoid use of BPF filters filter: provide a BPF filter iface: listen answers only on the given interface""" s = conf.L3socket(filter=filter, iface=iface, nofilter=nofilter) @@ -535,7 +535,7 @@ def srpflood(x,filter=None, iface=None, iface_hint=None, nofilter=None, *args,** prn: function applied to packets received. Ret val is printed if not None store: if 1 (default), store answers and return them unique: only consider packets whose print -nofilter: put 1 to avoid use of bpf filters +nofilter: put 1 to avoid use of BPF filters filter: provide a BPF filter iface: listen answers only on the given interface""" if iface is None and iface_hint is not None: diff --git a/scapy/supersocket.py b/scapy/supersocket.py index 3fd0fef5..4dd7d3b8 100644 --- a/scapy/supersocket.py +++ b/scapy/supersocket.py @@ -108,7 +108,7 @@ class L3RawSocket(SuperSocket): log_runtime.error(msg) class SimpleSocket(SuperSocket): - desc = "wrapper arround a classic socket" + desc = "wrapper around a classic socket" def __init__(self, sock): self.ins = sock self.outs = sock diff --git a/scapy/themes.py b/scapy/themes.py index a0529d70..a814159b 100644 --- a/scapy/themes.py +++ b/scapy/themes.py @@ -267,7 +267,7 @@ class ColorPrompt: from scapy import config ct = config.conf.color_theme if isinstance(ct, AnsiColorTheme): - ## ^A and ^B delimit invisible caracters for readline to count right + ## ^A and ^B delimit invisible characters for readline to count right return "\001%s\002" % ct.prompt("\002"+config.conf.prompt+"\001") else: return ct.prompt(config.conf.prompt) diff --git a/scapy/tools/UTscapy.py b/scapy/tools/UTscapy.py index a63328c5..15488d09 100755 --- a/scapy/tools/UTscapy.py +++ b/scapy/tools/UTscapy.py @@ -202,7 +202,7 @@ def parse_campaign_file(campaign_file): else: if test is None: if l.strip(): - print >>sys.stderr, "Unkonwn content [%s]" % l.strip() + print >>sys.stderr, "Unknown content [%s]" % l.strip() else: test.test += l return test_campaign diff --git a/scapy/utils.py b/scapy/utils.py index 4a92e625..d70b7c3d 100644 --- a/scapy/utils.py +++ b/scapy/utils.py @@ -299,7 +299,7 @@ def str2mac(s): def strxor(x,y): return "".join(map(lambda x,y:chr(ord(x)^ord(y)),x,y)) -# Workarround bug 643005 : https://sourceforge.net/tracker/?func=detail&atid=105470&aid=643005&group_id=5470 +# Workaround bug 643005 : https://sourceforge.net/tracker/?func=detail&atid=105470&aid=643005&group_id=5470 try: socket.inet_aton("255.255.255.255") except socket.error: @@ -651,7 +651,7 @@ class RawPcapReader: def dispatch(self, callback): """call the specified callback routine for each packet read - This is just a convienience function for the main loop + This is just a convenience function for the main loop that allows for easy launching of packet processing in a thread. """ @@ -826,7 +826,7 @@ class RawPcapWriter: filename: the name of the file to write packets to, or an open, writable file-like object. linktype: force linktype to a given value. If None, linktype is taken - from the first writter packet + from the first writer packet gz: compress the capture on the fly endianness: force an endianness (little:"<", big:">"). Default is native append: append packets to the capture file instead of truncating it diff --git a/scapy/utils6.py b/scapy/utils6.py index eb4ecb5a..1298544c 100644 --- a/scapy/utils6.py +++ b/scapy/utils6.py @@ -170,7 +170,7 @@ def find_ifaddr2(addr, plen, laddr): if l == 1: # Only one address for our scope return sameScope[0][1] - elif l > 1: # Muliple addresses for our scope + elif l > 1: # Multiple addresses for our scope stfAddr = filter(lambda x: x[0] & IPV6_ADDR_6TO4, sameScope) nativeAddr = filter(lambda x: not (x[0] & IPV6_ADDR_6TO4), sameScope) @@ -360,8 +360,8 @@ def in6_get6to4Prefix(addr): def in6_6to4ExtractAddr(addr): """ - Extract IPv4 address embbeded in 6to4 address. Passed address must be - a 6to4 addrees. None is returned on error. + Extract IPv4 address embedded in 6to4 address. Passed address must be + a 6to4 address. None is returned on error. """ try: addr = inet_pton(socket.AF_INET6, addr) @@ -375,7 +375,7 @@ def in6_6to4ExtractAddr(addr): def in6_getLocalUniquePrefix(): """ Returns a pseudo-randomly generated Local Unique prefix. Function - follows recommandation of Section 3.2.2 of RFC 4193 for prefix + follows recommendation of Section 3.2.2 of RFC 4193 for prefix generation. """ # Extracted from RFC 1305 (NTP) : @@ -730,7 +730,7 @@ def in6_ismgladdr(str): def in6_ismlladdr(str): """ - Returns True if address balongs to link-local multicast address + Returns True if address belongs to link-local multicast address space (ff02::/16) """ return in6_isincluded(str, 'ff02::', 16) diff --git a/scapy/volatile.py b/scapy/volatile.py index f59e9ecf..116bf860 100644 --- a/scapy/volatile.py +++ b/scapy/volatile.py @@ -656,7 +656,7 @@ class GeneralizedTime(AutoTime): class DelayedEval(VolatileValue): - """ Exemple of usage: DelayedEval("time.time()") """ + """ Example of usage: DelayedEval("time.time()") """ def __init__(self, expr): self.expr = expr def _fix(self): -- GitLab