RE: [RFC net-next 3/4] ynl: add a sample python library
From: "Keller, Jacob E" <jacob.e.keller@intel.com>
Date: 2022-08-18 21:29:57
Also in:
linux-doc
-----Original Message----- From: Jakub Kicinski <kuba@kernel.org> Sent: Friday, August 12, 2022 4:08 PM To: Edward Cree <ecree.xilinx@gmail.com> Cc: Stephen Hemminger <stephen@networkplumber.org>; netdev@vger.kernel.org; davem@davemloft.net; edumazet@google.com; pabeni@redhat.com; sdf@google.com; Keller, Jacob E [off-list ref]; vadfed@fb.com; johannes@sipsolutions.net; jiri@resnulli.us; dsahern@kernel.org; fw@strlen.de; linux-doc@vger.kernel.org Subject: Re: [RFC net-next 3/4] ynl: add a sample python library On Fri, 12 Aug 2022 16:42:53 +0100 Edward Cree wrote:quoted
quoted
It would be great if python had standard module for netlink. Then your code could just (re)use that. Something like mnl but for python.There's pyroute2, that seemed alright when I used it for something a few years back, and I think it has the pieces you need. https://pyroute2.org/I saw that and assumed that its true to its name and only supports RTNL :( I'll reach out to Peter the maintainer for his thoughts. This patch was meant as a sample, I kept trying to finish up the C codegen for a week and it still didn't feel presentable enough for the RFC. In practice I'd rather leave writing the language specific libs to the experts.
It has some generic netlink support, but the way it parses messages was a bit confusing to me. It could benefit from the automatic generation of attribute parsing though!