Example #1
0
 public static unsafe void Write48(byte[] arr, uint offset, bit48 value)
 {
     fixed(byte *p = &arr[offset])
     {
         *((uint *)p)         = (uint)value.Value;
         *((ushort *)(p + 4)) = (ushort)(value.Value >> 32);
     }
 }
Example #2
0
 public Set_smac_Action(EthernetAddress smac) : base(action_list.Set_smac)
 {
     this.smac = smac;
 }
Example #3
0
 //action Set_smac(EthernetAddress smac)
 // { headers.ethernet.srcAddr = smac; }
 private static void Set_smac(TopPipe_Args args, EthernetAddress smac)
 {
     args.headers.ethernet.srcAddr = smac;
 }
Example #4
0
 public Set_dmac_Action(EthernetAddress dmac) : base(action_list.Set_dmac)
 {
     this.dmac = dmac;
 }
Example #5
0
 //action Set_dmac(EthernetAddress dmac)
 //{ headers.ethernet.dstAddr = dmac; }
 private static void Set_dmac(TopPipe_Args args, EthernetAddress dmac)
 {
     args.headers.ethernet.dstAddr = dmac;
 }
Example #6
0
 // NOTE these methods aren't in the P4 - they are generated to help packet_in, etc.
 public override void Extract(byte[] data, uint offset)
 {
     dstAddr   = BitHelper.Extract48(data, offset);
     srcAddr   = BitHelper.Extract48(data, offset + 5);
     etherType = BitHelper.Extract16(data, offset + 10);
 }