[T106][ZXW-22]7520V3SCV2.01.01.02P42U09_VEC_V0.8_AP_VEC origin source commit
Change-Id: Ic6e05d89ecd62fc34f82b23dcf306c93764aec4b
diff --git a/ap/build/uClibc/test/inet/tst-ethers.c b/ap/build/uClibc/test/inet/tst-ethers.c
new file mode 100644
index 0000000..6b6e10c
--- /dev/null
+++ b/ap/build/uClibc/test/inet/tst-ethers.c
@@ -0,0 +1,33 @@
+#include <netinet/ether.h>
+#include <stdio.h>
+
+#define ETHER_LINE_LEN 256
+
+/* This test requires /etc/ethers to exist
+ * and to have host "teeth". For example:
+ * 00:11:22:33:44:55 teeth
+ */
+
+int main(void)
+{
+ struct ether_addr addr;
+ char host[ETHER_LINE_LEN];
+ int i;
+ int res = ether_hostton("teeth", &addr);
+
+ if (res)
+ return 1;
+
+ for (i = 0; i < 6; i++) {
+ printf("%02x", addr.ether_addr_octet[i]);
+ if (i < 5)
+ printf(":");
+ }
+
+ res = ether_ntohost(host, &addr);
+ if (res)
+ return 1;
+ printf(" %s\n", host);
+
+ return 0;
+}