-
Notifications
You must be signed in to change notification settings - Fork 34
/
Copy pathPcapHandlerModulePlugin.cpp
34 lines (28 loc) · 1.17 KB
/
PcapHandlerModulePlugin.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
#include "PcapHandlerModulePlugin.h"
#include "CoreRegistry.h"
#include "HandlerManager.h"
#include "InputStreamManager.h"
#include "PcapInputStream.h"
#include "PcapStreamHandler.h"
#include <Corrade/PluginManager/AbstractManager.h>
#include <nlohmann/json.hpp>
CORRADE_PLUGIN_REGISTER(VisorHandlerPcap, visor::handler::pcap::PcapHandlerModulePlugin,
"visor.module.handler/1.0")
namespace visor::handler::pcap {
using namespace visor::input::pcap;
using json = nlohmann::json;
void PcapHandlerModulePlugin::setup_routes(HttpServer *)
{
}
std::unique_ptr<StreamHandler> PcapHandlerModulePlugin::instantiate(const std::string &name, InputEventProxy *proxy, const Configurable *config, const Configurable *filter)
{
// TODO using config as both window config and module config
auto handler_module = std::make_unique<PcapStreamHandler>(name, proxy, config);
handler_module->config_merge(*config);
handler_module->config_merge(*filter);
return handler_module;
}
}