Example #1
0
        public int ScanDevice(string start_IP, string end_IP)
        {
            string[] sArray_startIP = start_IP.Split('.');
            string[] sArray_endIP   = end_IP.Split('.');
            string   unchange_part  = sArray_startIP[0] + "." + sArray_startIP[1] + "." + sArray_startIP[2] + ".";

            int start  = Int32.Parse(sArray_startIP[3]);
            int end    = Int32.Parse(sArray_endIP[3]);
            int IP_num = end - start;

            List <string> dev_IP_list = new List <string>();

            for (int count = 0; count + start <= end; count++)
            {
                dev_IP_list.Add(unchange_part + Convert.ToString(count + start));
            }

            foreach (string dev_IP in dev_IP_list)
            {
#if debug
                Console.WriteLine(dev_IP);
#endif
                DeviceForm devform       = new DeviceForm(dev_IP, 33333);
                SendInfo   sendcheckInfo = new SendInfo(devform);
                sendcheckInfo.SendCheckInfo();
            }

            return(IP_num);
        }
Example #2
0
        public bool ClearAllRules(string dev_IP)
        {
            DeviceForm devform = new DeviceForm(dev_IP, 22222);

            ConfigDPIRules configDevice = new ConfigDPIRules(devform);

            return(configDevice.ClearAllRules());
        }
Example #3
0
        public bool ChangeOPCRules(string dst_IP, string src_IP, string dev_IP, bool log_record, bool add_delete)
        {
            OPCRulesForm orf = new OPCRulesForm();

            orf.setDst_IPAndSrc_IP(dst_IP, src_IP);

            DeviceForm devform = new DeviceForm(dev_IP, 22222);

            ConfigDPIRules configDevice = new ConfigDPIRules(devform);

            return(configDevice.ConfigOPCRules(orf, log_record, add_delete));
        }
Example #4
0
        public bool ChangeModbusTcpRules(string dst_IP, string src_IP, string min_addr, string max_addr, string func, int Min_data, int Max_data, string dev_IP, bool log_record, bool add_delete)
        {
            ModbusTcpRulesForm mtrf = new ModbusTcpRulesForm();

            mtrf.setIP_Addr_Funcode(dst_IP, src_IP, min_addr, max_addr, func, Min_data, Max_data);

            DeviceForm devform = new DeviceForm(dev_IP, 22222);

            IConfigRules configDevice = new ConfigDPIRules(devform);

            return(configDevice.ConfigModbusTcpRules(mtrf, log_record, add_delete));
        }
Example #5
0
        public bool ChangeDNP3Rules(string dst_IP, string src_IP, string dev_IP, bool log_record, bool add_delete)
        {
            DNP3RulesForm dnp3rf = new DNP3RulesForm();

            dnp3rf.setDst_IPAndSrc_IP(dst_IP, src_IP);

            DeviceForm devform = new DeviceForm(dev_IP, 22222);

            IConfigRules configDevice = new ConfigRules(devform);

            return(configDevice.ConfigDNP3Rules(dnp3rf, add_delete));
        }
Example #6
0
 public APCRulesManage()
 {
     this.db_operate    = new DBOperation();
     this.devform       = new DeviceForm("0.0.0.0", 22222);
     this.protocol_port = new Dictionary <string, string>()
     {
         { "ftp", "21" },
         { "http", "80" },
         { "telnet", "23" },
         { "smtp", "25" },
         { "pop3", "110" },
         { "ssh", "22" }
     };
 }
Example #7
0
 /*初始化设备*/
 public SendInfo(DeviceForm devform)
 {
     this.devform = devform;
 }
Example #8
0
 public CNCRulesManage()
 {
     this.db_operate = new DBOperation();
     this.devform    = new DeviceForm("0.0.0.0", 22222);
 }
Example #9
0
 public ConfigDPIRules(DeviceForm devform)
 {
     this.devform       = devform;
     this.DPIdb_operate = new DBOperation();
 }
Example #10
0
 public ConfigWhiteLists()
 {
     this.devform        = new DeviceForm("0.0.0.0", 22222);
     this.LISTdb_operate = new DBOperation();
 }
Example #11
0
 public ConfigureNAT()
 {
     this.NATdb_operate = new DBOperation();
     this.devform       = new DeviceForm("0.0.0.0", 22222);
 }