-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/

-- | Access the local computer's basic network configuration
--   
--   This library provides simple read-only access to the local computer's
--   networking configuration. It is currently capable of getting a list of
--   all the network interfaces and their respective IPv4, IPv6 and MAC
--   addresses.
--   
--   network-info has been tested and is known to work on Ubuntu 10.10,
--   FreeBSD 9.0, Mac OS X 10.6.4 and Windows XP/7. It probably works on
--   other flavours of Linux, OS X, FreeBSD and Windows as well.
@package network-info
@version 0.2.0.3

module Network.Info

-- | Gets the address information for each of the network interfaces on the
--   local computer.
getNetworkInterfaces :: IO [NetworkInterface]

-- | Describes the basic configuration of a network interface. This
--   definition is currently limited to just one address per family.
data NetworkInterface
NetworkInterface :: String -> IPv4 -> IPv6 -> MAC -> NetworkInterface

-- | Interface name (e.g. "eth0", "lo", "Local Area Connection")
name :: NetworkInterface -> String

-- | IPv4 address
ipv4 :: NetworkInterface -> IPv4

-- | IPv6 address
ipv6 :: NetworkInterface -> IPv6

-- | MAC address
mac :: NetworkInterface -> MAC

-- | Represents an IPv4 address (e.g. 172.23.21.1,
--   127.0.0.1)
data IPv4
IPv4 :: {-# UNPACK #-} !Word32 -> IPv4

-- | Represents an IPv6 address (e.g.
--   2001:db8:85a3::8a2e:370:7334, ::1)
data IPv6
IPv6 :: {-# UNPACK #-} !Word32 -> {-# UNPACK #-} !Word32 -> {-# UNPACK #-} !Word32 -> {-# UNPACK #-} !Word32 -> IPv6

-- | Represents a MAC address (e.g. 01:23:45:67:89:ab)
data MAC
MAC :: {-# UNPACK #-} !Word8 -> {-# UNPACK #-} !Word8 -> {-# UNPACK #-} !Word8 -> {-# UNPACK #-} !Word8 -> {-# UNPACK #-} !Word8 -> {-# UNPACK #-} !Word8 -> MAC
instance Eq IPv4
instance Ord IPv4
instance Bounded IPv4
instance Eq IPv6
instance Ord IPv6
instance Bounded IPv6
instance Eq MAC
instance Ord MAC
instance Bounded MAC
instance Show NetworkInterface
instance Storable MAC
instance Show MAC
instance Storable IPv6
instance Show IPv6
instance Storable IPv4
instance Show IPv4
instance Storable NetworkInterface
