mirror of
https://github.com/apache/nuttx.git
synced 2026-06-08 01:42:58 +08:00
net/netdev: Support managing multiple IPv6 addresses by ioctl
1. Supporting `SIOCSIFADDR` and `SIOCDIFADDR` with Linux in6_ifreq struct to manage ipv6 addresses. Ref: https://man7.org/linux/man-pages/man7/netdevice.7.html 2. Supporting alias like 'eth0:0' for multiple IPv6 addresses, to keep previous ioctl `SIOCGLIFADDR`, `SIOCSLIFADDR`, `SIOCGLIFNETMASK` and `SIOCSLIFNETMASK` working. Ref: https://man7.org/linux/man-pages/man8/ifconfig.8.html Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
This commit is contained in:
@@ -335,6 +335,13 @@ struct in6_pktinfo
|
||||
int ipi6_ifindex; /* send/recv interface index */
|
||||
};
|
||||
|
||||
struct in6_ifreq
|
||||
{
|
||||
struct in6_addr ifr6_addr; /* The IPv6 address of the request */
|
||||
uint32_t ifr6_prefixlen; /* The IPv6 prefix length */
|
||||
int ifr6_ifindex; /* The interface index of the request */
|
||||
};
|
||||
|
||||
/****************************************************************************
|
||||
* Public Data
|
||||
****************************************************************************/
|
||||
|
||||
@@ -301,7 +301,7 @@ void net_initialize(void);
|
||||
* Calculate the ioctl argument buffer length.
|
||||
*
|
||||
* Input Parameters:
|
||||
*
|
||||
* domain The socket domain
|
||||
* cmd The ioctl command
|
||||
*
|
||||
* Returned Value:
|
||||
@@ -309,7 +309,7 @@ void net_initialize(void);
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
ssize_t net_ioctl_arglen(int cmd);
|
||||
ssize_t net_ioctl_arglen(uint8_t domain, int cmd);
|
||||
|
||||
/****************************************************************************
|
||||
* Critical section management.
|
||||
|
||||
Reference in New Issue
Block a user