diff options
| author | chenyong <[email protected]> | 2019-06-24 13:56:42 +0800 |
|---|---|---|
| committer | chenyong <[email protected]> | 2019-06-24 17:46:18 +0800 |
| commit | 7d2ffe63e91a46380d04d4245fec56d6ba0d25f8 (patch) | |
| tree | 8485d1c158c9e542ab383436056bc68a3cb7dcc2 /components/net/netdev/include/netdev.h | |
| parent | c574c49b2fe81ad2ee6f4ba7f3f61c978bea0497 (diff) | |
[net][sal][netdev] Add IPv6 option configuration and feature support in SAL and netdev
Signed-off-by: chenyong <[email protected]>
Diffstat (limited to 'components/net/netdev/include/netdev.h')
| -rw-r--r-- | components/net/netdev/include/netdev.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/components/net/netdev/include/netdev.h b/components/net/netdev/include/netdev.h index 0be2a2bda3..71a61be3c0 100644 --- a/components/net/netdev/include/netdev.h +++ b/components/net/netdev/include/netdev.h @@ -27,6 +27,13 @@ extern "C" { #define NETDEV_DNS_SERVERS_NUM 2U #endif +#if NETDEV_IPV6 +/* the maximum of dns server number supported */ +#ifndef NETDEV_IPV6_NUM_ADDRESSES +#define NETDEV_IPV6_NUM_ADDRESSES 3U +#endif +#endif /* NETDEV_IPV6 */ + /* whether the network interface device is 'up' (set by the network interface driver or application) */ #define NETDEV_FLAG_UP 0x01U /* if set, the network interface device has broadcast capability, only supported in the 'lwIP' stack */ @@ -78,6 +85,9 @@ struct netdev ip_addr_t ip_addr; /* IP address */ ip_addr_t netmask; /* subnet mask */ ip_addr_t gw; /* gateway */ +#if NETDEV_IPV6 + ip_addr_t ip6_addr[NETDEV_IPV6_NUM_ADDRESSES]; /* array of IPv6 addresses */ +#endif /* NETDEV_IPV6 */ ip_addr_t dns_servers[NETDEV_DNS_SERVERS_NUM]; /* DNS server */ uint8_t hwaddr_len; /* hardware address length */ uint8_t hwaddr[NETDEV_HWADDR_MAX_LEN]; /* hardware address */ @@ -163,6 +173,7 @@ int netdev_set_dns_server(struct netdev *netdev, uint8_t dns_num, const ip_addr_ /* Set network interface device callback, it can be called when the status or address changed */ void netdev_set_status_callback(struct netdev *netdev, netdev_callback_fn status_callback); +void netdev_set_addr_callback(struct netdev *netdev, netdev_callback_fn addr_callback); /* Set network interface device status and address, this function can only be called in the network interface device driver */ void netdev_low_level_set_ipaddr(struct netdev *netdev, const ip_addr_t *ipaddr); |
