Documentation ¶
Overview ¶
Package netdb provides a Go interface for the protoent and servent structures as defined in netdb.h
A pure Go implementation is used by parsing /etc/protocols and /etc/services
All return values are pointers that point to the entries in the original list of protocols and services. Manipulating the entries would affect the entire program.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( Protocols []*Protoent Services []*Servent )
These variables get populated from /etc/protocols and /etc/services respectively.
Functions ¶
This section is empty.
Types ¶
type Protoent ¶
func GetProtoByName ¶
GetProtoByName returns the Protoent whose name or any of its aliases matches the argument.
func GetProtoByNumber ¶
GetProtoByNumber returns the Protoent for a given protocol number.
type Servent ¶
func GetServByName ¶
GetServByName returns the Servent for a given service name or alias and protocol. If the protocol is nil, the first service matching the service name is returned.
func GetServByPort ¶
GetServByPort returns the Servent for a given port number and protocol. If the protocol is nil, the first service matching the port number is returned.