P4Runtime sh >>> p = packet_out()
P4Runtime sh >>> p.payload = b'AAAA' # Note that the payload must be a byte string
P4Runtime sh >>> p.metadata['egress_port'] = '1' # Note that the value must be a string
P4Runtime sh >>> p.send # send the packet-out message
But I did not see any way to take a PacketIn message and access its payload and metadata fields in a similar style. I only found that one could use the PacketIn class to receive packets as Python Protobuf data structures.
Did I miss some feature to take the PacketIn's and make them readable using syntax like mypktin.payload, mypktin.metadata['egress_port'], etc.?
I see in https://github.com/p4lang/p4runtime-shell/blob/main/usage/packet_io.md that one can use Pythonic syntax to fill in the controller packet metadata fields:
But I did not see any way to take a PacketIn message and access its payload and metadata fields in a similar style. I only found that one could use the PacketIn class to receive packets as Python Protobuf data structures.
Did I miss some feature to take the PacketIn's and make them readable using syntax like
mypktin.payload
,mypktin.metadata['egress_port']
, etc.?