- if (ep == 0) {
- ep = (struct ether_addr *)calloc(1, sizeof (struct ether_addr));
- if (ep == 0)
- return (0);
- }
- i = sscanf(s, " %x:%x:%x:%x:%x:%x",
- &t[0], &t[1], &t[2], &t[3], &t[4], &t[5]);
- if (i != 6)
- return ((struct ether_addr *)NULL);
- for (i = 0; i < 6; i++)
- ep->ether_addr_octet[i] = t[i];
- return (ep);
-}
-
-/*
- * Given a host's name, this routine returns its 48 bit ethernet address.
- * Returns zero if successful, non-zero otherwise.
- */
-/* XXX need to override in netinfo */
-int ether_hostton(host, e)
- char *host; /* function input */
- struct ether_addr *e; /* function output */
-{
- char currenthost[256];
- char buf[512];
- char *val = buf;
- register int reason;
- FILE *f;
-
- if ((f = fopen(ethers, "r")) == NULL)
- {
- return (-1);
- }
-
- reason = -1;
- while (fscanf(f, "%[^\n] ", val) == 1)
- {
- if ((ether_line(val, e, currenthost) == 0) &&
- (strcmp(currenthost, host) == 0))
- {
- reason = 0;
- break;
- }
- }
-
- fclose(f);
- return (reason);
-}
-
-/*
- * Given a 48 bit ethernet address, this routine return its host name.
- * Returns zero if successful, non-zero otherwise.
- */
-/* XXX need to override in netinfo */
-int ether_ntohost(host, e)
- char *host; /* function output */
- struct ether_addr *e; /* function input */
-{
- struct ether_addr currente;
- char buf[512];
- char *val = buf;
- register int reason;
- FILE *f;
-
- if ((f = fopen(ethers, "r")) == NULL)