]> sourceware.org Git - systemtap.git/blob - csclient.h
configure: Remove explicit msgfmt check
[systemtap.git] / csclient.h
1 // -*- C++ -*-
2 // Copyright (C) 2010-2018 Red Hat Inc.
3 //
4 // This file is part of systemtap, and is free software. You can
5 // redistribute it and/or modify it under the terms of the GNU General
6 // Public License (GPL); either version 2, or (at your option) any
7 // later version.
8 #ifndef CSCLIENT_H
9 #define CSCLIENT_H
10
11 #include "cscommon.h"
12 #include "nss-server-info.h"
13 #include <string>
14
15 class client_backend
16 {
17 public:
18 client_backend (systemtap_session &s) : s(s) {}
19 ~client_backend () {}
20
21 void set_tmpdir (std::string &tmpdir) { client_tmpdir = tmpdir; }
22 virtual int initialize () = 0;
23 virtual int package_request () = 0;
24 virtual int find_and_connect_to_server () = 0;
25 virtual int unpack_response () = 0;
26
27 virtual int add_protocol_version (const std::string &version) = 0;
28 virtual int add_sysinfo () = 0;
29 virtual int include_file_or_directory (const std::string &subdir,
30 const std::string &path,
31 const bool add_arg = true) = 0;
32 virtual int add_tmpdir_file (const std::string &path) = 0;
33 virtual int add_cmd_arg (const std::string &arg) = 0;
34
35 virtual void add_localization_variable(const std::string &var,
36 const std::string &value) = 0;
37 virtual int finalize_localization_variables() = 0;
38
39 virtual void add_mok_fingerprint(const std::string &fingerprint) = 0;
40 virtual int finalize_mok_fingerprints() = 0;
41
42 #if HAVE_NSS
43 virtual void fill_in_server_info (compile_server_info &info) = 0;
44 virtual int trust_server_info (const compile_server_info &info) = 0;
45 #endif
46
47 std::string server_tmpdir;
48 cs_protocol_version server_version;
49
50 protected:
51 systemtap_session &s;
52 std::string client_tmpdir;
53 };
54
55 class compile_server_client
56 {
57 public:
58 compile_server_client (systemtap_session &s) : s(s), backend(NULL) {}
59 int passes_0_4 ();
60
61 private:
62 // Client/server session methods.
63 int initialize ();
64 int create_request ();
65 int process_response ();
66
67 // Client/server utility methods.
68 int add_cmd_args ();
69 int add_localization_variables();
70
71 void show_server_compatibility () const;
72
73 systemtap_session &s;
74 client_backend *backend;
75
76 std::string client_tmpdir;
77 };
78
79 // Return the appropriate client backend for the current session.
80 client_backend *nss_get_client_backend (systemtap_session &s);
81
82 #endif // CSCLIENT_H
This page took 0.039092 seconds and 5 git commands to generate.