diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2010-07-11 15:17:11 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2010-07-11 15:17:11 +0000 |
commit | 7a7b211c40caa734799e2973b62d6f582071a051 (patch) | |
tree | 3b9f2a939d846761f4d35034eec43749dd313732 /nuttx/include/net | |
parent | 045b0affc951ce0a37ddfe3dae1b212fcd87bd81 (diff) | |
download | px4-nuttx-7a7b211c40caa734799e2973b62d6f582071a051.tar.gz px4-nuttx-7a7b211c40caa734799e2973b62d6f582071a051.tar.bz2 px4-nuttx-7a7b211c40caa734799e2973b62d6f582071a051.zip |
Add support for multicast MAC addresses
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@2784 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/include/net')
-rw-r--r-- | nuttx/include/net/uip/uip-arch.h | 4 | ||||
-rw-r--r-- | nuttx/include/net/uip/uip.h | 20 |
2 files changed, 23 insertions, 1 deletions
diff --git a/nuttx/include/net/uip/uip-arch.h b/nuttx/include/net/uip/uip-arch.h index 939c60450..c7e8687c1 100644 --- a/nuttx/include/net/uip/uip-arch.h +++ b/nuttx/include/net/uip/uip-arch.h @@ -184,6 +184,10 @@ struct uip_driver_s int (*d_ifup)(struct uip_driver_s *dev); int (*d_ifdown)(struct uip_driver_s *dev); int (*d_txavail)(struct uip_driver_s *dev); +#ifdef CONFIG_NET_IGMP + int (*d_addmac)(struct uip_driver_s *dev, FAR const uint8_t *mac); + int (*d_rmmac)(struct uip_driver_s *dev, FAR const uint8_t *mac); +#endif /* Drivers may attached device-specific, private information */ diff --git a/nuttx/include/net/uip/uip.h b/nuttx/include/net/uip/uip.h index 3633a42a8..fd9373666 100644 --- a/nuttx/include/net/uip/uip.h +++ b/nuttx/include/net/uip/uip.h @@ -5,7 +5,7 @@ * are used by uIP programs as well as internal uIP structures and function * declarations. * - * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2010 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <spudmonkey@racsa.co.cr> * * This logic was leveraged from uIP which also has a BSD-style license: @@ -370,6 +370,24 @@ extern void uip_send(struct uip_driver_s *dev, const void *buf, int len); # define uip_ip4addr_conv(addr) (((in_addr_t)((uint16_t*)addr)[1] << 16) | (in_addr_t)((uint16_t*)addr)[0]) #endif +/* Extract individual bytes from a 32-bit IPv4 IP address that is in network byte order */ + +#ifdef CONFIG_ENDIAN_BIG + /* Big-endian byte order: 11223344 */ + +# define ip4_addr1(ipaddr) (((ipaddr) >> 24) & 0xff) +# define ip4_addr2(ipaddr) (((ipaddr) >> 16) & 0xff) +# define ip4_addr3(ipaddr) (((ipaddr) >> 8) & 0xff) +# define ip4_addr4(ipaddr) ((ipaddr) & 0xff) +#else + /* Little endian byte order: 44223311 */ + +# define ip4_addr1(ipaddr) ((ipaddr) & 0xff) +# define ip4_addr2(ipaddr) (((ipaddr) >> 8) & 0xff) +# define ip4_addr3(ipaddr) (((ipaddr) >> 16) & 0xff) +# define ip4_addr4(ipaddr) (((ipaddr) >> 24) & 0xff) +#endif + /* Construct an IPv6 address from eight 16-bit words. * * This function constructs an IPv6 address. |