socket-0.8.0.1: An extensible socket library.

Copyright(c) Lars Petersen 2015
LicenseMIT
Maintainerinfo@lars-petersen.net
Stabilityexperimental
Safe HaskellNone
LanguageHaskell2010

System.Socket.Family.Inet6

Contents

Description

 

Synopsis

Inet6

data Inet6 Source #

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

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

Special addresses

inet6Any

inet6Loopback

Socket options

V6Only

data V6Only Source #

IPV6_V6ONLY

Constructors

V6Only Bool