changelog shortlog tags branches files raw gz bz2 help

Mercurial > hg > plan9front / changeset: devether: remove duplicated parseether() implementation (pull from libip)

changeset 6250: ae7c1bf5cb85
parent 6249: 31534fbb8616
tag:tip
author: cinap_lenrek@felloff.net
date: Sat, 09 Dec 2017 22:07:32 +0100
files: sys/src/9/ip/ip.h sys/src/9/kw/devether.c sys/src/9/mtx/devether.c sys/src/9/omap/devether.c sys/src/9/pc/devether.c sys/src/9/ppc/devether.c sys/src/9/sgi/devether.c sys/src/9/teg2/devether.c sys/src/9/zynq/devether.c
description: devether: remove duplicated parseether() implementation (pull from libip)
     1.1--- a/sys/src/9/ip/ip.h
     1.2+++ b/sys/src/9/ip/ip.h
     1.3@@ -644,7 +644,7 @@ extern void	arpenter(Fs*, int version, u
     1.4  * ipaux.c
     1.5  */
     1.6 
     1.7-extern int	myetheraddr(uchar*, char*);
     1.8+extern int	parseether(uchar*, char*);
     1.9 extern vlong	parseip(uchar*, char*);
    1.10 extern vlong	parseipmask(uchar*, char*);
    1.11 extern char*	v4parseip(uchar*, char*);
     2.1--- a/sys/src/9/kw/devether.c
     2.2+++ b/sys/src/9/kw/devether.c
     2.3@@ -336,29 +336,6 @@ addethercard(char* t, int (*r)(Ether*))
     2.4 	ncard++;
     2.5 }
     2.6 
     2.7-int
     2.8-parseether(uchar *to, char *from)
     2.9-{
    2.10-	char nip[4];
    2.11-	char *p;
    2.12-	int i;
    2.13-
    2.14-	p = from;
    2.15-	for(i = 0; i < Eaddrlen; i++){
    2.16-		if(*p == 0)
    2.17-			return -1;
    2.18-		nip[0] = *p++;
    2.19-		if(*p == 0)
    2.20-			return -1;
    2.21-		nip[1] = *p++;
    2.22-		nip[2] = 0;
    2.23-		to[i] = strtoul(nip, 0, 16);
    2.24-		if(*p == ':')
    2.25-			p++;
    2.26-	}
    2.27-	return 0;
    2.28-}
    2.29-
    2.30 static void
    2.31 etherreset(void)
    2.32 {
     3.1--- a/sys/src/9/mtx/devether.c
     3.2+++ b/sys/src/9/mtx/devether.c
     3.3@@ -321,29 +321,6 @@ addethercard(char* t, int (*r)(Ether*))
     3.4 	ncard++;
     3.5 }
     3.6 
     3.7-int
     3.8-parseether(uchar *to, char *from)
     3.9-{
    3.10-	char nip[4];
    3.11-	char *p;
    3.12-	int i;
    3.13-
    3.14-	p = from;
    3.15-	for(i = 0; i < 6; i++){
    3.16-		if(*p == 0)
    3.17-			return -1;
    3.18-		nip[0] = *p++;
    3.19-		if(*p == 0)
    3.20-			return -1;
    3.21-		nip[1] = *p++;
    3.22-		nip[2] = 0;
    3.23-		to[i] = strtoul(nip, 0, 16);
    3.24-		if(*p == ':')
    3.25-			p++;
    3.26-	}
    3.27-	return 0;
    3.28-}
    3.29-
    3.30 static void
    3.31 etherreset(void)
    3.32 {
     4.1--- a/sys/src/9/omap/devether.c
     4.2+++ b/sys/src/9/omap/devether.c
     4.3@@ -334,29 +334,6 @@ addethercard(char* t, int (*r)(Ether*))
     4.4 	ncard++;
     4.5 }
     4.6 
     4.7-int
     4.8-parseether(uchar *to, char *from)
     4.9-{
    4.10-	char nip[4];
    4.11-	char *p;
    4.12-	int i;
    4.13-
    4.14-	p = from;
    4.15-	for(i = 0; i < Eaddrlen; i++){
    4.16-		if(*p == 0)
    4.17-			return -1;
    4.18-		nip[0] = *p++;
    4.19-		if(*p == 0)
    4.20-			return -1;
    4.21-		nip[1] = *p++;
    4.22-		nip[2] = 0;
    4.23-		to[i] = strtoul(nip, 0, 16);
    4.24-		if(*p == ':')
    4.25-			p++;
    4.26-	}
    4.27-	return 0;
    4.28-}
    4.29-
    4.30 static void
    4.31 etherreset(void)
    4.32 {
     5.1--- a/sys/src/9/pc/devether.c
     5.2+++ b/sys/src/9/pc/devether.c
     5.3@@ -341,29 +341,6 @@ addethercard(char* t, int (*r)(Ether*))
     5.4 	ncard++;
     5.5 }
     5.6 
     5.7-int
     5.8-parseether(uchar *to, char *from)
     5.9-{
    5.10-	char nip[4];
    5.11-	char *p;
    5.12-	int i;
    5.13-
    5.14-	p = from;
    5.15-	for(i = 0; i < Eaddrlen; i++){
    5.16-		if(*p == 0)
    5.17-			return -1;
    5.18-		nip[0] = *p++;
    5.19-		if(*p == 0)
    5.20-			return -1;
    5.21-		nip[1] = *p++;
    5.22-		nip[2] = 0;
    5.23-		to[i] = strtoul(nip, 0, 16);
    5.24-		if(*p == ':')
    5.25-			p++;
    5.26-	}
    5.27-	return 0;
    5.28-}
    5.29-
    5.30 static Ether*
    5.31 etherprobe(int cardno, int ctlrno)
    5.32 {
     6.1--- a/sys/src/9/ppc/devether.c
     6.2+++ b/sys/src/9/ppc/devether.c
     6.3@@ -320,29 +320,6 @@ addethercard(char* t, int (*r)(Ether*))
     6.4 	ncard++;
     6.5 }
     6.6 
     6.7-int
     6.8-parseether(uchar *to, char *from)
     6.9-{
    6.10-	char nip[4];
    6.11-	char *p;
    6.12-	int i;
    6.13-
    6.14-	p = from;
    6.15-	for(i = 0; i < 6; i++){
    6.16-		if(*p == 0)
    6.17-			return -1;
    6.18-		nip[0] = *p++;
    6.19-		if(*p == 0)
    6.20-			return -1;
    6.21-		nip[1] = *p++;
    6.22-		nip[2] = 0;
    6.23-		to[i] = strtoul(nip, 0, 16);
    6.24-		if(*p == ':')
    6.25-			p++;
    6.26-	}
    6.27-	return 0;
    6.28-}
    6.29-
    6.30 static void
    6.31 etherreset(void)
    6.32 {
     7.1--- a/sys/src/9/sgi/devether.c
     7.2+++ b/sys/src/9/sgi/devether.c
     7.3@@ -340,29 +340,6 @@ addethercard(char* t, int (*r)(Ether*))
     7.4 	ncard++;
     7.5 }
     7.6 
     7.7-int
     7.8-parseether(uchar *to, char *from)
     7.9-{
    7.10-	char nip[4];
    7.11-	char *p;
    7.12-	int i;
    7.13-
    7.14-	p = from;
    7.15-	for(i = 0; i < Eaddrlen; i++){
    7.16-		if(*p == 0)
    7.17-			return -1;
    7.18-		nip[0] = *p++;
    7.19-		if(*p == 0)
    7.20-			return -1;
    7.21-		nip[1] = *p++;
    7.22-		nip[2] = 0;
    7.23-		to[i] = strtoul(nip, 0, 16);
    7.24-		if(*p == ':')
    7.25-			p++;
    7.26-	}
    7.27-	return 0;
    7.28-}
    7.29-
    7.30 static Ether*
    7.31 etherprobe(int cardno, int ctlrno)
    7.32 {
     8.1--- a/sys/src/9/teg2/devether.c
     8.2+++ b/sys/src/9/teg2/devether.c
     8.3@@ -332,29 +332,6 @@ addethercard(char* t, int (*r)(Ether*))
     8.4 	ncard++;
     8.5 }
     8.6 
     8.7-int
     8.8-parseether(uchar *to, char *from)
     8.9-{
    8.10-	char nip[4];
    8.11-	char *p;
    8.12-	int i;
    8.13-
    8.14-	p = from;
    8.15-	for(i = 0; i < Eaddrlen; i++){
    8.16-		if(*p == 0)
    8.17-			return -1;
    8.18-		nip[0] = *p++;
    8.19-		if(*p == 0)
    8.20-			return -1;
    8.21-		nip[1] = *p++;
    8.22-		nip[2] = 0;
    8.23-		to[i] = strtoul(nip, 0, 16);
    8.24-		if(*p == ':')
    8.25-			p++;
    8.26-	}
    8.27-	return 0;
    8.28-}
    8.29-
    8.30 static void
    8.31 etherreset(void)
    8.32 {
     9.1--- a/sys/src/9/zynq/devether.c
     9.2+++ b/sys/src/9/zynq/devether.c
     9.3@@ -340,29 +340,6 @@ addethercard(char* t, int (*r)(Ether*))
     9.4 	ncard++;
     9.5 }
     9.6 
     9.7-int
     9.8-parseether(uchar *to, char *from)
     9.9-{
    9.10-	char nip[4];
    9.11-	char *p;
    9.12-	int i;
    9.13-
    9.14-	p = from;
    9.15-	for(i = 0; i < Eaddrlen; i++){
    9.16-		if(*p == 0)
    9.17-			return -1;
    9.18-		nip[0] = *p++;
    9.19-		if(*p == 0)
    9.20-			return -1;
    9.21-		nip[1] = *p++;
    9.22-		nip[2] = 0;
    9.23-		to[i] = strtoul(nip, 0, 16);
    9.24-		if(*p == ':')
    9.25-			p++;
    9.26-	}
    9.27-	return 0;
    9.28-}
    9.29-
    9.30 static Ether*
    9.31 etherprobe(int cardno, int ctlrno)
    9.32 {