network-ip-0.2.1: Internet Protocol data structures

Safe HaskellNone

Network.IP.Addr

Contents

Description

Internet Protocol addressing.

Synopsis

Host address

IPv4 address

anIP4 :: Proxy IP4Source

IP4 proxy value.

ip4ToOctets :: IP4 -> (Word8, Word8, Word8, Word8)Source

The octets of an IPv4 address.

ip4ToOctetList :: IP4 -> [Word8]Source

List the octets of an IPv4 address.

ip4FromOctets :: Word8 -> Word8 -> Word8 -> Word8 -> IP4Source

Assemble IPv4 address from the octets.

ip4FromOctetList :: [Word8] -> Maybe IP4Source

Assemble IPv4 address from the octet list.

anyIP4 :: IP4Source

IPv4 address 0.0.0.0.

loopbackIP4 :: IP4Source

IPv4 address 127.0.0.1.

broadcastIP4 :: IP4Source

IPv4 address 255.255.255.255.

data Range4 Source

IPv4 address range classification (per RFC6890).

Constructors

GeneralIP4

General IPv4 address.

ThisHostIP4

This host on this network.

PrivateUseIP4

Private-Use networks.

SharedSpaceIP4

Shared address space.

LoopbackIP4

Loopback address.

LinkLocalIP4

Link local address.

ReservedIP4

Reserved address.

DSLiteIP4

Dual-Stack Lite.

DocumentationIP4

Reserved for documentation.

IP6To4IP4

6to4.

BenchmarkingIP4

Benchmark testing.

MulticastIP4

Multicast address.

FutureUseIP4

Future use.

BroadcastIP4

Limited broadcast.

ip4Range :: IP4 -> Range4Source

Determine the address range type.

IPv6 address

anIP6 :: Proxy IP6Source

IP6 proxy value.

ip6ToWords :: IP6 -> (Word16, Word16, Word16, Word16, Word16, Word16, Word16, Word16)Source

The 16-bit pieces of an IPv6 address.

ip6ToWordList :: IP6 -> [Word16]Source

List the 16-bit pieces of an IPv6 address.

ip6FromWords :: Word16 -> Word16 -> Word16 -> Word16 -> Word16 -> Word16 -> Word16 -> Word16 -> IP6Source

Assemble IPv6 address from the 16-bit pieces.

ip6FromWordList :: [Word16] -> Maybe IP6Source

Assemble IPv6 address from the list of 16-bit pieces.

anyIP6 :: IP6Source

IPv6 address ::.

loopbackIP6 :: IP6Source

IPv6 address ::1.

data Range6 Source

IPv6 address range classification (per RFC6890).

Constructors

GeneralIP6

General IPv6 address.

AnyIP6

Unspecified address.

LoopbackIP6

Loopback address.

IP4MappedIP6

Mapped IPv4 address.

IP4EmbeddedIP6

Embedded IPv4 address.

DiscardIP6

Discard address.

ReservedIP6

Reserved address.

TeredoIP6

Teredo address.

BenchmarkingIP6

Benchmark testing.

DocumentationIP6

Reserved for documentation.

OrchidIP6

ORCHID address.

IP6To4IP6

6to4.

UniqueLocalIP6

Unique local address.

LinkLocalIP6

Link local address.

MulticastIP6

Multicast address.

ip6Range :: IP6 -> Range6Source

Determine the address range type.

IP address

anIP :: Proxy IPSource

IP proxy value.

Network address

class IsNetAddr n whereSource

Network address.

Associated Types

type NetHost n Source

The address type.

Methods

netHost :: n -> NetHost nSource

Host address.

netHostIx :: n -> NetHost nSource

Host index.

netPrefix :: n -> NetHost nSource

Network prefix.

netMask :: n -> NetHost nSource

Network mask.

netLength :: n -> Word8Source

Network prefix length.

netAddrSource

Arguments

:: NetHost n

Host address

-> Word8

Network prefix length

-> n 

Make a network address.

inNetworkSource

Arguments

:: NetHost n

Host address

-> n

Network address

-> Bool 

Test if the address is in the network.

aNetAddrOf :: Proxy a -> Proxy (NetAddr a)Source

NetAddr a proxy value.

printNetAddr :: (IsNetAddr n, Printable (NetHost n), Printer p) => n -> pSource

Print network address (CIDR notation).

net4Parser :: (CharParsing μ, Monad μ, IsNetAddr n, NetHost n ~ IP4) => μ nSource

IPv4 network address parser (CIDR notation).

net6Parser :: (CharParsing μ, Monad μ, IsNetAddr n, NetHost n ~ IP6) => μ nSource

IPv6 network address parser (CIDR notation).

netParser :: (IsNetAddr n, NetHost n ~ IP, CharParsing μ, Monad μ) => μ nSource

IP network address parser (CIDR notation).

Port number

Socket address

data InetAddr a Source

Socket address: host address + port number.

Constructors

InetAddr 

Fields

inetHost :: a
 
inetPort :: !InetPort
 

anInetAddrOf :: Proxy a -> Proxy (InetAddr a)Source

InetAddr a proxy value.