forked from netboxlabs/pktvisor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathNetHandlerModulePlugin.cpp
32 lines (26 loc) · 1.07 KB
/
NetHandlerModulePlugin.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
/* 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 "NetHandlerModulePlugin.h"
#include "CoreRegistry.h"
#include "HandlerManager.h"
#include "InputStreamManager.h"
#include "NetStreamHandler.h"
#include <Corrade/PluginManager/AbstractManager.h>
#include <nlohmann/json.hpp>
CORRADE_PLUGIN_REGISTER(VisorHandlerNet, visor::handler::net::NetHandlerModulePlugin,
"visor.module.handler/1.0")
namespace visor::handler::net {
using namespace visor::input::pcap;
using json = nlohmann::json;
void NetHandlerModulePlugin::setup_routes(HttpServer *svr)
{
}
std::unique_ptr<StreamHandler> NetHandlerModulePlugin::instantiate(const std::string &name, InputStream *input_stream, const Configurable *config)
{
// TODO using config as both window config and module config
auto handler_module = std::make_unique<NetStreamHandler>(name, input_stream, config);
handler_module->config_merge(*config);
return handler_module;
}
}