예제 #1
0
 def encap_mcast(self, pkt, src_ip, src_mac, vni):
     """
     Encapsulate the original payload frame by adding GENEVE header with its
     UDP, IP and Ethernet fields
     """
     return (Ether(src=src_mac, dst=self.mcast_mac) /
             IP(src=src_ip, dst=self.mcast_ip4) /
             UDP(sport=self.dport, dport=self.dport, chksum=0) /
             GENEVE(vni=vni) / pkt)
예제 #2
0
 def encapsulate(self, pkt, vni):
     """
     Encapsulate the original payload frame by adding GENEVE header with its
     UDP, IP and Ethernet fields
     """
     return (Ether(src=self.pg0.remote_mac, dst=self.pg0.local_mac) /
             IP(src=self.pg0.remote_ip4, dst=self.pg0.local_ip4) /
             UDP(sport=self.dport, dport=self.dport, chksum=0) /
             GENEVE(vni=vni) / pkt)