File: client-nss.h

package info (click to toggle)
systemtap 5.1-5
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 47,964 kB
  • sloc: cpp: 80,838; ansic: 54,757; xml: 49,725; exp: 43,665; sh: 11,527; python: 5,003; perl: 2,252; tcl: 1,312; makefile: 1,006; javascript: 149; lisp: 105; awk: 101; asm: 91; java: 70; sed: 16
file content (68 lines) | stat: -rw-r--r-- 1,888 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
65
66
67
68
// -*- 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_NSS_H
#define CLIENT_NSS_H

#if HAVE_NSS

#include "session.h"
#include "csclient.h"
#include "cscommon.h"
#include "nss-server-info.h"
#include <string>
#include <vector>

// Utility functions
void nss_client_query_server_status (systemtap_session &s);
void nss_client_manage_server_trust (systemtap_session &s);

class nss_client_backend : public client_backend
{
public:
  nss_client_backend (systemtap_session &s);

  int initialize ();
  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 &) { return 0; };
  int add_cmd_arg (const std::string &arg);

  void add_localization_variable(const std::string &var,
				 const std::string &value);
  int finalize_localization_variables();

  void add_mok_fingerprint(const std::string &fingerprint);
  int finalize_mok_fingerprints();

  void fill_in_server_info (compile_server_info &) { return; };
  int trust_server_info (const compile_server_info &server);

  int package_request ();
  int find_and_connect_to_server ();
  int unpack_response ();

private:
  unsigned argc;
  std::string client_zipfile;
  std::string server_zipfile;
  std::string locale_vars;
  std::ostringstream mok_fingerprints;

  std::vector<std::string> private_ssl_dbs;
  std::vector<std::string> public_ssl_dbs;

  int compile_using_server (std::vector<compile_server_info> &servers);
  void show_server_compatibility () const;
};
#endif	// HAVE_NSS

#endif	// CLIENT_NSS_H