palm/palmdef/encrypted_reflection.proto

71 lines
3.5 KiB
Protocol Buffer

syntax = "proto3";
package palmdef.encrypted_reflection;
/*
This file contains message definitions for packets sent via encrypted reflection.
These packets have the directions EC2R and ER2C (encrypted client to relay, encrypted relay to client)
These packets are assigned the ID block 0x30-0x4f.
*/
// Consult palm.proto for how the channel_id is calculated.
// Sent by the client to set the channel being requested for this session.
// If the channel has already been set, this value of this packet will be ignored, and this packet will only function
// as a "request status update" packet.
// Consult the channel_id of the PalmER2CChannelStatusPacket to see what channel was actually sent by the server.
// The client should send this packet every 15 seconds, to function as a keepalive. After 20 seconds, the server will timeout the client.
message PalmEC2RRelayRequestPacket {
enum packet_info { unknown = 0; type = 0x30; }
bytes channel_id = 1; // The hash of the PMK. Used to identify the channel to the relay, without it knowing the channel name, or the key used for cryptographic operations.
int32 session_id = 2; // The same session_id used in previous packets, used to identify this session.
}
// Sent by the server to update the client on the status of the channel they are set to.
// This is sent in two cases:
// 1. immediately in reply to a PalmEC2RRelayRequestPacket
// 2. when the state changes
message PalmER2CChannelStatusPacket {
enum packet_info { unknown = 0; type = 0x31; }
enum channel_state_t {
UNKNOWN_CHANNEL_STATE = 0;
CHANNEL_NOT_READY = 1;
CHANNEL_IN_USE = 2;
}
bytes channel_id = 1; // The ID of the channel that was requested. Consult palm.proto for how this value is calculated.
int32 session_id = 2; // The same session_id used in previous packets, used to identify this session.
channel_state_t state = 3; // The state of the channel.
}
// Sent by the server to inform the client that it may now send data via the relay.
message PalmER2CChannelReadyPacket {
enum packet_info { unknown = 0; type = 0x32; }
bytes channel_id = 1; // The ID of the channel that is now ready.
int32 session_id = 2; // The same session_id used in previous packets, used to identify this session.
bool is_initiator = 3; // Is this client the initiator? This should be set to true on one of the clients, and false on the other.
}
// Sent by the client to request that a packet be relayed to the other party
message PalmEC2RRelayDataPacket {
enum packet_info { unknown = 0; type = 0x33; }
bytes channel_id = 1; // The ID of the channel to relay data to.
int32 session_id = 2; // The same session_id used in previous packets, used to identify this session.
bytes data = 3; // The protobuf-encoded data to send to the other client
}
// Sent by the server to tell the client to give it the data sent by the other client
message PalmER2CRelayedDataPacket {
enum packet_info { unknown = 0; type = 0x34; }
bytes channel_id = 1; // The ID of the channel to relay data to.
int32 session_id = 2; // The same session_id used in previous packets, used to identify this session.
bytes data = 3; // The protobuf-encoded data sent by the other client
}