merge with master
[framework/osp/net.git] / src / FNet_NetIpcProxy.cpp
index 16c14ea..6cd15ae 100644 (file)
@@ -158,4 +158,40 @@ _NetIpcProxy::SetNetAccountId(NetAccountId netAccountId, NetAccountId& netAccoun
        return r;
 }
 
+result
+_NetIpcProxy::ResetNetStatistics(NetBearerType bearerType, NetStatisticsInfoType statType)
+{
+       result r = E_SUCCESS;
+       unsigned long ret = 0;
+
+       SysLog(NID_NET, "ResetNetStatistics() has been called with bearer:%d stat:%d", bearerType, statType);
+
+       unique_ptr<IPC::Message> pMessage(new (std::nothrow) ConnectivityNetServiceMsg_resetNetStatistics(bearerType, statType, &ret));
+       SysTryReturnResult(NID_NET, pMessage != null, E_OUT_OF_MEMORY, "Memory allocation failed.");
+
+       r = __pIpcClient->SendRequest(*pMessage);
+       SysTryReturnResult(NID_NET, r == E_SUCCESS, E_SYSTEM, "A system error has been occurred.");
+       SysTryReturnResult(NID_NET, ret == E_SUCCESS, ret, "Propagating.");
+
+       return r;
+}
+
+result
+_NetIpcProxy::ResetAllNetStatistics(NetBearerType bearerType)
+{
+       result r = E_SUCCESS;
+       unsigned long ret = 0;
+
+       SysLog(NID_NET, "ResetAllNetStatistics() has been called with bearer:%d", bearerType);
+
+       unique_ptr<IPC::Message> pMessage(new (std::nothrow) ConnectivityNetServiceMsg_resetAllNetStatistics(bearerType, &ret));
+       SysTryReturnResult(NID_NET, pMessage != null, E_OUT_OF_MEMORY, "Memory allocation failed.");
+
+       r = __pIpcClient->SendRequest(*pMessage);
+       SysTryReturnResult(NID_NET, r == E_SUCCESS, E_SYSTEM, "A system error has been occurred.");
+       SysTryReturnResult(NID_NET, ret == E_SUCCESS, ret, "Propagating.");
+
+       return r;
+}
+
 }} // Tizen::Net