def chain(cmd, chain, a = {})
      cmds = {
        new: '-N', rename: '-E', delete: '-X', flush: '-F',
        list_rules: '-S', list: '-L', zero: '-Z', policy: '-P'
      }
      table = build_option('-t', @table)
      numeric = build_option('-n', a[:numeric])
      rulenum = build_option(true, a[:rulenum])
      to = build_option(true, a[:to])
      @buffer << [
        'iptables', table, numeric, cmds[cmd], chain, rulenum, to
      ].compact.join(' ') << "\n"
      self
    end
def chain(cmd, chain, a = {})
      cmds = {
        new: '-N', rename: '-E', delete: '-X', flush: '-F',
        list_rules: '-S', list: '-L', zero: '-Z', policy: '-P'
      }
      table = build_option('-t', @table)
      numeric = build_option('-n', a[:numeric])
      rulenum = build_option(true, a[:rulenum])
      to = build_option(true, a[:to])
      @buffer << [
        'iptables', table, numeric, cmds[cmd], chain, rulenum, to
      ].compact.join(' ') << "\n"
      self
    end
Create, flush and delete chains
 @param [String] cmd the operation to perform (add, delete, flush)
 @param [String] chain name of the chain (e.g. INPUT, CATFLAP-DENY, etc.)
 @return self