57 #define MAC_STR_LEN 18 67 #define MAC_ADD_FORMAT_SCN "%02" SCNx8 ":%02" SCNx8 ":%02" SCNx8 ":%02" SCNx8 ":%02" SCNx8 ":%02" SCNx8 "" 68 #define MAC_ADD_FORMAT_PRI "%02" PRIx8 ":%02" PRIx8 ":%02" PRIx8 ":%02" PRIx8 ":%02" PRIx8 ":%02" PRIx8 "" 87 memcpy(&tmp.bytes, array, 6);
101 int res = sscanf(str,
MAC_ADD_FORMAT_SCN, &addr->bytes[0], &addr->bytes[1], &addr->bytes[2],
102 &addr->bytes[3], &addr->bytes[4], &addr->bytes[5]);
106 memset(addr->bytes, 0, 6);
120 return memcmp(addr1->bytes, addr2->bytes, 6);
133 addr->bytes[0], addr->bytes[1], addr->bytes[2],
134 addr->bytes[3], addr->bytes[4], addr->bytes[5]);
146 memcpy(array, (
void *) addr->bytes, 6);
#define MAC_ADD_FORMAT_SCN
INLINE void mac_to_str(const mac_addr_t *addr, char *str)
INLINE void mac_to_bytes(const mac_addr_t *addr, uint8_t *array)
#define MAC_ADD_FORMAT_PRI
INLINE mac_addr_t mac_from_bytes(uint8_t *array)
INLINE int mac_from_str(const char *str, mac_addr_t *addr)
memcpy(buffer, rec, ur_rec_size(tmplt, rec))
struct __attribute__((packed)) mac_addr_s
INLINE int mac_cmp(const mac_addr_t *addr1, const mac_addr_t *addr2)