Created
June 9, 2017 11:08
-
-
Save haraldh/02ce31adf9aae8c020c43de7e9f5b6f7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <net/if.h> | |
#include <stdlib.h> | |
#include <stdio.h> | |
int main(int argc, char **argv) | |
{ | |
char ifname[IF_NAMESIZE+1]; | |
int ifindex = atoi(argv[1]); | |
if (if_indextoname( ifindex, ifname) != NULL) | |
puts(ifname); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment