9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* Re: [9fans] [9ans] Question about network protocols
       [not found] <<E1N3HZO-0006Fj-00.ash_666-bk-ru@f13.mail.ru>
@ 2009-10-28 23:18 ` erik quanstrom
  0 siblings, 0 replies; 4+ messages in thread
From: erik quanstrom @ 2009-10-28 23:18 UTC (permalink / raw)
  To: ash_666, 9fans

> 1) as i understand, protocol initialization occurs in ipgetfs, which not used anywhere, except
> ipattach function in same file (devip.c). ipattach, in turn, member of ipdevtab struct and latter
> isn't used anywhere too (i haven't found any with grep).
> It seems me strange, but at this point i assume, theese actions take place at system start up (this
> not true, i think).

on boot, ip will be typically be attached by the boot process.

> 3) with your reference on ipgetfs i'm googled presentation [1], a little explaining to me the
> mechanism of choice.
> name = netmkaddr("133.137.166.17", "udp", "echo");
> netmkaddr takes the text name of protocol and, as i saw in sources, and passes it to fprint, which
> call vfprint, which, in turn, call dofmt. As i understand, dofmt is some internal machinery for
> parse format string and decide to use the appropriate protocol. But I did not see where a
> connection is opened or something like that.
> Is my assumption about fprint and dofmt true?

dofmt is part of the print library.  netmkaddr returns
a cannonical address as a text string.  this address can
be passed to dial(2) to make a connection.

netmkaddr doesn't have any knowledge of specific
protocols.  if you were to add a new connection type
tomorrow, netmkaddr wouldn't need any modification.
dial wouldn't either.

at this point, you should probablly be reading the
man pages for these things.  there on the cd and
online at plan9.bell-labs.com.

- erik



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [9fans] [9ans] Question about network protocols
  2009-10-28 23:04 [9fans] " ty ty
@ 2009-10-29 17:30 ` matt
  0 siblings, 0 replies; 4+ messages in thread
From: matt @ 2009-10-29 17:30 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

ty ty wrote:

>i haven't found any with grep
>
I find this quite good for browsing the source in a web browser

http://fxr.watson.org/fxr/source/?v=PLAN9

ipattach is referenced here

http://fxr.watson.org/fxr/ident?v=PLAN9;i=ipattach



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [9fans] [9ans] Question about network protocols
       [not found] <<E1N3FMj-00026n-00.ash_666-bk-ru@f266.mail.ru>
@ 2009-10-28 20:50 ` erik quanstrom
  0 siblings, 0 replies; 4+ messages in thread
From: erik quanstrom @ 2009-10-28 20:50 UTC (permalink / raw)
  To: ash_666, 9fans

On Wed Oct 28 16:44:36 EDT 2009, ash_666@bk.ru wrote:
> Hi, folks.
> I'm trying to understand how system interact with network protocols, such as tcp, udp and other.
> i'm look through sources in /sys/src/9/ip/ and saw follow:
>  - protocol header struct
>  - protocl init function
> and so on.
> But i'm grep in plan9.iso and don't find any files, when Tcp4hdr or tcpinit used. How it could be
> used?
> Where i can read about it or, better, where i can see at code, used such functions.
>
> Sorry for english and maybe foolish question.

excellent question.  you're running into a little magic
built into the kernel build scripts.  port/makedevc
is a script called from the kernel mkfile (these days,
usually pc/mkfile) that builds $kernelconfig.c.  this
file has an array called ipprotoinit.  if you specifiy
tcp in your kernel config, this array will contain a
reference to tcpinit.  here's the array from my kernel

	void (*ipprotoinit[])(Fs*) = {
		ilinit,
		tcpinit,
		udpinit,
		ipifcinit,
		icmpinit,
		icmp6init,
		nil,
	};

this array is referenced in ip/ipgetfs where tcpinit
would typically be called.

i hope that answers the question.  it is a bit confusing.

- erik



^ permalink raw reply	[flat|nested] 4+ messages in thread

* [9fans] [9ans] Question about network protocols
@ 2009-10-28 20:43 ty ty
  0 siblings, 0 replies; 4+ messages in thread
From: ty ty @ 2009-10-28 20:43 UTC (permalink / raw)
  To: 9fans

Hi, folks.
I'm trying to understand how system interact with network protocols, such as tcp, udp and other.
i'm look through sources in /sys/src/9/ip/ and saw follow:
 - protocol header struct
 - protocl init function
and so on.
But i'm grep in plan9.iso and don't find any files, when Tcp4hdr or tcpinit used. How it could be
used?
Where i can read about it or, better, where i can see at code, used such functions.

Sorry for english and maybe foolish question.
Thanks.



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-10-29 17:30 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <<E1N3HZO-0006Fj-00.ash_666-bk-ru@f13.mail.ru>
2009-10-28 23:18 ` [9fans] [9ans] Question about network protocols erik quanstrom
2009-10-28 23:04 [9fans] " ty ty
2009-10-29 17:30 ` [9fans] " matt
     [not found] <<E1N3FMj-00026n-00.ash_666-bk-ru@f266.mail.ru>
2009-10-28 20:50 ` erik quanstrom
  -- strict thread matches above, loose matches on Subject: below --
2009-10-28 20:43 ty ty

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).