Source/NFX/IO/Net/Gate/NetGate.cs
/// <summary>
/// Checks whether the specified traffic is allowed or denied.
/// Returns the rule that determined the allow/deny outcome or null when no rule matched
/// </summary>
Checks whether the specified traffic is allowed or denied.
Returns the rule that determined the allow/deny outcome or null when no rule matched
Checks whether the specified traffic is allowed or denied . Returns the rule that determined the allow / deny outcome or null when no rule matched
public GateAction CheckTraffic(ITraffic traffic, out Rule rule)
      {
        rule = null;
        if (!m_Enabled) return GateAction.Allow;
        if (traffic==null) return GateAction.Deny;
        var state = this[traffic.Direction];
        var result = state.DefaultAction;
        Group fromGroup = null;
        Group toGroup = null;
        foreach(var rItem in state.Rules.OrderedValues)
        {
          if (rItem.Check(state, traffic, ref fromGroup, ref toGroup))
          {
            result = rItem.Action;
            rule = rItem;
            break;
          }
        }
        return result;
      }
public GateAction CheckTraffic ( ITraffic traffic , out Rule rule ) { rule = null ; if ( ! m_Enabled ) return GateAction . Allow ; if ( traffic == null ) return GateAction . Deny ; var state = this [ traffic . Direction ] ; var result = state . DefaultAction ; Group fromGroup = null ; Group toGroup = null ; foreach ( var rItem in state . Rules . OrderedValues ) { if ( rItem . Check ( state , traffic , ref fromGroup , ref toGroup ) ) { result = rItem . Action ; rule = rItem ; break ; } } return result ; }
Checks whether the specified traffic is allowed or denied.
Checks whether the specified traffic is allowed or denied .
traffic
ITraffic
Rule
out