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

Method create_upper_layer

test/test_acl_plugin.py:249–267  ·  view source on GitHub ↗
(self, packet_index, proto, ports=0)

Source from the content-addressed store, hash-verified

247 wl.remove_vpp_config()
248
249 def create_upper_layer(self, packet_index, proto, ports=0):
250 p = self.proto_map[proto]
251 if p == "UDP":
252 if ports == 0:
253 return UDP(
254 sport=random.randint(self.udp_sport_from, self.udp_sport_to),
255 dport=random.randint(self.udp_dport_from, self.udp_dport_to),
256 )
257 else:
258 return UDP(sport=ports, dport=ports)
259 elif p == "TCP":
260 if ports == 0:
261 return TCP(
262 sport=random.randint(self.tcp_sport_from, self.tcp_sport_to),
263 dport=random.randint(self.tcp_dport_from, self.tcp_dport_to),
264 )
265 else:
266 return TCP(sport=ports, dport=ports)
267 return ""
268
269 def create_stream(
270 self,

Callers 1

create_streamMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected