diff options
author | Martin Mares <mj@ucw.cz> | 1999-05-06 21:38:11 +0000 |
---|---|---|
committer | Martin Mares <mj@ucw.cz> | 1999-05-06 21:38:11 +0000 |
commit | 9a158361da249e0eab1e0f7bd2c7dbe9f32eddfa (patch) | |
tree | 4d9dff14fd053aaa2d45be859144148eb8851a4d /nest/protocol.h | |
parent | ec8b579e9c9703601bf745745b620103fe2e2477 (diff) |
I rewrote the interface handling code, so that it supports multiple
addresses per interface (needed for example for IPv6 support).
Visible changes:
o struct iface now contains a list of all interface addresses (represented
by struct ifa), iface->addr points to the primary address (if any).
o Interface has IF_UP set iff it's up and it has a primary address.
o IF_UP is now independent on IF_IGNORED (i.e., you need to test IF_IGNORED
in the protocols; I've added this, but please check).
o The if_notify_change hook has been simplified (only one interface pointer
etc.).
o Introduced a ifa_notify_change hook. (For now, only the Direct protocol
does use it -- it's wise to just listen to device routes in all other
protocols.)
o Removed IF_CHANGE_FLAGS notifier flag (it was meaningless anyway).
o Updated all the code except netlink (I'll look at it tomorrow) to match
the new semantics (please look at your code to ensure I did it right).
Things to fix:
o Netlink.
o Make krt-iface interpret "eth0:1"-type aliases as secondary addresses.
Diffstat (limited to 'nest/protocol.h')
-rw-r--r-- | nest/protocol.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/nest/protocol.h b/nest/protocol.h index c203f252..5e1e2ce9 100644 --- a/nest/protocol.h +++ b/nest/protocol.h @@ -13,6 +13,7 @@ #include "lib/resource.h" struct iface; +struct ifa; struct rte; struct neighbor; struct rta; @@ -96,6 +97,7 @@ struct proto { * General protocol hooks: * * if_notify Notify protocol about interface state changes. + * ifa_notify Notify protocol about interface address changes. * rt_notify Notify protocol about routing table updates. * neigh_notify Notify protocol about neighbor cache events. * make_tmp_attrs Construct ea_list from private attrs stored in rte. @@ -106,7 +108,8 @@ struct proto { * 0=process it through the import filter set by the user. */ - void (*if_notify)(struct proto *, unsigned flags, struct iface *new, struct iface *old); + void (*if_notify)(struct proto *, unsigned flags, struct iface *i); + void (*ifa_notify)(struct proto *, unsigned flags, struct ifa *a); void (*rt_notify)(struct proto *, struct network *net, struct rte *new, struct rte *old); void (*neigh_notify)(struct neighbor *neigh); struct ea_list *(*make_tmp_attrs)(struct rte *rt, struct linpool *pool); |