2014-08-05 08:21:28 +00:00
|
|
|
// Copyright 2004-present Facebook. All Rights Reserved.
|
|
|
|
|
|
|
|
#ifndef OSQUERY_TABLES_REGISTRY_H
|
|
|
|
#define OSQUERY_TABLES_REGISTRY_H
|
|
|
|
|
|
|
|
#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"
|
|
|
|
|
|
|
|
namespace osquery { namespace tables {
|
|
|
|
|
|
|
|
class TablePlugin {
|
|
|
|
public:
|
|
|
|
virtual int attachVtable(sqlite3 *db) { return -1; }
|
|
|
|
virtual ~TablePlugin() {};
|
|
|
|
protected:
|
|
|
|
TablePlugin() {};
|
|
|
|
};
|
|
|
|
|
|
|
|
void attachVirtualTables(sqlite3 *db);
|
|
|
|
|
|
|
|
}}
|
|
|
|
|
|
|
|
DECLARE_REGISTRY(
|
|
|
|
TablePlugins,
|
|
|
|
std::string,
|
|
|
|
std::shared_ptr<osquery::tables::TablePlugin>)
|
|
|
|
|
|
|
|
#define REGISTERED_TABLES REGISTRY(TablePlugins)
|
|
|
|
|
|
|
|
#define REGISTER_TABLE(name, decorator) \
|
|
|
|
REGISTER(TablePlugins, name, decorator)
|
|
|
|
|
2014-08-05 23:13:55 +00:00
|
|
|
#endif /* OSQUERY_TABLES_REGISTRY_H */
|