xref: /freebsd/sys/arm64/include/in_cksum.h (revision 29363fb446372cb3f10bc98664e9767c53fbb457)
1e5acd89cSAndrew Turner /*-
2e5acd89cSAndrew Turner  * Copyright (c) 1990 The Regents of the University of California.
3e5acd89cSAndrew Turner  * All rights reserved.
4e5acd89cSAndrew Turner  *
5e5acd89cSAndrew Turner  * Redistribution and use in source and binary forms, with or without
6e5acd89cSAndrew Turner  * modification, are permitted provided that the following conditions
7e5acd89cSAndrew Turner  * are met:
8e5acd89cSAndrew Turner  * 1. Redistributions of source code must retain the above copyright
9e5acd89cSAndrew Turner  *    notice, this list of conditions and the following disclaimer.
10e5acd89cSAndrew Turner  * 2. Redistributions in binary form must reproduce the above copyright
11e5acd89cSAndrew Turner  *    notice, this list of conditions and the following disclaimer in the
12e5acd89cSAndrew Turner  *    documentation and/or other materials provided with the distribution.
13*fc8c8560SEd Maste  * 3. Neither the name of the University nor the names of its contributors
14e5acd89cSAndrew Turner  *    may be used to endorse or promote products derived from this software
15e5acd89cSAndrew Turner  *    without specific prior written permission.
16e5acd89cSAndrew Turner  *
17e5acd89cSAndrew Turner  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
18e5acd89cSAndrew Turner  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19e5acd89cSAndrew Turner  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20e5acd89cSAndrew Turner  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
21e5acd89cSAndrew Turner  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22e5acd89cSAndrew Turner  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23e5acd89cSAndrew Turner  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24e5acd89cSAndrew Turner  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25e5acd89cSAndrew Turner  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26e5acd89cSAndrew Turner  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27e5acd89cSAndrew Turner  * SUCH DAMAGE.
28e5acd89cSAndrew Turner  *
29e5acd89cSAndrew Turner  *	from tahoe:	in_cksum.c	1.2	86/01/05
30e5acd89cSAndrew Turner  *	from: Id: in_cksum.c,v 1.8 1995/12/03 18:35:19 bde Exp
31e5acd89cSAndrew Turner  */
32e5acd89cSAndrew Turner 
33e5acd89cSAndrew Turner #ifndef _MACHINE_IN_CKSUM_H_
34e5acd89cSAndrew Turner #define	_MACHINE_IN_CKSUM_H_	1
35e5acd89cSAndrew Turner 
36e5acd89cSAndrew Turner #ifdef _KERNEL
37e5acd89cSAndrew Turner #define	in_cksum(m, len)	in_cksum_skip(m, len, 0)
38e5acd89cSAndrew Turner u_short in_addword(u_short sum, u_short b);
39e5acd89cSAndrew Turner u_short in_cksum_skip(struct mbuf *m, int len, int skip);
40e5acd89cSAndrew Turner u_int do_cksum(const void *, int);
41e5acd89cSAndrew Turner #if defined(IPVERSION) && (IPVERSION == 4)
42e5acd89cSAndrew Turner u_int in_cksum_hdr(const struct ip *);
43e5acd89cSAndrew Turner #endif
44e5acd89cSAndrew Turner 
45e5acd89cSAndrew Turner u_short in_pseudo(u_int sum, u_int b, u_int c);
46e5acd89cSAndrew Turner 
47e5acd89cSAndrew Turner #endif /* _KERNEL */
48e5acd89cSAndrew Turner #endif /* _MACHINE_IN_CKSUM_H_ */
49