Network.Info

network-info-0.2.0.5: Access the local computer's basic network configuration

Safe Haskell | Safe
Language | Haskell98

Network.Info

Synopsis

- getNetworkInterfaces :: IO [NetworkInterface]
- data NetworkInterface = NetworkInterface {
  - name :: String
  - ipv4 :: IPv4
  - ipv6 :: IPv6
  - mac :: MAC
  }
- data IPv4 = IPv4 !Word32
- data IPv6 = IPv6 !Word32 !Word32 !Word32 !Word32
- data MAC = MAC !Word8 !Word8 !Word8 !Word8 !Word8 !Word8

# Documentation

getNetworkInterfaces :: IO [NetworkInterface]

Gets the address information for each of the network interfaces on the local computer.

data NetworkInterface

Describes the basic configuration of a network interface. This definition is currently limited to just one address per family.

Constructors

NetworkInterface |
Fields name :: String Interface name (e.g. "eth0", "lo", "Local Area Connection") ipv4 :: IPv4 IPv4 address ipv6 :: IPv6 IPv6 address mac :: MAC MAC address

Instances

Show NetworkInterface |
Storable NetworkInterface |

data IPv4

Represents an IPv4 address (e.g. `172.23.21.1`, `127.0.0.1`)

Constructors

IPv4 !Word32 |

Instances

Bounded IPv4 |
Eq IPv4 |
Ord IPv4 |
Show IPv4 |
Storable IPv4 |

data IPv6

Represents an IPv6 address (e.g. `2001:db8:85a3::8a2e:370:7334`, `::1`)

Constructors

IPv6 !Word32 !Word32 !Word32 !Word32 |

Instances

Bounded IPv6 |
Eq IPv6 |
Ord IPv6 |
Show IPv6 | Not yet capable of collapsing groups of zeros, will still generate valid addresses however.
Storable IPv6 |

data MAC

Represents a MAC address (e.g. `01:23:45:67:89:ab`)

Constructors

MAC !Word8 !Word8 !Word8 !Word8 !Word8 !Word8 |

Instances

Bounded MAC |
Eq MAC |
Ord MAC |
Show MAC |
Storable MAC |