EDGESEC  0.1.0-alpha.0+sha.ca29a8277b72f80785649ea9ef9cd7edf642d939
Secure router - reference implementation
Functions
sqlite_macconn_writer.c File Reference

File containing the implementation of the sqlite macconn writer utilities. More...

#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <sqlite3.h>
#include <string.h>
#include "sqlite_macconn_writer.h"
#include "../utils/allocs.h"
#include "../utils/log.h"
#include "../utils/net.h"
#include "../utils/os.h"
#include "../utils/sqliteu.h"
Include dependency graph for sqlite_macconn_writer.c:

Functions

void free_sqlite_macconn_db (sqlite3 *db)
 Closes the sqlite db. More...
 
int open_sqlite_macconn_db (const char *db_path, sqlite3 **sql)
 Opens the sqlite macconn db. More...
 
int save_sqlite_macconn_entry (sqlite3 *db, struct mac_conn *conn)
 Saves a macconn entry in the sqlite db. More...
 
int get_sqlite_macconn_entries (sqlite3 *db, UT_array *entries)
 Saves a macconn entries in the sqlite db. More...
 

Detailed Description

File containing the implementation of the sqlite macconn writer utilities.

Author
Alexandru Mereacre
Date
2021

Function Documentation

◆ free_sqlite_macconn_db()

void free_sqlite_macconn_db ( sqlite3 *  db)

Closes the sqlite db.

Parameters
dbThe sqlite db structure pointer

◆ get_sqlite_macconn_entries()

int get_sqlite_macconn_entries ( sqlite3 *  db,
UT_array *  entries 
)

Saves a macconn entries in the sqlite db.

Parameters
dbThe sqlite db structure pointer
entriesThe macconn entries
Returns
int 0 on success, -1 on failure

◆ open_sqlite_macconn_db()

int open_sqlite_macconn_db ( const char *  db_path,
sqlite3 **  sql 
)

Opens the sqlite macconn db.

Parameters
db_pathThe sqlite db path
[out]sqlThe returned sqlite db structure pointer
Returns
0 on success, -1 on failure

◆ save_sqlite_macconn_entry()

int save_sqlite_macconn_entry ( sqlite3 *  db,
struct mac_conn conn 
)

Saves a macconn entry in the sqlite db.

Parameters
dbThe sqlite db structure pointer
connThe MAC connection structure
Returns
int 0 on success, -1 on failure