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-next>] [day] [month] [year] [list]
Message-ID: <20180621145935.41ff8974@cakuba.netronome.com>
Date:   Thu, 21 Jun 2018 14:59:35 -0700
From:   Jakub Kicinski <jakub.kicinski@...ronome.com>
To:     Okash Khawaja <osk@...com>
Cc:     Daniel Borkmann <daniel@...earbox.net>,
        Martin KaFai Lau <kafai@...com>,
        Alexei Starovoitov <ast@...nel.org>,
        Yonghong Song <yhs@...com>,
        Quentin Monnet <quentin.monnet@...ronome.com>,
        "David S. Miller" <davem@...emloft.net>, <netdev@...r.kernel.org>,
        <kernel-team@...com>, <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH bpf-next 2/3] bpf: btf: add btf json print functionality

On Wed, 20 Jun 2018 13:30:53 -0700, Okash Khawaja wrote:
> $ sudo bpftool map dump -p id 14
> [{
>         "key": 0
>     },{
>         "value": {
>             "m": 1,
>             "n": 2,
>             "o": "c",
>             "p": [15,16,17,18,15,16,17,18
>             ],
>             "q": [[25,26,27,28,25,26,27,28
>                 ],[35,36,37,38,35,36,37,38
>                 ],[45,46,47,48,45,46,47,48
>                 ],[55,56,57,58,55,56,57,58
>                 ]
>             ],
>             "r": 1,
>             "s": 0x7ffff6f70568,
>             "t": {
>                 "x": 5,
>                 "y": 10
>             },
>             "u": 100,
>             "v": 20,
>             "w1": 0x7,
>             "w2": 0x3
>         }
>     }
> ]

I don't think this format is okay, JSON output is an API you shouldn't
break.  You can change the non-JSON output whatever way you like, but
JSON must remain backwards compatible.

The dump today has object per entry, e.g.:

{
        "key":["0x00","0x00","0x00","0x00",
        ],
        "value": ["0x02","0x00","0x00","0x00","0x00","0x00","0x00","0x00"
        ]
}

This format must remain, you may only augment it with new fields.  E.g.:

{
        "key":["0x00","0x00","0x00","0x00",
        ],
	"key_struct":{
		"index":0
	},
        "value": ["0x02","0x00","0x00","0x00","0x00","0x00","0x00","0x00"
        ],
	"value_struct":{
		"src_ip":2,
		"dst_ip:0
	}
}

The name XYZ_struct may not be the best, perhaps you can come up with a
better one?  

Does that make sense?  Am I missing what you're doing here?

One process note - please make sure you run checkpatch.pl --strict on
bpftool patches before posting.

Thanks for working on this!

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