SELKIELogger  1.0.0
Logger: Generic network device support
Collaboration diagram for Logger: Generic network device support:

Classes

struct  net_params
 Network device specific parameters. More...
 

Functions

void * net_setup (void *ptargs)
 Device thread setup. More...
 
void * net_logging (void *ptargs)
 Network source main logging loop. More...
 
void * net_shutdown (void *ptargs)
 Network source shutdown. More...
 
void * net_channels (void *ptargs)
 Channel map. More...
 
bool net_connect (void *ptargs)
 Network connection helper function. More...
 
device_callbacks net_getCallbacks (void)
 Fill out device callback functions for logging. More...
 
net_params net_getParams (void)
 Fill out default MP source parameters. More...
 
bool net_parseConfig (log_thread_args_t *lta, config_section *s)
 Take a configuration section and parse parameters. More...
 

Detailed Description

Adds support for reading arbitrary data from network devices that output messages not otherwise covered or interpreted by this software.

Function Documentation

◆ net_channels()

void* net_channels ( void *  ptargs)

Channel map.

Populate list of channels and push to queue as a map message

Parameters
[in]ptargsPointer to log_thread_args_t
Returns
NULL - Exit code in ptargs->returnCode if required

Definition at line 263 of file LoggerNet.c.

◆ net_connect()

bool net_connect ( void *  ptargs)

Network connection helper function.

Closes any existing connection, then attempts to open a new connection using the details in net_params.

Socket is set as nonblocking, so zero-length reads are to be expected.

Parameters
[in]ptargsPointer to log_thread_args_t
Returns
True on success, false on error

Definition at line 176 of file LoggerNet.c.

◆ net_getCallbacks()

device_callbacks net_getCallbacks ( void  )

Fill out device callback functions for logging.

Returns
device_callbacks for generic network sources

Definition at line 236 of file LoggerNet.c.

◆ net_getParams()

net_params net_getParams ( void  )

Fill out default MP source parameters.

Returns
Default parameters for generic network sources

Definition at line 247 of file LoggerNet.c.

◆ net_logging()

void* net_logging ( void *  ptargs)

Network source main logging loop.

Reads messages from the connection established by net_setup(), and pushes them to the queue. Data is not interpreted, just pushed into the queue with suitable headers.

Message size is variable, based on min/max limits and the amount of data available to read from the source.

Parameters
[in]ptargsPointer to log_thread_args_t
Returns
NULL - Exit code in ptargs->returnCode if required

Definition at line 66 of file LoggerNet.c.

◆ net_parseConfig()

bool net_parseConfig ( log_thread_args_t lta,
config_section s 
)

Take a configuration section and parse parameters.

Parameters
[in]ltaPointer to log_thread_args_t
[in]sPointer to config_section to be parsed
Returns
True on success, false on error

Definition at line 306 of file LoggerNet.c.

◆ net_setup()

void* net_setup ( void *  ptargs)

Device thread setup.

The actual work is delegated to net_connect() so we can reuse the logic elsewhere

It is assumed that no other setup is required for these devices.

Parameters
[in]ptargsPointer to log_thread_args_t
Returns
NULL - Exit code in ptargs->returnCode if required

Definition at line 41 of file LoggerNet.c.

◆ net_shutdown()

void* net_shutdown ( void *  ptargs)

Network source shutdown.

Simple wrapper around net_closeConnection(), which will do any cleanup required.

Parameters
[in]ptargsPointer to log_thread_args_t
Returns
NULL

Definition at line 147 of file LoggerNet.c.