1 /* ****************************************************************
3 * Copyright 2014 Samsung Electronics All Rights Reserved.
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
19 ******************************************************************/
24 * This file contains common utility function for remote endpoints.
27 #ifndef CA_REMOTE_HANDLER_H_
28 #define CA_REMOTE_HANDLER_H_
38 * @brief Creates a new remote endpoint from the input endpoint
39 * @param endpoint [IN] endpoint information where the data has to be sent
40 * @return remote endpoint created
42 CAEndpoint_t *CACloneEndpoint(const CAEndpoint_t *endpoint);
45 * @brief Allocate CAEndpoint_t instance.
46 * @param flags [IN] Transport flag
47 * @param adapter [IN] Adapter type
48 * @param address [IN] Address
49 * @param port [IN] Port
50 * @return #CA_STATUS_OK or Appropriate error code
52 CAEndpoint_t *CACreateEndpointObject(CATransportFlags_t flags, CATransportAdapter_t adapter,
53 const char *address, uint16_t port);
55 * @brief Destroy remote endpoint
56 * @param endpoint [IN] endpoint information where the data has to be sent
59 void CAFreeEndpoint(CAEndpoint_t *rep);
62 * @brief Creates a new request information
63 * @param request [IN] request information that needs to be duplicated
64 * @return remote endpoint created
66 CARequestInfo_t *CACloneRequestInfo(const CARequestInfo_t *request);
69 * @brief Destroy the request information
70 * @param request [IN] request information that needs to be destroyed
73 void CADestroyRequestInfoInternal(CARequestInfo_t *request);
76 * @brief Creates a new response information
77 * @param response [IN] response information that needs to be duplicated
78 * @return remote endpoint created
80 CAResponseInfo_t *CACloneResponseInfo(const CAResponseInfo_t *response);
83 * @brief Destroy the response information
84 * @param response [IN] response information that needs to be destroyed
87 void CADestroyResponseInfoInternal(CAResponseInfo_t *response);
93 #endif /* CA_REMOTE_HANDLER_H_ */