Hybrid ICN (hICN) plugin  v21.06-rc0-4-g18fa668
Typedefs | Functions
messageProcessor.h File Reference

Executes the set of rules dictated by the PacketType. More...

#include <hicn/content_store/contentStoreInterface.h>
#include <hicn/core/forwarder.h>
#include <hicn/core/message.h>
#include <hicn/utils/commands.h>
Include dependency graph for messageProcessor.h:

Go to the source code of this file.

Typedefs

typedef struct message_processor MessageProcessor
 

Functions

MessageProcessor * messageProcessor_Create (Forwarder *forwarder)
 
void messageProcessor_Destroy (MessageProcessor **processorPtr)
 
void messageProcessor_Receive (MessageProcessor *procesor, Message *message)
 
bool messageProcessor_AddOrUpdateRoute (MessageProcessor *processor, add_route_command *control, unsigned ifidx)
 
bool messageProcessor_RemoveRoute (MessageProcessor *processor, remove_route_command *control, unsigned ifidx)
 
void messageProcessor_RemoveConnectionIdFromRoutes (MessageProcessor *processor, unsigned connectionId)
 
FibEntryList * messageProcessor_GetFibEntries (MessageProcessor *processor)
 
void messageProcessor_SetContentObjectStoreSize (MessageProcessor *processor, size_t maximumContentStoreSize)
 
ContentStoreInterfacemessageProcessor_GetContentObjectStore (const MessageProcessor *processor)
 
void messageProcessor_SetCacheStoreFlag (MessageProcessor *processor, bool val)
 
bool messageProcessor_GetCacheStoreFlag (MessageProcessor *processor)
 
void messageProcessor_SetCacheServeFlag (MessageProcessor *processor, bool val)
 
bool messageProcessor_GetCacheServeFlag (MessageProcessor *processor)
 
void messageProcessor_ClearCache (MessageProcessor *processor)
 
void processor_SetStrategy (MessageProcessor *processor, Name *prefix, strategy_type strategy, unsigned related_prefixes_len, Name **related_prefixes)
 

Detailed Description

Executes the set of rules dictated by the PacketType.

This is a "run-to-completion" handling of a message based on the PacketType.

The MessageProcessor also owns the PIT and FIB tables.

Function Documentation

◆ messageProcessor_AddOrUpdateRoute()

bool messageProcessor_AddOrUpdateRoute ( MessageProcessor *  processor,
add_route_command control,
unsigned  ifidx 
)

Adds or updates a route in the FIB

If the route already exists, it is replaced

Parameters
[in]procesorAn allocated message processor
[in]routeThe route to update
Return values
trueadded or updated
falseAn error

◆ messageProcessor_Create()

MessageProcessor* messageProcessor_Create ( Forwarder *  forwarder)

Allocates a MessageProcessor along with PIT, FIB and ContentStore tables

The hicn-light pointer is primarily used for logging (forwarder_Log), getting the configuration, and accessing the connection table.

Parameters
[in]Pointerto owning hicn-light process
Return values
non-nullAn allocated message processor
nullAn error

◆ messageProcessor_Destroy()

void messageProcessor_Destroy ( MessageProcessor **  processorPtr)

Deallocates a message processor an all internal tables

Parameters
[in,out]processorPtrPointer to message processor to de-allocate, will be NULL'd.

◆ messageProcessor_GetContentObjectStore()

ContentStoreInterface* messageProcessor_GetContentObjectStore ( const MessageProcessor *  processor)

Return the interface to the currently instantiated ContentStore, if any.

Parameters
[in]processorthe MessageProcessor from which to return the ContentStoreInterface.

◆ messageProcessor_GetFibEntries()

FibEntryList* messageProcessor_GetFibEntries ( MessageProcessor *  processor)

Returns a list of all FIB entries

You must destroy the list.

Return values
non-nullThe list of FIB entries
nullAn error

◆ messageProcessor_Receive()

void messageProcessor_Receive ( MessageProcessor *  procesor,
Message *  message 
)

@function messageProcessor_Receive @abstract Process the message, takes ownership of the memory. @discussion Will call destroy on the memory when done with it, so if the caller wants to keep it, make a reference counted copy.

Receive may modify some fields in the message, such as the HopLimit field.

◆ messageProcessor_RemoveConnectionIdFromRoutes()

void messageProcessor_RemoveConnectionIdFromRoutes ( MessageProcessor *  processor,
unsigned  connectionId 
)

Removes a given connection id from all FIB entries

Iterates the FIB and removes the given connection ID from every route.

◆ messageProcessor_RemoveRoute()

bool messageProcessor_RemoveRoute ( MessageProcessor *  processor,
remove_route_command control,
unsigned  ifidx 
)

Removes a route from the FIB

Removes a specific nexthop for a route. If there are no nexthops left after the removal, the entire route is deleted from the FIB.

Parameters
[in]procesorAn allocated message processor
[in]routeThe route to remove
Return values
trueRoute completely removed
falseThere is still a nexthop for the route

◆ messageProcessor_SetContentObjectStoreSize()

void messageProcessor_SetContentObjectStoreSize ( MessageProcessor *  processor,
size_t  maximumContentStoreSize 
)

Adjusts the ContentStore to the given size.

This will destroy and re-create the content store, so any cached objects will be lost.