/foundation/communication/dhcp/test/unittest/services/dhcp_server/unittest/ |
H A D | address_utils_test.cpp | 155 uint32_t endIp = LastIpAddress(beginIp, testNetmask); in HWTEST() local 156 ASSERT_TRUE(endIp != 0); in HWTEST() 165 EXPECT_FALSE(IpInRange(testIp1, beginIp, endIp, testNetmask)); in HWTEST() 166 EXPECT_FALSE(IpInRange(testIp2, beginIp, endIp, testNetmask)); in HWTEST() 167 EXPECT_TRUE(IpInRange(testIp3, beginIp, endIp, testNetmask)); in HWTEST()
|
H A D | dhcp_s_server_test.cpp | 77 uint32_t endIp = ParseIpAddr("192.168.189.200"); in InitServerConfig() local 78 if (serverId == 0 || netmask == 0 || beginIp == 0 || endIp == 0) { in InitServerConfig() 94 config->pool.endAddress = endIp; in InitServerConfig()
|
H A D | dhcp_address_pool_test.cpp | 55 uint32_t endIp = ParseIpAddr("192.168.100.150"); in SamplePoolConfig() local 59 if (beginIp != 0 && endIp != 0 && netmask != 0 && gateway != 0) { in SamplePoolConfig() 61 testPool.addressRange.endAddress = endIp; in SamplePoolConfig()
|
/foundation/communication/netmanager_base/frameworks/native/netmanagernative/ |
H A D | netfirewall_parcel.cpp | 39 parcel.WriteUint32(ipv4.endIp.s_addr);
in Marshalling() 46 parcel.WriteUint8(ipv6.endIp.s6_addr[index]);
in Marshalling() 68 parcel.ReadUint32(ptr->ipv4.endIp.s_addr);
in Unmarshalling() 75 parcel.ReadUint8(ptr->ipv6.endIp.s6_addr[index]);
in Unmarshalling() 121 inet_ntop(AF_INET, &(this->ipv4.endIp), ip, INET_ADDRSTRLEN);
in GetEndIp() 123 inet_ntop(AF_INET6, &(this->ipv6.endIp), ip, INET6_ADDRSTRLEN);
in GetEndIp()
|
/foundation/communication/netmanager_ext/services/netfirewallmanager/src/ |
H A D | netfirewall_default_rule_parser.cpp | 185 cJSON *endIp = cJSON_GetObjectItem(mem, NET_FIREWALL_IP_END.c_str()); in ConvertIpParamToConfig() local 186 if (endIp != nullptr && cJSON_IsString(endIp)) { in ConvertIpParamToConfig() 187 tmp = cJSON_GetStringValue(endIp); in ConvertIpParamToConfig() 189 inet_pton(AF_INET, tmp.c_str(), &rule.ipv4.endIp); in ConvertIpParamToConfig() 191 inet_pton(AF_INET6, tmp.c_str(), &rule.ipv6.endIp); in ConvertIpParamToConfig()
|
H A D | netfirewall_db_helper.cpp | 914 memcpy_s(&dbip.ipv4.endIp, sizeof(uint32_t), ¶m.ipv4.endIp, sizeof(uint32_t));
in FirewallIpToDbIp() 917 memcpy_s(&dbip.ipv6.endIp, sizeof(in6_addr), ¶m.ipv6.endIp, sizeof(in6_addr));
in FirewallIpToDbIp() 932 memcpy_s(&dbip.ipv4.endIp, sizeof(uint32_t), ¶m.ipv4.endIp, sizeof(uint32_t));
in DbIpToFirewallIp() 935 memcpy_s(&dbip.ipv6.endIp, sizeof(in6_addr), ¶m.ipv6.endIp, sizeof(in6_addr));
in DbIpToFirewallIp()
|
/foundation/communication/netmanager_ext/frameworks/js/napi/netfirewall/src/context/ |
H A D | net_firewall_rule_parse.cpp | 49 std::string endIp;
in ParseIpList() local 59 endIp = NapiUtils::GetStringPropertyUtf8(env, valAttr, NET_FIREWALL_IP_END);
in ParseIpList() 64 inet_pton(AF_INET, endIp.c_str(), ¶m.ipv4.endIp);
in ParseIpList() 69 inet_pton(AF_INET6, endIp.c_str(), ¶m.ipv6.endIp);
in ParseIpList()
|
H A D | net_firewall_param_check.cpp | 163 bool NetFirewallParamCheck::CheckIpAddress(const std::string &startIp, const std::string &endIp, const int32_t family)
in CheckIpAddress() argument 172 endRet = inet_pton(AF_INET6, endIp.c_str(), &in6_addr2);
in CheckIpAddress() 174 NETMANAGER_EXT_LOGE("CheckIpAddress ipv6: startIp or endIp is invalid");
in CheckIpAddress() 180 NETMANAGER_EXT_LOGE("CheckIpAddress ipv6: start Ip is larger than endIp");
in CheckIpAddress() 189 endRet = inet_pton(AF_INET, endIp.c_str(), &inAddr2);
in CheckIpAddress() 191 NETMANAGER_EXT_LOGE("CheckIpAddress ipv4: startIp or endIp is invalid");
in CheckIpAddress() 196 NETMANAGER_EXT_LOGE("CheckIpAddress ipv4: start Ip is larger than endIp");
in CheckIpAddress() 260 NETMANAGER_EXT_LOGE("params ip type2 but no startIp or endIp");
in CheckMultipleIp() 269 std::string endIp =
in CheckMultipleIp() local 271 if (CheckIpAddress(startIp, endIp, famil in CheckMultipleIp() [all...] |
/foundation/communication/dhcp/services/dhcp_server/src/ |
H A D | address_utils.cpp | 104 int IpInRange(uint32_t ip, uint32_t beginIp, uint32_t endIp, uint32_t netmask) in IpInRange() argument 108 uint32_t secondNet = NetworkAddress(endIp, netmask); in IpInRange() 112 if (ip >= beginIp && ip <= endIp) { in IpInRange()
|
H A D | dhcp_address_pool.cpp | 139 uint32_t endIp = pool->addressRange.endAddress; in CheckRangeAvailability() local 140 if (IpInRange(distIp, beginIp, endIp, pool->netmask)) { in CheckRangeAvailability() 494 uint32_t endIp = pool->addressRange.endAddress; in LoadBindingRecoders() local 506 if (IpInRange(bind.ipAddress, beginIp, endIp, netmask)) { in LoadBindingRecoders()
|
/foundation/communication/netmanager_ext/frameworks/js/napi/netfirewall/include/context/ |
H A D | net_firewall_param_check.h | 76 * @param endIp Terminate IP
80 static bool CheckIpAddress(const std::string &startIp, const std::string &endIp, const int32_t family);
|
/foundation/communication/dhcp/services/dhcp_server/include/ |
H A D | address_utils.h | 35 int IpInRange(uint32_t ip, uint32_t beginIp, uint32_t endIp, uint32_t netmask);
|
/foundation/communication/netmanager_ext/services/networksharemanager/src/ |
H A D | networkshare_sub_statemachine.cpp | 759 std::string endIp; in StartDhcp() local 761 if (!CheckConfig(endIp, mask)) { in StartDhcp() 777 std::string strEndip = ipHead + "." + endIp; in StartDhcp() 827 bool NetworkShareSubStateMachine::CheckConfig(std::string &endIp, std::string &mask) in CheckConfig() argument 833 endIp = configuration_->GetDhcpEndIP(); in CheckConfig() 834 if (endIp.empty()) { in CheckConfig()
|
/foundation/communication/netmanager_ext/services/networksharemanager/include/ |
H A D | networkshare_sub_statemachine.h | 122 bool CheckConfig(std::string &endIp, std::string &mask);
|
/foundation/communication/netmanager_base/interfaces/innerkits/netmanagernative/include/ |
H A D | netfirewall_parcel.h | 68 const std::string NET_FIREWALL_IP_END = "endIp";
129 in_addr endIp;
member 133 in6_addr endIp;
member
|
/foundation/communication/netmanager_ext/services/netfirewallmanager/include/ |
H A D | netfirewall_db_helper.h | 79 in_addr endIp;
member 83 in6_addr endIp;
member
|
/foundation/communication/dhcp/test/fuzztest/addressutils_fuzzer/ |
H A D | addressutils_fuzzer.cpp | 85 uint32_t endIp = static_cast<uint32_t>(data[index++]); in IpInRangeTest() local 87 IpInRange(ip, beginIp, endIp, netmask); in IpInRangeTest()
|
/foundation/communication/netmanager_base/services/netmanagernative/bpf/src/ |
H A D | bitmap_manager.cpp | 193 int32_t ret = IpParamParser::GetIp4AndMask(item.ipv4.startIp, item.ipv4.endIp, ips); in InsertIp4SegBitmap() 218 int32_t ret = IpParamParser::GetIp6AndMask(item.ipv6.startIp, item.ipv6.endIp, ips); in InsertIp6SegBitmap() 416 uint32_t IpParamParser::GetMask(uint32_t startIp, uint32_t endIp) in GetMask() argument 420 if (((startIp >> i) & VALUE_ONE) != ((endIp >> i) & VALUE_ONE)) { in GetMask()
|
/foundation/communication/netmanager_base/test/netconnmanager/unittest/net_conn_add_test/ |
H A D | netfirewall_client_test.cpp | 92 inet_pton(AF_INET, ss.str().c_str(), &localParam.ipv4.endIp); in GetIpList() 95 inet_pton(AF_INET6, ss.str().c_str(), &localParam.ipv6.endIp); in GetIpList()
|
/foundation/communication/netmanager_ext/test/netfirewallmanager/unittest/netfirewallmanager_test/ |
H A D | netfirewall_client_test.cpp | 92 inet_pton(AF_INET, ss.str().c_str(), &localParam.ipv4.endIp);
in GetIpList() 95 inet_pton(AF_INET6, ss.str().c_str(), &localParam.ipv6.endIp);
in GetIpList()
|
/foundation/communication/netmanager_base/services/netmanagernative/bpf/include/ |
H A D | bitmap_manager.h | 217 * get biggest mask from startIp and endIp 220 * @param endIp end ip 224 static uint32_t GetMask(uint32_t startIp, uint32_t endIp);
|