|
20 | 20 | import time |
21 | 21 | from multiprocessing import Process, Queue |
22 | 22 |
|
23 | | -# pyre-fixme[21]: Could not find name `ARP` in `scapy.all`. |
24 | | -# pyre-fixme[21]: Could not find name `Ether` in `scapy.all`. |
25 | | -# pyre-fixme[21]: Could not find name `ICMP` in `scapy.all`. |
26 | | -# pyre-fixme[21]: Could not find name `ICMPv6EchoRequest` in `scapy.all`. |
27 | | -# pyre-fixme[21]: Could not find name `ICMPv6PacketTooBig` in `scapy.all`. |
28 | | -# pyre-fixme[21]: Could not find name `IP` in `scapy.all`. |
29 | | -# pyre-fixme[21]: Could not find name `IPv6` in `scapy.all`. |
30 | | -# pyre-fixme[21]: Could not find name `TCP` in `scapy.all`. |
31 | | -# pyre-fixme[21]: Could not find name `UDP` in `scapy.all`. |
32 | 23 | from scapy.all import ( |
| 24 | + # pyrefly: ignore [missing-module-attribute] |
33 | 25 | ARP, |
| 26 | + # pyrefly: ignore [missing-module-attribute] |
34 | 27 | Ether, |
| 28 | + # pyrefly: ignore [missing-module-attribute] |
35 | 29 | ICMP, |
| 30 | + # pyrefly: ignore [missing-module-attribute] |
36 | 31 | ICMPv6EchoRequest, |
| 32 | + # pyrefly: ignore [missing-module-attribute] |
37 | 33 | ICMPv6PacketTooBig, |
| 34 | + # pyrefly: ignore [missing-module-attribute] |
38 | 35 | IP, |
| 36 | + # pyrefly: ignore [missing-module-attribute] |
39 | 37 | IPv6, |
40 | 38 | sendp, |
41 | 39 | sniff, |
| 40 | + # pyrefly: ignore [missing-module-attribute] |
42 | 41 | TCP, |
| 42 | + # pyrefly: ignore [missing-module-attribute] |
43 | 43 | UDP, |
44 | 44 | ) |
45 | 45 |
|
|
50 | 50 |
|
51 | 51 | TEST_PCKTS = [ |
52 | 52 | # pkt 1; reply expected |
53 | | - # pyre-fixme[16]: Module `all` has no attribute `Ether`. |
54 | 53 | Ether(src="0x002", dst="0x2") |
55 | | - # pyre-fixme[16]: Module `all` has no attribute `IP`. |
56 | 54 | / IP(src="192.168.1.1", dst="10.200.1.1") |
57 | | - # pyre-fixme[16]: Module `all` has no attribute `UDP`. |
58 | 55 | / UDP(sport=31337, dport=80) |
59 | 56 | / "katran test pckt 01", |
60 | 57 | # pkt 2; reply expected |
61 | | - # pyre-fixme[16]: Module `all` has no attribute `Ether`. |
62 | 58 | Ether(src="0x002", dst="0x2") |
63 | | - # pyre-fixme[16]: Module `all` has no attribute `IP`. |
64 | 59 | / IP(src="192.168.1.1", dst="10.200.1.1") |
65 | | - # pyre-fixme[16]: Module `all` has no attribute `TCP`. |
66 | 60 | / TCP(sport=31337, dport=80, flags="A") |
67 | 61 | / "katran test pckt 02", |
68 | 62 | # pkt 3; reply expected |
69 | | - # pyre-fixme[16]: Module `all` has no attribute `Ether`. |
70 | 63 | Ether(src="0x002", dst="0x2") |
71 | | - # pyre-fixme[16]: Module `all` has no attribute `IP`. |
72 | 64 | / IP(src="192.168.1.1", dst="10.200.1.2") |
73 | | - # pyre-fixme[16]: Module `all` has no attribute `TCP`. |
74 | 65 | / TCP(sport=31337, dport=42, flags="A") |
75 | 66 | / "katran test pckt 03", |
76 | 67 | # pkt 4; reply expected |
77 | | - # pyre-fixme[16]: Module `all` has no attribute `Ether`. |
78 | 68 | Ether(src="0x002", dst="0x2") |
79 | | - # pyre-fixme[16]: Module `all` has no attribute `IP`. |
80 | 69 | / IP(src="192.168.1.1", dst="10.200.1.3") |
81 | | - # pyre-fixme[16]: Module `all` has no attribute `TCP`. |
82 | 70 | / TCP(sport=31337, dport=80, flags="A") |
83 | 71 | / "katran test pckt 04", |
84 | 72 | # pkt 5; reply expected |
85 | | - # pyre-fixme[16]: Module `all` has no attribute `Ether`. |
86 | 73 | Ether(src="0x002", dst="0x2") |
87 | | - # pyre-fixme[16]: Module `all` has no attribute `IPv6`. |
88 | 74 | / IPv6(src="fc00:2::1", dst="fc00:1::1") |
89 | | - # pyre-fixme[16]: Module `all` has no attribute `TCP`. |
90 | 75 | / TCP(sport=31337, dport=80, flags="A") |
91 | 76 | / "katran test pckt 05", |
92 | 77 | # pkt 6; reply expected |
93 | | - # pyre-fixme[16]: Module `all` has no attribute `Ether`. |
94 | 78 | Ether(src="0x002", dst="0x2") |
95 | | - # pyre-fixme[16]: Module `all` has no attribute `IP`. |
96 | 79 | / IP(src="192.168.1.1", dst="10.200.1.3") |
97 | | - # pyre-fixme[16]: Module `all` has no attribute `ICMP`. |
98 | 80 | / ICMP(type="echo-request") |
99 | 81 | / "katran test pckt 06", |
100 | 82 | # pkt 7; reply expected |
101 | | - # pyre-fixme[16]: Module `all` has no attribute `Ether`. |
102 | 83 | Ether(src="0x002", dst="0x2") |
103 | | - # pyre-fixme[16]: Module `all` has no attribute `IPv6`. |
104 | 84 | / IPv6(src="fc00:2::1", dst="fc00:1::1") |
105 | | - # pyre-fixme[16]: Module `all` has no attribute `ICMPv6EchoRequest`. |
106 | 85 | / ICMPv6EchoRequest() |
107 | 86 | / "katran test pckt 07", |
108 | 87 | # pkt 8; reply expected |
109 | | - # pyre-fixme[16]: Module `all` has no attribute `Ether`. |
110 | 88 | Ether(src="0x002", dst="0x2") |
111 | | - # pyre-fixme[16]: Module `all` has no attribute `IP`. |
112 | 89 | / IP(src="192.168.100.1", dst="10.200.1.1") |
113 | | - # pyre-fixme[16]: Module `all` has no attribute `ICMP`. |
114 | 90 | / ICMP(type="dest-unreach", code="fragmentation-needed") |
115 | | - # pyre-fixme[16]: Module `all` has no attribute `IP`. |
116 | 91 | / IP(src="10.200.1.1", dst="192.168.1.1") |
117 | | - # pyre-fixme[16]: Module `all` has no attribute `TCP`. |
118 | 92 | / TCP(sport=80, dport=31337) |
119 | 93 | / "katran test pckt 08", |
120 | 94 | # pkt 9; reply expected |
121 | | - # pyre-fixme[16]: Module `all` has no attribute `Ether`. |
122 | 95 | Ether(src="0x002", dst="0x2") |
123 | | - # pyre-fixme[16]: Module `all` has no attribute `IPv6`. |
124 | 96 | / IPv6(src="fc00:200::1", dst="fc00:1::1") |
125 | | - # pyre-fixme[16]: Module `all` has no attribute `ICMPv6PacketTooBig`. |
126 | 97 | / ICMPv6PacketTooBig() |
127 | | - # pyre-fixme[16]: Module `all` has no attribute `IPv6`. |
128 | 98 | / IPv6(src="fc00:1::1", dst="fc00:2::1") |
129 | | - # pyre-fixme[16]: Module `all` has no attribute `TCP`. |
130 | 99 | / TCP(sport=80, dport=31337) |
131 | 100 | / "katran test pckt 09", |
132 | 101 | # pkt 10; will be droped on katran side |
133 | | - # pyre-fixme[16]: Module `all` has no attribute `Ether`. |
134 | 102 | Ether(src="0x002", dst="0x2") |
135 | | - # pyre-fixme[16]: Module `all` has no attribute `IP`. |
136 | 103 | / IP(src="192.168.1.1", dst="10.200.1.1", ihl=6) |
137 | | - # pyre-fixme[16]: Module `all` has no attribute `TCP`. |
138 | 104 | / TCP(sport=31337, dport=80, flags="A") |
139 | 105 | / "katran test pckt 10", |
140 | 106 | # pkt 11; will be droped on katran side |
141 | | - # pyre-fixme[16]: Module `all` has no attribute `Ether`. |
142 | 107 | Ether(src="0x002", dst="0x2") |
143 | | - # pyre-fixme[16]: Module `all` has no attribute `IP`. |
144 | 108 | / IP(src="192.168.1.1", dst="10.200.1.1", ihl=5, flags="MF") |
145 | | - # pyre-fixme[16]: Module `all` has no attribute `TCP`. |
146 | 109 | / TCP(sport=31337, dport=80, flags="A") |
147 | 110 | / "katran test pckt 11", |
148 | 111 | # pkt 12; will be droped on katran side |
149 | | - # pyre-fixme[16]: Module `all` has no attribute `Ether`. |
150 | 112 | Ether(src="0x002", dst="0x2") |
151 | | - # pyre-fixme[16]: Module `all` has no attribute `IPv6`. |
152 | 113 | / IPv6(src="fc00:2::1", dst="fc00:1::1", nh=44) |
153 | | - # pyre-fixme[16]: Module `all` has no attribute `TCP`. |
154 | 114 | / TCP(sport=31337, dport=80, flags="A") |
155 | 115 | / "katran test pckt 12", |
156 | 116 | # pkt 13; will be passed to katran's tcp stack; no reply expected |
157 | | - # pyre-fixme[16]: Module `all` has no attribute `Ether`. |
158 | 117 | Ether(src="0x002", dst="0x2") |
159 | | - # pyre-fixme[16]: Module `all` has no attribute `IP`. |
160 | 118 | / IP(src="192.168.1.1", dst="10.200.1.1", ihl=5) |
161 | | - # pyre-fixme[16]: Module `all` has no attribute `TCP`. |
162 | 119 | / TCP(sport=31337, dport=82, flags="A") |
163 | 120 | / "katran test pckt 13", |
164 | 121 | # pkt 14; will be passed to katran's tcp stack; no reply expected |
165 | | - # pyre-fixme[16]: Module `all` has no attribute `Ether`. |
166 | 122 | Ether(src="0x002", dst="0x2") |
167 | | - # pyre-fixme[16]: Module `all` has no attribute `IPv6`. |
168 | 123 | / IPv6(src="fc00:2::1", dst="fc00:1::1") |
169 | | - # pyre-fixme[16]: Module `all` has no attribute `TCP`. |
170 | 124 | / TCP(sport=31337, dport=82, flags="A") |
171 | 125 | / "katran test pckt 14", |
172 | 126 | # pkt 15; will be passed to katran's tcp stack; no reply expected |
173 | | - # pyre-fixme[16]: Module `all` has no attribute `Ether`. |
174 | | - # pyre-fixme[16]: Module `all` has no attribute `ARP`. |
175 | 127 | Ether(src="0x002", dst="0x2") / ARP(), |
176 | 128 | ] |
177 | 129 |
|
|
0 commit comments