/ohos5.0/drivers/peripheral/wlan/wpa/interfaces/hdi_service/service_common/ |
H A D | wpa_hdi_util.c | 29 int ConvertMacToStr(const unsigned char *mac, int macSize, char *macStr, int strLen) in ConvertMacToStr() argument 31 if (mac == NULL || macStr == NULL || macSize != MAC_UINT_SIZE || strLen <= MAC_STRING_SIZE) { in ConvertMacToStr() 40 …if (snprintf_s(macStr, strLen, strLen - 1, "%02x:%02x:%02x:%02x:%02x:%02x", mac[posZero], mac[posO… in ConvertMacToStr() 61 int ConvertMacToArray(const char *macStr, unsigned char *mac, int macSize) in ConvertMacToArray() argument 63 …if (macStr == NULL || mac == NULL || macSize != MAC_UINT_SIZE || strlen(macStr) != MAC_STRING_SIZE… in ConvertMacToArray() 71 int8_t v = IsValidHexCharAndConvert(macStr[i]); in ConvertMacToArray() 79 if (macStr[i] != ':') { in ConvertMacToArray() 91 int CheckMacIsValid(const char *macStr) in CheckMacIsValid() argument 93 if (macStr == NULL || strlen(macStr) != MAC_STRING_SIZE) { in CheckMacIsValid() 98 int v = IsValidHexCharAndConvert(macStr[i]); in CheckMacIsValid() [all …]
|
H A D | wpa_hdi_util.h | 32 int ConvertMacToStr(const unsigned char *mac, int macSize, char *macStr, int strLen); 42 int ConvertMacToArray(const char *macStr, unsigned char *mac, int macSize); 50 int CheckMacIsValid(const char *macStr);
|
/ohos5.0/foundation/communication/wifi/wifi/test/wifi_standard/wifi_hal/unittest/ |
H A D | wifi_hal_common_func_test.cpp | 42 char macStr[MAC_LEN + 1] = "00:00:00:00:00:00"; variable 44 EXPECT_EQ(ConvertMacToStr(mac, macSize, macStr, strLen), -1); 49 char *macStr = NULL; variable 53 EXPECT_EQ(ConvertMacToStr(mac, macSize, macStr, strLen), -1); 60 char macStr[MAC_LEN + 1] = "00:00:00:00:00:00"; variable 69 char macStr[MAC_LEN + 1] = "00:00:00:00:00:00"; variable 78 char macStr[MAC_LEN + 1] = "00:00:00:00:00:00"; variable 93 const char *macStr = NULL; variable 95 EXPECT_EQ(ConvertMacToArray(macStr, mac, macSize), -1); 135 char *macStr = NULL; variable [all …]
|
/ohos5.0/foundation/communication/wifi/wifi/relation_services/common/ |
H A D | wifi_hal_common_func.c | 47 int ConvertMacToStr(const unsigned char *mac, int macSize, char *macStr, int strLen) in ConvertMacToStr() argument 49 if (mac == NULL || macStr == NULL || macSize != MAC_UINT_SIZE || strLen <= MAC_STRING_SIZE) { in ConvertMacToStr() 58 …if (snprintf_s(macStr, strLen, strLen - 1, "%02x:%02x:%02x:%02x:%02x:%02x", mac[posZero], mac[posO… in ConvertMacToStr() 79 int ConvertMacToArray(const char *macStr, unsigned char *mac, int macSize) in ConvertMacToArray() argument 81 …if (macStr == NULL || mac == NULL || macSize != MAC_UINT_SIZE || strlen(macStr) != MAC_STRING_SIZE… in ConvertMacToArray() 89 int8_t v = IsValidHexCharAndConvert(macStr[i]); in ConvertMacToArray() 97 if (macStr[i] != ':') { in ConvertMacToArray() 109 int CheckMacIsValid(const char *macStr) in CheckMacIsValid() argument 111 if (macStr == NULL || strlen(macStr) != MAC_STRING_SIZE) { in CheckMacIsValid() 116 int v = IsValidHexCharAndConvert(macStr[i]); in CheckMacIsValid() [all …]
|
H A D | wifi_hal_common_func.h | 41 int ConvertMacToStr(const unsigned char *mac, int macSize, char *macStr, int strLen); 51 int ConvertMacToArray(const char *macStr, unsigned char *mac, int macSize); 59 int CheckMacIsValid(const char *macStr);
|
/ohos5.0/foundation/communication/wifi/wifi/test/wifi_standard/wifi_framework/wifi_manage/wifi_native/client/hdi_client/hdi_interface/ |
H A D | wifi_hdi_wpa_sta_impl_test.cpp | 250 char macStr[MAC_LEN + 1] = "00:00:00:00:00:00"; variable 252 int result = ConvertMacToStr(mac, macSize, macStr, strLen); 258 char *macStr = NULL; variable 262 int result = ConvertMacToStr(mac, macSize, macStr, strLen); 270 char macStr[MAC_LEN + 1] = "00:00:00:00:00:00"; variable 280 char macStr[MAC_LEN + 1] = "00:00:00:00:00:00"; variable 290 char macStr[MAC_LEN + 1] = "00:00:00:00:00:00"; variable 300 char macStr[MAC_LEN + 1] = "00:00:00:00:00:00"; variable 310 char macStr[MAC_LEN + 1] = "00:00:00:00:00:00"; variable 318 char *macStr = NULL; variable [all …]
|
H A D | wifi_hdi_common_test.cpp | 128 char macStr[18] = "ab:cd:ef:gh:ij:kl"; variable 129 int result = CheckMacIsValid(macStr);
|
/ohos5.0/foundation/communication/dsoftbus/core/bus_center/lnn/net_buscenter/src/ |
H A D | lnn_bt_network_impl.c | 60 static int32_t GetAvailableBtMac(char *macStr, uint32_t len) in GetAvailableBtMac() argument 73 ret = ConvertBtMacToStr(macStr, len, mac.addr, sizeof(mac.addr)); in GetAvailableBtMac() 84 char macStr[BT_MAC_LEN] = {0}; in EnableBtSubnet() local 90 if (GetAvailableBtMac(macStr, sizeof(macStr)) != SOFTBUS_OK) { in EnableBtSubnet() 95 Anonymize(macStr, &anonyMac); in EnableBtSubnet() 98 return LnnSetLocalStrInfo(STRING_KEY_BT_MAC, macStr); in EnableBtSubnet() 154 char macStr[BT_MAC_LEN] = {0}; in GetBtRegistEvent() local 160 return GetAvailableBtMac(macStr, sizeof(macStr)) == SOFTBUS_OK ? in GetBtRegistEvent()
|
/ohos5.0/foundation/communication/dsoftbus/tests/core/bus_center/lnn/net_buscenter/ |
H A D | lnn_bt_network_impl_test.cpp | 225 char macStr[] = "123456789"; variable 230 int ret = GetAvailableBtMac(macStr, NETWORK_ID_BUF_LEN); 233 ret = GetAvailableBtMac(macStr, BT_MAC_LEN); 236 ret = GetAvailableBtMac(macStr, BT_MAC_LEN); 239 ret = GetAvailableBtMac(macStr, BT_MAC_LEN);
|
/ohos5.0/foundation/communication/dsoftbus/core/adapter/bus_center/src/ |
H A D | bus_center_adapter.c | 64 static int32_t SoftBusGetBleMacAddr(char *macStr, uint32_t len) in SoftBusGetBleMacAddr() argument 85 ret = ConvertReverseBtMacToStr(macStr, len, mac.addr, sizeof(mac.addr)); in SoftBusGetBleMacAddr() 93 (void)memset_s(macStr, len, 0, len); in SoftBusGetBleMacAddr()
|
/ohos5.0/foundation/communication/wifi/wifi/services/wifi_standard/wifi_framework/wifi_manage/ |
H A D | wifi_manager.cpp | 365 std::string macStr; in InstallPacketFilterProgram() local 366 WifiSettings::GetInstance().GetRealMacAddress(macStr, instId); in InstallPacketFilterProgram() 368 __FUNCTION__, OHOS::Wifi::MacAnonymize(macStr).c_str()); in InstallPacketFilterProgram() 369 if (OHOS::Wifi::MacStrToArray(macStr, macAddr) != EOK) { in InstallPacketFilterProgram()
|
/ohos5.0/foundation/communication/wifi/wifi/services/wifi_standard/wifi_framework/wifi_manage/wifi_native/client/idl_client/ |
H A D | wifi_idl_client.cpp | 167 unsigned char* macStr = macBytes.data(); in SetConnectMacAddr() local 179 unsigned char* macStr = macBytes.data(); in SetScanMacAddress() local 180 return SetScanningMacAddress(macStr, len); in SetScanMacAddress() 191 unsigned char* macStr = macBytes.data(); in DisconnectLastRoamingBssid() local 192 return DeauthLastRoamingBssid(macStr, len); in DisconnectLastRoamingBssid() 927 unsigned char* macStr = macBytes.data(); in AddBlockByMac() local 928 return SetMacFilter(macStr, len, id); in AddBlockByMac() 939 unsigned char* macStr = macBytes.data(); in DelBlockByMac() local 940 return DelMacFilter(macStr, len, id); in DelBlockByMac() 951 unsigned char* macStr = macBytes.data(); in RemoveStation() local [all …]
|
/ohos5.0/foundation/communication/dsoftbus/adapter/common/net/bluetooth/ble/ |
H A D | softbus_adapter_ble_gatt_client.c | 255 char macStr[BT_MAC_LEN] = {0}; in SoftbusGattcCheckExistConnectionByAddr() local 256 if (ConvertBtMacToStr(macStr, BT_MAC_LEN, btAddr->addr, sizeof(btAddr->addr)) != SOFTBUS_OK) { in SoftbusGattcCheckExistConnectionByAddr() 265 if (StrCmpIgnoreCase((const char *)it->addr, (const char *)macStr) == 0) { in SoftbusGattcCheckExistConnectionByAddr() 267 ConvertAnonymizeMacAddress(anomizeAddress, BT_MAC_LEN, macStr, BT_MAC_LEN); in SoftbusGattcCheckExistConnectionByAddr()
|
/ohos5.0/foundation/communication/wifi/wifi/services/wifi_standard/wifi_framework/wifi_manage/wifi_native/client/hdi_client/hdi_interface/ |
H A D | wifi_hdi_common.c | 809 int CheckMacIsValid(const char *macStr) in CheckMacIsValid() argument 811 if (macStr == NULL || strlen(macStr) != MAC_STRING_SIZE) { in CheckMacIsValid() 816 int v = IsValidHexCharAndConvert(macStr[i]); in CheckMacIsValid() 822 if (macStr[i] != ':') { in CheckMacIsValid()
|
H A D | wifi_hdi_wpa_sta_impl.h | 86 int ConvertMacToStr(char *mac, int macSize, char *macStr, int strLen);
|
H A D | wifi_hdi_common.h | 126 int CheckMacIsValid(const char *macStr);
|
H A D | wifi_hdi_wpa_sta_impl.c | 437 int ConvertMacToStr(char *mac, int macSize, char *macStr, int strLen) in ConvertMacToStr() argument 439 if (mac == NULL || macStr == NULL || macSize < ETH_ADDR_LEN || strLen <= HAL_BSSID_LENGTH) { in ConvertMacToStr() 448 …if (snprintf_s(macStr, strLen, strLen - 1, "%02x:%02x:%02x:%02x:%02x:%02x", mac[posZero], mac[posO… in ConvertMacToStr()
|
/ohos5.0/foundation/communication/wifi/wifi/services/wifi_standard/wifi_framework/wifi_toolkit/utils/ |
H A D | wifi_global_func.cpp | 199 int CheckMacIsValid(const std::string &macStr) in CheckMacIsValid() argument 201 if (macStr.length() != MAC_STRING_SIZE) { in CheckMacIsValid() 207 int8_t v = IsValidHexCharAndConvert(macStr[i]); in CheckMacIsValid() 213 if (macStr[i] != ':') { in CheckMacIsValid()
|
H A D | wifi_global_func.h | 81 int CheckMacIsValid(const std::string &macStr);
|
/ohos5.0/docs/zh-cn/contribute/ |
H A D | OpenHarmony-c-cpp-secure-coding-guide.md | 1760 // macStr中的数据格式为 e2:42:a4:52:1e:33 1761 int ret = sscanf(macStr, "%x:%x:%x:%x:%x:%x\n", 1774 // macStr中的数据格式为 e2:42:a4:52:1e:33 1775 int ret = sscanf(macStr, "%hhx:%hhx:%hhx:%hhx:%hhx:%hhx\n",
|
/ohos5.0/docs/en/contribute/ |
H A D | OpenHarmony-c-cpp-secure-coding-guide.md | 1818 // The data format in macStr is e2:42:a4:52:1e:33. 1819 int ret = sscanf(macStr, "%x:%x:%x:%x:%x:%x\n", 1833 // The data format in macStr is e2:42:a4:52:1e:33. 1834 int ret = sscanf(macStr, "%hhx:%hhx:%hhx:%hhx:%hhx:%hhx\n",
|