Home
last modified time | relevance | path

Searched refs:macStr (Results 1 – 21 of 21) sorted by relevance

/ohos5.0/drivers/peripheral/wlan/wpa/interfaces/hdi_service/service_common/
H A Dwpa_hdi_util.c29 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 Dwpa_hdi_util.h32 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 Dwifi_hal_common_func_test.cpp42 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 Dwifi_hal_common_func.c47 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 Dwifi_hal_common_func.h41 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 Dwifi_hdi_wpa_sta_impl_test.cpp250 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 Dwifi_hdi_common_test.cpp128 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 Dlnn_bt_network_impl.c60 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 Dlnn_bt_network_impl_test.cpp225 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 Dbus_center_adapter.c64 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 Dwifi_manager.cpp365 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 Dwifi_idl_client.cpp167 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 Dsoftbus_adapter_ble_gatt_client.c255 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 Dwifi_hdi_common.c809 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 Dwifi_hdi_wpa_sta_impl.h86 int ConvertMacToStr(char *mac, int macSize, char *macStr, int strLen);
H A Dwifi_hdi_common.h126 int CheckMacIsValid(const char *macStr);
H A Dwifi_hdi_wpa_sta_impl.c437 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 Dwifi_global_func.cpp199 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 Dwifi_global_func.h81 int CheckMacIsValid(const std::string &macStr);
/ohos5.0/docs/zh-cn/contribute/
H A DOpenHarmony-c-cpp-secure-coding-guide.md1760 // 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 DOpenHarmony-c-cpp-secure-coding-guide.md1818 // 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",