From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,ff8ca51181c2652e X-Google-Attributes: gidfee84,public From: dad@comet.pacersoft.com (David A. Dubois) Subject: Re: DLPI interface on DEC OSF/1 Date: 1995/03/29 Message-ID: <3lc5dj$7a@hercules.pacersoft.com>#1/1 X-Deja-AN: 100530347 distribution: world references: <796413525snz@cucumber.demon.co.uk> organization: Pacer Software, Inc. newsgroups: comp.unix.osf.osf1 In article <796413525snz@cucumber.demon.co.uk>, Andrew@cucumber.demon.co.uk (Andrew Gabriel) writes: |> This PPA identification is passed as a value on the DL_ATTACH_REQ, |> and is system/manufacturer dependent. I want to access the Ethernet |> port on the back of the machine, but nowhere can I find what value |> I should give in the DL_ATTACH_REQ for this (or any other) interface |> in DEC's implementation. |> |> Does anyone know how DEC map hardware interfaces to PPA values? There is an ioctl() you can use to list the device names and PPA numbers. Here's a simple program to do just that, making use of the "dl_ifnames" ioctl(): #include #include #include #include #include #define ND_GET ('N' << 8 + 0) #define BUFSIZE 256 char devName[] = "/dev/streams/dlb"; main() { int i; int fd; char *buf; struct strioctl stri; if ((buf = (char *) malloc (BUFSIZE)) == NULL) { perror ("malloc"); exit (-1); } fd = open(devName, O_RDWR, 0); if (fd < 0) { perror ("open"); exit (-1); } strcpy (buf, "dl_ifnames"); stri.ic_cmd = ND_GET; stri.ic_timout = -1; stri.ic_len = BUFSIZE; stri.ic_dp = buf; if (ioctl(fd, I_STR, &stri) < 0) { perror ("ioctl"); exit (-1); } printf("Valid PPA names on this system are ... \n\t"); for (i=0; i