[P4-dev] Check equality of two header fields

David Hancock dhancock at cs.utah.edu
Tue Jun 28 16:41:03 EDT 2016


action a_setflag() {
   modify_field(meta.flag, 1);
}

table t_setflag {
   actions {
     a_setflag;
   }
}

table subsequent_table {
   reads {
     meta.flag : exact;
   }
   actions {
     ...
   }
}

control ingress {
   ...
   if A == B {
     apply(t_setflag);
   }
   apply(subsequent_table);
   ...
}

On 06/28/2016 02:30 PM, Ashutosh Agrawal (ashu) wrote:
>
> Let’s say I’ve a packet header with srcAddr and DstAddr fields. I want 
> to check if src and dst addresses are same and set a metadata flag. I 
> can then use this flag as a key field for a subsequent table. AFAIK, 
> this A==B check can only be done in Control Flow but I can’t modify 
> the metadata there. Any ideas?
>
>
>
> _______________________________________________
> P4-dev mailing list
> P4-dev at lists.p4.org
> http://lists.p4.org/mailman/listinfo/p4-dev_lists.p4.org

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.p4.org/pipermail/p4-dev_lists.p4.org/attachments/20160628/39e5024c/attachment-0002.html>


More information about the P4-dev mailing list