At 02:35 AM 5/5/2007, Poul-Henning Kamp wrote:
>In message <[EMAIL PROTECTED]>, Mike Tancsa writes:
>
> >Is there a way to uniquely identify a soekris box through a software
> >check ? I know I could look at the MAC address of a NIC, but that
> >can be trivially changed via software. Is there a CPU serial # or
> >anything like that which could be checked ?
>
>The MAC addresses are the only unique numbers in the system.
>
>You could check if it is possible to read the MAC EEPROM via
>the if_sis chips to get around the ifconfig(8) issue.
Thanks, this is what I am using to create a "serial number" for the soekris
---Mike
[releng6-865]# diff -c if_sis.c.prev if_sis.c
*** if_sis.c.prev Wed May 9 14:21:40 2007
--- if_sis.c Wed May 9 14:30:49 2007
***************
*** 127,132 ****
--- 127,142 ----
static void sis_stop(struct sis_softc *);
static void sis_watchdog(struct ifnet *);
+ /* sysctl node */
+ SYSCTL_NODE(_hw, OID_AUTO, soekris, CTLFLAG_RD, 0, "Soekris info");
+
+ static union {
+ unsigned char uc[4];
+ unsigned long ul;
+ } serialnum;
+
+
+
#ifdef SIS_USEIOSPACE
#define SIS_RES SYS_RES_IOPORT
#define SIS_RID SIS_PCI_LOIO
***************
*** 1001,1006 ****
--- 1011,1023 ----
tmp[3] = sis_reverse(tmp[3]);
tmp[2] = sis_reverse(tmp[2]);
tmp[1] = sis_reverse(tmp[1]);
+
+ serialnum.uc[1] = tmp[3] & 0x00ff;
+ serialnum.uc[0] = tmp[3] >> 8;
+ serialnum.uc[3] = tmp[2] & 0x00ff;
+ serialnum.uc[2] = tmp[2] >> 8;
+
+ SYSCTL_ULONG(_hw_soekris, OID_AUTO,
serialnum, CTLFLAG_RD, &serialnum, 0,"MAC Address of last sis
adaptor- aka serial");
bcopy((char *)&tmp[1], eaddr, ETHER_ADDR_LEN);
}
[releng6-865]#
_______________________________________________
Soekris-tech mailing list
[email protected]
http://lists.soekris.com/mailman/listinfo/soekris-tech