mirror of
				https://github.com/RetroShare/RetroShare.git
				synced 2025-10-31 14:49:14 -04:00 
			
		
		
		
	Updated proto files:
* Added TransferList & Control Download to files.proto * Added Search functionality to search.proto * Cleaned up core a little. * Added Partial Success code. NOTE: Incompatible Changes - be sure to refresh all generated files. git-svn-id: http://svn.code.sf.net/p/retroshare/code/branches/v0.5-gxs-b1@5527 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
		
							parent
							
								
									138f462669
								
							
						
					
					
						commit
						277b8e66ae
					
				
					 5 changed files with 224 additions and 159 deletions
				
			
		|  | @ -1,7 +1,7 @@ | |||
| 
 | ||||
| EXEC = protoc | ||||
| #PROTO = core.proto peers.proto system.proto chat.proto files.proto  gxs.proto  msgs.proto 
 | ||||
| PROTO = core.proto peers.proto system.proto chat.proto  | ||||
| #PROTO = core.proto peers.proto system.proto chat.proto search.proto files.proto  gxs.proto  msgs.proto 
 | ||||
| PROTO = core.proto peers.proto system.proto chat.proto search.proto files.proto | ||||
| 
 | ||||
| PROTOPATH = ./definition | ||||
| #CDESTPATH = ./gencc
 | ||||
