/
Win32-dhcp-server.cabal
82 lines (81 loc) · 2.76 KB
/
Win32-dhcp-server.cabal
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
Name: Win32-dhcp-server
Synopsis: Win32 DHCP Server Management API
Version: 0.3.2
License: BSD3
License-file: LICENSE
Author: Michael Steele
Maintainer: mikesteele81@gmail.com
Copyright: Copyright 2013-2015 Michael Steele
Homepage: http://github.com/mikesteele81/win32-dhcp-server
Bug-Reports: http://github.com/mikesteele81/win32-dhcp-server/issues
Category: System
Build-type: Simple
Cabal-version: >=1.16
Tested-With: GHC == 7.10.2
Stability: provisional
Description:
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
  where
  Right subnet = readIp \"192.168.1.0\"
  context = Context \"192.168.1.5\" subnet
@
extra-source-files:
ChangeLog
examples/*.hs
Library
Build-depends: base >= 4.6 && < 4.9
, text >= 0.11 && < 1.3
, Win32 >= 2.2 && < 2.4
, Win32-errors >= 0.2 && < 0.3
default-language: Haskell2010
hs-source-dirs: src
Exposed-modules: Data.Ip
, Data.Mac
, System.Win32.DHCP
Ghc-Options: -funbox-strict-fields -Wall
other-modules:
Import
, System.Win32.DHCP.Internal
, System.Win32.DHCP.Client
, System.Win32.DHCP.CLIENT_UID
, System.Win32.DHCP.DhcpStructure
, System.Win32.DHCP.HOST_INFO
, System.Win32.DHCP.IP_CLUSTER
, System.Win32.DHCP.IP_RANGE
, System.Win32.DHCP.LengthBuffer
, System.Win32.DHCP.SEARCH_INFO
, System.Win32.DHCP.Reservation
, System.Win32.DHCP.SUBNET_CLIENT_INFO_ARRAY_V4
, System.Win32.DHCP.SUBNET_ELEMENT_DATA_V4
, System.Win32.DHCP.SUBNET_ELEMENT_INFO_ARRAY_V4
, System.Win32.DHCP.Types