lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