module Hans.Config (
Config(..),
defaultConfig,
HasConfig(..),
) where
import Hans.Lens
import Data.Time.Clock (NominalDiffTime)
import Data.Word (Word8)
data Config = Config { cfgInputQueueSize :: !Int
, cfgArpTableSize :: !Int
, cfgArpTableLifetime :: !NominalDiffTime
, cfgArpRetry :: !Int
, cfgArpRetryDelay :: !Int
, cfgIP4FragTimeout :: !NominalDiffTime
, cfgIP4InitialTTL :: !Word8
, cfgIP4MaxFragTableEntries :: !Int
, cfgUdpSocketTableSize :: !Int
, cfgDnsResolveTimeout :: !Int
, cfgTcpListenTableSize :: !Int
, cfgTcpActiveTableSize :: !Int
, cfgTcpTimeoutTimeWait :: !NominalDiffTime
, cfgTcpInitialMSS :: !Int
, cfgTcpMaxSynBacklog :: !Int
, cfgTcpInitialWindow :: !Int
, cfgTcpMSL :: !Int
, cfgTcpTSClockFrequency :: !NominalDiffTime
, cfgTcpTimeWaitSocketLimit :: !Int
, cfgNatMaxEntries :: !Int
}
defaultConfig :: Config
defaultConfig = Config { cfgInputQueueSize = 128
, cfgArpTableSize = 67
, cfgArpTableLifetime = 60
, cfgArpRetry = 10
, cfgArpRetryDelay = 2000
, cfgIP4FragTimeout = 30
, cfgIP4InitialTTL = 128
, cfgIP4MaxFragTableEntries= 32
, cfgUdpSocketTableSize = 31
, cfgDnsResolveTimeout = 5000000
, cfgTcpListenTableSize = 5
, cfgTcpActiveTableSize = 67
, cfgTcpTimeoutTimeWait = 60.0
, cfgTcpInitialMSS = 1380
, cfgTcpMaxSynBacklog = 128
, cfgTcpInitialWindow = 14600
, cfgTcpMSL = 60
, cfgTcpTSClockFrequency = 1000
, cfgTcpTimeWaitSocketLimit = 70
, cfgNatMaxEntries = 200
}
class HasConfig cfg where
config :: Getting r cfg Config
instance HasConfig Config where
config = id