EDGESEC  0.1.0-alpha.0+sha.ca29a8277b72f80785649ea9ef9cd7edf642d939
Secure router - reference implementation
middleware.h
Go to the documentation of this file.
1 
12 #ifndef MIDDLEWARE_H
13 #define MIDDLEWARE_H
14 
15 #include <stdint.h>
16 #include <sqlite3.h>
17 
18 #include <eloop.h>
19 #include "./pcap_service.h"
20 
21 // params is a pointer to an already allocated string
23  sqlite3 *db;
24  struct eloop_data *eloop;
25  struct pcap_context *pc;
26  void *mdata;
27  char *params;
28 };
29 
52  struct middleware_context *(*const init)(sqlite3 *db, char *db_path,
53  struct eloop_data *eloop,
54  struct pcap_context *pc,
55  char *params);
56 
68  int (*const process)(struct middleware_context *context, const char *ltype,
69  struct pcap_pkthdr *header, uint8_t *packet,
70  char *ifname);
71 
77  void (*const free)(struct middleware_context *context);
78 
84  const char *const name;
85 };
86 #endif
File containing the definition of the pcap service utilities.
Structure describing a middleware for the EDGESec capture service.
Definition: middleware.h:41
void(*const free)(struct middleware_context *context)
Frees the middleware context.
Definition: middleware.h:77
int(*const process)(struct middleware_context *context, const char *ltype, struct pcap_pkthdr *header, uint8_t *packet, char *ifname)
Runs the middleware.
Definition: middleware.h:68
const char *const name
Human readable name for middleware.
Definition: middleware.h:84
struct middleware_context *(*const init)(sqlite3 *db, char *db_path, struct eloop_data *eloop, struct pcap_context *pc, char *params)
Initialises the middleware.
Definition: middleware.h:52
Definition: middleware.h:22
char * params
Definition: middleware.h:27
struct eloop_data * eloop
Definition: middleware.h:24
sqlite3 * db
Definition: middleware.h:23
void * mdata
Definition: middleware.h:26
struct pcap_context * pc
Definition: middleware.h:25
Pcap context structure definition.
Definition: pcap_service.h:29