2014-08-05 08:21:28 +00:00
|
|
|
// Copyright 2004-present Facebook. All Rights Reserved.
|
|
|
|
|
2014-09-10 01:54:53 +00:00
|
|
|
#pragma once
|
2014-08-05 08:21:28 +00:00
|
|
|
|
|
|
|
#include <memory>
|
|
|
|
|
2014-08-12 00:37:49 +00:00
|
|
|
#include <sqlite3.h>
|
|
|
|
|
2014-08-05 23:13:55 +00:00
|
|
|
#include "osquery/status.h"
|
2014-08-05 08:21:28 +00:00
|
|
|
#include "osquery/registry.h"
|
|
|
|
|
2014-08-15 07:25:30 +00:00
|
|
|
namespace osquery {
|
|
|
|
namespace tables {
|
2014-08-05 08:21:28 +00:00
|
|
|
|
|
|
|
class TablePlugin {
|
2014-08-15 07:25:30 +00:00
|
|
|
public:
|
2014-08-05 08:21:28 +00:00
|
|
|
virtual int attachVtable(sqlite3 *db) { return -1; }
|
2014-09-21 21:29:28 +00:00
|
|
|
virtual ~TablePlugin(){};
|
2014-08-15 07:25:30 +00:00
|
|
|
|
|
|
|
protected:
|
2014-09-21 21:29:28 +00:00
|
|
|
TablePlugin(){};
|
2014-08-05 08:21:28 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
void attachVirtualTables(sqlite3 *db);
|
2014-08-15 07:25:30 +00:00
|
|
|
}
|
|
|
|
}
|
2014-08-05 08:21:28 +00:00
|
|
|
|
2014-08-15 07:25:30 +00:00
|
|
|
DECLARE_REGISTRY(TablePlugins,
|
|
|
|
std::string,
|
|
|
|
std::shared_ptr<osquery::tables::TablePlugin>)
|
2014-08-05 08:21:28 +00:00
|
|
|
|
|
|
|
#define REGISTERED_TABLES REGISTRY(TablePlugins)
|
|
|
|
|
2014-08-15 07:25:30 +00:00
|
|
|
#define REGISTER_TABLE(name, decorator) REGISTER(TablePlugins, name, decorator)
|