diff options
author | dyoung <dyoung> | 2004-09-23 21:30:12 +0000 |
---|---|---|
committer | dyoung <dyoung> | 2004-09-23 21:30:12 +0000 |
commit | cdf690cbf7bfbe8fbb52ca3b773e856e873eae2b (patch) | |
tree | 97103dfe0464cebc0dc0aa36130f205830b7dbe4 /extract.h | |
parent | 665b5651a8ac6a10de9cacbdb1af51134abcdb97 (diff) | |
download | tcpdump-cdf690cbf7bfbe8fbb52ca3b773e856e873eae2b.tar.gz |
cpack uses EXTRACT_LE_64BITS to extract little-endian 64-bit words.
Diffstat (limited to 'extract.h')
-rw-r--r-- | extract.h | 11 |
1 files changed, 10 insertions, 1 deletions
@@ -18,7 +18,7 @@ * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * @(#) $Header: /tcpdump/master/tcpdump/extract.h,v 1.19 2002-12-11 07:13:51 guy Exp $ (LBL) + * @(#) $Header: /tcpdump/master/tcpdump/extract.h,v 1.20 2004-09-23 21:30:12 dyoung Exp $ (LBL) */ /* Network to host order macros */ @@ -96,3 +96,12 @@ typedef struct { (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))) +#define EXTRACT_LE_64BITS(p) \ + ((u_int64_t)((u_int64_t)*((const u_int8_t *)(p) + 7) << 56 | \ + (u_int64_t)*((const u_int8_t *)(p) + 6) << 48 | \ + (u_int64_t)*((const u_int8_t *)(p) + 5) << 40 | \ + (u_int64_t)*((const u_int8_t *)(p) + 4) << 32 | \ + (u_int64_t)*((const u_int8_t *)(p) + 3) << 24 | \ + (u_int64_t)*((const u_int8_t *)(p) + 2) << 16 | \ + (u_int64_t)*((const u_int8_t *)(p) + 1) << 8 | \ + (u_int64_t)*((const u_int8_t *)(p) + 0))) |