#include <vfs.h> | |
#include <kfs.h> | |
#include <slab.h> | |
#include <kmalloc.h> | |
#include <kref.h> | |
#include <string.h> | |
#include <stdio.h> | |
#include <assert.h> | |
#include <error.h> | |
#include <cpio.h> | |
#include <pmap.h> | |
#include <smp.h> | |
int | |
parseether(uint8_t *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; | |
} |