public void TestComparisonMultiport() { String rule = "-A INPUT -p tcp -j RETURN -m multiport --dports 79,22 -m comment --comment TCP"; IpTablesChainSet chains = new IpTablesChainSet(4); IpTablesRule r1 = IpTablesRule.Parse(rule, null, chains); IpTablesRule r2 = IpTablesRule.Parse(rule, null, chains); Assert.IsTrue(r1.Equals(r2)); }
public void TestParse() { String rule1 = "-A PREROUTING -t raw -p tcp -j CT --ctevents new,destroy"; String rule2 = "-A PREROUTING -t raw -p tcp -j CT --ctevents \"destroy, new\""; IpTablesChainSet chains = new IpTablesChainSet(4); IpTablesRule irule1 = IpTablesRule.Parse(rule1, null, chains, 4); IpTablesRule irule2 = IpTablesRule.Parse(rule2, null, chains, 4); irule2.Equals(irule1); Assert.AreEqual(irule1, irule2); }