Haskell Core Libraries (network package)ContentsIndex
Network.BSD
Portabilitynon-portable
Stabilityexperimental
Maintainerlibraries@haskell.org
Contents
Host names
Service names
Protocol names
Port numbers
Network names
Symbolic links
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
type HostName = String
getHostName :: IO HostName
data HostEntry = HostEntry {
hostName :: HostName
hostAliases :: [HostName]
hostFamily :: Family
hostAddresses :: [HostAddress]
}
getHostByName :: HostName -> IO HostEntry
getHostByAddr :: Family -> HostAddress -> IO HostEntry
hostAddress :: HostEntry -> HostAddress
setHostEntry :: Bool -> IO ()
getHostEntry :: IO HostEntry
endHostEntry :: IO ()
getHostEntries :: Bool -> IO [HostEntry]
data ServiceEntry = ServiceEntry {
serviceName :: ServiceName
serviceAliases :: [ServiceName]
servicePort :: PortNumber
serviceProtocol :: ProtocolName
}
type ServiceName = String
getServiceByName :: ServiceName -> ProtocolName -> IO ServiceEntry
getServiceByPort :: PortNumber -> ProtocolName -> IO ServiceEntry
getServicePortNumber :: ServiceName -> IO PortNumber
getServiceEntry :: IO ServiceEntry
setServiceEntry :: Bool -> IO ()
endServiceEntry :: IO ()
getServiceEntries :: Bool -> IO [ServiceEntry]
type ProtocolName = String
type ProtocolNumber = CInt
data ProtocolEntry = ProtocolEntry {
protoName :: ProtocolName
protoAliases :: [ProtocolName]
protoNumber :: ProtocolNumber
}
getProtocolByName :: ProtocolName -> IO ProtocolEntry
getProtocolByNumber :: ProtocolNumber -> IO ProtocolEntry
getProtocolNumber :: ProtocolName -> IO ProtocolNumber
setProtocolEntry :: Bool -> IO ()
getProtocolEntry :: IO ProtocolEntry
endProtocolEntry :: IO ()
getProtocolEntries :: Bool -> IO [ProtocolEntry]
data PortNumber
type NetworkName = String
type NetworkAddr = CULong
data NetworkEntry = NetworkEntry {
networkName :: NetworkName
networkAliases :: [NetworkName]
networkFamily :: Family
networkAddress :: NetworkAddr
}
getNetworkByName :: NetworkName -> IO NetworkEntry
getNetworkByAddr :: NetworkAddr -> Family -> IO NetworkEntry
setNetworkEntry :: Bool -> IO ()
getNetworkEntry :: IO NetworkEntry
endNetworkEntry :: IO ()
getNetworkEntries :: Bool -> IO [NetworkEntry]
symlink :: String -> String -> IO ()
readlink :: String -> IO String
Host names
type HostName = String
getHostName :: IO HostName
data HostEntry
Constructors
HostEntry
hostName :: HostName
hostAliases :: [HostName]
hostFamily :: Family
hostAddresses :: [HostAddress]
show/hide Instances
getHostByName :: HostName -> IO HostEntry
getHostByAddr :: Family -> HostAddress -> IO HostEntry
hostAddress :: HostEntry -> HostAddress
setHostEntry :: Bool -> IO ()
getHostEntry :: IO HostEntry
endHostEntry :: IO ()
getHostEntries :: Bool -> IO [HostEntry]
Service names
data ServiceEntry
Constructors
ServiceEntry
serviceName :: ServiceName
serviceAliases :: [ServiceName]
servicePort :: PortNumber
serviceProtocol :: ProtocolName
show/hide Instances
type ServiceName = String
getServiceByName :: ServiceName -> ProtocolName -> IO ServiceEntry
getServiceByPort :: PortNumber -> ProtocolName -> IO ServiceEntry
getServicePortNumber :: ServiceName -> IO PortNumber
getServiceEntry :: IO ServiceEntry
setServiceEntry :: Bool -> IO ()
endServiceEntry :: IO ()
getServiceEntries :: Bool -> IO [ServiceEntry]
Protocol names
type ProtocolName = String
type ProtocolNumber = CInt
data ProtocolEntry
Constructors
ProtocolEntry
protoName :: ProtocolName
protoAliases :: [ProtocolName]
protoNumber :: ProtocolNumber
show/hide Instances
getProtocolByName :: ProtocolName -> IO ProtocolEntry
getProtocolByNumber :: ProtocolNumber -> IO ProtocolEntry
getProtocolNumber :: ProtocolName -> IO ProtocolNumber
setProtocolEntry :: Bool -> IO ()
getProtocolEntry :: IO ProtocolEntry
endProtocolEntry :: IO ()
getProtocolEntries :: Bool -> IO [ProtocolEntry]
Port numbers
data PortNumber
show/hide Instances
Network names
type NetworkName = String
type NetworkAddr = CULong
data NetworkEntry
Constructors
NetworkEntry
networkName :: NetworkName
networkAliases :: [NetworkName]
networkFamily :: Family
networkAddress :: NetworkAddr
show/hide Instances
getNetworkByName :: NetworkName -> IO NetworkEntry
getNetworkByAddr :: NetworkAddr -> Family -> IO NetworkEntry
setNetworkEntry :: Bool -> IO ()
getNetworkEntry :: IO NetworkEntry
endNetworkEntry :: IO ()
getNetworkEntries :: Bool -> IO [NetworkEntry]
Symbolic links
symlink :: String -> String -> IO ()
readlink :: String -> IO String
Produced by Haddock version 0.7