dhcp/eth.cpp

16 lines
325 B
C++

#include <assert.h>
#include <stdio.h>
#include "eth.h"
namespace eth {
char const * tostr(uint8_t const * buf)
{
static char tmp[18];
int ret = snprintf(tmp, 18,
"%02x:%02x:%02x:%02x:%02x:%02x", buf[0], buf[1], buf[2], buf[3], buf[4], buf[5]);
assert(ret > 0);
return tmp;
}
}