File: connection.h

package info (click to toggle)
falcosecurity-libs 0.1.1dev%2Bgit20220316.e5c53d64-5.1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 4,732 kB
  • sloc: cpp: 55,770; ansic: 37,330; makefile: 74; sh: 13
file content (44 lines) | stat: -rw-r--r-- 688 bytes parent folder | download
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
35
36
37
38
39
40
41
42
43
44
#pragma once

#ifndef _WIN32
#include <curl/curl.h>
#include <curl/easy.h>
#include <curl/multi.h>
#endif

#include <string>

#include "container_engine/docker/lookup_request.h"

namespace libsinsp {
namespace container_engine {

class docker_connection {
public:
	enum docker_response {
		RESP_OK = 0,
		RESP_BAD_REQUEST = 1,
		RESP_ERROR = 2
	};

	docker_connection();
	~docker_connection();

	docker_response
	get_docker(const docker_lookup_request& request, const std::string& req_url, std::string& json);

	void set_api_version(const std::string& api_version)
	{
		m_api_version = api_version;
	}

private:
	std::string m_api_version;

#ifndef _WIN32
	CURLM *m_curlm;
#endif
};

}
}