Lines Matching full:packet

107             for packet in sp.fragment6(ip6 / icmp, fragSize=send_frag_length):
108 packets.append(ether / packet)
117 for packet in sp.fragment(ip / icmp / raw, fragsize=send_frag_length):
118 packets.append(ether / packet)
121 for packet in packets:
122 sp.sendp(packet, iface=send_params['sendif'], verbose=False)
158 for packet in sp.fragment6(ip6 / udp / raw, fragSize=send_frag_length):
159 packets.append(ether / packet)
169 for packet in sp.fragment(ip / udp / raw, fragsize=send_frag_length):
170 packets.append(ether / packet)
174 for packet in packets:
175 sp.sendp(packet, iface=send_params['sendif'], verbose=False)
192 def check_ipv4(expect_params, packet): argument
198 ip = packet.getlayer(sp.IP)
199 LOGGER.debug(f'Packet: {ip}')
201 LOGGER.debug('Packet is not IPv4!')
221 def check_ipv6(expect_params, packet): argument
227 ip6 = packet.getlayer(sp.IPv6)
229 LOGGER.debug('Packet is not IPv6!')
251 def check_ping_4(expect_params, packet): argument
253 if not check_ipv4(expect_params, packet):
255 icmp = packet.getlayer(sp.ICMP)
257 LOGGER.debug('Packet is not IPv4 ICMP!')
259 raw = packet.getlayer(sp.Raw)
261 LOGGER.debug('Packet contains no payload!')
269 def check_ping_request_4(expect_params, packet): argument
270 if not check_ping_4(expect_params, packet):
272 icmp = packet.getlayer(sp.ICMP)
274 LOGGER.debug('Packet is not IPv4 ICMP Echo Request!')
279 def check_ping_reply_4(expect_params, packet): argument
280 if not check_ping_4(expect_params, packet):
282 icmp = packet.getlayer(sp.ICMP)
284 LOGGER.debug('Packet is not IPv4 ICMP Echo Reply!')
289 def check_ping_request_6(expect_params, packet): argument
291 if not check_ipv6(expect_params, packet):
293 icmp = packet.getlayer(sp.ICMPv6EchoRequest)
295 LOGGER.debug('Packet is not IPv6 ICMP Echo Request!')
303 def check_ping_reply_6(expect_params, packet): argument
305 if not check_ipv6(expect_params, packet):
307 icmp = packet.getlayer(sp.ICMPv6EchoReply)
309 LOGGER.debug('Packet is not IPv6 ICMP Echo Reply!')
317 def check_ping_request(args, packet): argument
326 return check_ping_request_6(args['expect_params'], packet)
328 return check_ping_request_4(args['expect_params'], packet)
331 def check_ping_reply(args, packet): argument
340 return check_ping_reply_6(args['expect_params'], packet)
342 return check_ping_reply_4(args['expect_params'], packet)
345 def check_tcp(expect_params, packet): argument
349 tcp = packet.getlayer(sp.TCP)
351 LOGGER.debug('Packet is not TCP!')
355 newpacket = sp.Ether(sp.raw(packet[sp.Ether]))
380 def check_udp(expect_params, packet): argument
382 udp = packet.getlayer(sp.UDP)
384 LOGGER.debug('Packet is not UDP!')
386 raw = packet.getlayer(sp.Raw)
388 LOGGER.debug('Packet contains no payload!')
395 newpacket = sp.Ether(sp.raw(packet[sp.Ether]))
404 def check_tcp_syn_request_4(expect_params, packet): argument
405 if not check_ipv4(expect_params, packet):
407 if not check_tcp(expect_params | {'tcp_flags': 'S'}, packet):
412 def check_tcp_syn_reply_4(send_params, expect_params, packet): argument
413 if not check_ipv4(expect_params, packet):
415 if not check_tcp(expect_params | {'tcp_flags': 'SA'}, packet):
420 def check_tcp_3way_4(args, packet): argument
427 # Sniff incoming SYN+ACK packet
429 check_ipv4(expect_params_sa, packet) and
430 check_tcp(expect_params_sa | {'tcp_flags': 'SA'}, packet)
433 ip_sa = packet.getlayer(sp.IP)
434 tcp_sa = packet.getlayer(sp.TCP)
450 def check_udp_request_4(expect_params, packet): argument
451 if not check_ipv4(expect_params, packet):
453 if not check_udp(expect_params, packet):
458 def check_tcp_syn_request_6(expect_params, packet): argument
459 if not check_ipv6(expect_params, packet):
461 if not check_tcp(expect_params | {'tcp_flags': 'S'}, packet):
466 def check_tcp_syn_reply_6(expect_params, packet): argument
467 if not check_ipv6(expect_params, packet):
469 if not check_tcp(expect_params | {'tcp_flags': 'SA'}, packet):
474 def check_tcp_3way_6(args, packet): argument
481 # Sniff incoming SYN+ACK packet
483 check_ipv6(expect_params_sa, packet) and
484 check_tcp(expect_params_sa | {'tcp_flags': 'SA'}, packet)
487 ip6_sa = packet.getlayer(sp.IPv6)
488 tcp_sa = packet.getlayer(sp.TCP)
504 def check_udp_request_6(expect_params, packet): argument
505 if not check_ipv6(expect_params, packet):
507 if not check_udp(expect_params, packet):
511 def check_tcp_syn_request(args, packet): argument
521 return check_tcp_syn_request_6(expect_params, packet)
523 return check_tcp_syn_request_4(expect_params, packet)
526 def check_tcp_syn_reply(args, packet): argument
536 return check_tcp_syn_reply_6(expect_params, packet)
538 return check_tcp_syn_reply_4(expect_params, packet)
540 def check_tcp_3way(args, packet): argument
550 return check_tcp_3way_6(args, packet)
552 return check_tcp_3way_4(args, packet)
555 def check_udp_request(args, packet): argument
565 return check_udp_request_6(expect_params, packet)
567 return check_udp_request_4(expect_params, packet)
600 help='The interface through which the packet(s) will be sent')
618 # Packet settings