You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Require types on action parameters
○ Parameters have directionality
■ in: May not be modified, can be a constant or other non-L-value
■ out: May be modified, implied to be uninitialized
■ inout: May be modified, already initialized with data
○ Use syntax similar to header field declaration
This example hits the API problem with actions that we're trying to defer
or simplify -- when are action parameters things that need to be set in the
P4 program (in the control flow when the table is applied), and when are
they things that become part of the control plane API (parameters to the
table entry you are installing in a table.)
In v1.0 the action params are always part of the control plane API (so 'in'
only) -- anything that is related to a header or metadata field has to be
bound directly to that field's global name and not passed as a parameter.
chkim4142
changed the title
[prototyping] action parameter types and directionality annotations
[prototyping] Action parameter types and directionality annotations
Oct 20, 2015
Require types on action parameters
○ Parameters have directionality
■ in: May not be modified, can be a constant or other non-L-value
■ out: May be modified, implied to be uninitialized
■ inout: May be modified, already initialized with data
○ Use syntax similar to header field declaration
action foo (inout header ipv4_t ipv4, in bit<32> new_dst_addr)
{
modify_field(ipv4.dstAddr, new_dst_addr);
}
The text was updated successfully, but these errors were encountered: