@hackage Win32-dhcp-server0.1
Win32 DHCP Server Management API.
Categories
License
BSD-3-Clause
Maintainer
mikesteele81@gmail.com
Links
- Homepage
- Documentation
- No source repository
- Security
Versions
Deprecated
Dependencies (3)
Dependents (1)
@hackage/acme-everything
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 from software.
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 System.Win32.DHCP
main :: IO ()
main = do
api <- loadDHCP
clients <- enumClients api context
let macs = map (showMac ":" . clientHardwareAddress) clients
mapM_ putStrLn macs
where
Just subnet = readIp "192.168.1.0"
context = Context "192.168.1.5" subnet