Hybrid ICN (hICN) plugin  v21.06-rc0-4-g18fa668
messageProcessor.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 
26 #ifndef messageProcessor_h
27 #define messageProcessor_h
28 
29 #include <hicn/content_store/contentStoreInterface.h>
30 #include <hicn/core/forwarder.h>
31 #include <hicn/core/message.h>
32 
33 #include <hicn/utils/commands.h>
34 
35 #ifdef WITH_POLICY
36 #ifdef WITH_MAPME
37 #include <hicn/core/connection.h>
38 #endif /* WITH_MAPME */
39 #endif /* WITH_POLICY */
40 
41 struct message_processor;
42 typedef struct message_processor MessageProcessor;
43 
56 MessageProcessor *messageProcessor_Create(Forwarder *forwarder);
57 
64 void messageProcessor_Destroy(MessageProcessor **processorPtr);
65 
75 void messageProcessor_Receive(MessageProcessor *procesor, Message *message);
76 
88 bool messageProcessor_AddOrUpdateRoute(MessageProcessor *processor,
89  add_route_command *control,
90  unsigned ifidx);
91 
105 bool messageProcessor_RemoveRoute(MessageProcessor *processor,
106  remove_route_command *control,
107  unsigned ifidx);
108 
109 #ifdef WITH_POLICY
110 
122 bool messageProcessor_AddOrUpdatePolicy(MessageProcessor *processor,
123  add_policy_command *control);
124 
136 bool messageProcessor_RemovePolicy(MessageProcessor *processor,
137  remove_policy_command *control);
138 
139 #endif /* WITH_POLICY */
140 
146 void messageProcessor_RemoveConnectionIdFromRoutes(MessageProcessor *processor,
147  unsigned connectionId);
148 
157 FibEntryList *messageProcessor_GetFibEntries(MessageProcessor *processor);
158 
166 void messageProcessor_SetContentObjectStoreSize(MessageProcessor *processor,
167  size_t maximumContentStoreSize);
168 
177  const MessageProcessor *processor);
178 
179 void messageProcessor_SetCacheStoreFlag(MessageProcessor *processor, bool val);
180 
181 bool messageProcessor_GetCacheStoreFlag(MessageProcessor *processor);
182 
183 void messageProcessor_SetCacheServeFlag(MessageProcessor *processor, bool val);
184 
185 bool messageProcessor_GetCacheServeFlag(MessageProcessor *processor);
186 
187 void messageProcessor_ClearCache(MessageProcessor *processor);
188 
189 void processor_SetStrategy(MessageProcessor *processor, Name *prefix,
190  strategy_type strategy,
191  unsigned related_prefixes_len,
192  Name **related_prefixes);
193 
194 #ifdef WITH_MAPME
195 
202 FIB *messageProcessor_getFib(MessageProcessor *processor);
203 
204 #endif /* WITH_MAPME */
205 
206 #endif // messageProcessor_h
messageProcessor_GetFibEntries
FibEntryList * messageProcessor_GetFibEntries(MessageProcessor *processor)
add_route_command
Definition: commands.h:181
messageProcessor_Destroy
void messageProcessor_Destroy(MessageProcessor **processorPtr)
messageProcessor_AddOrUpdateRoute
bool messageProcessor_AddOrUpdateRoute(MessageProcessor *processor, add_route_command *control, unsigned ifidx)
remove_route_command
Definition: commands.h:217
contentstore_interface
Definition: contentStoreInterface.h:29
message.h
Message is the unit of forwarding, i.e. the packets being switched.
messageProcessor_RemoveRoute
bool messageProcessor_RemoveRoute(MessageProcessor *processor, remove_route_command *control, unsigned ifidx)
messageProcessor_SetContentObjectStoreSize
void messageProcessor_SetContentObjectStoreSize(MessageProcessor *processor, size_t maximumContentStoreSize)
messageProcessor_Create
MessageProcessor * messageProcessor_Create(Forwarder *forwarder)
connection.h
Wrapper for different types of connections.
messageProcessor_Receive
void messageProcessor_Receive(MessageProcessor *procesor, Message *message)
messageProcessor_GetContentObjectStore
ContentStoreInterface * messageProcessor_GetContentObjectStore(const MessageProcessor *processor)
messageProcessor_RemoveConnectionIdFromRoutes
void messageProcessor_RemoveConnectionIdFromRoutes(MessageProcessor *processor, unsigned connectionId)