Something went wrong. Try again.
Expose HTTP/SSH/TCP services through SSH port forwarding. sandhole.com.br
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445// sandhole: Expose HTTP/SSH/TCP services through SSH port forwarding// Copyright (C) 2024-2026 Eric Rodrigues Pires//// This program is free software: you can redistribute it and/or modify it under// the terms of the GNU Affero General Public License as published by the Free// Software Foundation, either version 3 of the License, or (at your option)// any later version.//// This program is distributed in the hope that it will be useful, but WITHOUT// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS// FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for// more details.//// You should have received a copy of the GNU Affero General Public License along// with this program. If not, see <https://www.gnu.org/licenses/>.
// Original code (CC0 1.0 Universal):// <https://github.com/sunshowers-code/borrow-complex-key-example>
use std::{ hash::{Hash, Hasher}, net::IpAddr,};
use russh::keys::ssh_key::Fingerprint;
// A TCP alias, with an address and a port.#[derive(Clone, Debug, Eq, Ord, PartialEq, PartialOrd)]pub(crate) struct KeepaliveAlias( pub(crate) String, pub(crate) IpAddr, pub(crate) Option<Fingerprint>,);
impl Hash for KeepaliveAlias { fn hash<H: Hasher>(&self, state: &mut H) { self.0.hash(state); self.1.hash(state); self.2 .as_ref() .map(|fingerprint| fingerprint.as_bytes()) .hash(state); }}