File indexing completed on 2025-01-05 04:37:23

0001 /*
0002     SPDX-FileCopyrightText: 2005 Joris Guisson <joris.guisson@gmail.com>
0003 
0004     SPDX-License-Identifier: GPL-2.0-or-later
0005 */
0006 #ifndef BTSERVERAUTHENTICATE_H
0007 #define BTSERVERAUTHENTICATE_H
0008 
0009 #include "authenticatebase.h"
0010 
0011 namespace bt
0012 {
0013 /**
0014  * @author Joris Guisson
0015  *
0016  * Handles the authentication of incoming connections on the Server.
0017  * Once the authentication is finished, the socket gets handed over
0018  * to the right PeerManager.
0019  */
0020 class ServerAuthenticate : public AuthenticateBase
0021 {
0022     Q_OBJECT
0023 public:
0024     ServerAuthenticate(mse::EncryptedPacketSocket::Ptr sock);
0025     ~ServerAuthenticate() override;
0026 
0027     static bool isFirewalled();
0028     static void setFirewalled(bool Firewalled);
0029 
0030 protected:
0031     void onFinish(bool succes) override;
0032     void handshakeReceived(bool full) override;
0033 
0034 private:
0035     static bool s_firewalled;
0036 };
0037 
0038 }
0039 
0040 inline bool bt::ServerAuthenticate::isFirewalled()
0041 {
0042     return s_firewalled;
0043 }
0044 
0045 inline void bt::ServerAuthenticate::setFirewalled(bool Firewalled)
0046 {
0047     s_firewalled = Firewalled;
0048 }
0049 
0050 #endif