1 /* ****************************************************************
3 * Copyright 2015 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 ******************************************************************/
23 * This file contains the APIs for routing table manager endpoint.
25 #ifndef ROUTING_TABLE_MANAGER_ENDPOINT_H_
26 #define ROUTING_TABLE_MANAGER_ENDPOINT_H_
34 #if defined(__ANDROID__)
35 #include <linux/time.h>
37 #include "ulinklist.h"
38 #include "uarraylist.h"
48 * Initialize the Routing Table Manager.
49 * @param[in/out] endpointTable Endpoint Routing Table.
50 * @return ::OC_STACK_OK or Appropriate error code.
52 OCStackResult RTMEndpointInitialize(u_linklist_t **endpointTable);
55 * Terminates the Routing Table Manager..
56 * @param[in/out] endpointTable Endpoint Routing Table.
57 * @return ::OC_STACK_OK or Appropriate error code.
59 OCStackResult RTMEndpointTerminate(u_linklist_t **endpointTable);
62 * Frees the endpoint table memory with nodes containing structute RTMEndpointEntry_t.
63 * @param[in/out] endpointTable Endpoint Routing Table.
64 * @return ::OC_STACK_OK or Appropriate error code.
66 OCStackResult RTMFreeEndpointRouteTable(u_linklist_t **endpointTable);
69 * Adds the endpoint entry to the routing table.
70 * @param[in/out] endpointId Endpoint Id.
71 * @param[in] destAddr Destination Address.
72 * @param[in/out] endpointTable Endpoint Routing Table.
73 * @return ::OC_STACK_OK or Appropriate error code.
75 OCStackResult RTMAddEndpointEntry(uint16_t *endpointId, const CAEndpoint_t *destAddr,
76 u_linklist_t **endpointTable);
79 * Removes the endpoint entry from the routing table.
80 * @param[in] endpointId Endpoint id of node need to be removed.
81 * @param[in/out] endpointTable Endpoint Routing Table.
82 * @return ::OC_STACK_OK or Appropriate error code.
84 OCStackResult RTMRemoveEndpointEntry(uint16_t endpointId, u_linklist_t **endpointTable);
87 * Removes the endpoint nodes.
88 * @param[in/out] endpointTable Endpoint Routing Table.
89 * @return ::OC_STACK_OK or Appropriate error code.
91 OCStackResult RTMRemoveEndpoints(u_linklist_t **endpointTable);
95 * @param[in] endpointId Endpoint id of node need to be removed.
96 * @param[in] endpointTable Endpoint Routing Table.
97 * @return Endpoint Destination inteface address.
99 CAEndpoint_t *RTMGetEndpointEntry(uint16_t endpointId, const u_linklist_t *endpointTable);
102 * Prints the routing table
103 * @param[in] endpointTable Endpoint Routing Table.
105 void RTMEndpointPrintTable(const u_linklist_t *endpointTable);
111 #endif /* ROUTING_TABLE_MANAGER_ENDPOINT_H_ */