#include <fcntl.h>
#include <sys/socket.h>
#include <netinet/in.h>
+#include <net/if.h>
#include <string.h>
#include "libnetlink.h"
struct idxmap
{
struct idxmap * next;
- int index;
+ unsigned index;
int type;
int alen;
unsigned flags;
return 0;
}
-const char *ll_idx_n2a(int idx, char *buf)
+const char *ll_idx_n2a(unsigned idx, char *buf)
{
struct idxmap *im;
}
-const char *ll_index_to_name(int idx)
+const char *ll_index_to_name(unsigned idx)
{
static char nbuf[16];
return ll_idx_n2a(idx, nbuf);
}
-int ll_index_to_type(int idx)
+int ll_index_to_type(unsigned idx)
{
struct idxmap *im;
return -1;
}
-unsigned ll_index_to_flags(int idx)
+unsigned ll_index_to_flags(unsigned idx)
{
struct idxmap *im;
return 0;
}
-int ll_name_to_index(const char *name)
+unsigned ll_name_to_index(const char *name)
{
static char ncache[16];
static int icache;
}
}
}
- return 0;
+
+ return if_nametoindex(name);
}
int ll_init_map(struct rtnl_handle *rth)