add ether_aton[_r] and ether_ntoa[_r] functions

based on patch by Strake with minor stylistic changes, and combined
into a single file. this patch remained open for a long time due to
some question as to whether ether_aton would be better implemented in
terms of sscanf, and it's time something was committed, so here it is.
This commit is contained in:
Rich Felker
2013-06-25 21:15:27 -04:00
parent ef5507867b
commit 83966b369d
2 changed files with 57 additions and 0 deletions

14
include/netinet/ether.h Normal file
View File

@@ -0,0 +1,14 @@
#ifndef _NETINET_ETHER_H
#define _NETINET_ETHER_H
#include <netinet/if_ether.h>
char *ether_ntoa (const struct ether_addr *);
struct ether_addr *ether_aton (const char *);
char *ether_ntoa_r (const struct ether_addr *, char *);
struct ether_addr *ether_aton_r (const char *, struct ether_addr *);
#endif