From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: From: erik quanstrom Date: Tue, 6 Mar 2007 06:17:03 -0500 To: 9fans@cse.psu.edu Subject: Re: [9fans] Re: PPP error: cannot write IP - link not up In-Reply-To: <32a656c20703060155o426c506co8c87a3f61c319d6f@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="upas-dheqbwevojayxwmkmbcsfolngm" Topicbox-Message-UUID: 17c10fc4-ead2-11e9-9d60-3106f5b1d025 This is a multi-part message in MIME format. --upas-dheqbwevojayxwmkmbcsfolngm Content-Disposition: inline Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit On Tue Mar 6 04:55:44 EST 2007, vester.thacker@gmail.com wrote: > On 3/6/07, Stevie_Lancaster wrote: > > > Thanks for your reply. Under /net there is already a directory ether0. > > So I guess the device got binded there. Am I right? > > I believe it to mean that the device was recognized, but it does not > mean that it was binded. i guess this is pedantic but, yes it does mean the device is bound into the namespace and in most cases you can send and receive raw ethernet frames. i've attached an overly-complicated program which prints out the ip configuration by interface. output is like so: ; ipifc 0:/net/ether0 00a0c973fa3f 1514 205.185.197.2/120 205.185.197.0 0:/net.alt/ether1 000102ed3163 1514 65.14.39.132/123 65.14.39.128 the first line is the ipifc index, a ':', the mountpoint, mac and mtu. subsequent indented lines are address, a '/', netmask and network for each configured address. you can get the same information with ; cat cat /net*/ipifc/?/status>[2=] but it's a lot harder to read. ;-) - erik --upas-dheqbwevojayxwmkmbcsfolngm Content-Disposition: attachment; filename=ipifc.c Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit #include #include #include char *mtab[10] = {"/net", "/net.alt"}; int nmtab = 2; void ipifcprint(char *m, int idx) { Ipifc *ifc; Iplifc *l; uchar eth[6]; for(ifc = readipifc(m, 0, idx); ifc; ifc = ifc->next){ print("%d:%s ", ifc->index, ifc->dev); if(myetheraddr(eth, ifc->dev) == 0) print("\t" "%E", eth); print("\t" "%d\n", ifc->mtu); for(l = ifc->lifc; l; l = l->next) print("\t" "%I%M" "\t" "%I\n", l->ip, l->mask, l->net); } // freeipifc(ifc); } void usage(void) { fprint(2, "usage: ipfic [-m net mtpt] [interface number] ...\n"); exits("usage"); } void main(int argc, char **argv){ char* r; int i, m; m = 0; ARGBEGIN{ case 'm': if(m++ == 0) nmtab = 0; if(++nmtab < nelem(mtab)) mtab[nmtab-1] = EARGF(usage()); break; }ARGEND; fmtinstall('I', eipfmt); fmtinstall('M', eipfmt); fmtinstall('E', eipfmt); if(*argv) for(; *argv; argv++){ i = strtoul(*argv, &r, 0); if (*r) usage(); ipifcprint(mtab[0], i); } else for(i = 0; i < nmtab; i++) ipifcprint(mtab[i], -1); exits(0); } --upas-dheqbwevojayxwmkmbcsfolngm--