message.proto 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482
  1. syntax = "proto3";
  2. package hbb;
  3. message VP9 {
  4. bytes data = 1;
  5. bool key = 2;
  6. int64 pts = 3;
  7. }
  8. message VP9s { repeated VP9 frames = 1; }
  9. message RGB { bool compress = 1; }
  10. // planes data send directly in binary for better use arraybuffer on web
  11. message YUV {
  12. bool compress = 1;
  13. int32 stride = 2;
  14. }
  15. message VideoFrame {
  16. oneof union {
  17. VP9s vp9s = 6;
  18. RGB rgb = 7;
  19. YUV yuv = 8;
  20. }
  21. }
  22. message IdPk {
  23. string id = 1;
  24. bytes pk = 2;
  25. }
  26. message DisplayInfo {
  27. sint32 x = 1;
  28. sint32 y = 2;
  29. int32 width = 3;
  30. int32 height = 4;
  31. string name = 5;
  32. bool online = 6;
  33. }
  34. message PortForward {
  35. string host = 1;
  36. int32 port = 2;
  37. }
  38. message FileTransfer {
  39. string dir = 1;
  40. bool show_hidden = 2;
  41. }
  42. message LoginRequest {
  43. string username = 1;
  44. bytes password = 2;
  45. string my_id = 4;
  46. string my_name = 5;
  47. OptionMessage option = 6;
  48. oneof union {
  49. FileTransfer file_transfer = 7;
  50. PortForward port_forward = 8;
  51. }
  52. bool video_ack_required = 9;
  53. }
  54. message ChatMessage { string text = 1; }
  55. message PeerInfo {
  56. string username = 1;
  57. string hostname = 2;
  58. string platform = 3;
  59. repeated DisplayInfo displays = 4;
  60. int32 current_display = 5;
  61. bool sas_enabled = 6;
  62. string version = 7;
  63. int32 conn_id = 8;
  64. }
  65. message LoginResponse {
  66. oneof union {
  67. string error = 1;
  68. PeerInfo peer_info = 2;
  69. }
  70. }
  71. message MouseEvent {
  72. int32 mask = 1;
  73. sint32 x = 2;
  74. sint32 y = 3;
  75. repeated ControlKey modifiers = 4;
  76. }
  77. enum ControlKey {
  78. Unknown = 0;
  79. Alt = 1;
  80. Backspace = 2;
  81. CapsLock = 3;
  82. Control = 4;
  83. Delete = 5;
  84. DownArrow = 6;
  85. End = 7;
  86. Escape = 8;
  87. F1 = 9;
  88. F10 = 10;
  89. F11 = 11;
  90. F12 = 12;
  91. F2 = 13;
  92. F3 = 14;
  93. F4 = 15;
  94. F5 = 16;
  95. F6 = 17;
  96. F7 = 18;
  97. F8 = 19;
  98. F9 = 20;
  99. Home = 21;
  100. LeftArrow = 22;
  101. /// meta key (also known as "windows"; "super"; and "command")
  102. Meta = 23;
  103. /// option key on macOS (alt key on Linux and Windows)
  104. Option = 24; // deprecated, use Alt instead
  105. PageDown = 25;
  106. PageUp = 26;
  107. Return = 27;
  108. RightArrow = 28;
  109. Shift = 29;
  110. Space = 30;
  111. Tab = 31;
  112. UpArrow = 32;
  113. Numpad0 = 33;
  114. Numpad1 = 34;
  115. Numpad2 = 35;
  116. Numpad3 = 36;
  117. Numpad4 = 37;
  118. Numpad5 = 38;
  119. Numpad6 = 39;
  120. Numpad7 = 40;
  121. Numpad8 = 41;
  122. Numpad9 = 42;
  123. Cancel = 43;
  124. Clear = 44;
  125. Menu = 45; // deprecated, use Alt instead
  126. Pause = 46;
  127. Kana = 47;
  128. Hangul = 48;
  129. Junja = 49;
  130. Final = 50;
  131. Hanja = 51;
  132. Kanji = 52;
  133. Convert = 53;
  134. Select = 54;
  135. Print = 55;
  136. Execute = 56;
  137. Snapshot = 57;
  138. Insert = 58;
  139. Help = 59;
  140. Sleep = 60;
  141. Separator = 61;
  142. Scroll = 62;
  143. NumLock = 63;
  144. RWin = 64;
  145. Apps = 65;
  146. Multiply = 66;
  147. Add = 67;
  148. Subtract = 68;
  149. Decimal = 69;
  150. Divide = 70;
  151. Equals = 71;
  152. NumpadEnter = 72;
  153. RShift = 73;
  154. RControl = 74;
  155. RAlt = 75;
  156. CtrlAltDel = 100;
  157. LockScreen = 101;
  158. }
  159. message KeyEvent {
  160. bool down = 1;
  161. bool press = 2;
  162. oneof union {
  163. ControlKey control_key = 3;
  164. uint32 chr = 4;
  165. uint32 unicode = 5;
  166. string seq = 6;
  167. }
  168. repeated ControlKey modifiers = 8;
  169. }
  170. message CursorData {
  171. uint64 id = 1;
  172. sint32 hotx = 2;
  173. sint32 hoty = 3;
  174. int32 width = 4;
  175. int32 height = 5;
  176. bytes colors = 6;
  177. }
  178. message CursorPosition {
  179. sint32 x = 1;
  180. sint32 y = 2;
  181. }
  182. message Hash {
  183. string salt = 1;
  184. string challenge = 2;
  185. }
  186. message Clipboard {
  187. bool compress = 1;
  188. bytes content = 2;
  189. }
  190. enum FileType {
  191. Dir = 0;
  192. DirLink = 2;
  193. DirDrive = 3;
  194. File = 4;
  195. FileLink = 5;
  196. }
  197. message FileEntry {
  198. FileType entry_type = 1;
  199. string name = 2;
  200. bool is_hidden = 3;
  201. uint64 size = 4;
  202. uint64 modified_time = 5;
  203. }
  204. message FileDirectory {
  205. int32 id = 1;
  206. string path = 2;
  207. repeated FileEntry entries = 3;
  208. }
  209. message ReadDir {
  210. string path = 1;
  211. bool include_hidden = 2;
  212. }
  213. message ReadAllFiles {
  214. int32 id = 1;
  215. string path = 2;
  216. bool include_hidden = 3;
  217. }
  218. message FileAction {
  219. oneof union {
  220. ReadDir read_dir = 1;
  221. FileTransferSendRequest send = 2;
  222. FileTransferReceiveRequest receive = 3;
  223. FileDirCreate create = 4;
  224. FileRemoveDir remove_dir = 5;
  225. FileRemoveFile remove_file = 6;
  226. ReadAllFiles all_files = 7;
  227. FileTransferCancel cancel = 8;
  228. }
  229. }
  230. message FileTransferCancel { int32 id = 1; }
  231. message FileResponse {
  232. oneof union {
  233. FileDirectory dir = 1;
  234. FileTransferBlock block = 2;
  235. FileTransferError error = 3;
  236. FileTransferDone done = 4;
  237. }
  238. }
  239. message FileTransferBlock {
  240. int32 id = 1;
  241. sint32 file_num = 2;
  242. bytes data = 3;
  243. bool compressed = 4;
  244. }
  245. message FileTransferError {
  246. int32 id = 1;
  247. string error = 2;
  248. sint32 file_num = 3;
  249. }
  250. message FileTransferSendRequest {
  251. int32 id = 1;
  252. string path = 2;
  253. bool include_hidden = 3;
  254. }
  255. message FileTransferDone {
  256. int32 id = 1;
  257. sint32 file_num = 2;
  258. }
  259. message FileTransferReceiveRequest {
  260. int32 id = 1;
  261. string path = 2; // path written to
  262. repeated FileEntry files = 3;
  263. }
  264. message FileRemoveDir {
  265. int32 id = 1;
  266. string path = 2;
  267. bool recursive = 3;
  268. }
  269. message FileRemoveFile {
  270. int32 id = 1;
  271. string path = 2;
  272. sint32 file_num = 3;
  273. }
  274. message FileDirCreate {
  275. int32 id = 1;
  276. string path = 2;
  277. }
  278. // main logic from freeRDP
  279. message CliprdrMonitorReady {
  280. int32 conn_id = 1;
  281. }
  282. message CliprdrFormat {
  283. int32 conn_id = 1;
  284. int32 id = 2;
  285. string format = 3;
  286. }
  287. message CliprdrServerFormatList {
  288. int32 conn_id = 1;
  289. repeated CliprdrFormat formats = 2;
  290. }
  291. message CliprdrServerFormatListResponse {
  292. int32 conn_id = 1;
  293. int32 msg_flags = 2;
  294. }
  295. message CliprdrServerFormatDataRequest {
  296. int32 conn_id = 1;
  297. int32 requested_format_id = 2;
  298. }
  299. message CliprdrServerFormatDataResponse {
  300. int32 conn_id = 1;
  301. int32 msg_flags = 2;
  302. bytes format_data = 3;
  303. }
  304. message CliprdrFileContentsRequest {
  305. int32 conn_id = 1;
  306. int32 stream_id = 2;
  307. int32 list_index = 3;
  308. int32 dw_flags = 4;
  309. int32 n_position_low = 5;
  310. int32 n_position_high = 6;
  311. int32 cb_requested = 7;
  312. bool have_clip_data_id = 8;
  313. int32 clip_data_id = 9;
  314. }
  315. message CliprdrFileContentsResponse {
  316. int32 conn_id = 1;
  317. int32 msg_flags = 3;
  318. int32 stream_id = 4;
  319. bytes requested_data = 5;
  320. }
  321. message Cliprdr {
  322. oneof union {
  323. CliprdrMonitorReady ready = 1;
  324. CliprdrServerFormatList format_list = 2;
  325. CliprdrServerFormatListResponse format_list_response = 3;
  326. CliprdrServerFormatDataRequest format_data_request = 4;
  327. CliprdrServerFormatDataResponse format_data_response = 5;
  328. CliprdrFileContentsRequest file_contents_request = 6;
  329. CliprdrFileContentsResponse file_contents_response = 7;
  330. }
  331. }
  332. message SwitchDisplay {
  333. int32 display = 1;
  334. sint32 x = 2;
  335. sint32 y = 3;
  336. int32 width = 4;
  337. int32 height = 5;
  338. }
  339. message PermissionInfo {
  340. enum Permission {
  341. Keyboard = 0;
  342. Clipboard = 2;
  343. Audio = 3;
  344. File = 4;
  345. }
  346. Permission permission = 1;
  347. bool enabled = 2;
  348. }
  349. enum ImageQuality {
  350. NotSet = 0;
  351. Low = 2;
  352. Balanced = 3;
  353. Best = 4;
  354. }
  355. message OptionMessage {
  356. enum BoolOption {
  357. NotSet = 0;
  358. No = 1;
  359. Yes = 2;
  360. }
  361. ImageQuality image_quality = 1;
  362. BoolOption lock_after_session_end = 2;
  363. BoolOption show_remote_cursor = 3;
  364. BoolOption privacy_mode = 4;
  365. BoolOption block_input = 5;
  366. int32 custom_image_quality = 6;
  367. BoolOption disable_audio = 7;
  368. BoolOption disable_clipboard = 8;
  369. BoolOption enable_file_transfer = 9;
  370. }
  371. message OptionResponse {
  372. OptionMessage opt = 1;
  373. string error = 2;
  374. }
  375. message TestDelay {
  376. int64 time = 1;
  377. bool from_client = 2;
  378. }
  379. message PublicKey {
  380. bytes asymmetric_value = 1;
  381. bytes symmetric_value = 2;
  382. }
  383. message SignedId { bytes id = 1; }
  384. message AudioFormat {
  385. uint32 sample_rate = 1;
  386. uint32 channels = 2;
  387. }
  388. message AudioFrame { bytes data = 1; }
  389. message Misc {
  390. oneof union {
  391. ChatMessage chat_message = 4;
  392. SwitchDisplay switch_display = 5;
  393. PermissionInfo permission_info = 6;
  394. OptionMessage option = 7;
  395. AudioFormat audio_format = 8;
  396. string close_reason = 9;
  397. bool refresh_video = 10;
  398. OptionResponse option_response = 11;
  399. bool video_received = 12;
  400. }
  401. }
  402. message Message {
  403. oneof union {
  404. SignedId signed_id = 3;
  405. PublicKey public_key = 4;
  406. TestDelay test_delay = 5;
  407. VideoFrame video_frame = 6;
  408. LoginRequest login_request = 7;
  409. LoginResponse login_response = 8;
  410. Hash hash = 9;
  411. MouseEvent mouse_event = 10;
  412. AudioFrame audio_frame = 11;
  413. CursorData cursor_data = 12;
  414. CursorPosition cursor_position = 13;
  415. uint64 cursor_id = 14;
  416. KeyEvent key_event = 15;
  417. Clipboard clipboard = 16;
  418. FileAction file_action = 17;
  419. FileResponse file_response = 18;
  420. Misc misc = 19;
  421. Cliprdr cliprdr = 20;
  422. }
  423. }