diff options
author | shin <shin@FreeBSD.org> | 1999-11-05 14:41:39 +0000 |
---|---|---|
committer | shin <shin@FreeBSD.org> | 1999-11-05 14:41:39 +0000 |
commit | 7efc91cadcfeb421fc4d02ba94db784616f3714c (patch) | |
tree | f40f3ca5e5c27dfec6f4c10b00aa3b391491a550 /sys/netinet/if_ether.h | |
parent | 660a7daead2ffcf4f7e3d2a3c874a82ccc8954c8 (diff) | |
download | FreeBSD-src-7efc91cadcfeb421fc4d02ba94db784616f3714c.zip FreeBSD-src-7efc91cadcfeb421fc4d02ba94db784616f3714c.tar.gz |
KAME related header files additions and merges.
(only those which don't affect c source files so much)
Reviewed by: cvs-committers
Obtained from: KAME project
Diffstat (limited to 'sys/netinet/if_ether.h')
-rw-r--r-- | sys/netinet/if_ether.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/sys/netinet/if_ether.h b/sys/netinet/if_ether.h index 79f1252..09caa31 100644 --- a/sys/netinet/if_ether.h +++ b/sys/netinet/if_ether.h @@ -56,6 +56,22 @@ (enaddr)[4] = ((u_char *)ipaddr)[2]; \ (enaddr)[5] = ((u_char *)ipaddr)[3]; \ } +/* + * Macro to map an IP6 multicast address to an Ethernet multicast address. + * The high-order 16 bits of the Ethernet address are statically assigned, + * and the low-order 32 bits are taken from the low end of the IP6 address. + */ +#define ETHER_MAP_IPV6_MULTICAST(ip6addr, enaddr) \ +/* struct in6_addr *ip6addr; */ \ +/* u_char enaddr[ETHER_ADDR_LEN]; */ \ +{ \ + (enaddr)[0] = 0x33; \ + (enaddr)[1] = 0x33; \ + (enaddr)[2] = ((u_char *)ip6addr)[12]; \ + (enaddr)[3] = ((u_char *)ip6addr)[13]; \ + (enaddr)[4] = ((u_char *)ip6addr)[14]; \ + (enaddr)[5] = ((u_char *)ip6addr)[15]; \ +} /* * Ethernet Address Resolution Protocol. |