net: Add multicast address to network interface
Change-Id: Ifc09d2e1d3ac44ab0f5980ee17299119fbe2a867 Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
This commit is contained in:
parent
ac479e19b8
commit
ad848dcfbf
3 changed files with 22 additions and 2 deletions
|
@ -18,6 +18,4 @@
|
||||||
#include <net/uip/net_if.h>
|
#include <net/uip/net_if.h>
|
||||||
#elif defined(CONFIG_NET_YAIP)
|
#elif defined(CONFIG_NET_YAIP)
|
||||||
#include <net/yaip/net_if.h>
|
#include <net/yaip/net_if.h>
|
||||||
#else
|
|
||||||
#error "Either uIP or YAIP needs to be selected."
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -65,6 +65,20 @@ struct net_if_addr {
|
||||||
#endif /* CONFIG_NET_IPV6 */
|
#endif /* CONFIG_NET_IPV6 */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Network Interface multicast IP addresses
|
||||||
|
*
|
||||||
|
* Stores the multicast IP addresses assigned to this network interface.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
struct net_if_mcast_addr {
|
||||||
|
/** Is this multicast IP address used or not */
|
||||||
|
bool is_used;
|
||||||
|
|
||||||
|
/** IP address */
|
||||||
|
struct net_addr address;
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Network Interface structure
|
* @brief Network Interface structure
|
||||||
*
|
*
|
||||||
|
@ -90,9 +104,13 @@ struct net_if {
|
||||||
|
|
||||||
#if defined(CONFIG_NET_IPV6)
|
#if defined(CONFIG_NET_IPV6)
|
||||||
#define NET_IF_MAX_IPV6_ADDR CONFIG_NET_IFACE_UNICAST_IPV6_ADDR_COUNT
|
#define NET_IF_MAX_IPV6_ADDR CONFIG_NET_IFACE_UNICAST_IPV6_ADDR_COUNT
|
||||||
|
#define NET_IF_MAX_IPV6_MADDR CONFIG_NET_IFACE_MCAST_IPV6_ADDR_COUNT
|
||||||
struct {
|
struct {
|
||||||
/** Unicast IP addresses */
|
/** Unicast IP addresses */
|
||||||
struct net_if_addr unicast[NET_IF_MAX_IPV6_ADDR];
|
struct net_if_addr unicast[NET_IF_MAX_IPV6_ADDR];
|
||||||
|
|
||||||
|
/** Multicast IP addresses */
|
||||||
|
struct net_if_mcast_addr mcast[NET_IF_MAX_IPV6_MADDR];
|
||||||
} ipv6;
|
} ipv6;
|
||||||
|
|
||||||
uint8_t hop_limit;
|
uint8_t hop_limit;
|
||||||
|
|
|
@ -23,3 +23,7 @@ config NET_YAIP_INIT_PRIO
|
||||||
config NET_IFACE_UNICAST_IPV6_ADDR_COUNT
|
config NET_IFACE_UNICAST_IPV6_ADDR_COUNT
|
||||||
int "Max number of unicast IPv6 addresses assigned to network interface"
|
int "Max number of unicast IPv6 addresses assigned to network interface"
|
||||||
default 1
|
default 1
|
||||||
|
|
||||||
|
config NET_IFACE_MCAST_IPV6_ADDR_COUNT
|
||||||
|
int "Max number of multicast IPv6 addresses assigned to network interface"
|
||||||
|
default 1
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue