SDK API to get network interface details

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

SDK API to get network interface details

1,416件の閲覧回数
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,402件の閲覧回数
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,406件の閲覧回数
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 件の賞賛
返信