EDGESEC  0.1.0-alpha.0+sha.ca29a8277b72f80785649ea9ef9cd7edf642d939
Secure router - reference implementation
capture_service.h
Go to the documentation of this file.
1 
11 #ifndef CAPTURE_SERVICE_H
12 #define CAPTURE_SERVICE_H
13 
14 #include <pcap.h>
15 #include <sqlite3.h>
16 
17 #include <eloop.h>
18 
19 #include "capture_config.h"
20 #include "pcap_service.h"
21 
22 #define DB_BUSY_TIMEOUT 5000 // Sets the sqlite busy timeout in milliseconds
23 
25  struct capture_conf config;
26  UT_array *handlers;
27  char ifname[IF_NAMESIZE];
28 };
29 
39 void pcap_callback(const void *ctx, const void *pcap_ctx, char *ltype,
40  struct pcap_pkthdr *header, uint8_t *packet);
41 
49 int get_pcap_folder_path(char *capture_db_path, char *pcap_path);
50 
57 int run_capture(struct capture_middleware_context *context);
58 
65 
74 int run_capture_thread(char *ifname, struct capture_conf const *config,
75  pthread_t *id);
76 
77 #endif
File containing the definition of the capture config structures.
int run_capture(struct capture_middleware_context *context)
Runs the capture service.
Definition: capture_service.c:61
void pcap_callback(const void *ctx, const void *pcap_ctx, char *ltype, struct pcap_pkthdr *header, uint8_t *packet)
Callback for pcap packet module.
Definition: capture_service.c:38
int run_capture_thread(char *ifname, struct capture_conf const *config, pthread_t *id)
Runs the capture service thread.
Definition: capture_service.c:162
void free_capture_context(struct capture_middleware_context *context)
Frees the capture context.
Definition: capture_service.c:134
int get_pcap_folder_path(char *capture_db_path, char *pcap_path)
Return the pcap folder path.
Definition: pcap_middleware.c:44
File containing the definition of the pcap service utilities.
The capture configuration structure.
Definition: capture_config.h:32
char capture_db_path[MAX_OS_PATH_LEN]
Definition: capture_config.h:45
Definition: capture_service.h:24
struct capture_conf config
Definition: capture_service.h:25
char ifname[IF_NAMESIZE]
Definition: capture_service.h:27
UT_array * handlers
Definition: capture_service.h:26