Nix  2.93.0-dev
Lix: A modern, delicious implementation of the Nix package manager; unstable internal interfaces
Loading...
Searching...
No Matches
ssh.hh
Go to the documentation of this file.
1#pragma once
3
6#include "lix/libutil/sync.hh"
7#include <cstdint>
8
9namespace nix {
10
12{
13private:
14
15 const std::string host;
16 const std::optional<uint16_t> port;
17 bool fakeSSH;
18 const std::string keyFile;
19 const std::string sshPublicHostKey;
20 const bool useMaster;
21 const bool compress;
22 const int logFD;
23
24 struct State
25 {
26 Pid sshMaster;
27 std::unique_ptr<AutoDelete> tmpDir;
28 Path socketPath;
29 };
30
31 Sync<State> state_;
32
33 void addCommonSSHOpts(Strings & args);
34 bool isMasterRunning();
35
36public:
37
38 SSHMaster(const std::string & host, const std::optional<uint16_t> port, const std::string & keyFile, const std::string & sshPublicHostKey, bool useMaster, bool compress, int logFD = -1);
39
41 {
42 Pid sshPid;
43 AutoCloseFD out, in;
44 };
45
46 std::unique_ptr<Connection> startCommand(const std::string & command);
47
48 Path startMaster();
49};
50
51}
Definition file-descriptor.hh:42
Definition processes.hh:24
Definition ssh.hh:12
Definition sync.hh:37
Definition ssh.hh:41
std::string Path
Definition types.hh:28