1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- //
- // Created by robin on 1/31/18.
- //
-
- #ifndef QDNSAGG_QDNSSERVER_H
- #define QDNSAGG_QDNSSERVER_H
-
- #include <QtCore/QObject>
- #include <dns-base/QDnsPacket.h>
- #include <QtNetwork/QHostAddress>
- #include <functional>
-
- namespace QDns
- {
- namespace Server
- {
- class QDnsServer : public QObject
- {
- Q_OBJECT
- public:
- struct SendAnswerParams
- {
- QDns::Base::QDnsPacket answer;
- };
-
- struct OnRequestParams
- {
- QDns::Base::QDnsPacket query;
- QHostAddress senderAddress;
- quint16 senderPort;
- std::function<void(SendAnswerParams)> sendAnswer;
- };
-
- signals:
- void onRequest(OnRequestParams params); // TODO add onError
-
- public slots:
- virtual bool start(const QHostAddress& host, quint16 port) = 0;
- };
- }
- }
-
-
- #endif //QDNSAGG_QDNSSERVER_H
|