1 #ifndef __NETIFD_INTERFACE_H
2 #define __NETIFD_INTERFACE_H
8 struct interface_proto_state;
10 enum interface_event {
15 enum interface_state {
22 struct interface_error {
23 struct list_head list;
25 const char *subsystem;
31 * interface configuration
34 struct vlist_node node;
41 enum interface_state state;
43 /* main interface that the interface is bound to */
44 struct device_user main_dev;
46 /* interface that layer 3 communication will go through */
47 struct device_user *l3_dev;
49 struct blob_attr *config;
51 /* primary protocol state */
52 const struct proto_handler *proto_handler;
53 struct interface_proto_state *proto;
55 struct vlist_tree proto_addr;
56 struct vlist_tree proto_route;
58 /* errors/warnings while trying to bring up the interface */
59 struct list_head errors;
61 struct ubus_object ubus;
64 extern const struct config_param_list interface_attr_list;
66 void interface_init(struct interface *iface, const char *name,
67 struct blob_attr *config);
69 void interface_add(struct interface *iface, struct blob_attr *config);
71 void interface_set_proto_state(struct interface *iface, struct interface_proto_state *state);
73 void interface_set_available(struct interface *iface, bool new_state);
74 int interface_set_up(struct interface *iface);
75 int interface_set_down(struct interface *iface);
77 int interface_add_link(struct interface *iface, struct device *llif);
78 void interface_remove_link(struct interface *iface, struct device *llif);
80 void interface_add_error(struct interface *iface, const char *subsystem,
81 const char *code, const char **data, int n_data);
83 void interface_start_pending(void);