/foundation/communication/netmanager_base/test/netcommon/unittest/net_common_test/ |
H A D | route_utils_test.cpp | 36 Route route; in GetRoute() local 37 route.iface_ = iface; in GetRoute() 38 route.rtnType_ = RTN_UNICAST; in GetRoute() 39 route.hasGateway_ = true; in GetRoute() 40 route.isDefaultRoute_ = false; in GetRoute() 41 route.destination_.type_ = INetAddr::IPV4; in GetRoute() 42 route.destination_.family_ = AF_INET; in GetRoute() 43 route.destination_.prefixlen_ = 0x18; in GetRoute() 44 route.destination_.address_ = "192.168.2.10"; in GetRoute() 45 route in GetRoute() 59 Route route; GetRoute2() local 82 Route route; GetRoute3() local 105 Route route; GetRoute4() local 165 Route route; HWTEST_F() local 191 Route route; HWTEST_F() local 211 Route route; HWTEST_F() local 268 Route route = {}; HWTEST_F() local [all...] |
/foundation/communication/netmanager_ext/services/ethernetmanager/src/ |
H A D | ethernet_lan_management.cpp | 21 #include "route.h"
96 for (const auto &route : newNetLinkInfo.routeList_) {
in ReleaseLanNetLink() 97 std::string destAddress = route.destination_.address_ + "/" + std::to_string(route.destination_.prefixlen_);
in ReleaseLanNetLink() 98 ret += NetConnClient::GetInstance().RemoveNetworkRoute(LOCAL_NET_ID, route.iface_, destAddress,
in ReleaseLanNetLink() 99 route.gateway_.address_);
in ReleaseLanNetLink() 101 NETMGR_EXT_LOG_E("del lan[%{public}s] route failed, destAddress[%{private}s], nexthop[%{private}s]",
in ReleaseLanNetLink() 102 route.iface_.c_str(), destAddress.c_str(), route.gateway_.address_.c_str());
in ReleaseLanNetLink() 156 for (const auto &route in SetRoute() [all...] |
H A D | dev_interface_state.cpp | 24 #include "route.h" 239 Route route; in UpdateLinkInfo() local 240 route.iface_ = devName_; in UpdateLinkInfo() 241 route.destination_ = netAddr; in UpdateLinkInfo() 242 GetTargetNetAddrWithSameFamily(netAddr.address_, ifCfg_->ipStatic_.gatewayList_, route.gateway_); in UpdateLinkInfo() 243 linkInfo_->routeList_.push_back(route); in UpdateLinkInfo() 273 Route route; in UpdateLanLinkInfo() local 274 route.iface_ = devName_; in UpdateLanLinkInfo() 275 route.destination_ = netAddr; in UpdateLanLinkInfo() 276 GetRoutePrefixlen(netAddr.address_, ifCfg_->ipStatic_.netMaskList_, route in UpdateLanLinkInfo() [all...] |
/foundation/communication/netmanager_base/test/netconnmanager/unittest/net_info_test/ |
H A D | net_link_info_test.cpp | 59 sptr<Route> route = (std::make_unique<Route>()).release(); in GetNetLinkInfo() local 60 route->iface_ = "iface0"; in GetNetLinkInfo() 61 route->destination_.type_ = INetAddr::IPV4; in GetNetLinkInfo() 62 route->destination_.family_ = 0x10; in GetNetLinkInfo() 63 route->destination_.prefixlen_ = 0x17; in GetNetLinkInfo() 64 route->destination_.address_ = "0.0.0.0"; in GetNetLinkInfo() 65 route->destination_.netMask_ = "0.0.0.0"; in GetNetLinkInfo() 66 route->destination_.hostName_ = "netAddr"; in GetNetLinkInfo() 67 route->gateway_.type_ = INetAddr::IPV4; in GetNetLinkInfo() 68 route in GetNetLinkInfo() [all...] |
H A D | route_test.cpp | 20 #include "route.h" 62 sptr<Route> route = new (std::nothrow) Route(); in HWTEST_F() local 63 ASSERT_TRUE(route != nullptr); in HWTEST_F() 64 bool bRet = Route::Marshalling(data, route); in HWTEST_F() 69 bRet = route->Marshalling(data); in HWTEST_F()
|
/foundation/communication/netmanager_base/test/netconnmanager/unittest/net_conn_multi_test/ |
H A D | net_link_info_test.cpp | 59 sptr<Route> route = (std::make_unique<Route>()).release(); in GetNetLinkInfo() local 60 route->iface_ = "iface0"; in GetNetLinkInfo() 61 route->destination_.type_ = INetAddr::IPV4; in GetNetLinkInfo() 62 route->destination_.family_ = 0x10; in GetNetLinkInfo() 63 route->destination_.prefixlen_ = 0x17; in GetNetLinkInfo() 64 route->destination_.address_ = "0.0.0.0"; in GetNetLinkInfo() 65 route->destination_.netMask_ = "0.0.0.0"; in GetNetLinkInfo() 66 route->destination_.hostName_ = "netAddr"; in GetNetLinkInfo() 67 route->gateway_.type_ = INetAddr::IPV4; in GetNetLinkInfo() 68 route in GetNetLinkInfo() [all...] |
H A D | net_conn_hievent_test.cpp | 79 sptr<Route> route = (std::make_unique<Route>()).release(); in GetNetLinkInfo() local 80 route->iface_ = "iface0"; in GetNetLinkInfo() 81 route->destination_.type_ = INetAddr::IPV4; in GetNetLinkInfo() 82 route->destination_.family_ = 0x10; in GetNetLinkInfo() 83 route->destination_.prefixlen_ = 0x17; in GetNetLinkInfo() 84 route->destination_.address_ = "192.168.2.0"; in GetNetLinkInfo() 85 route->destination_.netMask_ = "192.255.255.255"; in GetNetLinkInfo() 86 route->destination_.hostName_ = "netAddr"; in GetNetLinkInfo() 87 route->gateway_.type_ = INetAddr::IPV4; in GetNetLinkInfo() 88 route in GetNetLinkInfo() [all...] |
H A D | native_net_conn_test.cpp | 52 void LogRoute(const OH_NetConn_Route route) const; 79 sptr<Route> route = (std::make_unique<Route>()).release(); in GetRouteSample() local 80 route->iface_ = "iface0"; in GetRouteSample() 81 route->destination_.type_ = INetAddr::IPV4; in GetRouteSample() 82 route->destination_.family_ = 0x10; in GetRouteSample() 83 route->destination_.prefixlen_ = 0x17; in GetRouteSample() 84 route->destination_.address_ = "192.168.2.0"; in GetRouteSample() 85 route->destination_.netMask_ = "192.255.255.255"; in GetRouteSample() 86 route->destination_.hostName_ = "netAddr"; in GetRouteSample() 87 route in GetRouteSample() 116 sptr<Route> route = GetRouteSample(); GetNetLinkInfoSample() local 422 sptr<Route> route = GetRouteSample(); HWTEST_F() local [all...] |
H A D | route_test.cpp | 20 #include "route.h" 62 sptr<Route> route = new (std::nothrow) Route(); in HWTEST_F() local 63 ASSERT_TRUE(route != nullptr); in HWTEST_F() 64 bool bRet = Route::Marshalling(data, route); in HWTEST_F() 69 bRet = route->Marshalling(data); in HWTEST_F()
|
/foundation/communication/netmanager_ext/test/vpnmanager/unittest/vpn_manager_ext_test/ |
H A D | networkvpn_service_ext_test.cpp | 70 Route route; in GetRouteInfo() local 71 route.iface_ = iface; in GetRouteInfo() 72 route.rtnType_ = RTN_UNICAST; in GetRouteInfo() 73 route.hasGateway_ = true; in GetRouteInfo() 74 route.isDefaultRoute_ = false; in GetRouteInfo() 75 route.destination_.type_ = INetAddr::IPV4; in GetRouteInfo() 76 route.destination_.family_ = AF_INET; in GetRouteInfo() 77 route.destination_.prefixlen_ = 0x18; in GetRouteInfo() 78 route.destination_.address_ = "192.168.2.10"; in GetRouteInfo() 79 route in GetRouteInfo() [all...] |
/foundation/communication/netmanager_base/services/common/src/ |
H A D | route_utils.cpp | 67 int32_t RouteUtils::AddRoute(int32_t netId, const Route &route) in AddRoute() argument 69 return ModifyRoute(ROUTE_ADD, netId, route); in AddRoute() 72 int32_t RouteUtils::RemoveRoute(int32_t netId, const Route &route) in RemoveRoute() argument 74 return ModifyRoute(ROUTE_REMOVE, netId, route); in RemoveRoute() 124 int32_t RouteUtils::ModifyRoute(routeOperateType op, int32_t netId, const Route &route) in ModifyRoute() argument 132 switch (route.rtnType_) { in ModifyRoute() 134 if (route.hasGateway_) { in ModifyRoute() 135 nextHop = route.gateway_.address_; in ModifyRoute() 148 ToPrefixString(route.destination_.address_, route in ModifyRoute() [all...] |
/foundation/communication/netmanager_base/frameworks/native/netconnclient/src/ |
H A D | net_adj_iface_info.cpp | 45 for (const auto &route : routeList_) { in Marshalling() 46 if (!route.Marshalling(parcel)) { in Marshalling() 76 sptr<Route> route; in Unmarshalling() local 78 route = Route::Unmarshalling(parcel); in Unmarshalling() 79 if (route == nullptr) { in Unmarshalling() 82 info->routeList_.push_back(*route); in Unmarshalling()
|
/foundation/communication/netmanager_base/services/netconnmanager/src/ |
H A D | network.cpp | 160 for (const auto &route : netLinkInfo_.routeList_) { in ReleaseBasicNetwork() 161 if (route.destination_.address_ != LOCAL_ROUTE_NEXT_HOP && in ReleaseBasicNetwork() 162 route.destination_.address_ != LOCAL_ROUTE_IPV6_DESTINATION) { in ReleaseBasicNetwork() 163 auto family = GetAddrFamily(route.destination_.address_); in ReleaseBasicNetwork() 165 auto destAddress = route.destination_.address_ + "/" + std::to_string(route.destination_.prefixlen_); in ReleaseBasicNetwork() 166 NetsysController::GetInstance().NetworkRemoveRoute(LOCAL_NET_ID, route.iface_, destAddress, nextHop); in ReleaseBasicNetwork() 177 for (const auto &route : netLinkInfo_.routeList_) { in ReleaseBasicNetwork() 178 auto destAddress = route.destination_.address_ + "/" + std::to_string(route in ReleaseBasicNetwork() [all...] |
/foundation/communication/netmanager_ext/test/vpnmanager/fuzztest/vpnclient_fuzzer/ |
H A D | vpnclient_fuzzer.cpp | 88 Route route; in GetRouteData() local 89 route.iface_ = GetStringData(); in GetRouteData() 90 route.destination_ = GetAddressData(); in GetRouteData() 91 route.gateway_ = GetAddressData(); in GetRouteData() 92 route.mtu_ = GetData<int32_t>(); in GetRouteData() 93 route.isHost_ = GetData<bool>(); in GetRouteData() 94 route.hasGateway_ = GetData<bool>(); in GetRouteData() 95 route.isDefaultRoute_ = GetData<bool>(); in GetRouteData() 96 return route; in GetRouteData()
|
/foundation/communication/netmanager_ext/services/vpnmanager/src/ |
H A D | net_vpn_impl.cpp | 284 for (auto &route : linkInfo->routeList_) { in UpdateNetLinkInfo() 285 AdjustRouteInfo(route); in UpdateNetLinkInfo() 328 for (auto &route : vpnConfig_->routes_) { in DelNetLinkInfo() 329 AdjustRouteInfo(route); in DelNetLinkInfo() 330 std::string destAddress = route.destination_.address_ + "/" + std::to_string(route.destination_.prefixlen_); in DelNetLinkInfo() 331 NetsysController::GetInstance().NetworkRemoveRoute(netId_, route.iface_, destAddress, route.gateway_.address_); in DelNetLinkInfo() 335 void NetVpnImpl::AdjustRouteInfo(Route &route) in AdjustRouteInfo() argument 337 if (route in AdjustRouteInfo() [all...] |
/foundation/communication/netmanager_base/services/common/include/ |
H A D | route_utils.h | 23 #include "route.h" 40 * Add route info to table by default netId 43 * @param routes the list of route 45 * @return 0, add route success, otherwise it will fail 50 * Remove route info from table by default netId 52 * @param routes the list of route 54 * @return 0, remove route success, otherwise it will fail 59 * Add route info to table by given netId 62 * @param route route inf [all...] |
/foundation/communication/netmanager_base/test/netconnmanager/unittest/net_conn_add_test/ |
H A D | ethernet_service_proxy_test.cpp | 74 INetAddr route; in GetIfaceConfig() local 75 route.type_ = INetAddr::IPV4; in GetIfaceConfig() 76 route.family_ = 0x01; in GetIfaceConfig() 77 route.prefixlen_ = 0x01; in GetIfaceConfig() 78 route.address_ = "0.0.0.0"; in GetIfaceConfig() 79 route.netMask_ = "0.0.0.0"; in GetIfaceConfig() 80 route.hostName_ = "netAddr"; in GetIfaceConfig() 81 ic->ipStatic_.routeList_.push_back(route); in GetIfaceConfig()
|
H A D | ethernet_lan_management_test.cpp | 65 INetAddr route; in GetNewIfaceConfig() local 66 route.type_ = INetAddr::IPV4; in GetNewIfaceConfig() 67 route.address_ = "0.0.0.0"; in GetNewIfaceConfig() 68 route.netMask_ = "0.0.0.0"; in GetNewIfaceConfig() 69 ic->ipStatic_.routeList_.push_back(route); in GetNewIfaceConfig()
|
/foundation/communication/netmanager_ext/test/ethernetmanager/unittest/ethernet_manager_test/ |
H A D | ethernet_service_proxy_test.cpp | 74 INetAddr route; in GetIfaceConfig() local 75 route.type_ = INetAddr::IPV4; in GetIfaceConfig() 76 route.family_ = 0x01; in GetIfaceConfig() 77 route.prefixlen_ = 0x01; in GetIfaceConfig() 78 route.address_ = "0.0.0.0"; in GetIfaceConfig() 79 route.netMask_ = "0.0.0.0"; in GetIfaceConfig() 80 route.hostName_ = "netAddr"; in GetIfaceConfig() 81 ic->ipStatic_.routeList_.push_back(route); in GetIfaceConfig()
|
H A D | ethernet_lan_management_test.cpp | 65 INetAddr route; in GetNewIfaceConfig() local 66 route.type_ = INetAddr::IPV4; in GetNewIfaceConfig() 67 route.address_ = "0.0.0.0"; in GetNewIfaceConfig() 68 route.netMask_ = "0.0.0.0"; in GetNewIfaceConfig() 69 ic->ipStatic_.routeList_.push_back(route); in GetNewIfaceConfig()
|
/foundation/communication/netmanager_ext/frameworks/native/netvpnclient/src/ |
H A D | vpn_config.cpp | 53 for (auto route : routes_) { in MarshallingAddrRoute() 54 if (!route.Marshalling(parcel)) { in MarshallingAddrRoute() 131 sptr<Route> route = Route::Unmarshalling(parcel); in UnmarshallingAddrRoute() local 132 if (route == nullptr) { in UnmarshallingAddrRoute() 133 NETMGR_EXT_LOG_E("route is null"); in UnmarshallingAddrRoute() 136 config->routes_.push_back(*route); in UnmarshallingAddrRoute()
|
/foundation/communication/wifi/wifi/services/wifi_standard/wifi_framework/wifi_toolkit/net_helper/ |
H A D | if_config.cpp | 19 #include <net/route.h> 317 LOGI("set dns and route finished!"); in SetIfDnsAndRoute() 372 struct rtentry route; in AddIpv4Route() local 373 if (memset_s(&route, sizeof(route), 0, sizeof(route)) != EOK) { in AddIpv4Route() 374 LOGE("memset_s route info failed!"); in AddIpv4Route() 378 struct sockaddr_in *addr = reinterpret_cast<struct sockaddr_in *>(&route.rt_gateway); in AddIpv4Route() 384 addr = reinterpret_cast<struct sockaddr_in *>(&route.rt_dst); in AddIpv4Route() 387 addr = reinterpret_cast<struct sockaddr_in *>(&route in AddIpv4Route() [all...] |
/foundation/communication/netmanager_ext/services/wearabledistributednetmanager/src/ |
H A D | wearable_distributed_net_link_info.cpp | 283 Route route;
in SetNetLinkRouteInfo() local 284 route.iface_ = GetIfaceName();
in SetNetLinkRouteInfo() 285 route.destination_.type_ = INetAddr::IPV4;
in SetNetLinkRouteInfo() 286 route.destination_.family_ = AF_INET;
in SetNetLinkRouteInfo() 287 route.destination_.address_ = GetRouteEstinationAddr();
in SetNetLinkRouteInfo() 288 route.gateway_.address_ = GetNetIfaceAddress();
in SetNetLinkRouteInfo() 289 route.gateway_.family_ = AF_INET;
in SetNetLinkRouteInfo() 291 linkInfo.routeList_.push_back(*route);
in SetNetLinkRouteInfo()
|
/foundation/communication/nfc/services/src/nci_adapter/ |
H A D | nci_ce_proxy.cpp | 75 bool NciCeProxy::AddAidRouting(const std::string &aidStr, int route, int aidInfo, in AddAidRouting() argument 79 return nciCeInterface_->AddAidRouting(aidStr, route, aidInfo, power); in AddAidRouting()
|
/foundation/communication/nfc/services/src/nci_adapter/nci_native_default/src/ |
H A D | nci_ce_impl_default.cpp | 50 bool NciCeImplDefault::AddAidRouting(const std::string &aidStr, int route, in AddAidRouting() argument 53 return RoutingManager::GetInstance().AddAidRouting(aidStr, route, aidInfo, in AddAidRouting()
|