rtnetlink-0.2.0.1: Manipulate network devices, addresses, and routes on Linux

Copyright(c) Formaltech Inc. 2017
LicenseBSD3
Maintainerprotob3n@gmail.com
Stabilityexperimental
PortabilityLinux
Safe HaskellNone
LanguageHaskell2010

System.Linux.RTNetlink.Address

Contents

Description

 
Synopsis

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

newtype IfIndex Source #

The index of a layer-3 interface.

Constructors

IfIndex 

Fields

Instances
Enum IfIndex Source # 
Instance details

Defined in System.Linux.RTNetlink.Address

Eq IfIndex Source # 
Instance details

Defined in System.Linux.RTNetlink.Address

Methods

(==) :: IfIndex -> IfIndex -> Bool #

(/=) :: IfIndex -> IfIndex -> Bool #

Integral IfIndex Source # 
Instance details

Defined in System.Linux.RTNetlink.Address

Num IfIndex Source # 
Instance details

Defined in System.Linux.RTNetlink.Address

Ord IfIndex Source # 
Instance details

Defined in System.Linux.RTNetlink.Address

Real IfIndex Source # 
Instance details

Defined in System.Linux.RTNetlink.Address

Show IfIndex Source # 
Instance details

Defined in System.Linux.RTNetlink.Address

Reply IfIndex Source # 
Instance details

Defined in System.Linux.RTNetlink.Address

Associated Types

type ReplyHeader IfIndex :: Type Source #

Message IfIndex Source # 
Instance details

Defined in System.Linux.RTNetlink.Address

Associated Types

type MessageHeader IfIndex :: Type Source #

type ReplyHeader IfIndex Source # 
Instance details

Defined in System.Linux.RTNetlink.Address

type MessageHeader IfIndex Source # 
Instance details

Defined in System.Linux.RTNetlink.Address

newtype IfPrefix Source #

A netmask in CIDR notation.

Constructors

IfPrefix Word8 
Instances
Enum IfPrefix Source # 
Instance details

Defined in System.Linux.RTNetlink.Address

Eq IfPrefix Source # 
Instance details

Defined in System.Linux.RTNetlink.Address

Integral IfPrefix Source # 
Instance details

Defined in System.Linux.RTNetlink.Address

Num IfPrefix Source # 
Instance details

Defined in System.Linux.RTNetlink.Address

Ord IfPrefix Source # 
Instance details

Defined in System.Linux.RTNetlink.Address

Real IfPrefix Source # 
Instance details

Defined in System.Linux.RTNetlink.Address

Show IfPrefix Source # 
Instance details

Defined in System.Linux.RTNetlink.Address

Reply IfPrefix Source # 
Instance details

Defined in System.Linux.RTNetlink.Address

Associated Types

type ReplyHeader IfPrefix :: Type Source #

Message IfPrefix Source # 
Instance details

Defined in System.Linux.RTNetlink.Address

Associated Types

type MessageHeader IfPrefix :: Type Source #

type ReplyHeader IfPrefix Source # 
Instance details

Defined in System.Linux.RTNetlink.Address

type MessageHeader IfPrefix Source # 
Instance details

Defined in System.Linux.RTNetlink.Address

data IfScope Source #

Constructors

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.

newtype IfLabel Source #

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.

Constructors

IfLabel ByteString 
Instances
Eq IfLabel Source # 
Instance details

Defined in System.Linux.RTNetlink.Address

Methods

(==) :: IfLabel -> IfLabel -> Bool #

(/=) :: IfLabel -> IfLabel -> Bool #

Show IfLabel Source # 
Instance details

Defined in System.Linux.RTNetlink.Address

IsString IfLabel Source # 
Instance details

Defined in System.Linux.RTNetlink.Address

Methods

fromString :: String -> IfLabel #

Reply IfLabel Source # 
Instance details

Defined in System.Linux.RTNetlink.Address

Associated Types

type ReplyHeader IfLabel :: Type Source #

Message IfLabel Source # 
Instance details

Defined in System.Linux.RTNetlink.Address

Associated Types

type MessageHeader IfLabel :: Type Source #

(Create c, MessageHeader c ~ IfAddrMsg) => Create (c, IfLabel) Source # 
Instance details

Defined in System.Linux.RTNetlink.Address

(Create c, MessageHeader c ~ IfAddrMsg) => Create (IfLabel, c) Source # 
Instance details

Defined in System.Linux.RTNetlink.Address

type ReplyHeader IfLabel Source # 
Instance details

Defined in System.Linux.RTNetlink.Address

type MessageHeader IfLabel Source # 
Instance details

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.

Constructors

Primary 
Secondary 

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.

Constructors

DadEnabled 
DadDisabled 
Instances
Eq DuplicateAddressDetection Source # 
Instance details

Defined in System.Linux.RTNetlink.Address

Show DuplicateAddressDetection Source # 
Instance details

Defined in System.Linux.RTNetlink.Address

Reply DuplicateAddressDetection Source # 
Instance details

Defined in System.Linux.RTNetlink.Address

Message DuplicateAddressDetection Source # 
Instance details

Defined in System.Linux.RTNetlink.Address

(Create c, MessageHeader c ~ IfAddrMsg) => Create (c, DuplicateAddressDetection) Source # 
Instance details

