1 /* *****************************************************************
3 * Copyright 2016 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 * *****************************************************************/
21 #ifndef _OTM_CONTEXT_LIST_H_
22 #define _OTM_CONTEXT_LIST_H_
27 #include "securevirtualresourcetypes.h"
28 #include "ownershiptransfermanager.h"
34 typedef struct OTMContextItem {
37 struct OTMContextItem* next;
41 * API to remove OTMContext from OTMContext list.
43 * @param[in] addr IP address of peer
44 * @param[in] port secure port number of peer
46 void RemoveOTMContext(const char* addr, uint16_t port);
49 * API to add OTMContext to OTMContext list.
50 * If same OTMContext exist, will be ignored.
52 * @param[in] ctx new OTMContext
53 * @param[in] addr IP address of peer
54 * @param[in] port secure port number of peer
56 * @return OC_STACK_OK in case of success and other value otherwise.
58 OCStackResult AddOTMContext(OTMContext_t* ctx, const char* addr, uint16_t port);
61 * API to read OTMContext from OTMContext list
63 * @param[in] addr IP address of peer
64 * @param[in] port secure port number of peer
66 * @return OTMContext in case of context found, otherwise NULL.
68 OTMContext_t* GetOTMContext(const char* addr, uint16_t port);
72 * API to delete all OTM context from list.
73 * NOTE : This API should be invoked after OCStop API.
75 void DeleteOTMContextList();
81 #endif //_OTM_CONTEXT_LIST_H_