mirror of
https://github.com/zeek/zeek.git
synced 2025-10-07 17:18:20 +00:00
Reformat Zeek in Spicy style
This largely copies over Spicy's `.clang-format` configuration file. The one place where we deviate is header include order since Zeek depends on headers being included in a certain order.
This commit is contained in:
parent
7b8e7ed72c
commit
f5a76c1aed
786 changed files with 131714 additions and 153609 deletions
|
@ -8,36 +8,32 @@
|
|||
#include <RunState.h>
|
||||
#include <threading/Formatter.h>
|
||||
|
||||
namespace btest::plugin::Demo_Unprocessed_Packet
|
||||
{
|
||||
namespace btest::plugin::Demo_Unprocessed_Packet {
|
||||
Plugin plugin;
|
||||
}
|
||||
}
|
||||
|
||||
using namespace btest::plugin::Demo_Unprocessed_Packet;
|
||||
|
||||
zeek::plugin::Configuration Plugin::Configure()
|
||||
{
|
||||
EnableHook(zeek::plugin::HOOK_UNPROCESSED_PACKET);
|
||||
zeek::plugin::Configuration Plugin::Configure() {
|
||||
EnableHook(zeek::plugin::HOOK_UNPROCESSED_PACKET);
|
||||
|
||||
zeek::plugin::Configuration config;
|
||||
config.name = "Demo::Unprocessed_Packet";
|
||||
config.description = "Exercises all plugin hooks";
|
||||
config.version.major = 1;
|
||||
config.version.minor = 0;
|
||||
config.version.patch = 0;
|
||||
return config;
|
||||
}
|
||||
zeek::plugin::Configuration config;
|
||||
config.name = "Demo::Unprocessed_Packet";
|
||||
config.description = "Exercises all plugin hooks";
|
||||
config.version.major = 1;
|
||||
config.version.minor = 0;
|
||||
config.version.patch = 0;
|
||||
return config;
|
||||
}
|
||||
|
||||
void Plugin::HookUnprocessedPacket(const zeek::Packet* packet)
|
||||
{
|
||||
zeek::ODesc d;
|
||||
d.Add("[");
|
||||
d.Add("ts=");
|
||||
d.Add(packet->time);
|
||||
d.Add(" len=");
|
||||
d.Add(packet->len);
|
||||
d.Add("]");
|
||||
void Plugin::HookUnprocessedPacket(const zeek::Packet* packet) {
|
||||
zeek::ODesc d;
|
||||
d.Add("[");
|
||||
d.Add("ts=");
|
||||
d.Add(packet->time);
|
||||
d.Add(" len=");
|
||||
d.Add(packet->len);
|
||||
d.Add("]");
|
||||
|
||||
fprintf(stdout, "%.6f %-23s %s\n", zeek::run_state::network_time, "| HookUnprocessedPacket",
|
||||
d.Description());
|
||||
}
|
||||
fprintf(stdout, "%.6f %-23s %s\n", zeek::run_state::network_time, "| HookUnprocessedPacket", d.Description());
|
||||
}
|
||||
|
|
|
@ -3,18 +3,16 @@
|
|||
|
||||
#include <plugin/Plugin.h>
|
||||
|
||||
namespace btest::plugin::Demo_Unprocessed_Packet
|
||||
{
|
||||
namespace btest::plugin::Demo_Unprocessed_Packet {
|
||||
|
||||
class Plugin : public zeek::plugin::Plugin
|
||||
{
|
||||
class Plugin : public zeek::plugin::Plugin {
|
||||
protected:
|
||||
void HookUnprocessedPacket(const zeek::Packet* packet) override;
|
||||
void HookUnprocessedPacket(const zeek::Packet* packet) override;
|
||||
|
||||
// Overridden from zeek::plugin::Plugin.
|
||||
zeek::plugin::Configuration Configure() override;
|
||||
};
|
||||
// Overridden from zeek::plugin::Plugin.
|
||||
zeek::plugin::Configuration Configure() override;
|
||||
};
|
||||
|
||||
extern Plugin plugin;
|
||||
|
||||
}
|
||||
} // namespace btest::plugin::Demo_Unprocessed_Packet
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue