Ejemplo n.º 1
0
 public void InsertNetRule(NetRule _newRule)
 {
     FilterNetwork_checkedListBox_Rules.Items.Insert(0, new RulesListBoxItem {
         Name = _newRule.ruleName, Value = _newRule.ruleBytes
     });
     __NetworkConfigInst.UpdateConfig();
     __NetworkWrapInst.WRAP_FilterNetworkDrv_UpdateConfig();
 }
Ejemplo n.º 2
0
        private void FilterNetworkRule_Button_AddRule_Click(object sender, EventArgs e)
        {
            RuleComponent compAction = new RuleComponent(RuleComponentType.action, FilterNetworkRule_comboBox_Action.Text);
            //RuleComponent compDirection = new RuleComponent(RuleComponentType.direction, FilterNetworkRule_comboBox_Direction.Text);
            RuleComponent compEtherType       = new RuleComponent(RuleComponentType.ether_type, FilterNetworkRule_comboBox_EtherType.Text);
            RuleComponent compIpNextProtocol  = new RuleComponent(RuleComponentType.ip_next_protocol, FilterNetworkRule_comboBox_IpNextProtocol.Text);
            RuleComponent compSourceIp        = new RuleComponent(RuleComponentType.source_ip, FilterNetworkRule_textBox_SourceIp.Text);
            RuleComponent compDestinationIp   = new RuleComponent(RuleComponentType.destination_ip, FilterNetworkRule_textBox_DestinationIp.Text);
            RuleComponent compSourcePort      = new RuleComponent(RuleComponentType.source_port, FilterNetworkRule_textBox_SourcePort.Text);
            RuleComponent compDestinationPort = new RuleComponent(RuleComponentType.destination_port, FilterNetworkRule_textBox_DestinationPort.Text);

            NetRule newRule = new NetRule(compAction,
                                          //compDirection,
                                          compEtherType,
                                          compIpNextProtocol,
                                          compSourceIp,
                                          compDestinationIp,
                                          compSourcePort,
                                          compDestinationPort);


            ptrParentForm.InsertNetRule(newRule);
        }