diff options
| author | Claudius "keldu" Holeksa <mail@keldu.de> | 2025-11-05 09:44:04 +0100 |
|---|---|---|
| committer | Claudius "keldu" Holeksa <mail@keldu.de> | 2025-11-05 09:44:04 +0100 |
| commit | c1d73cbe17650c834faee5a0098a9499b39a2835 (patch) | |
| tree | ac9c1180f5f8603dd887b7360597db8c53b6e99e /modules/io-ssh/c++/ssh.hpp | |
| parent | 5c1d7018ba867a73c160cc044b939e35a2c07243 (diff) | |
| download | forstio-forstio-c1d73cbe17650c834faee5a0098a9499b39a2835.tar.gz | |
Dangling changes from the weekend. Added io/ssh setup
Diffstat (limited to 'modules/io-ssh/c++/ssh.hpp')
| -rw-r--r-- | modules/io-ssh/c++/ssh.hpp | 43 |
1 files changed, 43 insertions, 0 deletions
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 <forstio/io/io.hpp> + +namespace saw { +namespace net { +struct Ssh {}; +} + +template<> +class network_address<net::Ssh> final { +private: + std::string address_; +public: + network_address(const std::string& address__): + address_{address__} + {} +}; + +template<> +class network<net::Ssh> final { +private: +public: + conveyor<own<network_address<net::Ssh>>> resolve_address(const std::string& addr){ + return make_error<err::not_implemented>("SSH resolve address not implemented"); + } + + error_or<own<network_address<net::Ssh>>> parse_address(const std::string& addr){ + return heap<network_address<net::Ssh>>(addr); + } +}; + +error_or<own<network<net::Ssh>>> setup_ssh_network(){ + own<network<net::Ssh>> ssh_net; + try{ + ssh_net = heap<network<net::Ssh>>(); + }catch(const std::exception& e){ + (void)e; + return make_error<err::critical>("Couldn't allocate ssh memory"); + } + return ssh_net; +} +} |
