Skip to content

QuantumGate::StartupParameters

Karel Donk edited this page Dec 26, 2021 · 25 revisions

QuantumGate::StartupParameters is a struct used to start a local instance of QuantumGate. It is used to configure the local instance on startup.

Definition

struct StartupParameters
{
    PeerUUID UUID;
    std::optional<PeerKeys> Keys;
    std::optional<ProtectedBuffer> GlobalSharedSecret;
    bool RequireAuthentication{ true };
    Algorithms SupportedAlgorithms;
    Size NumPreGeneratedKeysPerAlgorithm{ 5 };
    bool EnableExtenders{ false };

    struct
    {
        struct
        {
            bool Enable{ false };
            Set<UInt16> Ports{ 999 };
            bool NATTraversal{ false };
            bool UseConditionalAcceptFunction{ true };
        } TCP;
        struct
        {
            bool Enable{ false };
            Set<UInt16> Ports{ 999 };
            bool NATTraversal{ false };
        } UDP;
        struct
        {
            bool Enable{ false };
            Set<UInt16> Ports{ 9 };
            bool RequireAuthentication{ true };
            bool Discoverable{ false };
            std::optional<BluetoothServiceDetails> Service;
        } BTH;
    } Listeners;

    struct
    {
        bool Enable{ false };
        UInt8 IPv4ExcludedNetworksCIDRLeadingBits{ 16 };
        UInt8 IPv6ExcludedNetworksCIDRLeadingBits{ 48 };
    } Relays;
};

Member variables

Name Description
UUID The UUID for the local peer. This will uniquely identify this instance on the network. This UUID can be shared with other peers for identification and authentication purposes along with the associated public key.
Keys The private and public keys for the local peer. Used for authentication purposes together with the associated peer UUID.
GlobalSharedSecret The global shared secret to use for all connections with peers by default. The global shared secret should be at least 64 bytes in length. The global shared secret can be overridden for a specific connection via the QuantumGate::ConnectParameters when connecting to a peer (if that peer is configured with a different default global shared secret).
RequireAuthentication Whether authentication is required for connecting peers. Defaults to true. Note that when authentication is required, the UUIDs and associated public keys need to be registered for all connecting peers through the QuantumGate::Access::Manager.
SupportedAlgorithms The supported algorithms. You can add one (required) or more algorithms in the collection that you want the local instance to support. In order for peers to successfully connect to the local instance they will also need to support one or more of the same algorithms in each category. See QuantumGate::Algorithms for more details.
NumPreGeneratedKeysPerAlgorithm The number of key-pairs to generate in advance for each supported algorithm. Defaults to 5. If 0 is specified, the Key Generation Manager is disabled and keys will be made on the fly as needed during handshakes and key updates (which depending on the algorithm can introduce noticeable delays).
EnableExtenders Whether to enable extenders on startup. Defaults to false.
Listeners::TCP::Enable Whether to enable listening for incoming TCP connections on startup. Defaults to false.
Listeners::TCP::Ports Which TCP port(s) to listen on. Defaults to 999. More than one port can be specified.
Listeners::TCP::NATTraversal Whether NAT traversal is enabled. Defaults to false.
Listeners::TCP::UseConditionalAcceptFunction Whether to use the conditional accept function before accepting connections. The conditional accept function allows QuantumGate to determine if it should accept a TCP/IP connection from a specific IP address before the connection is accepted by the operating system. If this option is disabled, the operating system accepts the connection, and QuantumGate can later close the connection when it determines that it doesn't want to accept it based on the security configuration. However, in this last case, the peer knows that the connection was initially established and then closed, and so it knows that somebody was listening. For more details see the documentation on MSDN.
Listeners::UDP::Enable Whether to enable listening for incoming UDP connections on startup. Defaults to false.
Listeners::UDP::Ports Which UDP port(s) to listen on. Defaults to 999. More than one port can be specified.
Listeners::UDP::NATTraversal Whether NAT traversal is enabled. Defaults to false.
Listeners::BTH::Enable Whether to enable listening for incoming Bluetooth (BTH) connections on startup. Defaults to false.
Listeners::BTH::Ports Which Bluetooth port(s) to listen on. Defaults to 9. More than one port can be specified in the range from 1 to 31.
Listeners::BTH::RequireAuthentication Whether to require authentication for incoming Bluetooth connections. Defaults to true. When authentication is required, if a new device tries connecting to the local instance via Bluetooth then the operating system will prompt the user to first pair the devices. If pairing/authentication fails then connections are not accepted.
Listeners::BTH::Discoverable Whether to make the local device discoverable via Bluetooth when listening for incoming connections. Defaults to false. When set to true the local device will be found by other devices scanning for nearby Bluetooth devices. If the local device is not discoverable, other devices will need another way to find the Bluetooth address of the local device to be able to connect to it.
Listeners::BTH::Service The optional Bluetooth service details that should be used to advertise to other devices. See QuantumGate::BluetoothServiceDetails for more information. When this parameter is not specified, QuantumGate will use default values to advertise the QuantumGate Bluetooth service on the local device to other devices.
Relays::Enable Whether to enable relays on startup. Defaults to false.
Relays::IPv4ExcludedNetworksCIDRLeadingBits The CIDR leading bits of the IPv4 network address spaces of the source and destination endpoints to exclude from the relay link. Defaults to 16. See QuantumGate Relays for more details.
Relays::IPv6ExcludedNetworksCIDRLeadingBits The CIDR leading bits of the IPv6 network address spaces of the source and destination endpoints to exclude from the relay link. Defaults to 48. See QuantumGate Relays for more details.
Clone this wiki locally