SDK API to get network interface details

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

SDK API to get network interface details

626 Views
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 Kudos
2 Replies

612 Views
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 Kudos

616 Views
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 Kudos