Changeset 19d9fde1 in rtems-libbsd
- Timestamp:
- 12/15/21 15:11:22 (5 months ago)
- Branches:
- master
- Children:
- 0b883f3
- Parents:
- 9d65f34
- git-author:
- Kinsey Moore <kinsey.moore@…> (12/15/21 15:11:22)
- git-committer:
- Joel Sherrill <joel@…> (12/16/21 14:53:26)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
freebsd/sys/arm64/include/machine/in_cksum.h
r9d65f34 r19d9fde1 1 1 /*- 2 * SPDX-License-Identifier: BSD-3-Clause3 *4 2 * Copyright (c) 1990 The Regents of the University of California. 5 3 * All rights reserved. … … 32 30 * from: @(#)in_cksum.c 1.3 (Berkeley) 1/19/91 33 31 * from: Id: in_cksum.c,v 1.8 1995/12/03 18:35:19 bde Exp 34 * from: src/sys/alpha/include/in_cksum.h,v 1.7 2005/03/02 21:33:20 joerg35 32 * $FreeBSD$ 36 33 */ … … 41 38 #include <sys/cdefs.h> 42 39 40 #ifdef _KERNEL 43 41 #define in_cksum(m, len) in_cksum_skip(m, len, 0) 44 42 u_short in_addword(u_short sum, u_short b); 43 u_short in_cksum_skip(struct mbuf *m, int len, int skip); 44 u_int do_cksum(const void *, int); 45 45 #if defined(IPVERSION) && (IPVERSION == 4) 46 /* 47 * It it useful to have an Internet checksum routine which is inlineable 48 * and optimized specifically for the task of computing IP header checksums 49 * in the normal case (where there are no options and the header length is 50 * therefore always exactly five 32-bit words. 51 */ 52 #ifdef __CC_SUPPORTS___INLINE 53 54 static __inline void 55 in_cksum_update(struct ip *ip) 56 { 57 int __tmpsum; 58 __tmpsum = (int)ntohs(ip->ip_sum) + 256; 59 ip->ip_sum = htons(__tmpsum + (__tmpsum >> 16)); 60 } 61 62 #else 63 64 #define in_cksum_update(ip) \ 65 do { \ 66 int __tmpsum; \ 67 __tmpsum = (int)ntohs(ip->ip_sum) + 256; \ 68 ip->ip_sum = htons(__tmpsum + (__tmpsum >> 16)); \ 69 } while(0) 70 71 #endif 46 u_int in_cksum_hdr(const struct ip *); 72 47 #endif 73 48 74 #ifdef _KERNEL75 #if defined(IPVERSION) && (IPVERSION == 4)76 u_int in_cksum_hdr(const struct ip *ip);77 #endif78 u_short in_addword(u_short sum, u_short b);79 49 u_short in_pseudo(u_int sum, u_int b, u_int c); 80 u_short in_cksum_skip(struct mbuf *m, int len, int skip);81 #endif82 50 51 #endif /* _KERNEL */ 83 52 #endif /* _MACHINE_IN_CKSUM_H_ */
Note: See TracChangeset
for help on using the changeset viewer.