public bool WriteOutput(StreamWriter output)
        {
            bool res;

            foreach (var table in _tables)
            {
                res = WriteOutputLine(output, "*" + table.Key);
                if (!res)
                {
                    return(true);
                }


                foreach (var chain in table.Value.Chains)
                {
                    if (IPTablesTables.IsInternalChain(table.Key, chain))
                    {
                        res = WriteOutputLine(output, ":" + chain + " ACCEPT [0:0]");
                    }
                    else
                    {
                        res = WriteOutputLine(output, ":" + chain + " - [0:0]");
                    }
                    if (!res)
                    {
                        return(true);
                    }
                }

                foreach (var command in table.Value.Commands)
                {
                    Console.WriteLine("-t " + table.Key + " " + command);
                    res = WriteOutputLine(output, command);
                    if (!res)
                    {
                        return(true);
                    }
                }

                res = WriteOutputLine(output, "COMMIT");
                if (!res)
                {
                    return(true);
                }
                res = WriteOutputLine(output, "");
                if (!res)
                {
                    return(true);
                }
            }

            if (_tables.Count != 0)
            {
                return(true);
            }

            return(false);
        }
 private void TestChain(string table, string chain)
 {
     Assert.IsTrue(IPTablesTables.IsInternalChain(table, chain), String.Format("{0}:{1} should be internal", table, chain));
 }