EDGESEC  0.1.0-alpha.0+sha.ca29a8277b72f80785649ea9ef9cd7edf642d939
Secure router - reference implementation
Macros | Functions | Variables
header_middleware.c File Reference

File containing the implementation of the header middleware utilities. More...

#include "header_middleware.h"
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <pcap.h>
#include <sqlite3.h>
#include <string.h>
#include <eloop.h>
#include "../../../utils/allocs.h"
#include "../../../utils/log.h"
#include "../../../utils/os.h"
#include "packet_decoder.h"
#include "packet_queue.h"
#include "sqlite_header.h"
#include "../../pcap_service.h"
Include dependency graph for header_middleware.c:

Macros

#define HEADER_PROCESS_INTERVAL   10 * 1000
 

Functions

void add_packet_queue (UT_array *tp_array, struct packet_queue *queue)
 
void eloop_tout_header_handler (void *eloop_ctx, void *user_ctx)
 
void free_header_middleware (struct middleware_context *context)
 
struct middleware_contextinit_header_middleware (sqlite3 *db, char *db_path, struct eloop_data *eloop, struct pcap_context *pc, char *params)
 
int process_header_middleware (struct middleware_context *context, const char *ltype, struct pcap_pkthdr *header, uint8_t *packet, char *ifname)
 

Variables

struct capture_middleware header_middleware
 Packet Header Capture Middleware. The header middleware stores packet headers and other packet metadata into the capture SQLite database. More...
 

Detailed Description

File containing the implementation of the header middleware utilities.

Author
Alexandru Mereacre
Date
2021

Macro Definition Documentation

◆ HEADER_PROCESS_INTERVAL

#define HEADER_PROCESS_INTERVAL   10 * 1000

Function Documentation

◆ add_packet_queue()

void add_packet_queue ( UT_array *  tp_array,
struct packet_queue queue 
)

◆ eloop_tout_header_handler()

void eloop_tout_header_handler ( void *  eloop_ctx,
void *  user_ctx 
)

◆ free_header_middleware()

void free_header_middleware ( struct middleware_context context)

◆ init_header_middleware()

struct middleware_context* init_header_middleware ( sqlite3 *  db,
char *  db_path,
struct eloop_data *  eloop,
struct pcap_context pc,
char *  params 
)

◆ process_header_middleware()

int process_header_middleware ( struct middleware_context context,
const char *  ltype,
struct pcap_pkthdr *  header,
uint8_t *  packet,
char *  ifname 
)

Variable Documentation

◆ header_middleware

struct capture_middleware header_middleware
Initial value:
= {
.name = "header middleware",
}
int process_header_middleware(struct middleware_context *context, const char *ltype, struct pcap_pkthdr *header, uint8_t *packet, char *ifname)
Definition: header_middleware.c:142
struct middleware_context * init_header_middleware(sqlite3 *db, char *db_path, struct eloop_data *eloop, struct pcap_context *pc, char *params)
Definition: header_middleware.c:89
void free_header_middleware(struct middleware_context *context)
Definition: header_middleware.c:79

Packet Header Capture Middleware. The header middleware stores packet headers and other packet metadata into the capture SQLite database.

Authors
Alexandru Mereacre, Alois Klink