network/netdev: add attach(), detach(), set_ifindex(), and get_ifindex() to netdev vtable

Currently no vtable sets these functions, but will be used later.
This commit is contained in:
Yu Watanabe
2024-09-10 19:30:17 +09:00
parent 36ca0164ab
commit c60cd572bd
2 changed files with 30 additions and 3 deletions
+10
View File
@@ -169,6 +169,16 @@ typedef struct NetDevVTable {
/* verify that compulsory configuration options were specified */
int (*config_verify)(NetDev *netdev, const char *filename);
/* attach/detach additional interfaces, e.g. veth peer or L2TP sessions. */
int (*attach)(NetDev *netdev);
void (*detach)(NetDev *netdev);
/* set ifindex of the created interface. */
int (*set_ifindex)(NetDev *netdev, const char *name, int ifindex);
/* get ifindex of the netdev. */
int (*get_ifindex)(NetDev *netdev, const char *name);
/* expected iftype, e.g. ARPHRD_ETHER. */
uint16_t iftype;