diff --git a/proto/p4/v1/p4runtime.proto b/proto/p4/v1/p4runtime.proto index e1469502..3850019f 100755 --- a/proto/p4/v1/p4runtime.proto +++ b/proto/p4/v1/p4runtime.proto @@ -59,6 +59,11 @@ service P4Runtime { rpc Capabilities(CapabilitiesRequest) returns (CapabilitiesResponse) { } + +// Get properties of a resource + rpc GetResourceProperties(GetResourcePropertiesRequest) + returns (GetResourcePropertiesResponse) { + } } //------------------------------------------------------------------------------ @@ -791,3 +796,30 @@ message CapabilitiesResponse { // version of the P4Runtime API currently implemented by the server. string p4runtime_api_version = 1; } + +//------------------------------------------------------------------------------ +message GetResourcePropertiesRequest { + enum PropertyType { + // Default behavior. Returns all the properties of the resource. + ALL = 0; + // Returns number of entries in the resource + NUM_OF_ENTRIES = 1; + // Returns total capacity of the resource + SIZE = 2; + } + + // Unique identifier of a resource + // 0 is wildcard which fetches properties of all the resources + uint32 id = 1; + PropertyType property_type = 2; +} + +message GetResourcePropertiesResponse { + repeated ResourceProperties = 1; +} + +message ResourceProperties { + uint32 id = 1; + uint32 num_of_entries = 2; + uint32 size = 3; +}