network- Networking-related facilities





The Network.BSD module defines Haskell bindings to network programming functionality provided by BSD Unix derivatives.


Host names

getHostName :: IO HostNameSource

Calling getHostName returns the standard host name for the current processor, as set at boot time.

getHostByName :: HostName -> IO HostEntrySource

Resolve a HostName to IPv4 address.

getHostByAddr :: Family -> HostAddress -> IO HostEntrySource

Get a HostEntry corresponding to the given address and family. Note that only IPv4 is currently supported.

Low level functionality

Service names

Low level functionality

Protocol names

defaultProtocol :: ProtocolNumberSource

This is the default protocol for a given service.

Low level functionality

Port numbers

Network names

getNetworkEntries :: Bool -> IO [NetworkEntry]Source

Get the list of network entries.

Low level functionality

setNetworkEntry :: Bool -> IO ()Source

Open the network name database. The parameter specifies whether a connection is maintained open between various networkEntry calls

endNetworkEntry :: IO ()Source

Close the connection to the network name database.