robh2 97f31560ca Adding P4D2_2018_East Folder (#116)
* 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
2018-03-04 03:50:22 -05:00

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)