mirror of
https://github.com/valitydev/osquery-1.git
synced 2024-11-07 09:58:54 +00:00
59 lines
1.4 KiB
C++
59 lines
1.4 KiB
C++
/*
|
|
* Copyright (c) 2014, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
*/
|
|
|
|
/*
|
|
** This file is generated. Do not modify it manually!
|
|
*/
|
|
|
|
#include <osquery/events.h>
|
|
#include <osquery/tables.h>
|
|
|
|
namespace osquery { namespace tables {
|
|
|
|
/// BEGIN[GENTABLE]
|
|
{% if class_name == "" %}\
|
|
osquery::QueryData {{function}}(QueryContext& request);
|
|
{% else %}
|
|
class {{class_name}} {
|
|
public:
|
|
osquery::QueryData {{function}}(QueryContext& request);
|
|
};
|
|
{% endif %}\
|
|
|
|
class {{table_name_cc}}TablePlugin : public TablePlugin {
|
|
private:
|
|
TableColumns columns() const {
|
|
return {
|
|
{% for column in schema %}\
|
|
{"{{column.name}}", "{{column.type.affinity}}"}\
|
|
{% if not loop.last %}, {% endif %}
|
|
{% endfor %}\
|
|
};
|
|
}
|
|
|
|
QueryData generate(QueryContext& request) {
|
|
{% if class_name != "" %}\
|
|
auto subscriber = EventFactory::getEventSubscriber("{{class_name}}");
|
|
return subscriber->{{function}}(request);
|
|
{% else %}\
|
|
return osquery::tables::{{function}}(request);
|
|
{% endif %}\
|
|
}
|
|
};
|
|
|
|
{% if attributes.utility %}
|
|
REGISTER_INTERNAL({{table_name_cc}}TablePlugin, "table", "{{table_name}}");
|
|
{% else %}
|
|
REGISTER({{table_name_cc}}TablePlugin, "table", "{{table_name}}");
|
|
{% endif %}
|
|
/// END[GENTABLE]
|
|
|
|
}}
|