MCPcopy Create free account
hub / github.com/FDio/vpp / ppc

Function ppc

test/util.py:92–113  ·  view source on GitHub ↗

Return string containing ppp() printout for a capture. :param headline: printed as first line of output :param capture: packets to print :param limit: limit the print to # of packets

(headline, capture, limit=10)

Source from the content-addressed store, hash-verified

90
91
92def ppc(headline, capture, limit=10):
93 """Return string containing ppp() printout for a capture.
94
95 :param headline: printed as first line of output
96 :param capture: packets to print
97 :param limit: limit the print to # of packets
98 """
99 if not capture:
100 return headline
101 tail = ""
102 if limit < len(capture):
103 tail = "\nPrint limit reached, %s out of %s packets printed" % (
104 limit,
105 len(capture),
106 )
107 body = "".join(
108 [
109 str(ppp("Packet #%s:" % count, p))
110 for count, p in zip(range(0, limit), capture)
111 ]
112 )
113 return "%s\n%s%s" % (headline, body, tail)
114
115
116def ip4_range(ip4, s, e):

Callers 6

send_and_expect_multiMethod · 0.90
test_frag_in_orderMethod · 0.90
get_captureMethod · 0.90
test_ipsec_nat_tunMethod · 0.90

Calls 1

pppFunction · 0.85

Tested by 4

test_frag_in_orderMethod · 0.72
test_ipsec_nat_tunMethod · 0.72