network-2.2.1.7: Networking-related facilities

Portabilitynon-portable
Stabilityexperimental
Maintainerlibraries@haskell.org

Network.BSD

Description

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

Synopsis

Host names

type HostName = String Source

getHostName :: IO HostName Source

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

data HostEntry Source

Constructors

Instances

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

getHostEntries :: Bool -> IO [HostEntry]Source

Low level functionality

setHostEntry :: Bool -> IO () Source

getHostEntry :: IO HostEntry Source

endHostEntry :: IO () Source

Service names

data ServiceEntry Source

Constructors

Instances

type ServiceName = String Source

getServiceByName :: ServiceName -> ProtocolName -> IO ServiceEntry Source

Get service by name.

getServiceByPort :: PortNumber -> ProtocolName -> IO ServiceEntry Source

Get the service given a PortNumber and ProtocolName .

getServicePortNumber :: ServiceName -> IO PortNumber Source

Get the PortNumber corresponding to the ServiceName .

getServiceEntries :: Bool -> IO [ServiceEntry]Source

Low level functionality

getServiceEntry :: IO ServiceEntry Source

setServiceEntry :: Bool -> IO () Source

endServiceEntry :: IO () Source

Protocol names

type ProtocolName = String Source

type ProtocolNumber = CInt Source

data ProtocolEntry Source

Constructors

Instances

getProtocolByName :: ProtocolName -> IO ProtocolEntry Source

getProtocolByNumber :: ProtocolNumber -> IO ProtocolEntry Source

getProtocolNumber :: ProtocolName -> IO ProtocolNumber Source

defaultProtocol :: ProtocolNumber Source

This is the default protocol for a given service.

getProtocolEntries :: Bool -> IO [ProtocolEntry]Source

Low level functionality

setProtocolEntry :: Bool -> IO () Source

getProtocolEntry :: IO ProtocolEntry Source

endProtocolEntry :: IO () Source

Port numbers

data PortNumber Source

Instances

Network names

type NetworkName = String Source

type NetworkAddr = CULong Source

data NetworkEntry Source

Constructors

Instances

getNetworkByName :: NetworkName -> IO NetworkEntry Source

getNetworkByAddr :: NetworkAddr -> Family -> IO NetworkEntry Source

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

getNetworkEntry :: IO NetworkEntry Source

endNetworkEntry :: IO () Source

Close the connection to the network name database.

AltStyle によって変換されたページ (->オリジナル) /