Open antoninbas opened 5 years ago
Note from 2019-Jun-19 P4 API working group meeting:
One possible way that might work is for the PacketReplicationEngineEntry message to be unset, i.e. neither of its oneof values (if Protobuf allows that -- needs to be verified). If it can be unset, the P4Runtime API spec could specify that when it is unset, the server treats it as a wildcard read of all multicast groups and all clone sessions.
Just wanted to follow-up here saying that you can indeed check for the absence of a oneof field in protobuf 3. You can check the "case" of the oneof field, which will be 0 for unset oneof fields.
For instance, in C++ you could check it as follows: entry.type_case() == ::p4::v1::PacketReplicationEngineEntry::TypeCase::TYPE_NOT_SET
.
This is currently not supported by P4Runtime (to the best of my knowledge), which could be quite inconvenient. I don't see a nice way to support this without changing the corresponding Protobuf message definitions. For
MulticastGroupEntry
, we may be able to get away with usingmulticast_group_id
0 as the wildcard, but forCloneSessionEntry
, the spec states that 0 is a valid session id (of course we could consider changing that).