network-2.2.1: Networking-related facilitiesSource codeContentsIndex
Network.Socket.Internal
Portabilityportable
Stabilityprovisional
Maintainerlibraries@haskell.org
Contents
Socket addresses
Protocol families
Description
A module containing semi-public Network.Socket internals. Modules which extend the Network.Socket module will need to use this module while ideally most users will be able to make do with the public interface.
Synopsis
type HostAddress = Word32
type HostAddress6 = (Word32, Word32, Word32, Word32)
type FlowInfo = Word32
type ScopeID = Word32
newtype PortNumber = PortNum Word16
data SockAddr
= SockAddrInet PortNumber HostAddress
| SockAddrInet6 PortNumber FlowInfo HostAddress6 ScopeID
| SockAddrUnix String
peekSockAddr :: Ptr SockAddr -> IO SockAddr
pokeSockAddr :: Ptr a -> SockAddr -> IO ()
sizeOfSockAddr :: SockAddr -> Int
sizeOfSockAddrByFamily :: Family -> Int
withSockAddr :: SockAddr -> (Ptr SockAddr -> Int -> IO a) -> IO a
withNewSockAddr :: Family -> (Ptr SockAddr -> Int -> IO a) -> IO a
data Family
= AF_UNSPEC
| AF_UNIX
| AF_INET
| AF_INET6
| AF_SNA
| AF_DECnet
| AF_APPLETALK
| AF_ROUTE
| AF_X25
| AF_AX25
| AF_IPX
| AF_NETROM
| AF_BRIDGE
| AF_ATMPVC
| AF_ROSE
| AF_NETBEUI
| AF_SECURITY
| AF_PACKET
| AF_ASH
| AF_ECONET
| AF_ATMSVC
| AF_IRDA
| AF_PPPOX
| AF_WANPIPE
| AF_BLUETOOTH
Socket addresses
type HostAddress = Word32Source
type HostAddress6 = (Word32, Word32, Word32, Word32)Source
type FlowInfo = Word32Source
type ScopeID = Word32Source
newtype PortNumber Source
Constructors
PortNum Word16
show/hide Instances
data SockAddr Source
Constructors
SockAddrInet PortNumber HostAddress
SockAddrInet6 PortNumber FlowInfo HostAddress6 ScopeID
SockAddrUnix String
show/hide Instances
peekSockAddr :: Ptr SockAddr -> IO SockAddrSource
Read a SockAddr from the given memory location.
pokeSockAddr :: Ptr a -> SockAddr -> IO ()Source
Write the given SockAddr to the given memory location.
sizeOfSockAddr :: SockAddr -> IntSource
Computes the storage requirements (in bytes) of the given SockAddr. This function differs from sizeOf in that the value of the argument is used.
sizeOfSockAddrByFamily :: Family -> IntSource
Computes the storage requirements (in bytes) required for a SockAddr with the given Family.
withSockAddr :: SockAddr -> (Ptr SockAddr -> Int -> IO a) -> IO aSource
Use a SockAddr with a function requiring a pointer to a SockAddr and the length of that SockAddr.
withNewSockAddr :: Family -> (Ptr SockAddr -> Int -> IO a) -> IO aSource
Create a new SockAddr for use with a function requiring a pointer to a SockAddr and the length of that SockAddr.
Protocol families
data Family Source
This data type might have different constructors depending on what is supported by the operating system.
Constructors
AF_UNSPEC
AF_UNIX
AF_INET
AF_INET6
AF_SNA
AF_DECnet
AF_APPLETALK
AF_ROUTE
AF_X25
AF_AX25
AF_IPX
AF_NETROM
AF_BRIDGE
AF_ATMPVC
AF_ROSE
AF_NETBEUI
AF_SECURITY
AF_PACKET
AF_ASH
AF_ECONET
AF_ATMSVC
AF_IRDA
AF_PPPOX
AF_WANPIPE
AF_BLUETOOTH
show/hide Instances
Produced by Haddock version 2.4.2