rtnetlink-0.1.0.3: 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

newtype IfPrefix Source #

A netmask in CIDR notation.

Constructors

IfPrefix 

Fields

Instances

Eq IfPrefix Source # 
Num IfPrefix Source # 
Ord IfPrefix Source # 
Show IfPrefix Source # 
Reply IfPrefix Source # 
Message IfPrefix Source # 
type ReplyHeader IfPrefix Source # 
type MessageHeader IfPrefix Source # 

data IfAddrMsg Source #

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

Constructors

IfAddrMsg 

Fields

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}]

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 }]

Orphan instances