Re: [systemd-devel] Filter/Parse NETLINK_KOBJECT_UEVENT Messages

2021-09-14 Thread Ryan McClue
Sorry, I should clarify. The code in sd-device related to BPF I don't understand. What is the 'input' in BPF? Sent from ProtonMail mobile Original Message On 14 Sep. 2021, 5:24 pm, Lennart Poettering wrote: > On Di, 14.09.21 01:08, Ryan McClue (re.mcc...@pro

Re: [systemd-devel] Filter/Parse NETLINK_KOBJECT_UEVENT Messages

2021-09-14 Thread Ryan McClue
Earlier you said that .nl_groups = 2 will get kernel uevents augmented by udev. So, at some stage doesn't udev have to parse the raw kernel uevents, i.e. .nl_groups = 1? How does it do this? Does it use BPF to achieve this or the string parsing? -- Ryan McClue, Sydney ‐‐‐ Original Me

Re: [systemd-devel] Filter/Parse NETLINK_KOBJECT_UEVENT Messages

2021-09-13 Thread Ryan McClue
s wrote: > On Mon, Sep 13, 2021 at 12:29 PM Ryan McClue wrote: > >> Currently, I'm listening to NETLINK_KOBJECT_UEVENT messages with the >> following code: >> >> union UeventBuffer { >> struct nlmsghdr netlink_header; >> char raw[819

[systemd-devel] Filter/Parse NETLINK_KOBJECT_UEVENT Messages

2021-09-13 Thread Ryan McClue
Currently, I'm listening to NETLINK_KOBJECT_UEVENT messages with the following code: union UeventBuffer { struct nlmsghdr netlink_header; char raw[8192]; }; int sock = socket(PF_NETLINK, SOCK_RAW | SOCK_NONBLOCK, NETLINK_KOBJECT_UEVENT); struct sockaddr_nl addr = {}; addr.nl_family = AF_NETLINK;