xref: /freebsd/sys/amd64/include/in_cksum.h (revision 29363fb446372cb3f10bc98664e9767c53fbb457)
11ebcad57SDoug Rabson /*-
2*51369649SPedro F. Giffuni  * SPDX-License-Identifier: BSD-3-Clause
3*51369649SPedro F. Giffuni  *
41ebcad57SDoug Rabson  * Copyright (c) 1990 The Regents of the University of California.
51ebcad57SDoug Rabson  * All rights reserved.
61ebcad57SDoug Rabson  *
71ebcad57SDoug Rabson  * Redistribution and use in source and binary forms, with or without
81ebcad57SDoug Rabson  * modification, are permitted provided that the following conditions
91ebcad57SDoug Rabson  * are met:
101ebcad57SDoug Rabson  * 1. Redistributions of source code must retain the above copyright
111ebcad57SDoug Rabson  *    notice, this list of conditions and the following disclaimer.
121ebcad57SDoug Rabson  * 2. Redistributions in binary form must reproduce the above copyright
131ebcad57SDoug Rabson  *    notice, this list of conditions and the following disclaimer in the
141ebcad57SDoug Rabson  *    documentation and/or other materials provided with the distribution.
15fc8c8560SEd Maste  * 3. Neither the name of the University nor the names of its contributors
161ebcad57SDoug Rabson  *    may be used to endorse or promote products derived from this software
171ebcad57SDoug Rabson  *    without specific prior written permission.
181ebcad57SDoug Rabson  *
191ebcad57SDoug Rabson  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
201ebcad57SDoug Rabson  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
211ebcad57SDoug Rabson  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
221ebcad57SDoug Rabson  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
231ebcad57SDoug Rabson  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
241ebcad57SDoug Rabson  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
251ebcad57SDoug Rabson  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
261ebcad57SDoug Rabson  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
271ebcad57SDoug Rabson  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
281ebcad57SDoug Rabson  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
291ebcad57SDoug Rabson  * SUCH DAMAGE.
301ebcad57SDoug Rabson  *
311ebcad57SDoug Rabson  *	from tahoe:	in_cksum.c	1.2	86/01/05
321ebcad57SDoug Rabson  *	from: Id: in_cksum.c,v 1.8 1995/12/03 18:35:19 bde Exp
331ebcad57SDoug Rabson  */
341ebcad57SDoug Rabson 
351ebcad57SDoug Rabson #ifndef _MACHINE_IN_CKSUM_H_
361ebcad57SDoug Rabson #define	_MACHINE_IN_CKSUM_H_	1
371ebcad57SDoug Rabson 
381ebcad57SDoug Rabson #define in_cksum(m, len)	in_cksum_skip(m, len, 0)
391ebcad57SDoug Rabson 
401ebcad57SDoug Rabson #ifdef _KERNEL
41920b9658SBjoern A. Zeeb #if defined(IPVERSION) && (IPVERSION == 4)
421ebcad57SDoug Rabson u_int in_cksum_hdr(const struct ip *ip);
43920b9658SBjoern A. Zeeb #endif
441ebcad57SDoug Rabson u_short	in_addword(u_short sum, u_short b);
451ebcad57SDoug Rabson u_short	in_pseudo(u_int sum, u_int b, u_int c);
461ebcad57SDoug Rabson u_short	in_cksum_skip(struct mbuf *m, int len, int skip);
471ebcad57SDoug Rabson #endif
481ebcad57SDoug Rabson 
491ebcad57SDoug Rabson #endif /* _MACHINE_IN_CKSUM_H_ */
50