Messages in this thread | | | From | Patrick Rittiner <> | Subject | RAW ethernet in kernel space | Date | Thu, 16 Jul 2009 08:17:15 +0200 |
| |
hi everyone,
I have a problem, I would like to open a ethernet socket and receive all data (RAW ethernet) on the ethernet interface on it. ( interface has to be in promisc mode ) In user space this is not a big problem, but how can I do it in kernel space? I mean, i can not use functions like ioctl() and socket(), right? so I think there is a sock_create().
so how can I write code like this for kernel space:
memset(&ifInfo, 0x00, sizeof(ifInfo)); strncpy(ifInfo.ifr_name, iface, IFNAMSIZ); ioctl(sock, SIOCGIFFLAGS, &ifInfo); ifInfo.ifr_flags |= IFF_PROMISC; ioctl(sock, SIOCSIFFLAGS, &ifInfo);
thanks for your help
| |