packages feed

hans-2.1.0.0: hans.cabal

name:           hans
version:        2.1.0.0
cabal-version:  >= 1.8
license:        BSD3
license-file:   LICENSE
author:         Galois Inc., Peng Li, Stephan Zdancewic
maintainer:     halvm-devel@community.galois.com
category:       Networking
synopsis:       IPv4 Network Stack
build-type:     Simple
description:
  HaNS is a lightweight, pure Haskell network stack that can be used for Haskell
  networking in the context of the HaLVM, or with a Linux tap device. Currently,
  HaNS supports 802.3, IPv4, ARP, DHCP (partially), ICMP, UDP, and TCP.

source-repository head
        type:           git
        location:       git://src.galois.com/srv/git/HaNS.git

flag bounded-channels
        default:        False
        description:    Use bounded channels for message passing

flag example
        default:        False
        description:    Build the example program

flag halvm
        default:        False
        description:    Build for the HaLVM

library
        if(flag(halvm))
                build-depends:          XenDevice, communication
                exposed-modules:        Hans.Device.Xen,
                                        Hans.Device.Ivc
        else
                build-depends:          unix
                include-dirs:           cbits
                c-sources:              cbits/tapdevice.c
                exposed-modules:        Hans.Device.Tap

        if flag(bounded-channels)
                build-depends:  BoundedChan
                cpp-options:    -DBOUNDED_CHANNELS

        ghc-options:            -Wall
        hs-source-dirs:         src
        build-depends:          base       == 4.*,
                                cereal     == 0.3.*,
                                bytestring == 0.9.1.*,
                                containers >= 0.4.0.0 && < 0.5.0.0,
                                monadLib   == 3.6.*,
                                time       >= 1.2.0.0 && < 1.3.0.0,
                                fingertree == 0.0.1.*,
                                random     == 1.0.0.*
        exposed-modules:        Data.PrefixTree,
                                Hans.Address,
                                Hans.Utils.Checksum,
                                Hans.Layer,
                                Hans.Ports,
                                Hans.Setup,
                                Hans.Utils,
                                Hans.Channel,
                                Hans.DhcpClient,
                                Hans.Simple,
                                Hans.Layer.Tcp,
                                Hans.Layer.Arp.Table,
                                Hans.Layer.Tcp.Handlers,
                                Hans.Layer.Tcp.Monad,
                                Hans.Layer.Tcp.Socket,
                                Hans.Layer.IP4,
                                Hans.Layer.Udp,
                                Hans.Layer.Arp,
                                Hans.Layer.IP4.Routing,
                                Hans.Layer.IP4.Fragmentation,
                                Hans.Layer.Timer,
                                Hans.Layer.Ethernet,
                                Hans.Layer.Icmp4,
                                Hans.Message.Tcp,
                                Hans.Message.Types,
                                Hans.Message.Udp,
                                Hans.Message.Ip4,
                                Hans.Message.EthernetFrame,
                                Hans.Message.Arp,
                                Hans.Message.Dhcp4Codec,
                                Hans.Message.Dhcp4,
                                Hans.Message.Dhcp4Options,
                                Hans.Message.Icmp4,
                                Hans.Address.Mac,
                                Hans.Address.IP4,
                                Network.TCP.Aux.SockMonad,
                                Network.TCP.Aux.Param,
                                Network.TCP.Aux.Misc,
                                Network.TCP.Aux.Output,
                                Network.TCP.LTS.User,
                                Network.TCP.LTS.Out,
                                Network.TCP.LTS.InPassive,
                                Network.TCP.LTS.InActive,
                                Network.TCP.LTS.InMisc,
                                Network.TCP.LTS.In,
                                Network.TCP.LTS.InData,
                                Network.TCP.Type.Socket,
                                Network.TCP.Type.Syscall,
                                Network.TCP.Type.Datagram,
                                Network.TCP.Type.Base,
                                Network.TCP.Type.Timer

executable test
        if flag(example)
                buildable:      True
        else
                buildable:      False

        if(flag(bounded-channels))
                build-depends:  BoundedChan
                cpp-options:    -DBOUNDED_CHANNELS

        main-is:        test.hs
        other-modules:  WebServer
        ghc-options:    -Wall
        hs-source-dirs: example
        build-depends:  base          == 4.*,
                        cereal        == 0.3.0.*,
                        bytestring    == 0.9.1.*,
                        containers    >= 0.4.0.0 && < 0.5.0.0,
                        monadLib      == 3.6.*,
                        time          >= 1.2.0.0 && < 1.3.0.0,
                        old-locale    == 1.0.0.*,
                        hans

        if flag(halvm)
                build-depends:      XenDevice     == 1.0.0,
                                    RendezvousLib == 1.0.0,
                                    HALVMCore     == 1.0.0,
                                    communication == 1.0.0
        else
                ghc-options: -threaded