packages feed

Win32-dhcp-server-0.3: Win32-dhcp-server.cabal

Name:                Win32-dhcp-server
Synopsis:            Win32 DHCP Server Management API
Version:             0.3
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.6.3, GHC == 7.8.3, GHC == 7.10.1
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.
  .
  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
  &#x20;   api <- loadDHCP
  &#x20;   clients <- enumClients api context
  &#x20;   let macs = map (showMac \":\" . clientHardwareAddress) clients
  &#x20;   mapM_ T.putStrLn macs
  &#x20; where
  &#x20;   Right subnet = readIp \"192.168.1.0\"
  &#x20;   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
  Exposed-modules: Data.Ip
                 , Data.Mac
                 , System.Win32.DHCP
  Ghc-Options: -funbox-strict-fields -Wall
  other-modules: Utils
               , 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