[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kernelnewbies
Subject:    Re: How to access kernel infor from user space?
From:       Erik Mouw <J.A.K.Mouw () its ! tudelft ! nl>
Date:       2003-01-30 17:01:48
[Download RAW message or body]

On Tue, Jan 28, 2003 at 04:00:06PM -0500, Ying Ge wrote:
> Dear Newsgroup,

Minor nitpick: we are a mailing list :)

> I'm just starting to look at the linux kernel, please help me...
> 
> In the Orinoco Driver code, one can get the information about the packet
> the driver received, such as packet type, sender, etc. However, these
> information are obtained in the kernel space, how can I write the
> programme to access these infor from user space?
> 
> My understanding is that I can write a new ioctl to access these info,
> or I can create a new entry in /proc file system and write these infor
> to the file in the kernel space. But how can I do these things? Can
> anybody provide me any sample code?

You just want raw packets and the code for that is already in place,
just run 'tcpdump -i eth0' and you'll see the packet headers going over
your screen. If you want something better, have a look at ethereal
and/or libpcap.


Erik

-- 
J.A.K. (Erik) Mouw
Email: J.A.K.Mouw@its.tudelft.nl  mouw@nl.linux.org
WWW: http://www-ict.its.tudelft.nl/~erik/

[Attachment #3 (application/pgp-signature)]
--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic