X-Git-Url: http://git.sameswireless.fr/l2tpns.git/blobdiff_plain/d02a2433978f0919a780073b2f49af4b5d3ba9ea..eecccf0b30d5ec19960633d1b62cf5f9936d1f16:/util.c?ds=sidebyside diff --git a/util.c b/util.c index 78ec78b..65f8dc3 100644 --- a/util.c +++ b/util.c @@ -1,7 +1,5 @@ /* Misc util functions */ -char const *cvs_id_util = "$Id: util.c,v 1.14 2006/04/05 01:45:57 bodea Exp $"; - #include #include #include @@ -10,6 +8,7 @@ char const *cvs_id_util = "$Id: util.c,v 1.14 2006/04/05 01:45:57 bodea Exp $"; #include #include #include +#include #include "l2tpns.h" #ifdef BGP @@ -30,6 +29,17 @@ char *fmtaddr(in_addr_t addr, int n) return strcpy(addrs[n], inet_ntoa(in)); } +char *fmtMacAddr(uint8_t *pMacAddr) +{ + static char strMAC[2*ETH_ALEN]; + + sprintf(strMAC, "%02X:%02X:%02X:%02X:%02X:%02X", + pMacAddr[0], pMacAddr[1], pMacAddr[2], + pMacAddr[3], pMacAddr[4], pMacAddr[5]); + + return strMAC; +} + void *shared_malloc(unsigned int size) { void * p;