-void CAIPTerminateNetworkMonitor()
-{
- OIC_LOG(DEBUG, IP_MONITOR_TAG, "IN");
-
- ca_mutex_lock(g_networkMonitorContextMutex);
-
- // Deinitialize Wifi service
- wifi_error_e ret = wifi_deinitialize();
- if (WIFI_ERROR_NONE != ret)
- {
- OIC_LOG(ERROR, IP_MONITOR_TAG, "wifi_deinitialize failed");
- }
-
- CAClearNetInterfaceInfoList(g_networkMonitorContext->netInterfaceList);
-
- g_networkMonitorContext->netInterfaceList = NULL;
- g_networkMonitorContext->nwConnectivityStatus = CA_INTERFACE_DOWN;
- g_networkMonitorContext->networkChangeCb = NULL;
-
- OICFree(g_networkMonitorContext);
- g_networkMonitorContext = NULL;
-
- ca_mutex_unlock(g_networkMonitorContextMutex);
-
- CADestroyNetworkMonitorMutexes();
-
- OIC_LOG(DEBUG, IP_MONITOR_TAG, "OUT");
-}
-
-CAResult_t CAIPStartNetworkMonitor()
+/**
+ * Used to send netlink query to kernel and recv response from kernel.
+ *
+ * @param[in] idx desired network interface index, 0 means all interfaces.
+ * @param[out] iflist linked list.
+ *
+ */
+static bool CAIPGetAddrInfo(int idx, u_arraylist_t *iflist)