Hybrid ICN (hICN) plugin  v21.06-rc0-4-g18fa668
mapme.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2017-2019 Cisco and/or its affiliates.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at:
6  *
7  * http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
21 #ifndef mapme_h
22 #define mapme_h
23 
24 #ifdef WITH_MAPME
25 
26 #include <stdbool.h>
27 #include <stdint.h>
28 
29 #include <hicn/hicn.h>
30 #include <hicn/core/forwarder.h>
31 #include <hicn/core/connection.h>
32 #include <hicn/utils/commands.h>
33 
34 struct mapme;
35 typedef struct mapme MapMe;
36 
42 bool mapme_create(MapMe **mapme, Forwarder *Forwarder);
43 
48 void mapme_free(MapMe *mapme);
49 
59 bool mapme_isMapMe(const uint8_t *msgBuffer);
60 
68 void mapme_Process(const MapMe *mapme, const uint8_t *msgBuffer,
69  unsigned conn_id);
70 
79 void mapme_send_updates(const MapMe * mapme, FibEntry * fibEntry, const NumberSet * nexthops);
80 
89 void mapme_maybe_send_updates(const MapMe * mapme, FibEntry * fibEntry, const NumberSet * nexthops);
90 
97 void mapme_reconsiderFibEntry(const MapMe *mapme, FibEntry * fibEntry);
98 
108 void mapme_onConnectionEvent(const MapMe *mapme, const Connection *conn, connection_event_t event);
109 
115 NumberSet *mapme_getNextHops(const MapMe *mapme, FibEntry *fibEntry,
116  const Message *interest);
117 
118 hicn_mapme_type_t mapme_PktType_To_LibHicnPktType(MessagePacketType type);
119 
120 MessagePacketType mapme_LibHicnPktType_To_PktType(hicn_mapme_type_t type);
121 
122 #endif /* WITH_MAPME */
123 
124 #endif // mapme_h
connection.h
Wrapper for different types of connections.
hicn_mapme_type_t
hicn_mapme_type_t
MAP-Me packet types.
Definition: mapme.h:60