[P4-discuss] control in Actions

Antonin Bas antonin at barefootnetworks.com
Fri Oct 14 13:05:05 EDT 2016


The ternary operator is only available in P4 v1.1

On Fri, Oct 14, 2016 at 9:09 AM, Thambi Sreedharan <thambisree at gmail.com>
wrote:

> Hi
>
> while reviewing the https://github.com/p4lang/
> tutorials/blob/master/p4v1_1/simple_router/p4src/simple_router.p4
>
> found following piece of code :
>
> action do_drop_expired() {
> drops_register[0] = drops_register[0] + ((drops_register_enabled[0] == 1)
> ? (bit<32>)1 : 0);
> drop();
> }
>
>
> expression  (a=0) ? 1 :0 is supported in P4 version 1.0.2 or only in 1.1.0
>
>
> Thanks
> Jay
>
> _______________________________________________
> P4-discuss mailing list
> P4-discuss at lists.p4.org
> http://lists.p4.org/mailman/listinfo/p4-discuss_lists.p4.org
>



-- 
Antonin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.p4.org/pipermail/p4-discuss_lists.p4.org/attachments/20161014/91bbb492/attachment-0002.html>


More information about the P4-discuss mailing list