packages feed

mptcp-pm-0.0.1: mptcp-pm.cabal

cabal-version: 2.2
name: mptcp-pm
version: 0.0.1
license: GPL-3.0-only
license-file: LICENSE
build-type: Simple
Maintainer:  teto
Category:   Network
Synopsis: A work in progress Multipath TCP path manager
Homepage:   https://github.com/teto/netlink_pm
Description:
  Multipath TCP (www.multipath-tcp.org) starting from version 0.95 provides a 
  netlink path manager module. This package implements the userspace part to allow
  userspace daemons to control MPTCP behavior.
Extra-source-files:
  headers/*.h README.md CHANGELOG

Source-repository head
  type:       git
  location:   https://github.com/teto/netlink_pm


Flag Dev {
  Description: Develop with a local netlink library
  Default:     True
}


-- TODO write a rule specific to generated files
-- , ip requires hspec_2_7
-- iproute/network-info bad
-- bitset, fails
-- aeson to (de)serialize to json
-- brittany for formatting (does not work)
-- use containers for Data.Set ?
-- bytestring-conversion,
common shared-properties
    build-depends: base >= 4.12 && < 4.20, optparse-applicative,
      containers, bytestring, fast-logger, process, cereal, ip, aeson,
       netlink >= 1.1.1.0, bytestring-conversion, c2hsc
    default-language: Haskell2010
    -- -fno-warn-unused-imports
    ghc-options: -Wall -fno-warn-unused-binds -fno-warn-unused-matches

    if flag(Dev)
        build-depends: netlink>= 1.1.1.1
    -- for the generated.hsc , c2hs seems good to generate headers
    Build-tools:       hsc2hs, c2hs
    -- apparently this just helps getting a better error messages
    Includes:          tcp_states.h, linux/sock_diag.h, linux/inet_diag.h
    Other-modules:     Net.SockDiag, Net.Tcp, Net.Mptcp, Net.IPAddress, Generated
    -- TODO try to pass it from CLI instead , Net.TcpInfo
    include-dirs:     headers
    -- , Net.TcpInfo
    autogen-modules: Generated



-- monitor new mptcp connections
-- and delegate the behavior to a monitor
executable daemon
    import: shared-properties
    -- build-depends: MyCustomLibrary
    -- ghc-options: -i/home/teto/netlink-hs
    ghc-options: -Wall -fno-warn-unused-binds -fno-warn-unused-matches -threaded
    main-is: daemon.hs
    -- extra-packages: netlink
    -- extra-lib-dirs: /home/teto/netlink-hs
    hs-source-dirs: ., hs

-- will monitor a specific mptcp connection
executable monitor
    import: shared-properties
    main-is: hs/monitor.hs

-- for short tests
executable short
    import: shared-properties
    main-is: hs/test.hs

--  MyCustomLibrary
library
    Build-tools:       hsc2hs, c2hs
    ghc-options: -Wall -fno-warn-unused-binds -fno-warn-unused-matches
    default-language: Haskell2010
    -- apparently this just helps getting a better error messages
    Includes:          tcp_states.h, linux/sock_diag.h, linux/inet_diag.h
    include-dirs: . , headers
    -- autogen-modules: Generated


Test-Suite test
  -- 2 types supported, exitcode is based on ... exit codes ....
  type:               exitcode-stdio-1.0
  main-is:            test/Main.hs
  -- test-module:       Detailed
  hs-source-dirs:     .
  default-language: Haskell2010
  -- import: shared-properties
  Build-tools:       hsc2hs, c2hs
  Includes:          tcp_states.h, linux/sock_diag.h, linux/inet_diag.h
  Other-modules:     Generated, Net.SockDiag, Net.Mptcp, Net.IPAddress
  autogen-modules: Generated
  include-dirs:      headers
  build-depends:      base >=4.12 && <4.20
                     , HUnit
                     , netlink
                     , cereal
                     , ip
                     , bytestring
                     , containers
                     , aeson
                     -- , test-framework
                     -- , test-framework-hunit