From 47ddb515b7d59b29d83628c1b4e48642dc0e49ba Mon Sep 17 00:00:00 2001 From: Lorenzo Colitti Date: Mon, 26 Sep 2011 10:49:41 -0700 Subject: Support adding, deleting, and clearing IPv6 addrs. - Provide a function to add and delete IPv4/IPv6 addresses using netlink. - Provide a function that clears all IP addresses on an interface that can be used by netd. Also, a couple of cleanups: - Update the header file to match reality, and include the header file in the implementation. Also fix a caller that has an incorrect method signature. - Fix whitespace in Android.mk. Change-Id: Ifba9d60cdfffb0b7e5c3b9c6ab328f5f77d259c4 --- include/netutils/ifc.h | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'include') diff --git a/include/netutils/ifc.h b/include/netutils/ifc.h index 575e72efc..67a4a4564 100644 --- a/include/netutils/ifc.h +++ b/include/netutils/ifc.h @@ -38,9 +38,13 @@ extern int ifc_reset_connections(const char *ifname, const int reset_mask); extern int ifc_get_addr(const char *name, in_addr_t *addr); extern int ifc_set_addr(const char *name, in_addr_t addr); -extern int ifc_get_prefixLength(const char *name, uint32_t *prefixLength); -extern int ifc_set_prefixLength(const char *name, uint32_t prefixLength); +extern int ifc_add_address(const char *name, const char *address, + int prefixlen); +extern int ifc_del_address(const char *name, const char *address, + int prefixlen); +extern int ifc_set_prefixLength(const char *name, int prefixLength); extern int ifc_set_hwaddr(const char *name, const void *ptr); +extern int ifc_clear_addresses(const char *name); /* This function is deprecated. Use ifc_add_route instead. */ extern int ifc_add_host_route(const char *name, in_addr_t addr); @@ -53,9 +57,10 @@ extern int ifc_create_default_route(const char *name, in_addr_t addr); extern int ifc_remove_default_route(const char *ifname); extern int ifc_add_route(const char *name, const char *addr, int prefix_length, const char *gw); - -extern int ifc_get_info(const char *name, in_addr_t *addr, in_addr_t *mask, - in_addr_t *flags); +extern int ifc_remove_route(const char *ifname, const char *dst, + int prefix_length, const char *gw); +extern int ifc_get_info(const char *name, in_addr_t *addr, int *prefixLength, + unsigned *flags); extern int ifc_configure(const char *ifname, in_addr_t address, uint32_t prefixLength, in_addr_t gateway, -- cgit v1.2.3