caremotehandler.h 3.4 KB
Newer Older
1
/* ****************************************************************
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
 *
 * Copyright 2014 Samsung Electronics All Rights Reserved.
 *
 *
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 ******************************************************************/
20 21

/**
22 23 24
 * @file
 *
 * This file contains common utility function for remote endpoints.
25 26
 */

27 28
#ifndef CA_REMOTE_HANDLER_H_
#define CA_REMOTE_HANDLER_H_
29 30 31 32 33 34 35 36

#include "cacommon.h"

#ifdef __cplusplus
extern "C"
{
#endif

37 38 39 40 41
/**
 * @brief   Creates a new remote endpoint from the input endpoint
 * @param   endpoint       [IN]    endpoint information where the data has to be sent
 * @return  remote endpoint created
 */
42
CARemoteEndpoint_t *CACloneRemoteEndpoint(const CARemoteEndpoint_t *endpoint);
43

44 45
/**
 * @brief   Creates a new remote endpoint from the input uri
46 47
 * @param   uri                 [IN]    absolute uri information to create remote endpoint
 * @param   transportType       [IN]    transport type of the endpoint
48 49
 * @return  remote endpoint created
 */
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 56 57
 * @param   resourceUri         [IN]    absolute uri information to create remote endpoint
 * @param   addr                [IN]    address of the endpoint
 * @param   type                [IN]    transport  type of the endpoint
58 59
 * @return  remote endpoint created
 */
60
CARemoteEndpoint_t *CACreateRemoteEndpointInternal(const CAURI_t resourceUri,
61 62
                                                   const CAAddress_t addr,
                                                   const CATransportType_t type);
63

64 65 66 67 68
/**
 * @brief   Destroy remote endpoint
 * @param   endpoint       [IN]    endpoint information where the data has to be sent
 * @return  none
 */
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 75
 * @return  remote endpoint created
 */
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 82
 * @return none
 */
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 89
 * @return  remote endpoint created
 */
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 96
 * @return
 */
97
void CADestroyResponseInfoInternal(CAResponseInfo_t *response);
98 99 100 101 102

#ifdef __cplusplus
} /* extern "C" */
#endif

103
#endif /* CA_REMOTE_HANDLER_H_ */
104