X-Git-Url: http://git.archive.openwrt.org/?p=project%2Fnetifd.git;a=blobdiff_plain;f=system-dummy.c;h=a5d352d7c2454098e1f123f6bc4d0e0e6b5a591d;hp=80f1734d1e0bd4870cf1bf02a29b188b2baf0000;hb=39f5ec857a31fe65e14cdf9b75927297e78015bb;hpb=3062736f3cf323e3b0f95c4c97fdcf57ab768590 diff --git a/system-dummy.c b/system-dummy.c index 80f1734..a5d352d 100644 --- a/system-dummy.c +++ b/system-dummy.c @@ -1,8 +1,20 @@ #include #include +#include + +#ifndef DEBUG +#define DEBUG +#endif + #include "netifd.h" #include "device.h" +#include "system.h" + +int system_init(void) +{ + return 0; +} int system_bridge_addbr(struct device *bridge) { @@ -65,11 +77,15 @@ int system_if_check(struct device *dev) int system_add_address(struct device *dev, struct device_addr *addr) { uint8_t *a = (uint8_t *) &addr->addr.in; + char ipaddr[64]; if ((addr->flags & DEVADDR_FAMILY) == DEVADDR_INET4) { DPRINTF("ifconfig %s add %d.%d.%d.%d/%d\n", dev->ifname, a[0], a[1], a[2], a[3], addr->mask); } else { + inet_ntop(AF_INET6, &addr->addr.in6, ipaddr, sizeof(struct in6_addr)); + DPRINTF("ifconfig %s add %s/%d\n", + dev->ifname, ipaddr, addr->mask); return -1; } @@ -79,11 +95,15 @@ int system_add_address(struct device *dev, struct device_addr *addr) int system_del_address(struct device *dev, struct device_addr *addr) { uint8_t *a = (uint8_t *) &addr->addr.in; + char ipaddr[64]; if ((addr->flags & DEVADDR_FAMILY) == DEVADDR_INET4) { DPRINTF("ifconfig %s del %d.%d.%d.%d\n", dev->ifname, a[0], a[1], a[2], a[3]); } else { + inet_ntop(AF_INET6, &addr->addr.in6, ipaddr, sizeof(struct in6_addr)); + DPRINTF("ifconfig %s del %s/%d\n", + dev->ifname, ipaddr, addr->mask); return -1; }