Win32 DHCP Server Management API

Latest on Hackage:0.3.2

This package is not currently in any snapshots. If you're interested in using it, we recommend adding it to Stackage Nightly. Doing so will make builds more reliable, and allow to host generated Haddocks.

BSD3 licensed by Michael Steele

This package provides a partial binding to the Win32 DHCP Server Management API. Its purpose is to query and control a Microsoft DHCP server. Enough functionality is defined so so that Ipv4 client lease and reservation records can be manipulated programmatically._Only 32-bit versions of GHC are supported at this time._

Here are a few notes on the required environment:

  • Only 32-bit executables are supported. This is mainly because pointers are assumed to be 4 bytes wide in a few places. Support for 64-bit executables may be added in the future.

  • All library calls should be supported on Windows 7 or above.

Simple Example and Usage

-- Print all MAC addresses with an active client lease
module Main where

import Data.Ip
import Data.Mac
import qualified Data.Text.IO as T
import System.Win32.DHCP

main :: IO ()
main = do
    api <- loadDHCP
    clients <- enumClients api context
    let macs = map (showMac ":" . clientHardwareAddress) clients
    mapM_ T.putStrLn macs
    Right subnet = readIp ""
    context = Context "" subnet



* internal code documentation
* small internal code refactorings


* updated documentation
* internal refactoring


* Update to support GHC 7.6 - 7.10
* Expose freeDHCP function


* bug fix: Internal memory structures were not being freed properly.


* All functions throw Win32Exception exceptions.
* strict Text values are favored over String
* drop dependency on safe
Depends on 4 packages:
Used by 1 package:
comments powered byDisqus