Usenet comp.unix.osf.osf1 (1992-2004)
 help / color / mirror / Atom feed
From: dad@comet.pacersoft.com (David A. Dubois)
Subject: Re: DLPI interface on DEC OSF/1
Date: 1995/03/29	[thread overview]
Message-ID: <3lc5dj$7a@hercules.pacersoft.com> (raw)
In-Reply-To: 796413525snz@cucumber.demon.co.uk

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 <sys/ioctl.h>
#include <stropts.h>
#include <errno.h>
#include <fcntl.h>
#include <string.h>

#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<stri.ic_len; i++)
    {
        if (buf[i] == 0)
            printf(", ");
        else
            printf("%c",buf[i]);
    }
    printf("\n");
}




  parent reply	other threads:[~1995-03-29  5:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1995-03-28 17:58 DLPI interface on DEC OSF/1 Andrew Gabriel
1995-03-29  5:00 ` Simon Rosenthal
1995-03-29  5:00 ` David A. Dubois [this message]
1995-04-03  4:00 ` Andrew.Gabriel
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox