Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ServiceNames ¶
type ServiceNames struct {
// contains filtered or unexported fields
}
func LoadServicesDB ¶
func LoadServicesDB(protocols, services io.Reader) (*ServiceNames, error)
LoadServicesDB receives readers to the /etc/protocols and /etc/services formatted content and returns a database that allow querying service names from ports and protocol information
func (*ServiceNames) ByPortAndProtocolName ¶
func (db *ServiceNames) ByPortAndProtocolName(port int, nameOrAlias string) string
ByPortAndProtocolName returns the service name given a port and a protocol name (or its alias). If the protocol does not exist, returns the name of any service matching the port number.
func (*ServiceNames) ByPortAndProtocolNumber ¶
func (db *ServiceNames) ByPortAndProtocolNumber(port, protoNum int) string
ByPortAndProtocolNumber returns the service name given a port and a protocol number. If the protocol does not exist, returns the name of any service matching the port number.
Click to show internal directories.
Click to hide internal directories.