SatCat5
eth_checksum.h File Reference

Detailed Description

Inline Ethernet Checksum insertion and verification.

Every Ethernet frame contains a "Frame Check Sequence" (FCS). In many cases, the FCS is automatically added or removed by drivers, by hardware logic, etc., so that it does not need to be handled in software. (This includes SatCat5 HDL blocks such as port_mailbox and port_mailmap.)

The blocks below are provided for cases that do not provide this service. Each is implemented as an inline layer using Readable/Writeable streams.

  • eth::ChecksumTx appends an FCS to each outgoing frame.
  • eth::ChecksumRx checks the FCS of each incoming frame and calls either write_finalize() or write_abort() appropriately.
  • eth::SlipCodec combines both of the above PLUS a SLIP encoder and decoder. This makes it easy to send and receive SLIP-encoded Ethernet frames over an SPI or UART port, for example.

Definition in file eth_checksum.h.

Include dependency graph for eth_checksum.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  satcat5::eth::ChecksumTx
 Append FCS to each outgoing frame. More...
 
class  satcat5::eth::ChecksumRx
 Check and remove FCS from each incoming frame. More...
 
class  satcat5::eth::SlipCodec
 Buffered SLIP encoder / decoder pair with Ethernet FCS. More...
 
class  satcat5::eth::SlipCodecInverse
 Inverted SLIP encoder / decoder pair with Ethernet FCS. More...
 

Functions

u32 satcat5::eth::crc32 (unsigned nbytes, const void *data)
 Directly calculate CRC32 on a block of data.
 
u32 satcat5::eth::crc32 (satcat5::io::Readable *src)
 Read data from source and calculate CRC32.