osquery-1/osquery/registry/registry.h

35 lines
660 B
C
Raw Normal View History

2014-08-05 08:21:28 +00:00
// Copyright 2004-present Facebook. All Rights Reserved.
#pragma once
2014-08-05 08:21:28 +00:00
#include <memory>
2014-08-12 00:37:49 +00:00
#include <sqlite3.h>
#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)