Nix
2.36.0
Nix, the purely functional package manager; unstable internal interfaces
Toggle main menu visibility
Loading...
Searching...
No Matches
ssh.hh
Go to the documentation of this file.
1
#pragma once
3
4
#include "
nix/util/ref.hh
"
5
#include "
nix/util/sync.hh
"
6
#include "
nix/util/url.hh
"
7
#include "
nix/util/processes.hh
"
8
#include "
nix/util/file-system.hh
"
9
10
namespace
nix {
11
17
const
std::filesystem::path &
sshProgram
();
18
19
OsStrings
getNixSshOpts();
20
21
class
SSHMaster
22
{
23
private
:
24
25
ParsedURL::Authority
authority;
26
std::string hostnameAndUser;
27
bool
fakeSSH;
28
const
std::optional<std::filesystem::path> keyFile;
32
const
std::string sshPublicHostKey;
33
const
bool
useMaster;
34
const
bool
compress;
35
const
Descriptor
logFD;
36
37
const
ref<const AutoDelete>
tmpDir;
38
39
struct
State
40
{
41
Pid
sshMaster;
42
std::filesystem::path socketPath;
43
};
44
45
Sync<State> state_;
46
47
void
addCommonSSHOpts(
OsStrings
& args);
48
bool
isMasterRunning();
49
50
std::filesystem::path startMaster();
51
52
public
:
53
54
SSHMaster(
55
const
ParsedURL::Authority
& authority,
56
std::optional<std::filesystem::path> keyFile,
57
std::string_view sshPublicHostKey,
58
bool
useMaster,
59
bool
compress,
60
Descriptor
logFD = INVALID_DESCRIPTOR);
61
62
struct
Connection
63
{
64
Pid
sshPid;
65
AutoCloseFD
out, in;
66
77
void
trySetBufferSize
(
size_t
size);
78
};
79
87
std::unique_ptr<Connection>
startCommand
(
OsStrings
&& command,
OsStrings
&& extraSshArgs = {});
88
};
89
90
}
// namespace nix
nix::AutoCloseFD
Definition
file-descriptor.hh:265
nix::Pid
Definition
processes.hh:39
nix::SSHMaster::startCommand
std::unique_ptr< Connection > startCommand(OsStrings &&command, OsStrings &&extraSshArgs={})
Definition
ssh.cc:161
nix::ref
Definition
ref.hh:58
nix::Descriptor
int Descriptor
Definition
file-descriptor.hh:36
file-system.hh
Utilities for working with the file system and file paths.
nix::OsStrings
std::list< OsString > OsStrings
Definition
os-string.hh:51
processes.hh
ref.hh
nix::sshProgram
const std::filesystem::path & sshProgram()
Definition
ssh.cc:62
nix::ParsedURL::Authority
Definition
url.hh:32
nix::SSHMaster::Connection
Definition
ssh.hh:63
nix::SSHMaster::Connection::trySetBufferSize
void trySetBufferSize(size_t size)
Definition
ssh.cc:297
sync.hh
url.hh
libstore
include
nix
store
ssh.hh
Generated by
1.18.0