Re: [PATCH iproute2] tc: add print options to fix json output

2020-10-29 Thread David Ahern
On 10/29/20 6:42 PM, Sharma, Puneet wrote: > Because basic match is made of multiple keywords and parsed and handle > differently > example: > $ tc filter add dev $eth_dev_name ingress priority 2 protocol ipv4 > basic match '(cmp(u8 at 9 layer network eq 6) or cmp(u8 at 9 layer network

Re: [PATCH iproute2] tc: add print options to fix json output

2020-10-29 Thread Sharma, Puneet
Because basic match is made of multiple keywords and parsed and handle differently example: $ tc filter add dev $eth_dev_name ingress priority 2 protocol ipv4 basic match '(cmp(u8 at 9 layer network eq 6) or cmp(u8 at 9 layer network eq 17)) and ipset(sg-test-ipv4 src)' action pass

Re: [PATCH iproute2] tc: add print options to fix json output

2020-10-29 Thread Stephen Hemminger
On Thu, 29 Oct 2020 21:20:55 + "Sharma, Puneet" wrote: > I did provide an example to better explain what patch is doing. > > Sorry for long paste. > > So, with current implementation output of command: > $ tc -s -d -j filter show dev ingress > > would contain: > [{ > "protocol": "

Re: [PATCH iproute2] tc: add print options to fix json output

2020-10-29 Thread Stephen Hemminger
On Wed, 28 Oct 2020 14:35:54 -0400 Puneet Sharma wrote: > Currently, json for basic rules output does not produce correct json > syntax. The following fixes were done to correct it for extended > matches for use with "basic" filters. > > tc/f_basic.c: replace fprintf with print_uint to support j

[PATCH iproute2] tc: add print options to fix json output

2020-10-28 Thread Puneet Sharma
Currently, json for basic rules output does not produce correct json syntax. The following fixes were done to correct it for extended matches for use with "basic" filters. tc/f_basic.c: replace fprintf with print_uint to support json output. fixing this prints "handle" tag correctly in json output