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 HaskellSafe-Inferred
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 where #

Bundled Patterns

pattern AF_UNSPEC :: Family 
pattern AF_UNIX :: Family 
pattern AF_INET :: Family 
pattern AF_INET6 :: Family 
pattern AF_IMPLINK :: Family 
pattern AF_PUP :: Family 
pattern AF_CHAOS :: Family 
pattern AF_NS :: Family 
pattern AF_NBS :: Family 
pattern AF_ECMA :: Family 
pattern AF_DATAKIT :: Family 
pattern AF_CCITT :: Family 
pattern AF_SNA :: Family 
pattern AF_DECnet :: Family 
pattern AF_DLI :: Family 
pattern AF_LAT :: Family 
pattern AF_HYLINK :: Family 
pattern AF_APPLETALK :: Family 
pattern AF_ROUTE :: Family 
pattern AF_NETBIOS :: Family 
pattern AF_NIT :: Family 
pattern AF_802 :: Family 
pattern AF_ISO :: Family 
pattern AF_OSI :: Family 
pattern AF_NETMAN :: Family 
pattern AF_X25 :: Family 
pattern AF_AX25 :: Family 
pattern AF_OSINET :: Family 
pattern AF_GOSSIP :: Family 
pattern AF_IPX :: Family 
pattern Pseudo_AF_XTP :: Family 
pattern AF_CTF :: Family 
pattern AF_WAN :: Family 
pattern AF_SDL :: Family 
pattern AF_NETWARE :: Family 
pattern AF_NDD :: Family 
pattern AF_INTF :: Family 
pattern AF_COIP :: Family 
pattern AF_CNT :: Family 
pattern Pseudo_AF_RTIP :: Family 
pattern Pseudo_AF_PIP :: Family 
pattern AF_SIP :: Family 
pattern AF_ISDN :: Family 
pattern Pseudo_AF_KEY :: Family 
pattern AF_NATM :: Family 
pattern AF_ARP :: Family 
pattern Pseudo_AF_HDRCMPLT :: Family 
pattern AF_ENCAP :: Family 
pattern AF_LINK :: Family 
pattern AF_RAW :: Family 
pattern AF_RIF :: Family 
pattern AF_NETROM :: Family 
pattern AF_BRIDGE :: Family 
pattern AF_ATMPVC :: Family 
pattern AF_ROSE :: Family 
pattern AF_NETBEUI :: Family 
pattern AF_SECURITY :: Family 
pattern AF_PACKET :: Family 
pattern AF_ASH :: Family 
pattern AF_ECONET :: Family 
pattern AF_ATMSVC :: Family 
pattern AF_IRDA :: Family 
pattern AF_PPPOX :: Family 
pattern AF_WANPIPE :: Family 
pattern AF_BLUETOOTH :: Family 
pattern AF_CAN :: Family 

Instances

Instances details
Read Family 
Instance details

Defined in Network.Socket.Types

Show Family 
Instance details

Defined in Network.Socket.Types

Eq Family 
Instance details

Defined in Network.Socket.Types

Ord 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
Storable PortNumber 
Instance details

Defined in Network.Socket.Types

Bounded PortNumber 
Instance details

Defined in Network.Socket.Types

Enum PortNumber 
Instance details

Defined in Network.Socket.Types

Num PortNumber 
Instance details

Defined in Network.Socket.Types

Read PortNumber 
Instance details

Defined in Network.Socket.Types

Integral 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

Eq PortNumber 
Instance details

Defined in Network.Socket.Types

Ord 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