network-2.5.0.0: Low-level networking interface

Portabilitynon-portable
Stabilityexperimental
Maintainerlibraries@haskell.org
Safe HaskellNone

Network.BSD

Contents

Description

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

Synopsis

Host names

type HostName = StringSource

Either a host name e.g., "haskell.org" or a numeric host address string consisting of a dotted decimal IPv4 address or an IPv6 address e.g., "192.168.0.1".

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.