@@ -191,7 +191,7 @@ static int bpf_print_opt(struct action_util *au, FILE *f, struct rtattr *arg)
b, sizeof(b)));
}
- print_action_control(f, "default-action ", parm->action, _SL_);
+ print_action_control("default-action ", parm->action, _SL_);
print_uint(PRINT_ANY, "index", "\t index %u", parm->index);
print_int(PRINT_ANY, "ref", " ref %d", parm->refcnt);
print_int(PRINT_ANY, "bind", " bind %d", parm->bindcnt);
@@ -112,7 +112,7 @@ static int print_connmark(struct action_util *au, FILE *f, struct rtattr *arg)
ci = RTA_DATA(tb[TCA_CONNMARK_PARMS]);
print_uint(PRINT_ANY, "zone", "zone %u", ci->zone);
- print_action_control(f, " ", ci->action, "");
+ print_action_control(" ", ci->action, "");
print_nl();
print_uint(PRINT_ANY, "index", "\t index %u", ci->index);
@@ -204,7 +204,7 @@ print_csum(struct action_util *au, FILE *f, struct rtattr *arg)
uflag_4, uflag_5, uflag_6, uflag_7);
print_string(PRINT_ANY, "csum", "(%s) ", buf);
- print_action_control(f, "action ", sel->action, _SL_);
+ print_action_control("action ", sel->action, _SL_);
print_uint(PRINT_ANY, "index", "\tindex %u", sel->index);
print_int(PRINT_ANY, "ref", " ref %d", sel->refcnt);
print_int(PRINT_ANY, "bind", " bind %d", sel->bindcnt);
@@ -523,7 +523,7 @@ static int print_ct(struct action_util *au, FILE *f, struct rtattr *arg)
ct_print_helper(tb[TCA_CT_HELPER_FAMILY], tb[TCA_CT_HELPER_PROTO], tb[TCA_CT_HELPER_NAME]);
ct_print_nat(ct_action, tb);
- print_action_control(f, " ", p->action, "");
+ print_action_control(" ", p->action, "");
print_nl();
print_uint(PRINT_ANY, "index", "\t index %u", p->index);
@@ -236,7 +236,7 @@ static int print_ctinfo(struct action_util *au, FILE *f, struct rtattr *arg)
zone = rta_getattr_u16(tb[TCA_CTINFO_ZONE]);
print_hu(PRINT_ANY, "zone", "zone %u", zone);
- print_action_control(f, " ", ci->action, "");
+ print_action_control(" ", ci->action, "");
print_nl();
print_uint(PRINT_ANY, "index", "\t index %u", ci->index);
@@ -178,7 +178,7 @@ print_gact(struct action_util *au, FILE *f, struct rtattr *arg)
}
p = RTA_DATA(tb[TCA_GACT_PARMS]);
- print_action_control(f, "action ", p->action, "");
+ print_action_control("action ", p->action, "");
#ifdef CONFIG_GACT_PROB
if (tb[TCA_GACT_PROB] != NULL) {
pp = RTA_DATA(tb[TCA_GACT_PROB]);
@@ -191,7 +191,7 @@ print_gact(struct action_util *au, FILE *f, struct rtattr *arg)
print_nl();
print_string(PRINT_ANY, "random_type", "\t random type %s",
prob_n2a(pp->ptype));
- print_action_control(f, " ", pp->paction, " ");
+ print_action_control(" ", pp->paction, " ");
print_int(PRINT_ANY, "val", "val %d", pp->pval);
close_json_object();
#endif
@@ -517,7 +517,7 @@ static int print_gate(struct action_util *au, FILE *f, struct rtattr *arg)
if (tb[TCA_GATE_ENTRY_LIST])
print_gate_list(tb[TCA_GATE_ENTRY_LIST]);
- print_action_control(f, "\t", parm->action, "");
+ print_action_control("\t", parm->action, "");
print_uint(PRINT_ANY, "index", "\n\t index %u", parm->index);
print_int(PRINT_ANY, "ref", " ref %d", parm->refcnt);
@@ -236,7 +236,7 @@ static int print_ife(struct action_util *au, FILE *f, struct rtattr *arg)
print_string(PRINT_ANY, "mode", "%s ",
p->flags & IFE_ENCODE ? "encode" : "decode");
- print_action_control(f, "action ", p->action, " ");
+ print_action_control("action ", p->action, " ");
if (tb[TCA_IFE_TYPE]) {
ife_type = rta_getattr_u16(tb[TCA_IFE_TYPE]);
@@ -337,7 +337,7 @@ print_mirred(struct action_util *au, FILE *f, struct rtattr *arg)
print_string(PRINT_ANY, "to_dev", " to device %s)", dev);
}
- print_action_control(f, " ", p->action, "");
+ print_action_control(" ", p->action, "");
print_nl();
print_uint(PRINT_ANY, "index", "\tindex %u", p->index);
@@ -272,7 +272,7 @@ static int print_mpls(struct action_util *au, FILE *f, struct rtattr *arg)
}
break;
}
- print_action_control(f, " ", parm->action, "");
+ print_action_control(" ", parm->action, "");
print_nl();
print_uint(PRINT_ANY, "index", "\t index %u", parm->index);
@@ -169,7 +169,7 @@ print_nat(struct action_util *au, FILE * f, struct rtattr *arg)
print_string(PRINT_ANY, "new_addr", " %s",
format_host_r(AF_INET, 4, &sel->new_addr, buf1, sizeof(buf1)));
- print_action_control(f, " ", sel->action, "");
+ print_action_control(" ", sel->action, "");
print_nl();
print_uint(PRINT_ANY, "index", "\t index %u", sel->index);
print_int(PRINT_ANY, "ref", " ref %d", sel->refcnt);
@@ -791,7 +791,7 @@ static int print_pedit(struct action_util *au, FILE *f, struct rtattr *arg)
}
}
- print_action_control(f, "action ", sel->action, " ");
+ print_action_control("action ", sel->action, " ");
print_uint(PRINT_ANY, "nkeys", "keys %d\n", sel->nkeys);
print_uint(PRINT_ANY, "index", " \t index %u", sel->index);
print_int(PRINT_ANY, "ref", " ref %d", sel->refcnt);
@@ -325,12 +325,12 @@ static int print_police(struct action_util *a, FILE *f, struct rtattr *arg)
print_u64(PRINT_ANY, "pkts_burst", "pkts_burst %llu ", ppsburst64);
}
- print_action_control(f, "action ", p->action, "");
+ print_action_control("action ", p->action, "");
if (tb[TCA_POLICE_RESULT]) {
__u32 action = rta_getattr_u32(tb[TCA_POLICE_RESULT]);
- print_action_control(f, "/", action, " ");
+ print_action_control("/", action, " ");
} else {
print_string(PRINT_FP, NULL, " ", NULL);
}
@@ -160,7 +160,7 @@ static int print_sample(struct action_util *au, FILE *f, struct rtattr *arg)
print_uint(PRINT_ANY, "trunc_size", " trunc_size %u",
rta_getattr_u32(tb[TCA_SAMPLE_TRUNC_SIZE]));
- print_action_control(f, " ", p->action, "");
+ print_action_control(" ", p->action, "");
print_nl();
print_uint(PRINT_ANY, "index", "\t index %u", p->index);
@@ -239,7 +239,7 @@ static int print_skbedit(struct action_util *au, FILE *f, struct rtattr *arg)
"inheritdsfield");
}
- print_action_control(f, " ", p->action, "");
+ print_action_control(" ", p->action, "");
print_nl();
print_uint(PRINT_ANY, "index", "\t index %u", p->index);
@@ -178,7 +178,7 @@ static int print_skbmod(struct action_util *au, FILE *f, struct rtattr *arg)
p = RTA_DATA(tb[TCA_SKBMOD_PARMS]);
fprintf(f, "skbmod ");
- print_action_control(f, "", p->action, " ");
+ print_action_control("", p->action, " ");
if (tb[TCA_SKBMOD_ETYPE]) {
skbmod_etype = rta_getattr_u16(tb[TCA_SKBMOD_ETYPE]);
@@ -731,7 +731,7 @@ static int print_tunnel_key(struct action_util *au, FILE *f, struct rtattr *arg)
tb[TCA_TUNNEL_KEY_ENC_TTL]);
break;
}
- print_action_control(f, " ", parm->action, "");
+ print_action_control(" ", parm->action, "");
print_nl();
print_uint(PRINT_ANY, "index", "\t index %u", parm->index);
@@ -282,7 +282,7 @@ static int print_vlan(struct action_util *au, FILE *f, struct rtattr *arg)
print_string(PRINT_ANY, "src_mac", " src_mac %s", b1);
}
}
- print_action_control(f, " ", parm->action, "");
+ print_action_control(" ", parm->action, "");
print_nl();
print_uint(PRINT_ANY, "index", "\t index %u", parm->index);
@@ -539,8 +539,7 @@ int parse_action_control_slash(int *argc_p, char ***argv_p,
return 0;
}
-void print_action_control(FILE *f, const char *prefix,
- int action, const char *suffix)
+void print_action_control(const char *prefix, int action, const char *suffix)
{
print_string(PRINT_FP, NULL, "%s", prefix);
open_json_object("control_action");
@@ -109,8 +109,7 @@ void parse_action_control_dflt(int *argc_p, char ***argv_p,
int default_result);
int parse_action_control_slash(int *argc_p, char ***argv_p,
int *result1_p, int *result2_p, bool allow_num);
-void print_action_control(FILE *f, const char *prefix,
- int action, const char *suffix);
+void print_action_control(const char *prefix, int action, const char *suffix);
int police_print_xstats(struct action_util *a, FILE *f, struct rtattr *tb);
int tc_print_action(FILE *f, const struct rtattr *tb, unsigned short tot_acts);
int parse_action(int *argc_p, char ***argv_p, int tca_id, struct nlmsghdr *n);
The FILE handle is no longer used. Signed-off-by: Stephen Hemminger <stephen@networkplumber.org> --- tc/m_bpf.c | 2 +- tc/m_connmark.c | 2 +- tc/m_csum.c | 2 +- tc/m_ct.c | 2 +- tc/m_ctinfo.c | 2 +- tc/m_gact.c | 4 ++-- tc/m_gate.c | 2 +- tc/m_ife.c | 2 +- tc/m_mirred.c | 2 +- tc/m_mpls.c | 2 +- tc/m_nat.c | 2 +- tc/m_pedit.c | 2 +- tc/m_police.c | 4 ++-- tc/m_sample.c | 2 +- tc/m_skbedit.c | 2 +- tc/m_skbmod.c | 2 +- tc/m_tunnel_key.c | 2 +- tc/m_vlan.c | 2 +- tc/tc_util.c | 3 +-- tc/tc_util.h | 3 +-- 20 files changed, 22 insertions(+), 24 deletions(-)