11 #ifndef SQLITE_MACCONN_WRITER_H
12 #define SQLITE_MACCONN_WRITER_H
20 #include "../utils/allocs.h"
21 #include "../utils/os.h"
22 #include "../utils/squeue.h"
24 #define MACCONN_TABLE_NAME "instance"
26 #define MACCONN_CREATE_TABLE \
27 "CREATE TABLE IF NOT EXISTS " MACCONN_TABLE_NAME \
28 " (id TEXT NOT NULL, mac TEXT NOT NULL, status INTEGER, vlanid INTEGER, " \
29 "primaryip TEXT, secondaryip TEXT, nat INTEGER, allow INTEGER, label TEXT, " \
30 "timestamp INTEGER, pass TEXT, PRIMARY KEY (id, mac));"
31 #define MACCONN_INSERT_INTO \
32 "INSERT INTO " MACCONN_TABLE_NAME \
33 " VALUES(@id, @mac, @status, @vlanid, @primaryip, @secondaryip, " \
34 "@nat, @allow, @label, @timestamp, @pass);"
35 #define MACCONN_DELETE_FROM "DELETE FROM " MACCONN_TABLE_NAME " WHERE mac=@mac;"
36 #define MACCONN_SELECT_FROM \
37 "SELECT mac, id, status, vlanid, nat, allow, label, pass FROM " \
38 " " MACCONN_TABLE_NAME ";"
File containing the definition of the mac mapper.
void free_sqlite_macconn_db(sqlite3 *db)
Closes the sqlite db.
Definition: sqlite_macconn_writer.c:26
int get_sqlite_macconn_entries(sqlite3 *db, UT_array *entries)
Saves a macconn entries in the sqlite db.
Definition: sqlite_macconn_writer.c:180
int save_sqlite_macconn_entry(sqlite3 *db, struct mac_conn *conn)
Saves a macconn entry in the sqlite db.
Definition: sqlite_macconn_writer.c:58
int open_sqlite_macconn_db(const char *db_path, sqlite3 **sql)
Opens the sqlite macconn db.
Definition: sqlite_macconn_writer.c:32
MAC connection structure.
Definition: mac_mapper.h:57