net: Add IPv6 prefixes to network interface
Change-Id: I34c75eec6068abbd6af1eac2e178e42ce382b128 Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
This commit is contained in:
parent
ad848dcfbf
commit
510ebe255d
2 changed files with 33 additions and 0 deletions
|
@ -79,6 +79,31 @@ struct net_if_mcast_addr {
|
|||
struct net_addr address;
|
||||
};
|
||||
|
||||
#if defined(CONFIG_NET_IPV6)
|
||||
/**
|
||||
* @brief Network Interface IPv6 prefixes
|
||||
*
|
||||
* Stores the multicast IP addresses assigned to this network interface.
|
||||
*
|
||||
*/
|
||||
struct net_if_ipv6_prefix {
|
||||
/** Is this prefix used or not */
|
||||
bool is_used;
|
||||
|
||||
/** IPv6 prefix */
|
||||
struct in6_addr prefix;
|
||||
|
||||
/** Prefix length */
|
||||
uint8_t len;
|
||||
|
||||
/** Is the IP prefix valid forever */
|
||||
bool is_infinite;
|
||||
|
||||
/** Prefix lifetime */
|
||||
struct nano_timer lifetime;
|
||||
};
|
||||
#endif /* CONFIG_NET_IPV6 */
|
||||
|
||||
/**
|
||||
* @brief Network Interface structure
|
||||
*
|
||||
|
@ -105,12 +130,16 @@ struct net_if {
|
|||
#if defined(CONFIG_NET_IPV6)
|
||||
#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
|
||||
#define NET_IF_MAX_IPV6_PREFIX CONFIG_NET_IFACE_IPV6_PREFIX_COUNT
|
||||
struct {
|
||||
/** Unicast IP addresses */
|
||||
struct net_if_addr unicast[NET_IF_MAX_IPV6_ADDR];
|
||||
|
||||
/** Multicast IP addresses */
|
||||
struct net_if_mcast_addr mcast[NET_IF_MAX_IPV6_MADDR];
|
||||
|
||||
/** Prefixes */
|
||||
struct net_if_ipv6_prefix prefix[NET_IF_MAX_IPV6_PREFIX];
|
||||
} ipv6;
|
||||
|
||||
uint8_t hop_limit;
|
||||
|
|
|
@ -27,3 +27,7 @@ config NET_IFACE_UNICAST_IPV6_ADDR_COUNT
|
|||
config NET_IFACE_MCAST_IPV6_ADDR_COUNT
|
||||
int "Max number of multicast IPv6 addresses assigned to network interface"
|
||||
default 1
|
||||
|
||||
config NET_IFACE_IPV6_PREFIX_COUNT
|
||||
int "Max number of IPv6 prefixes assigned to network interface"
|
||||
default 2
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue