network-data-0.2.0: Library for network data structures (ex: ip/udp/tcp headers and helper functions)




class (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.