|
Network.BSD | Portability | non-portable | Stability | experimental | Maintainer | libraries@haskell.org |
|
|
|
|
|
Description |
The Network.BSD module defines Haskell bindings to functionality
provided by BSD Unix derivatives. Currently this covers
network programming functionality and symbolic links.
(OK, so the latter is pretty much supported by most Unixes
today, but it was BSD that introduced them.)
The symlink stuff is really in the wrong place, at some point it will move
to a generic Unix library somewhere else in the module tree.
|
|
Synopsis |
|
|
|
|
Host names
|
|
type HostName = String |
|
getHostName :: IO HostName |
Calling getHostName returns the standard host name for the current
processor, as set at boot time.
|
|
data HostEntry |
Constructors | | Instances | |
|
|
getHostByName :: HostName -> IO HostEntry |
Resolve a HostName to IPv4 address.
|
|
getHostByAddr :: Family -> HostAddress -> IO HostEntry |
Get a HostEntry corresponding to the given address and family.
Note that only IPv4 is currently supported.
|
|
hostAddress :: HostEntry -> HostAddress |
|
getHostEntries :: Bool -> IO [HostEntry] |
|
Low level functionality
|
|
setHostEntry :: Bool -> IO () |
|
getHostEntry :: IO HostEntry |
|
endHostEntry :: IO () |
|
Service names
|
|
data ServiceEntry |
Constructors | | Instances | |
|
|
type ServiceName = String |
|
getServiceByName :: ServiceName -> ProtocolName -> IO ServiceEntry |
Get service by name.
|
|
getServiceByPort :: PortNumber -> ProtocolName -> IO ServiceEntry |
Get the service given a PortNumber and ProtocolName.
|
|
getServicePortNumber :: ServiceName -> IO PortNumber |
Get the PortNumber corresponding to the ServiceName.
|
|
getServiceEntries :: Bool -> IO [ServiceEntry] |
|
Low level functionality
|
|
getServiceEntry :: IO ServiceEntry |
|
setServiceEntry :: Bool -> IO () |
|
endServiceEntry :: IO () |
|
Protocol names
|
|
type ProtocolName = String |
|
type ProtocolNumber = CInt |
|
data ProtocolEntry |
Constructors | | Instances | |
|
|
getProtocolByName :: ProtocolName -> IO ProtocolEntry |
|
getProtocolByNumber :: ProtocolNumber -> IO ProtocolEntry |
|
getProtocolNumber :: ProtocolName -> IO ProtocolNumber |
|
getProtocolEntries :: Bool -> IO [ProtocolEntry] |
|
Low level functionality
|
|
setProtocolEntry :: Bool -> IO () |
|
getProtocolEntry :: IO ProtocolEntry |
|
endProtocolEntry :: IO () |
|
Port numbers
|
|
data PortNumber |
Instances | |
|
|
Network names
|
|
type NetworkName = String |
|
type NetworkAddr = CULong |
|
data NetworkEntry |
Constructors | | Instances | |
|
|
getNetworkByName :: NetworkName -> IO NetworkEntry |
|
getNetworkByAddr :: NetworkAddr -> Family -> IO NetworkEntry |
|
getNetworkEntries :: Bool -> IO [NetworkEntry] |
Get the list of network entries.
|
|
Low level functionality
|
|
setNetworkEntry :: Bool -> IO () |
Open the network name database. The parameter specifies
whether a connection is maintained open between various
networkEntry calls
|
|
getNetworkEntry :: IO NetworkEntry |
|
endNetworkEntry :: IO () |
Close the connection to the network name database.
|
|
Symbolic links
|
|
symlink :: String -> String -> IO () |
|
readlink :: String -> IO String |
|
Produced by Haddock version 0.7 |