# File firewall/lib/symbiosis/firewall/pattern.rb, line 10
      def initialize(filename)
        @logfile  = nil
        @ports    = nil
        @patterns = []
        @filename = filename

        File.readlines(filename).each do |line|
          #
          # Remove preceeding and trailing spaces, and newlines
          #
          line = line.strip.chomp

          next if line.empty? or line =~ /^#/ 

          #
          #  Filename
          #
          if line =~ /^file\s*=\s*(.*)/  and @logfile.nil?
            @logfile = $1

          #
          # Comma/space separated line of ports/services
          #
          elsif line =~ /^ports\s*=\s*(.*)/ and @ports.nil?
            @ports = $1.split(/[^a-z0-9]+/i)

          else
            line = line.gsub("__IP__","(?:::ffff:)?([0-9a-fA-F:\.]+(?:/[0-9]+)?)")

            # 
            # Make sure there is anchor at one end of the regexp
            #
            unless line =~ /^\^/ or line =~ /\$$/
              line += "$"
            end

            @patterns << Regexp.new(line)
          end

        end

        if @ports.nil? or @ports.empty?
          puts "No ports set in #{filename} -- assuming 'all'." if $VERBOSE
          @ports = %w(all)
        end

      end