Pulp 1.88.0
Cross-platform audio plugin framework
Loading...
Searching...
No Matches
control_carrier.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <cstdint>
4#include <filesystem>
5#include <optional>
6
7namespace pulp::inspect {
8
13 std::uint64_t device = 0;
14 std::uint64_t inode = 0;
15
17 const ControlEndpointIdentity&) = default;
18};
19
21std::filesystem::path default_control_runtime_directory();
22
26std::filesystem::path default_control_runtime_directory(const std::filesystem::path& runtime_root);
27
29std::filesystem::path default_control_endpoint_path();
30std::filesystem::path default_control_endpoint_path(const std::filesystem::path& runtime_root);
31
35bool prepare_control_runtime_directory(const std::filesystem::path& runtime_directory);
36
39std::optional<ControlEndpointIdentity>
40control_endpoint_identity(const std::filesystem::path& endpoint_path);
41
44bool remove_stale_control_endpoint(const std::filesystem::path& endpoint_path,
45 const ControlEndpointIdentity& expected_identity);
46
49bool remove_stale_control_endpoint(const std::filesystem::path& endpoint_path);
50
51} // namespace pulp::inspect
Definition agent_context.hpp:7
std::filesystem::path default_control_endpoint_path()
Deterministic LocalSocket endpoint for the control broker.
std::filesystem::path default_control_runtime_directory()
Deterministic owner-specific directory for the control carrier.
std::optional< ControlEndpointIdentity > control_endpoint_identity(const std::filesystem::path &endpoint_path)
Capture a socket only when its parent is private and its path is an owner-owned 0600 local endpoint.
bool remove_stale_control_endpoint(const std::filesystem::path &endpoint_path, const ControlEndpointIdentity &expected_identity)
Remove an endpoint only if its device and inode still match the identity captured before the caller's...
bool prepare_control_runtime_directory(const std::filesystem::path &runtime_directory)
Create or validate an absolute owner-only runtime directory.
Filesystem identity captured for an owner-private local socket endpoint.
Definition control_carrier.hpp:12
std::uint64_t device
Definition control_carrier.hpp:13
friend bool operator==(const ControlEndpointIdentity &, const ControlEndpointIdentity &)=default
std::uint64_t inode
Definition control_carrier.hpp:14