Skip to content

Commit

Permalink
Merge pull request #348 from guedou/typos
Browse files Browse the repository at this point in the history
Python files spell checked
  • Loading branch information
p-l- authored Nov 16, 2016
2 parents a6e4ab2 + ed95a6a commit c6e1e6c
Show file tree
Hide file tree
Showing 25 changed files with 51 additions and 51 deletions.
2 changes: 1 addition & 1 deletion scapy/ansmachine.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ def reply(self, pkt):
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):
Expand Down
2 changes: 1 addition & 1 deletion scapy/arch/unix.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion scapy/autorun.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion scapy/base_classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ class BasePacket(Gen):


#############################
## Packet list base classe ##
## Packet list base class ##
#############################

class BasePacketList(object):
Expand Down
10 changes: 5 additions & 5 deletions scapy/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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, ...)
Expand All @@ -308,13 +308,13 @@ class Conf(ConfClass):
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
Expand Down Expand Up @@ -390,7 +390,7 @@ class Conf(ConfClass):


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)
Expand Down
2 changes: 1 addition & 1 deletion scapy/contrib/gsm_um.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand Down
6 changes: 3 additions & 3 deletions scapy/contrib/igmp.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def mysummary(self):

#--------------------------------------------------------------------------
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.
Expand Down Expand Up @@ -110,7 +110,7 @@ def igmpize(self, ip=None, ether=None):

#--------------------------------------------------------------------------
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.
Expand All @@ -127,7 +127,7 @@ def adjust_ether (self, ip=None, ether=None):

#--------------------------------------------------------------------------
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.
Expand Down
6 changes: 3 additions & 3 deletions scapy/contrib/igmpv3.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ def mysummary(self):

#--------------------------------------------------------------------------
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.
Expand Down Expand Up @@ -208,7 +208,7 @@ def igmpize(self, ip=None, ether=None):

#--------------------------------------------------------------------------
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.
Expand All @@ -225,7 +225,7 @@ def adjust_ether (self, ip=None, ether=None):

#--------------------------------------------------------------------------
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.
Expand Down
2 changes: 1 addition & 1 deletion scapy/contrib/isis.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion scapy/contrib/pnio_rtc.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ def analyse_data(packets):
@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 = {}

Expand Down
2 changes: 1 addition & 1 deletion scapy/dadict.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from scapy.error import Scapy_Exception

###############################
## Direct Access dictionnary ##
## Direct Access dictionary ##
###############################

def fixname(x):
Expand Down
2 changes: 1 addition & 1 deletion scapy/error.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def emit(self, record):
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):
Expand Down
2 changes: 1 addition & 1 deletion scapy/fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ def __getattr__(self, attr):

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
Expand Down
6 changes: 3 additions & 3 deletions scapy/layers/dhcp6.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -943,7 +943,7 @@ def answers(self, other):
# - 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.

Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion scapy/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
6 changes: 3 additions & 3 deletions scapy/packet.py
Original file line number Diff line number Diff line change
Expand Up @@ -840,7 +840,7 @@ def display(self,*args,**kargs): # Deprecated. Use show()

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.
"""

Expand Down Expand Up @@ -907,10 +907,10 @@ def sprintf(self, fmt, relax=1):
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%}}")
Expand Down
6 changes: 3 additions & 3 deletions scapy/plist.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ def filter(self, func):
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):
Expand All @@ -139,7 +139,7 @@ def plot(self, f, lfilter=None, plot_xy=False, **kargs):
"""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
Expand Down Expand Up @@ -422,7 +422,7 @@ def _dump_document(self, **kargs):


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)
Expand Down
2 changes: 1 addition & 1 deletion scapy/pton_ntop.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
14 changes: 7 additions & 7 deletions scapy/sendrecv.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 """
Expand Down Expand Up @@ -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
Expand All @@ -341,7 +341,7 @@ def sr(x,filter=None, iface=None, nofilter=0, *args,**kargs):
@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
Expand All @@ -362,7 +362,7 @@ def sr1(x,filter=None,iface=None, nofilter=0, *args,**kargs):
@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
Expand All @@ -382,7 +382,7 @@ def srp(x,iface=None, iface_hint=None, filter=None, nofilter=0, type=ETH_P_ALL,
@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
Expand Down Expand Up @@ -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)
Expand All @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion scapy/supersocket.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ def send(self, x):
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
Expand Down
2 changes: 1 addition & 1 deletion scapy/themes.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ def __str__(self):
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)
Expand Down
2 changes: 1 addition & 1 deletion scapy/tools/UTscapy.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions scapy/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -651,7 +651,7 @@ def read_packet(self, size=MTU):
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.
"""
Expand Down Expand Up @@ -826,7 +826,7 @@ def __init__(self, filename, linktype=None, gz=False, endianness="", append=Fals
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
Expand Down
Loading

0 comments on commit c6e1e6c

Please sign in to comment.