[<prev] [next>] [day] [month] [year] [list]
Message-Id: <88A69E70-10FB-414A-9542-EBC9E0768D23@gmail.com>
Date: Thu, 16 Jul 2009 08:17:15 +0200
From: Patrick Rittiner <rittiner@...il.com>
To: linux-kernel@...r.kernel.org
Subject: RAW ethernet in kernel space
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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists