2 * Copyright (C) 2003,2005 Thiago Macieira <thiago@kde.org>
5 * Permission is hereby granted, free of charge, to any person obtaining
6 * a copy of this software and associated documentation files (the
7 * "Software"), to deal in the Software without restriction, including
8 * without limitation the rights to use, copy, modify, merge, publish,
9 * distribute, sublicense, and/or sell copies of the Software, and to
10 * permit persons to whom the Software is furnished to do so, subject to
11 * the following conditions:
13 * The above copyright notice and this permission notice shall be included
14 * in all copies or substantial portions of the Software.
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20 * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21 * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22 * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
25 #ifndef KRESOLVERSTANDARDWORKERS_P_H
26 #define KRESOLVERSTANDARDWORKERS_P_H
28 #include <sys/types.h>
33 #include <QStringList>
35 #include "k3resolver.h"
36 #include "k3resolverworkerbase.h"
39 #include <config-network.h>
41 namespace KNetwork
{ namespace Internal
43 extern void initStandardWorkers() KDE_NO_EXPORT
;
47 * The blacklist worker.
49 class KBlacklistWorker
: public KNetwork::KResolverWorkerBase
52 static QStringList blacklist
;
54 static void loadBlacklist();
56 static bool isBlacklisted(const QString
&);
58 virtual bool preprocess();
60 virtual bool postprocess() { return true; }
66 class KStandardWorker
: public KNetwork::KResolverWorkerBase
69 mutable QByteArray m_encodedName
;
72 QList
<KNetwork::KResolverResults
*> resultList
;
75 virtual ~KStandardWorker();
78 virtual bool preprocess();
80 virtual bool postprocess();
82 bool resolveScopeId();
83 bool resolveService();
84 bool resolveNumerically();
86 KNetwork::KResolver::ErrorCodes
addUnix();
89 #if defined(HAVE_GETADDRINFO)
91 * Worker class based on getaddrinfo(3).
93 * This class does not do post-processing.
95 class KGetAddrinfoWorker
: public KStandardWorker
101 virtual ~KGetAddrinfoWorker();
102 virtual bool preprocess();
104 virtual bool postprocess() { return true; }
106 bool wantThis(int family
);
108 #endif // HAVE_GETADDRINFO
110 } } // namespace KNetwork::Internal