Copyright | (c) Lars Petersen 2015 |
---|---|
License | MIT |
Maintainer | info@lars-petersen.net |
Stability | experimental |
Safe Haskell | None |
Language | Haskell2010 |
- data Inet6
- data Inet6Address
- data Inet6Port
- data Inet6FlowInfo
- data Inet6ScopeId
- data family SocketAddress f
- inet6AddressFromTuple :: (Word16, Word16, Word16, Word16, Word16, Word16, Word16, Word16) -> Inet6Address
- inet6AddressToTuple :: Inet6Address -> (Word16, Word16, Word16, Word16, Word16, Word16, Word16, Word16)
- inet6Any :: Inet6Address
- inet6Loopback :: Inet6Address
- data V6Only = V6Only Bool
Inet6
Family Inet6 Source # | |
HasNameInfo Inet6 Source # | |
HasAddressInfo Inet6 Source # | |
Eq (SocketAddress Inet6) Source # | |
Show (SocketAddress Inet6) Source # | |
Storable (SocketAddress Inet6) Source # | |
data SocketAddress Inet6 Source # | An IPv6 socket address. The socket address contains a port number that may be used by transport protocols like TCP. SocketAddressInet6 inet6Loopback 8080 0 0 |
Inet6Address
data Inet6Address Source #
To avoid errors with endianess it was decided to keep this type abstract.
Use inet6AddressFromTuple
and inet6AddressToTuple
for constructing and
deconstructing custom addresses.
Hint: Use the Storable
instance. It exposes it
exactly as found within an IP packet (big endian if you insist
on interpreting it as a number).
Another hint: Use getAddressInfo
for parsing and suppress
nameserver lookups:
> getAddressInfo (Just "::1") Nothing aiNumericHost :: IO [AddressInfo SocketAddressInet6 Stream TCP] [AddressInfo { addressInfoFlags = AddressInfoFlags 4, socketAddress = SocketAddressInet6 {inet6Address = Inet6Address 0000:0000:0000:0000:0000:0000:0000:0001, inet6Port = Inet6Port 0, inet6FlowInfo = Inet6FlowInfo 0, inet6ScopeId = Inet6ScopeId 0}, canonicalName = Nothing }]
Inet6Port
Inet6FlowInfo
data Inet6FlowInfo Source #
Inet6ScopeId
data Inet6ScopeId Source #
SocketAddress Inet6
data family SocketAddress f Source #
The SocketAddress
type is a data family.
This allows to provide different data constructors depending on the socket
family wihtout knowing all of them in advance or the need to patch this
core library.
SocketAddressInet inetLoopback 8080 :: SocketAddress Inet SocketAddressInet6 inet6Loopback 8080 0 0 :: SocketAddress Inet6
Eq (SocketAddress Inet6) # | |
Eq (SocketAddress Inet) # | |
Show (SocketAddress Inet6) # | |
Show (SocketAddress Inet) # | |
Storable (SocketAddress Inet6) # | |
Storable (SocketAddress Inet) # | |
data SocketAddress Inet6 Source # | An IPv6 socket address. The socket address contains a port number that may be used by transport protocols like TCP. SocketAddressInet6 inet6Loopback 8080 0 0 |
data SocketAddress Inet Source # | An IPv4 socket address. The socket address contains a port number that may be used by transport protocols like TCP. SocketAddressInet inetLoopback 8080 |
Custom addresses
inet6AddressFromTuple
inet6AddressFromTuple :: (Word16, Word16, Word16, Word16, Word16, Word16, Word16, Word16) -> Inet6Address Source #
Constructs a custom Inet6Address
.
inet6AddressFromTuple (0,0,0,0,0,0,0,1) == inet6Loopback
inet6AddressToTuple
inet6AddressToTuple :: Inet6Address -> (Word16, Word16, Word16, Word16, Word16, Word16, Word16, Word16) Source #
Deconstructs an Inet6Address
.
Special addresses
inet6Any
inet6Any :: Inet6Address Source #
::
inet6Loopback
inet6Loopback :: Inet6Address Source #
::1