-static int ns_parse_mac(char *mac, unsigned char *esi)
-{
- int i, j;
- short byte1, byte0;
-
- if (mac == NULL || esi == NULL)
- return -1;
- j = 0;
- for (i = 0; i < 6; i++) {
- if ((byte1 = hex_to_bin(mac[j++])) < 0)
- return -1;
- if ((byte0 = hex_to_bin(mac[j++])) < 0)
- return -1;
- esi[i] = (unsigned char)(byte1 * 16 + byte0);
- if (i < 5) {
- if (mac[j++] != ':')
- return -1;
- }
- }
- return 0;
-}
-
-