-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

Prashant Batra writes:
> Hi all,

> I am having a query.

> I understand that whenever a packet comes at an interface (lets say
> ethernet) , the driver for that interface handles the packet to kernel.
> Kernel works on the packet. To be specific, IP stack in the kernel works on
> the packet and does the necessary things. Then it gives the packet to the
> registered application ( user ).

> Now I want the packet from the kernel directly, without it going through the
> IP stack.
> Now, I can do the similar things using libpcap, but what I want is to bring
> the packet directly from the kernel space to user space. ( that is kernel
> writes the packet in a memory location and gives the address of that to the
> user application.

As I understand, you're looking for some kind of shared memory between
kernel-space and user-space, which AFAIK doesn't exist. You need to use
read(2)/write(2) to pass the memory address and length to copy data from/to
kernel-space. You can use poll/select/epoll to check the availability of
data/readiness on the socket. libpcap is the high-level library utilizing raw
sockets, you can use raw sockets directly also without relying on libpcap.

> Is this possible? And if how.

You probably have to invent such interface of your own.

Ashish
- -- 
Sent via Gnus from GNU Emacs

They who can give up essential liberty to obtain a little temporary safety,
deserve neither liberty nor safety.
  -- Benjamin Franklin, Memoirs of the life and writings of Benjamin Franklin
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.14 (FreeBSD)

iQIcBAEBCgAGBQJMAxYuAAoJEMdGz6nnT6Sw3p4QAJsDoFO2cwPSUn9ZVK+es7wx
rAG9lSo1HK+7jeODDM2EHe4e1azdT/NCfFr+ofRZdhsWB7YaTHM1KEhX+7zZS1Yf
XC1+Uq/8NJ5uyE9P8yupsY/pRlrfd/cRGythtDwLuEPjWu3vS0Z3pqE3lsJDXLI6
iPLCdpOqZdWpGwES8r0Sbo1TOU9gjQvjUsCCPRhdzWO/cZ3K3ra3RSs1ij31RkDJ
UFXzC2ikt4qSRhHt0BuLpdp4xzA3sHQC0mXY3hv9gfVLRJnrsX2011InMcxTol3J
xihF1AewUDoC7EI3DJmQHajo1Ofzdn9FWd8UYH8N/VE9zns2jWtPI/sCMNhZlWH1
8tFpm7yU3278t3g3tV6H+eHFNhbEf0aXy7IxCVJw/4sCSUkMpuZV2stVy+nSAWax
KowWjrFU9j4zj0SVGY/lG+imDIIzo/n8j0aWZmPbVy1tU707XbrBpGrGgZFbKi2U
IMjse62ITG0IhyUWsTMf9jNUmlbOE7B6XXl7UDueaSVwUaHPNpDatTi+/yejoRfD
FvZ/lUsa5bh3SVkx9oWUBUSlVlyt43NK04mGgmNkPqa4z5iAmziF64X5Y5Wn4qCO
h0NiC+fwql2RBc7WNvjiKet+dhjQL9fAOqSp5EW6BVOlHpdReEQuMBf9NbBTqbQO
RCzw//Fuwv1C9ml2cSnf
=fZOw
-----END PGP SIGNATURE-----

_______________________________________________
Ilugd mailing list
Ilugd@lists.linux-delhi.org
http://frodo.hserus.net/mailman/listinfo/ilugd

Reply via email to