TSP: The Transport Sample Protocol



Main Page | Modules | Alphabetical List | Data Structures | File List | Data Fields | Globals | Related Pages

tsp_rpc.x

Go to the documentation of this file.
00001 
00029 enum TSP_status_t 
00030 {
00032         TSP_STATUS_OK,
00033 
00035         TSP_STATUS_ERROR_UNKNOWN,
00036 
00041         TSP_STATUS_ERROR_SEE_STRING,    
00042 
00046         TSP_STATUS_ERROR_VERSION,
00047 
00051         TSP_STATUS_ERROR_SYMBOLS        
00052         
00053 };
00054 
00059 struct TSP_answer_open_t
00060 {
00062         int version_id;            
00067         unsigned int channel_id;   
00069         TSP_status_t status;  
00071         string status_str<>;
00072 
00073 };
00074 
00075 
00076 typedef string   TSP_argv_item_t<>;
00077 typedef TSP_argv_item_t TSP_argv_t<>; 
00078 
00084 struct TSP_request_open_t
00085 {
00086   int version_id;        
00090         TSP_argv_t argv;        
00091 
00092 };
00093 
00094 struct TSP_request_close_t
00095 {
00096         int version_id;
00097         unsigned int channel_id;
00098 };
00099 
00100 struct TSP_request_information_t
00101 {
00102         int version_id;
00103         unsigned int channel_id;
00104 };
00105 
00106 struct TSP_request_feature_t
00107 {
00108         int version_id;
00109         unsigned int channel_id;
00110         unsigned int feature_words[4];
00111 };
00112 
00113 
00114 struct TSP_answer_feature_t
00115 {
00116         int version_id;
00117         unsigned int channel_id;
00118         unsigned int feature_words[4];
00119         int int_value;
00120         double double_value;
00121         string string_value<>;
00122 };
00123 
00124 struct TSP_exec_feature_t
00125 {
00126         int version_id;
00127         unsigned int channel_id;
00128         unsigned int feature_words[4];
00129         int int_value;
00130         double double_value;
00131         string string_value<>;
00132 };
00133 
00134 struct TSP_sample_symbol_info_t
00135 {
00136         string name<>;
00137         int provider_global_index;
00138         int provider_group_index;
00139         int provider_group_rank;
00140         opaque xdr_tsp_t[4];
00141         unsigned int dimension;
00142         int period;
00143         int phase; 
00144 };
00145 
00146 
00147 /*struct TSP_sample_symbol_info_list_t
00148 {
00149         TSP_sample_symbol_info_t TSP_sample_symbol_info_list_t<>;
00150 };
00151 */
00152 
00153 typedef TSP_sample_symbol_info_t TSP_sample_symbol_info_list_t<>;
00154 
00155 /*
00156 FIXME : Use it when the consumer will be able
00157 to ask for a given endianity
00158 enum TSP_endianity_t 
00159 {
00160         TSP_PSEUDO_XDR_LITTLE_ENDIAN,
00161         TSP_XDR_BIG_ENDIAN
00162 };*/
00163 
00164 
00165 struct TSP_request_sample_t
00166 {
00167         int version_id;
00168         unsigned int channel_id;
00169         unsigned int feature_words[4];
00170         int consumer_timeout;
00171         TSP_sample_symbol_info_list_t symbols;
00172 
00173         /* TSP_endianity_t data_endianity; FIXME : implementer */
00174 };
00175 
00176 struct TSP_answer_sample_t
00177 {
00178         int version_id;
00179         unsigned int channel_id;
00180 
00181         int provider_timeout;
00182         int provider_group_number;
00183         TSP_sample_symbol_info_list_t symbols;
00184         double base_frequency;
00185         int max_period; 
00186         int max_client_number; 
00187         int current_client_number; 
00188         TSP_status_t status;            
00189 
00190         /*unsigned int feature_words[4]; FIXME*/
00191         /* TSP_endianity_t data_endianity; FIXME : implementer */
00192 
00193 
00194 };
00195 
00196 struct TSP_request_sample_init_t
00197 {
00198         int version_id;
00199         unsigned int channel_id;
00200 };
00201 
00202 struct TSP_answer_sample_init_t
00203 {
00204         int version_id;
00205         unsigned int channel_id;
00206         string data_address<>;          
00207         TSP_status_t status;                    
00208 };
00209 
00210 
00211 /* FIXME : utiliser ca...*/
00212 struct TSP_asynchronous_sample_symbol_t
00213 {
00214         int provider_index;
00215 };
00216 
00217 
00218 /* FIXME : implementer */
00219 struct TSP_request_sample_destroy_t
00220 {
00221         int version_id;
00222         unsigned int channel_id;        
00223 };
00224 
00225 /* FIXME : implementer */
00226 struct TSP_answer_sample_destroy_t
00227 {
00228         int version_id;
00229         unsigned int channel_id;        
00230         int status;
00231 };
00232 
00233 
00234 
00235 /* This structure is not part of TSP Protocol*/
00236 struct TSP_provider_info_t{
00237         string info<>;
00238 };
00239 
00240 
00241 /*------------------------------------------------------*/
00242 /*              RPC Functions for TSP Provider          */
00243 /*------------------------------------------------------*/
00244 program TSP_RPC {
00245 
00246         version TSP_RPC_VERSION_INITIAL {
00247 
00248         
00249 
00250         /* This function is not part of TSP Protocol */ 
00251         TSP_provider_info_t     TSP_PROVIDER_INFORMATION(void) = 101;
00252 
00253         
00254         /* TSP Protocol */      
00255 
00256         TSP_answer_open_t               TSP_REQUEST_OPEN(TSP_request_open_t req_open) = 102;
00257         
00258         void                            TSP_REQUEST_CLOSE(TSP_request_close_t req_close) = 103;
00259         
00260         TSP_answer_sample_t             TSP_REQUEST_INFORMATION(TSP_request_information_t req_info) = 104;
00261         
00262         TSP_answer_feature_t            TSP_REQUEST_FEATURE(TSP_request_feature_t req_feature) = 105;
00263         
00264         TSP_answer_sample_t             TSP_REQUEST_SAMPLE(TSP_request_sample_t req_sample) = 106;
00265         
00266         TSP_answer_sample_init_t        TSP_REQUEST_SAMPLE_INIT(TSP_request_sample_init_t req_sample) = 107;
00267         
00268         TSP_answer_sample_destroy_t     TSP_REQUEST_SAMPLE_DESTROY(TSP_request_sample_destroy_t req_destroy) = 108;
00269         
00270         void                            TSP_EXEC_FEATURE(TSP_exec_feature_t exec_feature) = 109;
00271         
00272 
00273         } = 1;
00274 } = 0x31230010 ;
00275 
00276 
00279 #ifdef RPC_CLNT
00280 %
00281 %int tsp_wrap_rpc_clnt_set_timeout(CLIENT *client, int timeout)
00282 %{
00283 %       static struct timeval   tv;
00284 %    
00285 %       /* RPC timeout definition */
00286 %       /* ----------------------- */
00287 %       tv.tv_sec  = timeout;
00288 %       tv.tv_usec = 0;
00289 %       return clnt_control(client, CLSET_TIMEOUT, (char *)&tv);
00290 %}
00291 #endif
00292 
00293 %#define TSP_STRACE_RPC_ERROR(cl, pResult) if(!pResult)  {  STRACE_ERROR(("%s", clnt_sperror(cl, "")));  }
Framework Home Page.

Beware !! TSP wave is coming...