1 #ifndef __NETIFD_INTERFACE_H
2 #define __NETIFD_INTERFACE_H
7 struct interface_proto_state
;
14 enum interface_state
{
21 struct interface_error
{
22 struct list_head list
;
24 const char *subsystem
;
30 * interface configuration
33 struct list_head list
;
40 enum interface_state state
;
42 /* main interface that the interface is bound to */
43 struct device_user main_dev
;
45 /* interface that layer 3 communication will go through */
46 struct device_user
*l3_iface
;
48 /* primary protocol state */
49 struct interface_proto_state
*proto
;
51 struct list_head address
, routes
;
53 /* errors/warnings while trying to bring up the interface */
54 struct list_head errors
;
56 struct ubus_object ubus
;
59 struct interface
*get_interface(const char *name
);
60 struct interface
*alloc_interface(const char *name
, struct uci_section
*s
);
61 void free_interface(struct interface
*iface
);
63 void interface_set_proto_state(struct interface
*iface
, struct interface_proto_state
*state
);
65 int set_interface_up(struct interface
*iface
);
66 int set_interface_down(struct interface
*iface
);
68 int interface_add_link(struct interface
*iface
, struct device
*llif
);
69 void interface_remove_link(struct interface
*iface
, struct device
*llif
);
71 void interface_add_error(struct interface
*iface
, const char *subsystem
,
72 const char *code
, const char **data
, int n_data
);
74 int interface_attach_bridge(struct interface
*iface
, struct uci_section
*s
);
76 int interface_add_address(struct interface
*iface
, struct device_addr
*addr
);
77 void interface_del_address(struct interface
*iface
, struct device_addr
*addr
);
78 void interface_del_ctx_addr(struct interface
*iface
, void *ctx
);
80 void start_pending_interfaces(void);