Defined in System.Linux.RTNetlink.Address

(Create c, MessageHeader c ~ IfAddrMsg) => Create (DuplicateAddressDetection, c) Source # 
Instance details

Defined in System.Linux.RTNetlink.Address

type ReplyHeader DuplicateAddressDetection Source # 
Instance details

Defined in System.Linux.RTNetlink.Address

type MessageHeader DuplicateAddressDetection Source # 
Instance details

Defined in System.Linux.RTNetlink.Address

data DuplicateAddressDetectionFlags Source #

Flags for IPv6 duplicate address detection. See RFC4862.

Constructors

DuplicateAddressDetectionFlags 

Fields

  • dadOptimistic :: Bool

    Whether to use this address for neighbor dicovery and receiving frames when it is in a tentative state (i.e., DAD has not yet succeeded). It is dis-preferred for source address selection, like a deprecated address. See RFC4429.

  • dadTentative :: Bool

    Indicates that DAD has not yet succeeded. This address will not be used for neighbor discovery unless dadOptimistic is also set.

  • dadFailed :: Bool

    Indicates that duplicate address detection failed on this address.

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.

Constructors

Home 
NotHome 

data Preference Source #

Indicates an address that is past its preferred lifetime. A deprecated address will be dis-preferred for source address selection.

Constructors

Prefered 
Deprecated 

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.

Constructors

Permanent 
Dynamic 

data PrefixRoute Source #

Whether to automatically add a route based on the prefix when the address is added.

Constructors

PREnabled 
PRDisabled 

data MulticastAutoJoin Source #

Enable joining multicast groups when connected to a switch that does IGMP snooping. Only sensible on multicast addresses.

Constructors

AutoJoin 
NoAutoJoin 

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.

Constructors

IfLifetime 

data IfAddrMsg Source #

The header corresponding to address messages, based on 'struct ifaddrmsg' from 'linux/if_addr.h'.

Constructors

IfAddrMsg 

Fields

Instances
Eq IfAddrMsg Source # 
Instance details

Defined in System.Linux.RTNetlink.Address

Show IfAddrMsg Source # 
Instance details

Defined in System.Linux.RTNetlink.Address

Serialize IfAddrMsg Source # 
Instance details

Defined in System.Linux.RTNetlink.Address

Sized IfAddrMsg Source # 
Instance details

Defined in System.Linux.RTNetlink.Address

Methods

size :: Integral i => IfAddrMsg -> i Source #

sizeAligned :: Integral a => a -> IfAddrMsg -> a Source #

ReplyMessageHeader IfAddrMsg Source # 
Instance details

Defined in System.Linux.RTNetlink.Address

RequestMessageHeader IfAddrMsg Source # 
Instance details

Defined in System.Linux.RTNetlink.Address

DestroyMessageHeader IfAddrMsg Source # 
Instance details

Defined in System.Linux.RTNetlink.Address

CreateMessageHeader IfAddrMsg Source # 
Instance details

Defined in System.Linux.RTNetlink.Address

Header IfAddrMsg Source # 
Instance details

Defined in System.Linux.RTNetlink.Address

Associated Types

type HeaderPart IfAddrMsg :: Type Source #

type HeaderPart IfAddrMsg Source # 
Instance details

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
Eq InetAddress 
Instance details

Defined in System.Socket.Family.Inet

Show InetAddress 
Instance details

Defined in System.Socket.Family.Inet

Storable InetAddress 
Instance details

Defined in System.Socket.Family.Inet

Reply InetAddress Source # 
Instance details

Defined in System.Linux.RTNetlink.Address

Associated Types

type ReplyHeader InetAddress :: Type Source #

Message InetAddress Source # 
Instance details

Defined in System.Linux.RTNetlink.Address

Associated Types

type MessageHeader InetAddress :: Type Source #

type ReplyHeader InetAddress Source # 
Instance details

Defined in System.Linux.RTNetlink.Address

type MessageHeader InetAddress Source # 
Instance details

Defined in System.Linux.RTNetlink.Address

inetAddressFromTuple :: (Word8, Word8, Word8, Word8) -> InetAddress #

Constructs a custom InetAddress.

inetAddressFromTuple (127,0,0,1) == inetLoopback

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
Eq Inet6Address 
Instance details

Defined in System.Socket.Family.Inet6

Show Inet6Address 
Instance details

Defined in System.Socket.Family.Inet6

Storable Inet6Address 
Instance details

Defined in System.Socket.Family.Inet6

Reply Inet6Address Source # 
Instance details

Defined in System.Linux.RTNetlink.Address

Associated Types

type ReplyHeader Inet6Address :: Type Source #

Message Inet6Address Source # 
Instance details

Defined in System.Linux.RTNetlink.Address

Associated Types

type MessageHeader Inet6Address :: Type Source #

type ReplyHeader Inet6Address Source # 
Instance details

Defined in System.Linux.RTNetlink.Address

type MessageHeader Inet6Address Source # 
Instance details

Defined in System.Linux.RTNetlink.Address

inet6AddressFromTuple :: (Word16, Word16, Word16, Word16, Word16, Word16, Word16, Word16) -> Inet6Address #

Constructs a custom Inet6Address.

inet6AddressFromTuple (0,0,0,0,0,0,0,1) == inet6Loopback

Orphan instances