First page Back Continue Last page Overview Graphics
Interfaces
Name-to-index
- unsigned int if_nametoindex(const char *name);
Index-to-name
- char ifname[IF_NAMESIZE];
- char *if_indextoname(unsigned int ifindex, char *ifname);
All interfaces names and indexes
- struct if_nameindex *if_nameindex(void);
- where
struct if_nameindex {
unsigned int if_index; /* 1, 2, ... */
char *if_name; /* null terminated name: "lo", ... */
};
Free memory
- void struct if_freenameindex(struct if_nameindex *ptr)
- Free the dynamic memory allocated by if_nameindex()
Notes: