EDGESEC
0.1.0-alpha.0+sha.ca29a8277b72f80785649ea9ef9cd7edf642d939
Secure router - reference implementation
|
File containing the definition of the capture service. More...
#include <pcap.h>
#include <sqlite3.h>
#include <eloop.h>
#include "capture_config.h"
#include "pcap_service.h"
Go to the source code of this file.
Data Structures | |
struct | capture_middleware_context |
Macros | |
#define | DB_BUSY_TIMEOUT 5000 |
Functions | |
void | pcap_callback (const void *ctx, const void *pcap_ctx, char *ltype, struct pcap_pkthdr *header, uint8_t *packet) |
Callback for pcap packet module. More... | |
int | get_pcap_folder_path (char *capture_db_path, char *pcap_path) |
Return the pcap folder path. More... | |
int | run_capture (struct capture_middleware_context *context) |
Runs the capture service. More... | |
void | free_capture_context (struct capture_middleware_context *context) |
Frees the capture context. More... | |
int | run_capture_thread (char *ifname, struct capture_conf const *config, pthread_t *id) |
Runs the capture service thread. More... | |
File containing the definition of the capture service.
#define DB_BUSY_TIMEOUT 5000 |
void free_capture_context | ( | struct capture_middleware_context * | context | ) |
Frees the capture context.
context | The middleware context |
int get_pcap_folder_path | ( | char * | capture_db_path, |
char * | pcap_path | ||
) |
Return the pcap folder path.
capture_db_path | The capture db path |
pcap_path | The returned pcap folder path |
void pcap_callback | ( | const void * | ctx, |
const void * | pcap_ctx, | ||
char * | ltype, | ||
struct pcap_pkthdr * | header, | ||
uint8_t * | packet | ||
) |
Callback for pcap packet module.
ctx | The capture context |
pcap_ctx | The pcap context |
ltype | The link type |
header | pcap header structure |
packet | Returned pcap packet |
int run_capture | ( | struct capture_middleware_context * | context | ) |
Runs the capture service.
context | The middleware context |
int run_capture_thread | ( | char * | ifname, |
struct capture_conf const * | config, | ||
pthread_t * | id | ||
) |
Runs the capture service thread.
ifname | The capture interface name | |
config | The capture service config structure | |
[out] | id | The returned thread id |