where to find the source code of "send" function of TCP?

where to find the source code of "send" function of TCP?

Post by scyth » Wed, 06 Feb 2002 23:41:23



Anyone knows where can I find the source code of "send" function of TCP?

thx a lot

 
 
 

where to find the source code of "send" function of TCP?

Post by Tauno Voipi » Thu, 14 Feb 2002 00:52:13



Quote:> Anyone knows where can I find the source code of "send" function of TCP?

> thx a lot

There is no simple answer.

The data is usually written to a TCP socket with a write() system call. The
call code is in the C library (libc.so.6), which is a shared library. It
packs the parameters into registers and executes the system call proper with
a software interrupt.

The code in kernel module Entry.S picks the system calls and dispatches them
to proper parts of the kernel.

The piece in the kernel TCP code responsible to move the user data in for
sending is tcp_sendmsg().

For more information, start with:

Daniel P. Bovet & Marco Cesati, Understanding the Linux Kernel, O'Reilly,
ISBN 0-596-00002-2,

and

Stephen T. Satchell and H.B.J. Clifford, Linux IP Stacks Commentary,
CoriolisOpen Press, ISBN 1-57610-470-2

Tauno Voipio