From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: To: 9fans@cse.psu.edu Subject: Re: [9fans] csipinfo From: Joel “chesky” Salomon Date: Wed, 18 Oct 2006 08:38:00 -0400 In-Reply-To: <0d0bcfa5c119e6439bc89db35a8ef847@plan9.jp> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Topicbox-Message-UUID: cc647d4a-ead1-11e9-9d60-3106f5b1d025 > Ndbtuple *t =3D csipinfo(nil, ipattr(i->raddr), i->raddr, ["ip", "dns"]= , 2); ... has two problems. One, it should be i->rsys rather than ->raddr (=E2= =80=94I think; does it really matter?); and two, the inline creation of t= he array doesn=E2=80=99t complie; the line now reads: char *attr[2] =3D {"ip", "dns"}; t =3D csipinfo(nil, ipattr(i->rsys), i->rsys, attr, 2); which sort of works. In testing I=E2=80=99ve gotten two different ip add= resses referring to my system in the list; I=E2=80=99m guessing I need to= walk the Ndbtuple list until I find the element referring to "dns"? Aft= er the code above, is for(dt =3D t; dt !=3D nil; dt =3D dt->entry) if(strstr(dt->attr, "dns")) break; guaranteed to find an Ndbtuple with attr =3D=3D "dns" or can that fail? --Joel