ip-0.6.1: Library for IP and MAC addresses

Safe HaskellNone
LanguageHaskell2010

Net.IPv4

Contents

Description

An IPv4 data type

This module provides the IPv4 data type and functions for working with it. There are also encoding and decoding functions provided in this module, but they should be imported from Net.IPv4.Text and Net.IPv4.ByteString.Char8 instead. They are defined here so that the FromJSON and ToJSON instances can use them.

At some point, a highly efficient IPv4-to-ByteString function needs to be added to this module to take advantage of aeson's new toEncoding method.

Synopsis

Types

Conversion Functions

fromOctets' :: Word32 -> Word32 -> Word32 -> Word32 -> IPv4 Source

This is sort of a misnomer. It takes Word32 to make dotDecimalParser probably perform better.

Encoding and Decoding Functions

dotDecimalParser :: Parser IPv4 Source

This does not do an endOfInput check because it is reused in the range parser implementation.