Imported Upstream version 0.9.1
[platform/upstream/iotivity.git] / resource / csdk / connectivity / inc / caremotehandler.h
1 /* ****************************************************************
2  *
3  * Copyright 2014 Samsung Electronics All Rights Reserved.
4  *
5  *
6  *
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
10  *
11  *      http://www.apache.org/licenses/LICENSE-2.0
12  *
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.
18  *
19  ******************************************************************/
20
21 /**
22  * @file
23  *
24  * This file contains common utility function for remote endpoints.
25  */
26
27 #ifndef CA_REMOTE_HANDLER_H_
28 #define CA_REMOTE_HANDLER_H_
29
30 #include "cacommon.h"
31
32 #ifdef __cplusplus
33 extern "C"
34 {
35 #endif
36
37 /**
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
41  */
42 CARemoteEndpoint_t *CACloneRemoteEndpoint(const CARemoteEndpoint_t *endpoint);
43
44 /**
45  * @brief   Creates a new remote endpoint from the input uri
46  * @param   uri                 [IN]    absolute uri information to create remote endpoint
47  * @param   transportType       [IN]    transport type of the endpoint
48  * @return  remote endpoint created
49  */
50 CARemoteEndpoint_t *CACreateRemoteEndpointUriInternal(const CAURI_t uri,
51                                                       const CATransportType_t transportType);
52
53 /**
54  * @brief   Creates a new remote endpoint from the input and other information
55  * @param   resourceUri         [IN]    absolute uri information to create remote endpoint
56  * @param   addr                [IN]    address of the endpoint
57  * @param   type                [IN]    transport  type of the endpoint
58  * @return  remote endpoint created
59  */
60 CARemoteEndpoint_t *CACreateRemoteEndpointInternal(const CAURI_t resourceUri,
61                                                    const CAAddress_t addr,
62                                                    const CATransportType_t type);
63
64 /**
65  * @brief   Destroy remote endpoint
66  * @param   endpoint       [IN]    endpoint information where the data has to be sent
67  * @return  none
68  */
69 void CADestroyRemoteEndpointInternal(CARemoteEndpoint_t *rep);
70
71 /**
72  * @brief   Creates a new request information
73  * @param   request       [IN]    request information that needs to be duplicated
74  * @return  remote endpoint created
75  */
76 CARequestInfo_t *CACloneRequestInfo(const CARequestInfo_t *request);
77
78 /**
79  * @brief   Destroy the request information
80  * @param   request       [IN]    request information that needs to be destroyed
81  * @return none
82  */
83 void CADestroyRequestInfoInternal(CARequestInfo_t *request);
84
85 /**
86  * @brief   Creates a new response information
87  * @param   response       [IN]    response information that needs to be duplicated
88  * @return  remote endpoint created
89  */
90 CAResponseInfo_t *CACloneResponseInfo(const CAResponseInfo_t *response);
91
92 /**
93  * @brief   Destroy the response information
94  * @param   response       [IN]    response information that needs to be destroyed
95  * @return
96  */
97 void CADestroyResponseInfoInternal(CAResponseInfo_t *response);
98
99 #ifdef __cplusplus
100 } /* extern "C" */
101 #endif
102
103 #endif /* CA_REMOTE_HANDLER_H_ */
104