Safe Haskell | None |
---|---|
Language | Haskell2010 |
- type DeviceName = ByteString
- data ChecksumOffload = ChecksumOffload {}
- defaultChecksumOffload :: ChecksumOffload
- data DeviceConfig = DeviceConfig {
- dcSendQueueLen :: !Int
- dcTxOffload :: !ChecksumOffload
- dcRxOffload :: !ChecksumOffload
- dcMtu :: !Int
- class HasDeviceConfig cfg where
- txOffload :: HasDeviceConfig cfg => Getting r cfg ChecksumOffload
- rxOffload :: HasDeviceConfig cfg => Getting r cfg ChecksumOffload
- defaultDeviceConfig :: DeviceConfig
- data Device = Device {
- devName :: !DeviceName
- devMac :: !Mac
- devConfig :: !DeviceConfig
- devSendQueue :: !(BoundedChan ByteString)
- devStart :: !(IO ())
- devStop :: !(IO ())
- devCleanup :: !(IO ())
- devStats :: !DeviceStats
- data DeviceException = FailedToOpen !DeviceName
- type Stat = IORef Int
- incrementStat :: Stat -> IO ()
- addStat :: Stat -> Int -> IO ()
- data StatGroup = StatGroup {
- _statBytes :: !Stat
- _statPackets :: !Stat
- _statErrors :: !Stat
- _statDropped :: !Stat
- statBytes :: Getting r StatGroup Stat
- statPackets :: Getting r StatGroup Stat
- statErrors :: Getting r StatGroup Stat
- statDropped :: Getting r StatGroup Stat
- newStatGroup :: IO StatGroup
- dumpStatGroup :: String -> StatGroup -> IO ()
- data DeviceStats = DeviceStats {}
- statTX :: Getting r DeviceStats StatGroup
- statRX :: Getting r DeviceStats StatGroup
- newDeviceStats :: IO DeviceStats
- dumpStats :: DeviceStats -> IO ()
- updateDropped :: Getting Stat DeviceStats StatGroup -> DeviceStats -> IO ()
- updateError :: Getting Stat DeviceStats StatGroup -> DeviceStats -> IO ()
- updateBytes :: Getting Stat DeviceStats StatGroup -> DeviceStats -> Int -> IO ()
- updatePackets :: Getting Stat DeviceStats StatGroup -> DeviceStats -> IO ()
Documentation
type DeviceName = ByteString Source #
data ChecksumOffload Source #
data DeviceConfig Source #
Static configuration data for creating a device.
DeviceConfig | |
|
class HasDeviceConfig cfg where Source #
deviceConfig :: Getting r cfg DeviceConfig Source #
txOffload :: HasDeviceConfig cfg => Getting r cfg ChecksumOffload Source #
The TX checksum offload config.
rxOffload :: HasDeviceConfig cfg => Getting r cfg ChecksumOffload Source #
The RX checksum offload config.
Device | |
|
data DeviceException Source #
incrementStat :: Stat -> IO () Source #
StatGroup | |
|
dumpStats :: DeviceStats -> IO () Source #
updateDropped :: Getting Stat DeviceStats StatGroup -> DeviceStats -> IO () Source #
Add one to the count of dropped packets for this device.
updateError :: Getting Stat DeviceStats StatGroup -> DeviceStats -> IO () Source #
Add one to the error count for this device.
updateBytes :: Getting Stat DeviceStats StatGroup -> DeviceStats -> Int -> IO () Source #
Update information about bytes received.
updatePackets :: Getting Stat DeviceStats StatGroup -> DeviceStats -> IO () Source #
Update information about bytes received.