[haiku-gsoc] Queries regarding the current code for tcp

  • From: Ayush Agrawal <echo.27.04.96@xxxxxxxxx>
  • To: haiku-gsoc@xxxxxxxxxxxxx
  • Date: Mon, 5 Jun 2017 00:00:21 +0530

I have been going through the code for TCP at
https://github.com/haiku/haiku/blob/master/src/add-ons/kernel/network/protocols/tcp/tcp.cpp
and I have the following doubts:

*Q1*. Modules basically export an API to be used by other modules and
drivers. The tcp module (sTCPModule) exports many functions. I couldn't
find any other module or driver that calls those functions or any file that
does a get_module on "network/protocols/tcp/v1". I used `grep -ri tcp_` to
search for files calling the exported functions.

As per the network stack described at
https://www.haiku-os.org/docs/api/group__network.html, the core stack
module or the network stack driver should be using the tcp module as per my
understanding.

So actually I wanted some clarity on how things go from calling socket(..)
in userland, to the devfs and which driver or module calls upon the tcp
module and how.

*Q2*. The naming convention. Many variable names are prefixed with either a
'g' or an 's' like sEndpointManagerLock and gStackModule. What does the
letters symbolize?

Q3. tcp.cpp, checking the argument "level" in two different ways:
                  line 525 @ tcp_control: (level & LEVEL_MASK) ==
IPPROTO_TCP

Other related posts: