/* checksum.h: IP/UDP/TCP checksum routines on the V9. * *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 user space while it *checksums * *hereevenmoreimportanttoalignsrcanddstona32-bit(oreven *better64-bit)boundary
*/
__wsum csum_partial_copy_nocheck(constvoid *src, void *dst, int len);
__wsum csum_and_copy_from_user(constvoid __user *src, void *dst, int len);
__wsum csum_and_copy_to_user(constvoid *src, void __user *dst, int len);
/* ihl is always 5 or greater, almost always is 5, and iph is word aligned *themajorityofthetime.
*/
__sum16 ip_fast_csum(constvoid *iph, unsignedint ihl);
/* Fold a partial checksum without adding pseudo headers. */ staticinline __sum16 csum_fold(__wsum sum)
{ unsignedint tmp;
/* 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.