addressvalidator.h

来自「查看局域网的信息,类似网上邻居的功能,例如查看哪台计算机在线等」· C头文件 代码 · 共 54 行

H
54
字号
/*    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 2struct 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

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?