For /dev/mem, map in memory to be copied to memory's own address space
[minix3.git] / lib / ip / ethere2a.c
blob1fb55fcacae221f2430217623db50c76c5cfe0e1
1 /* $Id$ */
2 /* This file was part of the etherlib package. */
4 #include <stdio.h>
6 #ifdef _MINIX
7 #include <sys/types.h>
8 #include <stdlib.h>
10 #include <net/gen/ether.h>
11 #include <net/gen/if_ether.h>
13 #define ETHERSTRLEN 18 /* max length of "xx:xx:xx:xx:xx:xx" */
14 #define ether_addr ether_addr_t
15 #define bytes ea_addr
16 char *ether_e2a _ARGS(( ether_addr_t *a, char *e ));
17 #else
18 #include "libether.h"
19 #endif
21 char *
22 ether_e2a (addr, estring)
23 ether_addr *addr;
24 char *estring;
26 #ifdef lint
27 char *sprintf ();
28 #endif
29 if (estring == NULL)
30 estring = (char *) malloc (ETHERSTRLEN);
32 if (estring != NULL)
33 (void) sprintf (estring, "%x:%x:%x:%x:%x:%x",
34 addr->bytes[0], addr->bytes[1], addr->bytes[2],
35 addr->bytes[3], addr->bytes[4], addr->bytes[5]);
36 return (estring);
39 #ifndef ETHERDB
41 char *
42 ether_ntoa (addr)
43 ether_addr *addr;
45 static char estring[ETHERSTRLEN];
47 return (ether_e2a (addr, estring));
50 #endif