remove the DNS option from proto-static, it will be handled by generic code
[project/netifd.git] / system-dummy.c
1 #include <stdio.h>
2 #include <string.h>
3
4 #include "netifd.h"
5 #include "device.h"
6
7 int system_bridge_addbr(struct device *bridge)
8 {
9         DPRINTF("brctl addbr %s\n", bridge->ifname);
10         return 0;
11 }
12
13 int system_bridge_delbr(struct device *bridge)
14 {
15         DPRINTF("brctl delbr %s\n", bridge->ifname);
16         return 0;
17 }
18
19 int system_bridge_addif(struct device *bridge, struct device *dev)
20 {
21         DPRINTF("brctl addif %s %s\n", bridge->ifname, dev->ifname);
22         return 0;
23 }
24
25 int system_bridge_delif(struct device *bridge, struct device *dev)
26 {
27         DPRINTF("brctl delif %s %s\n", bridge->ifname, dev->ifname);
28         return 0;
29 }
30
31 int system_vlan_add(struct device *dev, int id)
32 {
33         DPRINTF("vconfig add %s %d\n", dev->ifname, id);
34         return 0;
35 }
36
37 int system_vlan_del(struct device *dev)
38 {
39         DPRINTF("vconfig rem %s\n", dev->ifname);
40         return 0;
41 }
42
43 int system_if_up(struct device *dev)
44 {
45         DPRINTF("ifconfig %s up\n", dev->ifname);
46         return 0;
47 }
48
49 int system_if_down(struct device *dev)
50 {
51         DPRINTF("ifconfig %s down\n", dev->ifname);
52         return 0;
53 }
54
55 int system_if_check(struct device *dev)
56 {
57         dev->ifindex = 0;
58
59         if (!strcmp(dev->ifname, "eth0"))
60                 set_device_present(dev, true);
61
62         return 0;
63 }
64
65 int system_add_address(struct device *dev, int family, void *addr, int prefixlen)
66 {
67         uint8_t *a = addr;
68
69         if (family == AF_INET) {
70                 DPRINTF("ifconfig %s add %d.%d.%d.%d/%d\n",
71                         dev->ifname, a[0], a[1], a[2], a[3], prefixlen);
72         } else {
73                 return -1;
74         }
75
76         return 0;
77 }
78
79 int system_del_address(struct device *dev, int family, void *addr)
80 {
81         uint8_t *a = addr;
82
83         if (family == AF_INET) {
84                 DPRINTF("ifconfig %s del %d.%d.%d.%d\n",
85                         dev->ifname, a[0], a[1], a[2], a[3]);
86         } else {
87                 return -1;
88         }
89
90         return 0;
91 }