/* test netlink for web100 */ #include #include #include #include main() { int fd,lth; double buff[1024]; struct Msg { int type; int cid; } *msg; fd = open("/dev/web100",O_RDONLY); if (fd < 0) { perror("open"); exit(1); } msg = (struct Msg *)buff; while (1) { lth = read(fd,buff,sizeof(buff)); if (lth < 0) { perror("read"); exit(1); } printf("lth %d type %d cid %d\n",lth,msg->type,msg->cid); } }