ref: 35bc3ac5735bd0edff45b68465de710ff61d2385
parent: a7ac020664f1de870b09807086565030246ad6fb
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Sat Dec 9 17:07:32 EST 2017
devether: remove duplicated parseether() implementation (pull from libip)
--- a/sys/src/9/ip/ip.h
+++ b/sys/src/9/ip/ip.h
@@ -644,7 +644,7 @@
* ipaux.c
*/
-extern int myetheraddr(uchar*, char*);
+extern int parseether(uchar*, char*);
extern vlong parseip(uchar*, char*);
extern vlong parseipmask(uchar*, char*);
extern char* v4parseip(uchar*, char*);
--- a/sys/src/9/kw/devether.c
+++ b/sys/src/9/kw/devether.c
@@ -336,29 +336,6 @@
ncard++;
}
-int
-parseether(uchar *to, char *from)
-{
- char nip[4];
- char *p;
- int i;
-
- p = from;
- for(i = 0; i < Eaddrlen; i++){
- if(*p == 0)
- return -1;
- nip[0] = *p++;
- if(*p == 0)
- return -1;
- nip[1] = *p++;
- nip[2] = 0;
- to[i] = strtoul(nip, 0, 16);
- if(*p == ':')
- p++;
- }
- return 0;
-}
-
static void
etherreset(void)
{
--- a/sys/src/9/mtx/devether.c
+++ b/sys/src/9/mtx/devether.c
@@ -321,29 +321,6 @@
ncard++;
}
-int
-parseether(uchar *to, char *from)
-{
- char nip[4];
- char *p;
- int i;
-
- p = from;
- for(i = 0; i < 6; i++){
- if(*p == 0)
- return -1;
- nip[0] = *p++;
- if(*p == 0)
- return -1;
- nip[1] = *p++;
- nip[2] = 0;
- to[i] = strtoul(nip, 0, 16);
- if(*p == ':')
- p++;
- }
- return 0;
-}
-
static void
etherreset(void)
{
--- a/sys/src/9/omap/devether.c
+++ b/sys/src/9/omap/devether.c
@@ -334,29 +334,6 @@
ncard++;
}
-int
-parseether(uchar *to, char *from)
-{
- char nip[4];
- char *p;
- int i;
-
- p = from;
- for(i = 0; i < Eaddrlen; i++){
- if(*p == 0)
- return -1;
- nip[0] = *p++;
- if(*p == 0)
- return -1;
- nip[1] = *p++;
- nip[2] = 0;
- to[i] = strtoul(nip, 0, 16);
- if(*p == ':')
- p++;
- }
- return 0;
-}
-
static void
etherreset(void)
{
--- a/sys/src/9/pc/devether.c
+++ b/sys/src/9/pc/devether.c
@@ -341,29 +341,6 @@
ncard++;
}
-int
-parseether(uchar *to, char *from)
-{
- char nip[4];
- char *p;
- int i;
-
- p = from;
- for(i = 0; i < Eaddrlen; i++){
- if(*p == 0)
- return -1;
- nip[0] = *p++;
- if(*p == 0)
- return -1;
- nip[1] = *p++;
- nip[2] = 0;
- to[i] = strtoul(nip, 0, 16);
- if(*p == ':')
- p++;
- }
- return 0;
-}
-
static Ether*
etherprobe(int cardno, int ctlrno)
{
--- a/sys/src/9/ppc/devether.c
+++ b/sys/src/9/ppc/devether.c
@@ -320,29 +320,6 @@
ncard++;
}
-int
-parseether(uchar *to, char *from)
-{
- char nip[4];
- char *p;
- int i;
-
- p = from;
- for(i = 0; i < 6; i++){
- if(*p == 0)
- return -1;
- nip[0] = *p++;
- if(*p == 0)
- return -1;
- nip[1] = *p++;
- nip[2] = 0;
- to[i] = strtoul(nip, 0, 16);
- if(*p == ':')
- p++;
- }
- return 0;
-}
-
static void
etherreset(void)
{
--- a/sys/src/9/sgi/devether.c
+++ b/sys/src/9/sgi/devether.c
@@ -340,29 +340,6 @@
ncard++;
}
-int
-parseether(uchar *to, char *from)
-{
- char nip[4];
- char *p;
- int i;
-
- p = from;
- for(i = 0; i < Eaddrlen; i++){
- if(*p == 0)
- return -1;
- nip[0] = *p++;
- if(*p == 0)
- return -1;
- nip[1] = *p++;
- nip[2] = 0;
- to[i] = strtoul(nip, 0, 16);
- if(*p == ':')
- p++;
- }
- return 0;
-}
-
static Ether*
etherprobe(int cardno, int ctlrno)
{
--- a/sys/src/9/teg2/devether.c
+++ b/sys/src/9/teg2/devether.c
@@ -332,29 +332,6 @@
ncard++;
}
-int
-parseether(uchar *to, char *from)
-{
- char nip[4];
- char *p;
- int i;
-
- p = from;
- for(i = 0; i < Eaddrlen; i++){
- if(*p == 0)
- return -1;
- nip[0] = *p++;
- if(*p == 0)
- return -1;
- nip[1] = *p++;
- nip[2] = 0;
- to[i] = strtoul(nip, 0, 16);
- if(*p == ':')
- p++;
- }
- return 0;
-}
-
static void
etherreset(void)
{
--- a/sys/src/9/zynq/devether.c
+++ b/sys/src/9/zynq/devether.c
@@ -340,29 +340,6 @@
ncard++;
}
-int
-parseether(uchar *to, char *from)
-{
- char nip[4];
- char *p;
- int i;
-
- p = from;
- for(i = 0; i < Eaddrlen; i++){
- if(*p == 0)
- return -1;
- nip[0] = *p++;
- if(*p == 0)
- return -1;
- nip[1] = *p++;
- nip[2] = 0;
- to[i] = strtoul(nip, 0, 16);
- if(*p == ':')
- p++;
- }
- return 0;
-}
-
static Ether*
etherprobe(int cardno, int ctlrno)
{