lkml.org 
[lkml]   [2009]   [Jul]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRAW ethernet in kernel space
Date
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


\
 
 \ /
  Last update: 2009-07-16 08:21    [W:0.138 / U:0.140 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site