Ejemplo n.º 1
0
/*
 * parse attribute TCA_RSVP_SRC
 */
int parse_tca_rsvp_src(char *msg, char **mp, struct tcmsg *tcm, struct rtattr *rsvp)
{
    char addr[INET6_ADDRSTRLEN+1] = "";
    int res;

    res = inet_ntop_tc_addr(tcm, rsvp, addr, sizeof(addr));
    if(res) {
        rec_log("error: %s: %s", __func__,
            (res == 1) ? strerror(errno) : "payload too short");
        return(1);
    }
    *mp = add_log(msg, *mp, "source=%s ", addr);

    return(0);
}
Ejemplo n.º 2
0
Archivo: rta.c Proyecto: t2mune/nield
/*
 * debug attribute
 */
void debug_rta_tc_addr(int lev, struct tcmsg *tcm, struct rtattr *rta, const char *name)
{
    char addr[INET6_ADDRSTRLEN+1] = "";
    int res;

    res = inet_ntop_tc_addr(tcm, rta, addr, sizeof(addr));
    if(res) {
        rec_dbg(lev, "%s(%hu): -- %s --",
            name, RTA_ALIGN(rta->rta_len),
            (res == 1) ? strerror(errno) : "payload too short");
        return;
    }

    rec_dbg(lev, "%s(%hu): %s", name, RTA_ALIGN(rta->rta_len), addr);
}