Home
last modified time | relevance | path

Searched refs:macAddr (Results 1 - 25 of 102) sorted by relevance

12345

/foundation/communication/dhcp/services/dhcp_server/src/
H A Ddhcp_address_pool.cpp39 //Write a HASH FUNCTION FOR uint8_t macAddr[DHCP_HWADDR_LENGTH]
40 std::size_t macAddrHash(uint8_t macAddr[DHCP_HWADDR_LENGTH]) in macAddrHash() argument
44 hash = ((hash << HASH_CAL_CODE_CAL) + hash) ^ static_cast<std::size_t>(macAddr[i]); in macAddrHash()
50 AddressBinding *GetBindingByMac(uint8_t macAddr[DHCP_HWADDR_LENGTH]) in GetBindingByMac() argument
52 std::size_t hash = macAddrHash(macAddr); in GetBindingByMac()
60 AddressBinding *QueryBinding(uint8_t macAddr[DHCP_HWADDR_LENGTH], PDhcpOptionList cliOptins) in QueryBinding() argument
62 return GetBindingByMac(macAddr); in QueryBinding()
65 AddressBinding *AddNewBinding(uint8_t macAddr[DHCP_HWADDR_LENGTH], PDhcpOptionList cliOptins) in AddNewBinding() argument
70 if (memcpy_s(newBind.chaddr, DHCP_HWADDR_LENGTH, macAddr, DHCP_HWADDR_LENGTH) != EOK) { in AddNewBinding()
80 g_bindingRecoders[macAddrHash(macAddr)] in AddNewBinding()
85 CheckIpAvailability(DhcpAddressPool *pool, uint8_t macAddr[DHCP_HWADDR_LENGTH], uint32_t distIp) CheckIpAvailability() argument
127 CheckRangeAvailability( DhcpAddressPool *pool, uint8_t macAddr[DHCP_HWADDR_LENGTH], uint32_t distIp, int *outOfRange) CheckRangeAvailability() argument
180 AddressDistribute(DhcpAddressPool *pool, uint8_t macAddr[DHCP_HWADDR_LENGTH]) AddressDistribute() argument
289 IsReserved(uint8_t macAddr[DHCP_HWADDR_LENGTH]) IsReserved() argument
341 AddReservedBinding(uint8_t macAddr[DHCP_HWADDR_LENGTH]) AddReservedBinding() argument
357 RemoveBinding(uint8_t macAddr[DHCP_HWADDR_LENGTH]) RemoveBinding() argument
367 RemoveReservedBinding(uint8_t macAddr[DHCP_HWADDR_LENGTH]) RemoveReservedBinding() argument
381 ReleaseBinding(uint8_t macAddr[DHCP_HWADDR_LENGTH]) ReleaseBinding() argument
[all...]
H A Daddress_utils.cpp207 char *ParseStrMac(const uint8_t *macAddr, size_t addrSize) in ParseStrMac() argument
210 if (!macAddr || addrSize < MAC_ADDR_LENGTH) { in ParseStrMac()
214 sprintf_s(strMacAddr, MAD_ADDR_BUF_SIZE, "%02x:%02x:%02x:%02x:%02x:%02x", macAddr[MAI_ZERO], in ParseStrMac()
215 macAddr[MAI_ONE], macAddr[MAI_TWO], macAddr[MAI_THREE], macAddr[MAI_FOUR], macAddr[MAI_FIVE]) < 0) { in ParseStrMac()
235 int ParseMacAddress(const char *strMac, uint8_t macAddr[DHCP_HWADDR_LENGTH]) in ParseMacAddress() argument
257 macAddr[ in ParseMacAddress()
276 ParseLogMac(uint8_t macAddr[DHCP_HWADDR_LENGTH]) ParseLogMac() argument
290 IsEmptyHWAddr(const uint8_t macAddr[DHCP_HWADDR_LENGTH]) IsEmptyHWAddr() argument
[all...]
/foundation/communication/dhcp/services/dhcp_server/include/
H A Ddhcp_address_pool.h29 typedef AddressBinding *(*QueryBind)(uint8_t macAddr[DHCP_HWADDR_LENGTH], PDhcpOptionList cliOptins);
30 typedef AddressBinding *(*AddBind)(uint8_t macAddr[DHCP_HWADDR_LENGTH], PDhcpOptionList cliOptins);
31 typedef uint32_t (*Distribute)(DhcpAddressPool *pool, uint8_t macAddr[DHCP_HWADDR_LENGTH]);
59 int IsReserved(uint8_t macAddr[DHCP_HWADDR_LENGTH]);
62 int AddReservedBinding(uint8_t macAddr[DHCP_HWADDR_LENGTH]);
63 int RemoveReservedBinding(uint8_t macAddr[DHCP_HWADDR_LENGTH]);
64 int RemoveBinding(uint8_t macAddr[DHCP_HWADDR_LENGTH]);
65 int ReleaseBinding(uint8_t macAddr[DHCP_HWADDR_LENGTH]);
72 AddressBinding *QueryBinding(uint8_t macAddr[DHCP_HWADDR_LENGTH], PDhcpOptionList cliOptins);
H A Daddress_utils.h44 int IsEmptyHWAddr(const uint8_t macAddr[DHCP_HWADDR_LENGTH]);
45 char *ParseStrMac(const uint8_t *macAddr, size_t addrSize);
46 int ParseMacAddress(const char *strMac, uint8_t macAddr[DHCP_HWADDR_LENGTH]);
50 char *ParseLogMac(uint8_t macAddr[DHCP_HWADDR_LENGTH]);
/foundation/communication/wifi/wifi/test/wifi_standard/wifi_framework/wifi_manage/wifi_sta/
H A Dmulti_gateway_test.cpp53 std::string macAddr = ""; in HWTEST_F() local
54 EXPECT_TRUE(DelayedSingleton<MultiGateway>::GetInstance()->SetStaticArp(iface, ipAddr, macAddr) == -1); in HWTEST_F()
56 EXPECT_TRUE(DelayedSingleton<MultiGateway>::GetInstance()->SetStaticArp(iface, ipAddr, macAddr) == -1); in HWTEST_F()
58 EXPECT_TRUE(DelayedSingleton<MultiGateway>::GetInstance()->SetStaticArp(iface, ipAddr, macAddr) == -1); in HWTEST_F()
59 macAddr = "00:00:11:11:11:11"; in HWTEST_F()
60 DelayedSingleton<MultiGateway>::GetInstance()->SetStaticArp(iface, ipAddr, macAddr); in HWTEST_F()
84 const char *macAddr = nullptr; in HWTEST_F() local
85 EXPECT_TRUE(DelayedSingleton<MultiGateway>::GetInstance()->GetMacAddr(buff, macAddr) == -1); in HWTEST_F()
87 EXPECT_TRUE(DelayedSingleton<MultiGateway>::GetInstance()->GetMacAddr(buff1, macAddr) == -1); in HWTEST_F()
/foundation/communication/netmanager_base/test/netmanagernative/unittest/netsys_manager_test/
H A Dinterface_manager_test.cpp212 std::string macAddr; in HWTEST_F() local
214 auto ret = InterfaceManager::AddStaticArp(ipAddr, macAddr, ifName); in HWTEST_F()
221 std::string macAddr; in HWTEST_F() local
223 auto ret = InterfaceManager::DelStaticArp(ipAddr, macAddr, ifName); in HWTEST_F()
230 std::string macAddr; in HWTEST_F() local
233 auto ret = InterfaceManager::AssembleArp(ipAddr, macAddr, ifName, req); in HWTEST_F()
237 ret = InterfaceManager::AssembleArp(ipAddr, macAddr, ifName, req); in HWTEST_F()
244 std::string macAddr = "08:00:20:0A:8C:6D"; in HWTEST_F() local
249 auto ret = InterfaceManager::AssembleArp(ipAddr, macAddr, ifName, req); in HWTEST_F()
255 std::string macAddr; in HWTEST_F() local
414 std::string macAddr = "aa:bb:cc:dd:ee:ff"; HWTEST_F() local
424 std::string macAddr = "aa:bb:cc:dd:ee:ff"; HWTEST_F() local
439 std::string macAddr = "aa:bb:cc:dd:ee:ff"; HWTEST_F() local
[all...]
H A Dnet_manager_native_test.cpp176 std::string macAddr = "aa:bb:cc:dd:ee:ff"; in HWTEST_F() local
178 auto ret = instance_->AddStaticArp(ipAddr, macAddr, ifName); in HWTEST_F()
185 std::string macAddr = "aa:bb:cc:dd:ee:ff"; in HWTEST_F() local
187 auto ret = instance_->DelStaticArp(ipAddr, macAddr, ifName); in HWTEST_F()
/foundation/communication/netmanager_base/services/netmanagernative/include/manager/
H A Dinterface_manager.h121 static int32_t AddStaticArp(const std::string &ipAddr, const std::string &macAddr,
123 static int32_t DelStaticArp(const std::string &ipAddr, const std::string &macAddr,
128 static int32_t AssembleArp(const std::string &ipAddr, const std::string &macAddr,
130 static int32_t MacStringToArray(const std::string &macAddr, sockaddr &macSock);
/foundation/communication/wifi/wifi/services/wifi_standard/wifi_framework/wifi_manage/wifi_self_cure/
H A Dmulti_gateway.cpp94 int32_t MultiGateway::SetStaticArp(const std::string& iface, const std::string& ipAddr, const std::string& macAddr) in SetStaticArp() argument
100 if (iface.empty() || ipAddr.empty() || macAddr.empty()) { in SetStaticArp()
118 if (GetMacAddr(reinterpret_cast<char *>(req.arp_ha.sa_data), macAddr.c_str()) < 0) { in SetStaticArp()
169 int32_t MultiGateway::GetMacAddr(char *buff, const char *macAddr) in GetMacAddr() argument
172 if (buff == nullptr || macAddr == nullptr) { in GetMacAddr()
173 WIFI_LOGE("buff or macAddr is nullptr"); in GetMacAddr()
177 if (sscanf_s(macAddr, "%x:%x:%x:%x:%x:%x", &addr[MAC_INDEX_0], &addr[MAC_INDEX_1], &addr[MAC_INDEX_2], in GetMacAddr()
179 WIFI_LOGE("sscanf_s macAddr err"); in GetMacAddr()
H A Dmulti_gateway.h31 int32_t SetStaticArp(const std::string& iface, const std::string& ipAddr, const std::string& macAddr);
35 int32_t GetMacAddr(char *buff, const char *macAddr);
/foundation/communication/dhcp/test/fuzztest/dhcpaddresspool_fuzzer/
H A Ddhcpaddresspool_fuzzer.cpp56 uint8_t macAddr[DHCP_HWADDR_LENGTH]; in DhcpAddressPoolFuzzTest() local
60 AddReservedBinding(&macAddr[0]); in DhcpAddressPoolFuzzTest()
61 RemoveReservedBinding(&macAddr[0]); in DhcpAddressPoolFuzzTest()
62 RemoveBinding(&macAddr[0]); in DhcpAddressPoolFuzzTest()
70 QueryBinding(macAddr, &options); in DhcpAddressPoolFuzzTest()
/foundation/communication/dsoftbus/tests/core/connection/wifi_direct_cpp/
H A Dnet_conn_client.h59 virtual int32_t AddStaticArp(const std::string &ipAddr, const std::string &macAddr, const std::string &ifName);
60 virtual int32_t DelStaticArp(const std::string &ipAddr, const std::string &macAddr, const std::string &ifName);
74 AddStaticArp, int32_t(const std::string &ipAddr, const std::string &macAddr, const std::string &ifName));
78 DelStaticArp, int32_t(const std::string &ipAddr, const std::string &macAddr, const std::string &ifName));
H A Dnet_conn_client.cpp18 const std::string &ipAddr, const std::string &macAddr, const std::string &ifName) in AddStaticArp()
24 return mock->AddStaticArp(ipAddr, macAddr, ifName); in AddStaticArp()
28 const std::string &ipAddr, const std::string &macAddr, const std::string &ifName) in DelStaticArp()
34 return mock->DelStaticArp(ipAddr, macAddr, ifName); in DelStaticArp()
17 AddStaticArp( const std::string &ipAddr, const std::string &macAddr, const std::string &ifName) AddStaticArp() argument
27 DelStaticArp( const std::string &ipAddr, const std::string &macAddr, const std::string &ifName) DelStaticArp() argument
/foundation/communication/wifi_aware/interfaces/kits/
H A Dwifiaware.h104 * @param macAddr Indicates the MAC address of the device that sends the message.
114 typedef int (*RecvCallback)(unsigned char* macAddr, unsigned char peerHandle, unsigned char localHandle,
169 * @param macAddr Indicates the MAC address of the peer device. It contains 6 bytes.
180 int SendData(unsigned char* macAddr, unsigned char peerHandle, unsigned char localHandle,
/foundation/communication/wifi_aware/hals/
H A Dhal_wifiaware.h31 typedef int (*HalRecvCallback)(unsigned char* macAddr, unsigned char peerHandle, unsigned char localHandle,
40 int HalWifiSdpSend(unsigned char* macAddr, unsigned char peerHandle, unsigned char localHandle,
/foundation/communication/netmanager_base/services/netmanagernative/src/manager/
H A Dinterface_manager.cpp431 int32_t InterfaceManager::AddStaticArp(const std::string &ipAddr, const std::string &macAddr, in AddStaticArp() argument
436 int32_t res = AssembleArp(ipAddr, macAddr, ifName, req); in AddStaticArp()
452 int32_t InterfaceManager::DelStaticArp(const std::string &ipAddr, const std::string &macAddr, in DelStaticArp() argument
457 int32_t res = AssembleArp(ipAddr, macAddr, ifName, req); in DelStaticArp()
473 int32_t InterfaceManager::AssembleArp(const std::string &ipAddr, const std::string &macAddr, in AssembleArp() argument
481 if (!regex_match(macAddr, REGEX_CMD_MAC_ADDRESS)) { in AssembleArp()
482 NETNATIVE_LOGE("macAddr error"); in AssembleArp()
488 if (MacStringToArray(macAddr, ethAddrStruct) != 0) { in AssembleArp()
515 int32_t InterfaceManager::MacStringToArray(const std::string &macAddr, sockaddr &macSock) in MacStringToArray() argument
520 if (memcpy_s(strAddr, MAC_ADDRESS_STR_LEN, macAddr in MacStringToArray()
[all...]
/foundation/communication/wifi/wifi/test/wifi_standard/wifi_framework/wifi_toolkit/unittest/
H A Dmac_address_test.cpp103 unsigned char macAddr[MAC_LEN] = {0}; in HWTEST_F() local
104 EXPECT_FALSE(MacAddress::GetMacAddr(ifName, macAddr)); in HWTEST_F()
/foundation/communication/dhcp/test/fuzztest/addressutils_fuzzer/
H A Daddressutils_fuzzer.cpp145 uint8_t* macAddr = nullptr; in ParseStrMacTest() local
147 ParseStrMac(macAddr, addrSize); in ParseStrMacTest()
153 uint8_t macAddr[DHCP_HWADDR_LENGTH]; in ParseMacAddressTest() local
154 (void)ParseMacAddress(strMac, &macAddr[0]); in ParseMacAddressTest()
180 uint8_t macAddr[DHCP_HWADDR_LENGTH]; in ParseLogMacTest() local
181 ParseLogMac(&macAddr[0]); in ParseLogMacTest()
/foundation/communication/dhcp/services/dhcp_client/src/
H A Ddhcp_ipv6_client.cpp370 char macAddr[MAC_ADDR_LEN * MAC_ADDR_CHAR_NUM]; in IsEui64ModeIpv6Address() local
371 if (memset_s(macAddr, sizeof(macAddr), 0, sizeof(macAddr)) != EOK) { in IsEui64ModeIpv6Address()
375 MacChConToMacStr(ifaceMac, MAC_ADDR_LEN, macAddr, sizeof(macAddr)); in IsEui64ModeIpv6Address()
376 std::string localMacString = macAddr; in IsEui64ModeIpv6Address()
383 if (macAddr[macPosition + POSITION_OFFSET_1] == ipv6addr[ipv6position + POSITION_OFFSET_3] && in IsEui64ModeIpv6Address()
384 macAddr[macPosition + POSITION_OFFSET_2] == ipv6addr[ipv6position + POSITION_OFFSET_4] && in IsEui64ModeIpv6Address()
385 macAddr[macPositio in IsEui64ModeIpv6Address()
[all...]
H A Ddhcp_client_state_machine.cpp254 char macAddr[MAC_ADDR_LEN * MAC_ADDR_CHAR_NUM]; in GetClientNetworkInfo() local
255 if (memset_s(macAddr, sizeof(macAddr), 0, sizeof(macAddr)) != EOK) { in GetClientNetworkInfo()
259 MacChConToMacStr(m_cltCnf.ifaceMac, MAC_ADDR_LEN, macAddr, sizeof(macAddr)); in GetClientNetworkInfo()
261 m_cltCnf.ifaceName, m_cltCnf.ifaceIndex, macAddr); in GetClientNetworkInfo()
1552 char macAddr[MAC_ADDR_LEN * MAC_ADDR_CHAR_NUM] = {0}; in AddClientIdToOpts() local
1553 MacChConToMacStr(m_cltCnf.ifaceMac, MAC_ADDR_LEN, macAddr, sizeof(macAddr)); in AddClientIdToOpts()
1867 char macAddr[MAC_ADDR_CHAR_NUM * MAC_ADDR_LEN]; IsArpReachable() local
[all...]
/foundation/communication/wifi_aware/frameworks/source/
H A Dwifiaware.c78 int SendData(unsigned char* macAddr, unsigned char peerHandle, unsigned char localHandle, in SendData() argument
81 if (HalWifiSdpSend(macAddr, peerHandle, localHandle, msg, len) != 0) { in SendData()
/foundation/communication/dsoftbus/core/bus_center/lnn/net_ledger/common/include/
H A Dlnn_connect_info.h36 char macAddr[MAC_LEN]; member
/foundation/communication/bluetooth_service/services/bluetooth/service/src/ble/
H A Dble_properties.cpp172 std::string macAddr = pimpl->macAddr_; in UpdateConfig() local
174 [macAddr](IAdapterBleObserver &observer) { observer.OnDeviceAddrChanged(macAddr); }); in UpdateConfig()
/foundation/communication/wifi/wifi/services/wifi_standard/wifi_framework/wifi_toolkit/net_helper/
H A Dmac_address.h73 * @param macAddr - Array for storing returned mac data
76 static bool GetMacAddr(const std::string& ifName, unsigned char macAddr[MAC_LEN]);
H A Dmac_address.cpp140 bool MacAddress::GetMacAddr(const std::string& ifName, unsigned char macAddr[MAC_LEN]) in GetMacAddr() argument
161 if (memcpy_s(macAddr, ETH_ALEN, ifr.ifr_hwaddr.sa_data, ETH_ALEN) != EOK) { in GetMacAddr()

Completed in 15 milliseconds

12345