Safe Haskell | None |
---|---|
Language | Haskell98 |
- type FragmentationTable addr = Map (Ident, addr, addr) Fragments
- emptyFragmentationTable :: FragmentationTable IP4
- data Fragments = Fragments {}
- data Fragment = Fragment {}
- fragmentEnd :: Fragment -> Int
- comesBefore :: Fragment -> Fragment -> Bool
- comesAfter :: Fragment -> Fragment -> Bool
- combineFragments :: Fragment -> Fragment -> Fragment
- expandGroup :: Fragments -> Fragment -> Int -> Fragments
- addFragment :: Fragment -> [Fragment] -> [Fragment]
- processFragment :: Address addr => POSIXTime -> FragmentationTable addr -> Bool -> Int -> addr -> addr -> Ident -> ByteString -> (FragmentationTable addr, Maybe ByteString)
- processIP4Packet :: POSIXTime -> FragmentationTable IP4 -> IP4Header -> ByteString -> (FragmentationTable IP4, Maybe ByteString)
Documentation
type FragmentationTable addr = Map (Ident, addr, addr) Fragments Source
Fragment | |
|
fragmentEnd :: Fragment -> Int Source
The end of a fragment.
comesBefore :: Fragment -> Fragment -> Bool Source
Check the ordering of two fragments.
comesAfter :: Fragment -> Fragment -> Bool Source
Check the ordering of two fragments.
combineFragments :: Fragment -> Fragment -> Fragment Source
Merge two fragments.
Note: This doesn't do a validity check to make sure that they're actually adjacent.
expandGroup :: Fragments -> Fragment -> Int -> Fragments Source
Given a group of fragments, a new fragment, and a possible total size, create a new group of fragments that incorporates the new fragment.
addFragment :: Fragment -> [Fragment] -> [Fragment] Source
Add a fragment to a list of fragments, in a position that is relative to its offset and length.
processFragment :: Address addr => POSIXTime -> FragmentationTable addr -> Bool -> Int -> addr -> addr -> Ident -> ByteString -> (FragmentationTable addr, Maybe ByteString) Source
Process a packet fragment through the system, potentially returning a fully-processed packet if this fragment completes an existing packet or is itself a fully-complete packet.
processIP4Packet :: POSIXTime -> FragmentationTable IP4 -> IP4Header -> ByteString -> (FragmentationTable IP4, Maybe ByteString) Source