* Copying P4D2 Fall 2017 into P4D2 2018 East. * Updated P4D2_2018_East VM. Added vagrant URL workaround, cdrom to VM. Updated to latest commits of BMV2, p4c, PI. Known issue with p4runtime exercise. * Applied patch from @antoninbas in and updated solution
21 lines
394 B
Python
21 lines
394 B
Python
|
|
from scapy.all import *
|
|
import sys, os
|
|
|
|
TYPE_MYTUNNEL = 0x1212
|
|
TYPE_IPV4 = 0x0800
|
|
|
|
class MyTunnel(Packet):
|
|
name = "MyTunnel"
|
|
fields_desc = [
|
|
ShortField("pid", 0),
|
|
ShortField("dst_id", 0)
|
|
]
|
|
def mysummary(self):
|
|
return self.sprintf("pid=%pid%, dst_id=%dst_id%")
|
|
|
|
|
|
bind_layers(Ether, MyTunnel, type=TYPE_MYTUNNEL)
|
|
bind_layers(MyTunnel, IP, pid=TYPE_IPV4)
|
|
|