network-data-0.5.2: Library for network data structures and their serialization.

Safe HaskellNone




class (Eq c, Num c, Serialize h) => L3Header h a c | h -> a, a -> h, h -> c whereSource

A class of network headers that assumes a checksum is present.


getChecksum :: h -> cSource

Returns the checksum from the header

setChecksum :: h -> c -> hSource

Sets the checksum in the header

src :: h -> aSource

Returns a source for the header.

dst :: h -> aSource

Returns a destination for the header.

zeroChecksum :: h -> hSource

Returns a header with all the same fields except the checksum is zeroed

computeChecksum :: h -> cSource

Computes the checksum

fillChecksum :: h -> hSource

Computes the checksum, returns a header with the proper checksum

pseudoHeader :: h -> ByteStringSource

Used by various layer 4 protocols (UDP, TCP), a pseudo header is needed to compute the checksum

valid :: h -> BoolSource

Returns True iff the checksum is valid

class Serialize a => L3Address a h | a -> h, h -> a whereSource

A class of network addresses that assumes there is a broadcast concept.