Usenet comp.sys.dec (1990-2013)
 help / color / mirror / Atom feed
From: hirai@cc.swarthmore.edu (Eiji Hirai)
Subject: Re: How to get ethernet number of a running DECsystem?
Date: 3 Jan 1994 14:06:08 GMT	[thread overview]
Message-ID: <2g98og$4jj@larch.cc.swarthmore.edu> (raw)
In-Reply-To: CJ1q26.Mx5@hermes.hrz.uni-bielefeld.de

hoover@mathematik.uni-bielefeld.de (Uwe Schuerkamp) writes:
: can anyone tell me how to determine the physical ethernet address of
: an Ultrix host

Compile the code below and run it.

-- 
hirai@cc.swarthmore.edu (Eiji Hirai) | Unix Geek for Swarthmore College
I don't speak for Swarthmore College | Computing Center, Swarthmore, PA, USA

"I post, therefore I am." -Rene Descartes on Usenet


/*
 * Newsgroups: comp.unix.ultrix
 * From: jm@decuk.uvo.dec.com (John McNulty)
 * Subject: Re: Help : Copy 
 * Message-ID: <1992Oct16.072054.783@decuk.uvo.dec.com>
 * Organization: Digital Equipment Co. Ltd
 * Date: Fri, 16 Oct 1992 07:20:54 GMT
 */

#include <stdio.h>
#include <sys/ioctl.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <net/if.h>

int main (int argc, char *argv[])
{
	int	s;
	struct ifdevea	i;

	if ( argc != 2 ) {
		fprintf (stderr, "usage: %s interface\n", argv[0]);
		exit (1);
	}

	if ((s = socket (AF_INET, SOCK_STREAM, 0)) == -1) {
		perror ("socket");
		exit (1);
	}

	strncpy (i.ifr_name, argv[1], sizeof (i.ifr_name));
	if (ioctl (s, SIOCRPHYSADDR, &i) == -1) {
		perror ("ioctl");
		exit (1);
	}

	printf ("%s: %x-%x-%x-%x-%x-%x\n", i.ifr_name, i.default_pa[0], 
		i.default_pa[1], i.default_pa[2], i.default_pa[3], 
		i.default_pa[4], i.default_pa[5]);
	exit (0);
}


  reply	other threads:[~1994-01-03 14:06 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1994-01-03  8:54 How to get ethernet number of a running DECsystem? Uwe Schuerkamp
1994-01-03 14:06 ` Eiji Hirai [this message]
1994-01-03 15:20   ` Andy Jaworski
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