diff options
author | Felix Fietkau <nbd@openwrt.org> | 2011-04-13 23:13:11 +0200 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2011-04-13 23:13:11 +0200 |
commit | 8ac814e3d02fd3c8be2798814c085dc2c65c5c49 (patch) | |
tree | 18b08f730d9b049289289c68854d104157bef580 /system-dummy.c | |
parent | 71427e54fa17dacd1ace6077bffb9f9b9d456ebb (diff) |
add functions for setting v4 addresses
Diffstat (limited to 'system-dummy.c')
-rw-r--r-- | system-dummy.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/system-dummy.c b/system-dummy.c index aadb64f..7e009ba 100644 --- a/system-dummy.c +++ b/system-dummy.c @@ -61,3 +61,31 @@ int system_if_check(struct device *dev) return 0; } + +int system_add_address(struct device *dev, int family, void *addr, int prefixlen) +{ + uint8_t *a = addr; + + if (family == AF_INET) { + DPRINTF("ifconfig %s add %d.%d.%d.%d/%d\n", + dev->ifname, a[0], a[1], a[2], a[3], prefixlen); + } else { + return -1; + } + + return 0; +} + +int system_del_address(struct device *dev, int family, void *addr) +{ + uint8_t *a = addr; + + if (family == AF_INET) { + DPRINTF("ifconfig %s del %d.%d.%d.%d\n", + dev->ifname, a[0], a[1], a[2], a[3]); + } else { + return -1; + } + + return 0; +} |