vpp_pg_interface module¶
-
class
vpp_pg_interface.
VppPGInterface
(test, pg_index)¶ Bases:
vpp_interface.VppInterface
VPP packet-generator interface
-
add_stream
(pkts)¶ Add a stream of packets to this packet-generator
Parameters: pkts – iterable packets
-
assert_nothing_captured
(remark=None)¶
-
cap_name
¶ capture name for this interface
-
capture_cli
¶ CLI string to start capture on this interface
-
create_arp_req
()¶ Create ARP request applicable for this interface
-
create_ndp_req
()¶ Create NDP - NS applicable for this interface
-
enable_capture
()¶ Enable capture on this packet-generator interface
-
get_capture
(remark=None, filter_fn=<function is_ipv6_misc>)¶ Get captured packets
Parameters: - remark – remark printed into debug logs
- filter_fn – filter applied to each packet, packets for which the filter returns True are removed from capture
Returns: iterable packets
-
in_history_counter
¶ Self-incrementing counter used when renaming old pcap files
-
in_path
¶ pcap file path - injected packets
-
input_cli
¶ CLI string to load the injected packets
-
out_history_counter
¶ Self-incrementing counter used when renaming old pcap files
-
out_path
¶ pcap file path - captured packets
-
pg_index
¶ packet-generator interface index assigned by VPP
-
resolve_arp
(pg_interface=None)¶ Resolve ARP using provided packet-generator interface
Parameters: pg_interface – interface used to resolve, if None then this interface is used
-
resolve_ndp
(pg_interface=None)¶ Resolve NDP using provided packet-generator interface
Parameters: pg_interface – interface used to resolve, if None then this interface is used
-
wait_for_capture_file
(timeout=1)¶ Wait until pcap capture file appears
Parameters: timeout – How long to wait for the packet (default 1s) Raises: Exception – if the capture file does not appear within timeout
-
wait_for_packet
(timeout)¶ Wait for next packet captured with a timeout
Parameters: timeout – How long to wait for the packet Returns: Captured packet if no packet arrived within timeout Raises: Exception – if no packet arrives within timeout
-
-
vpp_pg_interface.
is_ipv6_misc
(p)¶ Is packet one of uninteresting IPv6 broadcasts?