summaryrefslogtreecommitdiffstats
path: root/lanbrowsing/lisa/addressvalidator.h
diff options
context:
space:
mode:
authortoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
committertoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
commitbcb704366cb5e333a626c18c308c7e0448a8e69f (patch)
treef0d6ab7d78ecdd9207cf46536376b44b91a1ca71 /lanbrowsing/lisa/addressvalidator.h
downloadtdenetwork-bcb704366cb5e333a626c18c308c7e0448a8e69f.tar.gz
tdenetwork-bcb704366cb5e333a626c18c308c7e0448a8e69f.zip
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdenetwork@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'lanbrowsing/lisa/addressvalidator.h')
-rw-r--r--lanbrowsing/lisa/addressvalidator.h55
1 files changed, 55 insertions, 0 deletions
diff --git a/lanbrowsing/lisa/addressvalidator.h b/lanbrowsing/lisa/addressvalidator.h
new file mode 100644
index 00000000..6f1c723e
--- /dev/null
+++ b/lanbrowsing/lisa/addressvalidator.h
@@ -0,0 +1,55 @@
+/* addressvalidator.h
+ *
+ * Copyright (c) 2000, Alexander Neundorf
+ * neundorf@kde.org
+ *
+ * You may distribute under the terms of the GNU General Public
+ * License as specified in the COPYING file.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ */
+
+#ifndef ADDRESSVALIDATOR_H
+#define ADDRESSVALIDATOR_H
+
+#include "lisadefines.h"
+#include "mystring.h"
+#include "configfile.h"
+
+#define NO_SPEC 0
+#define NETMASK_SPEC 1
+#define EXACTADDR_SPEC 2
+#define RANGE_SPEC 3
+#define MULTIRANGE_SPEC 4
+
+struct AddressSpec
+{
+ int address;
+ int mask;
+ int typeOfSpec;
+};
+
+class AddressValidator
+{
+ public:
+ AddressValidator(const MyString& addressSpecs);
+ AddressValidator();
+ ~AddressValidator();
+ void configure(Config& config);
+ void setValidAddresses(MyString addressSpecs);
+ void clearSpecs();
+ int isValid(int addressNBO);
+ MyString validAddresses() {return allowedHosts;};
+ private:
+ int localhostNet;
+ int localhostMask;
+ MyString allowedHosts;
+ void addSpec(int type, int address, int mask=0);
+ AddressSpec specs[MAX_SPECS];
+};
+
+#endif