X-Git-Url: http://git.archive.openwrt.org/?p=project%2Fnetifd.git;a=blobdiff_plain;f=interface.h;h=87a7cb3a195b92a45eecbc92b69813a4c3d57931;hp=afdeb186af09c2b950eae402b0b00f2fda0e4412;hb=d5202486636818e3ff48ede9d3e06c886c659c0a;hpb=ddbc9bb6e4769b9654a5ab12acf64c448c70e7bb diff --git a/interface.h b/interface.h index afdeb18..87a7cb3 100644 --- a/interface.h +++ b/interface.h @@ -2,21 +2,18 @@ #define __NETIFD_INTERFACE_H struct interface; -struct interface_proto; struct interface_proto_state; -extern struct list_head interfaces; - enum interface_event { IFEV_UP, IFEV_DOWN, }; -struct interface_proto_state { - 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 *); +enum interface_state { + IFS_SETUP, + IFS_UP, + IFS_TEARDOWN, + IFS_DOWN, }; struct interface_error { @@ -35,15 +32,11 @@ struct interface { char name[IFNAMSIZ]; - /* interface is up and running */ - bool up; - - /* interface can be brought up */ bool active; - - /* interface will be brought up when available */ bool autostart; + enum interface_state state; + /* main interface that the interface is bound to */ struct device_user main_dev; @@ -51,7 +44,7 @@ struct interface { struct device_user *l3_iface; /* primary protocol state */ - struct interface_proto_state *state; + struct interface_proto_state *proto; /* errors/warnings while trying to bring up the interface */ struct list_head errors;