Le Mon, 17 Mar 2008 02:20:53 -0300, "Rafael C. de Almeida" <almeidaraf@xxxxxxxxx> a écrit : > I'm trying to understand how the bytes I get from recv(2) comes > through the nic to the sockets interface. I tried following it from > sys_recv (net/socket.c) to the driver functions being used. But I got > stuck on: > > err = security_socket_recvmsg(sock, msg, size, flags); This is a function call to the security infrastructure of the Linux kernel, into which securiy modules can be plugged to perform various checks at different places inside the kernel. So it is not important in the general case of execution. > return sock->ops->recvmsg(iocb, sock, msg, size, flags); It's a call to the protocol-specific recvmsg() method. 'ops' is of type 'struct proto_ops', whose defined can be seen at http://lxr.free-electrons.com/source/include/linux/net.h#133. You can start by exploring the implementation of datagram sockets (relying on the UDP protocol) at http://lxr.free-electrons.com/source/net/ipv4/af_inet.c#847. You'll find many very precise documentations about the implementation of the Linux network stack at http://www.cs.clemson.edu/~westall/853/notes/. It may not be completely uptodate, but at least gives the general idea. Sincerly, Thomas -- Thomas Petazzoni, Free Electrons Free Embedded Linux Training Materials on http://free-electrons.com/training (More than 1500 pages!)
Attachment:
signature.asc
Description: PGP signature