Rev | Line | |
---|
[9] | 1 | .TH ONEC_SUM 3
|
---|
| 2 | .SH NAME
|
---|
| 3 | oneC_sum \- One's complement internet checksum
|
---|
| 4 | .SH SYNOPSIS
|
---|
| 5 | .ft B
|
---|
| 6 | .nf
|
---|
| 7 | #define _MINIX_SOURCE 1
|
---|
| 8 | #include <stddef.h>
|
---|
| 9 | #include <sys/types.h>
|
---|
| 10 |
|
---|
| 11 | #include <net/gen/oneCsum.h>
|
---|
| 12 |
|
---|
| 13 | u16_t oneC_sum(u16_t \fIprev\fP, void *\fIdata\fP, size_t \fIsize\fP)
|
---|
| 14 | .fi
|
---|
| 15 | .ft R
|
---|
| 16 | .SH DESCRIPTION
|
---|
| 17 | .B OneC_sum
|
---|
| 18 | is used to calculate the one's complement checksum needed for IP network
|
---|
| 19 | packets.
|
---|
| 20 | A good document about the Internet Checksum is RFC-1071 (Computing the
|
---|
| 21 | Internet checksum).
|
---|
| 22 | .PP
|
---|
| 23 | .B OneC_sum
|
---|
| 24 | expects three parameters:
|
---|
| 25 | .TP 10
|
---|
| 26 | .I prev
|
---|
| 27 | The checksum of previous blocks of data that are to be included in the
|
---|
| 28 | checksum.
|
---|
| 29 | The value of prev in first call to oneC_sum should be 0.
|
---|
| 30 | .TP
|
---|
| 31 | .I data
|
---|
| 32 | A pointer to the block of data.
|
---|
| 33 | The data is interpreted as a series of 16 bit numbers in network byte order, but
|
---|
| 34 | an odd number of bytes is also allowed.
|
---|
| 35 | .TP
|
---|
| 36 | .I size
|
---|
| 37 | The size of the data in bytes.
|
---|
| 38 | .SH "SEE ALSO"
|
---|
| 39 | .BR ip (4).
|
---|
| 40 | .br
|
---|
| 41 | .B RFC-1071
|
---|
| 42 | .SH AUTHOR
|
---|
| 43 | Philip Homburg (philip@cs.vu.nl)
|
---|
| 44 | .\"
|
---|
| 45 | .\" $PchId: oneC_sum.3,v 1.3 1996/02/22 21:05:31 philip Exp $
|
---|
Note:
See
TracBrowser
for help on using the repository browser.