SDK API to get network interface details

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

SDK API to get network interface details

1,411 次查看
Sreeshma
Contributor I

I am using imxrt1170 board with SDK 2.10.1 for testing TCP communication. I need to read the network interface details from my task. Similar to the linux api getifaddrs. I found that the stack keeps the network details in netif structure but couldn't find an API to get the same. Kindly please help.

0 项奖励
回复
2 回复数

1,397 次查看
Sreeshma
Contributor I

@danielchen thank u so much for the quick response.

If I call struct netif * netif_get_by_index(u8_t idex) from my task the execution gets aborted at sys_assert. Same is the case with netif_find. Exception occurs from LWIP_ASSERT_CORE_LOCKED();

I can use below APIs

unsigned int
lwip_if_nametoindex(const char *ifname)

char *
lwip_if_indextoname(unsigned int ifindex, char *ifname)

 

0 项奖励
回复

1,401 次查看
danielchen
NXP TechSupport
NXP TechSupport

Hi

 

Please refer to LwIP API

struct netif * netif_get_by_index(u8_t idex)

struct netif* netif_find(const char *name)

 

Please refer to below link for more details

https://www.nongnu.org/lwip/2_1_x/group__netif.html

 

Regards

Daniel

 

0 项奖励
回复