EDGESEC  0.1.0-alpha.0+sha.ca29a8277b72f80785649ea9ef9cd7edf642d939
Secure router - reference implementation
Data Fields
capture_middleware Struct Reference

Structure describing a middleware for the EDGESec capture service. More...

#include <middleware.h>

Collaboration diagram for capture_middleware:
[legend]

Data Fields

struct middleware_context *(*const init )(sqlite3 *db, char *db_path, struct eloop_data *eloop, struct pcap_context *pc, char *params)
 Initialises the middleware. More...
 
int(*const process )(struct middleware_context *context, const char *ltype, struct pcap_pkthdr *header, uint8_t *packet, char *ifname)
 Runs the middleware. More...
 
void(*const free )(struct middleware_context *context)
 Frees the middleware context. More...
 
const char *const name
 Human readable name for middleware. More...
 

Detailed Description

Structure describing a middleware for the EDGESec capture service.

All EDGESec capture service middlewares should expose a variable of type capture_middleware only.

You can then use the CMake function edgesecAddCaptureMiddleware to add your middleware to the EDGESec capture service when building EDGESec.

Authors
Alois Klink, Alexandru Mereacre

Field Documentation

◆ free

void(*const capture_middleware::free) (struct middleware_context *context)

Frees the middleware context.

Parameters
contextThe middleware context

◆ init

struct middleware_context*(*const capture_middleware::init) (sqlite3 *db, char *db_path, struct eloop_data *eloop, struct pcap_context *pc, char *params)

Initialises the middleware.

Parameters
dbThe sqlite3 db
db_pathThe sqlite3 db path
eloopThe eloop structure
pcThe pcap context
paramsThe middleware params
Returns
The middleware context on success, NULL on failure

◆ name

const char* const capture_middleware::name

Human readable name for middleware.

Human readable name for this middleware. Currently only used for logs.

◆ process

int(*const capture_middleware::process) (struct middleware_context *context, const char *ltype, struct pcap_pkthdr *header, uint8_t *packet, char *ifname)

Runs the middleware.

Parameters
contextThe middleware context
ltypeThe packet type
headerThe pcap packet header
packetThe pcap packet
ifnameThe capture interface
Return values
0on success
-1on failure

The documentation for this struct was generated from the following file: