# File firewall/lib/symbiosis/firewall/ports.rb, line 24 def load( filename = "/etc/services" ) # # Read the file. # File.open(filename).readlines().each do |line| # # service-names are alphanumeric - but also include "-" and "_". # Only interested in TCP or UDP services. # if ( line =~ /^([\w-]+)\s+(\d+)\/(?:tcp|udp)\s*([\w -]+)*/ ) srv, port, other_names = $1,$2,$3 add_service(srv, port) other_names.to_s.split(/\s+/).each{ |n| add_service(n, port) } end end end