packages feed

mptcp-pm-0.0.5: mptcp-pm.cabal

cabal-version: 3.0
name: mptcp-pm
version: 0.0.5
license: GPL-3.0-only
license-file: LICENSE
build-type: Simple
Maintainer:  teto
Category:   Network, Mptcp
Synopsis: A Multipath TCP path manager
Homepage:   https://github.com/teto/quantum2
Description:
  Multipath TCP (www.multipath-tcp.org) starting from version 0.95 provides a
  netlink path manager module. This package implements the userspace component
  in charge of controlling MPTCP subflow establishement and various behaviors.
  It contains a set of function that is also used in [mptcpanalyzer](https://hackage.haskell.org/packages/).

data-files:
extra-source-files:
  headers/*.h
  headers/linux/*.h
  README.md
  CHANGELOG



tested-with:         GHC == 8.10.7

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

Flag WithPolysemy {
  Description: Add polysemy plugin
  Default:     True
}

Flag CwndCapping {
  Description: With an experimental kernel, it's possible to cap some congestion window
  Default:     False
}

common shared-properties
    default-language: Haskell2010
    ghc-options:
      -Wall -fno-warn-unused-binds -fno-warn-unused-matches -haddock
    build-depends:
      -- TODO remove that boundary
        netlink >= 1.1.1.0
      , formatting
      , readable
      , polysemy
      -- winning combination
      -- co-log-0.4.0.1
    -- co-log-core-0.2.1.1
    -- co-log-polysemy-0.0.1.3
    -- integer-logarithms-1.0.3.1
    -- polysemy-log-0.3.0.2
    -- polysemy-log-co-0.3.0.2
    -- co-log-polysemy-0.0.1.3
    -- polysemy-1.7.1.0
    -- polysemy-conc-0.5.0.0
    -- polysemy-log-0.3.0.2
    -- polysemy-log-co-0.3.0.2
    -- polysemy-plugin-0.4.3.0
    -- polysemy-time-0.1.4.0
      --  >= 0.2.2.4
      , polysemy-log
      , polysemy-log-co

    default-extensions:
          FlexibleContexts
        , StrictData
        , DataKinds
        , FlexibleContexts
        , GADTs
        , LambdaCase
        , PolyKinds
        , RankNTypes
        , ScopedTypeVariables
        , TemplateHaskell
        , TypeApplications
        , TypeOperators
        , TypeFamilies

    if flag(WithPolysemy)
        ghc-options: -fplugin=Polysemy.Plugin
        build-depends: polysemy-plugin


library
    import: shared-properties
    default-language: Haskell2010
    -- for the .chs => c2hs
    -- apparently this just helps getting a better error messages
    Includes:
        tcp_states.h
      -- , linux/sock_diag.h
      -- , linux/inet_diag.h
      -- , linux/mptcp.h
      , linux/mptcp_v0.h
      -- , linux/mptcp_v1.h
      -- linux_latest.dev
      -- pass it via --extra-include-dirs=/nix/store/0l32krcbak7jw4lkwysmsg52k3m0dlm9-linux-5.15.7-dev/lib/modules/5.15.7/source/include/uapi
      -- , linux/mptcp.h
    -- TODO try to pass it from CLI instead , Net.TcpInfo
    include-dirs:
      headers
    default-extensions:
      DeriveGeneric
    -- autogen-modules:
    --     Net.Tcp.Constants
    --   , Net.Mptcp.Constants
    --   , Net.SockDiag.Constants
    build-depends:
        base >= 4.12
      , containers
      , mptcp
      , lens
      , readable
      , bytestring
      , process
      , cereal
      , enumset
      , ip >= 1.7.3
      , bytestring-conversion
      , text
      -- todo get rid of it
      -- for liftIO
      , mtl
      -- for merge
      , aeson
      , aeson-pretty
      , aeson-extra
      -- to help with merging json content
      , unordered-containers
      -- to create temp folder/files
      , transformers
    hs-source-dirs:
      src/
    build-tool-depends:
      c2hs:c2hs
    Exposed-Modules:
        Net.SockDiag
      , Net.Bitset
      , Net.Tcp.Constants
      , Net.Mptcp.Types
      , Net.Mptcp.Utils
      , Net.Mptcp.Constants
      , Net.Mptcp.Netlink
      -- , Net.Mptcp.Fork.Constants
      -- , Net.Mptcp.Fork.Commands
      , Net.Mptcp.Upstream.Constants
      , Net.Mptcp.Upstream.Commands
      -- , Net.Mptcp.PathManager.Fork.NdiffPorts
      , Net.Mptcp.PathManager.Upstream.NdiffPorts
      -- Now implemented in Net.Mptcp.PathManager.V1.NdiffPorts, remerge later ?
      -- , Net.Mptcp.PathManager.Default
      , Net.Mptcp.PathManager
      , Net.IPAddress
      , Net.SockDiag.Constants
      , Netlink.Route
      -- TODO let it high level
    if flag(CwndCapping)
      cpp-options: -DEXPERIMENTAL_CWND=1

    ghc-options:
      -Werror=missing-home-modules

-- monitor new mptcp connections
-- and delegate the behavior to a monitor
executable mptcp-pm
    import: shared-properties
    default-language: Haskell2010
    build-depends:
        aeson
      , aeson-pretty
      , aeson-extra
      , base >= 4.12 && < 4.17
      , bytestring
      , containers
      , lens
      , mptcp
      , mptcp-pm
      , optparse-applicative
      , transformers
      , ip
      , text
      , mtl
      , cereal
      , process
      , temporary
      , filepath
      , pretty-simple
      -- to use Simple module. Try to do without
      , netlink >= 1.1.1.0
    default-extensions: DeriveGeneric
    main-is: Main.hs
    hs-source-dirs: src/app
    ghc-options: -threaded -rtsopts


Test-Suite test-tcp
  -- 2 types supported, exitcode is based on ... exit codes ....
  type:               exitcode-stdio-1.0
  default-language:   Haskell2010
  main-is:            Main.hs
  hs-source-dirs:     test
  ghc-options:        -threaded -rtsopts
  build-depends:
      base >=4.12
    , HUnit
    , mptcp
    , mptcp-pm
    , ip, text