diff --git a/src/tests/kits/net/Jamfile b/src/tests/kits/net/Jamfile index ce66439eab..f133901cc1 100644 --- a/src/tests/kits/net/Jamfile +++ b/src/tests/kits/net/Jamfile @@ -19,6 +19,8 @@ SimpleTest link_echo : link_echo.cpp : $(TARGET_NETWORK_LIBS) bnetapi be ; SimpleTest getpeername : getpeername.cpp : $(TARGET_NETWORK_LIBS) ; +SimpleTest if_nameindex : if_nameindex.c : $(TARGET_NETWORK_LIBS) ; + SimpleTest tcp_connection_test : tcp_connection_test.cpp : $(TARGET_NETWORK_LIBS) ; diff --git a/src/tests/kits/net/if_nameindex.c b/src/tests/kits/net/if_nameindex.c new file mode 100644 index 0000000000..b277ed05d6 --- /dev/null +++ b/src/tests/kits/net/if_nameindex.c @@ -0,0 +1,17 @@ +#include +#include +#include + +int main(int argc, char *argv[]) +{ + struct if_nameindex *ifs; + int i; + + ifs = if_nameindex(); + if (ifs == NULL) { perror("if_nameindex"); exit(EXIT_FAILURE); } + + for (i = 0; ifs[i].if_index != 0 || ifs[i].if_name != NULL; i++) { + printf("%d %s\n", ifs[i].if_index, ifs[i].if_name); + } + return EXIT_SUCCESS; +}