]> sourceware.org Git - systemtap.git/blob - cscommon.h
step-prep: on debian/ubuntu machines, attempt "apt-get -y install"
[systemtap.git] / cscommon.h
1 // Common functions and macros used by the compile-server and its client.
2 #ifndef CSCOMMON_H
3 #define CSCOMMON_H 1
4
5 #define MOK_PUBLIC_CERT_NAME "signing_key.x509"
6 #define MOK_PUBLIC_CERT_FILE "/" MOK_PUBLIC_CERT_NAME
7
8 #if HAVE_NSS
9 extern "C"
10 {
11 #include <ssl.h>
12 #include <nspr.h>
13 }
14 #endif
15
16 // Versioning system for the protocol used for communication between the compile-server and client.
17 // The original version is 1.0. After that, we use the systemtap release number.
18 //
19 // By Policy:
20 // - All servers are backward compatible with clients. Servers adapt to the protocol version
21 // of the client.
22 // - All clients are backward compatible with servers. Clients adapt to the protocol version
23 // of the server. Warnings are issued for servers lacking features.
24 //
25 // Features:
26 // Version 1.0
27 // Original version
28 // Versions 1.6 and higher
29 // Client:
30 // - Passes localization variables to the server in the file client_tmpdir + "/locale"
31 // - Looks for the uprobes module in server_response + "/uprobes"
32 // - No longer needs to remove stap's "Keeping temporary directory ..." message from
33 // the server's stderr response.
34 // - Looks for 'version' tag in server's avahi record and does not automatically connect to
35 // an incompatible server. Also prefers newer servers over older ones.
36 // Server:
37 // - Applies localization variables passed from the client to stap during translation.
38 // - Looks for the uprobes module in server_response + "/uprobes"
39 // - Uses --tmpdir to specify temp directory to be used by stap, instead of -k, in order to
40 // avoid parsing error messages in search of stap's randomly-generated temp dir.
41 // - Advertises its protocol version using a 'version' tag in avahi.
42 //
43 #define CURRENT_CS_PROTOCOL_VERSION VERSION
44
45 struct cs_protocol_version
46 {
47 cs_protocol_version (const char *v = "1.0") : v(0) { *this = v; }
48 ~cs_protocol_version ();
49 const cs_protocol_version &operator= (const char *v);
50 bool operator< (const cs_protocol_version &that) const;
51
52 const char *v;
53 };
54
55 #if HAVE_NSS
56 struct thread_arg
57 {
58 PRFileDesc *tcpSocket;
59 CERTCertificate *cert;
60 SECKEYPrivateKey *privKey;
61 PRNetAddr addr;
62 };
63
64 extern int read_from_file (const std::string &fname, cs_protocol_version &data);
65 extern std::string get_cert_serial_number (const CERTCertificate *cert);
66 #endif
67
68 #endif // CSCOMMON_H
This page took 0.03464 seconds and 5 git commands to generate.