Home
last modified time | relevance | path

Searched refs:scapy (Results 1 – 16 of 16) sorted by relevance

/kernel/tests/net/test/
Dpackets.py19 from scapy import all as scapy unknown
47 return {4: scapy.IP, 5: scapy.IP, 6: scapy.IPv6}[version]
50 if isinstance(packet, scapy.IPv6):
52 elif isinstance(packet, scapy.IP):
64 scapy.UDP(sport=sport, dport=53) / UDP_PAYLOAD)
68 packet = (scapy.IP(src=srcaddr, dst=dstaddr, ttl=lifetime, tos=0x83) /
69 scapy.UDP(sport=sport, dport=53) /
72 packet = (scapy.IPv6(src=srcaddr, dst=dstaddr,
74 scapy.UDP(sport=sport, dport=53) /
86 scapy.TCP(sport=sport, dport=dport,
[all …]
Dxfrm_base.py18 from scapy import all as scapy unknown
172 udp_layer = packet.getlayer(scapy.UDP)
176 esp_packet = scapy.Raw(xfrm.EspHdr((spi, seq)).Pack())
181 ip_type = {4: scapy.IP, 6: scapy.IPv6}[outer_version]
184 esp_nexthdr = {scapy.IPv6: IPPROTO_IPV6,
185 scapy.IP: IPPROTO_IPIP}[type(packet)]
203 esp_packet.payload = scapy.Raw(inner_layer)
205 packet.payload = scapy.Raw(str(esp_packet) + trailer)
209 if type(packet) is scapy.IPv6:
213 packet = scapy.IPv6(str(packet))
[all …]
Dping6_test.py30 from scapy import all as scapy unknown
90 layers = ["IP", "ICMP", scapy.ICMPv6EchoRequest]
107 src = packet.getlayer(scapy.IP).src
109 scapy.IP(src=self.INTERMEDIATE_IPV4, dst=src) /
110 scapy.ICMP(type=11, code=0) /
113 src = packet.getlayer(scapy.IPv6).src
115 scapy.IPv6(src=self.INTERMEDIATE_IPV6, dst=src) /
116 scapy.ICMPv6TimeExceeded(code=0) /
120 src = packet.getlayer(scapy.IPv6).src
123 scapy.IPv6(src=self.INTERMEDIATE_IPV6, dst=src) /
[all …]
Dxfrm_test.py19 from scapy import all as scapy unknown
57 udp_hdr = packet[scapy.UDP]
303 incoming = (scapy.IP(src=remoteaddr, dst=myaddr) /
304 scapy.UDP(sport=4500, dport=encap_port) / payload)
305 incoming = scapy.IP(str(incoming))
327 scapy.IP(src=remoteaddr, dst=myaddr) / scapy.UDP(
507 IpType = {4: scapy.IP, 6: scapy.IPv6}[version]
509 scapy.UDP(sport=remote_port, dport=local_port) /
526 self.assertEqual(output_pkt[scapy.UDP].len, len("output_hello") + 8)
528 self.assertEqual(remote_port, output_pkt[scapy.UDP].dport)
[all …]
Dnet_test.py26 from scapy import all as scapy unknown
83 UDP_PAYLOAD = str(scapy.DNS(rd=1,
85 qd=scapy.DNSQR(qname="wWW.GoOGle.CoM",
213 ifr = fcntl.ioctl(s, scapy.SIOCGIFINDEX, ifr)
223 ifr = struct.pack("%dsH6s" % IFNAMSIZ, ifname, scapy.ARPHDR_ETHER, hwaddr)
230 ifr = fcntl.ioctl(s, scapy.SIOCGIFFLAGS, ifr)
233 flags |= scapy.IFF_UP
235 flags &= ~scapy.IFF_UP
237 ifr = fcntl.ioctl(s, scapy.SIOCSIFFLAGS, ifr)
Dneighbour_test.py23 from scapy import all as scapy unknown
174 scapy.IPv6(src=src, dst=dst) /
175 scapy.ICMPv6ND_NS(tgt=addr) /
176 scapy.ICMPv6NDOptSrcLLAddr(lladdr=llsrc)
186 expected = scapy.ARP(psrc=src, pdst=dst, hwsrc=llsrc, op=1)
205 scapy.Ether(src=mac, dst=self.MyMacAddress(self.netid)) /
206 scapy.IPv6(src=srcaddr, dst=dstaddr) /
207 scapy.ICMPv6ND_NA(tgt=addr, S=S, O=O, R=R) /
208 scapy.ICMPv6NDOptDstLLAddr(lladdr=mac)
Dmultinetwork_base.py29 from scapy import all as scapy unknown
246 ra = (scapy.Ether(src=macaddr, dst="33:33:00:00:00:01") /
247 scapy.IPv6(src=lladdr, hlim=255) /
248 scapy.ICMPv6ND_RA(reachabletime=reachabletime,
251 scapy.ICMPv6NDOptSrcLLAddr(lladdr=macaddr) /
252 scapy.ICMPv6NDOptPrefixInfo(prefix=cls.OnlinkPrefix(6, netid),
537 packet = scapy.Ether(src=routermac, dst=mymac) / ip_packet
556 ether = scapy.Ether(packet)
Dxfrm_tunnel_test.py26 from scapy import all as scapy unknown
109 _SCAPY_IP_TYPE = {4: scapy.IP, 6: scapy.IPv6}
133 IpType = {4: scapy.IP, 6: scapy.IPv6}[inner_version]
135 IpType(**ip_hdr_options) / scapy.UDP(sport=src_port, dport=dst_port) /
755 'id': scapy.IP(str(pkt.payload)[8:]).id,
756 'flags': scapy.IP(str(pkt.payload)[8:]).flags
759 ip_hdr_options = {'fl': scapy.IPv6(str(pkt.payload)[8:]).fl}
Dmultinetwork_test.py27 from scapy import all as scapy unknown
302 expected = (scapy.IPv6(src=srcaddr, dst=net_test.IPV6_ADDR,
304 scapy.IPv6ExtHdrDestOpt(
305 options=[scapy.PadN(optdata="\x00\x00\x00\x00\x00\x00"),
306 scapy.HBHOptUnknown(otype=0x8b,
308 scapy.UDP(sport=sport, dport=53) /
625 options = scapy.ICMPv6NDOptRouteInfo(rtlifetime=rtlifetime, plen=plen,
859 reply = scapy.Ether(src=tgtmac, dst=mymac) / reply
887 options = scapy.ICMPv6NDOptRouteInfo(rtlifetime=rtlifetime, plen=plen,
Dtun_twister.py26 from scapy import all as scapy unknown
156 if ip_type not in (scapy.IP, scapy.IPv6):
167 return scapy.IP(packet_bytes)
169 return scapy.IPv6(packet_bytes)
205 return scapy.Ether(bytes_in)
Dtcp_fastopen_test.py21 from scapy import all as scapy unknown
67 ip_layer = {4: scapy.IP, 6: scapy.IPv6}[version]
116 t = syn.getlayer(scapy.TCP)
118 t.payload = scapy.Raw(net_test.UDP_PAYLOAD)
Dsrcaddr_selection_test.py23 from scapy import all as scapy unknown
294 dad_defense = (scapy.Ether(src=conflict_macaddr, dst="33:33:33:00:00:01") /
295 scapy.IPv6(src=self.test_ip, dst="ff02::1") /
296 scapy.ICMPv6ND_NA(tgt=self.test_ip, R=0, S=0, O=1) /
297 scapy.ICMPv6NDOptDstLLAddr(lladdr=conflict_macaddr))
Dxfrm_algorithm_test.py21 from scapy import all as scapy unknown
222 packet.getlayer(scapy.UDP),
225 packet.getlayer(scapy.TCP),
Dtcp_repair_test.py29 from scapy import all as scapy unknown
DAndroid.bp17 "scapy",
/kernel/tests/net/test/rootfs/
Dbullseye.list25 python3-scapy