network-bsd-2.8.1.0: POSIX network database (<netdb.h>) API
Copyright(c) The University of Glasgow 2001
LicenseBSD-3-Clause
Maintainerlibraries@haskell.org
Stabilityexperimental
Portabilitynon-portable
Safe HaskellNone
LanguageHaskell2010

Network.BSD

Description

The Network.BSD module defines Haskell bindings to network programming functionality (mostly network database operations) provided by BSD Unix derivatives.

NOTE: Some of the types are reexported from Network.Socket in order to make the network-bsd API self-contained.

Windows compatibility

The following functions are not exported by Network.BSD on the Windows platform:

Synopsis

Host names and network addresses

data Family #

Instances

Instances details
Eq Family 
Instance details

Defined in Network.Socket.Types

Ord Family 
Instance details

Defined in Network.Socket.Types

Read Family 
Instance details

Defined in Network.Socket.Types

Show Family 
Instance details

Defined in Network.Socket.Types

getHostName :: IO HostName Source #

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

gethostname(2).

data HostEntry Source #

Representation of the POSIX hostent structure defined in netdb.h.

Constructors

HostEntry 

Fields

getHostByName :: HostName -> IO HostEntry Source #

Resolve a HostName to IPv4 address.

getHostByAddr :: Family -> HostAddress -> IO HostEntry Source #

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

hostAddress :: HostEntry -> HostAddress Source #

Convenience function extracting one address in a HostEntry. Returns error if HostEntry contains no addresses.

getHostEntries :: Bool -> IO [HostEntry] Source #

Retrieve list of all HostEntry via gethostent(3).

Low level functionality

setHostEntry :: Bool -> IO () Source #

sethostent(3).

getHostEntry :: IO HostEntry Source #

gethostent(3).

endHostEntry :: IO () Source #

endhostent(3).

Service names

data ServiceEntry Source #

Representation of the POSIX servent structure defined in netdb.h.

Constructors

ServiceEntry 

Fields

data PortNumber #

Instances

Instances details
Enum PortNumber 
Instance details

Defined in Network.Socket.Types

Eq PortNumber 
Instance details

Defined in Network.Socket.Types

Integral PortNumber 
Instance details

Defined in Network.Socket.Types

Num PortNumber 
Instance details

Defined in Network.Socket.Types

Ord PortNumber 
Instance details

Defined in Network.Socket.Types

Read PortNumber 
Instance details

Defined in Network.Socket.Types

Real PortNumber 
Instance details

Defined in Network.Socket.Types

Show PortNumber 
Instance details

Defined in Network.Socket.Types

Storable PortNumber 
Instance details

Defined in Network.Socket.Types

getServiceEntries :: Bool -> IO [ServiceEntry] Source #

Retrieve list of all ServiceEntry via getservent(3).

Low level functionality

setServiceEntry :: Bool -> IO () Source #

setservent(3).

endServiceEntry :: IO () Source #

endservent(3).

Protocol names

getProtocolEntries :: Bool -> IO [ProtocolEntry] Source #

Retrieve list of all ProtocolEntry via getprotoent(3).

Low level functionality

setProtocolEntry :: Bool -> IO () Source #

setprotoent(3).

endProtocolEntry :: IO () Source #

endprotoent(3).

Network names

data NetworkEntry Source #

Representation of the POSIX netent structure defined in netdb.h.

Constructors

NetworkEntry 

Fields

getNetworkEntries :: Bool -> IO [NetworkEntry] Source #

Get the list of network entries via getnetent(3).

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

setnetent(3).

endNetworkEntry :: IO () Source #

Close the connection to the network name database.

endnetent(3).

Interface names