blob: cd031944976a486c48bac6265c264525f2960ffc [file] [log] [blame]
// Copyright 2020 The Pigweed Authors
//
// Licensed under the Apache License, Version 2.0 (the "License"); you may not
// use this file except in compliance with the License. You may obtain a copy of
// the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
// License for the specific language governing permissions and limitations under
// the License.
syntax = "proto3";
package pw.rpc.internal;
enum PacketType {
// RPC packets correspond with an RPC request or response.
RPC = 0;
// CANCEL packets indicate cancellation of an ongoing streaming RPC. They are
// sent by the client to request cancellation and by the server to signal that
// an RPC was cancelled. The server sends a CANCEL packet when an RPC is
// cancelled server-side and in response to a client's request.
CANCEL = 1;
}
message RpcPacket {
// The type of packet. Either a general RPC packet or a specific control
// packet. Required.
PacketType type = 1;
// Channel through which the packet is sent. Required.
uint32 channel_id = 2;
// Tokenized fully-qualified name of the service with which this packet is
// associated. For RPC packets, this is the service that processes the packet.
uint32 service_id = 3;
// Tokenized name of the method which should process this packet.
uint32 method_id = 4;
// The packet's payload.
bytes payload = 5;
// RPC response status code.
uint32 status = 6;
}