remove device_{route,addr}->device
[project/netifd.git] / system.h
1 #ifndef __NETIFD_SYSTEM_H
2 #define __NETIFD_SYSTEM_H
3
4 #include <sys/time.h>
5 #include <sys/socket.h>
6 #include "device.h"
7 #include "interface-ip.h"
8
9 enum bridge_opt {
10         /* stp and forward delay always set */
11         BRIDGE_OPT_AGEING_TIME = (1 << 0),
12         BRIDGE_OPT_HELLO_TIME  = (1 << 1),
13         BRIDGE_OPT_MAX_AGE     = (1 << 2),
14 };
15
16 struct bridge_config {
17         enum bridge_opt flags;
18         bool stp;
19         bool igmp_snoop;
20         int forward_delay;
21
22         int ageing_time;
23         int hello_time;
24         int max_age;
25 };
26
27 int system_init(void);
28
29 int system_bridge_addbr(struct device *bridge, struct bridge_config *cfg);
30 int system_bridge_delbr(struct device *bridge);
31 int system_bridge_addif(struct device *bridge, struct device *dev);
32 int system_bridge_delif(struct device *bridge, struct device *dev);
33
34 int system_vlan_add(struct device *dev, int id);
35 int system_vlan_del(struct device *dev);
36
37 void system_if_clear_state(struct device *dev);
38 int system_if_up(struct device *dev);
39 int system_if_down(struct device *dev);
40 int system_if_check(struct device *dev);
41 int system_if_dump_info(struct device *dev, struct blob_buf *b);
42 int system_if_dump_stats(struct device *dev, struct blob_buf *b);
43 struct device *system_if_get_parent(struct device *dev);
44
45 int system_add_address(struct device *dev, struct device_addr *addr);
46 int system_del_address(struct device *dev, struct device_addr *addr);
47
48 int system_add_route(struct device *dev, struct device_route *route);
49 int system_del_route(struct device *dev, struct device_route *route);
50 int system_flush_routes(void);
51
52 time_t system_get_rtime(void);
53
54 #endif