Esempio n. 1
0
/*
 * debug rsvp options
 */
void debug_tca_options_rsvp(int lev, struct tcmsg *tcm, struct rtattr *tca, const char *name)
{
    struct rtattr *rsvp[__TCA_RSVP_MAX];

    rec_dbg(lev, "%s(%hu):", name, RTA_ALIGN(tca->rta_len));
    parse_nested_rtattr(rsvp, TCA_RSVP_MAX, tca);

    if(rsvp[TCA_RSVP_CLASSID])
        debug_tca_classid(lev+1, rsvp[TCA_RSVP_CLASSID],
            "TCA_RSVP_CLASSID");

    if(rsvp[TCA_RSVP_DST])
        debug_rta_tc_addr(lev+1, tcm, rsvp[TCA_RSVP_DST],
            "TCA_RSVP_DST");

    if(rsvp[TCA_RSVP_SRC])
        debug_rta_tc_addr(lev+1, tcm, rsvp[TCA_RSVP_SRC],
            "TCA_RSVP_SRC");

    if(rsvp[TCA_RSVP_PINFO])
        debug_tca_rsvp_pinfo(lev+1, rsvp[TCA_RSVP_PINFO],
            "TCA_RSVP_PINFO");

    if(rsvp[TCA_RSVP_POLICE])
        debug_tca_act_options_police(lev+1, rsvp[TCA_RSVP_POLICE],
            "TCA_RSVP_POLICE");

    if(rsvp[TCA_RSVP_ACT])
        debug_tca_acts(lev+1, rsvp[TCA_RSVP_ACT],
            "TCA_RSVP_ACT");
}
Esempio n. 2
0
/*
 * debug attribute TCA_ACT_OPTIONS
 */
void debug_tca_act_options(int lev, struct rtattr *act,
    const char *name, char *kind, int len)
{
    rec_dbg(lev, "%s(%hu):", name, RTA_ALIGN(act->rta_len));

    if(!strncmp(kind, "police", len))
        debug_tca_act_options_police(lev, act, NULL);
    else if(!strncmp(kind, "gact", len))
        debug_tca_act_options_gact(lev, act);
    else if(!strncmp(kind, "pedit", len))
        debug_tca_act_options_pedit(lev, act);
    else if(!strncmp(kind, "mirred", len))
        debug_tca_act_options_mirred(lev, act);
#ifdef HAVE_LINUX_TC_ACT_TC_NAT_H
    else if(!strncmp(kind, "nat", len))
        debug_tca_act_options_nat(lev, act);
#endif
#ifdef HAVE_LINUX_TC_ACT_TC_SKBEDIT_H
    else if(!strncmp(kind, "skbedit", len))
        debug_tca_act_options_skbedit(lev, act);
#endif
#ifdef HAVE_LINUX_TC_ACT_TC_CSUM_H
    else if(!strncmp(kind, "csum", len))
        debug_tca_act_options_csum(lev, act);
#endif
    else
        rec_dbg(lev, "    -- unknown action %s --", kind);
}
Esempio n. 3
0
/*
 * debug flow options
 */
void debug_tca_options_flow(int lev, struct rtattr *tca, const char *name)
{
    struct rtattr *flow[__TCA_FLOW_MAX];

    rec_dbg(lev, "%s(%hu):", name, RTA_ALIGN(tca->rta_len));
    parse_nested_rtattr(flow, TCA_FLOW_MAX, tca);

    if(flow[TCA_FLOW_KEYS])
        debug_rta_u32(lev+1, flow[TCA_FLOW_KEYS],
            "TCA_FLOW_KEYS", conv_flow_key);

    if(flow[TCA_FLOW_MODE])
        debug_rta_u32(lev+1, flow[TCA_FLOW_MODE],
            "TCA_FLOW_MODE", conv_flow_mode);

    if(flow[TCA_FLOW_BASECLASS])
        debug_tca_classid(lev+1, flow[TCA_FLOW_BASECLASS],
            "TCA_FLOW_BASECLASS");

    if(flow[TCA_FLOW_RSHIFT])
        debug_rta_u32(lev+1, flow[TCA_FLOW_RSHIFT],
            "TCA_FLOW_RSHIT", NULL);

    if(flow[TCA_FLOW_ADDEND])
        debug_rta_u32x(lev+1, flow[TCA_FLOW_ADDEND],
            "TCA_FLOW_ADDEND", NULL);

    if(flow[TCA_FLOW_MASK])
        debug_rta_u32x(lev+1, flow[TCA_FLOW_MASK],
            "TCA_FLOW_MASK", NULL);

    if(flow[TCA_FLOW_XOR])
        debug_rta_u32x(lev+1, flow[TCA_FLOW_XOR],
            "TCA_FLOW_XOR", NULL);

    if(flow[TCA_FLOW_DIVISOR])
        debug_rta_u32(lev+1, flow[TCA_FLOW_DIVISOR],
            "TCA_FLOW_DIVISOR", NULL);

    if(flow[TCA_FLOW_ACT])
        debug_tca_acts(lev+1, flow[TCA_FLOW_ACT],
            "TCA_FLOW_ACT");

    if(flow[TCA_FLOW_POLICE])
        debug_tca_act_options_police(lev+1, flow[TCA_FLOW_POLICE],
            "TCA_FLOW_POLICE");

    if(flow[TCA_FLOW_EMATCHES])
        debug_tca_ematch(lev+1, flow[TCA_FLOW_EMATCHES],
            "TCA_FLOW_EMATCHES");

    if(flow[TCA_FLOW_PERTURB])
        debug_rta_u32(lev+1, flow[TCA_FLOW_PERTURB],
            "TCA_FLOW_PERTURB", NULL);
}