# Process packets despite bad checksums.
redef ignore_checksums = T;
This will change significantly with Bro 2.2 when we have the file analysis
// --- component setup -------------------------------------------------------- | |
// Creates a broker execution context that encapsulates runtime state, such as | |
// a thread pool and message type information. | |
system sys{cfg}; | |
// Create a broker in a given system. A broker is a thin abstraction on top of | |
// a CAF actor for sending and receiving messages. There exist synchronous and | |
// aysnchronous brokers. | |
async_broker a{sys}; |
#include <cassert> | |
#include <iostream> | |
#include <vector> | |
#include <caf/all.hpp> | |
using namespace std; | |
using namespace caf; | |
// Predicate to check whether a particular bot is the puzzle solution. |
#include <cassert> | |
#include <iostream> | |
#include <vector> | |
#include <caf/all.hpp> | |
using namespace std; | |
using namespace caf; | |
// The same bot from part one. |
flexbuffers::Builder& build(flexbuffers::Builder& builder, const data& x) { | |
static auto to_uint = [](auto i) { | |
return static_cast<std::underlying_type_t<detail::DataType>>(i); | |
}; | |
struct converter { | |
converter(flexbuffers::Builder& builder) : builder_{builder} { | |
} | |
void operator()(none) { | |
builder_.UInt(to_uint(detail::DataType::NoneType)); | |
} |
#ifndef VAST_FLEXBUFFER_PACKER_HPP | |
#define VAST_FLEXBUFFER_PACKER_HPP | |
#include <caf/deserializer.hpp> | |
#include <caf/serializer.hpp> | |
#include <flatbuffers/flexbuffers.h> | |
#include "vast/chunk.hpp" |
flexbuffers::Builder& build(flexBuffers::Builder& builder, const data& x) { | |
struct converter { | |
converter(flatbuffers::FlatBufferBuilder& builder) : builder_{builder} { | |
} | |
using result_type = flatbuffers::Offset<detail::Data>; | |
result_type operator()(none) { | |
detail::DataBuilder db{builder_}; | |
return db.Finish(); | |
} | |
result_type operator()(boolean x) { |
#!/bin/sh | |
# | |
# Checks Maildir directories for new mail. For each new mail, it invokes | |
# terminal-notifier to show a notification with the message From and Subject | |
# header. | |
# | |
# The script can execute an arbitrary command when clicking on a notification, | |
# e.g., open mutt: | |
# | |
# % cat open-mutt |
when (local result = lookup_addr("www.bro-ids.org")) | |
{ | |
for (addr in result) | |
print addr; | |
} |
let blacklists = ["*://www.inoreader.com/*", "*://mail.google.com/*"] |