コード例 #1
0
        /// <summary>
        /// 是否通过过滤
        /// </summary>
        /// <param name="pack"></param>
        /// <returns></returns>
        public bool Pass(Pack pack)
        {
            bool rs1, rs2, rs3, rs4;

            rs1 = FromPort == null ? true : FromPort.IndexOf(pack.FromPort) >= 0;
            rs2 = ToPort == null ? true : ToPort.IndexOf(pack.ToPort) >= 0;
            rs3 = FromIp == null ? true : FromIp.IndexOf(pack.FromIP) >= 0;
            rs4 = ToIp == null ? true : ToIp.IndexOf(pack.ToIP) >= 0;
            return(rs1 || rs2 || rs3 || rs4);
        }
コード例 #2
0
ファイル: StreamConnection.cs プロジェクト: nlebeck/CRA
 public override int GetHashCode()
 {
     return(FromIPAddress.GetHashCode() ^ FromPort.GetHashCode() ^ ToIPAddress.GetHashCode() ^ ToPort.GetHashCode());
 }