2 * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
19 * @brief \~english RPC library --API define header file
21 /** @addtogroup BaseSystem
24 /** @addtogroup other_service
28 /** @addtogroup rpc_library
29 * @ingroup other_service
32 #ifndef OTHERSERVICE_RPC_H_ // NOLINT(build/header_guard)
33 #define OTHERSERVICE_RPC_H_ // NOLINT(build/header_guard)
38 #include <other_service/rpc_id.h>
45 * @brief \~english RPC_ID max number
47 #define RPC_MAX_THREADS_IN_PROCESS 64
49 /** @brief \~english fd max number in one process.
50 * 0 = main/sub thread communication pipe fd.
51 * 1 = inotify() process listen fd.
52 * 2~129 = even num : API request data socket.
53 * odd num : secure stream socket.
55 #define RPC_MAX_FD_IN_PROCESS 130
58 #define RPC_MAX_API_ARG_NUM 8
59 ///< \~english API call parameter max num
62 #define RPC_MAX_API_ARG_SIZE 1024
63 ///< \~english API call one parameter max byte
65 #define RPC_MAX_API_ARG_TOTAL_SIZE 1500
66 ///< \~english API call all parameter max byte
68 #define RPC_MAX_APICALL_QUEUE 16
69 ///< \~english API call max queue num
72 ///< \~english invalid port num
74 /** @brief \~english RPC library function return value
76 enum rpc_result { // NOLINT (readability/nolint)
77 RPC_OK = 0, ///< \~english ok
78 RPC_ERR_No_Response = 0x8fff0000, ///< \~english has no response
79 RPC_ERR_Timeout, ///< \~english timeout
80 RPC_ERR_Busy, ///< \~english busy
81 RPC_ERR_API_Error, ///< \~english API error
82 RPC_ERR_API_Fatal, ///< \~english API fatal
83 RPC_ERR_Fatal, ///< \~english fatal
84 RPC_ERR_Configuration, ///< \~english configuration
85 RPC_ERR_Server_DeadLock, ///< \~english server deadlock
86 RPC_ERR_Server_Finish, ///< \~english server finish
87 RPC_ERR_Reject_connect, ///< \~english reject connect
89 /** @brief \~english RPC library function return type
92 typedef INT32 RPC_Result;
94 /** @brief \~english RPC ID
97 typedef UINT32 RPC_ID;
99 #define RPC_NO_ID RPC_NO_PORT
100 ///< \~english The ID when destination is invalid
102 #define RPC_SELF_ID RPC_NO_PORT
103 ///< \~english The ID when destination is self
105 /** @brief \~english The ID when destination is any
107 #define RPC_ANY_ID RPC_NO_PORT
110 typedef RPC_Result (*RPC_dispatch_func_t)(UINT16 api_num,
111 const char *args_string,
112 unsigned int args_size,
114 unsigned int *ret_bytes);
116 #ifdef RPC_DISPATCH_FUNC
117 #error "Please include <rpc.h> before \"*_srvr.h\"."
118 #else /* !RPC_DISPATCH_FUNC */
119 #define RPC_DISPATCH_FUNC NULL
120 #endif /* !RPC_DISPATCH_FUNC */
122 /* RPC Library Start Function Macro */
123 /////////////////////////////////////////////////////////////////////////////////////
124 /// \ingroup RPC_START_SERVER
125 /// \~english @par Brief
126 /// server start(certification of the client by UID)
127 /// \~english @param [in] ID
128 /// RPC_ID - program's RPC_ID
129 /// \~english @retval RPC_OK Normal End
130 /// \~english @retval RPC_ERR_Fatal Fatal Error
131 /// \~english @par Prerequisite
133 /// \~english @par Change of internal state
135 /// \~english @par Conditions of processing failure
136 /// - Case of an input parameter error
137 /// - Case of fail to information generation
138 /// - When RPC_start has already been issued
139 /// - Case of space reservation fails
140 /// - Case of socket generation fails
141 /// - Case of socket allocation fails
142 /// - Case of creating a pipe fails
144 /// \~english @par Classification
146 /// \~english @par Type
148 /// \~english @par Detail
149 /// - Used when the server program of RPC-API performs RPC library use start processing
150 /// - ID specifies a symbol in the form of XXX_RPC_ID defined by rpc_id.h
151 /// - Only one server program is permitted per thread
152 /// - When the server program calls the API as a client of another server,
153 /// it only needs to call RPC_START_SERVER, there is no need to call RPC_START_CLIENT
154 /// \~english @see RPC_start, RPC_end
155 ////////////////////////////////////////////////////////////////////////////////////
156 #define RPC_START_SERVER(ID) RPC_start((ID), RPC_DISPATCH_FUNC, NULL, NO_SECURE_CHECK)
158 /////////////////////////////////////////////////////////////////////////////////////
159 /// \ingroup RPC_START_SECURE_SERVER
160 /// \~english @par Brief
161 /// server start(certification of the client by UID)
162 /// \~english @param [in] ID
163 /// RPC_ID - program's RPC_ID
164 /// \~english @retval RPC_OK Normal End
165 /// \~english @retval RPC_ERR_Fatal Fatal Error
166 /// \~english @par Prerequisite
168 /// \~english @par Change of internal state
170 /// \~english @par Conditions of processing failure
171 /// - Case of an input parameter error
172 /// - Case of fail to information generation
173 /// - When RPC_start has already been issued
174 /// - Case of space reservation fails
175 /// - Case of socket generation fails
176 /// - Case of socket allocation fails
177 /// - Case of creating a pipe fails
179 /// \~english @par Classification
181 /// \~english @par Type
183 /// \~english @par Detail
184 /// - Used when the server program of RPC-API performs RPC library use start processing
185 /// - ID specifies a symbol in the form of XXX_RPC_ID defined by rpc_id.h
186 /// - Only one server program is permitted per thread
187 /// - When the server program calls the API as a client of another server,
188 /// it only needs to call RPC_START_SERVER, there is no need to call RPC_START_CLIENT
189 /// \~english @see RPC_start, RPC_end
190 ////////////////////////////////////////////////////////////////////////////////////
191 #define RPC_START_SECURE_SERVER(ID) RPC_start((ID), RPC_DISPATCH_FUNC, NULL, NEED_SECURE_CHECK)
193 /////////////////////////////////////////////////////////////////////////////////////
194 /// \ingroup RPC_START_CLIENT
195 /// \~english @par Brief
197 /// \~english @param [out] pID
198 /// RPC_ID * - auto allocated program's RPC_ID
199 /// \~english @retval RPC_OK Normal End
200 /// \~english @retval RPC_ERR_Fatal Fatal Error
201 /// \~english @par Prerequisite
203 /// \~english @par Change of internal state
205 /// \~english @par Conditions of processing failure
206 /// - input parameter error
207 /// - Unable to get the rpc lib info for the self-thread.
208 /// - Memory allocation fail for id info.
209 /// - Socket generation fail.
210 /// - Socket allocation fail.
211 /// - Unable to get the socket name.
213 /// \~english @par Classification
215 /// \~english @par Type
217 /// \~english @par Detail
218 /// - This macro supports only client function of RPC library.
219 /// - Run the start processing by using this macro only when the APIs provided by the other program are called.
220 /// \~english @see RPC_start, RPC_end
221 ////////////////////////////////////////////////////////////////////////////////////
222 #define RPC_START_CLIENT(pID) RPC_start((UINT16)RPC_NO_ID, NULL, (pID), NO_SECURE_CHECK)
223 //!< \~english client start
225 /* Client authentication by registering the server's UID list */
226 #define NEED_SECURE_CHECK 1 ///< \~english has secure check
227 #define NO_SECURE_CHECK 0 ///< \~english has no secure check
229 /* Setting whether to register UID list of server */
230 #define REGISTERED 1 ///< \~english registered
231 #define NO_REGISTERED 0 ///< \~english not registered
233 /* API Function Prototypes in the RPC Library */
234 RPC_Result RPC_start(RPC_ID id, RPC_dispatch_func_t func, RPC_ID *pID, INT32 secure_check); // NOLINT (readability/nolint)
236 /////////////////////////////////////////////////////////////////////////////////////
237 /// \ingroup RPC_get_fd
238 /// \~english @par Brief
239 /// Get the file descriptor to judge whether there is the request of RPC-API call or not.
240 /// \~english @param [in] id
241 /// RPC_ID - server program's RPC_ID
242 /// \~english @param [out] fd
243 /// int * - area for fd
244 /// \~english @retval RPC_OK Normal End
245 /// \~english @retval RPC_ERR_Fatal Fatal Error
246 /// \~english @par Prerequisite
247 /// RPC_START_SERVER or RPC_START_SECURE_SERVER is already called.
248 /// \~english @par Change of internal state
250 /// \~english @par Conditions of processing failure
251 /// - Argument(id) is RPC_NO_ID.
252 /// - Argument(fd) is NULL.
253 /// - Unable to get the rpc lib info for the self-thread.
254 /// - RPC sub thread doesn't exist.
256 /// \~english @par Classification
258 /// \~english @par Type
260 /// \~english @par Detail
261 /// - This function returns the fd(file descriptor) to judge whether there is the request to server.
262 /// - Return value(fd) is used only for poll function or select function parameter.
264 /// - To get fd from this function.
265 /// - Wait for the data to use poll function or select function.
266 /// - After that, call RPC_process_API_request function.
267 /// - As a result, the API call request from client is done(that is, run the server API).
268 /// \~english @see None
269 ////////////////////////////////////////////////////////////////////////////////////
270 RPC_Result RPC_get_fd(RPC_ID id, int *fd); // NOLINT (readability/nolint)
272 /////////////////////////////////////////////////////////////////////////////////////
273 /// \ingroup RPC_process_API_request
274 /// \~english @par Brief
275 /// Run the processing of RPC-API call
276 /// \~english @param [in] id
277 /// RPC_ID - server program's RPC_ID
278 /// \~english @retval RPC_OK Normal End
279 /// \~english @retval RPC_ERR_Fatal Fatal Error
280 /// \~english @par Prerequisite
281 /// RPC_START_SERVER or RPC_START_SECURE_SERVER is already called.
282 /// \~english @par Change of internal state
284 /// \~english @par Conditions of processing failure
285 /// - Argument(id) is RPC_NO_ID.
286 /// - Unable to get the rpc lib info for the self-thread.
287 /// - RPC sub thread doesn't exist.
288 /// - fail to send UDP packet.
289 /// - API processing from the client returns the error.
291 /// \~english @par Classification
293 /// \~english @par Type
295 /// \~english @par Detail
296 /// - Process all the queued API running requests from the client.
297 /// - API function of server program is called in this function.
298 /// - If there are no requests to run API, this function doesn't wait and return immediately.
299 /// \~english @see None
300 ////////////////////////////////////////////////////////////////////////////////////
301 RPC_Result RPC_process_API_request(RPC_ID id); // NOLINT (readability/nolint)
303 /////////////////////////////////////////////////////////////////////////////////////
305 /// \~english @par Brief
306 /// End processing of RPC library.
307 /// \~english @param [in] id
308 /// RPC_ID - program's RPC_ID
309 /// \~english @retval None
310 /// \~english @par Prerequisite
311 /// RPC_START_SERVER or RPC_START_SECURE_SERVER or RPC_START_CLIENT is already called.
312 /// \~english @par Change of internal state
314 /// \~english @par Conditions of processing failure
316 /// \~english @par Classification
318 /// \~english @par Type
320 /// \~english @par Detail
321 /// - End processing(socket close and memory release etc) is done.
322 /// - When there are no more program that uses RPC_ID, RPC sub thread started by RPC_start will be ended.
323 /// - Need to call this function before the program is ended.
324 /// - Need to call this function from which the thread called RPC_start.
325 /// - Nothing is done when incorrect or no more used RPC_ID is designated.
326 /// \~english @see None
327 ////////////////////////////////////////////////////////////////////////////////////
328 void RPC_end(RPC_ID id); // NOLINT (readability/nolint)
330 ////////////////////////////////////////////////////////////////////////////////
331 /// \ingroup RPC_end_all
332 /// \~english @par Brief
333 /// End processing of RPC library(forcing to clean up).
334 /// \~english @par Prerequisite
336 /// \~english @par Change of internal state
338 /// \~english @par Conditions of processing failure
340 /// \~english @par Classification
342 /// \~english @par Type
344 /// \~english @par Detail
345 /// Delete the socket files created in process for communication. /n
346 /// The program which use RPC library must call RPC_end() to free resource, /n
347 /// This API is used for insurance processing when socket file's link lost. /n
348 /// 1,Before process ends, call this API. /n
349 /// When process is ending, auto running socket's close and memory free is not work. /n
350 /// 2,After called this API, all the RPC's process(both server and client) become to useless. /n
351 /// Even if after called this API, call RPC_START to repair it also can't make sure to active. /n
352 /// RPC library which use Unix autobind is nothing to do. /n
353 /// \~english @see None
354 ////////////////////////////////////////////////////////////////////////////////
355 void RPC_end_all(void); // NOLINT (readability/nolint)
357 /////////////////////////////////////////////////////////////////////////////////////
358 /// \ingroup RPC_set_API_timeout
359 /// \~english @par Brief
360 /// Set timeout time for server side API processing time
361 /// \~english @param [in] sec
362 /// INT32 - timeout time
363 /// \~english @retval RPC_OK Normal End
364 /// \~english @retval RPC_ERR_Fatal Fatal Error
365 /// \~english @retval RPC_ERR_Configuration Argument is out of range
366 /// \~english @par Prerequisite
367 /// RPC_START_SERVER or RPC_START_SECURE_SERVER is already called.
368 /// \~english @par Change of internal state
370 /// \~english @par Conditions of processing failure
371 /// - Unable to get the rpc lib info for the self-thread.
372 /// - Server id info doesn't exist.
373 /// - Info for API call reception processing doesn't exist.
375 /// - The value of the argument(sec) is out of range.
376 /// - RPC_ERR_Configuration
377 /// \~english @par Classification
379 /// \~english @par Type
381 /// \~english @par Detail
383 /// \~english @see None
384 ////////////////////////////////////////////////////////////////////////////////////
385 RPC_Result RPC_set_API_timeout(INT32 sec); // NOLINT (readability/nolint)
388 ////////////////////////////////////////////////////////////////////////////////
389 /// \ingroup RPC_is_server_ready
390 /// \~english @par Brief
391 /// Return RPC server's status
392 /// \~english @param [in] id
393 /// RPC_ID - server program's RPC_ID
395 /// \~english @retval RPC_OK : Success
396 /// \~english @retval RPC_ERR_No_Response : No response
398 /// \~english @par Prerequisite
400 /// \~english @par Change of internal state
402 /// \~english @par Conditions of processing failure
404 /// \~english @par Classification
406 /// \~english @par Type
408 /// \~english @par Detail
409 /// return the server's work status.
410 /// \~english @see None
411 ////////////////////////////////////////////////////////////////////////////////
412 RPC_Result RPC_is_server_ready(RPC_ID id); // NOLINT (readability/nolint)
414 /////////////////////////////////////////////////////////////////////////////////////
415 /// \ingroup RPC_regist_credential
416 /// \~english @par Brief
417 /// Register UID and GID list
418 /// \~english @param [in] uid_num
419 /// int - UID number to regist(number of elements of UID list)
420 /// \~english @param [in] uid_list
421 /// uid_t* - head pointer of UID list
422 /// \~english @param [in] gid_num
423 /// int - GID number to regist(number of elements of GID list)
424 /// \~english @param [in] uid_list
425 /// gid_t* - head pointer of GID list
426 /// \~english @retval RPC_OK Normal End
427 /// \~english @retval RPC_ERR_Fatal Fatal Error
428 /// \~english @retval RPC_ERR_Configuration Argument is out of range
429 /// \~english @par Prerequisite
430 /// RPC_START_SECURE_SERVER is already called.
431 /// \~english @par Change of internal state
433 /// \~english @par Conditions of processing failure
434 /// - Unable to get the rpc lib info for the self-thread.
435 /// - Server id info doesn't exist.
436 /// - Info for API call reception processing doesn't exist.
437 /// - Arguments(client_uid and client_gid) are NULL.
438 /// - Client authentication check is not necessary.
439 /// - Authentication info is already registered.
440 /// - Memory allocation fail for UID and GID lists.
442 /// - Values of Arguments(uid_num and gid_num) are out of range.
443 /// - RPC_ERR_Configuration
444 /// \~english @par Classification
446 /// \~english @par Type
448 /// \~english @par Detail
449 /// - Register the UID and GID lists acceptable by the RPC server.
450 /// - If RPC_START_SECURE_SERVER is not called, this function returns the error.
451 /// \~english @see None
452 ////////////////////////////////////////////////////////////////////////////////////
453 RPC_Result RPC_regist_credential(int uid_num, uid_t *uid_list, int gid_num, gid_t *gid_list); // NOLINT (readability/nolint)
455 /////////////////////////////////////////////////////////////////////////////////////
456 /// \ingroup RPC_get_client_credential
457 /// \~english @par Brief
458 /// Get UID and GID of client that requested to run APIs processing
459 /// \~english @param [out] client_uid
460 /// uid_t* - UID of client that requested to run APIs processing
461 /// \~english @param [out] client_gid
462 /// gid_t* - GID of client that requested to run APIs processing
463 /// \~english @retval RPC_OK Normal End
464 /// \~english @retval RPC_ERR_Fatal Fatal Error
465 /// \~english @par Prerequisite
466 /// RPC_START_SECURE_SERVER is already called.
467 /// \~english @par Change of internal state
469 /// \~english @par Conditions of processing failure
470 /// - Server id info doesn't exist.
471 /// - Info for API call reception processing doesn't exist.
472 /// - Arguments(client_uid and client_gid) are NULL.
473 /// - Client authentication check is not necessary.
474 /// - There are no running clients.
475 /// - Info for the running client is not applicable.
477 /// \~english @par Classification
479 /// \~english @par Type
481 /// \~english @par Detail
482 /// - This function is to get UID and GID of client that requested to run APIs processing.
483 /// - If RPC_START_SECURE_SERVER is not called, this function returns the error.
484 /// - If the running client doesn't exist, this function returns the error.
485 /// \~english @see None
486 ////////////////////////////////////////////////////////////////////////////////////
487 RPC_Result RPC_get_client_credential(uid_t *client_uid, gid_t *client_gid); // NOLINT (readability/nolint)
490 * The following are only used in stub files
492 #define RPC_RETCODE_LEN 9
494 #define RPC_MARSHALL_FLAG_BITS_CODE 12
495 #define RPC_MARSHALL_FLAG_BITS_IS_VARARRAY 1
496 #define RPC_MARSHALL_FLAG_BITS_IS_POINTER 1
497 #define RPC_MARSHALL_FLAG_BITS_IN_OUT 2
499 /** @brief \~english APIcall property stored struct
503 UINT32 all; ///< \~english all property
505 unsigned int code: RPC_MARSHALL_FLAG_BITS_CODE; ///< \~english value type
506 /** @brief \~english vararray or not
509 unsigned int is_vararray: RPC_MARSHALL_FLAG_BITS_IS_VARARRAY;
510 /** @brief \~english pointer or not
513 unsigned int is_pointer: RPC_MARSHALL_FLAG_BITS_IS_POINTER;
514 /** @brief \~english in/out parameter property
517 unsigned int in_out: RPC_MARSHALL_FLAG_BITS_IN_OUT;
518 /** @brief \~english string or user define type byte num.other is 0
522 } bits; ///< \~english variable properties
525 /////////////////////////////////////////////////////////////////////////////////////
526 /// \ingroup RPC_API_call
527 /// \~english @par brief
528 /// API call execution function (client)
529 /// \~english @param [in] id
530 /// RPC_ID - RPC_ID of server program
531 /// \~english @param [in] api_num
532 /// UINT16 - Request API number
533 /// \~english @param [in] args_string
534 /// const char* - Argument string
535 /// \~english @param [in] args_size
536 /// unsigned int - Argument string length
537 /// \~english @param [out] ret_string
538 /// char** - Process result string
539 /// \~english @param [out] ret_size
540 /// unsigned int* - Process result string length
541 /// \~english @retval RPC_OK Normal End
542 /// \~english @retval RPC_ERR_Fatal Fatal error
543 /// \~english @retval RPC_ERR_No_Response No response
544 /// \~english @retval RPC_ERR_Busy API call queue overflow
545 /// \~english @retval RPC_ERR_Server_DeadLock RPC server deadlock
546 /// \~english @retval RPC_ERR_Reject_connect The RPC server does not allow communication
547 /// \~english @par Prerequisite
548 /// The RPC server is running.
549 /// \~english @par Change of internal state
551 /// \~english @par Conditions of processing failure
552 /// - Acquisition of rpc library information for self thread fails
553 /// - Generation of self-thread rpc library information fails
554 /// - The RPC ID information does not exist
555 /// - Failed to receive data from the server at initial authentication
556 /// - Analysis of received data failed during initial authentication
557 /// - Commands not expected to be received during initial authentication
558 /// - Server response when initial authentication is API call error
559 /// - Failed to receive data from the server at API processing request
560 /// - Analysis of received data failed during API processing request
561 /// - Commands not expected to be received during API processing request
562 /// - Server response when API processing request is API call error
563 /// - Error in server response other than deadlock when processing results are received
564 /// - Server shut down
566 /// - UDP packet transmission fails at initial authentication
567 /// - A timeout occurred in response from the server during initial authentication
568 /// - UDP packet transmission failed at API processing request
569 /// - A timeout occurred in response from the server during API processing request
570 /// - RPC_ERR_No_Response
571 /// - Server response when initial authentication is API call queue overflow
572 /// - Server response when API processing request is API call queue overflow
574 /// - When the server response is deadlocked on initial authentication
575 /// - When the server response is deadlocked on API processing request
576 /// - Server response is deadlocked when processing result is received
577 /// - RPC_ERR_Server_DeadLock
578 /// - Server response is not authenticated at initial authentication
579 /// - RPC_ERR_Reject_connect
580 /// \~english @par Classification
582 /// \~english @par Type
584 /// \~english @par Detail
585 /// - Request execution of RPC-API from the client side.
586 /// - However, since this API is called from the automatically generated code, it is not used directly by the user.
587 /// \~english @see None
588 ////////////////////////////////////////////////////////////////////////////////////
589 RPC_Result RPC_API_call(RPC_ID id, UINT16 api_num, // NOLINT (readability/nolint)
590 const char *args_string, unsigned int args_size,
591 char **ret_string, unsigned int *ret_size);
593 /////////////////////////////////////////////////////////////////////////////////////
594 /// \ingroup RPC_demarshall_arguments
595 /// \~english @par Brief
596 /// Confirm whether the input character string conforms to the prescribed format.
597 /// \~english @param [in] from
598 /// const char * - Input string
599 /// \~english @param [in] size
600 /// unsigned int - Byte length of the input string
601 /// \~english @param [in] need_alloc
602 /// int - Flag whether memory allocation is necessary or not.
603 /// \~english @param [in] num_args
604 /// int - Number of the variable length arguments
605 /// \~english @param [in] ...
606 /// void * - Variable length arguments
607 /// \~english @retval 0 Normal End
608 /// \~english @retval -1 Abnormal End
609 /// \~english @par Prerequisite
611 /// \~english @par Change of internal state
613 /// \~english @par Conditions of processing failure
614 /// - Byte length of the input string is 0 bytes or less or larger than 1024 bytes.
615 /// - The input character string doesn't conform to the prescribed format.
617 /// \~english @par Classification
619 /// \~english @par Type
621 /// \~english @par Detail
622 /// This function is used in the stub file only and user must not call this function directly.
623 /// \~english @see RPC_marshall_arguments
624 ////////////////////////////////////////////////////////////////////////////////////
625 int RPC_demarshall_arguments(const char *from, unsigned int size, // NOLINT (readability/nolint)
626 int need_alloc, int num_args, ...);
628 /////////////////////////////////////////////////////////////////////////////////////
629 /// \ingroup RPC_marshall_arguments
630 /// \~english @par Brief
631 /// Collect variable arguments, convert them to a format that matches the receiver's specification,
632 /// and stuff them into the message buffer.
633 /// \~english @param [in] size
634 /// unsigned int * - data size after conversion
635 /// \~english @param [in] dont_marshall_out_args
636 /// int - input/output kind(when the argument is a pointer)
637 /// \~english @param [in] num_args
638 /// int - value of variable argument
639 /// \~english @param [in] ...
640 /// void * - variable argument
641 /// \~english @retval char * Message buffer after conversion
642 /// \~english @retval NULL Abnormal
643 /// \~english @par Prerequisite
645 /// \~english @par Change of internal state
647 /// \~english @par Conditions of processing failure
648 /// - When marshall work securing work area fails
649 /// - When the specified type size is abnormal
650 /// - When securing the area of the message buffer after conversion fails
652 /// \~english @par Classification
654 /// \~english @par Type
656 /// \~english @par Detail
657 /// This function is used in the stub file for client only and user must not call this function directly.
658 /// \~english @see RPC_demarshalol_arguments
659 ////////////////////////////////////////////////////////////////////////////////////
660 char *RPC_marshall_arguments(unsigned int *size, int dont_marshall_out_args, // NOLINT (readability/nolint)
663 /////////////////////////////////////////////////////////////////////////////////////
664 /// \ingroup RPC_marshall_free
665 /// \~english @par Brief
666 /// Variadic function for memory release
667 /// \~english @param [in] num
668 /// int - number of memory to be released
669 /// \~english @param [in] ...
670 /// void * - allocated memory
671 /// \~english @retval None
672 /// \~english @par Prerequisite
674 /// \~english @par Change of internal state
676 /// \~english @par Conditions of processing failure
678 /// \~english @par Classification
680 /// \~english @par Type
682 /// \~english @par Detail
683 /// - This function is used in the stub file only and user must not call this function directly.
684 /// \~english @see None
685 ////////////////////////////////////////////////////////////////////////////////////
686 void RPC_marshall_free(int num, ...); // NOLINT (readability/nolint)
688 /////////////////////////////////////////////////////////////////////////////////////
689 /// \ingroup RPC_free_return_string
690 /// \~english @par Brief
691 /// release memory allocated during running API call.
692 /// \~english @param [in] ptr
693 /// void * - allocated memory
694 /// \~english @retval None
695 /// \~english @par Prerequisite
696 /// RPC_API_call is already called.
697 /// \~english @par Change of internal state
699 /// \~english @par Conditions of processing failure
701 /// \~english @par Classification
703 /// \~english @par Type
705 /// \~english @par Detail
706 /// - This function is used in the stub file for client only and user must not call this function directly.
707 /// \~english @see None
708 ////////////////////////////////////////////////////////////////////////////////////
709 void RPC_free_return_string(void *ptr); // NOLINT (readability/nolint)
713 ////////////////////////////////////////////////////////////////////////////////
714 /// \ingroup RPC_record_dbg_log
715 /// \~english @par Brief
716 /// RPC-API call process's log
717 /// \~english @param [in] filename
718 /// const char - filename's point
719 /// \~english @param [in] funcname
720 /// const char - function name's point
721 /// \~english @param [in] line
722 /// int - file's line
723 /// \~english @param [in] apiname
724 /// const char - called API name's point
725 /// \~english @param [out]
727 /// \~english @retval 0 : Success
729 /// \~english @par Prerequisite
730 /// - DBG_ENABLE is defined.
731 /// \~english @par Change of internal state
733 /// \~english @par Conditions of processing failure
735 /// \~english @par Classification
737 /// \~english @par Type
739 /// \~english @par Detail
740 /// Receipt and record the client's filename, function name,
741 /// line and called API's function name which called this API.
742 /// \~english @see None
743 ////////////////////////////////////////////////////////////////////////////////
744 int RPC_record_dbg_log(const char *filename, const char *funcname, int line,
745 const char *apiname);
748 #define rpc_malloc malloc
749 #define rpc_free free
752 * RPC debug message control
753 * if set to non-null and some critical information is displayed.
755 extern char *RPC_DEBUG; // NOLINT (readability/nolint)
757 /** @}*/ // end of rpc_library
758 /** @}*/ // end of other_service
759 /** @}*/ // end of BaseSystem
765 #endif // OTHERSERVICE_RPC_H_