text-postgresql-0.0.3.0: Parser and Printer of PostgreSQL extended types

Copyright2015-2018 Kei Hibino
LicenseBSD3
Maintainerex8k.hibino@gmail.com
Stabilityexperimental
Portabilityunknown
Safe HaskellSafe
LanguageHaskell2010

Data.PostgreSQL.NetworkAddress

Contents

Description

This module defines network-address types of PostgreSQL. http://www.postgresql.org/docs/current/static/datatype-net-types.html

Synopsis

Definitions about inet and cidr types

newtype Inet Source #

Corresponding to INET type of PostgreSQL

Constructors

Inet NetAddress 

Instances

newtype Cidr Source #

Corresponding to CIDR type of PostgreSQL

Constructors

Cidr NetAddress 

Instances

cidr4 :: V4HostAddress -> Word8 -> Maybe Cidr Source #

Make Cidr type of IPv4 from host-address bits consistent with mask

cidr4' :: V4HostAddress -> Word8 -> Maybe Cidr Source #

Same as cidr4 except for dropping host-address bits along with mask

cidr6 :: V6HostAddress -> Word8 -> Maybe Cidr Source #

Make Cidr type of IPv6 from host-address bits consistent with mask

cidr6' :: V6HostAddress -> Word8 -> Maybe Cidr Source #

Same as cidr6 except for dropping host-address bits along with mask

Definitions about the address type which is the pair of host-address and mask

netAddress4 Source #

Arguments

:: V4HostAddress

IPv4 host-address

-> Word8

IPv4 mask 0-32

-> Maybe NetAddress

result NetAddress

Make IPv4 NetAddress type consistent with IPv4 mask

netAddress6 Source #

Arguments

:: V6HostAddress

IPv6 host-address

-> Word8

IPv6 mask 0-128

-> Maybe NetAddress

result NetAddress

Make IPv6 NetAddress type consistent with IPv6 mask

Definitions about the host-address types

data V6HostAddress Source #

Host address type along with IPv6 address words with IPv6 string order. Each Word16 value is host byte order. Host byte order is portable in programs on its own host. Network byte order is only needed, when communicating other hosts.