File: client-http.h

package info (click to toggle)
systemtap 4.0-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 36,436 kB
  • sloc: cpp: 72,388; ansic: 58,430; xml: 47,797; exp: 40,417; sh: 10,793; python: 2,759; perl: 2,252; tcl: 1,305; makefile: 1,119; lisp: 105; java: 102; awk: 101; asm: 91; sed: 16
file content (64 lines) | stat: -rw-r--r-- 1,829 bytes parent folder | download | duplicates (4)
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
// -*- C++ -*-
// Copyright (C) 2017-2018 Red Hat Inc.
//
// This file is part of systemtap, and is free software.  You can
// redistribute it and/or modify it under the terms of the GNU General
// Public License (GPL); either version 2, or (at your option) any
// later version.

#ifndef CLIENT_HTTP_H
#define CLIENT_HTTP_H

#ifdef HAVE_HTTP_SUPPORT

#include "session.h"
#include "csclient.h"
#include <json-c/json.h>

class http_client;
class http_client_backend : public client_backend
{
public:
  http_client_backend (systemtap_session &s);
  ~http_client_backend ();

  friend class http_client;

  int initialize ();
  int package_request ();
  int find_and_connect_to_server ();
  int unpack_response ();
  int process_response ();

  int add_protocol_version (const std::string &version);
  int add_sysinfo ();
  int include_file_or_directory (const std::string &subdir,
				 const std::string &path,
				 const bool add_arg = true);
  int add_tmpdir_file (const std::string &file);
  int add_cmd_arg (const std::string &arg);

  void add_localization_variable(const std::string &var,
				 const std::string &value);
  int finalize_localization_variables() { return 0; };

  void add_mok_fingerprint(const std::string &fingerprint);
  int finalize_mok_fingerprints() { return 0; };

  void fill_in_server_info (compile_server_info &info);
  int trust_server_info (const compile_server_info &info);

  // FIXME: The 'request_parameters' data item isn't right. This means
  // we can only add string parameters, not numeric parameters. We
  // could have 'request_string_parameters' and
  // 'request_numeric_parameters' - but then we get the ordering
  // wrong.
  std::vector<std::tuple<std::string, std::string>> request_parameters;

private:
  bool files_seen;
};

#endif	// HAVE_HTTP_SUPPORT

#endif	// CLIENT_HTTP_H