72 lines
1.7 KiB
HTML
72 lines
1.7 KiB
HTML
<HTML>
|
|
<HEAD>
|
|
<TITLE>oneC_sum(3)</TITLE>
|
|
</HEAD>
|
|
<BODY>
|
|
<H1>oneC_sum(3)</H1>
|
|
<HR>
|
|
<PRE>
|
|
|
|
</PRE>
|
|
<H2>NAME</H2><PRE>
|
|
oneC_sum - One's complement internet checksum
|
|
|
|
|
|
</PRE>
|
|
<H2>SYNOPSIS</H2><PRE>
|
|
<STRONG>#define</STRONG> <STRONG>_MINIX_SOURCE</STRONG> <STRONG>1</STRONG>
|
|
<STRONG>#include</STRONG> <STRONG><stddef.h></STRONG>
|
|
<STRONG>#include</STRONG> <STRONG><sys/types.h></STRONG>
|
|
|
|
<STRONG>#include</STRONG> <STRONG><net/gen/oneCsum.h></STRONG>
|
|
|
|
<STRONG>u16_t</STRONG> <STRONG>oneC_sum(u16_t</STRONG> <EM>prev</EM><STRONG>,</STRONG> <STRONG>u16_t</STRONG> <STRONG>*</STRONG><EM>data</EM><STRONG>,</STRONG> <STRONG>size_t</STRONG> <EM>size</EM><STRONG>)</STRONG>
|
|
|
|
|
|
</PRE>
|
|
<H2>DESCRIPTION</H2><PRE>
|
|
<STRONG>OneC_sum</STRONG> is used to calculate the one's complement checksum needed for IP
|
|
network packets. A good document about the Internet Checksum is RFC-1071
|
|
(Computing the Internet checksum).
|
|
|
|
<STRONG>One_Csum</STRONG> expects three parameters:
|
|
|
|
<EM>prev</EM> The checksum of previous blocks of data that are to be included
|
|
in the checksum. The value of prev in first call to oneC_sum
|
|
should be 0.
|
|
|
|
<EM>data</EM> A pointer to the block of data. The data is interpreted as a
|
|
series of 16 bit numbers in network byte order, but an odd
|
|
number of bytes is also allowed.
|
|
|
|
<EM>size</EM> The size of the data in bytes.
|
|
|
|
|
|
</PRE>
|
|
<H2>SEE ALSO</H2><PRE>
|
|
<STRONG><A HREF="../man4/ip.4.html">ip(4)</A></STRONG>.
|
|
<STRONG>RFC</STRONG>-<STRONG>1071</STRONG>
|
|
|
|
|
|
</PRE>
|
|
<H2>AUTHOR</H2><PRE>
|
|
Philip Homburg (philip@cs.vu.nl)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</PRE>
|
|
</BODY>
|
|
</HTML>
|