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

A listener set is unique on (EncapType, localAddress) More...

#include <hicn/io/listener.h>
Include dependency graph for listenerSet.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Typedefs

typedef struct listener_set ListenerSet
 

Functions

ListenerSet * listenerSet_Create (void)
 
void listenerSet_Destroy (ListenerSet **setPtr)
 
bool listenerSet_Add (ListenerSet *set, ListenerOps *ops)
 
size_t listenerSet_Length (const ListenerSet *set)
 
ListenerOpslistenerSet_Get (const ListenerSet *set, size_t index)
 
ListenerOpslistenerSet_Find (const ListenerSet *set, EncapType encapType, const Address *localAddress)
 
ListenerOpslistenerSet_FindById (const ListenerSet *set, unsigned id)
 
int listenerSet_FindIdByListenerName (const ListenerSet *set, const char *listenerName)
 
void listenerSet_RemoveById (const ListenerSet *set, unsigned id)
 

Detailed Description

A listener set is unique on (EncapType, localAddress)

Keeps track of all the running listeners. The set is unique on the encapsulation type and the local address. For example, with TCP encapsulation and local address 127.0.0.1 or Ethernet encapsulation and MAC address 00:11:22:33:44:55.

NOTE: This does not allow multiple EtherType on the same interface because the Address for a LINK address does not include an EtherType.

Function Documentation

◆ listenerSet_Add()

bool listenerSet_Add ( ListenerSet *  set,
ListenerOps ops 
)

@function listenerSet_Add @abstract Adds the listener to the set @discussion Unique set based on pair (EncapType, localAddress). Takes ownership of the ops memory if added.

Parameters
<param1::>
Returns
true if added, false if not

◆ listenerSet_Create()

ListenerSet* listenerSet_Create ( void  )

<#One Line Description#>

<#Paragraphs Of Explanation#>

Parameters
[<inout in,out#>] <#name#> <#description#>
Return values
<::value::><#explanation#>

Example:

<#example#>

◆ listenerSet_Destroy()

void listenerSet_Destroy ( ListenerSet **  setPtr)

<#One Line Description#>

<#Paragraphs Of Explanation#>

Parameters
[<inout in,out#>] <#name#> <#description#>
Return values
<::value::><#explanation#>

Example:

<#example#>

◆ listenerSet_Find()

ListenerOps* listenerSet_Find ( const ListenerSet *  set,
EncapType  encapType,
const Address *  localAddress 
)

Looks up a listener by its key (EncapType, LocalAddress)

<#Paragraphs Of Explanation#>

Parameters
[in]setAn allocated listener set
[in]encapTypethe listener type
[in]localAddressThe local bind address (e.g. MAC address or TCP socket)
Return values
non-nullThe listener matching the query
nullDoes not exist

Example:

◆ listenerSet_FindById()

ListenerOps* listenerSet_FindById ( const ListenerSet *  set,
unsigned  id 
)

Looks up a listener by its id

<#Paragraphs Of Explanation#>

Parameters
[in]setAn allocated listener set
[in]idof the listener
Return values
non-nullThe listener matching the query
nullDoes not exist

Example:

◆ listenerSet_FindIdByListenerName()

int listenerSet_FindIdByListenerName ( const ListenerSet *  set,
const char *  listenerName 
)

Looks up a listener by its id

<#Paragraphs Of Explanation#>

Parameters
[in]setAn allocated listener set
[in]nameof the listener
Return values
greateror equal to 0 The listener matching the query
-1Does not exist

Example:

◆ listenerSet_Get()

ListenerOps* listenerSet_Get ( const ListenerSet *  set,
size_t  index 
)

Returns the listener at the given index

<#Paragraphs Of Explanation#>

Parameters
[in]setAn allocated listener set
[in]indexThe index position (0 <= index < listenerSet_Lenght)
Return values
non-nullThe listener at index
nullAn error

Example:

<#example#>

◆ listenerSet_Length()

size_t listenerSet_Length ( const ListenerSet *  set)

The number of listeners in the set

<#Paragraphs Of Explanation#>

Parameters
[in]setAn allocated listener set
Return values
<::value::><#explanation#>

Example:

<#example#>

◆ listenerSet_RemoveById()

void listenerSet_RemoveById ( const ListenerSet *  set,
unsigned  id 
)

Remove up a listener by its id

<#Paragraphs Of Explanation#>

Parameters
[in]setAn allocated listener set
[in]idof the listener

Example: