diff options
author | Felix Fietkau <nbd@openwrt.org> | 2011-03-28 21:54:19 +0200 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2011-03-28 21:55:40 +0200 |
commit | f62eea9492a669bcf96464e85f04ae5e80190a76 (patch) | |
tree | 59eebbcc6902f2930b64828a96541e0db3f450b4 /interface.h | |
parent | 7fff5dae53f1cdc9d9d5b181fc51ee9e26aa3256 (diff) | |
download | netifd-f62eea9492a669bcf96464e85f04ae5e80190a76.tar.gz |
restructure the proto state, add a callback for notifications by the protocol handler, move the iface pointer to the proto state
Diffstat (limited to 'interface.h')
-rw-r--r-- | interface.h | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/interface.h b/interface.h index 3a0b96f..dd72389 100644 --- a/interface.h +++ b/interface.h @@ -12,11 +12,21 @@ enum interface_event { IFEV_DOWN, }; +enum interface_proto_event { + PROTO_UP, + PROTO_DOWN, +}; + struct interface_proto_state { + struct interface *iface; const struct interface_proto *proto; - int (*event)(struct interface *, struct interface_proto_state *, enum interface_event ev); - void (*free)(struct interface *, struct interface_proto_state *); + /* filled in by the protocol user */ + int (*proto_event)(struct interface_proto_state *, enum interface_proto_event ev); + + /* filled in by the protocol handler */ + int (*event)(struct interface_proto_state *, enum interface_event ev); + void (*free)(struct interface_proto_state *); }; struct interface_error { |