EDGESEC
0.1.0-alpha.0+sha.ca29a8277b72f80785649ea9ef9cd7edf642d939
Secure router - reference implementation
|
File containing the implementation of the capture service. More...
#include <stdarg.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include <errno.h>
#include <fcntl.h>
#include <libgen.h>
#include <pthread.h>
#include <unistd.h>
#include "capture_config.h"
#include "capture_service.h"
#include "pcap_service.h"
#include <eloop.h>
#include "../utils/allocs.h"
#include "../utils/log.h"
#include "../utils/os.h"
#include "../utils/sockctl.h"
#include "../utils/squeue.h"
#include "middlewares_list.h"
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... | |
void | eloop_read_fd_handler (int sock, void *eloop_ctx, void *sock_ctx) |
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... | |
void * | capture_thread (void *arg) |
int | run_capture_thread (char *ifname, struct capture_conf const *config, pthread_t *id) |
Runs the capture service thread. More... | |
File containing the implementation of the capture service.
void* capture_thread | ( | void * | arg | ) |
void eloop_read_fd_handler | ( | int | sock, |
void * | eloop_ctx, | ||
void * | sock_ctx | ||
) |
void free_capture_context | ( | struct capture_middleware_context * | context | ) |
Frees the capture context.
context | The middleware context |
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 |