Mumble.proto 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544
  1. package MumbleProto;
  2. option optimize_for = SPEED;
  3. message Version {
  4. // 2-byte Major, 1-byte Minor and 1-byte Patch version number.
  5. optional uint32 version = 1;
  6. // Client release name.
  7. optional string release = 2;
  8. // Client OS name.
  9. optional string os = 3;
  10. // Client OS version.
  11. optional string os_version = 4;
  12. }
  13. // Not used. Not even for tunneling UDP through TCP.
  14. message UDPTunnel {
  15. // Not used.
  16. required bytes packet = 1;
  17. }
  18. // Used by the client to send the authentication credentials to the server.
  19. message Authenticate {
  20. // UTF-8 encoded username.
  21. optional string username = 1;
  22. // Server or user password.
  23. optional string password = 2;
  24. // Additional access tokens for server ACL groups.
  25. repeated string tokens = 3;
  26. // A list of CELT bitstream version constants supported by the client.
  27. repeated int32 celt_versions = 4;
  28. optional bool opus = 5 [default = false];
  29. }
  30. // Sent by the client to notify the server that the client is still alive.
  31. // Server must reply to the packet with the same timestamp and its own
  32. // good/late/lost/resync numbers. None of the fields is strictly required.
  33. message Ping {
  34. // Client timestamp. Server should not attempt to decode.
  35. optional uint64 timestamp = 1;
  36. // The amount of good packets received.
  37. optional uint32 good = 2;
  38. // The amount of late packets received.
  39. optional uint32 late = 3;
  40. // The amount of packets never received.
  41. optional uint32 lost = 4;
  42. // The amount of nonce resyncs.
  43. optional uint32 resync = 5;
  44. // The total amount of UDP packets received.
  45. optional uint32 udp_packets = 6;
  46. // The total amount of TCP packets received.
  47. optional uint32 tcp_packets = 7;
  48. // UDP ping average.
  49. optional float udp_ping_avg = 8;
  50. // UDP ping variance.
  51. optional float udp_ping_var = 9;
  52. // TCP ping average.
  53. optional float tcp_ping_avg = 10;
  54. // TCP ping variance.
  55. optional float tcp_ping_var = 11;
  56. }
  57. // Sent by the server when it rejects the user connection.
  58. message Reject {
  59. enum RejectType {
  60. // TODO ??
  61. None = 0;
  62. // The client attempted to connect with an incompatible version.
  63. WrongVersion = 1;
  64. // The user name supplied by the client was invalid.
  65. InvalidUsername = 2;
  66. // The client attempted to authenticate as a user with a password but it
  67. // was wrong.
  68. WrongUserPW = 3;
  69. // The client attempted to connect to a passworded server but the password
  70. // was wrong.
  71. WrongServerPW = 4;
  72. // Supplied username is already in use.
  73. UsernameInUse = 5;
  74. // Server is currently full and cannot accept more users.
  75. ServerFull = 6;
  76. // The user did not provide a certificate but one is required.
  77. NoCertificate = 7;
  78. AuthenticatorFail = 8;
  79. }
  80. // Rejection type.
  81. optional RejectType type = 1;
  82. // Human readable rejection reason.
  83. optional string reason = 2;
  84. }
  85. // ServerSync message is sent by the server when it has authenticated the user
  86. // and finished synchronizing the server state.
  87. message ServerSync {
  88. // The session of the current user.
  89. optional uint32 session = 1;
  90. // Maximum bandwidth that the user should use.
  91. optional uint32 max_bandwidth = 2;
  92. // Server welcome text.
  93. optional string welcome_text = 3;
  94. // Current user permissions TODO: Confirm??
  95. optional uint64 permissions = 4;
  96. }
  97. // Sent by the client when it wants a channel removed. Sent by the server when
  98. // a channel has been removed and clients should be notified.
  99. message ChannelRemove {
  100. required uint32 channel_id = 1;
  101. }
  102. // Used to communicate channel properties between the client and the server.
  103. // Sent by the server during the login process or when channel properties are
  104. // updated. Client may use this message to update said channel properties.
  105. message ChannelState {
  106. // Unique ID for the channel within the server.
  107. optional uint32 channel_id = 1;
  108. // channel_id of the parent channel.
  109. optional uint32 parent = 2;
  110. // UTF-8 encoded channel name.
  111. optional string name = 3;
  112. // A collection of channel id values of the linked channels. Absent during
  113. // the first channel listing.
  114. repeated uint32 links = 4;
  115. // UTF-8 encoded channel description. Only if the description is less than
  116. // 128 bytes
  117. optional string description = 5;
  118. // A collection of channel_id values that should be added to links.
  119. repeated uint32 links_add = 6;
  120. // A collection of channel_id values that should be removed from links.
  121. repeated uint32 links_remove = 7;
  122. // True if the channel is temporary.
  123. optional bool temporary = 8 [default = false];
  124. // Position weight to tweak the channel position in the channel list.
  125. optional int32 position = 9 [default = 0];
  126. // SHA1 hash of the description if the description is 128 bytes or more.
  127. optional bytes description_hash = 10;
  128. }
  129. // Used to communicate user leaving or being kicked. May be sent by the client
  130. // when it attempts to kick a user. Sent by the server when it informs the
  131. // clients that a user is not present anymore.
  132. message UserRemove {
  133. // The user who is being kicked, identified by their session, not present
  134. // when no one is being kicked.
  135. required uint32 session = 1;
  136. // The user who initiated the removal. Either the user who performs the kick
  137. // or the user who is currently leaving.
  138. optional uint32 actor = 2;
  139. // Reason for the kick, stored as the ban reason if the user is banned.
  140. optional string reason = 3;
  141. // True if the kick should result in a ban.
  142. optional bool ban = 4;
  143. }
  144. // Sent by the server when it communicates new and changed users to client.
  145. // First seen during login procedure. May be sent by the client when it wishes
  146. // to alter its state.
  147. message UserState {
  148. // Unique user session ID of the user whose state this is, may change on
  149. // reconnect.
  150. optional uint32 session = 1;
  151. // The session of the user who is updating this user.
  152. optional uint32 actor = 2;
  153. // User name, UTF-8 encoded.
  154. optional string name = 3;
  155. // Registered user ID if the user is registered.
  156. optional uint32 user_id = 4;
  157. // Channel on which the user is.
  158. optional uint32 channel_id = 5;
  159. // True if the user is muted by admin.
  160. optional bool mute = 6;
  161. // True if the user is deafened by admin.
  162. optional bool deaf = 7;
  163. // True if the user has been suppressed from talking by a reason other than
  164. // being muted.
  165. optional bool suppress = 8;
  166. // True if the user has muted self.
  167. optional bool self_mute = 9;
  168. // True if the user has deafened self.
  169. optional bool self_deaf = 10;
  170. // User image if it is less than 128 bytes.
  171. optional bytes texture = 11;
  172. // TODO ??
  173. optional bytes plugin_context = 12;
  174. // TODO ??
  175. optional string plugin_identity = 13;
  176. // User comment if it is less than 128 bytes.
  177. optional string comment = 14;
  178. // The hash of the user certificate.
  179. optional string hash = 15;
  180. // SHA1 hash of the user comment if it 128 bytes or more.
  181. optional bytes comment_hash = 16;
  182. // SHA1 hash of the user picture if it 128 bytes or more.
  183. optional bytes texture_hash = 17;
  184. // True if the user is a priority speaker.
  185. optional bool priority_speaker = 18;
  186. // True if the user is currently recording.
  187. optional bool recording = 19;
  188. }
  189. // Relays information on the bans. The client may send the BanList message to
  190. // either modify the list of bans or query them from the server. The server
  191. // sends this list only after a client queries for it.
  192. message BanList {
  193. message BanEntry {
  194. // Banned IP address.
  195. required bytes address = 1;
  196. // The length of the subnet mask for the ban.
  197. required uint32 mask = 2;
  198. // User name for identification purposes (does not affect the ban).
  199. optional string name = 3;
  200. // TODO ??
  201. optional string hash = 4;
  202. // Reason for the ban (does not affect the ban).
  203. optional string reason = 5;
  204. // Ban start time.
  205. optional string start = 6;
  206. // Ban duration in seconds.
  207. optional uint32 duration = 7;
  208. }
  209. // List of ban entries currently in place.
  210. repeated BanEntry bans = 1;
  211. // True if the server should return the list, false if it should replace old
  212. // ban list with the one provided.
  213. optional bool query = 2 [default = false];
  214. }
  215. // Used to send and broadcast text messages.
  216. message TextMessage {
  217. // The message sender, identified by its session.
  218. optional uint32 actor = 1;
  219. // Target users for the message, identified by their session.
  220. repeated uint32 session = 2;
  221. // The channels to which the message is sent, identified by their
  222. // channel_ids.
  223. repeated uint32 channel_id = 3;
  224. // The root channels when sending message recursively to several channels,
  225. // identified by their channel_ids.
  226. repeated uint32 tree_id = 4;
  227. // The UTF-8 encoded message. May be HTML if the server allows.
  228. required string message = 5;
  229. }
  230. message PermissionDenied {
  231. enum DenyType {
  232. // Operation denied for other reason, see reason field.
  233. Text = 0;
  234. // Permissions were denied.
  235. Permission = 1;
  236. // Cannot modify SuperUser.
  237. SuperUser = 2;
  238. // Invalid channel name.
  239. ChannelName = 3;
  240. // Text message too long.
  241. TextTooLong = 4;
  242. // The flux capacitor was spelled wrong.
  243. H9K = 5;
  244. // Operation not permitted in temporary channel.
  245. TemporaryChannel = 6;
  246. // Operation requires certificate.
  247. MissingCertificate = 7;
  248. // Invalid username.
  249. UserName = 8;
  250. // Channel is full.
  251. ChannelFull = 9;
  252. NestingLimit = 10;
  253. }
  254. // The denied permission when type is Permission.
  255. optional uint32 permission = 1;
  256. // channel_id for the channel where the permission was denied when type is
  257. // Permission.
  258. optional uint32 channel_id = 2;
  259. // The user who was denied permissions, identified by session.
  260. optional uint32 session = 3;
  261. // Textual reason for the denial.
  262. optional string reason = 4;
  263. // Type of the denial.
  264. optional DenyType type = 5;
  265. // The name that is invalid when type is UserName.
  266. optional string name = 6;
  267. }
  268. message ACL {
  269. message ChanGroup {
  270. // Name of the channel group, UTF-8 encoded.
  271. required string name = 1;
  272. // True if the group has been inherited from the parent (Read only).
  273. optional bool inherited = 2 [default = true];
  274. // True if the group members are inherited.
  275. optional bool inherit = 3 [default = true];
  276. // True if the group can be inherited by sub channels.
  277. optional bool inheritable = 4 [default = true];
  278. // Users explicitly included in this group, identified by user_id.
  279. repeated uint32 add = 5;
  280. // Users explicitly removed from this group in this channel if the group
  281. // has been inherited, identified by user_id.
  282. repeated uint32 remove = 6;
  283. // Users inherited, identified by user_id.
  284. repeated uint32 inherited_members = 7;
  285. }
  286. message ChanACL {
  287. // True if this ACL applies to the current channel.
  288. optional bool apply_here = 1 [default = true];
  289. // True if this ACL applies to the sub channels.
  290. optional bool apply_subs = 2 [default = true];
  291. // True if the ACL has been inherited from the parent.
  292. optional bool inherited = 3 [default = true];
  293. // ID of the user that is affected by this ACL.
  294. optional uint32 user_id = 4;
  295. // ID of the group that is affected by this ACL.
  296. optional string group = 5;
  297. // Bit flag field of the permissions granted by this ACL.
  298. optional uint32 grant = 6;
  299. // Bit flag field of the permissions denied by this ACL.
  300. optional uint32 deny = 7;
  301. }
  302. // Channel ID of the channel this message affects.
  303. required uint32 channel_id = 1;
  304. // True if the channel inherits its parent's ACLs.
  305. optional bool inherit_acls = 2 [default = true];
  306. // User group specifications.
  307. repeated ChanGroup groups = 3;
  308. // ACL specifications.
  309. repeated ChanACL acls = 4;
  310. // True if the message is a query for ACLs instead of setting them.
  311. optional bool query = 5 [default = false];
  312. }
  313. // Client may use this message to refresh its registered user information. The
  314. // client should fill the IDs or Names of the users it wants to refresh. The
  315. // server fills the missing parts and sends the message back.
  316. message QueryUsers {
  317. // user_ids.
  318. repeated uint32 ids = 1;
  319. // User names in the same order as ids.
  320. repeated string names = 2;
  321. }
  322. // Used to initialize and resync the UDP encryption. Either side may request a
  323. // resync by sending the message without any values filled. The resync is
  324. // performed by sending the message with only the client or server nonce
  325. // filled.
  326. message CryptSetup {
  327. // Encryption key.
  328. optional bytes key = 1;
  329. // Client nonce.
  330. optional bytes client_nonce = 2;
  331. // Server nonce.
  332. optional bytes server_nonce = 3;
  333. }
  334. message ContextActionModify {
  335. enum Context {
  336. // Action is applicable to the server.
  337. Server = 0x01;
  338. // Action can target a Channel.
  339. Channel = 0x02;
  340. // Action can target a User.
  341. User = 0x04;
  342. }
  343. enum Operation {
  344. Add = 0;
  345. Remove = 1;
  346. }
  347. // The action name.
  348. required string action = 1;
  349. // The display name of the action.
  350. optional string text = 2;
  351. // Context bit flags defining where the action should be displayed.
  352. optional uint32 context = 3;
  353. optional Operation operation = 4;
  354. }
  355. // Sent by the client when it wants to initiate a Context action.
  356. message ContextAction {
  357. // The target User for the action, identified by session.
  358. optional uint32 session = 1;
  359. // The target Channel for the action, identified by channel_id.
  360. optional uint32 channel_id = 2;
  361. // The action that should be executed.
  362. required string action = 3;
  363. }
  364. // Lists the registered users.
  365. message UserList {
  366. message User {
  367. // Registered user ID.
  368. required uint32 user_id = 1;
  369. // Registered user name.
  370. optional string name = 2;
  371. optional string last_seen = 3;
  372. optional uint32 last_channel = 4;
  373. }
  374. // A list of registered users.
  375. repeated User users = 1;
  376. }
  377. // Sent by the client when it wants to register or clear whisper targets.
  378. //
  379. // Note: The first available target ID is 1 as 0 is reserved for normal
  380. // talking. Maximum target ID is 30.
  381. message VoiceTarget {
  382. message Target {
  383. // Users that are included as targets.
  384. repeated uint32 session = 1;
  385. // Channels that are included as targets.
  386. optional uint32 channel_id = 2;
  387. // TODO ??
  388. optional string group = 3;
  389. // True if the voice should follow links from the specified channel.
  390. optional bool links = 4 [default = false];
  391. // True if the voice should also be sent to children of the specific
  392. // channel.
  393. optional bool children = 5 [default = false];
  394. }
  395. // Voice target ID.
  396. optional uint32 id = 1;
  397. // The receivers that this voice target includes.
  398. repeated Target targets = 2;
  399. }
  400. // Sent by the client when it wants permissions for a certain channel. Sent by
  401. // the server when it replies to the query or wants the user to resync all
  402. // channel permissions.
  403. message PermissionQuery {
  404. // channel_id of the channel for which the permissions are queried.
  405. optional uint32 channel_id = 1;
  406. // Channel permissions.
  407. optional uint32 permissions = 2;
  408. // True if the client should drop its current permission information for all
  409. // channels.
  410. optional bool flush = 3 [default = false];
  411. }
  412. // Sent by the server to notify the users of the version of the CELT codec they
  413. // should use. This may change during the connection when new users join.
  414. message CodecVersion {
  415. // The version of the CELT Alpha codec.
  416. required int32 alpha = 1;
  417. // The version of the CELT Beta codec.
  418. required int32 beta = 2;
  419. // True if the user should prefer Alpha over Beta.
  420. required bool prefer_alpha = 3 [default = true];
  421. optional bool opus = 4 [default = false];
  422. }
  423. // Used to communicate user stats between the server and clients.
  424. message UserStats {
  425. message Stats {
  426. // The amount of good packets received.
  427. optional uint32 good = 1;
  428. // The amount of late packets received.
  429. optional uint32 late = 2;
  430. // The amount of packets never received.
  431. optional uint32 lost = 3;
  432. // The amount of nonce resyncs.
  433. optional uint32 resync = 4;
  434. }
  435. // User whose stats these are.
  436. optional uint32 session = 1;
  437. // True if the message contains only mutable stats (packets, ping).
  438. optional bool stats_only = 2 [default = false];
  439. // Full user certificate chain of the user certificate in DER format.
  440. repeated bytes certificates = 3;
  441. // Packet statistics for packets received from the client.
  442. optional Stats from_client = 4;
  443. // Packet statistics for packets sent by the server.
  444. optional Stats from_server = 5;
  445. // Amount of UDP packets sent.
  446. optional uint32 udp_packets = 6;
  447. // Amount of TCP packets sent.
  448. optional uint32 tcp_packets = 7;
  449. // UDP ping average.
  450. optional float udp_ping_avg = 8;
  451. // UDP ping variance.
  452. optional float udp_ping_var = 9;
  453. // TCP ping average.
  454. optional float tcp_ping_avg = 10;
  455. // TCP ping variance.
  456. optional float tcp_ping_var = 11;
  457. // Client version.
  458. optional Version version = 12;
  459. // A list of CELT bitstream version constants supported by the client of this
  460. // user.
  461. repeated int32 celt_versions = 13;
  462. // Client IP address.
  463. optional bytes address = 14;
  464. // Bandwith used by this client.
  465. optional uint32 bandwidth = 15;
  466. // Connection duration.
  467. optional uint32 onlinesecs = 16;
  468. // Duration since last activity.
  469. optional uint32 idlesecs = 17;
  470. // True if the user has a strong certificate.
  471. optional bool strong_certificate = 18 [default = false];
  472. optional bool opus = 19 [default = false];
  473. }
  474. // Used by the client to request binary data from the server. By default large
  475. // comments or textures are not sent within standard messages but instead the
  476. // hash is. If the client does not recognize the hash it may request the
  477. // resource when it needs it. The client does so by sending a RequestBlob
  478. // message with the correct fields filled with the user sessions or channel_ids
  479. // it wants to receive. The server replies to this by sending a new
  480. // UserState/ChannelState message with the resources filled even if they would
  481. // normally be transmitted as hashes.
  482. message RequestBlob {
  483. // sessions of the requested UserState textures.
  484. repeated uint32 session_texture = 1;
  485. // sessions of the requested UserState comments.
  486. repeated uint32 session_comment = 2;
  487. // channel_ids of the requested ChannelState descriptions.
  488. repeated uint32 channel_description = 3;
  489. }
  490. // Sent by the server when it informs the clients on server configuration
  491. // details.
  492. message ServerConfig {
  493. // The maximum bandwidth the clients should use.
  494. optional uint32 max_bandwidth = 1;
  495. // Server welcome text.
  496. optional string welcome_text = 2;
  497. // True if the server allows HTML.
  498. optional bool allow_html = 3;
  499. // Maximum text message length.
  500. optional uint32 message_length = 4;
  501. // Maximum image message length.
  502. optional uint32 image_message_length = 5;
  503. }
  504. // Sent by the server to inform the clients of suggested client configuration
  505. // specified by the server administrator.
  506. message SuggestConfig {
  507. // Suggested client version.
  508. optional uint32 version = 1;
  509. // True if the administrator suggests positional audio to be used on this
  510. // server.
  511. optional bool positional = 2;
  512. // True if the administrator suggests push to talk to be used on this server.
  513. optional bool push_to_talk = 3;
  514. }