2 * Copyright (c) 2018 Harsha Sharma <harshasharmaiitr@gmail.com>
3 * Copyright (c) 2018 The strace developers.
6 * SPDX-License-Identifier: LGPL-2.1-or-later
10 #include "print_fields.h"
11 #include "netlink_kobject_uevent.h"
13 #include <arpa/inet.h>
16 decode_netlink_kobject_uevent(struct tcb *tcp, kernel_ulong_t addr,
19 struct udev_monitor_netlink_header uh;
20 const char *prefix = "libudev";
21 unsigned int offset = sizeof(uh);
23 if (!verbose(tcp) || (exiting(tcp) && syserror(tcp)) ||
24 !addr || len < offset || umove(tcp, addr, &uh) ||
25 strcmp(uh.prefix, prefix) != 0) {
26 printstrn(tcp, addr, len);
30 PRINT_FIELD_CSTRING("{{", uh, prefix);
31 tprintf(", magic=htonl(%#x)", ntohl(uh.magic));
32 PRINT_FIELD_U(", ", uh, header_size);
33 PRINT_FIELD_U(", ", uh, properties_off);
34 PRINT_FIELD_U(", ", uh, properties_len);
35 tprintf(", filter_subsystem_hash=htonl(%#x)", ntohl(uh.filter_subsystem_hash));
36 tprintf(", filter_devtype_hash=htonl(%#x)", ntohl(uh.filter_devtype_hash));
37 tprintf(", filter_tag_bloom_hi=htonl(%#x)", ntohl(uh.filter_tag_bloom_hi));
38 tprintf(", filter_tag_bloom_lo=htonl(%#x)", ntohl(uh.filter_tag_bloom_lo));
42 printstrn(tcp, addr + offset, len - offset);