X-Git-Url: https://git.archive.openwrt.org/?p=project%2Fnetifd.git;a=blobdiff_plain;f=interface.h;h=0f2eb85c191dcdbff6891b3f67177287ec08383c;hp=480f7595c8a02159c10457c4c5266258c24f43d7;hb=18afbe24610df2e1a7a2d417ea24c245f948a8d8;hpb=f6fb6bee2c29f31d13d0b0288f4f680b6b56e9ba diff --git a/interface.h b/interface.h index 480f759..0f2eb85 100644 --- a/interface.h +++ b/interface.h @@ -2,6 +2,7 @@ #define __NETIFD_INTERFACE_H #include "device.h" +#include "config.h" struct interface; struct interface_proto_state; @@ -45,7 +46,10 @@ struct interface { /* interface that layer 3 communication will go through */ struct device_user *l3_iface; + struct config_state config; + /* primary protocol state */ + const struct proto_handler *proto_handler; struct interface_proto_state *proto; struct list_head address, routes; @@ -56,14 +60,16 @@ struct interface { struct ubus_object ubus; }; -struct interface *get_interface(const char *name); -struct interface *alloc_interface(const char *name, struct uci_section *s); -void free_interface(struct interface *iface); +extern const struct config_param_list interface_attr_list; + +struct interface *interface_get(const char *name); +struct interface *interface_alloc(const char *name, struct blob_attr *attr); +void interface_free(struct interface *iface); void interface_set_proto_state(struct interface *iface, struct interface_proto_state *state); -int set_interface_up(struct interface *iface); -int set_interface_down(struct interface *iface); +int interface_set_up(struct interface *iface); +int interface_set_down(struct interface *iface); int interface_add_link(struct interface *iface, struct device *llif); void interface_remove_link(struct interface *iface, struct device *llif); @@ -71,16 +77,6 @@ void interface_remove_link(struct interface *iface, struct device *llif); void interface_add_error(struct interface *iface, const char *subsystem, const char *code, const char **data, int n_data); -int interface_attach_bridge(struct interface *iface, struct uci_section *s); - -int interface_add_address(struct interface *iface, struct device_addr *addr); -void interface_del_address(struct interface *iface, struct device_addr *addr); -void interface_del_ctx_addr(struct interface *iface, void *ctx); - -int interface_add_route(struct interface *iface, struct device_route *route); -void interface_del_route(struct interface *iface, struct device_route *route); -void interface_del_all_routes(struct interface *iface); - -void start_pending_interfaces(void); +void interface_start_pending(void); #endif