summaryrefslogtreecommitdiff
path: root/sys/netinet
diff options
context:
space:
mode:
authorNathan Binkert <nate@cvs.openbsd.org>2002-05-07 19:29:00 +0000
committerNathan Binkert <nate@cvs.openbsd.org>2002-05-07 19:29:00 +0000
commitd4099e9e53696672da0c15c51805e3335e2e4205 (patch)
tree947182b66019bbe10c1a8d47f52e98c1a2739707 /sys/netinet
parent2ea3f7af298faeb6d751bb68c7d3a911fc39c0a2 (diff)
move ether_crc32_le to if_ethersubr.c. Add ether_crc32_be
Diffstat (limited to 'sys/netinet')
-rw-r--r--sys/netinet/if_ether.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/sys/netinet/if_ether.h b/sys/netinet/if_ether.h
index 8bfd7a0af28..f1284d7be0e 100644
--- a/sys/netinet/if_ether.h
+++ b/sys/netinet/if_ether.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_ether.h,v 1.19 2002/03/14 01:27:11 millert Exp $ */
+/* $OpenBSD: if_ether.h,v 1.20 2002/05/07 19:28:59 nate Exp $ */
/* $NetBSD: if_ether.h,v 1.22 1996/05/11 13:00:00 mycroft Exp $ */
/*
@@ -90,6 +90,12 @@ struct ether_header {
#define ETHERMTU (ETHER_MAX_LEN - ETHER_HDR_LEN - ETHER_CRC_LEN)
#define ETHERMIN (ETHER_MIN_LEN - ETHER_HDR_LEN - ETHER_CRC_LEN)
+/*
+ * Ethernet CRC32 polynomials (big- and little-endian verions).
+ */
+#define ETHER_CRC_POLY_LE 0xedb88320
+#define ETHER_CRC_POLY_BE 0x04c11db6
+
#ifdef _KERNEL
/*
* Macro to map an IP multicast address to an Ethernet multicast address.
@@ -286,6 +292,9 @@ int revarpwhoarewe(struct ifnet *, struct in_addr *, struct in_addr *);
int revarpwhoami(struct in_addr *, struct ifnet *);
int db_show_arptab(void);
+u_int32_t ether_crc32_le(const u_int8_t *, size_t);
+u_int32_t ether_crc32_be(const u_int8_t *, size_t);
+
#else
char *ether_ntoa(struct ether_addr *);