/* Construct a netaddr from a given NHDP address  */
static void netaddr_from_nhdp_address(struct netaddr *target, nhdp_addr_t *n_addr)
/* Construct a netaddr from a given NHDP address  */
static void netaddr_from_nhdp_address(struct netaddr *target, nhdp_addr_t *n_addr)
{
    memset(target->_addr, 0, NETADDR_MAX_LENGTH);
    memcpy(target->_addr, n_addr->addr, n_addr->addr_size);
    switch (n_addr->addr_type) {
        case AF_CC110X:
            target->_prefix_len = 8u;
            target->_type = AF_CC110X;
            break;
        case AF_INET:
            target->_prefix_len = 32u;
            target->_type = AF_INET;
            break;
        case AF_INET6:
        default:
            target->_prefix_len = 128u;
            target->_type = AF_INET6;
            break;
    }
}