network-2.6.3.4: Low-level networking interface

Copyright(c) The University of Glasgow 2001
LicenseBSD-style (see the file libraries/network/LICENSE)
Maintainerlibraries@haskell.org
Stabilityexperimental
Portabilitynon-portable
Safe HaskellNone
LanguageHaskell98

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 #

Either a host name e.g., "haskell.org" or a numeric host address string consisting of a dotted decimal IPv4 address or an IPv6 address e.g., "192.168.0.1".

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 #

Use the Num instance (i.e. use a literal) to create a PortNumber value with the correct network-byte-ordering. You should not use the PortNum constructor. It will be removed in the next release.

>>> 1 :: PortNumber
1
>>> read "1" :: PortNumber
1

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.

Interface names

ifNameToIndex :: String -> IO (Maybe Int) Source #

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