EDGESEC
0.1.0-alpha.0+sha.ca29a8277b72f80785649ea9ef9cd7edf642d939
Secure router - reference implementation
|
File containing the implementation of the capture cleaner service structures. More...
#include "./cleaner_middleware.h"
#include <libgen.h>
#include <sqlite3.h>
#include <utarray.h>
#include "../../capture_config.h"
#include "../../capture_service.h"
#include "../pcap_middleware/sqlite_pcap.h"
#include "../../../utils/allocs.h"
#include "../../../utils/os.h"
#include <eloop.h>
Data Structures | |
struct | cleaner_middleware_context |
Macros | |
#define | CLEANER_PROCESS_INTERVAL 5 /* Frequency in sec to run the cleaner function*/ |
#define | CLEANER_GROUP_INTERVAL |
#define | CLEANER_STORE_SIZE 1000 /*Specifies the capture store size in KiB */ |
Functions | |
int | clean_capture (struct middleware_context *context) |
void | eloop_tout_cleaner_handler (void *eloop_ctx, void *user_ctx) |
void | free_cleaner_middleware (struct middleware_context *context) |
struct middleware_context * | init_cleaner_middleware (sqlite3 *db, char *db_path, struct eloop_data *eloop, struct pcap_context *pc, char *params) |
int | process_cleaner_middleware (struct middleware_context *context, const char *ltype, struct pcap_pkthdr *header, uint8_t *packet, char *ifname) |
Variables | |
struct capture_middleware | cleaner_middleware |
Cleaner Middleware. The cleaner middleware is designed to periodically remove the oldest PCAP files when the use more than CLEANER_STORE_SIZE KiB. More... | |
File containing the implementation of the capture cleaner service structures.
Defines the start function for the capturte cleaner service, which removes the capture files from the database folder when it reaches a given size specified in the capture_conf structure. The store size is give by the parameter CLEANER_STORE_SIZE in Kb.
#define CLEANER_GROUP_INTERVAL |
#define CLEANER_PROCESS_INTERVAL 5 /* Frequency in sec to run the cleaner function*/ |
#define CLEANER_STORE_SIZE 1000 /*Specifies the capture store size in KiB */ |
int clean_capture | ( | struct middleware_context * | context | ) |
void eloop_tout_cleaner_handler | ( | void * | eloop_ctx, |
void * | user_ctx | ||
) |
void free_cleaner_middleware | ( | struct middleware_context * | context | ) |
struct middleware_context* init_cleaner_middleware | ( | sqlite3 * | db, |
char * | db_path, | ||
struct eloop_data * | eloop, | ||
struct pcap_context * | pc, | ||
char * | params | ||
) |
int process_cleaner_middleware | ( | struct middleware_context * | context, |
const char * | ltype, | ||
struct pcap_pkthdr * | header, | ||
uint8_t * | packet, | ||
char * | ifname | ||
) |
struct capture_middleware cleaner_middleware |
Cleaner Middleware. The cleaner middleware is designed to periodically remove the oldest PCAP files when the use more than CLEANER_STORE_SIZE
KiB.