Merge commit '9276b3991ba20d5a5660887ba81b0bc7bed25a0c'
[unleashed.git] / share / man / man9f / net_isvalidchecksum.9f
blob582fee53ce972dd50b5175a167fe12725d04f159
1 '\" te
2 .\" Copyright (C) 2008, Sun Microsystems, Inc. All Rights Reserved.
3 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
4 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
5 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
6 .TH NET_ISVALIDCHECKSUM 9F "May 1, 2008"
7 .SH NAME
8 net_isvalidchecksum \- verify layer 3 and layer 4  checksums
9 .SH SYNOPSIS
10 .LP
11 .nf
12 #include <sys/neti.h>
14 \fBint\fR \fBnet_isvalidchecksum\fR(\fBconst\fR \fBnet_data_t\fR \fInet\fR, \fBmblk_t\fR *\fImb\fR);
15 .fi
17 .SH INTERFACE LEVEL
18 .sp
19 .LP
20 Solaris DDI specific (Solaris DDI).
21 .SH PARAMETERS
22 .sp
23 .ne 2
24 .na
25 \fB\fInet\fR\fR
26 .ad
27 .RS 7n
28 value returned from a successful call to \fBnet_protocol_lookup\fR(9F).
29 .RE
31 .sp
32 .ne 2
33 .na
34 \fB\fImb\fR\fR
35 .ad
36 .RS 6n
37 the \fBmblk\fR structure holding a packet that is the subject of this query.
38 .RE
40 .SH DESCRIPTION
41 .sp
42 .LP
43 The \fBnet_isvalidchecksum()\fR function verifies the layer 3 checksum (and, in
44 some case, the layer 4 checksum) in the packet. If possible, fields that are
45 used by hardware checksum'ing are examined rather than  manually verifying that
46 the checksums are present for packets received from a network interface.
47 .sp
48 .LP
49 For both \fBIPv4\fR and \fBIPv6\fR, \fBTCP\fR, \fBUDP\fR and \fBICMP\fR
50 (including \fBICMPV6\fR for \fBIPv6\fR) layer 4 checksums are currently
51 validated.
52 .SH RETURN VALUES
53 .sp
54 .LP
55 The \fBnet_isvalidchecksum()\fR function returns:
56 .sp
57 .ne 2
58 .na
59 \fB-1\fR
60 .ad
61 .RS 6n
62 The network protocol does not support this function.
63 .RE
65 .sp
66 .ne 2
67 .na
68 \fB0\fR
69 .ad
70 .RS 6n
71 The packet does not contain partial checksums.
72 .RE
74 .sp
75 .ne 2
76 .na
77 \fB1\fR
78 .ad
79 .RS 6n
80 The packet does contain partial checksums.
81 .RE
83 .SH CONTEXT
84 .sp
85 .LP
86 The \fBnet_isvalidchecksum()\fR function may be called from user,  kernel, or
87 interrupt context.
88 .SH ATTRIBUTES
89 .sp
90 .LP
91 See \fBattributes\fR(5) for descriptions of the following attributes:
92 .sp
94 .sp
95 .TS
96 box;
97 c | c
98 l | l .
99 ATTRIBUTE TYPE  ATTRIBUTE VALUE
101 Interface Stability     Committed
104 .SH SEE ALSO
107 \fBnet_ispartialchecksum\fR(9F), \fBnet_protocol_lookup\fR(9F),
108 \fBattributes\fR(5)