|
EDGESEC
0.1.0-alpha.0+sha.ca29a8277b72f80785649ea9ef9cd7edf642d939
Secure router - reference implementation
|
File containing the definition of the sqlite pcap utilities. More...
#include <stdint.h>#include <sqlite3.h>#include "../../../utils/allocs.h"#include "../../../utils/os.h"#include "../../../utils/squeue.h"Go to the source code of this file.
Data Structures | |
| struct | pcap_file_meta |
Macros | |
| #define | PCAP_TABLE_NAME "pcap" |
| #define | PCAP_CREATE_TABLE |
| #define | PCAP_INSERT_INTO |
| #define | PCAP_SELECT_FIRST_ENTRY |
| #define | PCAP_SUM_GROUP |
| #define | PCAP_SELECT_GROUP |
| #define | PCAP_DELETE_GROUP |
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 | 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... | |
| 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... | |
File containing the definition of the sqlite pcap utilities.
| #define PCAP_CREATE_TABLE |
| #define PCAP_DELETE_GROUP |
| #define PCAP_INSERT_INTO |
| #define PCAP_SELECT_FIRST_ENTRY |
| #define PCAP_SELECT_GROUP |
| #define PCAP_SUM_GROUP |
| #define PCAP_TABLE_NAME "pcap" |
| 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 |