Add newlink/delink processing.

- Can up/down a link.
- Can set MAC on a link, if it's a phy.
- Can set MTU on a link.
- Can delete link (including phy).

Because link state and mtu changes tend to go around in circles (from
netlink -> vpp; and then with lcp-sync on, as well from vpp -> netlink)
when we consume a batch of netlink messages, we'll temporarily turn off
lcp-sync if it's enabled.

TODO (in the next commit), the whole nine yards of creating interfaces
in VPP based on NEWLINK vlans that come in. Conceptualy not too
difficult: if NEWLINK doesn't have a LIP associated with it, but it's a
VLAN, and the parent of the VLAN is a link which _does_ have a LIP, then
we can create the subint in VPP in the correct way.
This commit is contained in:
Pim van Pelt
2021-08-24 18:11:51 +02:00
parent 6d2ce1cd83
commit a3a5f68926
4 changed files with 185 additions and 4 deletions

View File

@ -85,6 +85,8 @@ void lcp_nl_neigh_add (struct rtnl_neigh *rn);
void lcp_nl_neigh_del (struct rtnl_neigh *rn);
void lcp_nl_addr_add (struct rtnl_addr *ra);
void lcp_nl_addr_del (struct rtnl_addr *ra);
void lcp_nl_link_add (struct rtnl_link *rl, void *ctx);
void lcp_nl_link_del (struct rtnl_link *rl);
/*
* fd.io coding-style-patch-verification: ON