netlink_sysevent.c (0bcb3ebd1fb71f397f020d30e6c087d2831fd72e) netlink_sysevent.c (99084611932f5b61e1ed875da550a889f170e125)
1/*-
2 * SPDX-License-Identifier: BSD-2-Clause
3 *
4 * Copyright (c) 2023 Baptiste Daroussin <bapt@FreeBSD.org>
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

--- 60 unchanged lines hidden (view full) ---

69 }
70
71 struct genlmsghdr *ghdr = nlmsg_reserve_object(&nw, struct genlmsghdr);
72 if (ghdr == NULL) {
73 NL_LOG(LOG_DEBUG, "unable to allocate memory");
74 return;
75 }
76 ghdr->version = 0;
1/*-
2 * SPDX-License-Identifier: BSD-2-Clause
3 *
4 * Copyright (c) 2023 Baptiste Daroussin <bapt@FreeBSD.org>
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

--- 60 unchanged lines hidden (view full) ---

69 }
70
71 struct genlmsghdr *ghdr = nlmsg_reserve_object(&nw, struct genlmsghdr);
72 if (ghdr == NULL) {
73 NL_LOG(LOG_DEBUG, "unable to allocate memory");
74 return;
75 }
76 ghdr->version = 0;
77 ghdr->cmd = 0;
77 ghdr->cmd = NLSE_CMD_NEWEVENT;
78 ghdr->reserved = 0;
79 nlattr_add_string(&nw, NLSE_ATTR_SYSTEM, se->name);
80 nlattr_add_string(&nw, NLSE_ATTR_SUBSYSTEM, subsystem);
81 nlattr_add_string(&nw, NLSE_ATTR_TYPE, type);
82 if (data != NULL)
83 nlattr_add_string(&nw, NLSE_ATTR_DATA, data);
84 nlmsg_end(&nw);
85 nlmsg_flush(&nw);

--- 95 unchanged lines hidden ---
78 ghdr->reserved = 0;
79 nlattr_add_string(&nw, NLSE_ATTR_SYSTEM, se->name);
80 nlattr_add_string(&nw, NLSE_ATTR_SUBSYSTEM, subsystem);
81 nlattr_add_string(&nw, NLSE_ATTR_TYPE, type);
82 if (data != NULL)
83 nlattr_add_string(&nw, NLSE_ATTR_DATA, data);
84 nlmsg_end(&nw);
85 nlmsg_flush(&nw);

--- 95 unchanged lines hidden ---