Skip to content

Commit ef72e1d

Browse files
JulienPalardguedou
authored andcommitted
Spotted some old prints in the documentation.
1 parent 13621d1 commit ef72e1d

File tree

5 files changed

+17
-17
lines changed

5 files changed

+17
-17
lines changed

doc/scapy/development.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ The generic format for a test campaign is shown in the following table::
120120
* Comments for unit test 1
121121
# Python statements follow
122122
a = 1
123-
print a
123+
print(a)
124124
a == 1
125125

126126

@@ -196,7 +196,7 @@ Table 5 shows a simple test campaign with multiple tests set definitions. Additi
196196
= Unit Test 1
197197
~ test_set_1 simple
198198
a = 1
199-
print a
199+
print(a)
200200

201201
= Unit test 2
202202
~ test_set_1 simple
@@ -234,7 +234,7 @@ Table 5 shows a simple test campaign with multiple tests set definitions. Additi
234234

235235
= Unit Test 6
236236
~ test_set_2 hardest
237-
print e
237+
print(e)
238238
e == 1296
239239

240240
To see an example that is targeted to Scapy, go to http://www.secdev.org/projects/UTscapy. Cut and paste the example at the bottom of the page to the file ``demo_campaign.txt`` and run UTScapy against it::

doc/scapy/usage.rst

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -502,8 +502,8 @@ A TCP traceroute::
502502
***......
503503
Received 33 packets, got 21 answers, remaining 1 packets
504504
>>> for snd,rcv in ans:
505-
... print snd.ttl, rcv.src, isinstance(rcv.payload, TCP)
506-
...
505+
... print(snd.ttl, rcv.src, isinstance(rcv.payload, TCP))
506+
...
507507
5 194.51.159.65 0
508508
6 194.51.159.49 0
509509
4 194.250.107.181 0
@@ -1644,7 +1644,7 @@ In this case we got 2 replies, so there were two active DHCP servers on the test
16441644

16451645
We are only interested in the MAC and IP addresses of the replies:
16461646

1647-
>>> for p in ans: print p[1][Ether].src, p[1][IP].src
1647+
>>> for p in ans: print(p[1][Ether].src, p[1][IP].src)
16481648
...
16491649
00:de:ad:be:ef:00 192.168.1.1
16501650
00:11:11:22:22:33 192.168.1.11
@@ -1670,16 +1670,16 @@ Firewalking
16701670
TTL decrementation after a filtering operation
16711671
only not filtered packets generate an ICMP TTL exceeded
16721672

1673-
>>> ans, unans = sr(IP(dst="172.16.4.27", ttl=16)/TCP(dport=(1,1024)))
1674-
>>> for s,r in ans:
1675-
if r.haslayer(ICMP) and r.payload.type == 11:
1676-
print s.dport
1673+
>>> ans, unans = sr(IP(dst="172.16.4.27", ttl=16)/TCP(dport=(1,1024)))
1674+
>>> for s,r in ans:
1675+
... if r.haslayer(ICMP) and r.payload.type == 11:
1676+
... print(s.dport)
16771677

16781678
Find subnets on a multi-NIC firewall
16791679
only his own NIC’s IP are reachable with this TTL::
16801680

1681-
>>> ans, unans = sr(IP(dst="172.16.5/24", ttl=15)/TCP())
1682-
>>> for i in unans: print i.dst
1681+
>>> ans, unans = sr(IP(dst="172.16.5/24", ttl=15)/TCP())
1682+
>>> for i in unans: print(i.dst)
16831683

16841684

16851685
TCP Timestamp Filtering

scapy/contrib/ppi_geotag.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ def any2i(self, pkt, x):
198198
pass
199199
else:
200200
y = x
201-
# print "any2i: %s --> %s" % (str(x), str(y))
201+
# print("any2i: %s --> %s" % (str(x), str(y)))
202202
return y
203203

204204

scapy/layers/dot15d4.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ def lengthFromAddrMode(self, pkt, x):
9191
if pkttop.underlayer is None:
9292
break
9393
pkttop = pkttop.underlayer
94-
# print "Underlayer field value of", x, "is", addrmode
94+
# print("Underlayer field value of", x, "is", addrmode)
9595
if addrmode == 2:
9696
return 2
9797
elif addrmode == 3:

scapy/layers/sctp.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,13 +124,13 @@ def crc32c(buf):
124124
def update_adler32(adler, buf):
125125
s1 = adler & 0xffff
126126
s2 = (adler >> 16) & 0xffff
127-
print s1,s2
127+
print(s1, s2)
128128
129129
for c in buf:
130-
print orb(c)
130+
print(orb(c))
131131
s1 = (s1 + orb(c)) % BASE
132132
s2 = (s2 + s1) % BASE
133-
print s1,s2
133+
print(s1, s2)
134134
return (s2 << 16) + s1
135135
136136
def sctp_checksum(buf):

0 commit comments

Comments
 (0)