summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSreeram Ramachandran2014-07-23 11:30:53 -0500
committerSreeram Ramachandran2014-07-23 11:30:53 -0500
commiteec232603d314e486888e5a0d2dd8d507c266be7 (patch)
tree5b6a6fc48afc1d60696257809ef5707cabb8c248 /libnetutils
parent759356bbd889d780a57c51c19761b32cbba8e6ef (diff)
downloadplatform-system-core-eec232603d314e486888e5a0d2dd8d507c266be7.tar.gz
platform-system-core-eec232603d314e486888e5a0d2dd8d507c266be7.tar.xz
platform-system-core-eec232603d314e486888e5a0d2dd8d507c266be7.zip
Put back some deleted code.
http://ag/507249 removed a bunch of supposedly dead (unused) code. It turns out at least ifc_disable() is being used in some protected partner branches. Put back that as well as ifc_enable() to keep it symmetric. Bug: 15413389 Change-Id: Ibec83a66e5d9079876ccf36d250b95b7c0294c03
Diffstat (limited to 'libnetutils')
-rw-r--r--libnetutils/ifc_utils.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/libnetutils/ifc_utils.c b/libnetutils/ifc_utils.c
index 52ce17156..27863730b 100644
--- a/libnetutils/ifc_utils.c
+++ b/libnetutils/ifc_utils.c
@@ -563,6 +563,37 @@ int ifc_create_default_route(const char *name, in_addr_t gw)
563 return ret; 563 return ret;
564} 564}
565 565
566// Needed by code in hidden partner repositories / branches, so don't delete.
567int ifc_enable(const char *ifname)
568{
569 int result;
570
571 ifc_init();
572 result = ifc_up(ifname);
573 ifc_close();
574 return result;
575}
576
577int ifc_disable(const char *ifname)
578{
579 unsigned addr, count;
580 int result;
581
582 ifc_init();
583 result = ifc_down(ifname);
584
585 ifc_set_addr(ifname, 0);
586 for (count=0, addr=1;((addr != 0) && (count < 255)); count++) {
587 if (ifc_get_addr(ifname, &addr) < 0)
588 break;
589 if (addr)
590 ifc_set_addr(ifname, 0);
591 }
592
593 ifc_close();
594 return result;
595}
596
566int ifc_reset_connections(const char *ifname, const int reset_mask) 597int ifc_reset_connections(const char *ifname, const int reset_mask)
567{ 598{
568#ifdef HAVE_ANDROID_OS 599#ifdef HAVE_ANDROID_OS