Copyright | (c) Formaltech Inc. 2017 |
---|---|
License | BSD3 |
Maintainer | protob3n@gmail.com |
Stability | experimental |
Portability | Linux |
Safe Haskell | None |
Language | Haskell2010 |
Synopsis
- data IfInetAddress = IfInetAddress {}
- data IfInet6Address = IfInet6Address {}
- newtype IfIndex = IfIndex {}
- newtype IfPrefix = IfPrefix Word8
- data IfScope
- newtype IfLabel = IfLabel ByteString
- data Precedence
- data DuplicateAddressDetection
- data DuplicateAddressDetectionFlags = DuplicateAddressDetectionFlags {
- dadOptimistic :: Bool
- dadTentative :: Bool
- dadFailed :: Bool
- data Mip6Homing
- data Preference
- data Permanence
- data PrefixRoute
- data MulticastAutoJoin
- data IfSeconds
- data IfLifetime = IfLifetime {}
- data AnyInterface = AnyInterface
- data IfAddrMsg = IfAddrMsg {
- addrFamily :: Word8
- addrPrefix :: Word8
- addrFlags :: Word8
- addrScope :: Word8
- addrIndex :: Word32
- data InetAddress
- inetAddressFromTuple :: (Word8, Word8, Word8, Word8) -> InetAddress
- inetAddressToTuple :: InetAddress -> (Word8, Word8, Word8, Word8)
- data Inet6Address
- inet6AddressFromTuple :: (Word16, Word16, Word16, Word16, Word16, Word16, Word16, Word16) -> Inet6Address
- inet6AddressToTuple :: Inet6Address -> (Word16, Word16, Word16, Word16, Word16, Word16, Word16, Word16)
Documentation
data IfInetAddress Source #
An ipv4 address and netmask associated with an interface.
IfInetAddress | |
|
Instances
Eq IfInetAddress Source # | |
Defined in System.Linux.RTNetlink.Address (==) :: IfInetAddress -> IfInetAddress -> Bool # (/=) :: IfInetAddress -> IfInetAddress -> Bool # | |
Show IfInetAddress Source # | |
Defined in System.Linux.RTNetlink.Address showsPrec :: Int -> IfInetAddress -> ShowS # show :: IfInetAddress -> String # showList :: [IfInetAddress] -> ShowS # | |
Reply IfInetAddress Source # | |
Defined in System.Linux.RTNetlink.Address type ReplyHeader IfInetAddress :: Type Source # | |
Destroy IfInetAddress Source # | |
Defined in System.Linux.RTNetlink.Address | |
Create IfInetAddress Source # | |
Defined in System.Linux.RTNetlink.Address | |
Message IfInetAddress Source # | |
Defined in System.Linux.RTNetlink.Address type MessageHeader IfInetAddress :: Type Source # | |
type ReplyHeader IfInetAddress Source # | |
Defined in System.Linux.RTNetlink.Address | |
type MessageHeader IfInetAddress Source # | |
Defined in System.Linux.RTNetlink.Address |
data IfInet6Address Source #
An ipv6 address and netmask associated with an interface.
IfInet6Address | |
|
Instances
Eq IfInet6Address Source # | |
Defined in System.Linux.RTNetlink.Address (==) :: IfInet6Address -> IfInet6Address -> Bool # (/=) :: IfInet6Address -> IfInet6Address -> Bool # | |
Show IfInet6Address Source # | |
Defined in System.Linux.RTNetlink.Address showsPrec :: Int -> IfInet6Address -> ShowS # show :: IfInet6Address -> String # showList :: [IfInet6Address] -> ShowS # | |
Reply IfInet6Address Source # | |
Defined in System.Linux.RTNetlink.Address type ReplyHeader IfInet6Address :: Type Source # | |
Destroy IfInet6Address Source # | |
Defined in System.Linux.RTNetlink.Address | |
Create IfInet6Address Source # | |
Defined in System.Linux.RTNetlink.Address | |
Message IfInet6Address Source # | |
Defined in System.Linux.RTNetlink.Address type MessageHeader IfInet6Address :: Type Source # | |
type ReplyHeader IfInet6Address Source # | |
Defined in System.Linux.RTNetlink.Address | |
type MessageHeader IfInet6Address Source # | |
Defined in System.Linux.RTNetlink.Address |
The index of a layer-3 interface.
Instances
Enum IfIndex Source # | |
Eq IfIndex Source # | |
Integral IfIndex Source # | |
Defined in System.Linux.RTNetlink.Address | |
Num IfIndex Source # | |
Ord IfIndex Source # | |
Defined in System.Linux.RTNetlink.Address | |
Real IfIndex Source # | |
Defined in System.Linux.RTNetlink.Address toRational :: IfIndex -> Rational # | |
Show IfIndex Source # | |
Reply IfIndex Source # | |
Defined in System.Linux.RTNetlink.Address type ReplyHeader IfIndex :: Type Source # fromNLMessage :: NLMessage (ReplyHeader IfIndex) -> Maybe IfIndex Source # | |
Message IfIndex Source # | |
Defined in System.Linux.RTNetlink.Address type MessageHeader IfIndex :: Type Source # messageHeaderParts :: IfIndex -> [HeaderPart (MessageHeader IfIndex)] Source # messageAttrs :: IfIndex -> AttributeList Source # | |
type ReplyHeader IfIndex Source # | |
Defined in System.Linux.RTNetlink.Address | |
type MessageHeader IfIndex Source # | |
Defined in System.Linux.RTNetlink.Address |
A netmask in CIDR notation.
Instances
Enum IfPrefix Source # | |
Defined in System.Linux.RTNetlink.Address | |
Eq IfPrefix Source # | |
Integral IfPrefix Source # | |
Defined in System.Linux.RTNetlink.Address | |
Num IfPrefix Source # | |
Ord IfPrefix Source # | |
Defined in System.Linux.RTNetlink.Address | |
Real IfPrefix Source # | |
Defined in System.Linux.RTNetlink.Address toRational :: IfPrefix -> Rational # | |
Show IfPrefix Source # | |
Reply IfPrefix Source # | |
Defined in System.Linux.RTNetlink.Address type ReplyHeader IfPrefix :: Type Source # | |
Message IfPrefix Source # | |
Defined in System.Linux.RTNetlink.Address type MessageHeader IfPrefix :: Type Source # messageHeaderParts :: IfPrefix -> [HeaderPart (MessageHeader IfPrefix)] Source # messageAttrs :: IfPrefix -> AttributeList Source # | |
type ReplyHeader IfPrefix Source # | |
Defined in System.Linux.RTNetlink.Address | |
type MessageHeader IfPrefix Source # | |
Defined in System.Linux.RTNetlink.Address |
IfUniverse | Destination located anywhere (default). |
IfUserScope Word8 | User-defined scope; 0, 200, and 253-5 are reserved. |
IfSite | IPv6 address valid inside this site. Deprecated. |
IfLink | Destination on attached link. |
IfHost | Local address. |
IfNowhere | Destination doesn't exist. |
Instances
Eq IfScope Source # | |
Show IfScope Source # | |
Reply IfScope Source # | |
Defined in System.Linux.RTNetlink.Address type ReplyHeader IfScope :: Type Source # fromNLMessage :: NLMessage (ReplyHeader IfScope) -> Maybe IfScope Source # | |
Message IfScope Source # | |
Defined in System.Linux.RTNetlink.Address type MessageHeader IfScope :: Type Source # messageHeaderParts :: IfScope -> [HeaderPart (MessageHeader IfScope)] Source # messageAttrs :: IfScope -> AttributeList Source # | |
(Create c, MessageHeader c ~ IfAddrMsg) => Create (c, IfScope) Source # | |
Defined in System.Linux.RTNetlink.Address | |
(Create c, MessageHeader c ~ IfAddrMsg) => Create (IfScope, c) Source # | |
Defined in System.Linux.RTNetlink.Address | |
type ReplyHeader IfScope Source # | |
Defined in System.Linux.RTNetlink.Address | |
type MessageHeader IfScope Source # | |
Defined in System.Linux.RTNetlink.Address |
A textual label applied to an IPv4 address. Defaults to the LinkName
of
the parent link. Note that this is ignored/absent for IPv6 addresses.
Instances
Eq IfLabel Source # | |
Show IfLabel Source # | |
IsString IfLabel Source # | |
Defined in System.Linux.RTNetlink.Address fromString :: String -> IfLabel # | |
Reply IfLabel Source # | |
Defined in System.Linux.RTNetlink.Address type ReplyHeader IfLabel :: Type Source # fromNLMessage :: NLMessage (ReplyHeader IfLabel) -> Maybe IfLabel Source # | |
Message IfLabel Source # | |
Defined in System.Linux.RTNetlink.Address type MessageHeader IfLabel :: Type Source # messageHeaderParts :: IfLabel -> [HeaderPart (MessageHeader IfLabel)] Source # messageAttrs :: IfLabel -> AttributeList Source # | |
(Create c, MessageHeader c ~ IfAddrMsg) => Create (c, IfLabel) Source # | |
Defined in System.Linux.RTNetlink.Address | |
(Create c, MessageHeader c ~ IfAddrMsg) => Create (IfLabel, c) Source # | |
Defined in System.Linux.RTNetlink.Address | |
type ReplyHeader IfLabel Source # | |
Defined in System.Linux.RTNetlink.Address | |
type MessageHeader IfLabel Source # | |
Defined in System.Linux.RTNetlink.Address |
data Precedence Source #
Precedence for address on its link. The first address created on a subnet
is Primary
, and each subsequent one is Secondary
. (This is similar to an
"alias" address in ifconfig
.) By default, linux has the (maybe
counterintuitive) behavior that, when the primary address on a subnet is
deleted, all secondary interfaces are deleted as well. To change this
behavior, you can set net.ipv{4|6}.conf.dev.promote_secondaries = 1
in
sysctl
.
Instances
Eq Precedence Source # | |
Defined in System.Linux.RTNetlink.Address (==) :: Precedence -> Precedence -> Bool # (/=) :: Precedence -> Precedence -> Bool # | |
Show Precedence Source # | |
Defined in System.Linux.RTNetlink.Address showsPrec :: Int -> Precedence -> ShowS # show :: Precedence -> String # showList :: [Precedence] -> ShowS # | |
Reply Precedence Source # | |
Defined in System.Linux.RTNetlink.Address type ReplyHeader Precedence :: Type Source # | |
type ReplyHeader Precedence Source # | |
Defined in System.Linux.RTNetlink.Address |
data DuplicateAddressDetection Source #
Whether this IPv6 address should send duplicate address detection packets
(see RFC2462). Default is DadEnabled
. This flag only makes sense for IPv6
addresses, but the kernel is perfectly happy to let you set it on IPv4 ones,
with no effect.
Instances
Eq DuplicateAddressDetection Source # | |
Defined in System.Linux.RTNetlink.Address | |
Show DuplicateAddressDetection Source # | |
Defined in System.Linux.RTNetlink.Address showsPrec :: Int -> DuplicateAddressDetection -> ShowS # show :: DuplicateAddressDetection -> String # showList :: [DuplicateAddressDetection] -> ShowS # | |
Reply DuplicateAddressDetection Source # | |
Message DuplicateAddressDetection Source # | |
(Create c, MessageHeader c ~ IfAddrMsg) => Create (c, DuplicateAddressDetection) Source # | |
Defined in System.Linux.RTNetlink.Address | |
(Create c, MessageHeader c ~ IfAddrMsg) => Create (DuplicateAddressDetection, c) Source # | |
Defined in System.Linux.RTNetlink.Address | |
type ReplyHeader DuplicateAddressDetection Source # | |
Defined in System.Linux.RTNetlink.Address | |
type MessageHeader DuplicateAddressDetection Source # | |
Defined in System.Linux.RTNetlink.Address |
data DuplicateAddressDetectionFlags Source #
Flags for IPv6 duplicate address detection. See RFC4862.
DuplicateAddressDetectionFlags | |
|
data Mip6Homing Source #
Home address for IPv6. Used in Mobility for IPv6 (MIP6), which allows a device to use its home address on mobile networks. See RFC6275.
Instances
Eq Mip6Homing Source # | |
Defined in System.Linux.RTNetlink.Address (==) :: Mip6Homing -> Mip6Homing -> Bool # (/=) :: Mip6Homing -> Mip6Homing -> Bool # | |
Show Mip6Homing Source # | |
Defined in System.Linux.RTNetlink.Address showsPrec :: Int -> Mip6Homing -> ShowS # show :: Mip6Homing -> String # showList :: [Mip6Homing] -> ShowS # | |
Reply Mip6Homing Source # | |
Defined in System.Linux.RTNetlink.Address type ReplyHeader Mip6Homing :: Type Source # | |
Message Mip6Homing Source # | |
Defined in System.Linux.RTNetlink.Address type MessageHeader Mip6Homing :: Type Source # | |
type ReplyHeader Mip6Homing Source # | |
Defined in System.Linux.RTNetlink.Address | |
type MessageHeader Mip6Homing Source # | |
Defined in System.Linux.RTNetlink.Address |
data Preference Source #
Indicates an address that is past its preferred lifetime. A deprecated address will be dis-preferred for source address selection.
Instances
Eq Preference Source # | |
Defined in System.Linux.RTNetlink.Address (==) :: Preference -> Preference -> Bool # (/=) :: Preference -> Preference -> Bool # | |
Show Preference Source # | |
Defined in System.Linux.RTNetlink.Address showsPrec :: Int -> Preference -> ShowS # show :: Preference -> String # showList :: [Preference] -> ShowS # | |
Reply Preference Source # | |
Defined in System.Linux.RTNetlink.Address type ReplyHeader Preference :: Type Source # | |
type ReplyHeader Preference Source # | |
Defined in System.Linux.RTNetlink.Address |
data Permanence Source #
A Permanent
IPv6 address is one that was explicitly created. A Dynamic
address is one that was auto-generated, e.g. by SLAAC.
Instances
Eq Permanence Source # | |
Defined in System.Linux.RTNetlink.Address (==) :: Permanence -> Permanence -> Bool # (/=) :: Permanence -> Permanence -> Bool # | |
Show Permanence Source # | |
Defined in System.Linux.RTNetlink.Address showsPrec :: Int -> Permanence -> ShowS # show :: Permanence -> String # showList :: [Permanence] -> ShowS # | |
Reply Permanence Source # | |
Defined in System.Linux.RTNetlink.Address type ReplyHeader Permanence :: Type Source # | |
type ReplyHeader Permanence Source # | |
Defined in System.Linux.RTNetlink.Address |
data PrefixRoute Source #
Whether to automatically add a route based on the prefix when the address is added.
Instances
Eq PrefixRoute Source # | |
Defined in System.Linux.RTNetlink.Address (==) :: PrefixRoute -> PrefixRoute -> Bool # (/=) :: PrefixRoute -> PrefixRoute -> Bool # | |
Show PrefixRoute Source # | |
Defined in System.Linux.RTNetlink.Address showsPrec :: Int -> PrefixRoute -> ShowS # show :: PrefixRoute -> String # showList :: [PrefixRoute] -> ShowS # | |
Reply PrefixRoute Source # | |
Defined in System.Linux.RTNetlink.Address type ReplyHeader PrefixRoute :: Type Source # | |
Message PrefixRoute Source # | |
Defined in System.Linux.RTNetlink.Address type MessageHeader PrefixRoute :: Type Source # | |
(Create c, MessageHeader c ~ IfAddrMsg) => Create (c, PrefixRoute) Source # | |
Defined in System.Linux.RTNetlink.Address | |
(Create c, MessageHeader c ~ IfAddrMsg) => Create (PrefixRoute, c) Source # | |
Defined in System.Linux.RTNetlink.Address | |
type ReplyHeader PrefixRoute Source # | |
Defined in System.Linux.RTNetlink.Address | |
type MessageHeader PrefixRoute Source # | |
Defined in System.Linux.RTNetlink.Address |
data MulticastAutoJoin Source #
Enable joining multicast groups when connected to a switch that does IGMP snooping. Only sensible on multicast addresses.
Instances
Eq MulticastAutoJoin Source # | |
Defined in System.Linux.RTNetlink.Address (==) :: MulticastAutoJoin -> MulticastAutoJoin -> Bool # (/=) :: MulticastAutoJoin -> MulticastAutoJoin -> Bool # | |
Show MulticastAutoJoin Source # | |
Defined in System.Linux.RTNetlink.Address showsPrec :: Int -> MulticastAutoJoin -> ShowS # show :: MulticastAutoJoin -> String # showList :: [MulticastAutoJoin] -> ShowS # | |
Reply MulticastAutoJoin Source # | |
Defined in System.Linux.RTNetlink.Address type ReplyHeader MulticastAutoJoin :: Type Source # | |
Message MulticastAutoJoin Source # | |
Defined in System.Linux.RTNetlink.Address type MessageHeader MulticastAutoJoin :: Type Source # | |
type ReplyHeader MulticastAutoJoin Source # | |
Defined in System.Linux.RTNetlink.Address | |
type MessageHeader MulticastAutoJoin Source # | |
Defined in System.Linux.RTNetlink.Address |
data IfLifetime Source #
The lifetime of this address. The address will be in a Prefered
state for
ifPrefered
seconds, after which it will be Deprecated
. After ifValid
seconds, the address will be removed.
Instances
Eq IfLifetime Source # | |
Defined in System.Linux.RTNetlink.Address (==) :: IfLifetime -> IfLifetime -> Bool # (/=) :: IfLifetime -> IfLifetime -> Bool # | |
Show IfLifetime Source # | |
Defined in System.Linux.RTNetlink.Address showsPrec :: Int -> IfLifetime -> ShowS # show :: IfLifetime -> String # showList :: [IfLifetime] -> ShowS # | |
Reply IfLifetime Source # | |
Defined in System.Linux.RTNetlink.Address type ReplyHeader IfLifetime :: Type Source # | |
Message IfLifetime Source # | |
Defined in System.Linux.RTNetlink.Address type MessageHeader IfLifetime :: Type Source # | |
(Create c, MessageHeader c ~ IfAddrMsg) => Create (c, IfLifetime) Source # | |
Defined in System.Linux.RTNetlink.Address | |
(Create c, MessageHeader c ~ IfAddrMsg) => Create (IfLifetime, c) Source # | |
Defined in System.Linux.RTNetlink.Address | |
type ReplyHeader IfLifetime Source # | |
Defined in System.Linux.RTNetlink.Address | |
type MessageHeader IfLifetime Source # | |
Defined in System.Linux.RTNetlink.Address |
data AnyInterface Source #
Interface wildcard. Use this to get information about all layer-3 interfaces.
Instances
Eq AnyInterface Source # | |
Defined in System.Linux.RTNetlink.Address (==) :: AnyInterface -> AnyInterface -> Bool # (/=) :: AnyInterface -> AnyInterface -> Bool # | |
Show AnyInterface Source # | |
Defined in System.Linux.RTNetlink.Address showsPrec :: Int -> AnyInterface -> ShowS # show :: AnyInterface -> String # showList :: [AnyInterface] -> ShowS # | |
Request AnyInterface Source # | |
Defined in System.Linux.RTNetlink.Address | |
Message AnyInterface Source # | |
Defined in System.Linux.RTNetlink.Address type MessageHeader AnyInterface :: Type Source # | |
type MessageHeader AnyInterface Source # | |
Defined in System.Linux.RTNetlink.Address |
The header corresponding to address messages, based on 'struct ifaddrmsg' from 'linux/if_addr.h'.
IfAddrMsg | |
|
Instances
Eq IfAddrMsg Source # | |
Show IfAddrMsg Source # | |
Serialize IfAddrMsg Source # | |
Sized IfAddrMsg Source # | |
ReplyMessageHeader IfAddrMsg Source # | |
Defined in System.Linux.RTNetlink.Address replyTypeNumbers :: IfAddrMsg -> [TypeNumber] Source # | |
RequestMessageHeader IfAddrMsg Source # | |
Defined in System.Linux.RTNetlink.Address | |
DestroyMessageHeader IfAddrMsg Source # | |
Defined in System.Linux.RTNetlink.Address | |
CreateMessageHeader IfAddrMsg Source # | |
Defined in System.Linux.RTNetlink.Address | |
Header IfAddrMsg Source # | |
Defined in System.Linux.RTNetlink.Address type HeaderPart IfAddrMsg :: Type Source # | |
type HeaderPart IfAddrMsg Source # | |
Defined in System.Linux.RTNetlink.Address |
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
inetAddressFromTuple :: (Word8, Word8, Word8, Word8) -> InetAddress #
Constructs a custom InetAddress
.
inetAddressFromTuple (127,0,0,1) == inetLoopback
inetAddressToTuple :: InetAddress -> (Word8, Word8, Word8, Word8) #
Deconstructs an InetAddress
.
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
inet6AddressFromTuple :: (Word16, Word16, Word16, Word16, Word16, Word16, Word16, Word16) -> Inet6Address #
Constructs a custom Inet6Address
.
inet6AddressFromTuple (0,0,0,0,0,0,0,1) == inet6Loopback
inet6AddressToTuple :: Inet6Address -> (Word16, Word16, Word16, Word16, Word16, Word16, Word16, Word16) #
Deconstructs an Inet6Address
.
Orphan instances
Reply Inet6Address Source # | |
type ReplyHeader Inet6Address :: Type Source # | |
Reply InetAddress Source # | |
type ReplyHeader InetAddress :: Type Source # | |
Message Inet6Address Source # | |
type MessageHeader Inet6Address :: Type Source # | |
Message InetAddress Source # | |
type MessageHeader InetAddress :: Type Source # |