Official cwtch.im peer and server implementations.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ControlChannel.proto 1.5KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. syntax = "proto2";
  2. package protocol;
  3. message Packet {
  4. // Must contain exactly one field
  5. optional OpenChannel open_channel = 1;
  6. optional ChannelResult channel_result = 2;
  7. optional KeepAlive keep_alive = 3;
  8. optional EnableFeatures enable_features = 4;
  9. optional FeaturesEnabled features_enabled = 5;
  10. }
  11. message OpenChannel {
  12. required int32 channel_identifier = 1; // Arbitrary unique identifier for this channel instance
  13. required string channel_type = 2; // String identifying channel type; e.g. im.ricochet.chat
  14. // It is valid to extend the OpenChannel message to add fields specific
  15. // to the requested channel_type.
  16. extensions 100 to max;
  17. }
  18. message ChannelResult {
  19. required int32 channel_identifier = 1; // Matching the value from OpenChannel
  20. required bool opened = 2; // If the channel is now open
  21. enum CommonError {
  22. GenericError = 0;
  23. UnknownTypeError = 1;
  24. UnauthorizedError = 2;
  25. BadUsageError = 3;
  26. FailedError = 4;
  27. }
  28. optional CommonError common_error = 3;
  29. // As with OpenChannel, it is valid to extend this message with fields specific
  30. // to the channel type.
  31. extensions 100 to max;
  32. }
  33. message KeepAlive {
  34. required bool response_requested = 1;
  35. }
  36. message EnableFeatures {
  37. repeated string feature = 1;
  38. extensions 100 to max;
  39. }
  40. message FeaturesEnabled {
  41. repeated string feature = 1;
  42. extensions 100 to max;
  43. }