diff options
author | fenner <fenner@FreeBSD.org> | 2002-06-21 00:43:23 +0000 |
---|---|---|
committer | fenner <fenner@FreeBSD.org> | 2002-06-21 00:43:23 +0000 |
commit | 91fc581e384bca8ae8831d23b70ab73ab0dc1a21 (patch) | |
tree | 89431945035dbd4a9ce74e63c4a1f65ed4166a1a /contrib/tcpdump/extract.h | |
parent | f815ae37f4671c581fdc1c6f99a8490a6dfbb4f6 (diff) | |
download | FreeBSD-src-91fc581e384bca8ae8831d23b70ab73ab0dc1a21.zip FreeBSD-src-91fc581e384bca8ae8831d23b70ab73ab0dc1a21.tar.gz |
Import tcpdump 3.7.1, from
http://www.tcpdump.org/release/tcpdump-3.7.1.tar.gz
Diffstat (limited to 'contrib/tcpdump/extract.h')
-rw-r--r-- | contrib/tcpdump/extract.h | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/contrib/tcpdump/extract.h b/contrib/tcpdump/extract.h index 9e5bb9b..861f06f 100644 --- a/contrib/tcpdump/extract.h +++ b/contrib/tcpdump/extract.h @@ -18,40 +18,40 @@ * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * @(#) $Header: /tcpdump/master/tcpdump/extract.h,v 1.16 2000/10/03 02:54:55 itojun Exp $ (LBL) + * @(#) $Header: /tcpdump/master/tcpdump/extract.h,v 1.17 2001/09/17 21:57:52 fenner Exp $ (LBL) */ /* Network to host order macros */ #ifdef LBL_ALIGN #define EXTRACT_16BITS(p) \ - ((u_int16_t)*((u_int8_t *)(p) + 0) << 8 | \ - (u_int16_t)*((u_int8_t *)(p) + 1)) + ((u_int16_t)*((const u_int8_t *)(p) + 0) << 8 | \ + (u_int16_t)*((const u_int8_t *)(p) + 1)) #define EXTRACT_32BITS(p) \ - ((u_int32_t)*((u_int8_t *)(p) + 0) << 24 | \ - (u_int32_t)*((u_int8_t *)(p) + 1) << 16 | \ - (u_int32_t)*((u_int8_t *)(p) + 2) << 8 | \ - (u_int32_t)*((u_int8_t *)(p) + 3)) + ((u_int32_t)*((const u_int8_t *)(p) + 0) << 24 | \ + (u_int32_t)*((const u_int8_t *)(p) + 1) << 16 | \ + (u_int32_t)*((const u_int8_t *)(p) + 2) << 8 | \ + (u_int32_t)*((const u_int8_t *)(p) + 3)) #else #define EXTRACT_16BITS(p) \ - ((u_int16_t)ntohs(*(u_int16_t *)(p))) + ((u_int16_t)ntohs(*(const u_int16_t *)(p))) #define EXTRACT_32BITS(p) \ - ((u_int32_t)ntohl(*(u_int32_t *)(p))) + ((u_int32_t)ntohl(*(const u_int32_t *)(p))) #endif #define EXTRACT_24BITS(p) \ - ((u_int32_t)*((u_int8_t *)(p) + 0) << 16 | \ - (u_int32_t)*((u_int8_t *)(p) + 1) << 8 | \ - (u_int32_t)*((u_int8_t *)(p) + 2)) + ((u_int32_t)*((const u_int8_t *)(p) + 0) << 16 | \ + (u_int32_t)*((const u_int8_t *)(p) + 1) << 8 | \ + (u_int32_t)*((const u_int8_t *)(p) + 2)) /* Little endian protocol host order macros */ #define EXTRACT_LE_8BITS(p) (*(p)) #define EXTRACT_LE_16BITS(p) \ - ((u_int16_t)*((u_int8_t *)(p) + 1) << 8 | \ - (u_int16_t)*((u_int8_t *)(p) + 0)) + ((u_int16_t)*((const u_int8_t *)(p) + 1) << 8 | \ + (u_int16_t)*((const u_int8_t *)(p) + 0)) #define EXTRACT_LE_32BITS(p) \ - ((u_int32_t)*((u_int8_t *)(p) + 3) << 24 | \ - (u_int32_t)*((u_int8_t *)(p) + 2) << 16 | \ - (u_int32_t)*((u_int8_t *)(p) + 1) << 8 | \ - (u_int32_t)*((u_int8_t *)(p) + 0)) + ((u_int32_t)*((const u_int8_t *)(p) + 3) << 24 | \ + (u_int32_t)*((const u_int8_t *)(p) + 2) << 16 | \ + (u_int32_t)*((const u_int8_t *)(p) + 1) << 8 | \ + (u_int32_t)*((const u_int8_t *)(p) + 0)) |