1 #ifndef __NETIFD_INTERFACE_H
2 #define __NETIFD_INTERFACE_H
5 struct interface_proto_state;
12 enum interface_state {
19 struct interface_error {
20 struct list_head list;
22 const char *subsystem;
28 * interface configuration
31 struct list_head list;
38 enum interface_state state;
40 /* main interface that the interface is bound to */
41 struct device_user main_dev;
43 /* interface that layer 3 communication will go through */
44 struct device_user *l3_iface;
46 /* primary protocol state */
47 struct interface_proto_state *proto;
49 /* errors/warnings while trying to bring up the interface */
50 struct list_head errors;
52 struct ubus_object ubus;
55 struct interface *get_interface(const char *name);
56 struct interface *alloc_interface(const char *name);
57 void free_interface(struct interface *iface);
59 int set_interface_up(struct interface *iface);
60 int set_interface_down(struct interface *iface);
62 int interface_add_link(struct interface *iface, struct device *llif);
63 void interface_remove_link(struct interface *iface, struct device *llif);
65 void interface_add_error(struct interface *iface, const char *subsystem,
66 const char *code, const char **data, int n_data);
68 int interface_attach_bridge(struct interface *iface, struct uci_section *s);