From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <899a6a33f1807a18fb47a7463792ebe6@plan9.jp> To: 9fans@cse.psu.edu From: Joel “chesky” Salomon Date: Tue, 17 Oct 2006 23:10:57 -0400 MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Subject: [9fans] csipinfo Content-Transfer-Encoding: quoted-printable Topicbox-Message-UUID: cbbde35e-ead1-11e9-9d60-3106f5b1d025 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=E2=80=99ve got everything but the gethostbyaddr equivalent code. From cpu% sig csipinfo Ndbtuple* csipinfo(char *netroot, char *attr, char *val, char **attrs, i= nt nattr) it looks as if I should do something like: lfd =3D listen(adir, ldir); if (lfd < 0) sysfatal("listen: %r"); dfd =3D accept(lfd, ldir); if (dfd < 0) sysfatal("can't accept: %r"); NetConnInfo *i =3D getnetconninfo(nil, lfd); Ndbtuple *t =3D csipinfo(nil, "????", "????", ["ip", "dns"], 2); ... =E2=80=94 but what=E2=80=99re the attr and val arguments to csipinfo? I=E2= =80=99ve 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=3Dvalue pair do I know about for this remotely-initiated connection? Thanks, --Joel