Advertisement
TShiva

Protobuf

Oct 3rd, 2017
237
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.13 KB | None | 0 0
  1. syntax = "proto3";
  2.  
  3. package stream_changer;
  4.  
  5. message Request{
  6. int32 fd = 1;
  7.  
  8. // структура для отправки
  9.  
  10. message scst_user_get_cmd {
  11. sint32 cmd_h = 1;
  12. sint32 subcode = 2;
  13. sint64 preply=3;
  14.  
  15. message scst_user_sess{
  16. sint64 sess_h=1;
  17. sint64 lun=2;
  18. sint32 threads_num=3;
  19. sint32 rd_only=4;
  20. sint32 scsi_transport_version=5;
  21. sint32 phys_transport_version=6;
  22. string initiator_name=7;
  23. string target_name=8;
  24. }
  25. scst_user_sess sess=4;
  26.  
  27. message scst_user_scsi_cmd_parse{
  28. sint64 sess_h=1;
  29. repeated sint32 cdb=2;
  30. sint32 cdb_len=3;
  31. sint64 lba=4;
  32. sint64 data_len=5;
  33. int32 bufflen=6;
  34. int32 out_bufflen=7;
  35. sint32 timeout=8;
  36. sint32 op_flags=9;
  37. sint32 queue_type=10;
  38. sint32 data_direction=11;
  39. sint32 expected_values_set=12;
  40. sint32 expected_data_direction=13;
  41. int32 expected_transfer_len=14;
  42. int32 expected_out_transfer_len=15;
  43. sint32 sn=16;
  44. }
  45. scst_user_scsi_cmd_parse parse_cmd=5;
  46.  
  47. message scst_user_scsi_cmd_alloc_mem{
  48. sint64 sess_h=1;
  49. repeated sint32 cdb=2;
  50. int32 alloc_len=3;
  51. sint32 queue_type=4;
  52. sint32 data_direction=5;
  53. sint32 sn=6;
  54. }
  55. scst_user_scsi_cmd_alloc_mem alloc_cmd=6;
  56.  
  57. message scst_user_scsi_cmd_exec{
  58. sint64 sess_h=1;
  59. repeated sint32 cdb=2;
  60. sint32 cdb_len=3;
  61. int64 lba=4;
  62. int64 data_len=5;
  63. int32 bufflen=6;
  64. int32 alloc_len=7;
  65. sint64 pbuf=8;
  66. sint32 queue_type=9;
  67. sint32 data_direction=10;
  68. sint32 partial=11;
  69. int32 timeout=12;
  70.  
  71. sint64 p_out_buf=13;
  72. int32 out_bufflen=14;
  73.  
  74. sint32 sn=15;
  75.  
  76. sint32 parent_cmd_h=16;
  77. int32 parent_cmd_data_len=17;
  78. sint32 partial_offset=18;
  79. }
  80. scst_user_scsi_cmd_exec exec_cmd=7;
  81.  
  82. message scst_user_scsi_on_free_cmd{
  83. sint64 pbuf=1;
  84. int32 resp_data_len=2;
  85. sint32 buffer_cached=3;
  86. sint32 aborted=4;
  87. sint32 status=5;
  88. sint32 delivery_status=6;
  89. }
  90. scst_user_scsi_on_free_cmd on_free_cmd=8;
  91.  
  92. message scst_user_on_cached_mem_free{
  93. sint64 pbuf=1;
  94. }
  95. scst_user_on_cached_mem_free on_cached_mem_free=9;
  96.  
  97. message scst_user_tm{
  98. sint64 sess_h=1;
  99. sint32 fn=2;
  100. sint32 cmd_h_to_abort=3;
  101. sint32 cmd_sn=4;
  102. sint32 cmd_sn_set=5;
  103. }
  104. scst_user_tm tm_cmd=10;
  105.  
  106. message scst_user_ext_copy_remap{
  107. sint64 sess_h=1;
  108. sint64 src_sess_h=2;
  109. sint64 dst_sess_h=3;
  110. message scst_user_ext_copy_data_descr{
  111. sint64 src_lba=1;
  112. sint64 dst_lba=2;
  113. int32 data_len=3;
  114. }
  115. scst_user_ext_copy_data_descr data_descr=4;
  116. }
  117. scst_user_ext_copy_remap remap_cmd=11;
  118. }
  119. scst_user_get_cmd cmd=2;
  120.  
  121. message vdisk_dev{
  122. int32 scst_usr_fd=1;
  123. sint32 block_size=2;
  124. sint64 nblocks=3;
  125. int32 block_shift=4;
  126. int64 file_size=5;
  127. //pthread_mutex_t dev_mutex; - видимо опустим это поле
  128. sint32 rd_only_flag=6;
  129. sint32 wt_flag=7;
  130. sint32 nv_cache=8;
  131. sint32 o_direct_flag=9;
  132. sint32 media_changed=10;
  133. sint32 prevent_allow_medium_removal=11;
  134. sint32 nullio=12;
  135. sint32 cdrom_empty=13;
  136. sint32 non_blocking=14;
  137. //#if defined(DEBUG_TM_IGNORE) || defined(DEBUG_TM_IGNORE_ALL)
  138. // unsigned int debug_tm_ignore:1;
  139. //#if defined(DEBUG_TM_IGNORE_ALL)
  140. // volatile int debug_tm_ignore_all;
  141. //#endif
  142. //#endif - это мы тоже не передаём
  143. message vdisk_tgt_dev{
  144. sint64 sess_h=1;
  145. }
  146. repeated vdisk_tgt_dev tgt_devs=15;
  147. string name=16;
  148. string file_name=17;
  149. string usn=18;
  150. int32 type=19;
  151. }
  152. vdisk_dev dev=3;
  153.  
  154. sint32 may_need_to_free_pbuf = 4;
  155.  
  156. message scst_user_reply_cmd{
  157. sint32 cmd_h=1;
  158. sint32 subcode=2;
  159. int32 result=3;
  160.  
  161. message scst_user_scsi_cmd_reply_parse{
  162. sint32 status=1;
  163. //_________________________
  164. sint32 queue_type=2;
  165. sint32 data_direction=3;
  166. sint32 cdb_len=4;
  167. int64 lba=5;
  168. int64 data_len=6;
  169. int32 bufflen=7;
  170. sint32 op_flags=8;
  171. int32 out_bufflen=9;
  172. //_________________________
  173. sint32 sense_len=10;
  174. sint64 psense_buffer=11;
  175. }
  176. scst_user_scsi_cmd_reply_parse parse_reply=4;
  177.  
  178. message scst_user_scsi_cmd_reply_alloc_mem{
  179. sint64 pbuf=1;
  180. }
  181. scst_user_scsi_cmd_reply_alloc_mem alloc_reply=5;
  182.  
  183. message scst_user_scsi_cmd_reply_exec{
  184. int32 resp_data_len=1;
  185. sint64 pbuf=2;
  186. sint32 reply_type=3;
  187. sint32 status=4;
  188. //_________________________
  189. sint32 sense_len=5;
  190. sint64 psense_buffer=6;
  191. //_________________________
  192. sint32 ws_descriptors_len=7;
  193. sint64 ws_descriptors=8;
  194. }
  195. scst_user_scsi_cmd_reply_exec exec_reply=6;
  196.  
  197. message scst_user_ext_copy_reply_remap{
  198. sint64 remap_descriptors=1;
  199. sint32 remap_descriptors_len=2;
  200. sint32 status=3;
  201. sint32 sense_len=4;
  202. sint64 psense_buffer=5;
  203. }
  204. scst_user_ext_copy_reply_remap remap_reply=7;
  205. }
  206. scst_user_reply_cmd reply=5;
  207.  
  208. repeated sint32 sense = 6;
  209. };
  210.  
  211. message Response{
  212. bool ok = 1;
  213. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement