Skip to content

Commit

Permalink
Fix typos (#620)
Browse files Browse the repository at this point in the history
  • Loading branch information
rex4539 committed Jan 4, 2022
1 parent 21094a1 commit 7a91ae5
Show file tree
Hide file tree
Showing 13 changed files with 20 additions and 20 deletions.
4 changes: 2 additions & 2 deletions dpkt/aoe.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def test_creation():

def test_properties():
aoe = AOE()
# propery getters
# property getters
assert aoe.ver == 1
assert aoe.fl == 0

Expand All @@ -113,7 +113,7 @@ def test_unpack():
'00000000' # tag
)
aoe = AOE(buf)
# AOE_CMD_ATA speficied, but no data supplied
# AOE_CMD_ATA specified, but no data supplied
assert aoe.data == b''

buf = unhexlify(
Expand Down
2 changes: 1 addition & 1 deletion dpkt/diameter.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

# Request/Answer Command Codes
ABORT_SESSION = 274
ACCOUTING = 271
ACCOUNTING = 271
CAPABILITIES_EXCHANGE = 257
DEVICE_WATCHDOG = 280
DISCONNECT_PEER = 282
Expand Down
2 changes: 1 addition & 1 deletion dpkt/dpkt.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ def __iter__(self):
return iter((fld, getattr(self, fld)) for fld in self.__class__.__hdr_fields__)

def __getitem__(self, kls):
"""Return the 1st occurence of the underlying <kls> data layer, raise KeyError otherwise."""
"""Return the 1st occurrence of the underlying <kls> data layer, raise KeyError otherwise."""
dd = self.data
while isinstance(dd, Packet):
if dd.__class__ == kls:
Expand Down
2 changes: 1 addition & 1 deletion dpkt/gre.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ def unpack(self, buf):
self.data = ethernet.Ethernet._typesw[self.p](self.data)
setattr(self, self.data.__class__.__name__.lower(), self.data)
except (KeyError, dpkt.UnpackError):
# data alrady set
# data already set
pass

def __len__(self):
Expand Down
4 changes: 2 additions & 2 deletions dpkt/icmp6.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
ICMP6_MEMBERSHIP_REDUCTION = 132 # group membership termination

ND_ROUTER_SOLICIT = 133 # router solicitation
ND_ROUTER_ADVERT = 134 # router advertisment
ND_ROUTER_ADVERT = 134 # router advertisement
ND_NEIGHBOR_SOLICIT = 135 # neighbor solicitation
ND_NEIGHBOR_ADVERT = 136 # neighbor advertisment
ND_NEIGHBOR_ADVERT = 136 # neighbor advertisement
ND_REDIRECT = 137 # redirect

ICMP6_ROUTER_RENUMBERING = 138 # router renumbering
Expand Down
2 changes: 1 addition & 1 deletion dpkt/ip.py
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ def test_dict():
assert (d['p'] == 17)


def test_hl(): # Todo chack this test method
def test_hl(): # Todo check this test method
s = (b'BB\x03\x00\x00\x00\x00\x00\x00\x00\xd0\x00\xec\xbc\xa5\x00\x00\x00\x03\x80\x00\x00\xd0'
b'\x01\xf2\xac\xa5"0\x01\x00\x14\x00\x02\x00\x0f\x00\x00\x00\x00\x00\x00\x00\x00\x00')
try:
Expand Down
4 changes: 2 additions & 2 deletions dpkt/ip6.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ class IP6ExtensionHeader(dpkt.Packet):
class IP6OptsHeader(IP6ExtensionHeader):
__hdr__ = (
('nxt', 'B', 0), # next extension header protocol
('len', 'B', 0) # option data length in 8 octect units (ignoring first 8 octets) so, len 0 == 64bit header
('len', 'B', 0) # option data length in 8 octet units (ignoring first 8 octets) so, len 0 == 64bit header
)

def unpack(self, buf):
Expand Down Expand Up @@ -203,7 +203,7 @@ class IP6DstOptsHeader(IP6OptsHeader):
class IP6RoutingHeader(IP6ExtensionHeader):
__hdr__ = (
('nxt', 'B', 0), # next extension header protocol
('len', 'B', 0), # extension data length in 8 octect units (ignoring first 8 octets) (<= 46 for type 0)
('len', 'B', 0), # extension data length in 8 octet units (ignoring first 8 octets) (<= 46 for type 0)
('type', 'B', 0), # routing type (currently, only 0 is used)
('segs_left', 'B', 0), # remaining segments in route, until destination (<= 23)
('_rsvd_sl_bits', 'I', 0)
Expand Down
4 changes: 2 additions & 2 deletions dpkt/netbios.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def encode_name(name):
Each 4-bit, half-octet of the NetBIOS name is treated as an 8-bit,
right-adjusted, zero-filled binary number. This number is added to
value of the ASCII character 'A' (hexidecimal 41). The resulting 8-
value of the ASCII character 'A' (hexadecimal 41). The resulting 8-
bit number is stored in the appropriate byte. The following diagram
demonstrates this procedure:
Expand Down Expand Up @@ -61,7 +61,7 @@ def encode_name(name):
The NetBIOS scope identifier is a valid domain name (without a
leading dot).
An ASCII dot (2E hexidecimal) and the scope identifier are appended
An ASCII dot (2E hexadecimal) and the scope identifier are appended
to the encoded form of the NetBIOS name, the result forming a valid
domain name.
"""
Expand Down
2 changes: 1 addition & 1 deletion dpkt/pcap.py
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,7 @@ class WriterTestWrap:
"""
Decorate a writer test function with an instance of this class.
The test will be provided with a writer object, which it shoud write some pkts to.
The test will be provided with a writer object, which it should write some pkts to.
After the test has run, the BytesIO object will be passed to a Reader,
which will compare each pkt to the return value of the test.
Expand Down
2 changes: 1 addition & 1 deletion dpkt/pcapng.py
Original file line number Diff line number Diff line change
Expand Up @@ -911,7 +911,7 @@ class WriterTestWrap:
"""
Decorate a writer test function with an instance of this class.
The test will be provided with a writer object, which it shoud write some pkts to.
The test will be provided with a writer object, which it should write some pkts to.
After the test has run, the BytesIO object will be passed to a Reader,
which will compare each pkt to the return value of the test.
Expand Down
4 changes: 2 additions & 2 deletions dpkt/ssl.py
Original file line number Diff line number Diff line change
Expand Up @@ -636,7 +636,7 @@ def setup_class(cls):
# cipher suites
b"005200ffc00ac0140088008700390038c00fc00500840035c007c009c011c0130045004400330032"
b"c00cc00ec002c0040096004100050004002fc008c01200160013c00dc003000ac006c010c00bc00100020001"
b"0100" # compresssion methods
b"0100" # compression methods
# extensions
b"00fc0000000e000c0000096c6f63616c686f7374000a00080006001700180019000b000201000023"
b"00d0a50b2e9f618a9ea9bf493ef49b421835cd2f6b05bbe1179d8edf70d58c33d656e8696d36d7e7"
Expand Down Expand Up @@ -993,7 +993,7 @@ def test_extensions():
b"20b3330000ab415e3356226b305993bfb76b2d50bfaeb5298549723b594c999479" # session id
# cipher suites
b"0026c02cc02bc030c02fc024c023c028c027c00ac009c014c013009d009c003d003c0035002f000a"
b"0100" # compresssion methods
b"0100" # compression methods
# extensions
b"006d00000023002100001e73656c662e6576656e74732e646174612e6d6963726f736f66742e636f"
b"6d000500050100000000000a00080006001d00170018000b00020100000d001a0018080408050806"
Expand Down
2 changes: 1 addition & 1 deletion dpkt/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def test_utils():
ipv6_inet = b' \x01\r\xb8\x85\xa3\x00\x00\x00\x00\x8a.\x03ps4'
assert inet_to_str(ipv6_inet) == '2001:db8:85a3::8a2e:370:7334'

# Test the make_dict method with a DNS reponse packet
# Test the make_dict method with a DNS response packet
a_resp = unhexlify("059c8180000100010000000106676f6f676c6503636f6d0000010001c00c00010"
"0010000012b0004d83ace2e0000290200000000000000")
my_dns = DNS(a_resp)
Expand Down
6 changes: 3 additions & 3 deletions examples/print_dns_truncated.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""
Use DPKT to read in a pcap file and print out the contents of trucated
DNS packets. This example show how to read/handle trucated packets
Use DPKT to read in a pcap file and print out the contents of truncated
DNS packets. This example show how to read/handle truncated packets
"""
import sys
import dpkt
Expand Down Expand Up @@ -48,7 +48,7 @@ def print_packet(buf):
print('UDP: sport={:d} dport={:d} sum={:d} ulen={:d}'.format(udp.sport, udp.dport,
udp.sum, udp.ulen))

# Now see if we can parse the contents of the trucated DNS request
# Now see if we can parse the contents of the truncated DNS request
try:
dns = dpkt.dns.DNS()
dns.unpack(udp.data)
Expand Down

0 comments on commit 7a91ae5

Please sign in to comment.