EDGESEC
0.1.0-alpha.0+sha.ca29a8277b72f80785649ea9ef9cd7edf642d939
Secure router - reference implementation
|
File containing the implementation of the sqlite pcap utilities. More...
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <sqlite3.h>
#include <string.h>
#include "sqlite_pcap.h"
#include "../../../utils/allocs.h"
#include "../../../utils/log.h"
#include "../../../utils/os.h"
#include "../../../utils/sqliteu.h"
Functions | |
int | init_sqlite_pcap_db (sqlite3 *db) |
Initialisez the sqlite pcap db tables. More... | |
int | save_sqlite_pcap_entry (sqlite3 *db, char *name, uint64_t timestamp, uint32_t caplen, uint32_t length) |
Save a pcap entry into the sqlite db. More... | |
int | get_first_pcap_entry (sqlite3 *db, uint64_t *timestamp, uint64_t *caplen) |
Returns the first pcap entry timestamp. More... | |
int | sum_pcap_group (sqlite3 *db, uint64_t lt, uint32_t lim, uint64_t *ht, uint64_t *sum) |
Calculates the sum of the group of a pcap. More... | |
int | get_pcap_meta_array (sqlite3 *db, uint64_t lt, uint32_t lim, UT_array *pcap_meta_arr) |
Returns the pcap meta array. More... | |
int | delete_pcap_entries (sqlite3 *db, uint64_t lt, uint64_t ht) |
Removes a set of entries. More... | |
File containing the implementation of the sqlite pcap utilities.
int delete_pcap_entries | ( | sqlite3 * | db, |
uint64_t | lt, | ||
uint64_t | ht | ||
) |
Removes a set of entries.
db | The sqlite db structure pointer |
lt | The lower timestamp |
ht | The higher timestamp |
int get_first_pcap_entry | ( | sqlite3 * | db, |
uint64_t * | timestamp, | ||
uint64_t * | caplen | ||
) |
Returns the first pcap entry timestamp.
db | The sqlite db structure pointer |
timestamp | The returned timestamp value |
caplen | The returned caplen value |
int get_pcap_meta_array | ( | sqlite3 * | db, |
uint64_t | lt, | ||
uint32_t | lim, | ||
UT_array * | pcap_meta_arr | ||
) |
Returns the pcap meta array.
db | The sqlite db structure pointer |
lt | The lower timestamp |
lim | The limit number of rows |
pcap_meta_arr | The pcap meta array |
int init_sqlite_pcap_db | ( | sqlite3 * | db | ) |
Initialisez the sqlite pcap db tables.
db | The sqlite3 db |
int save_sqlite_pcap_entry | ( | sqlite3 * | db, |
char * | name, | ||
uint64_t | timestamp, | ||
uint32_t | caplen, | ||
uint32_t | length | ||
) |
Save a pcap entry into the sqlite db.
db | The sqlite db structure pointer |
name | The pcap file name |
timestamp | The timestamp value |
caplen | The capture len |
length | The offwire packet len |
int sum_pcap_group | ( | sqlite3 * | db, |
uint64_t | lt, | ||
uint32_t | lim, | ||
uint64_t * | ht, | ||
uint64_t * | sum | ||
) |
Calculates the sum of the group of a pcap.
db | The sqlite db structure pointer |
lt | The lower bound timestamp |
lim | The limit number of rows |
ht | The returned upper timestamp |
sum | The returned sum |