Copyright | (c) Formaltech Inc. 2017 |
---|---|
License | BSD3 |
Maintainer | [email protected] |
Stability | experimental |
Portability | Linux |
Safe Haskell | None |
Language | Haskell2010 |
System.Linux.RTNetlink.Address
Contents
Description
- data IfInetAddress = IfInetAddress {}
- data IfInet6Address = IfInet6Address {}
- newtype IfIndex = IfIndex {}
- newtype IfPrefix = IfPrefix {}
- data AnyInterface = AnyInterface
- data IfAddrMsg = IfAddrMsg {
- addrFamily :: Word8
- addrPrefix :: Word8
- addrFlags :: Word8
- addrScope :: Word8
- addrIndex :: Word32
- data InetAddress :: *
- data Inet6Address :: *
Documentation
data IfInetAddress Source #
An ipv4 address and netmask associated with an interface.
Constructors
IfInetAddress | |
Fields
|
data IfInet6Address Source #
An ipv6 address and netmask associated with an interface.
Constructors
IfInet6Address | |
Fields
|
The index of a layer-3 interface.
A netmask in CIDR notation.
data AnyInterface Source #
Interface wildcard. Use this to get information about all layer-3 interfaces.
Constructors
AnyInterface |
Instances
The header corresponding to address messages, based on 'struct ifaddrmsg' from 'linux/if_addr.h'.
Re-exports
data InetAddress :: * #
To avoid errors with endianess it was decided to keep this type abstract.
Use inetAddressFromTuple
and inetAddressToTuple
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 "127.0.0.1") Nothing aiNumericHost :: IO [AddressInfo Inet Stream TCP] [AddressInfo {addressInfoFlags = AddressInfoFlags 4, socketAddress = SocketAddressInet {inetAddress = InetAddress 127.0.0.1, inetPort = InetPort 0}, canonicalName = Nothing}]
Instances
data Inet6Address :: * #
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 }]
Instances