[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <aea4f633-b4b4-4b3c-79b4-9b4876833e96@gmail.com>
Date: Wed, 29 Apr 2020 20:43:32 -0600
From: David Ahern <dsahern@...il.com>
To: Petr Machata <petrm@...lanox.com>, netdev@...r.kernel.org
Cc: dsahern@...il.com, stephen@...workplumber.org
Subject: Re: [PATCH iproute2-next v2] tc: pedit: Support JSON dumping
On 4/28/20 5:44 AM, Petr Machata wrote:
> The action pedit does not currently support dumping to JSON. Convert
> print_pedit() to the print_* family of functions so that dumping is correct
> both in plain and JSON mode. In plain mode, the output is character for
> character the same as it was before. In JSON mode, this is an example dump:
>
> $ tc filter add dev dummy0 ingress prio 125 flower \
> action pedit ex munge udp dport set 12345 \
> munge ip ttl add 1 \
> munge offset 10 u8 clear
> $ tc -j filter show dev dummy0 ingress | jq
> [
> {
> "protocol": "all",
> "pref": 125,
> "kind": "flower",
> "chain": 0
> },
> {
> "protocol": "all",
> "pref": 125,
> "kind": "flower",
> "chain": 0,
> "options": {
> "handle": 1,
> "keys": {},
> "not_in_hw": true,
> "actions": [
> {
> "order": 1,
> "kind": "pedit",
> "control_action": {
> "type": "pass"
> },
> "nkeys": 3,
> "index": 1,
> "ref": 1,
> "bind": 1,
> "keys": [
> {
> "htype": "udp",
> "offset": 0,
> "cmd": "set",
> "val": "3039",
> "mask": "ffff0000"
> },
> {
> "htype": "ipv4",
> "offset": 8,
> "cmd": "add",
> "val": "1000000",
> "mask": "ffffff"
> },
> {
> "htype": "network",
> "offset": 8,
> "cmd": "set",
> "val": "0",
> "mask": "ffff00ff"
> }
> ]
> }
> ]
> }
> }
> ]
>
> Signed-off-by: Petr Machata <petrm@...lanox.com>
> ---
>
applied to iproute2-next
Powered by blists - more mailing lists