Untitled

 avatar
unknown
plain_text
2 years ago
5.6 kB
5
Indexable
@startuml

namespace cqp.tunnels {
    namespace Names {
        +TunnelID : string
        +KeyName : string
        +IV : string
        +CipherData : string
        +LocalDetails : string
        +RemoteDetails : string
        +CompletedDetails : string
        +RequestedDetails : string
        +Result : string
        +Address : string
        +Port : string
        +Command : string
        +Response : string
        +ITunnelManager : string
        +CreateTunnel : string
        +CompleteTunnel : string
        +CloseTunnel : string
        +CompleteCloseTunnel : string
        +Upgrade : string
    }
    namespace EndpointDetailsNames {
        +name : string
        +tunnelId : string
        +farSideController : string
        +farSideControllerId : string
        +active : string
        +keyDeviceId : string
        +encryptionMethod : string
        +clientDataPort : string
        +encryptedDataChannel : string
        +nodeIndex : string
    }
    namespace ControllerDetailsNames {
        +name : string
        +address : string
        +port : string
        +devices : string
        +tunnels : string
        +id : string
        +connectionAddress : string
    }
    namespace CypherSuiteNames {
        +keyExchangeAlgorithm : string
        +bultEncryptionAlgorithm : string
        +macAlgorithm : string
        +randomFunction : string
    }


class Controller {

        + Controller(initialSettings: remote::tunnels::ControllerDetails)
    + GetSupportedSchemes(context: grpc::ServerContext, empty: google::protobuf::Empty, response: remote::tunnels::EncryptionSchemes*) : grpc::Status
    + GetControllerSettings(context: grpc::ServerContext, empty: google::protobuf::Empty, response: remote::tunnels::ControllerDetails*) : grpc::Status
    + ModifyTunnel(context: grpc::ServerContext, request: remote::tunnels::Tunnel*, empty: google::protobuf::Empty) : grpc::Status
    + DeleteTunnel(context: grpc::ServerContext, request: google::protobuf::StringValue*, empty: google::protobuf::Empty) : grpc::Status
    + StartTunnel(context: grpc::ServerContext, request: google::protobuf::StringValue*, empty: google::protobuf::Empty) : grpc::Status
    + StopTunnel(context: grpc::ServerContext, request: google::protobuf::StringValue*, empty: google::protobuf::Empty) : grpc::Status
    + CompleteTunnel(context: grpc::ServerContext, request: remote::tunnels::CompleteTunnelRequest*, response: remote::tunnels::CompleteTunnelResponse*) : grpc::Status
    + StartAllTunnels() : void
    + StopAllTunnels() : void
    + GetControllerSettings(response: remote::tunnels::ControllerDetails&) : void
    + ModifyTunnel(tunnel: remote::tunnels::Tunnel) : void
    + StartTunnel(name: string) : grpc::Status
    + StopTunnel(name: string) : grpc::Status
    + OnServiceDetected(newServices: RemoteHosts, deletedServices: RemoteHosts) : void
    # WaitForKeyStore(timeout: std::chrono::milliseconds = std::chrono::milliseconds(0)): bool
    # FindController(tun: remote::tunnels::Tunnel): std::shared_ptr<grpc::Channel>

     # remote::tunnels::ControllerDetails settings
    # std::mutex settingsMutex
    # std::shared_ptr<grpc::ChannelCredentials> clientCreds
    # std::shared_ptr<grpc::ServerCredentials> serverCreds
    # using ControllerList = std::unordered_map<std::string, std::shared_ptr<grpc::Channel>>
    # ControllerList endpointsByName
    # ControllerList endpointsByID
    # std::mutex controllerDetectedMutex
    # std::condition_variable controllerDetectedCv
    # using TunnelBuilderList = std::unordered_map<std::string, std::shared_ptr<TunnelBuilder>>
    # TunnelBuilderList tunnelBuilders
    # std::string keyStoreFactoryUri
    # std::shared_ptr<grpc::Channel> keyFactoryChannel
}

 class DeviceIO {
            +WaitUntilReady(timeout: std::chrono::milliseconds = std::chrono::milliseconds(3000)): bool noexcept
            +Read(data: void*, length: size_t, bytesReceived: size_t&): bool
            +Write(data: const void*, length: size_t): bool
            +Put2(inString: const unsigned char*, length: size_t, messageEnd: int, blocking: bool): size_t
            #ready: bool
            #readyCv: std::condition_variable
            #readyMutex: std::mutex
        }

    namespace CryptoPP {
    class Bufferless<Sink> {
  }
}
 class EthTap {
        - mode: Mode
        + EthTap(deviceName: const std::string&, mode: Mode, address: const std::string&, netMask: const std::string&, persist: bool = false)
        + Create(uri: URI) : EthTap*
        + GetName(): const std::string&
        + IsValid(): bool
        + SetPersist(on: bool): bool
        + SetOwner(user: int = -1, group: int = -1): bool
        + ~EthTap(): virtual override
        + Read(data: void*, length: size_t, bytesReceived: size_t&): bool override
        + Write(data: const void*, length: size_t): bool override
        + static Create(uri: const URI&): EthTap*
        + static FindDevices(): std::vector<DeviceDetails>
         +FindDevices(): std::vector<DeviceDetails>
        #name: std::string
        #bufferSize: size_t
    }

    class EthTap::Params {
- name: CONSTSTRING = "name"
- netmask: CONSTSTRING = "netmask"
- mode_tun: CONSTSTRING = "tun"
- mode_tap: CONSTSTRING = "tap"
- persist: CONSTSTRING = "persist"
}

class DeviceDetails {
    -name: std::string
    -address: URI
    -mode: Mode
}
tunnels.DeviceIO --|> CryptoPP::Bufferless<CryptoPP::Sink>
EthTap -- DeviceDetails
EthTap -- Params
EthTap --|> DeviceIO
EthTap --|> net::Socket
}

@enduml
Editor is loading...