[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180306184439.1a93d7d4@xeon-e3>
Date: Tue, 6 Mar 2018 18:44:39 -0800
From: Stephen Hemminger <stephen@...workplumber.org>
To: Roopa Prabhu <roopa@...ulusnetworks.com>
Cc: dsahern@...il.com, netdev@...r.kernel.org
Subject: Re: [PATCH iproute2 net-next v3] iprule: support for ip_proto,
sport and dport match options
On Tue, 6 Mar 2018 18:07:59 -0800
Roopa Prabhu <roopa@...ulusnetworks.com> wrote:
> + if (tb[FRA_IP_PROTO]) {
> + SPRINT_BUF(pbuf);
> + fprintf(fp, "ip_proto %s ",
> + inet_proto_n2a(rta_getattr_u8(tb[FRA_IP_PROTO]), pbuf,
> + sizeof(pbuf)));
> + }
> +
> + if (tb[FRA_SPORT_RANGE]) {
> + struct fib_rule_port_range *r = RTA_DATA(tb[FRA_SPORT_RANGE]);
> +
> + if (r->start == r->end)
> + fprintf(fp, "sport %hu ", r->start);
> + else
> + fprintf(fp, "sport %hu-%hu ", r->start, r->end);
> + }
> +
> + if (tb[FRA_DPORT_RANGE]) {
> + struct fib_rule_port_range *r = RTA_DATA(tb[FRA_DPORT_RANGE]);
> +
> + if (r->start == r->end)
> + fprintf(fp, "dport %hu ", r->start);
> + else
> + fprintf(fp, "dport %hu-%hu ", r->start, r->end);
> + }
> +
in net-next this is all JSON now.
Powered by blists - more mailing lists