コード例 #1
0
 public NetRule(
     RuleComponent _compAction,
     //RuleComponent _compDirection,
     RuleComponent _compEtherType,
     RuleComponent _compIpNextProtocol,
     RuleComponent _compSourceIp,
     RuleComponent _compDestinationIp,
     RuleComponent _compSourcePort,
     RuleComponent _compDestinationPort
     )
 {
     compAction = _compAction;
     //compDirection = _compDirection;
     compEtherType       = _compEtherType;
     compIpNextProtocol  = _compIpNextProtocol;
     compSourceIp        = _compSourceIp;
     compDestinationIp   = _compDestinationIp;
     compSourcePort      = _compSourcePort;
     compDestinationPort = _compDestinationPort;
     ToBytes();
     ruleToString();
 }
コード例 #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);
        }