Esempio n. 1
0
 protected void SetDefaultOutboundAction(FirewallRule.Actions Action)
 {
     for (int i = 0; i < FwProfiles.Length; i++)
     {
         SetDefaultOutboundAction(FwProfiles[i], Action);
     }
 }
Esempio n. 2
0
            public void CheckAction(FirewallRule.Actions action)
            {
                switch (action)
                {
                case FirewallRule.Actions.Undefined:
                    State = States.UnRuled;
                    break;

                case FirewallRule.Actions.Allow:
                    if (FwEvent.Action == FirewallRule.Actions.Allow)
                    {
                        State = LogEntry.States.RuleAllowed;
                    }
                    else
                    {
                        State = LogEntry.States.RuleError;
                    }
                    break;

                case FirewallRule.Actions.Block:
                    if (FwEvent.Action == FirewallRule.Actions.Block)
                    {
                        State = LogEntry.States.RuleBlocked;
                    }
                    else
                    {
                        State = LogEntry.States.RuleError;
                    }
                    break;
                }
            }
Esempio n. 3
0
 private void cmbConTypes_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     evetnFilter            = (FirewallRule.Actions)cmbConTypes.SelectedIndex;
     cmbConTypes.Background = (cmbConTypes.SelectedItem as ComboBoxItem).Background;
     App.SetConfig("FwLog", "Events", (int)evetnFilter);
     //UpdateConnections(true);
     logGrid.Items.Filter = new Predicate <object>(item => LogFilter(item));
 }
Esempio n. 4
0
        private void CmbAction_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            actionFilter         = (FirewallRule.Actions)cmbAction.SelectedIndex;
            cmbAction.Background = (cmbAction.SelectedItem as ComboBoxItem).Background;
            App.SetConfig("FwRules", "Actions", (int)actionFilter);
            //UpdateRules(true);

            rulesGrid.Items.Filter = new Predicate <object>(item => RuleFilter(item));
        }
Esempio n. 5
0
 protected bool TestDefaultOutboundAction(FirewallRule.Actions Action)
 {
     for (int i = 0; i < FwProfiles.Length; i++)
     {
         if (GetDefaultOutboundAction(FwProfiles[i]) != Action)
         {
             return(false);
         }
     }
     return(true);
 }
Esempio n. 6
0
 public void SetDefaultOutboundAction(FirewallRule.Profiles profileType, FirewallRule.Actions Action)
 {
     NetFwPolicy.set_DefaultOutboundAction((NET_FW_PROFILE_TYPE2_)profileType, Action == FirewallRule.Actions.Block ? NET_FW_ACTION_.NET_FW_ACTION_BLOCK : NET_FW_ACTION_.NET_FW_ACTION_ALLOW);
 }