@@ -50,13 +50,10 @@ class docker
50
50
static std::string get_socket_file ();
51
51
52
52
private:
53
- static const std::string DOCKER_SOCKET_FILE;
54
53
void connect ();
55
54
void send_event_data_request ();
56
55
void check_collector_status ();
57
56
58
- void handle_event (Json::Value&& root);
59
-
60
57
template <typename T>
61
58
bool connect (T http, typename T::element_type::json_callback_func_t func, int expected_connections)
62
59
{
@@ -89,21 +86,23 @@ class docker
89
86
typedef handler_t ::ptr_t handler_ptr_t ;
90
87
typedef socket_collector<handler_t > collector_t ;
91
88
92
- std::string m_id;
93
89
handler_ptr_t m_event_http;
94
90
collector_t m_collector;
95
91
std::string m_event_uri;
96
92
#endif // HAS_CAPTURE
97
93
98
94
private:
99
95
96
+ static const std::string DOCKER_SOCKET_FILE;
100
97
typedef std::vector<json_ptr_t > event_list_t ;
101
98
typedef sinsp_logger::event_severity severity_t ;
102
99
typedef std::unordered_map<std::string, severity_t > severity_map_t ;
103
100
typedef std::unordered_map<std::string, std::string> name_translation_map_t ;
104
101
typedef std::set<std::string> entity_events_t ;
105
102
const std::string& translate_name (const std::string& event_name);
103
+ void handle_event (Json::Value&& root);
106
104
105
+ std::string m_id;
107
106
long m_timeout_ms;
108
107
bool m_is_captured;
109
108
bool m_verbose;
@@ -120,6 +119,7 @@ class docker
120
119
bool m_event_limit_exceeded = false ;
121
120
};
122
121
122
+ #ifdef HAS_CAPTURE
123
123
inline const std::string& docker::get_id () const
124
124
{
125
125
return m_id;
@@ -139,6 +139,7 @@ inline const std::string& docker::get_machine_id() const
139
139
{
140
140
return m_machine_id;
141
141
}
142
+ #endif // HAS_CAPTURE
142
143
143
144
inline const std::string& docker::translate_name (const std::string& event_name)
144
145
{
@@ -150,6 +151,7 @@ inline const std::string& docker::translate_name(const std::string& event_name)
150
151
return event_name;
151
152
}
152
153
154
+ #ifdef HAS_CAPTURE
153
155
inline bool docker::is_container_event (const std::string& evt_name)
154
156
{
155
157
return m_container_events.find (evt_name) != m_container_events.end ();
@@ -169,6 +171,7 @@ inline bool docker::is_network_event(const std::string& evt_name)
169
171
{
170
172
return m_network_events.find (evt_name) != m_network_events.end ();
171
173
}
174
+ #endif // HAS_CAPTURE
172
175
173
176
inline void docker::reset_event_counter ()
174
177
{
0 commit comments