summaryrefslogtreecommitdiff
path: root/usr.sbin/tcpdump
diff options
context:
space:
mode:
authorVisa Hankala <visa@cvs.openbsd.org>2021-09-16 12:34:13 +0000
committerVisa Hankala <visa@cvs.openbsd.org>2021-09-16 12:34:13 +0000
commitc062d0623bb6da11a675c54478d8cd6ca65f1c12 (patch)
tree83d4217cff494a4ba4de6f9a32e79ec8ecfd4100 /usr.sbin/tcpdump
parent1760a096d6cde0383eb4c492d7240beec6c73f0b (diff)
Add EXTRACT_LE_64BITS().
OK deraadt@
Diffstat (limited to 'usr.sbin/tcpdump')
-rw-r--r--usr.sbin/tcpdump/extract.h13
1 files changed, 11 insertions, 2 deletions
diff --git a/usr.sbin/tcpdump/extract.h b/usr.sbin/tcpdump/extract.h
index c19e9ad2fd2..1a364621cee 100644
--- a/usr.sbin/tcpdump/extract.h
+++ b/usr.sbin/tcpdump/extract.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: extract.h,v 1.9 2007/10/07 16:41:05 deraadt Exp $ */
+/* $OpenBSD: extract.h,v 1.10 2021/09/16 12:34:12 visa Exp $ */
/*
* Copyright (c) 1992, 1993, 1994, 1995, 1996
@@ -20,7 +20,7 @@
* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * @(#) $Id: extract.h,v 1.9 2007/10/07 16:41:05 deraadt Exp $ (LBL)
+ * @(#) $Id: extract.h,v 1.10 2021/09/16 12:34:12 visa Exp $ (LBL)
*/
/* Network to host order macros */
@@ -51,3 +51,12 @@
(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)*((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))