From c1d73cbe17650c834faee5a0098a9499b39a2835 Mon Sep 17 00:00:00 2001 From: "Claudius \"keldu\" Holeksa" Date: Wed, 5 Nov 2025 09:44:04 +0100 Subject: Dangling changes from the weekend. Added io/ssh setup --- modules/io-ssh/c++/ssh.hpp | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 modules/io-ssh/c++/ssh.hpp (limited to 'modules/io-ssh/c++/ssh.hpp') diff --git a/modules/io-ssh/c++/ssh.hpp b/modules/io-ssh/c++/ssh.hpp new file mode 100644 index 0000000..93c4ac0 --- /dev/null +++ b/modules/io-ssh/c++/ssh.hpp @@ -0,0 +1,43 @@ +#pragma once + +#include + +namespace saw { +namespace net { +struct Ssh {}; +} + +template<> +class network_address final { +private: + std::string address_; +public: + network_address(const std::string& address__): + address_{address__} + {} +}; + +template<> +class network final { +private: +public: + conveyor>> resolve_address(const std::string& addr){ + return make_error("SSH resolve address not implemented"); + } + + error_or>> parse_address(const std::string& addr){ + return heap>(addr); + } +}; + +error_or>> setup_ssh_network(){ + own> ssh_net; + try{ + ssh_net = heap>(); + }catch(const std::exception& e){ + (void)e; + return make_error("Couldn't allocate ssh memory"); + } + return ssh_net; +} +} -- cgit v1.2.3