|  |  | |||
|  | @ -15,9 +15,11 @@ enum PackageId { | |||
|   PEERS = 1;  | ||||
|   SYSTEM = 2; | ||||
|   CHAT = 3; | ||||
|   SEARCH = 4; | ||||
|   FILES = 5; | ||||
|   // BELOW HERE IS STILL BEING DESIGNED. | ||||
|   //FILES = 4; | ||||
|   //MSGS = 5; | ||||
|   //TRANSFER = 6; | ||||
| 
 | ||||
|   // THEORETICAL ONES. | ||||
|   GXS = 1000;  | ||||
|  | @ -32,9 +34,11 @@ message Status { | |||
|     FAILED        	= 0; | ||||
|     NO_IMPL_YET		= 1; | ||||
|     INVALID_QUERY 	= 2; | ||||
|     SUCCESS       	= 3; | ||||
|     READMSG       	= 4; | ||||
|     PARTIAL_SUCCESS   	= 3; | ||||
|     SUCCESS       	= 4; | ||||
|     READMSG       	= 5; | ||||
|   } | ||||
| 
 | ||||
|   required StatusCode code = 1; | ||||
|   optional string msg = 2; | ||||
| } | ||||
|  | @ -89,11 +93,12 @@ message Person { | |||
| message File { | ||||
|   required string name = 1; | ||||
|   required string hash = 2; | ||||
|   required int64  size = 3; | ||||
| 
 | ||||
|   optional string path = 4; | ||||
|   optional string avail = 5; | ||||
|   required uint64 size = 3; | ||||
| 
 | ||||
|   // THINK WE DONT WANT THESE HERE... | ||||
|   // BETTER TO KEEP File simple. | ||||
|   //optional string path = 4; | ||||
|   //optional string avail = 5; | ||||
| } | ||||
| 
 | ||||
| message Dir { | ||||
|  |  | |||
|  | @ -3,197 +3,115 @@ package rsctrl.files; | |||
| import "core.proto"; | ||||
| 
 | ||||
| /////////////////////////////////////////////////////////////// | ||||
| // Mirror most of rsFiles functionality. | ||||
| // | ||||
| // Share Directories. | ||||
| // Searches | ||||
| // List Transfers. | ||||
| // Control Transfers. | ||||
| // | ||||
| // TODO: | ||||
| // Share Directories. | ||||
| /////////////////////////////////////////////////////////////// | ||||
| 
 | ||||
| enum RequestMsgIds { | ||||
|     MsgId_RequestPeers = 1; | ||||
|     MsgId_RequestAddPeer = 2; | ||||
|     MsgId_RequestModifyPeer = 3; | ||||
|     MsgId_RequestTransferList 		= 1; | ||||
|     MsgId_RequestControlDownload   	= 2; | ||||
| } | ||||
| 
 | ||||
| enum ResponseMsgIds { | ||||
|     MsgId_ResponsePeerList = 1; | ||||
|     MsgId_ResponseAddPeer = 2; | ||||
|     MsgId_ResponseModifyPeer = 3; | ||||
|     MsgId_ResponseTransferList  	= 1; | ||||
|     MsgId_ResponseControlDownload  	= 2; | ||||
| } | ||||
| 
 | ||||
| /////////////////////////////////////////////////////////////// | ||||
| /////////////////////////////////////////////////////////////// | ||||
| // SEARCH (start). | ||||
| 
 | ||||
| // REQUEST: RequestBasicSearch | ||||
| message RequestBasicSearch { | ||||
| // Building Blocks | ||||
| 
 | ||||
|   repeated string terms = 1; | ||||
| enum Direction { | ||||
|     DIRECTION_UPLOAD    = 1; | ||||
|     DIRECTION_DOWNLOAD  = 2; | ||||
| } | ||||
| 
 | ||||
| // REQUEST: RequestAdvSearch | ||||
| message RequestAdvSearch { | ||||
| message FileTransfer { | ||||
| 
 | ||||
|   repeated string terms = 1; | ||||
|   required rsctrl.core.File file 	= 1; | ||||
|   required Direction direction		= 2; | ||||
|   required float fraction		= 3; | ||||
|   required float rate_kBs		= 4; | ||||
| } | ||||
| 
 | ||||
| /////////////////////////////////////////////////////////////// | ||||
| // Transfer List. | ||||
| 
 | ||||
| // RESPONSE: ResponseSearchId | ||||
| message ResponseSearchId { | ||||
| // REQUEST: RequestTransferList | ||||
| message RequestTransferList { | ||||
|   required Direction direction = 1; | ||||
| } | ||||
| 
 | ||||
| // RESPONSE: ResponseTransferList | ||||
| message ResponseTransferList { | ||||
| 
 | ||||
|   required rsctrl.core.Status status = 1; | ||||
|   required string search_id = 2; | ||||
|   repeated FileTransfer transfers = 2; | ||||
| 
 | ||||
| } | ||||
| 
 | ||||
| /////////////////////////////////////////////////////////////// | ||||
| // SEARCH (list) | ||||
| // Download. | ||||
| 
 | ||||
| // REQUEST: RequestControlDownload | ||||
| // START requires name, hash & size. | ||||
| // other actions only require file hash. | ||||
| message RequestControlDownload { | ||||
| 
 | ||||
| // REQUEST: RequestSearchResults | ||||
| message RequestSearchResults { | ||||
| 
 | ||||
|   enum SetCmd { | ||||
|     ALLIDS = 1; 	// All  | ||||
|     LISTED = 2; 	// Only Search Ids in the Vector. | ||||
|   } | ||||
| 
 | ||||
|   required SetCmd set = 1; | ||||
|   repeated string search_ids = 2; | ||||
| } | ||||
| 
 | ||||
| // Building Block | ||||
| message SearchHit { | ||||
| 
 | ||||
|   enum LocFlag { | ||||
|     LOCAL 	= 1; 	// We Have it. | ||||
|     FRIEND 	= 2; 	// Browsable | ||||
|     NETWORK 	= 4; 	// Network. | ||||
|   enum Action { | ||||
|     ACTION_START    = 1; 	// start download. | ||||
|     ACTION_CONTINUE = 2; 	// move to top of queue. | ||||
|     ACTION_WAIT     = 3;	// send to bottom of queue. | ||||
|     ACTION_PAUSE    = 4; 	// hold indefinitely.  | ||||
|     ACTION_RESTART  = 5; 	// end pause, restart download. | ||||
|     ACTION_CHECK    = 6; 	// force check. | ||||
|     ACTION_CANCEL   = 7; 	// remove permenantly. | ||||
|   } | ||||
| 
 | ||||
|   required rsctrl.core.File file 	= 1; | ||||
|   required uint32 no_hits 		= 2; | ||||
|   required LocFlag loc 			= 3; | ||||
|   required Action action 		= 2; | ||||
| 
 | ||||
| } | ||||
| 
 | ||||
| message SearchSet { | ||||
| 
 | ||||
|   required string search_id			= 1; | ||||
| 
 | ||||
|   enum SearchType { | ||||
|     BASIC 	= 1; 	// Stuff. | ||||
|     ADVANCED 	= 2; 	// Stuff. | ||||
|   } | ||||
| 
 | ||||
|   // One of these will be filled in depending on flag. | ||||
| 
 | ||||
|   required SearchType         search_type	= 2; | ||||
|   optional RequestBasicSearch basic_req		= 3; | ||||
|   optional RequestAdvSearch   adv_req		= 4; | ||||
| 
 | ||||
|   repeated SearchHit	      hits		= 5; | ||||
| 
 | ||||
| } | ||||
| 
 | ||||
| // RESPONSE: ResponseSearchResults | ||||
| message ResponseSearchResults { | ||||
| 
 | ||||
| // RESPONSE: ResponseControlDownload | ||||
| message ResponseControlDownload { | ||||
|   required rsctrl.core.Status status = 1; | ||||
|   repeated SearchSet searches = 2; | ||||
| } | ||||
| 
 | ||||
| 
 | ||||
| /////////////////////////////////////////////////////////////// | ||||
| // SEARCH (cancel) | ||||
| 
 | ||||
| // REQUEST: RequestCloseSearch | ||||
| message RequestCloseSearch { | ||||
| 
 | ||||
|   required string search_id = 2; | ||||
| } | ||||
| 
 | ||||
| 
 | ||||
| // RESPONSE: ResponseSearchId | ||||
| // As before. | ||||
| 
 | ||||
| 
 | ||||
| /////////////////////////////////////////////////////////////// | ||||
| /////////////////////////////////////////////////////////////// | ||||
| // SHARED FILES | ||||
| // THIS STUFF IS NOT FINISHED YET! | ||||
| // | ||||
| //// REQUEST: RequestListShares | ||||
| //message RequestListShares { | ||||
| // | ||||
| //  required uint32 depth = 1;		// HOW Many Directories to drill down. | ||||
| //  repeated string ShareLocation = 2; | ||||
| //} | ||||
| // | ||||
| //message ShareLocation { | ||||
| //  required string ssl_id = 1; | ||||
| //  required string path = 2; | ||||
| //} | ||||
| // | ||||
| // | ||||
| // | ||||
| //// REQUEST: RequestChangeShares | ||||
| // | ||||
| //// REQUEST: RequestLiCloseSearch | ||||
| //// REQUEST: RequestCloseSearch | ||||
| // | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| // REQUEST: RequestListShares | ||||
| message RequestListShares { | ||||
| 
 | ||||
|   required uint32 depth = 1;		// HOW Many Directories to drill down. | ||||
|   repeated string ShareLocation = 2; | ||||
| } | ||||
| 
 | ||||
| message ShareLocation { | ||||
|   required string ssl_id = 1; | ||||
|   required string path = 2; | ||||
| } | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| // REQUEST: RequestChangeShares | ||||
| 
 | ||||
| // REQUEST: RequestLiCloseSearch | ||||
| // REQUEST: RequestCloseSearch | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| // REQUEST: RequestAddPeer | ||||
| message RequestAddPeer { | ||||
| 
 | ||||
|   enum AddCmd { | ||||
|     NOOP = 0; 		// No op. | ||||
|     ADD = 1; 		// Add existing from gpg_id. | ||||
|     REMOVE = 2; 	// Remove existing from gpg_id. | ||||
|     IMPORT = 3; 	// Import from cert, with gpg_id. | ||||
|     EXAMINE = 4; 	// Examine cert, but no action. | ||||
|   } | ||||
| 
 | ||||
|   required string gpg_id = 1; | ||||
|   required AddCmd cmd = 2; | ||||
|   optional string cert = 3; | ||||
| } | ||||
| 
 | ||||
| // RESPONSE: ResponseAddPeer | ||||
| message ResponseAddPeer { | ||||
|   required rsctrl.core.Status status = 1; | ||||
|   repeated rsctrl.core.Person peers = 2; | ||||
| } | ||||
| 
 | ||||
| /////////////////////////////////////////////////////////////// | ||||
| 
 | ||||
| // REQUEST: RequestModifyPeer | ||||
| message RequestModifyPeer { | ||||
| 
 | ||||
|   enum ModCmd { | ||||
|     NOOP    		= 0; 	 | ||||
|     ADDRESS 		= 1; | ||||
|     DYNDNS  		= 2; | ||||
|     //SOMETHING_ELSE  	= 0x0000010;  | ||||
|     //SOMETHING_ELSE  	= 0x0000020;  | ||||
|     //SOMETHING_ELSE  	= 0x0000040;  | ||||
|     //SOMETHING_ELSE  	= 0x0000080;  | ||||
|   } | ||||
| 
 | ||||
|   required ModCmd cmd = 1;  | ||||
|   //required int64 cmd = 1; // Could we OR the Cmds together? | ||||
|   repeated rsctrl.core.Person peers = 2; | ||||
| } | ||||
| 
 | ||||
| // RESPONSE: ResponseModifyPeer | ||||
| message ResponseModifyPeer { | ||||
|   required rsctrl.core.Status status = 1; | ||||
|   repeated rsctrl.core.Person peers = 2; | ||||
| } | ||||
| 
 | ||||
| /////////////////////////////////////////////////////////////// | ||||
| /////////////////////////////////////////////////////////////// | ||||
| /////////////////////////////////////////////////////////////// | ||||
| 
 | ||||
|  |  | |||
							
								
								
									
										120
									
								
								rsctrl/src/definition/search.proto
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										120
									
								
								rsctrl/src/definition/search.proto
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,120 @@ | |||
| package rsctrl.search; | ||||
| 
 | ||||
| import "core.proto"; | ||||
| 
 | ||||
| /////////////////////////////////////////////////////////////// | ||||
| // Searches | ||||
| /////////////////////////////////////////////////////////////// | ||||
| 
 | ||||
| enum RequestMsgIds { | ||||
|     MsgId_RequestBasicSearch   = 1; | ||||
|     //MsgId_RequestAdvSearch   = 2; // NOT IMPLEMENTED YET.		 | ||||
|     MsgId_RequestCloseSearch   = 3; | ||||
|     MsgId_RequestListSearches  = 4; | ||||
|     MsgId_RequestSearchResults = 5; | ||||
| } | ||||
| 
 | ||||
| enum ResponseMsgIds { | ||||
|     MsgId_ResponseSearchIds = 1; | ||||
|     MsgId_ResponseSearchResults = 5; | ||||
| } | ||||
| 
 | ||||
| /////////////////////////////////////////////////////////////// | ||||
| /////////////////////////////////////////////////////////////// | ||||
| // Building Block | ||||
| message SearchHit { | ||||
| 
 | ||||
|   enum LocFlag { | ||||
|     LOCAL 	= 1; 	// We Have it. | ||||
|     FRIEND 	= 2; 	// Browsable | ||||
|     NETWORK 	= 4; 	// Network. | ||||
|   } | ||||
| 
 | ||||
|   required rsctrl.core.File file 	= 1; | ||||
|   required uint32 loc 			= 2; // OR of LocFlag so uint field | ||||
|   required uint32 no_hits 		= 3; // NOT USED YET. | ||||
| 
 | ||||
| } | ||||
| 
 | ||||
| message SearchSet { | ||||
| 
 | ||||
|   required uint32     search_id			= 1; | ||||
|   repeated SearchHit  hits			= 2; | ||||
| 
 | ||||
| } | ||||
| 
 | ||||
| /////////////////////////////////////////////////////////////// | ||||
| /////////////////////////////////////////////////////////////// | ||||
| // SEARCH (start). | ||||
| 
 | ||||
| // REQUEST: RequestBasicSearch | ||||
| message RequestBasicSearch { | ||||
| 
 | ||||
|   repeated string terms = 1; | ||||
| } | ||||
| 
 | ||||
| // REQUEST: RequestAdvSearch | ||||
| message RequestAdvSearch { | ||||
| 
 | ||||
|   repeated string terms = 1; | ||||
| } | ||||
| 
 | ||||
| 
 | ||||
| // RESPONSE: ResponseSearchIds | ||||
| message ResponseSearchIds { | ||||
| 
 | ||||
|   required rsctrl.core.Status status = 1; | ||||
|   repeated uint32 search_id = 2; | ||||
| } | ||||
| 
 | ||||
| 
 | ||||
| /////////////////////////////////////////////////////////////// | ||||
| // SEARCH (cancel) | ||||
| 
 | ||||
| // REQUEST: RequestCloseSearch | ||||
| message RequestCloseSearch { | ||||
| 
 | ||||
|   required uint32 search_id = 1; | ||||
| } | ||||
| 
 | ||||
| 
 | ||||
| // RESPONSE: ResponseSearchIds | ||||
| // As before. | ||||
| 
 | ||||
| /////////////////////////////////////////////////////////////// | ||||
| // SEARCH (list) | ||||
| 
 | ||||
| // REQUEST: RequestListSearches | ||||
| message RequestListSearches { | ||||
|    // Nothing here. | ||||
| } | ||||
| 
 | ||||
| // RESPONSE: ResponseSearchIds | ||||
| // As before. | ||||
| 
 | ||||
| /////////////////////////////////////////////////////////////// | ||||
| // SEARCH (list) | ||||
| 
 | ||||
| 
 | ||||
| // REQUEST: RequestSearchResults | ||||
| // Empty search_ids => all results. | ||||
| message RequestSearchResults { | ||||
| 
 | ||||
|   repeated uint32 search_ids = 2; | ||||
| 
 | ||||
| } | ||||
| 
 | ||||
| // RESPONSE: ResponseSearchResults | ||||
| message ResponseSearchResults { | ||||
| 
 | ||||
|   required rsctrl.core.Status status = 1; | ||||
|   repeated SearchSet searches = 2; | ||||
| } | ||||
| 
 | ||||
| 
 | ||||
| /////////////////////////////////////////////////////////////// | ||||
| /////////////////////////////////////////////////////////////// | ||||
| /////////////////////////////////////////////////////////////// | ||||
| /////////////////////////////////////////////////////////////// | ||||
| /////////////////////////////////////////////////////////////// | ||||
| 
 | ||||
|  | @ -8,12 +8,12 @@ import "core.proto"; | |||
| 
 | ||||
| enum RequestMsgIds { | ||||
|     MsgId_RequestSystemStatus = 1; | ||||
|     //MsgId_RequestNetConfig = 2; | ||||
|     MsgId_RequestSystemQuit   = 2; | ||||
| } | ||||
| 
 | ||||
| enum ResponseMsgIds { | ||||
|     MsgId_ResponseSystemStatus = 1; | ||||
|     //MsgId_ResponseNetConfig = 2; | ||||
|     MsgId_ResponseSystemQuit   = 2; | ||||
| } | ||||
| 
 | ||||
| /////////////////////////////////////////////////////////////// | ||||
|  | @ -51,6 +51,28 @@ message ResponseSystemStatus { | |||
|   required rsctrl.core.Bandwidth bw_total = 5; | ||||
| } | ||||
| 
 | ||||
| /////////////////////////////////////////////////////////////// | ||||
| 
 | ||||
| // REQUEST: RequestSystemQuit | ||||
| message RequestSystemQuit { | ||||
| 
 | ||||
|   enum QuitCode { | ||||
|     CLOSE_CHANNEL       = 1; | ||||
|     SHUTDOWN_RS         = 2;  // NOT RECOMMENDED (but some people might like it) | ||||
|   } | ||||
| 
 | ||||
|   required QuitCode quit_code = 1; | ||||
| } | ||||
| 
 | ||||
| // RESPONSE: ResponseSystemQuit | ||||
| // Effect potentially immediate (with loss of connection) - only expect a response error. | ||||
| // Shutdown takes longer - so you should get a response. | ||||
| message ResponseSystemQuit { | ||||
| 
 | ||||
|   // Status of response. | ||||
|   required rsctrl.core.Status status = 1; | ||||
| } | ||||
| 
 | ||||
| /////////////////////////////////////////////////////////////// | ||||
| /////////////////////////////////////////////////////////////// | ||||
| /////////////////////////////////////////////////////////////// | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 drbob
						drbob