|
version 1.1.2.1, 2013/06/25 09:08:10
|
version 1.1.2.4, 2013/06/25 16:42:41
|
|
Line 37
|
Line 37
|
| #include <netinet/if_ether.h> |
#include <netinet/if_ether.h> |
| #endif |
#endif |
| |
|
| |
#include <aitio.h> |
| |
|
| #ifndef roundup |
#ifndef roundup |
| #define roundup(x, y) ((((x) + ((y) - 1)) / (y)) * (y)) /* to any y */ |
#define roundup(x, y) ((((x) + ((y) - 1)) / (y)) * (y)) /* to any y */ |
| #endif |
#endif |
|
Line 261 main(int argc, char **argv)
|
Line 263 main(int argc, char **argv)
|
| pthread_t tid; |
pthread_t tid; |
| char ch, mode = 'R'; |
char ch, mode = 'R'; |
| struct timespec ts_start, ts_end; |
struct timespec ts_start, ts_end; |
| #ifdef __FreeBSD__ | void *bz = NULL; |
| struct bpf_zbuf *bz; | |
| #endif | |
| |
|
| while ((ch = getopt(argc, argv, "hvwzs:p:f:")) != -1) |
while ((ch = getopt(argc, argv, "hvwzs:p:f:")) != -1) |
| switch (ch) { |
switch (ch) { |
|
Line 299 main(int argc, char **argv)
|
Line 299 main(int argc, char **argv)
|
| else |
else |
| strlcpy(szStr, *argv, sizeof szStr); |
strlcpy(szStr, *argv, sizeof szStr); |
| |
|
| #ifdef __FreeBSD_ | #ifdef __FreeBSD__ |
| dev = io_etherOpen(szStr, O_RDWR | O_NONBLOCK, 42, &siz, &bz); | dev = io_etherOpen(szStr, O_RDWR, 42, (u_int*) &siz, &bz); |
| | if (dev == -1) |
| | dev = io_etherOpen(szStr, O_RDWR, 42, (u_int*) &siz, NULL); |
| #else |
#else |
| dev = io_etherOpen(szStr, O_RDWR | O_NONBLOCK, 42, &siz, NULL); | dev = io_etherOpen(szStr, O_RDWR, 42, (u_int*) &siz, NULL); |
| #endif |
#endif |
| if (dev == -1) { |
if (dev == -1) { |
| printf("Error:: #%d - %s\n", io_GetErrno(), io_GetError()); |
printf("Error:: #%d - %s\n", io_GetErrno(), io_GetError()); |