swift
authresponse.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (C) 2019 swift Project Community / Contributors
2 // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1
3 
5 
6 #ifndef SWIFT_CORE_FSD_AUTHRESPONSE_H
7 #define SWIFT_CORE_FSD_AUTHRESPONSE_H
8 
9 #include "core/fsd/messagebase.h"
10 
11 namespace swift::core::fsd
12 {
16  {
17  public:
19  AuthResponse(const QString &sender, const QString &receiver, const QString &response);
20 
22  QStringList toTokens() const;
23 
25  static AuthResponse fromTokens(const QStringList &tokens);
26 
28  static QString pdu() { return QStringLiteral("$ZR"); }
29 
30  QString m_response;
31 
32  private:
33  AuthResponse();
34  };
35 
37  inline bool operator==(const AuthResponse &lhs, const AuthResponse &rhs)
38  {
39  return lhs.sender() == rhs.sender() && lhs.receiver() == rhs.receiver() && lhs.m_response == rhs.m_response;
40  }
41 
43  inline bool operator!=(const AuthResponse &lhs, const AuthResponse &rhs) { return !(lhs == rhs); }
44 } // namespace swift::core::fsd
45 
46 #endif // SWIFT_CORE_FSD_AUTHRESPONSE_H
bool operator!=(const AddAtc &lhs, const AddAtc &rhs)
Not equal operator.
Definition: addatc.h:68
Responds to an authentication challenge. The protocol for formulating and responding to auth challeng...
Definition: authresponse.h:16
static QString pdu()
PDU identifier.
Definition: authresponse.h:28
FSD message base class.
Definition: messagebase.h:58
QString sender() const
get message sender
Definition: messagebase.h:73
QString receiver() const
Get message receiver.
Definition: messagebase.h:79
#define SWIFT_CORE_EXPORT
Export a class or function from the library.