예제 #1
0
int get_lisp_addr_from_char (
        char        *address,
        lisp_addr_t *lisp_addr)
{
    uint8_t result = BAD;

    lisp_addr->afi = get_afi(address);
    switch (lisp_addr->afi){
    case AF_INET:
        if (inet_pton(AF_INET,address,&(lisp_addr->address.ip))==1){
            result = GOOD;
        }
        break;
    case AF_INET6:
        if (inet_pton(AF_INET6,address,&(lisp_addr->address.ipv6))==1){
            result = GOOD;
        }
        break;
    default:
        break;
    }
    if (result == BAD){
        lisp_addr->afi = AF_UNSPEC;
    }
    return (result);
}
예제 #2
0
int get_lisp_addr_from_char (
        char        *address,
        lisp_addr_t *lisp_addr)
{
    uint8_t result = BAD;

    lisp_addr->afi = get_afi(address);
    switch (lisp_addr->afi){
    case AF_INET:
        if (inet_pton(AF_INET,address,&(lisp_addr->address.ip))==1){
            result = GOOD;
        }
        break;
    case AF_INET6:
        if (inet_pton(AF_INET6,address,&(lisp_addr->address.ipv6))==1){
            result = GOOD;
        }
        break;
    default:
        break;
    }
    if (result == BAD){
        lisp_addr->afi = AF_UNSPEC;
        lispd_log_msg(LISP_LOG_DEBUG_2,"get_lisp_addr_from_char: Error parsing the string of the address: %s", address);
    }
    return (result);
}
예제 #3
0
int get_lisp_addr_from_char (
        char        *address,
        lisp_addr_t *lisp_addr)
{
    lisp_addr->afi = get_afi(address);
    switch (lisp_addr->afi){
    case AF_INET:
        if (inet_pton(AF_INET,address,&(lisp_addr->address.ip))==1)
            return (GOOD);
        else
            return (BAD);
    case AF_INET6:
        if (inet_pton(AF_INET6,address,&(lisp_addr->address.ipv6))==1)
            return (GOOD);
        else
            return (BAD);
    }
    return (BAD);
}