[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: socket and device relation.



> I'm trying to understant exactly where network driver is involved during the
> connection. So I start with a user program which do the following things:
> socket, bind, listen and accept. This is now what I understand:
> 
> - socket() called sys_socket() 
> - sys_socket() 
>    -> sock_create()
> 


Ooops, it seems that my mail was posted before I finished my question. So I
rewrite it.

   I'm trying to understant exactly where network driver is involved during the
connection. So I start with a user program which do the following things:
socket, bind, listen and accept. This is what I understand:
 
call to socket cause a syscall to sys_socketcall which call:
- sys_socket()
   -> sock_create()
      * check protocol
      * sock_alloc()
         allocate a new inode and a new socket object
   -> sock_map_fd()
      * map the socket to a file descriptor

So during the creation of the socket the driver is not involved.
Now there is the binding:

- sys_bind()
   * Just bind the name and the socket
  
At this point there something that I don't understand: 
There is a call to 
sock->ops->bind(sock, (struct sockaddr *)address, addrlen);

but I don't see where sock->ops is initialized and thus, I don't find
the function bind. Is the binding involving the network driver.

Thank you for help
--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/