Merge "IPACM: get upstream and tethered iface in Android"
diff --git a/ipacm/src/IPACM_IfaceManager.cpp b/ipacm/src/IPACM_IfaceManager.cpp
index bbce080..af9811c 100644
--- a/ipacm/src/IPACM_IfaceManager.cpp
+++ b/ipacm/src/IPACM_IfaceManager.cpp
@@ -229,15 +229,12 @@
IPACMDBG_H("Creating Wan interface\n");
IPACM_Wan *w = new IPACM_Wan(ipa_interface_index, is_sta_mode);
IPACM_EvtDispatcher::registr(IPA_ADDR_ADD_EVENT, w);
-//#ifdef FEATURE_IPA_ANDROID
-#if 0
+#ifdef FEATURE_IPA_ANDROID
IPACM_EvtDispatcher::registr(IPA_WAN_UPSTREAM_ROUTE_ADD_EVENT, w);
- IPACM_EvtDispatcher::registr(IPA_WAN_UPSTREAM_ROUTE_DEL_EVENT, w);
-#endif
-//#else/* defined(FEATURE_IPA_ANDROID) */
+#else/* defined(FEATURE_IPA_ANDROID) */
IPACM_EvtDispatcher::registr(IPA_ROUTE_ADD_EVENT, w);
IPACM_EvtDispatcher::registr(IPA_ROUTE_DEL_EVENT, w);
-//#endif /* not defined(FEATURE_IPA_ANDROID)*/
+#endif /* not defined(FEATURE_IPA_ANDROID)*/
IPACM_EvtDispatcher::registr(IPA_FIREWALL_CHANGE_EVENT, w);
IPACM_EvtDispatcher::registr(IPA_NEIGH_CLIENT_IP_ADDR_ADD_EVENT, w);
IPACM_EvtDispatcher::registr(IPA_SW_ROUTING_ENABLE, w);
diff --git a/ipacm/src/IPACM_Main.cpp b/ipacm/src/IPACM_Main.cpp
index 620e2fa..badcc7e 100644
--- a/ipacm/src/IPACM_Main.cpp
+++ b/ipacm/src/IPACM_Main.cpp
@@ -543,14 +543,14 @@
/* Add for 8994 Android case */
case WAN_UPSTREAM_ROUTE_ADD:
memcpy(&event_wan, buffer + sizeof(struct ipa_msg_meta), sizeof(struct ipa_wan_msg));
- IPACMDBG_H("Received WAN_UPSTREAM_ROUTE_ADD name: %s\n",event_wan.name);
+ IPACMDBG_H("Received WAN_UPSTREAM_ROUTE_ADD name: %s, tethered name: %s\n", event_wan.upstream_ifname, event_wan.tethered_ifname);
data_iptype = (ipacm_event_data_iptype *)malloc(sizeof(ipacm_event_data_iptype));
if(data_iptype == NULL)
{
IPACMERR("unable to allocate memory for event_ecm data_iptype\n");
return NULL;
}
- ipa_get_if_index(event_wan.name, &(data_iptype->if_index));
+ ipa_get_if_index(event_wan.upstream_ifname, &(data_iptype->if_index));
data_iptype->iptype = event_wan.ip;
IPACMDBG_H("Received WAN_UPSTREAM_ROUTE_ADD: fid(%d) ip-type(%d)\n", data_iptype->if_index, data_iptype->iptype);
evt_data.event = IPA_WAN_UPSTREAM_ROUTE_ADD_EVENT;
@@ -558,14 +558,14 @@
break;
case WAN_UPSTREAM_ROUTE_DEL:
memcpy(&event_wan, buffer + sizeof(struct ipa_msg_meta), sizeof(struct ipa_wan_msg));
- IPACMDBG_H("Received WAN_UPSTREAM_ROUTE_DEL name: %s\n",event_wan.name);
+ IPACMDBG_H("Received WAN_UPSTREAM_ROUTE_DEL name: %s, tethered name: %s\n", event_wan.upstream_ifname, event_wan.tethered_ifname);
data_iptype = (ipacm_event_data_iptype *)malloc(sizeof(ipacm_event_data_iptype));
if(data_iptype == NULL)
{
IPACMERR("unable to allocate memory for event_ecm data_iptype\n");
return NULL;
}
- ipa_get_if_index(event_wan.name, &(data_iptype->if_index));
+ ipa_get_if_index(event_wan.upstream_ifname, &(data_iptype->if_index));
data_iptype->iptype = event_wan.ip;
IPACMDBG_H("Received WAN_UPSTREAM_ROUTE_DEL: fid(%d) ip-type(%d)\n", data_iptype->if_index, data_iptype->iptype);
evt_data.event = IPA_WAN_UPSTREAM_ROUTE_DEL_EVENT;
diff --git a/ipacm/src/IPACM_Wan.cpp b/ipacm/src/IPACM_Wan.cpp
index 3d47598..1d894c4 100644
--- a/ipacm/src/IPACM_Wan.cpp
+++ b/ipacm/src/IPACM_Wan.cpp
@@ -472,8 +472,7 @@
}
break;
-//#ifdef FEATURE_IPA_ANDROID
-#if 0
+
case IPA_WAN_UPSTREAM_ROUTE_ADD_EVENT:
{
ipacm_event_data_iptype *data = (ipacm_event_data_iptype *)param;
@@ -569,8 +568,7 @@
}
}
break;
-#endif
-//#else/* defined(FEATURE_IPA_ANDROID) */
+
case IPA_ROUTE_ADD_EVENT:
{
ipacm_event_data_addr *data = (ipacm_event_data_addr *)param;
@@ -677,7 +675,7 @@
}
}
break;
-//#endif /* not defined(FEATURE_IPA_ANDROID)*/
+
case IPA_NEIGH_CLIENT_IP_ADDR_ADD_EVENT:
{
ipacm_event_data_all *data = (ipacm_event_data_all *)param;