| Class | Symbiosis::Firewall::Ports |
| In: |
firewall/lib/symbiosis/firewall/ports.rb
|
| Parent: | Object |
This class is used to convert names to port numbers using the details from /etc/services.
This class only has class methods so that it is accessible globally.
We read the services-file and store the data from within it into a hash for later lookups.
The hash has the form
{
name => port
}
Find the TCP/UDP port of the named service.
If the name looks like a number, then we convert that to an integer, and return. Otherwise the name is looked up in @services. If no port is found, nil is returned.