|
|
| version 1.4, 2013/12/15 22:57:20 | version 1.4.12.2, 2016/08/11 16:23:43 |
|---|---|
| Line 1 | Line 1 |
| #ifdef __linux__ | |
| int main() | |
| { | |
| return 0; | |
| } | |
| #else | |
| #include <stdio.h> | #include <stdio.h> |
| #include <stdlib.h> | #include <stdlib.h> |
| #include <fcntl.h> | #include <fcntl.h> |
| Line 248 main(int argc, char **argv) | Line 255 main(int argc, char **argv) |
| u_int n, count = (u_int) -1; | u_int n, count = (u_int) -1; |
| register int i; | register int i; |
| int dev, fd, ret, siz = 0; | int dev, fd, ret, siz = 0; |
| char szStr[BUFSIZ], szEA[STRSIZ], szMap[MAXPATHLEN] = { 0 }, *buffer = NULL; | char szStr[BUFSIZ], szMap[MAXPATHLEN] = { 0 }, *buffer = NULL; |
| struct ifreq ifr; | struct ifreq ifr; |
| struct pollfd pfd = { 0 }; | struct pollfd pfd = { 0 }; |
| pthread_t tid; | pthread_t tid; |
| Line 291 main(int argc, char **argv) | Line 298 main(int argc, char **argv) |
| else | else |
| strlcpy(szStr, *argv, sizeof szStr); | strlcpy(szStr, *argv, sizeof szStr); |
| printf("io_getmaciface(%s) -> %d\n", szStr, io_getmaciface(szStr, &ea)); | |
| e_ether_ntoa(&ea, szEA, sizeof szEA); | |
| printf("ethernet address is %s\n", szEA); | |
| #ifdef __FreeBSD__ | #ifdef __FreeBSD__ |
| dev = io_etherOpen(szStr, O_RDWR | O_NONBLOCK, 42, 0, (u_int*) &siz, (flg) ? &bz : NULL); | dev = io_etherOpen(szStr, O_RDWR | O_NONBLOCK, 42, 0, (u_int*) &siz, (flg) ? &bz : NULL); |
| if (dev == -1) | if (dev == -1) |
| Line 375 main(int argc, char **argv) | Line 378 main(int argc, char **argv) |
| printf("0.%09lu per/iteration\n", ts_end.tv_sec + ts_end.tv_nsec / i); | printf("0.%09lu per/iteration\n", ts_end.tv_sec + ts_end.tv_nsec / i); |
| return 0; | return 0; |
| } | } |
| #endif |