On Tue, Mar 6, 2018 at 6:44 PM, Stephen Hemminger
<step...@networkplumber.org> wrote:
> On Tue,  6 Mar 2018 18:07:59 -0800
> Roopa Prabhu <ro...@cumulusnetworks.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.

ok i will rebase, thanks stephen

Reply via email to