osquery-1/osquery/tables/events/event_utils.h

35 lines
1.0 KiB
C
Raw Normal View History

/**
* Copyright (c) 2014-present, Facebook, Inc.
2015-12-11 17:58:50 +00:00
* All rights reserved.
*
* This source code is licensed under both the Apache 2.0 license (found in the
* LICENSE file in the root directory of this source tree) and the GPLv2 (found
* in the COPYING file in the root directory of this source tree).
* You may select, at your option, one of the above-listed licenses.
2015-12-11 17:58:50 +00:00
*/
2016-02-26 18:58:36 +00:00
#pragma once
#include <set>
2015-12-11 17:58:50 +00:00
#include <string>
#include <osquery/tables.h>
namespace osquery {
/// List of columns decorated for file events.
extern const std::set<std::string> kCommonFileColumns;
2015-12-11 17:58:50 +00:00
/**
* @brief A helper function for each platform's implementation of file_events.
*
* Given an action and path, this Row decorator assures a common implementation
* of hashing and common columns from the `file` table.
*
* @param path The target path from the file event.
* @param hash Should the target path be read and hashed.
* @param r The output parameter row structure.
*/
void decorateFileEvent(const std::string& path, bool hash, Row& r);
}