Thread (3 messages) 3 messages, 2 authors, 2018-03-07

Re: [PATCH iproute2 net-next v3] iprule: support for ip_proto, sport and dport match options

flat view

From: Roopa Prabhu <hidden>
Date: 2018-03-07 15:51:11

On Tue, Mar 6, 2018 at 6:44 PM, Stephen Hemminger
[off-list ref] wrote:
On Tue,  6 Mar 2018 18:07:59 -0800
Roopa Prabhu [off-list ref] wrote:
quoted
+     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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help