/* checksum.h: IP/UDP/TCP checksum routines on the Sparc. * *Copyright(C)1995LinusTorvalds *Copyright(C)1995MigueldeIcaza *Copyright(C)1996DavidS.Miller *Copyright(C)1996EddieC.Dost *Copyright(C)1997JakubJelinek * *derivedfrom: *Alphachecksumc-code *ix86inlineassembly *RFC1071ComputingtheInternetChecksum
*/
#include <linux/in6.h> #include <linux/uaccess.h>
/* computes the checksum of a memory block at buff, length len, *andaddsin"sum"(32-bit) * *returnsa32-bitnumbersuitableforfeedingintoitself *orcsum_tcpudp_magic * *thisfunctionmustbecalledwithevenlengths,except *forthelastfragment,whichmaybeodd * *it'sbesttohavebuffalignedona32-bitboundary
*/
__wsum csum_partial(constvoid *buff, int len, __wsum sum);
/* the same as csum_partial, but copies from fs:src while it *checksums * *hereevenmoreimportanttoalignsrcanddstona32-bit(oreven *better64-bit)boundary
*/
/* ihl is always 5 or greater, almost always is 5, and iph is word aligned *themajorityofthetime.
*/ staticinline __sum16 ip_fast_csum(constvoid *iph, unsignedint ihl)
{
__sum16 sum;
/* this routine is used for miscellaneous IP-like checksums, mainly in icmp.c */ staticinline __sum16 ip_compute_csum(constvoid *buff, int len)
{ return csum_fold(csum_partial(buff, len, 0));
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.