9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] csipinfo
@ 2006-10-18  3:10 Joel “chesky” Salomon
  2006-10-18  3:36 ` geoff
  2006-10-18 20:38 ` andrey mirtchovski
  0 siblings, 2 replies; 23+ messages in thread
From: Joel “chesky” Salomon @ 2006-10-18  3:10 UTC (permalink / raw)
  To: 9fans

My homework assignment reads:
> Write a program to receive multiple UDP messages ...  Print to
> standard output the remote host and port from which the message
> originated (print the dotted decimal IP address and also use
> gethostbyaddr to print a textual host name), followed by the message
> itself.

I’ve got everything but the gethostbyaddr equivalent code.  From
cpu% sig csipinfo
	Ndbtuple* csipinfo(char *netroot, char *attr, char *val, char **attrs, int nattr)
it looks as if I should do something like:
	lfd = listen(adir, ldir);
	if (lfd < 0) sysfatal("listen: %r");
	dfd = accept(lfd, ldir);
	if (dfd < 0) sysfatal("can't accept: %r");
	NetConnInfo	*i = getnetconninfo(nil, lfd);
	Ndbtuple		*t = csipinfo(nil, "????", "????", ["ip", "dns"], 2);
	...
— but what’re the attr and val arguments to csipinfo?  I’ve read
ndb(2) and been thoroughly confused, and
http://www.google.com/codesearch turns up no uses of csipinfo, only
its implementation on Plan 9 and plan9ports.

Specifically, what attribute=value pair do I know about for this
remotely-initiated connection?

Thanks,
--Joel



^ permalink raw reply	[flat|nested] 23+ messages in thread
[parent not found: <61d9157e8f6994d999d7f257cd2b05b4@coraid.com>]

end of thread, other threads:[~2006-10-19  8:29 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-10-18  3:10 [9fans] csipinfo Joel “chesky” Salomon
2006-10-18  3:36 ` geoff
2006-10-18  5:20   ` Joel “chesky” Salomon
2006-10-18  5:37     ` geoff
2006-10-18  5:53       ` Joel “chesky” Salomon
2006-10-18 12:38         ` Joel “chesky” Salomon
2006-10-18 15:32         ` Russ Cox
2006-10-18 16:43           ` Joel Salomon
2006-10-18 16:59             ` rog
2006-10-18 20:38 ` andrey mirtchovski
     [not found] <61d9157e8f6994d999d7f257cd2b05b4@coraid.com>
2006-10-18 18:44 ` Joel “chesky” Salomon
2006-10-18 19:14   ` rog
2006-10-18 19:26     ` erik quanstrom
2006-10-18 19:38     ` Joel “chesky” Salomon
2006-10-18 19:57       ` C H Forsyth
2006-10-18 23:51         ` Charles Forsyth
2006-10-19  8:29           ` Charles Forsyth
2006-10-18 20:17       ` Joel “chesky” Salomon
2006-10-18 21:29       ` geoff
2006-10-18 19:56     ` Charles Forsyth
2006-10-18 19:59       ` erik quanstrom
2006-10-18 20:15       ` rog
2006-10-18 19:30   ` erik quanstrom

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).