1 #ifndef __NETIFD_INTERFACE_H
2 #define __NETIFD_INTERFACE_H
5 struct interface_proto
;
6 struct interface_proto_state
;
8 extern struct list_head interfaces
;
10 enum interface_event
{
15 struct interface_proto_state
{
16 const struct interface_proto
*proto
;
18 int (*event
)(struct interface
*, struct interface_proto_state
*, enum interface_event ev
);
19 void (*free
)(struct interface
*, struct interface_proto_state
*);
23 * interface configuration
26 struct list_head list
;
28 char name
[IFNAMSIZ
- 2];
30 /* interface is up and running */
33 /* interface can be brought up */
36 /* interface will be brought up when available */
39 /* main interface that the interface is bound to */
40 struct device_user main_dev
;
42 /* interface that layer 3 communication will go through */
43 struct device_user
*l3_iface
;
45 /* primary protocol state */
46 struct interface_proto_state
*state
;
48 struct ubus_object ubus
;
51 struct interface
*get_interface(const char *name
);
52 struct interface
*alloc_interface(const char *name
);
53 void free_interface(struct interface
*iface
);
55 int set_interface_up(struct interface
*iface
);
56 int set_interface_down(struct interface
*iface
);
58 int interface_add_link(struct interface
*iface
, struct device
*llif
);
59 void interface_remove_link(struct interface
*iface
, struct device
*llif
);
61 int interface_attach_bridge(struct interface
*iface
, struct uci_section
*s
);