Skip to content

Commit 96a4144

Browse files
committed
Minor code tidy: gRPC is a separate module in the analyser
directory / namespace.
1 parent ec69b92 commit 96a4144

File tree

4 files changed

+49
-14
lines changed

4 files changed

+49
-14
lines changed

include/cyberprobe/analyser/grpc.h

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
2+
////////////////////////////////////////////////////////////////////////////
3+
//
4+
// gRPC stuff
5+
//
6+
////////////////////////////////////////////////////////////////////////////
7+
8+
#ifndef CYBERPROBE_ANALYSER_GRPC_H
9+
#define CYBERPROBE_ANALYSER_GRPC_H
10+
11+
#ifdef HAVE_CONFIG_H
12+
#include <config.h>
13+
#endif
14+
15+
#include <memory>
16+
#include <string>
17+
#include <cyberprobe/event/event.h>
18+
19+
namespace cyberprobe {
20+
21+
namespace analyser {
22+
23+
#ifdef WITH_GRPC
24+
25+
class eventstream_client;
26+
27+
class grpc_manager {
28+
public:
29+
grpc_manager() {}
30+
std::map<std::string, std::shared_ptr<eventstream_client> > client;
31+
static std::shared_ptr<grpc_manager> create();
32+
void observe(std::shared_ptr<event::event>, const std::string& svc);
33+
void close();
34+
virtual ~grpc_manager();
35+
};
36+
37+
#endif
38+
39+
}
40+
41+
}
42+
43+
#endif

include/cyberprobe/analyser/lua.h

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ extern "C" {
3232
#include <cyberprobe/protocol/tls_handshake_protocol.h>
3333
#include <cyberprobe/event/event.h>
3434

35+
#ifdef WITH_GRPC
36+
#include <cyberprobe/analyser/grpc.h>
37+
#endif
38+
3539
namespace cyberprobe {
3640

3741
namespace analyser {
@@ -442,18 +446,6 @@ delete[] buf;
442446

443447
#ifdef WITH_GRPC
444448

445-
class eventstream_client;
446-
447-
class grpc_manager {
448-
public:
449-
grpc_manager() {}
450-
std::map<std::string, std::shared_ptr<eventstream_client> > client;
451-
static std::shared_ptr<grpc_manager> create();
452-
void observe(std::shared_ptr<event::event>, const std::string& svc);
453-
void close();
454-
virtual ~grpc_manager();
455-
};
456-
457449
class grpc_userdata {
458450
public:
459451

src/Makefile.am

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ endif
179179
if WITH_PROTOBUF
180180
if WITH_GRPC
181181

182-
libcybermon_la_SOURCES += event/event_grpc.C
182+
libcybermon_la_SOURCES += analyser/grpc.C
183183

184184
eventstream_service_SOURCES = eventstream-service.C network/socket.C \
185185
../include/cyberprobe/network/socket.h

src/event/event_grpc.C renamed to src/analyser/grpc.C

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
#include <thread>
1010

1111
#include <cyberprobe/event/event.h>
12-
#include <cyberprobe/analyser/lua.h>
12+
#include <cyberprobe/analyser/grpc.h>
1313

1414
#include <grpc/grpc.h>
1515
#include <grpcpp/channel.h>

0 commit comments

Comments
 (0)