Safe Haskell | None |
---|---|
Language | Haskell98 |
- class (Eq c, Num c, Serialize h) => L3Header h a c | h -> a, a -> h, h -> c where
- getChecksum :: h -> c
- setChecksum :: h -> c -> h
- src :: h -> a
- dst :: h -> a
- zeroChecksum :: h -> h
- computeChecksum :: h -> c
- fillChecksum :: h -> h
- pseudoHeader :: h -> ByteString
- valid :: h -> Bool
- class Serialize a => L3Address a h | a -> h, h -> a where
- localBroadcast :: a -> a
- globalBroadcast :: a
Documentation
class (Eq c, Num c, Serialize h) => L3Header h a c | h -> a, a -> h, h -> c where Source
A class of network headers that assumes a checksum is present.
getChecksum :: h -> c Source
Returns the checksum from the header
setChecksum :: h -> c -> h Source
Sets the checksum in the header
Returns a source
for the header.
Returns a destination
for the header.
zeroChecksum :: h -> h Source
Returns a header with all the same fields except the checksum is zeroed
computeChecksum :: h -> c Source
Computes the checksum
fillChecksum :: h -> h Source
Computes the checksum, returns a header with the proper checksum
pseudoHeader :: h -> ByteString Source
Used by various layer 4 protocols (UDP, TCP), a pseudo header is needed to compute the checksum
Returns True iff the checksum is valid
class Serialize a => L3Address a h | a -> h, h -> a where Source
A class of network addresses that assumes there is a broadcast
concept.
localBroadcast :: a -> a Source
globalBroadcast :: a Source