]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
libsystemd: Clean up includes
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Thu, 22 May 2025 09:27:45 +0000 (11:27 +0200)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Sat, 24 May 2025 18:40:24 +0000 (03:40 +0900)
For libsystemd's headers, the changes made depend on whether the
header is installed or not. For installed headers, the only change
made is that commonly included headers were moved to _sd-common.h.
For these headers, there should be no noticeable change in behavior
when including them. For non-installed headers, includes were replaced
with forward declarations where possible as usual.

Split out of #37344.

272 files changed:
src/libsystemd-network/arp-util.c
src/libsystemd-network/arp-util.h
src/libsystemd-network/dhcp-client-id-internal.h
src/libsystemd-network/dhcp-client-internal.h
src/libsystemd-network/dhcp-duid-internal.h
src/libsystemd-network/dhcp-lease-internal.h
src/libsystemd-network/dhcp-network.c
src/libsystemd-network/dhcp-network.h
src/libsystemd-network/dhcp-option.c
src/libsystemd-network/dhcp-option.h
src/libsystemd-network/dhcp-packet.c
src/libsystemd-network/dhcp-packet.h
src/libsystemd-network/dhcp-protocol.h
src/libsystemd-network/dhcp-server-internal.h
src/libsystemd-network/dhcp-server-lease-internal.h
src/libsystemd-network/dhcp6-client-internal.h
src/libsystemd-network/dhcp6-internal.h
src/libsystemd-network/dhcp6-lease-internal.h
src/libsystemd-network/dhcp6-network.c
src/libsystemd-network/dhcp6-option.c
src/libsystemd-network/dhcp6-option.h
src/libsystemd-network/dhcp6-protocol.h
src/libsystemd-network/dns-resolver-internal.h
src/libsystemd-network/fuzz-dhcp-client.c
src/libsystemd-network/fuzz-dhcp-server-relay.c
src/libsystemd-network/fuzz-dhcp-server.c
src/libsystemd-network/fuzz-dhcp6-client.c
src/libsystemd-network/fuzz-lldp-rx.c
src/libsystemd-network/fuzz-ndisc-rs.c
src/libsystemd-network/icmp6-packet.c
src/libsystemd-network/icmp6-packet.h
src/libsystemd-network/icmp6-test-util.c
src/libsystemd-network/icmp6-test-util.h
src/libsystemd-network/icmp6-util.c
src/libsystemd-network/icmp6-util.h
src/libsystemd-network/lldp-neighbor.c
src/libsystemd-network/lldp-neighbor.h
src/libsystemd-network/lldp-network.c
src/libsystemd-network/lldp-network.h
src/libsystemd-network/lldp-rx-internal.h
src/libsystemd-network/ndisc-internal.h
src/libsystemd-network/ndisc-neighbor-internal.h
src/libsystemd-network/ndisc-option.c
src/libsystemd-network/ndisc-option.h
src/libsystemd-network/ndisc-redirect-internal.h
src/libsystemd-network/ndisc-router-internal.h
src/libsystemd-network/ndisc-router-solicit-internal.h
src/libsystemd-network/network-common.h
src/libsystemd-network/network-internal.c
src/libsystemd-network/network-internal.h
src/libsystemd-network/radv-internal.h
src/libsystemd-network/sd-dhcp-client-id.c
src/libsystemd-network/sd-dhcp-client.c
src/libsystemd-network/sd-dhcp-duid.c
src/libsystemd-network/sd-dhcp-lease.c
src/libsystemd-network/sd-dhcp-server-lease.c
src/libsystemd-network/sd-dhcp-server.c
src/libsystemd-network/sd-dhcp6-client.c
src/libsystemd-network/sd-dhcp6-lease.c
src/libsystemd-network/sd-dns-resolver.c
src/libsystemd-network/sd-dns-resolver.h
src/libsystemd-network/sd-ipv4acd.c
src/libsystemd-network/sd-ipv4ll.c
src/libsystemd-network/sd-lldp-rx.c
src/libsystemd-network/sd-lldp-tx.c
src/libsystemd-network/sd-ndisc-neighbor.c
src/libsystemd-network/sd-ndisc-redirect.c
src/libsystemd-network/sd-ndisc-router-solicit.c
src/libsystemd-network/sd-ndisc-router.c
src/libsystemd-network/sd-ndisc.c
src/libsystemd-network/sd-radv.c
src/libsystemd-network/test-acd.c
src/libsystemd-network/test-dhcp-client.c
src/libsystemd-network/test-dhcp-option.c
src/libsystemd-network/test-dhcp-server.c
src/libsystemd-network/test-dhcp6-client.c
src/libsystemd-network/test-ipv4ll-manual.c
src/libsystemd-network/test-ipv4ll.c
src/libsystemd-network/test-lldp-rx.c
src/libsystemd-network/test-ndisc-ra.c
src/libsystemd-network/test-ndisc-rs.c
src/libsystemd-network/test-ndisc-send.c
src/libsystemd-network/test-sd-dhcp-lease.c
src/libsystemd/sd-bus/bus-common-errors.c
src/libsystemd/sd-bus/bus-container.c
src/libsystemd/sd-bus/bus-container.h
src/libsystemd/sd-bus/bus-control.c
src/libsystemd/sd-bus/bus-control.h
src/libsystemd/sd-bus/bus-convenience.c
src/libsystemd/sd-bus/bus-creds.c
src/libsystemd/sd-bus/bus-creds.h
src/libsystemd/sd-bus/bus-dump-json.c
src/libsystemd/sd-bus/bus-dump.c
src/libsystemd/sd-bus/bus-dump.h
src/libsystemd/sd-bus/bus-error.c
src/libsystemd/sd-bus/bus-error.h
src/libsystemd/sd-bus/bus-internal.c
src/libsystemd/sd-bus/bus-internal.h
src/libsystemd/sd-bus/bus-introspect.c
src/libsystemd/sd-bus/bus-introspect.h
src/libsystemd/sd-bus/bus-kernel.c
src/libsystemd/sd-bus/bus-kernel.h
src/libsystemd/sd-bus/bus-match.c
src/libsystemd/sd-bus/bus-match.h
src/libsystemd/sd-bus/bus-message.c
src/libsystemd/sd-bus/bus-message.h
src/libsystemd/sd-bus/bus-objects.c
src/libsystemd/sd-bus/bus-objects.h
src/libsystemd/sd-bus/bus-protocol.h
src/libsystemd/sd-bus/bus-signature.c
src/libsystemd/sd-bus/bus-signature.h
src/libsystemd/sd-bus/bus-slot.c
src/libsystemd/sd-bus/bus-slot.h
src/libsystemd/sd-bus/bus-socket.c
src/libsystemd/sd-bus/bus-socket.h
src/libsystemd/sd-bus/bus-track.c
src/libsystemd/sd-bus/bus-track.h
src/libsystemd/sd-bus/bus-type.c
src/libsystemd/sd-bus/bus-type.h
src/libsystemd/sd-bus/fuzz-bus-match.c
src/libsystemd/sd-bus/fuzz-bus-message.c
src/libsystemd/sd-bus/sd-bus.c
src/libsystemd/sd-bus/test-bus-benchmark.c
src/libsystemd/sd-bus/test-bus-chat.c
src/libsystemd/sd-bus/test-bus-cleanup.c
src/libsystemd/sd-bus/test-bus-marshal.c
src/libsystemd/sd-bus/test-bus-match.c
src/libsystemd/sd-bus/test-bus-objects.c
src/libsystemd/sd-bus/test-bus-peersockaddr.c
src/libsystemd/sd-bus/test-bus-queue-ref-cycle.c
src/libsystemd/sd-bus/test-bus-server.c
src/libsystemd/sd-bus/test-bus-signature.c
src/libsystemd/sd-bus/test-bus-track.c
src/libsystemd/sd-bus/test-bus-vtable.c
src/libsystemd/sd-bus/test-bus-watch-bind.c
src/libsystemd/sd-daemon/sd-daemon.c
src/libsystemd/sd-device/device-enumerator-private.h
src/libsystemd/sd-device/device-enumerator.c
src/libsystemd/sd-device/device-filter.c
src/libsystemd/sd-device/device-filter.h
src/libsystemd/sd-device/device-internal.h
src/libsystemd/sd-device/device-monitor-private.h
src/libsystemd/sd-device/device-monitor.c
src/libsystemd/sd-device/device-private.c
src/libsystemd/sd-device/device-private.h
src/libsystemd/sd-device/device-util.c
src/libsystemd/sd-device/device-util.h
src/libsystemd/sd-device/sd-device.c
src/libsystemd/sd-device/test-device-util.c
src/libsystemd/sd-device/test-sd-device-monitor.c
src/libsystemd/sd-device/test-sd-device-thread.c
src/libsystemd/sd-device/test-sd-device.c
src/libsystemd/sd-event/event-source.h
src/libsystemd/sd-event/event-util.c
src/libsystemd/sd-event/event-util.h
src/libsystemd/sd-event/sd-event.c
src/libsystemd/sd-event/test-event.c
src/libsystemd/sd-hwdb/hwdb-internal.h
src/libsystemd/sd-hwdb/sd-hwdb.c
src/libsystemd/sd-id128/id128-util.c
src/libsystemd/sd-id128/id128-util.h
src/libsystemd/sd-id128/sd-id128.c
src/libsystemd/sd-journal/audit-type.h
src/libsystemd/sd-journal/catalog.c
src/libsystemd/sd-journal/catalog.h
src/libsystemd/sd-journal/fsprg.h
src/libsystemd/sd-journal/journal-authenticate.c
src/libsystemd/sd-journal/journal-authenticate.h
src/libsystemd/sd-journal/journal-def.h
src/libsystemd/sd-journal/journal-file.c
src/libsystemd/sd-journal/journal-file.h
src/libsystemd/sd-journal/journal-internal.h
src/libsystemd/sd-journal/journal-send.c
src/libsystemd/sd-journal/journal-send.h
src/libsystemd/sd-journal/journal-vacuum.c
src/libsystemd/sd-journal/journal-vacuum.h
src/libsystemd/sd-journal/journal-verify.c
src/libsystemd/sd-journal/lookup3.h
src/libsystemd/sd-journal/mmap-cache.c
src/libsystemd/sd-journal/mmap-cache.h
src/libsystemd/sd-journal/sd-journal.c
src/libsystemd/sd-journal/test-catalog.c
src/libsystemd/sd-journal/test-journal-append.c
src/libsystemd/sd-journal/test-journal-enum.c
src/libsystemd/sd-journal/test-journal-file.c
src/libsystemd/sd-journal/test-journal-flush.c
src/libsystemd/sd-journal/test-journal-init.c
src/libsystemd/sd-journal/test-journal-interleaving.c
src/libsystemd/sd-journal/test-journal-match.c
src/libsystemd/sd-journal/test-journal-send.c
src/libsystemd/sd-journal/test-journal-stream.c
src/libsystemd/sd-journal/test-journal-verify.c
src/libsystemd/sd-journal/test-journal.c
src/libsystemd/sd-journal/test-mmap-cache.c
src/libsystemd/sd-json/json-internal.h
src/libsystemd/sd-json/json-util.c
src/libsystemd/sd-json/json-util.h
src/libsystemd/sd-json/sd-json.c
src/libsystemd/sd-login/sd-login.c
src/libsystemd/sd-login/test-login.c
src/libsystemd/sd-login/test-sd-login.c
src/libsystemd/sd-netlink/netlink-genl.c
src/libsystemd/sd-netlink/netlink-genl.h
src/libsystemd/sd-netlink/netlink-internal.h
src/libsystemd/sd-netlink/netlink-message-nfnl.c
src/libsystemd/sd-netlink/netlink-message-rtnl.c
src/libsystemd/sd-netlink/netlink-message.c
src/libsystemd/sd-netlink/netlink-slot.c
src/libsystemd/sd-netlink/netlink-slot.h
src/libsystemd/sd-netlink/netlink-sock-diag.c
src/libsystemd/sd-netlink/netlink-sock-diag.h
src/libsystemd/sd-netlink/netlink-socket.c
src/libsystemd/sd-netlink/netlink-types-genl.c
src/libsystemd/sd-netlink/netlink-types-internal.h
src/libsystemd/sd-netlink/netlink-types-nfnl.c
src/libsystemd/sd-netlink/netlink-types-rtnl.c
src/libsystemd/sd-netlink/netlink-types-sdnl.c
src/libsystemd/sd-netlink/netlink-types.c
src/libsystemd/sd-netlink/netlink-types.h
src/libsystemd/sd-netlink/netlink-util.c
src/libsystemd/sd-netlink/netlink-util.h
src/libsystemd/sd-netlink/sd-netlink.c
src/libsystemd/sd-netlink/test-netlink.c
src/libsystemd/sd-network/network-util.h
src/libsystemd/sd-network/sd-network.c
src/libsystemd/sd-path/path-lookup.c
src/libsystemd/sd-path/path-lookup.h
src/libsystemd/sd-path/sd-path.c
src/libsystemd/sd-resolve/sd-resolve.c
src/libsystemd/sd-resolve/test-resolve.c
src/libsystemd/sd-varlink/sd-varlink-idl.c
src/libsystemd/sd-varlink/sd-varlink.c
src/libsystemd/sd-varlink/varlink-idl-util.h
src/libsystemd/sd-varlink/varlink-internal.h
src/libsystemd/sd-varlink/varlink-util.c
src/libsystemd/sd-varlink/varlink-util.h
src/systemd/_sd-common.h
src/systemd/sd-bus-vtable.h
src/systemd/sd-bus.h
src/systemd/sd-daemon.h
src/systemd/sd-device.h
src/systemd/sd-dhcp-client-id.h
src/systemd/sd-dhcp-client.h
src/systemd/sd-dhcp-duid.h
src/systemd/sd-dhcp-lease.h
src/systemd/sd-dhcp-option.h
src/systemd/sd-dhcp-server.h
src/systemd/sd-dhcp6-client.h
src/systemd/sd-dhcp6-lease.h
src/systemd/sd-dhcp6-option.h
src/systemd/sd-event.h
src/systemd/sd-id128.h
src/systemd/sd-ipv4acd.h
src/systemd/sd-ipv4ll.h
src/systemd/sd-journal.h
src/systemd/sd-json.h
src/systemd/sd-lldp-rx.h
src/systemd/sd-lldp-tx.h
src/systemd/sd-lldp.h
src/systemd/sd-login.h
src/systemd/sd-ndisc-neighbor.h
src/systemd/sd-ndisc-redirect.h
src/systemd/sd-ndisc-router-solicit.h
src/systemd/sd-ndisc-router.h
src/systemd/sd-ndisc.h
src/systemd/sd-netlink.h
src/systemd/sd-network.h
src/systemd/sd-path.h
src/systemd/sd-radv.h
src/systemd/sd-resolve.h
src/systemd/sd-varlink-idl.h
src/systemd/sd-varlink.h

index ad61614f12f6769b7636b2bc5f89d9f5d9cbb72a..a017cb7ab29df2c62f69e0bbdbc7337eab3bbc91 100644 (file)
@@ -3,7 +3,6 @@
   Copyright Â© 2014 Axis Communications AB. All rights reserved.
 ***/
 
-#include <arpa/inet.h>
 #include <linux/filter.h>
 #include <netinet/if_ether.h>
 
@@ -11,6 +10,7 @@
 #include "ether-addr-util.h"
 #include "fd-util.h"
 #include "in-addr-util.h"
+#include "socket-util.h"
 #include "unaligned.h"
 
 int arp_update_filter(int fd, const struct in_addr *a, const struct ether_addr *mac) {
index b66a81bf9bda078b81560c69a184613cb573f443..4152c3a0986b6e7b4772c4dc78499196d28be9e6 100644 (file)
@@ -5,11 +5,7 @@
   Copyright Â© 2014 Axis Communications AB. All rights reserved.
 ***/
 
-#include <net/ethernet.h>
-#include <netinet/in.h>
-
-#include "socket-util.h"
-#include "sparse-endian.h"
+#include "forward.h"
 
 int arp_update_filter(int fd, const struct in_addr *a, const struct ether_addr *mac);
 int arp_network_bind_raw_socket(int ifindex, const struct in_addr *a, const struct ether_addr *mac);
index 382575e7a286e21c5649821e79f208ef515e7bf7..f43d278cdddd608f20cd1912aaab0d863167155e 100644 (file)
@@ -1,12 +1,12 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 #pragma once
 
+#include <linux/if_ether.h>
+
 #include "sd-dhcp-client-id.h"
-#include "sd-json.h"
 
 #include "dhcp-duid-internal.h"
-#include "macro.h"
-#include "siphash24.h"
+#include "forward.h"
 #include "sparse-endian.h"
 
 /* RFC 2132 section 9.14: its minimum length is 2.
index 247fd9d9120ddc2c6182324fb2ea719438646463..3248e1098b19d5614caec598cdf29f17ea08892d 100644 (file)
@@ -1,11 +1,9 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 #pragma once
 
-#include <errno.h>
-
 #include "sd-dhcp-client.h"
 
-#include "macro.h"
+#include "forward.h"
 #include "network-common.h"
 
 typedef enum DHCPState {
index 0d3d6b5cef6cfd7cc17452941c20e86726e7fcfd..061786cd02d2f2b641cce0f728a40d907bda421a 100644 (file)
@@ -1,12 +1,11 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 #pragma once
 
-#include "sd-device.h"
 #include "sd-dhcp-duid.h"
 #include "sd-id128.h"
 
 #include "ether-addr-util.h"
-#include "macro.h"
+#include "forward.h"
 #include "sparse-endian.h"
 
 #define SYSTEMD_PEN    43793
index 394c71bdf0fe60db7a985d8ecdac832a405589fe..0ed8c3fc938acca8e51a229a2068de201df827c8 100644 (file)
@@ -5,13 +5,12 @@
   Copyright Â© 2013 Intel Corporation. All rights reserved.
 ***/
 
-#include "sd-dhcp-client.h"
+#include "sd-dhcp-lease.h"
 
-#include "alloc-util.h"
 #include "dhcp-client-id-internal.h"
 #include "dhcp-option.h"
+#include "forward.h"
 #include "list.h"
-#include "time-util.h"
 
 struct sd_dhcp_route {
         struct in_addr dst_addr;
index 207f68a5e6e6e8dd8ca327ce4efbb8a034947a1c..24b8c12011f7325a0b47e098930af515c90580b8 100644 (file)
@@ -3,20 +3,18 @@
   Copyright Â© 2013 Intel Corporation. All rights reserved.
 ***/
 
-#include <errno.h>
 #include <linux/filter.h>
 #include <linux/if_infiniband.h>
 #include <linux/if_packet.h>
-#include <net/ethernet.h>
-#include <net/if.h>
 #include <net/if_arp.h>
 #include <stdio.h>
 #include <string.h>
 
 #include "dhcp-network.h"
 #include "dhcp-protocol.h"
+#include "ether-addr-util.h"
 #include "fd-util.h"
-#include "log.h"
+#include "socket-util.h"
 #include "unaligned.h"
 
 static int _bind_raw_socket(
index eb9dab44533a42dee873f981ef4ddde180924eae..c493cfeee502cca8302849d1b7df79b9fbd6af25 100644 (file)
@@ -1,11 +1,8 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 #pragma once
 
-#include <stdbool.h>
-#include <stdint.h>
-
-#include "ether-addr-util.h"
-#include "socket-util.h"
+#include "forward.h"
+#include "sparse-endian.h"
 
 int dhcp_network_bind_raw_socket(
                 int ifindex,
index 4945acfd563fac555cbec7dc92dc77531902d611..a840b614621574c10a24e55b4822d0173f3c9bdf 100644 (file)
@@ -3,8 +3,6 @@
   Copyright Â© 2013 Intel Corporation. All rights reserved.
 ***/
 
-#include <errno.h>
-#include <stdint.h>
 #include <stdio.h>
 
 #include "alloc-util.h"
@@ -14,6 +12,7 @@
 #include "hostname-util.h"
 #include "memory-util.h"
 #include "ordered-set.h"
+#include "string-util.h"
 #include "strv.h"
 #include "utf8.h"
 
index 289e833443f7b1804f49671993fa738062a4ee2c..c3738b87c14c1b79f0b7f4489a2bdc7d5202e695 100644 (file)
@@ -1,12 +1,10 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 #pragma once
 
-#include <stdint.h>
-
-#include "sd-dhcp-option.h"
+#include "sd-dhcp-option.h" /* IWYU pragma: export */
 
 #include "dhcp-protocol.h"
-#include "dns-resolver-internal.h"
+#include "forward.h"
 #include "hash-funcs.h"
 
 struct sd_dhcp_option {
index 6dcfe80672a34cf942335ad44be4e99c3fd9e686..46317c997cec4fe988cfd9010397182971227fde 100644 (file)
@@ -3,8 +3,6 @@
   Copyright Â© 2013 Intel Corporation. All rights reserved.
 ***/
 
-#include <errno.h>
-#include <net/ethernet.h>
 #include <net/if_arp.h>
 #include <string.h>
 
index 751321b92f654a821bf96060f7fdb3f44268257b..a7f2e12b4f1c0a417eddcddf17841643e7507a85 100644 (file)
@@ -1,10 +1,8 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 #pragma once
 
-#include <stdbool.h>
-#include <stdint.h>
-
 #include "dhcp-protocol.h"
+#include "forward.h"
 
 int dhcp_message_init(
                 DHCPMessage *message,
index b3b247a567e8b6f7db22b7078e925e5747450fec..ca872a8081572e4f3131272296d4a9c72ac5f9fa 100644 (file)
@@ -7,11 +7,10 @@
 
 #include <netinet/ip.h>
 #include <netinet/udp.h>
-#include <stdint.h>
 
 #include "sd-dhcp-protocol.h"
 
-#include "macro.h"
+#include "forward.h"
 #include "sparse-endian.h"
 #include "time-util.h"
 
index 0b2fa9652414e354caaf9f9e7acd1f255c3cc1d6..1da18cce6031e18e8ba41fd1ff44ee090139549a 100644 (file)
@@ -5,14 +5,14 @@
   Copyright Â© 2013 Intel Corporation. All rights reserved.
 ***/
 
+#include "sd-dhcp-lease.h"
 #include "sd-dhcp-server.h"
-#include "sd-event.h"
 
 #include "dhcp-client-id-internal.h"
 #include "dhcp-option.h"
+#include "forward.h"
 #include "network-common.h"
-#include "ordered-set.h"
-#include "time-util.h"
+#include "sparse-endian.h"
 
 typedef enum DHCPRawOption {
         DHCP_RAW_OPTION_DATA_UINT8,
@@ -25,7 +25,7 @@ typedef enum DHCPRawOption {
         _DHCP_RAW_OPTION_DATA_INVALID,
 } DHCPRawOption;
 
-struct sd_dhcp_server {
+typedef struct sd_dhcp_server {
         unsigned n_ref;
 
         sd_event *event;
@@ -78,7 +78,7 @@ struct sd_dhcp_server {
 
         int lease_dir_fd;
         char *lease_file;
-};
+} sd_dhcp_server;
 
 typedef struct DHCPRequest {
         /* received message */
index f206e0118f3585509d0f5a7adb0121a97fb9c2cf..4a36df6eadf5a0397b3a79d865ed6032f5c016f0 100644 (file)
@@ -2,11 +2,10 @@
 #pragma once
 
 #include "sd-dhcp-server-lease.h"
-#include "sd-json.h"
 
 #include "dhcp-client-id-internal.h"
 #include "dhcp-server-internal.h"
-#include "time-util.h"
+#include "forward.h"
 
 typedef struct sd_dhcp_server_lease {
         unsigned n_ref;
index 6c17f5749bc3ab097819c7b766a400204724eed8..1a84053735a27dc8d82735007b86c454ebead786 100644 (file)
@@ -1,6 +1,7 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 #pragma once
 
+#include "forward.h"
 #include "sd-dhcp6-client.h"
 
 int dhcp6_client_set_state_callback(
index 2ef8dc8690cae9adbcd84ce44d5b44ffd7f402b8..5762966c2644db80afaf7fdc4a4b9dbcf29bd3e4 100644 (file)
@@ -9,19 +9,13 @@
 #include <netinet/in.h>
 
 #include "sd-dhcp6-client.h"
-#include "sd-event.h"
 
 #include "dhcp-duid-internal.h"
-#include "dhcp6-client-internal.h"
 #include "dhcp6-option.h"
 #include "dhcp6-protocol.h"
-#include "ether-addr-util.h"
-#include "hashmap.h"
-#include "macro.h"
+#include "forward.h"
 #include "network-common.h"
-#include "ordered-set.h"
 #include "sparse-endian.h"
-#include "time-util.h"
 
 /* what to request from the server, addresses (IA_NA) and/or prefixes (IA_PD) */
 typedef enum DHCP6RequestIA {
index 62c3858841afa13d162e7118a00d5bae8568a794..ac7fb588eff63e856437e37ad77fa695a02eddf5 100644 (file)
@@ -5,15 +5,11 @@
   Copyright Â© 2014-2015 Intel Corporation. All rights reserved.
 ***/
 
-#include <inttypes.h>
-
 #include "sd-dhcp6-lease.h"
 
 #include "dhcp6-option.h"
 #include "dhcp6-protocol.h"
-#include "dns-resolver-internal.h"
-#include "macro.h"
-#include "set.h"
+#include "forward.h"
 #include "time-util.h"
 
 struct sd_dhcp6_lease {
index dbe425316435d5507434ec574807836316675962..b794d8858cb43c4f25d13506ccb5697995b15c62 100644 (file)
@@ -3,14 +3,9 @@
   Copyright Â© 2014 Intel Corporation. All rights reserved.
 ***/
 
-#include <errno.h>
-#include <linux/if_packet.h>
 #include <netinet/in.h>
-#include <netinet/ip6.h>
 #include <stdio.h>
 #include <string.h>
-#include <sys/types.h>
-#include <unistd.h>
 
 #include "dhcp6-internal.h"
 #include "dhcp6-protocol.h"
index 2767c6f7fcace600f0dad336e9625fec6ba8cb9d..1de4bacd1b434169ccbe59161879bcf61844c4ed 100644 (file)
@@ -3,10 +3,10 @@
   Copyright Â© 2014-2015 Intel Corporation. All rights reserved.
 ***/
 
-#include <errno.h>
 #include <netinet/in.h>
 
 #include "sd-dhcp6-client.h"
+#include "sd-dhcp6-option.h"
 
 #include "alloc-util.h"
 #include "dhcp6-internal.h"
 #include "dhcp6-protocol.h"
 #include "dns-def.h"
 #include "dns-domain.h"
-#include "errno-util.h"
 #include "escape.h"
 #include "memory-util.h"
 #include "network-common.h"
+#include "ordered-set.h"
+#include "string-util.h"
 #include "strv.h"
 #include "unaligned.h"
 
index 614b4f8a43d83890e6c9ce9ecba7005dde835787..9deee41ae41f920e7c5690610c4c35f7d7c0bd5e 100644 (file)
@@ -1,12 +1,12 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 #pragma once
 
-#include "sd-dhcp6-client.h"
+#include <netinet/in.h>
 
-#include "hash-funcs.h"
+#include "sd-dhcp6-option.h" /* IWYU pragma: export */
+
+#include "forward.h"
 #include "list.h"
-#include "macro.h"
-#include "ordered-set.h"
 #include "sparse-endian.h"
 
 typedef struct sd_dhcp6_option {
index 39f5040f9d6333d924e219aaf9c3807392e02de2..75608348cdd1276fb1213b396444aff17f2ef8a9 100644 (file)
@@ -5,11 +5,7 @@
   Copyright Â© 2014 Intel Corporation. All rights reserved.
 ***/
 
-#include <errno.h>
-#include <netinet/ip6.h>
-#include <netinet/udp.h>
-
-#include "macro.h"
+#include "forward.h"
 #include "sparse-endian.h"
 
 struct DHCP6Message {
index a02aa05bf21b1b6f2230d04f2e34c1cec96ab153..1ae775096dba85fb34157619228eb3b49007561f 100644 (file)
@@ -1,12 +1,9 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 #pragma once
 
-#include <errno.h>
-
 #include "sd-dns-resolver.h"
 
-#include "list.h"
-#include "macro.h"
+#include "forward.h"
 #include "socket-netlink.h"
 
 /* https://www.iana.org/assignments/dns-svcb/dns-svcb.xhtml#dns-svcparamkeys */
@@ -30,7 +27,7 @@ const char* format_dns_svc_param_key(uint16_t i, char buf[static DECIMAL_STR_MAX
 
 /* Represents a "designated resolver" */
 /* typedef struct sd_dns_resolver sd_dns_resolver; */
-struct sd_dns_resolver {
+typedef struct sd_dns_resolver {
         uint16_t priority;
         char *auth_name;
         int family;
@@ -39,7 +36,7 @@ struct sd_dns_resolver {
         sd_dns_alpn_flags transports;
         uint16_t port;
         char *dohpath;
-};
+} sd_dns_resolver;
 
 void siphash24_compress_resolver(const sd_dns_resolver *res, struct siphash *state);
 
index 3ed21ee175a9f69413e6812de299d3e14559c995..23471f89fcedd0ac58c20a953226bce49b76598e 100644 (file)
@@ -1,13 +1,8 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
-#include <errno.h>
 #include <sys/socket.h>
-#include <unistd.h>
 
-#include "alloc-util.h"
-#include "dhcp-lease-internal.h"
 #include "dhcp-network.h"
-#include "fs-util.h"
 #include "fuzz.h"
 #include "network-internal.h"
 #include "sd-dhcp-client.c"
index 3cfcab7e997acf38db1d4e61d31787cd346312eb..62c2d822f24c860da4ead320236cb3ee88d382dd 100644 (file)
@@ -1,8 +1,6 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
 #include <fcntl.h>
-#include <sys/stat.h>
-#include <sys/types.h>
 
 #include "fuzz.h"
 #include "sd-dhcp-server.c"
index 3f83aae34d814204ac4669b03eb383c0f2d75f27..47e3c9efa9791953858a30e4ae24ce4c946a4478 100644 (file)
@@ -1,11 +1,9 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
 #include <fcntl.h>
-#include <sys/stat.h>
-#include <sys/types.h>
+#include <net/if_arp.h>
 
 #include "fuzz.h"
-#include "path-util.h"
 #include "rm-rf.h"
 #include "sd-dhcp-server.c"
 #include "tmpfile-util.h"
index 2b6e3357e9558abe60cc4c10a2cb0324c1ebaed6..aaa95c2b9dc03165839792646ae27f52bde1f28e 100644 (file)
@@ -1,12 +1,12 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
+#include <stdlib.h>
 #include <unistd.h>
 
 #include "sd-dhcp6-client.h"
 #include "sd-event.h"
 
 #include "dhcp6-internal.h"
-#include "event-util.h"
 #include "fd-util.h"
 #include "fuzz.h"
 
index 00e6d818094fe915fa5493471fa90fe613caca69..8567e433ae1c85255db519bbb5e1c97dad50ddd5 100644 (file)
@@ -1,9 +1,10 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
-#include <errno.h>
+#include <sys/socket.h>
 #include <unistd.h>
 
 #include "sd-event.h"
+#include "sd-json.h"
 #include "sd-lldp-rx.h"
 
 #include "fd-util.h"
index e6ee76895f87fe1e321afe74ac9138dbc4df4ffe..0576821666ea00b8c5d86ec6ffa3509e11398935 100644 (file)
@@ -1,20 +1,18 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
-#include <arpa/inet.h>
-#include <netinet/icmp6.h>
 #include <unistd.h>
 
+#include "sd-event.h"
 #include "sd-ndisc.h"
 #include "sd-radv.h"
 
-#include "alloc-util.h"
 #include "fd-util.h"
 #include "fuzz.h"
 #include "icmp6-packet.h"
 #include "icmp6-test-util.h"
-#include "ndisc-internal.h"
+#include "icmp6-util.h"
 #include "ndisc-option.h"
-#include "socket-util.h"
+#include "set.h"
 
 static void test_with_sd_ndisc(const uint8_t *data, size_t size) {
         struct ether_addr mac_addr = {
index fe531ba14aa8cfeb37d57cd0facd93d483ef3ff0..b4e8e7f85147e9c82b15722688119c2b65ac7f6e 100644 (file)
@@ -6,8 +6,7 @@
 #include "icmp6-packet.h"
 #include "icmp6-util.h"
 #include "in-addr-util.h"
-#include "iovec-util.h"
-#include "network-common.h"
+#include "log.h"
 #include "socket-util.h"
 
 DEFINE_TRIVIAL_REF_UNREF_FUNC(ICMP6Packet, icmp6_packet, mfree);
index cb961ff641c2dd02a1b27cbeedf36468e403e125..3ae33a2039ad00a6d630f0e7f43eb7790b0d68b3 100644 (file)
@@ -1,11 +1,9 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 #pragma once
 
-#include <inttypes.h>
 #include <netinet/in.h>
 
-#include "macro.h"
-#include "memory-util.h"
+#include "forward.h"
 #include "time-util.h"
 
 typedef struct ICMP6Packet {
index 3c781095bc90e7bda41b5b9ba3532b308c62b797..761f6a0fb5f5cee815900e698cc53852b608f5f1 100644 (file)
@@ -1,11 +1,12 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
-#include <netinet/icmp6.h>
-#include <netinet/ip6.h>
+#include <sys/uio.h>
 #include <unistd.h>
 
 #include "fd-util.h"
 #include "icmp6-test-util.h"
+#include "icmp6-util.h"
+#include "time-util.h"
 
 int test_fd[2] = EBADF_PAIR;
 
index d7b0cc84b366666a9d803dd50a2f2a0ef45b6ed0..124cab555218a033a1b22500fcf5a30f0e5d87bd 100644 (file)
@@ -1,6 +1,4 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 #pragma once
 
-#include "icmp6-util.h"
-
 extern int test_fd[2];
index 58c473c0481758b18d926b2d12bfc145c9254f67..4347f8b723bf00739a8010d4ca1d436ef3c2a7b3 100644 (file)
@@ -3,21 +3,14 @@
   Copyright Â© 2014 Intel Corporation. All rights reserved.
 ***/
 
-#include <errno.h>
-#include <linux/if_packet.h>
-#include <net/if.h>
 #include <netinet/icmp6.h>
 #include <netinet/in.h>
-#include <netinet/ip6.h>
 #include <stdio.h>
 #include <string.h>
-#include <sys/types.h>
-#include <unistd.h>
 
 #include "fd-util.h"
 #include "icmp6-util.h"
 #include "in-addr-util.h"
-#include "iovec-util.h"
 #include "network-common.h"
 #include "socket-util.h"
 
index 9e5063f51ba4b7b4c1b17d43f9a6de666d9b67fb..a904564dfe3165ff9f4b546b3e44f80919e2dc7d 100644 (file)
@@ -5,12 +5,9 @@
   Copyright Â© 2014-2015 Intel Corporation. All rights reserved.
 ***/
 
-#include <net/ethernet.h>
 #include <netinet/in.h>
-#include <stdbool.h>
-#include <sys/uio.h>
 
-#include "time-util.h"
+#include "forward.h"
 
 #define IN6_ADDR_ALL_ROUTERS_MULTICAST                                  \
         ((const struct in6_addr) { { {                                  \
index dd2a221403fbd2c94866dd3b5ad11abf95aed0a0..e93cf566fa7a2e92720d215208d7e7062786b54f 100644 (file)
@@ -3,12 +3,16 @@
 #include "alloc-util.h"
 #include "escape.h"
 #include "ether-addr-util.h"
+#include "hashmap.h"
 #include "hexdecoct.h"
 #include "in-addr-util.h"
 #include "json-util.h"
 #include "lldp-neighbor.h"
+#include "lldp-rx-internal.h"
 #include "memory-util.h"
 #include "missing_network.h"
+#include "prioq.h"
+#include "siphash24.h"
 #include "unaligned.h"
 
 static void lldp_neighbor_id_hash_func(const LLDPNeighborID *id, struct siphash *state) {
index f7945c2edfe3b2313781b95c028f5b84d86516bf..9a2dc7d81d6ebcc7b7c86673cf4a7a40eaaf9d59 100644 (file)
@@ -1,15 +1,12 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 #pragma once
 
-#include <inttypes.h>
-#include <stdbool.h>
-#include <sys/types.h>
+#include <net/ethernet.h>
 
-#include "sd-json.h"
 #include "sd-lldp-rx.h"
 
-#include "hash-funcs.h"
-#include "lldp-rx-internal.h"
+#include "forward.h"
+#include "memory-util.h"
 #include "time-util.h"
 
 typedef struct LLDPNeighborID {
index 598669fe20ceee865e3637be2373b0c8726da9b3..38e5ddb691dcaa6482e7e34d290ccea0a2a88e33 100644 (file)
@@ -1,7 +1,6 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
 #include <linux/filter.h>
-#include <netinet/if_ether.h>
 
 #include "fd-util.h"
 #include "lldp-network.h"
index bc69b324c2c329c7601846400c871c99a79ccf6c..b2ae00fb4ac8425f48033fdb07dec62973436e28 100644 (file)
@@ -1,6 +1,4 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 #pragma once
 
-#include "sd-event.h"
-
 int lldp_network_bind_raw_socket(int ifindex);
index 33f0add399baed29a4048066b20a315c10cf39d1..9c451c183d2dfa8efd95e6dc440dceed7d4f70d0 100644 (file)
@@ -1,13 +1,12 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 #pragma once
 
-#include "sd-event.h"
-#include "sd-json.h"
-#include "sd-lldp-rx.h"
+#include <net/ethernet.h>
+
+#include "sd-lldp-rx.h" /* IWYU pragma: export */
 
-#include "hashmap.h"
 #include "network-common.h"
-#include "prioq.h"
+#include "forward.h"
 
 struct sd_lldp_rx {
         unsigned n_ref;
index 4e82fd5a86db84fd9269831412d8f3a942c9d0d7..f0488cff8d735795184b33a1ede3513b8df7b328 100644 (file)
@@ -5,8 +5,13 @@
   Copyright Â© 2014 Intel Corporation. All rights reserved.
 ***/
 
-#include "sd-ndisc.h"
+#include <net/ethernet.h>
+#include <netinet/in.h>
 
+#include "sd-event.h"
+#include "sd-ndisc.h" /* IWYU pragma: export */
+
+#include "forward.h"
 #include "network-common.h"
 #include "time-util.h"
 
@@ -14,7 +19,7 @@
 #define NDISC_MAX_ROUTER_SOLICITATION_INTERVAL (3600U * USEC_PER_SEC)
 #define NDISC_MAX_ROUTER_SOLICITATIONS 3U
 
-struct sd_ndisc {
+typedef struct sd_ndisc {
         unsigned n_ref;
 
         int ifindex;
@@ -35,7 +40,7 @@ struct sd_ndisc {
 
         sd_ndisc_callback_t callback;
         void *userdata;
-};
+} sd_ndisc;
 
 const char* ndisc_event_to_string(sd_ndisc_event_t e) _const_;
 sd_ndisc_event_t ndisc_event_from_string(const char *s) _pure_;
index aee655665e40ab6714968b08329d3b1fa6422274..295c093b4336652084b132d4d2c0c58789fc1368 100644 (file)
@@ -1,12 +1,11 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 #pragma once
 
-#include "sd-ndisc.h"
+#include <linux/in6.h>
 
-#include "icmp6-packet.h"
-#include "set.h"
+#include "forward.h"
 
-struct sd_ndisc_neighbor {
+typedef struct sd_ndisc_neighbor {
         unsigned n_ref;
 
         ICMP6Packet *packet;
@@ -15,7 +14,7 @@ struct sd_ndisc_neighbor {
         struct in6_addr target_address;
 
         Set *options;
-};
+} sd_ndisc_neighbor;
 
 sd_ndisc_neighbor* ndisc_neighbor_new(ICMP6Packet *packet);
 int ndisc_neighbor_parse(sd_ndisc *nd, sd_ndisc_neighbor *na);
index d0f95c896fdc1dfb2dc0c5608a453e1ff4ab14ce..d66f3d235eed8d3dd953fd22a2122621a532907e 100644 (file)
@@ -3,18 +3,24 @@
 #include <linux/ipv6.h>
 #include <netinet/icmp6.h>
 
+#include "sd-ndisc-protocol.h"
+
 #include "alloc-util.h"
 #include "dns-def.h"
 #include "dns-domain.h"
 #include "dns-resolver-internal.h"
 #include "ether-addr-util.h"
+#include "hash-funcs.h"
 #include "hostname-util.h"
+#include "icmp6-packet.h"
 #include "icmp6-util.h"
 #include "in-addr-util.h"
 #include "iovec-util.h"
-#include "missing_network.h"
 #include "ndisc-option.h"
 #include "network-common.h"
+#include "set.h"
+#include "siphash24.h"
+#include "string-util.h"
 #include "strv.h"
 #include "unaligned.h"
 
@@ -1664,6 +1670,14 @@ int ndisc_parse_options(ICMP6Packet *packet, Set **ret_options) {
         return 0;
 }
 
+sd_ndisc_option* ndisc_option_get(Set *options, const sd_ndisc_option *p) {
+        return set_get(options, ASSERT_PTR(p));
+}
+
+sd_ndisc_option* ndisc_option_get_by_type(Set *options, uint8_t type) {
+        return ndisc_option_get(options, &(const sd_ndisc_option) { .type = type });
+}
+
 int ndisc_option_get_mac(Set *options, uint8_t type, struct ether_addr *ret) {
         assert(IN_SET(type, SD_NDISC_OPTION_SOURCE_LL_ADDRESS, SD_NDISC_OPTION_TARGET_LL_ADDRESS));
 
@@ -1676,6 +1690,10 @@ int ndisc_option_get_mac(Set *options, uint8_t type, struct ether_addr *ret) {
         return 0;
 }
 
+void ndisc_option_remove(Set *options, const sd_ndisc_option *p) {
+        ndisc_option_free(set_remove(options, ASSERT_PTR(p)));
+}
+
 int ndisc_send(int fd, const struct in6_addr *dst, const struct icmp6_hdr *hdr, Set *options, usec_t timestamp) {
         int r;
 
index d9408be79a978876eda0ed21de79440434e5e80a..8517f68dfba7492902d11da3c916a84c48909e22 100644 (file)
@@ -1,19 +1,11 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 #pragma once
 
-#include <inttypes.h>
 #include <net/ethernet.h>
-#include <netinet/icmp6.h>
-#include <netinet/in.h>
 #include <netinet/ip6.h>
-#include <sys/uio.h>
 
 #include "sd-dns-resolver.h"
-#include "sd-ndisc-protocol.h"
 
-#include "icmp6-packet.h"
-#include "macro.h"
-#include "set.h"
 #include "time-util.h"
 
 typedef struct sd_ndisc_raw {
@@ -131,17 +123,11 @@ int ndisc_option_parse(
 
 int ndisc_parse_options(ICMP6Packet *p, Set **ret_options);
 
-static inline sd_ndisc_option* ndisc_option_get(Set *options, const sd_ndisc_option *p) {
-        return set_get(options, ASSERT_PTR(p));
-}
-static inline sd_ndisc_option* ndisc_option_get_by_type(Set *options, uint8_t type) {
-        return ndisc_option_get(options, &(const sd_ndisc_option) { .type = type });
-}
+sd_ndisc_option* ndisc_option_get(Set *options, const sd_ndisc_option *p);
+sd_ndisc_option* ndisc_option_get_by_type(Set *options, uint8_t type);
 int ndisc_option_get_mac(Set *options, uint8_t type, struct ether_addr *ret);
 
-static inline void ndisc_option_remove(Set *options, const sd_ndisc_option *p) {
-        ndisc_option_free(set_remove(options, ASSERT_PTR(p)));
-}
+void ndisc_option_remove(Set *options, const sd_ndisc_option *p);
 static inline void ndisc_option_remove_by_type(Set *options, uint8_t type) {
         ndisc_option_remove(options, &(const sd_ndisc_option) { .type = type });
 }
index e35263a05dd01a509c50a5c1d1a60c839dd4c756..77d6f8b88f2eb583896207981df2358b804ad169 100644 (file)
@@ -1,12 +1,11 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 #pragma once
 
-#include "sd-ndisc.h"
+#include <linux/in6.h>
 
-#include "icmp6-packet.h"
-#include "set.h"
+#include "forward.h"
 
-struct sd_ndisc_redirect {
+typedef struct sd_ndisc_redirect {
         unsigned n_ref;
 
         ICMP6Packet *packet;
@@ -15,7 +14,7 @@ struct sd_ndisc_redirect {
         struct in6_addr destination_address;
 
         Set *options;
-};
+} sd_ndisc_redirect;
 
 sd_ndisc_redirect* ndisc_redirect_new(ICMP6Packet *packet);
 int ndisc_redirect_parse(sd_ndisc *nd, sd_ndisc_redirect *rd);
index 6df72fd3cce6e5ab96a8301f35316daed3c2c64f..025cc146a42c984f2c478b35508928f63c9d0c19 100644 (file)
@@ -8,10 +8,10 @@
 #include "sd-ndisc.h"
 
 #include "icmp6-packet.h"
+#include "iterator.h"
 #include "ndisc-option.h"
-#include "time-util.h"
 
-struct sd_ndisc_router {
+typedef struct sd_ndisc_router {
         unsigned n_ref;
 
         ICMP6Packet *packet;
@@ -28,7 +28,7 @@ struct sd_ndisc_router {
         Set *options;
         Iterator iterator;
         sd_ndisc_option *current_option;
-};
+} sd_ndisc_router;
 
 sd_ndisc_router* ndisc_router_new(ICMP6Packet *packet);
 int ndisc_router_parse(sd_ndisc *nd, sd_ndisc_router *rt);
index 6f0b0af13aaab74bfb2ba8a41ea8e7fd884812a3..2186238a6fd5c79f450a8298e506045c4d040a0f 100644 (file)
@@ -1,18 +1,15 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 #pragma once
 
-#include "sd-radv.h"
+#include "forward.h"
 
-#include "icmp6-packet.h"
-#include "set.h"
-
-struct sd_ndisc_router_solicit {
+typedef struct sd_ndisc_router_solicit {
         unsigned n_ref;
 
         ICMP6Packet *packet;
 
         Set *options;
-};
+} sd_ndisc_router_solicit;
 
 sd_ndisc_router_solicit* ndisc_router_solicit_new(ICMP6Packet *packet);
 int ndisc_router_solicit_parse(sd_radv *ra, sd_ndisc_router_solicit *rs);
index 1750f1810bdac7e6d3a23e8d0dbcb3a9e91c598e..933ce170b7e9ca4a8b03a4dac0db8f4eaa932cd5 100644 (file)
@@ -1,8 +1,7 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 #pragma once
 
-#include <sys/socket.h>
-
+#include "forward.h"
 #include "log-link.h"
 #include "sparse-endian.h"
 #include "time-util.h"
index 1563655b794d9e9c33e398768faad81c40aa177d..e7c22c9b76e051f743c63e2c3a9169dff07626bf 100644 (file)
@@ -1,19 +1,17 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
 #include <arpa/inet.h>
-#include <linux/if.h>
-#include <netinet/ether.h>
-
-#include "sd-ndisc.h"
+#include <stdio.h>
 
 #include "alloc-util.h"
 #include "dhcp-lease-internal.h"
+#include "dns-resolver-internal.h"
 #include "extract-word.h"
 #include "hexdecoct.h"
 #include "in-addr-util.h"
-#include "log.h"
 #include "network-internal.h"
 #include "parse-util.h"
+#include "string-util.h"
 #include "strv.h"
 
 size_t serialize_in_addrs(FILE *f,
index 6a102e92c47e1ad16aaa7e6a7e656cbf998d7c0c..aace983d5bee6cce7ec4251a35a9d8ff50deaff7 100644 (file)
@@ -1,10 +1,7 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 #pragma once
 
-#include <stdbool.h>
-#include <stdio.h>
-
-#include "sd-dhcp-lease.h"
+#include "forward.h"
 
 size_t serialize_in_addrs(FILE *f,
                           const struct in_addr *addresses,
index 5ed7784a850171c6127e811ed882e5e4e76a4582..0e34176e8c066946d3ecd3db45c8f0e4eb4c681f 100644 (file)
@@ -5,14 +5,10 @@
   Copyright Â© 2017 Intel Corporation. All rights reserved.
 ***/
 
-#include <netinet/icmp6.h>
+#include <netinet/in.h>
 
-#include "sd-radv.h"
-
-#include "list.h"
-#include "ndisc-option.h"
+#include "forward.h"
 #include "network-common.h"
-#include "sparse-endian.h"
 #include "time-util.h"
 
 /* RFC 4861 section 6.2.1.
index d1280fb6192a7d8eed015418f0031b45d53d1010..77614718d71e3c50cf6c0e804fe6c897e8ce39fc 100644 (file)
@@ -5,6 +5,8 @@
 #include "iovec-util.h"
 #include "json-util.h"
 #include "log.h"
+#include "siphash24.h"
+#include "string-util.h"
 #include "unaligned.h"
 #include "utf8.h"
 
index 56e97475289ffe4a05372632f2076b5d09d09f02..2cb60b92ce937a31ac982fdb8710b84df71aa37a 100644 (file)
@@ -3,13 +3,9 @@
   Copyright Â© 2013 Intel Corporation. All rights reserved.
 ***/
 
-#include <errno.h>
 #include <linux/if_infiniband.h>
-#include <net/ethernet.h>
 #include <net/if_arp.h>
 #include <stdio.h>
-#include <stdlib.h>
-#include <sys/ioctl.h>
 
 #include "sd-dhcp-client.h"
 
@@ -22,6 +18,7 @@
 #include "dhcp-option.h"
 #include "dhcp-packet.h"
 #include "dns-domain.h"
+#include "errno-util.h"
 #include "ether-addr-util.h"
 #include "event-util.h"
 #include "fd-util.h"
 #include "network-common.h"
 #include "random-util.h"
 #include "set.h"
+#include "socket-util.h"
 #include "sort-util.h"
 #include "string-table.h"
 #include "string-util.h"
 #include "strv.h"
 #include "time-util.h"
-#include "utf8.h"
 #include "web-util.h"
 
 #define MAX_MAC_ADDR_LEN CONST_MAX(INFINIBAND_ALEN, ETH_ALEN)
index 4782ec62d7af28d02f25041aaaa688fbd716ee41..b0caa10976fbe144afcd40477504234a91243caa 100644 (file)
@@ -1,15 +1,17 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
 #include <linux/if_infiniband.h>
-#include <net/ethernet.h>
 #include <net/if_arp.h>
+#include <stdio.h>
 
+#include "alloc-util.h"
 #include "dhcp-duid-internal.h"
 #include "hexdecoct.h"
 #include "netif-util.h"
 #include "network-common.h"
 #include "siphash24.h"
 #include "string-table.h"
+#include "string-util.h"
 #include "unaligned.h"
 
 #define HASH_KEY       SD_ID128_MAKE(80,11,8c,c2,fe,4a,03,ee,3e,d6,0c,6f,36,39,14,09)
index 2eb9bf25eef29421cfc5114c00ca7b727215bb2a..a98ec7fc63b0f0d1b3cba0f6581ec2d8b67d6b86 100644 (file)
@@ -4,11 +4,7 @@
 ***/
 
 #include <arpa/inet.h>
-#include <errno.h>
-#include <stdlib.h>
 #include <sys/stat.h>
-#include <sys/types.h>
-#include <unistd.h>
 
 #include "sd-dhcp-lease.h"
 
index d9ea5304e85a1c5abe1a9d5f0377303e22d41a1a..35a1e7bb185a1263be36b70f2eff3a2489a6ad4d 100644 (file)
@@ -1,14 +1,20 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
+#include <sys/stat.h>
+
+#include "sd-event.h"
+
 #include "alloc-util.h"
 #include "dhcp-server-lease-internal.h"
-#include "dns-def.h"
 #include "errno-util.h"
 #include "fd-util.h"
 #include "fs-util.h"
+#include "hashmap.h"
+#include "in-addr-util.h"
 #include "iovec-util.h"
 #include "json-util.h"
 #include "mkdir.h"
+#include "string-util.h"
 #include "tmpfile-util.h"
 
 static sd_dhcp_server_lease* dhcp_server_lease_free(sd_dhcp_server_lease *lease) {
index 88c51d5458a95b7cc9eda89e5bd4be3cf46d48bc..af87b1523863fbe25f06c15dd3b715eadc27b250 100644 (file)
@@ -3,10 +3,8 @@
   Copyright Â© 2013 Intel Corporation. All rights reserved.
 ***/
 
-#include <net/if_arp.h>
-#include <sys/ioctl.h>
-
 #include "sd-dhcp-server.h"
+#include "sd-event.h"
 #include "sd-id128.h"
 
 #include "alloc-util.h"
@@ -16,6 +14,7 @@
 #include "dhcp-server-internal.h"
 #include "dhcp-server-lease-internal.h"
 #include "dns-domain.h"
+#include "errno-util.h"
 #include "fd-util.h"
 #include "in-addr-util.h"
 #include "iovec-util.h"
@@ -24,9 +23,9 @@
 #include "ordered-set.h"
 #include "path-util.h"
 #include "siphash24.h"
+#include "socket-util.h"
 #include "string-util.h"
 #include "unaligned.h"
-#include "utf8.h"
 
 #define DHCP_DEFAULT_LEASE_TIME_USEC USEC_PER_HOUR
 #define DHCP_MAX_LEASE_TIME_USEC (USEC_PER_HOUR*12)
index b806a7debb09acdce2cb3aa120a99d139386c0f8..36585c8554336855e0591f09ddcc28226967fedb 100644 (file)
@@ -3,27 +3,30 @@
   Copyright Â© 2014-2015 Intel Corporation. All rights reserved.
 ***/
 
-#include <errno.h>
 #include <linux/if_arp.h>
 #include <linux/if_infiniband.h>
-#include <sys/ioctl.h>
 
 #include "sd-dhcp6-client.h"
+#include "sd-dhcp6-option.h"
 
 #include "alloc-util.h"
 #include "device-util.h"
 #include "dhcp-duid-internal.h"
+#include "dhcp6-client-internal.h"
 #include "dhcp6-internal.h"
 #include "dhcp6-lease-internal.h"
 #include "dns-domain.h"
+#include "errno-util.h"
 #include "event-util.h"
 #include "fd-util.h"
 #include "hostname-util.h"
 #include "in-addr-util.h"
 #include "iovec-util.h"
+#include "ordered-set.h"
 #include "random-util.h"
 #include "socket-util.h"
 #include "sort-util.h"
+#include "string-util.h"
 #include "strv.h"
 #include "web-util.h"
 
index 2ff1e87a2e461ca2b3dfdeb671c3b60df8a255d4..4d8df252c87d6d315a2f6859f7c08b61c2b8d089 100644 (file)
@@ -3,14 +3,17 @@
   Copyright Â© 2014-2015 Intel Corporation. All rights reserved.
 ***/
 
-#include <errno.h>
+#include "sd-dhcp6-option.h"
 
 #include "alloc-util.h"
 #include "dhcp6-internal.h"
 #include "dhcp6-lease-internal.h"
 #include "dns-domain.h"
+#include "dns-resolver-internal.h"
 #include "network-common.h"
+#include "set.h"
 #include "sort-util.h"
+#include "string-util.h"
 #include "strv.h"
 #include "unaligned.h"
 
index 673208106c71fe32b0097c4d691cffd4c9cfe445..e7f69da202ba7f5cd0ee6fdc1615d867a9db7f65 100644 (file)
@@ -3,8 +3,7 @@
 #include "alloc-util.h"
 #include "dns-resolver-internal.h"
 #include "errno-util.h"
-#include "log.h"
-#include "macro.h"
+#include "siphash24.h"
 #include "socket-netlink.h"
 #include "stdio-util.h"
 #include "string-table.h"
index 5acd4fe4f684cca88503b118061bfde89768ed99..8a574263ccb4b390279e6879377dba264709cd9b 100644 (file)
@@ -1,13 +1,10 @@
 #ifndef SD_DNS_RESOLVER_H
 #define SD_DNS_RESOLVER_H
 
-#include <errno.h>
-#include <netinet/in.h>
-#include <stddef.h>
-#include <stdint.h>
-
 #include "_sd-common.h"
 
+#include "forward.h"
+
 _SD_BEGIN_DECLARATIONS;
 
 typedef struct sd_dns_resolver sd_dns_resolver;
index 17db4a53f71fa7b8f1d046ae7fcc7456d4b66cbc..87bf46ad296246d77aac1ff8468495a1c4d82450 100644 (file)
@@ -3,16 +3,14 @@
   Copyright Â© 2014 Axis Communications AB. All rights reserved.
 ***/
 
-#include <arpa/inet.h>
-#include <errno.h>
 #include <netinet/if_ether.h>
 #include <stdio.h>
-#include <stdlib.h>
 
 #include "sd-ipv4acd.h"
 
 #include "alloc-util.h"
 #include "arp-util.h"
+#include "errno-util.h"
 #include "ether-addr-util.h"
 #include "event-util.h"
 #include "fd-util.h"
@@ -20,7 +18,7 @@
 #include "memory-util.h"
 #include "network-common.h"
 #include "random-util.h"
-#include "siphash24.h"
+#include "socket-util.h"
 #include "string-table.h"
 #include "string-util.h"
 #include "time-util.h"
index 557c145509c39b019afbc44037500d02786cd11f..b679d206e6f00e67c1e0f6ce30e067ba24c401ef 100644 (file)
@@ -3,11 +3,6 @@
   Copyright Â© 2014 Axis Communications AB. All rights reserved.
 ***/
 
-#include <arpa/inet.h>
-#include <errno.h>
-#include <stdio.h>
-#include <stdlib.h>
-
 #include "sd-id128.h"
 #include "sd-ipv4acd.h"
 #include "sd-ipv4ll.h"
 #include "ether-addr-util.h"
 #include "in-addr-util.h"
 #include "network-common.h"
-#include "random-util.h"
 #include "siphash24.h"
 #include "sparse-endian.h"
-#include "string-util.h"
 
 #define IPV4LL_NETWORK UINT32_C(0xA9FE0000)
 #define IPV4LL_NETMASK UINT32_C(0xFFFF0000)
index 029ee0282cf4c76c6c207f8f9c1f3a883c3461e4..288ed2ee96919247b891a4a8d19812b54de8c0fd 100644 (file)
@@ -1,6 +1,5 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
-#include <arpa/inet.h>
 #include <linux/sockios.h>
 #include <sys/ioctl.h>
 
@@ -8,17 +7,21 @@
 #include "sd-lldp-rx.h"
 
 #include "alloc-util.h"
+#include "errno-util.h"
 #include "ether-addr-util.h"
 #include "event-util.h"
 #include "fd-util.h"
+#include "hashmap.h"
 #include "lldp-neighbor.h"
 #include "lldp-network.h"
 #include "lldp-rx-internal.h"
 #include "memory-util.h"
 #include "network-common.h"
+#include "prioq.h"
 #include "socket-util.h"
 #include "sort-util.h"
 #include "string-table.h"
+#include "string-util.h"
 
 #define LLDP_DEFAULT_NEIGHBORS_MAX 128U
 
index 38a619168ee43e38934598fe5a598215c26bfecc..9e93a77cd1da1d32b5d7f9102863d9aa6b139dfc 100644 (file)
@@ -1,9 +1,5 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
-#include <arpa/inet.h>
-#include <linux/sockios.h>
-#include <sys/ioctl.h>
-
 #include "sd-event.h"
 #include "sd-id128.h"
 #include "sd-lldp-tx.h"
index 1bb6ebf610b6e2d2adac1c4c2d42a5f4ff1c5dfe..5ce1da06da3651d4a761643968e3ffc38d8a3a5b 100644 (file)
@@ -5,10 +5,12 @@
 #include "sd-ndisc.h"
 
 #include "alloc-util.h"
+#include "icmp6-packet.h"
 #include "in-addr-util.h"
 #include "ndisc-internal.h"
 #include "ndisc-neighbor-internal.h"
 #include "ndisc-option.h"
+#include "set.h"
 
 static sd_ndisc_neighbor* ndisc_neighbor_free(sd_ndisc_neighbor *na) {
         if (!na)
index a1fceb2dff3f4d542218b8157f4c1a33c007946d..1637ad36a22408f8481212c0e33e044bee4a6caf 100644 (file)
@@ -5,10 +5,12 @@
 #include "sd-ndisc.h"
 
 #include "alloc-util.h"
+#include "icmp6-packet.h"
 #include "in-addr-util.h"
 #include "ndisc-internal.h"
 #include "ndisc-option.h"
 #include "ndisc-redirect-internal.h"
+#include "set.h"
 
 static sd_ndisc_redirect* ndisc_redirect_free(sd_ndisc_redirect *rd) {
         if (!rd)
index 742ec9a1d2a9988a72a993f7ecfab160285b1bf8..ccd14be3cb97b5978f8d0821e4dd6e4cde3e7e8b 100644 (file)
@@ -2,13 +2,16 @@
 
 #include <netinet/icmp6.h>
 
+#include "sd-ndisc-protocol.h"
+#include "sd-ndisc-router-solicit.h"
 #include "sd-radv.h"
 
 #include "alloc-util.h"
-#include "in-addr-util.h"
+#include "icmp6-packet.h"
 #include "ndisc-option.h"
 #include "ndisc-router-solicit-internal.h"
 #include "radv-internal.h"
+#include "set.h"
 
 static sd_ndisc_router_solicit* ndisc_router_solicit_free(sd_ndisc_router_solicit *rs) {
         if (!rs)
index 6936ea34e24c69d19049cdbbab787ad797c8252b..69fab9f6d0ba937872d7cfc3aa52742c3155a3c7 100644 (file)
@@ -8,12 +8,11 @@
 #include "sd-ndisc.h"
 
 #include "alloc-util.h"
-#include "dns-domain.h"
-#include "dns-resolver-internal.h"
 #include "ndisc-internal.h"
 #include "ndisc-router-internal.h"
+#include "set.h"
 #include "string-table.h"
-#include "unaligned.h"
+#include "string-util.h"
 
 static sd_ndisc_router* ndisc_router_free(sd_ndisc_router *rt) {
         if (!rt)
index ca15f942f5615c2f459f2317e45e93fa37933e04..0f2f94eab60d22bf11f705dcd3b95c19f2b76152 100644 (file)
@@ -21,6 +21,7 @@
 #include "ndisc-router-internal.h"
 #include "network-common.h"
 #include "random-util.h"
+#include "set.h"
 #include "socket-util.h"
 #include "string-table.h"
 #include "string-util.h"
index 48a198099dccc639affe319a1e6138b6f110e699..02d6131e8a4931b1cb0cd08a004de658fc30da8c 100644 (file)
@@ -3,31 +3,29 @@
   Copyright Â© 2017 Intel Corporation. All rights reserved.
 ***/
 
-#include <arpa/inet.h>
 #include <linux/ipv6.h>
 #include <netinet/icmp6.h>
 #include <netinet/in.h>
 
+#include "sd-ndisc-protocol.h"
+#include "sd-ndisc-router-solicit.h"
 #include "sd-radv.h"
 
 #include "alloc-util.h"
-#include "dns-domain.h"
-#include "ether-addr-util.h"
 #include "event-util.h"
 #include "fd-util.h"
+#include "icmp6-packet.h"
 #include "icmp6-util.h"
 #include "in-addr-util.h"
-#include "iovec-util.h"
-#include "macro.h"
 #include "memory-util.h"
+#include "ndisc-option.h"
 #include "ndisc-router-solicit-internal.h"
 #include "network-common.h"
 #include "radv-internal.h"
 #include "random-util.h"
+#include "set.h"
 #include "socket-util.h"
 #include "string-util.h"
-#include "strv.h"
-#include "unaligned.h"
 
 int sd_radv_new(sd_radv **ret) {
         _cleanup_(sd_radv_unrefp) sd_radv *ra = NULL;
index c00e87605abac0e99a61a1cfa86191b23d1a0da8..e85a9d267a0d5d2f5a7b1ffd058d1f578272cceb 100644 (file)
@@ -1,10 +1,6 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
-#include <errno.h>
-#include <linux/veth.h>
-#include <net/if.h>
-#include <stdlib.h>
-#include <unistd.h>
+#include <net/ethernet.h>
 
 #include "sd-event.h"
 #include "sd-ipv4acd.h"
index fe2a88d8f3cd89e617f351a8b453756fbfd15216..72d8ad4d0cf04bbc860f88604d98677beda9d5a4 100644 (file)
@@ -3,10 +3,9 @@
   Copyright Â© 2013 Intel Corporation. All rights reserved.
 ***/
 
-#include <errno.h>
-#include <net/if.h>
 #include <net/if_arp.h>
 #include <stdio.h>
+#include <stdlib.h>
 #include <sys/socket.h>
 #include <unistd.h>
 #if HAVE_VALGRIND_VALGRIND_H
@@ -14,6 +13,7 @@
 #endif
 
 #include "sd-dhcp-client.h"
+#include "sd-dhcp-lease.h"
 #include "sd-event.h"
 
 #include "alloc-util.h"
@@ -24,7 +24,6 @@
 #include "ether-addr-util.h"
 #include "fd-util.h"
 #include "log.h"
-#include "random-util.h"
 #include "tests.h"
 
 static struct hw_addr_data hw_addr = {
index 2a07256ea0363fe204813fc873d6f59911a59e9f..9e36e0385994e222a07f97172ee59cb7683df367 100644 (file)
@@ -1,17 +1,12 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
-#include <errno.h>
 #include <net/if_arp.h>
-#include <stdbool.h>
 #include <stdio.h>
 #include <string.h>
 
 #include "alloc-util.h"
 #include "dhcp-option.h"
 #include "dhcp-packet.h"
-#include "ether-addr-util.h"
-#include "log.h"
-#include "macro.h"
 #include "memory-util.h"
 #include "tests.h"
 
index a067fc0da59244f20e1a64db22e46bd15de0054a..61189fe5452ec96ae02d2b4316e901b8ceeabfb2 100644 (file)
@@ -3,13 +3,14 @@
   Copyright Â© 2013 Intel Corporation. All rights reserved.
 ***/
 
-#include <errno.h>
 #include <net/if_arp.h>
 
 #include "sd-dhcp-server.h"
 #include "sd-event.h"
 
 #include "dhcp-server-internal.h"
+#include "hashmap.h"
+#include "siphash24.h"
 #include "tests.h"
 
 static void test_pool(struct in_addr *address, unsigned size, int ret) {
index 195aa145949bee97576ed28572c39c9a62ec3195..0775209e021c59822880e7c060db4c952969e7dd 100644 (file)
@@ -5,23 +5,20 @@
 
 #include <net/ethernet.h>
 #include <net/if_arp.h>
-#include <stdbool.h>
 #include <stdio.h>
-#include <sys/types.h>
+#include <stdlib.h>
 #include <unistd.h>
 
 #include "sd-dhcp6-client.h"
+#include "sd-dhcp6-protocol.h"
 #include "sd-event.h"
 
-#include "dhcp-duid-internal.h"
 #include "dhcp6-internal.h"
 #include "dhcp6-lease-internal.h"
 #include "dhcp6-protocol.h"
 #include "fd-util.h"
-#include "macro.h"
+#include "in-addr-util.h"
 #include "memory-util.h"
-#include "socket-util.h"
-#include "string-util.h"
 #include "strv.h"
 #include "tests.h"
 #include "time-util.h"
index 1fc6d11b88fc929fbc52a41144d422f0f9cbe90d..97f540870204275119b1dcc9903c66e296c86096 100644 (file)
@@ -1,16 +1,11 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
-#include <errno.h>
-#include <linux/veth.h>
-#include <net/if.h>
-#include <stdlib.h>
-#include <unistd.h>
+#include <net/ethernet.h>
 
 #include "sd-event.h"
 #include "sd-ipv4ll.h"
 #include "sd-netlink.h"
 
-#include "alloc-util.h"
 #include "in-addr-util.h"
 #include "log.h"
 #include "parse-util.h"
index 17c981307b6ca015dc8493050179c2b217df7be5..a26000d5f19a2f1e53185d8e8c79e320477f83d6 100644 (file)
@@ -3,19 +3,15 @@
   Copyright Â© 2014 Axis Communications AB. All rights reserved.
 ***/
 
-#include <errno.h>
 #include <netinet/if_ether.h>
 #include <stdio.h>
-#include <stdlib.h>
-#include <sys/types.h>
-#include <unistd.h>
 
+#include "sd-event.h"
 #include "sd-ipv4ll.h"
 
 #include "arp-util.h"
 #include "fd-util.h"
-#include "log.h"
-#include "socket-util.h"
+#include "in-addr-util.h"
 #include "tests.h"
 
 static bool verbose = false;
index 704c9a001539d0e9ba9687ebfb2b8790f1566b25..7f497a4de43c22893252b8a4f57634c5996cd733 100644 (file)
@@ -1,20 +1,15 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
-#include <arpa/inet.h>
-#include <errno.h>
-#include <net/ethernet.h>
+#include <linux/if_ether.h>
 #include <stdio.h>
+#include <sys/socket.h>
 #include <unistd.h>
 
 #include "sd-event.h"
 #include "sd-lldp-rx.h"
 
-#include "alloc-util.h"
 #include "fd-util.h"
 #include "lldp-network.h"
-#include "log.h"
-#include "macro.h"
-#include "string-util.h"
 #include "tests.h"
 
 #define TEST_LLDP_PORT "em1"
index cc7007f15a286f4f41bdaa364a33aec9e34d1d1c..84dc73e84fa5f7bd6c83db6686a288dfaeaf549b 100644 (file)
@@ -3,18 +3,19 @@
   Copyright Â© 2017 Intel Corporation. All rights reserved.
 ***/
 
-#include <arpa/inet.h>
+#include <net/ethernet.h>
 #include <netinet/icmp6.h>
 #include <unistd.h>
 
+#include "sd-event.h"
+#include "sd-ndisc-protocol.h"
 #include "sd-radv.h"
 
 #include "alloc-util.h"
-#include "hexdecoct.h"
 #include "icmp6-test-util.h"
+#include "in-addr-util.h"
 #include "radv-internal.h"
 #include "socket-util.h"
-#include "strv.h"
 #include "tests.h"
 
 static struct ether_addr mac_addr = {
index effed116154769d0312301056f36a0444b00799b..71af4c24788c614d5485f179f8ac569f06a13494 100644 (file)
@@ -3,7 +3,6 @@
   Copyright Â© 2014 Intel Corporation. All rights reserved.
 ***/
 
-#include <arpa/inet.h>
 #include <netinet/icmp6.h>
 #include <unistd.h>
 
@@ -14,8 +13,8 @@
 #include "hexdecoct.h"
 #include "icmp6-packet.h"
 #include "icmp6-test-util.h"
+#include "in-addr-util.h"
 #include "ndisc-internal.h"
-#include "socket-util.h"
 #include "strv.h"
 #include "tests.h"
 
index 52bd9fa637e3ce35da7a344563a9aa1adb91d39a..2b40ea77a3c65457ed853e588c7e365e031386c7 100644 (file)
@@ -1,6 +1,10 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
 #include <getopt.h>
+#include <netinet/icmp6.h>
+
+#include "sd-ndisc-protocol.h"
+#include "sd-netlink.h"
 
 #include "alloc-util.h"
 #include "build.h"
@@ -14,7 +18,8 @@
 #include "netlink-util.h"
 #include "network-common.h"
 #include "parse-util.h"
-#include "socket-util.h"
+#include "set.h"
+#include "string-util.h"
 #include "strv.h"
 #include "time-util.h"
 
index 5bb0b39180eaee90c24ad29698af43ab724299cc..32f9a6b9a34655cfe681b683fac32bdc375da9cd 100644 (file)
@@ -1,11 +1,6 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
-#include <errno.h>
-
 #include "dhcp-lease-internal.h"
-#include "log.h"
-#include "macro.h"
-#include "string-util.h"
 #include "strv.h"
 #include "tests.h"
 
index 1075c29ed64e9f76a2eeeb7be5634e89ef3b8512..812e75a302317956c43d47249969f4b15e78a9d3 100644 (file)
@@ -1,7 +1,5 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
-#include <errno.h>
-
 #include "sd-bus.h"
 
 #include "bus-common-errors.h"
index 54da4169a67687a9a5143844bf7d0220c5ae007c..73e86bb78c878ee12d08a374a29751743bc5c48c 100644 (file)
@@ -7,6 +7,7 @@
 #include "bus-internal.h"
 #include "bus-socket.h"
 #include "fd-util.h"
+#include "format-util.h"
 #include "log.h"
 #include "namespace-util.h"
 #include "process-util.h"
index cb503a597055d7270f620466784a17bc439bad52..bca37304c0178e475fe34f43b61290d98cdbfe3e 100644 (file)
@@ -1,6 +1,6 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 #pragma once
 
-#include "sd-bus.h"
+#include "forward.h"
 
 int bus_container_connect_socket(sd_bus *b);
index fdcd5ff2da62ec3b600182b77e53cded33e05a03..daa700ebf509e222a216c2d25c9c9345c730a4e1 100644 (file)
@@ -1,23 +1,15 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
-#if HAVE_VALGRIND_MEMCHECK_H
-#include <valgrind/memcheck.h>
-#endif
-
-#include <errno.h>
-#include <stddef.h>
-
 #include "sd-bus.h"
 
 #include "alloc-util.h"
 #include "bus-control.h"
 #include "bus-internal.h"
 #include "bus-message.h"
-#include "capability-util.h"
 #include "fd-util.h"
 #include "log.h"
+#include "pidref.h"
 #include "process-util.h"
-#include "stdio-util.h"
 #include "string-util.h"
 #include "strv.h"
 #include "user-util.h"
index 1cd4fb88d96d3622e446642f00228bd6ac654dd0..56b4a70cdaa3bf9ebea16d80b92e5d2340882e6d 100644 (file)
@@ -1,7 +1,7 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 #pragma once
 
-#include "sd-bus.h"
+#include "forward.h"
 
 int bus_add_match_internal(sd_bus *bus, const char *match, uint64_t timeout_usec, uint64_t *ret_counter);
 int bus_add_match_internal_async(sd_bus *bus, sd_bus_slot **ret, const char *match, sd_bus_message_handler_t callback, void *userdata, uint64_t timeout_usec);
index b59338a5d1471d9394cbd961370ae4d558838341..034ee49f00fc2f8c78442836236f32ba0e9cb564 100644 (file)
@@ -1,14 +1,13 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
-#include <sys/types.h>
 #include <unistd.h>
 
-#include "alloc-util.h"
+#include "sd-bus.h"
+
 #include "bus-internal.h"
 #include "bus-message.h"
 #include "bus-signature.h"
 #include "bus-type.h"
-#include "log.h"
 #include "string-util.h"
 
 _public_ int sd_bus_message_send(sd_bus_message *reply) {
index 9e93712bfd68263e85499a35bebbe4f5ea8b8cb4..700e7d24a9e5b59413bb74faefc778c5ed05b123 100644 (file)
@@ -1,7 +1,8 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
 #include <linux/capability.h>
-#include <stdlib.h>
+
+#include "sd-bus.h"
 
 #include "alloc-util.h"
 #include "audit-util.h"
@@ -17,6 +18,7 @@
 #include "hexdecoct.h"
 #include "nulstr-util.h"
 #include "parse-util.h"
+#include "pidref.h"
 #include "process-util.h"
 #include "string-util.h"
 #include "strv.h"
index d7ad1dc96b3bbeb108dc8f4d9a1527df025fed3f..089442e88571119fab102a6ada651b147d690ebe 100644 (file)
@@ -1,14 +1,9 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 #pragma once
 
-#include <stdbool.h>
+#include "forward.h"
 
-#include "sd-bus.h"
-
-#include "pidref.h"
-#include "user-util.h"
-
-struct sd_bus_creds {
+typedef struct sd_bus_creds {
         bool allocated;
         unsigned n_ref;
 
@@ -65,7 +60,7 @@ struct sd_bus_creds {
         char *cgroup_root;
 
         char *description, *unescaped_description;
-};
+} sd_bus_creds;
 
 #define SD_BUS_CREDS_INIT_FIELDS        \
         .uid = UID_INVALID,             \
index d753f50a0cda73a08da5ace99f3a7243006336b3..b6fc5f598f7e0fcd8cb357b098695f292a2f1410 100644 (file)
@@ -6,8 +6,7 @@
 #include "bus-internal.h"
 #include "bus-message.h"
 #include "json-util.h"
-#include "macro.h"
-#include "memory-util.h"
+#include "string-util.h"
 #include "time-util.h"
 
 static int json_transform_one(sd_bus_message *m, sd_json_variant **ret);
index 07df7d7d34ca41f5a84285ab33b26da21e24a472..d71274968c3087626cd916de4a70ef7b67962509 100644 (file)
@@ -1,6 +1,6 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
-#include <sys/time.h>
+#include "sd-bus.h"
 
 #include "alloc-util.h"
 #include "ansi-color.h"
 #include "format-util.h"
 #include "glyph-util.h"
 #include "log.h"
-#include "macro.h"
 #include "pcapng.h"
 #include "string-util.h"
 #include "strv.h"
-#include "terminal-util.h"
+#include "time-util.h"
 
 static char* indent(unsigned level, uint64_t flags) {
         if (FLAGS_SET(flags, SD_BUS_MESSAGE_DUMP_SUBTREE_ONLY) && level > 0)
index e7470ba6817ea5c10e472e0e34291a31f3f65946..ba38da168610d07eb11bd8e07cb4de3917b9603e 100644 (file)
@@ -1,10 +1,7 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 #pragma once
 
-#include <stdbool.h>
-#include <stdio.h>
-
-#include "sd-bus.h"
+#include "forward.h"
 
 int bus_creds_dump(sd_bus_creds *c, FILE *f, bool terse);
 
index 9b812dd36c1814dc581b8a0ce4ac14d250132471..b61df06632d380028ff845a954917133720a17e7 100644 (file)
@@ -1,20 +1,12 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
-#include <errno.h>
-#include <stdarg.h>
-#include <stdbool.h>
-#include <stdio.h>
-#include <stdlib.h>
-
 #include "sd-bus.h"
 
 #include "alloc-util.h"
 #include "bus-error.h"
 #include "errno-list.h"
 #include "errno-util.h"
-#include "log.h"
 #include "string-util.h"
-#include "strv.h"
 
 BUS_ERROR_MAP_ELF_REGISTER const sd_bus_error_map bus_standard_errors[] = {
         SD_BUS_ERROR_MAP(SD_BUS_ERROR_FAILED,                             EACCES),
@@ -592,7 +584,7 @@ const char* _bus_error_message(const sd_bus_error *e, int error, char buf[static
         if (e && e->message)
                 return e->message;
 
-        return strerror_r(abs(error), buf, ERRNO_BUF_LEN);
+        return strerror_r(ABS(error), buf, ERRNO_BUF_LEN);
 }
 
 static bool map_ok(const sd_bus_error_map *map) {
index c8768c9a7b61278a78c6762352798e004b0810cb..3757fe7c279e3f25f72b89409d4f059f4f1b9d29 100644 (file)
@@ -1,12 +1,10 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 #pragma once
 
-#include <stdbool.h>
-
-#include "sd-bus.h"
+#include "sd-bus-protocol.h"
 
 #include "errno-util.h"
-#include "macro.h"
+#include "forward.h"
 
 bool bus_error_is_dirty(sd_bus_error *e);
 
index 6a448c797fee7ad84870d3a96d7dee569ca70c0d..ffb99bd824803eb3dbf19951cc9523d38111926c 100644 (file)
@@ -1,6 +1,9 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
+#include "sd-bus.h"
+
 #include "alloc-util.h"
+#include "bus-error.h"
 #include "bus-internal.h"
 #include "bus-message.h"
 #include "escape.h"
index 25fe4bd95640a0bf152a63496885d4153e4ea72b..e9052b76b318ee461bff2360cffcce42cb5799fc 100644 (file)
@@ -1,20 +1,15 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 #pragma once
 
-#include <pthread.h>
+#include "sd-id128.h"
 
-#include "sd-bus.h"
-
-#include "bus-error.h"
 #include "bus-kernel.h"
 #include "bus-match.h"
 #include "constants.h"
-#include "hashmap.h"
+#include "forward.h"
 #include "list.h"
-#include "prioq.h"
 #include "runtime-scope.h"
 #include "socket-util.h"
-#include "time-util.h"
 
 /* Note that we use the new /run prefix here (instead of /var/run) since we require them to be aliases and
  * that way we become independent of /var being mounted */
@@ -126,7 +121,7 @@ typedef enum BusSlotType {
         _BUS_SLOT_INVALID = -EINVAL,
 } BusSlotType;
 
-struct sd_bus_slot {
+typedef struct sd_bus_slot {
         unsigned n_ref;
         BusSlotType type:8;
 
@@ -157,7 +152,7 @@ struct sd_bus_slot {
                 struct node_object_manager node_object_manager;
                 struct node_vtable node_vtable;
         };
-};
+} sd_bus_slot;
 
 enum bus_state {
         BUS_UNSET,
@@ -181,7 +176,7 @@ enum bus_auth {
         BUS_AUTH_ANONYMOUS
 };
 
-struct sd_bus {
+typedef struct sd_bus {
         unsigned n_ref;
 
         enum bus_state state;
@@ -327,7 +322,7 @@ struct sd_bus {
 
         /* zero means use value specified by $SYSTEMD_BUS_TIMEOUT= environment variable or built-in default */
         usec_t method_call_timeout;
-};
+} sd_bus;
 
 /* For method calls we timeout at 25s, like in the D-Bus reference implementation */
 #define BUS_DEFAULT_TIMEOUT ((usec_t) (25 * USEC_PER_SEC))
index 4c3914ff960e46a8a8d7f5e71b1de2d727157b94..2bbc932939389b884bd9afdc97d8b21c3086f4fa 100644 (file)
@@ -1,15 +1,15 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
+#include <stdio.h>
+
+#include "sd-bus-vtable.h"
+
 #include "bus-internal.h"
 #include "bus-introspect.h"
 #include "bus-objects.h"
-#include "bus-protocol.h"
 #include "bus-signature.h"
-#include "fd-util.h"
-#include "fileio.h"
-#include "log.h"
-#include "memory-util.h"
 #include "memstream-util.h"
+#include "ordered-set.h"
 #include "string-util.h"
 
 #define BUS_INTROSPECT_DOCTYPE                                       \
index 83bcfb2dadb8f698597d22b56769751a26b7f4bc..f9d87c499b69671d058b3216cd6c4a56da8efa85 100644 (file)
@@ -1,12 +1,8 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 #pragma once
 
-#include <stdio.h>
-
-#include "sd-bus.h"
-
+#include "forward.h"
 #include "memstream-util.h"
-#include "ordered-set.h"
 
 struct introspect {
         MemStream m;
index b726957c76729be5f5ed3296b8b625f76b0bc2fc..90fc60afbde232d5efb28a8f6d0c88cfdcf7e34a 100644 (file)
@@ -1,31 +1,11 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
-#if HAVE_VALGRIND_MEMCHECK_H
-#include <valgrind/memcheck.h>
-#endif
-
-#include <fcntl.h>
-#include <malloc.h>
 #include <sys/mman.h>
-#include <sys/prctl.h>
 
-#include "alloc-util.h"
-#include "bus-internal.h"
 #include "bus-kernel.h"
-#include "bus-label.h"
-#include "bus-message.h"
-#include "capability-util.h"
+#include "bus-internal.h"
 #include "fd-util.h"
-#include "fileio.h"
-#include "format-util.h"
-#include "log.h"
-#include "memfd-util.h"
 #include "memory-util.h"
-#include "parse-util.h"
-#include "stdio-util.h"
-#include "string-util.h"
-#include "strv.h"
-#include "user-util.h"
 
 void close_and_munmap(int fd, void *address, size_t size) {
         if (size > 0) {
index be8e0ceb9b692035e78bdcb07a64198293d1da6b..c364f62a8dc11e603e951d17da7e0a3170d707de 100644 (file)
@@ -1,7 +1,7 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 #pragma once
 
-#include "sd-bus.h"
+#include "forward.h"
 
 #define MEMFD_CACHE_MAX 32
 
index a07d9d05216ca5284be8ccd7b51d0709f999a9f8..fc05f385e86c4549575359d00232fcaa43048c7c 100644 (file)
@@ -1,15 +1,16 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
+#include "sd-bus.h"
+
 #include "alloc-util.h"
 #include "bus-internal.h"
 #include "bus-match.h"
 #include "bus-message.h"
-#include "fd-util.h"
-#include "fileio.h"
+#include "hashmap.h"
 #include "hexdecoct.h"
-#include "log.h"
 #include "memstream-util.h"
 #include "sort-util.h"
+#include "stdio-util.h"
 #include "string-util.h"
 #include "strv.h"
 
index 138123c70b9ed70c4b9b94748308a7b051d91790..622e00d94c6a548538e5f44c8f3715c0b47dee19 100644 (file)
@@ -1,11 +1,7 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 #pragma once
 
-#include <stdio.h>
-
-#include "sd-bus.h"
-
-#include "hashmap.h"
+#include "forward.h"
 
 enum bus_match_node_type {
         BUS_MATCH_ROOT,
index 8eff8781ab2cae1518155521319375249d3276e5..6636285526cd92db7bdb09cdb81b9e871547ef3e 100644 (file)
@@ -1,7 +1,5 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
-#include <errno.h>
-#include <fcntl.h>
 #include <sys/mman.h>
 
 #include "sd-bus.h"
@@ -18,7 +16,6 @@
 #include "memory-util.h"
 #include "string-util.h"
 #include "strv.h"
-#include "time-util.h"
 #include "utf8.h"
 
 static int message_append_basic(sd_bus_message *m, char type, const void *p, const void **stored);
index 76f0d853d36100099d4f43a76dd807fc5008306d..0f1cc8f33e5b8ed38e0126867311b1d4f233d4c6 100644 (file)
@@ -2,15 +2,14 @@
 #pragma once
 
 #include <byteswap.h>
-#include <stdbool.h>
-#include <sys/socket.h>
+#include <sys/uio.h>
 
-#include "sd-bus.h"
+#include "sd-bus-protocol.h"
 
 #include "bus-creds.h"
 #include "bus-protocol.h"
-#include "macro.h"
-#include "time-util.h"
+#include "forward.h"
+#include "memory-util.h"
 
 struct bus_container {
         char enclosing;
@@ -42,7 +41,7 @@ struct bus_body_part {
         bool is_zero:1;
 };
 
-struct sd_bus_message {
+typedef struct sd_bus_message {
         /* Caveat: a message can be referenced in two different ways: the main (user-facing) way will also
          * pin the bus connection object the message is associated with. The secondary way ("queued") is used
          * when a message is in the read or write queues of the bus connection object, which will not pin the
@@ -119,7 +118,7 @@ struct sd_bus_message {
         unsigned n_header_offsets;
 
         uint64_t read_counter;
-};
+} sd_bus_message;
 
 static inline bool BUS_MESSAGE_NEED_BSWAP(sd_bus_message *m) {
         return m->header->endian != BUS_NATIVE_ENDIAN;
index e7ec43a19d943127bd4be23f15a4774ba2c339e2..3e827770c84e769e99f0d2915c1ed0035e61ef2b 100644 (file)
@@ -2,6 +2,8 @@
 
 #include <linux/capability.h>
 
+#include "sd-bus.h"
+
 #include "alloc-util.h"
 #include "bus-internal.h"
 #include "bus-introspect.h"
@@ -10,7 +12,7 @@
 #include "bus-signature.h"
 #include "bus-slot.h"
 #include "bus-type.h"
-#include "log.h"
+#include "ordered-set.h"
 #include "set.h"
 #include "string-util.h"
 #include "strv.h"
index 20fccfa1d865b5a1166cc8200a9165dd56161db6..51bfa70ae5ee50b0283befde0fe00796bf322680 100644 (file)
@@ -1,8 +1,9 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 #pragma once
 
-#include "bus-internal.h"
-#include "bus-introspect.h"
+#include "forward.h"
+
+struct node;
 
 const sd_bus_vtable* bus_vtable_next(const sd_bus_vtable *vtable, const sd_bus_vtable *v);
 bool bus_vtable_has_names(const sd_bus_vtable *vtable);
index be46b5f6a7357d8b00ba2b17bbf3cd40a0628e0d..92e251727c18493a36b6e51378cf8068997d7709 100644 (file)
@@ -3,7 +3,7 @@
 
 #include <endian.h>
 
-#include "macro.h"
+#include "forward.h"
 
 /* Packet header */
 
index 16693bcad6b8a65026c53050a4f7c5ff320d78d5..d2f202067bd3065b987e077edc8beac488e06a13 100644 (file)
@@ -1,8 +1,7 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
-#include "sd-bus.h"
+#include "sd-bus-protocol.h"
 
-#include "assert-util.h"
 #include "bus-signature.h"
 #include "bus-type.h"
 
index 0fea7507447d0801eec061d66b1df67c90c2dfb7..b75df7335d4b0590947e1d00b6e94763056fbfba 100644 (file)
@@ -1,8 +1,7 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 #pragma once
 
-#include <stdbool.h>
-#include <stddef.h>
+#include "forward.h"
 
 bool signature_is_single(const char *s, bool allow_dict_entry);
 bool signature_is_pair(const char *s);
index ed9da9663839f835d97e1258d2f1287be3bc5ef8..3b6debadb038af797dadc97a4e163a642f7bd5d2 100644 (file)
@@ -6,7 +6,7 @@
 #include "bus-control.h"
 #include "bus-objects.h"
 #include "bus-slot.h"
-#include "log.h"
+#include "prioq.h"
 #include "set.h"
 #include "string-util.h"
 
index 8116195d4dd83be94527b91e035fa6205b3fa83a..5bd3b081eac4f8f7be7ba48e8a6cc02d8369ba32 100644 (file)
@@ -1,9 +1,8 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 #pragma once
 
-#include "sd-bus.h"
-
 #include "bus-internal.h"
+#include "forward.h"
 
 sd_bus_slot *bus_slot_allocate(sd_bus *bus, bool floating, BusSlotType type, size_t extra, void *userdata);
 
index 7271c68971df4b97de1bb3db05eb4355a89b2fac..9d911aaaa615e56cdaeef6b3311afdfe1e5483f6 100644 (file)
@@ -1,8 +1,10 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
 #include <endian.h>
+#include <grp.h>
 #include <poll.h>
 #include <stdlib.h>
+#include <sys/inotify.h>
 #include <unistd.h>
 
 #include "sd-bus.h"
 #include "bus-internal.h"
 #include "bus-message.h"
 #include "bus-socket.h"
+#include "errno-util.h"
 #include "escape.h"
 #include "fd-util.h"
-#include "format-util.h"
 #include "fs-util.h"
 #include "hexdecoct.h"
 #include "io-util.h"
 #include "iovec-util.h"
 #include "log.h"
-#include "macro.h"
 #include "memory-util.h"
 #include "path-util.h"
 #include "process-util.h"
 #include "random-util.h"
-#include "signal-util.h"
 #include "stdio-util.h"
 #include "string-util.h"
+#include "time-util.h"
 #include "user-util.h"
 #include "utf8.h"
 
index fc8c1eda09a916aa20ac6222d0f10476d83491e2..1c1d3561eeee097f7fb1fef124cbb6564e8680c3 100644 (file)
@@ -1,9 +1,7 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 #pragma once
 
-#include <stdbool.h>
-
-#include "sd-bus.h"
+#include "forward.h"
 
 void bus_socket_setup(sd_bus *b);
 
index 3c3e0c18ec5f9cd688d8563eac270826dfc5d58f..9e5b5e962062718ca33c540c3b44389f4ed1c5d7 100644 (file)
@@ -5,6 +5,7 @@
 #include "alloc-util.h"
 #include "bus-internal.h"
 #include "bus-track.h"
+#include "hashmap.h"
 #include "log.h"
 #include "string-util.h"
 
index 6868cda1e2c8fbf54842219918920949d4897e35..0ecd42e6d3733997de110a68582fbc5008224c66 100644 (file)
@@ -1,7 +1,7 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 #pragma once
 
-typedef struct sd_bus_track sd_bus_track;
+#include "forward.h"
 
 void bus_track_dispatch(sd_bus_track *track);
 void bus_track_close(sd_bus_track *track);
index d1fc836dde3d1b1243c0c739851a95f2c220cd6f..91b76b4c026c796564d2e1e6c8dbc3196986e6d4 100644 (file)
@@ -1,12 +1,9 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
-#include <errno.h>
-
 #include "sd-bus.h"
 
 #include "bus-internal.h"
 #include "bus-type.h"
-#include "log.h"
 
 bool bus_type_is_valid(char c) {
         static const char valid[] = {
index 490108a2c645fd9de59b174c72eeba29731836ef..0e851b0249ece20384239d77fffa14109f91b430 100644 (file)
@@ -1,9 +1,7 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 #pragma once
 
-#include <stdbool.h>
-
-#include "macro.h"
+#include "forward.h"
 
 bool bus_type_is_valid(char c) _const_;
 bool bus_type_is_basic(char c) _const_;
index 16da534245eddef33079135ac47e7f1f035db39f..e6e3dd97d0fb2bfc247b7d65bc0eb42c995d0c41 100644 (file)
@@ -1,11 +1,11 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
+#include "sd-bus.h"
+
 #include "alloc-util.h"
 #include "bus-internal.h"
 #include "bus-match.h"
 #include "env-util.h"
-#include "fd-util.h"
-#include "fileio.h"
 #include "fuzz.h"
 #include "memstream-util.h"
 
index e369f532c91888ddf7aab0aeef1264eb177f42ac..e2c4167f3c9d8faef448b4f51bfc221e7ddba740 100644 (file)
@@ -1,11 +1,10 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
+#include "sd-bus.h"
+
 #include "alloc-util.h"
-#include "bus-dump.h"
 #include "bus-message.h"
 #include "env-util.h"
-#include "fd-util.h"
-#include "fileio.h"
 #include "fuzz.h"
 #include "memstream-util.h"
 
index b0d0b0e1d14c43c29aa0ae59ac01c15a300b34c5..c13a8982121c49e2c6eaa22d7c77c24316a8cde5 100644 (file)
@@ -1,22 +1,21 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
-#include <endian.h>
 #include <netdb.h>
+#include <poll.h>
 #include <pthread.h>
-#include <signal.h>
 #include <stdlib.h>
-#include <sys/mman.h>
 #include <sys/stat.h>
-#include <sys/wait.h>
 #include <threads.h>
 #include <unistd.h>
 
 #include "sd-bus.h"
+#include "sd-event.h"
 
 #include "af-list.h"
 #include "alloc-util.h"
 #include "bus-container.h"
 #include "bus-control.h"
+#include "bus-error.h"
 #include "bus-internal.h"
 #include "bus-kernel.h"
 #include "bus-label.h"
@@ -28,7 +27,6 @@
 #include "bus-track.h"
 #include "bus-type.h"
 #include "cgroup-util.h"
-#include "constants.h"
 #include "errno-util.h"
 #include "fd-util.h"
 #include "format-util.h"
 #include "io-util.h"
 #include "log.h"
 #include "log-context.h"
-#include "macro.h"
 #include "memory-util.h"
-#include "missing_syscall.h"
 #include "origin-id.h"
 #include "parse-util.h"
 #include "path-util.h"
+#include "prioq.h"
 #include "process-util.h"
-#include "stdio-util.h"
+#include "set.h"
 #include "string-util.h"
 #include "strv.h"
+#include "time-util.h"
 #include "user-util.h"
 
 #define log_debug_bus_message(m)                                         \
index 78ae564aeb108ac8f31b948891486fa25fcf4f42..4063d79159a555a8ce725a5c8202f606573843b6 100644 (file)
@@ -1,5 +1,8 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
+#include <pthread.h>
+#include <sched.h>
+#include <stdlib.h>
 #include <sys/resource.h>
 #include <sys/wait.h>
 #include <unistd.h>
@@ -8,10 +11,7 @@
 
 #include "alloc-util.h"
 #include "bus-internal.h"
-#include "bus-kernel.h"
-#include "constants.h"
 #include "fd-util.h"
-#include "string-util.h"
 #include "tests.h"
 #include "time-util.h"
 
index d06853b22c0254f18eaf892630aad53a94098ad4..df1be5ceca38c6cd2bdf11eaaead54b32b5abd77 100644 (file)
@@ -2,7 +2,6 @@
 
 #include <fcntl.h>
 #include <pthread.h>
-#include <stdlib.h>
 #include <unistd.h>
 
 #include "sd-bus.h"
@@ -15,9 +14,9 @@
 #include "fd-util.h"
 #include "format-util.h"
 #include "log.h"
-#include "macro.h"
 #include "string-util.h"
 #include "tests.h"
+#include "time-util.h"
 
 static int match_callback(sd_bus_message *m, void *userdata, sd_bus_error *ret_error) {
         log_info("Match triggered! destination=%s interface=%s member=%s",
index b569986a9462a5a1c52ceb9b6b2c516f30795423..7c9899e129fbc46ed3c3ccaa573b089590d7533b 100644 (file)
@@ -1,6 +1,5 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
-#include <stdio.h>
 #include <unistd.h>
 
 #include "sd-bus.h"
index 31b04002b5919cb961bd5a1c9a468cf971c069b6..d52683ea87ee2a5fb0b96d8a7298ddb1a2207fe7 100644 (file)
@@ -1,7 +1,6 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
 #include <math.h>
-#include <stdlib.h>
 
 /* We make an exception here to our usual "include system headers first" rule because we need one of these
  * macros to disable a warning triggered by the glib headers. */
@@ -20,13 +19,10 @@ REENABLE_WARNING
 #include "sd-bus.h"
 
 #include "alloc-util.h"
-#include "bus-dump.h"
 #include "bus-label.h"
 #include "bus-message.h"
 #include "bus-util.h"
 #include "escape.h"
-#include "fd-util.h"
-#include "fileio.h"
 #include "log.h"
 #include "memstream-util.h"
 #include "tests.h"
index 2d7755711e54d27129ac848f899cf03ee0858b90..7b212c8eaa52c0247b81ff38e90f4e95c56449d2 100644 (file)
@@ -1,10 +1,11 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
+#include "sd-bus.h"
+
+#include "bus-internal.h"
 #include "bus-match.h"
 #include "bus-message.h"
-#include "bus-slot.h"
 #include "log.h"
-#include "macro.h"
 #include "memory-util.h"
 #include "tests.h"
 
index c9ec474856d74debe827f8bd1628e2b8f3a722b9..fac3e150857246edddf7774f78706224764590d4 100644 (file)
@@ -1,16 +1,13 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
 #include <pthread.h>
-#include <stdlib.h>
 
 #include "sd-bus.h"
 
 #include "alloc-util.h"
-#include "bus-dump.h"
 #include "bus-internal.h"
 #include "bus-message.h"
 #include "log.h"
-#include "macro.h"
 #include "strv.h"
 #include "tests.h"
 
index 8b11a7af33d639bf45e79d9371b29ad11082e521..32072097ba593fc24526559cf071fff130aef865 100644 (file)
@@ -6,11 +6,10 @@
 #include "sd-bus.h"
 
 #include "bus-dump.h"
-#include "bus-util.h"
 #include "fd-util.h"
+#include "pidref.h"
 #include "process-util.h"
 #include "socket-util.h"
-#include "sort-util.h"
 #include "tests.h"
 #include "user-util.h"
 
index 7c2fa72e84e97ccbf70f450c62b6984610bcc96a..debe78c7e2c21b12cd9fa4b01a22eb4d5d900ab9 100644 (file)
@@ -1,4 +1,5 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
+
 #include "sd-bus.h"
 
 #include "main-func.h"
index 8049e33294928ffdc2fba6aab10a680561af0ff8..68f5e00040ab5b835d5f5f4128fe0ea7e1440837 100644 (file)
@@ -1,13 +1,12 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
 #include <pthread.h>
-#include <stdlib.h>
+#include <sys/socket.h>
 
 #include "sd-bus.h"
 
-#include "bus-internal.h"
+#include "bus-error.h"
 #include "log.h"
-#include "macro.h"
 #include "memory-util.h"
 #include "string-util.h"
 #include "tests.h"
index 5a4c8118643bfa96167e0a35dabd17bf9be1f019..241720828174df45224a11fa94ebcdba56741e52 100644 (file)
@@ -3,7 +3,6 @@
 #include "bus-internal.h"
 #include "bus-signature.h"
 #include "log.h"
-#include "string-util.h"
 #include "tests.h"
 
 int main(int argc, char *argv[]) {
index 5604e84f522a32cd4d0000713da55f4731553843..4f14787f3062929d66f536104801c45c08ead11f 100644 (file)
@@ -1,11 +1,10 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
-#include <errno.h>
 #include <sys/socket.h>
 
 #include "sd-bus.h"
+#include "sd-event.h"
 
-#include "macro.h"
 #include "tests.h"
 
 static bool track_cb_called_x = false;
index bc6be901adc1cb67f308702e080f5406e609eda5..17cd1bb51c3631b42fa04db8cf9997a92aed6987 100644 (file)
@@ -1,18 +1,15 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
-#include <stdbool.h>
-#include <stddef.h>
-
 /* We use system assert.h here, because we don't want to keep macro.h and log.h C++ compatible */
 #undef NDEBUG
 #include <assert.h>
-#include <errno.h>
 #include <stdio.h>
 
 #include "sd-bus.h"
 #include "sd-bus-vtable.h"
 
 #ifndef __cplusplus
+#  include "alloc-util.h"
 #  include "bus-objects.h"
 #  include "log.h"
 #endif
index f7ba14a6a8063441f4a47983fc41933c224ead65..c6c072440ec52cdd691b1cb83c33eeb48e5de142 100644 (file)
@@ -17,6 +17,7 @@
 #include "socket-util.h"
 #include "string-util.h"
 #include "tests.h"
+#include "time-util.h"
 #include "tmpfile-util.h"
 
 static int method_foobar(sd_bus_message *m, void *userdata, sd_bus_error *ret_error) {
index b7635a60b6bec21affc794f6162a85a43c316843..14733d0f175bfe0bd9638cc64fee4e63ef261d03 100644 (file)
@@ -1,14 +1,9 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
-#include <errno.h>
-#include <limits.h>
 #include <mqueue.h>
 #include <netinet/in.h>
 #include <poll.h>
-#include <stdarg.h>
-#include <stddef.h>
 #include <stdio.h>
-#include <stdlib.h>
 #include <sys/stat.h>
 #include <sys/un.h>
 #include <unistd.h>
@@ -16,6 +11,7 @@
 #include "sd-daemon.h"
 
 #include "alloc-util.h"
+#include "errno-util.h"
 #include "extract-word.h"
 #include "fd-util.h"
 #include "fs-util.h"
index cf62fabdad98483bd99fb42d6560cc80d287d0f6..f4b836e16a56142b1e0f344c3c1c07fa7a780343 100644 (file)
@@ -1,9 +1,7 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 #pragma once
 
-#include <stdbool.h>
-
-#include "sd-device.h"
+#include "forward.h"
 
 typedef enum MatchInitializedType {
         MATCH_INITIALIZED_NO,     /* only devices without a db entry */
index 8230763ddd9d7180fa0f9609b0a61de6890a8073..1b2b534530a55468c0bd8ead919f895d25d91e57 100644 (file)
@@ -1,8 +1,6 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
-#include <fcntl.h>
 #include <fnmatch.h>
-#include <unistd.h>
 
 #include "sd-device.h"
 
@@ -12,6 +10,8 @@
 #include "device-util.h"
 #include "dirent-util.h"
 #include "fd-util.h"
+#include "log.h"
+#include "path-util.h"
 #include "set.h"
 #include "sort-util.h"
 #include "string-util.h"
index bf7d4d4be517f398b07b80750e5a34c0ccc7afac..cffc91ce9309c21829aae01626e8e3d642218646 100644 (file)
@@ -1,10 +1,12 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
-#include <fnmatch.h>
+#include "sd-device.h"
 
 #include "alloc-util.h"
 #include "device-filter.h"
+#include "hashmap.h"
 #include "path-util.h"
+#include "set.h"
 #include "strv.h"
 
 int update_match_strv(Hashmap **match_strv, const char *key, const char *value, bool clear_on_null) {
index 0c5f34e242d2524a4f30993a72b7c1220b6e59fa..d72cbab7e8cc8f859551ccff087e4896ad3cfa0a 100644 (file)
@@ -1,12 +1,7 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 #pragma once
 
-#include <stdbool.h>
-
-#include "sd-device.h"
-
-#include "hashmap.h"
-#include "set.h"
+#include "forward.h"
 
 int update_match_strv(Hashmap **match_strv, const char *key, const char *value, bool clear_on_null);
 bool device_match_sysattr(sd_device *device, Hashmap *match_sysattr, Hashmap *nomatch_sysattr);
index cbd89849bde74181103fadec557519cd0165db8a..1f9cf59d512230654fe80f7dbfcf11a4995e239e 100644 (file)
@@ -3,10 +3,8 @@
 
 #include "sd-device.h"
 
-#include "device-private.h"
-#include "hashmap.h"
-#include "set.h"
-#include "time-util.h"
+#include "forward.h"
+#include "iterator.h"
 
 #define LATEST_UDEV_DATABASE_VERSION 1
 
index 79f9d834ff3bd91e940203f61576d14bc67aaa0d..309d4979e22bcfe302f0f5f1769dcb7bca42d774 100644 (file)
@@ -1,11 +1,7 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 #pragma once
 
-#include <errno.h>
-
-#include "sd-device.h"
-
-#include "socket-util.h"
+#include "forward.h"
 
 typedef enum MonitorNetlinkGroup {
         MONITOR_GROUP_NONE,
index 99bdc7f342717e0d95b20d30ac7cc0767ee77e8c..5ae1eb6390a37acdcd63450fcd35b580bd915986 100644 (file)
@@ -1,6 +1,5 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
-#include <errno.h>
 #include <linux/filter.h>
 #include <linux/netlink.h>
 #include <linux/sockios.h>
 #include "hashmap.h"
 #include "io-util.h"
 #include "iovec-util.h"
+#include "log.h"
 #include "log-context.h"
-#include "missing_socket.h"
 #include "mountpoint-util.h"
 #include "set.h"
+#include "socket-util.h"
 #include "stat-util.h"
 #include "string-util.h"
-#include "strv.h"
 #include "uid-range.h"
 
 #define log_monitor(m, format, ...)                                     \
index 270e0293e1502145ca5fb0c94a5951189cade9da..9896e0e7ac4e7702c006d064c67d58d16365c357 100644 (file)
@@ -1,8 +1,8 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
-#include <ctype.h>
-#include <net/if.h>
-#include <sys/types.h>
+#include <sys/stat.h>
+#include <sys/sysmacros.h>
+#include <unistd.h>
 
 #include "sd-device.h"
 
 #include "device-internal.h"
 #include "device-private.h"
 #include "device-util.h"
+#include "extract-word.h"
 #include "fd-util.h"
 #include "fileio.h"
 #include "fs-util.h"
 #include "hashmap.h"
-#include "macro.h"
 #include "mkdir.h"
 #include "nulstr-util.h"
 #include "parse-util.h"
 #include "path-util.h"
 #include "set.h"
-#include "stdio-util.h"
 #include "string-table.h"
 #include "string-util.h"
 #include "strv.h"
 #include "strxcpyx.h"
+#include "time-util.h"
 #include "tmpfile-util.h"
 #include "user-util.h"
 
index 7d609d1a41401033227a4191ccdadd66a4b66b5c..b5a24dde1c02ad163948bce4aceb966bb0d41a42 100644 (file)
@@ -1,16 +1,11 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 #pragma once
 
-#include <dirent.h>
-#include <inttypes.h>
-#include <stdbool.h>
-#include <sys/stat.h>
-#include <sys/types.h>
+#include "sd-device.h" /* IWYU pragma: export */
 
-#include "sd-device.h"
+#include "forward.h"
 
-#include "chase.h"
-#include "macro.h"
+typedef enum ChaseFlags ChaseFlags;
 
 int device_new_from_mode_and_devnum(sd_device **ret, mode_t mode, dev_t devnum);
 int device_new_from_nulstr(sd_device **ret, char *nulstr, size_t len);
index 5169c24d848a984c8825695c1217380d1351c9ea..718b70306668a62e1f08b1d9bb00a5523e6aa7b9 100644 (file)
@@ -1,6 +1,5 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
-#include "alloc-util.h"
 #include "device-private.h"
 #include "device-util.h"
 #include "devnum-util.h"
@@ -29,6 +28,11 @@ int devname_from_devnum(mode_t mode, dev_t devnum, char **ret) {
         return strdup_to(ret, devname);
 }
 
+int devname_from_stat_rdev(const struct stat *st, char **ret) {
+        assert(st);
+        return devname_from_devnum(st->st_mode, st->st_rdev, ret);
+}
+
 int device_open_from_devnum(mode_t mode, dev_t devnum, int flags, char **ret_devname) {
         _cleanup_(sd_device_unrefp) sd_device *dev = NULL;
         _cleanup_close_ int fd = -EBADF;
index 5b899ecfcdf2ff79d2a0e2ad3fe8ab57eaf4f358..136d399d7eb84a3ad779a9a6efaa0fd6ba7ec794 100644 (file)
@@ -1,15 +1,10 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 #pragma once
 
-#include <stdbool.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-
 #include "sd-device.h"
 
-#include "alloc-util.h"
+#include "forward.h"
 #include "log.h"
-#include "macro.h"
 
 #define device_unref_and_replace(a, b)                                  \
         unref_and_replace_full(a, b, sd_device_ref, sd_device_unref)
 #define log_device_error_errno(device, error, ...)   log_device_full_errno(device, LOG_ERR,     error, __VA_ARGS__)
 
 int devname_from_devnum(mode_t mode, dev_t devnum, char **ret);
-static inline int devname_from_stat_rdev(const struct stat *st, char **ret) {
-        assert(st);
-        return devname_from_devnum(st->st_mode, st->st_rdev, ret);
-}
+int devname_from_stat_rdev(const struct stat *st, char **ret);
 int device_open_from_devnum(mode_t mode, dev_t devnum, int flags, char **ret_devname);
 
 char** device_make_log_fields(sd_device *device);
index c90d267456c68daf2a2c92c53537e434d4910252..aef02350ccd2e3c30bfa3bacf4ddd6783cce90cc 100644 (file)
@@ -1,11 +1,9 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
-#include <ctype.h>
-#include <net/if.h>
-#include <sys/ioctl.h>
-#include <sys/types.h>
+#include <unistd.h>
 
 #include "sd-device.h"
+#include "sd-id128.h"
 
 #include "alloc-util.h"
 #include "chase.h"
 #include "devnum-util.h"
 #include "dirent-util.h"
 #include "env-util.h"
+#include "errno-util.h"
+#include "extract-word.h"
 #include "fd-util.h"
 #include "fileio.h"
-#include "format-util.h"
 #include "fs-util.h"
 #include "hashmap.h"
-#include "id128-util.h"
-#include "macro.h"
 #include "missing_magic.h"
 #include "netlink-util.h"
 #include "parse-util.h"
 #include "path-util.h"
 #include "set.h"
 #include "socket-util.h"
+#include "stat-util.h"
 #include "stdio-util.h"
 #include "string-util.h"
 #include "strv.h"
-#include "strxcpyx.h"
-#include "user-util.h"
+#include "time-util.h"
 
 int device_new_aux(sd_device **ret) {
         sd_device *device;
index aa3fb8215fac96fd04e75e4bab7503df01dfd7df..030beff8b355c298b246393105217cc4962716bd 100644 (file)
@@ -1,5 +1,7 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
+#include "sd-device.h"
+
 #include "device-util.h"
 #include "mountpoint-util.h"
 #include "tests.h"
index 362ce0a85ee903f8ff7ae63c9570542638f87d98..c1c720b364b08a9f3184f2356a5ff1962c8b0be5 100644 (file)
@@ -1,6 +1,5 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
-#include <stdbool.h>
 #include <unistd.h>
 
 #include "sd-device.h"
 #include "device-private.h"
 #include "device-util.h"
 #include "io-util.h"
-#include "macro.h"
 #include "mountpoint-util.h"
 #include "path-util.h"
+#include "socket-util.h"
 #include "stat-util.h"
 #include "string-util.h"
 #include "tests.h"
-#include "virt.h"
+#include "time-util.h"
 
 static void prepare_loopback(sd_device **ret) {
         _cleanup_(sd_device_unrefp) sd_device *dev = NULL;
index 539dabd7a6b75d4b2d09bdfcc2def80334d3b72b..1738ddb620c379050e1c3e27caa1d6a83dc6ba97 100644 (file)
@@ -1,9 +1,6 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
-#include <errno.h>
 #include <pthread.h>
-#include <stdio.h>
-#include <stdlib.h>
 
 #include "sd-device.h"
 
@@ -12,7 +9,7 @@
 
 #define handle_error_errno(error, msg)                          \
         ({                                                      \
-                errno = abs(error);                             \
+                errno = ABS(error);                             \
                 perror(msg);                                    \
                 EXIT_FAILURE;                                   \
         })
index ff59d3bd501921909cd8d150bc20075be7074f9e..4173f76dd8139bd93ae5839dc09df46da11831b5 100644 (file)
@@ -1,10 +1,10 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
-#include <ctype.h>
 #include <fcntl.h>
 #include <unistd.h>
 
-#include "device-enumerator-private.h"
+#include "sd-event.h"
+
 #include "device-internal.h"
 #include "device-private.h"
 #include "device-util.h"
 #include "nulstr-util.h"
 #include "path-util.h"
 #include "rm-rf.h"
+#include "set.h"
 #include "stat-util.h"
 #include "string-util.h"
 #include "tests.h"
-#include "time-util.h"
 #include "tmpfile-util.h"
 #include "udev-util.h"
 
index d05bcf0538df633cf97ad0f1d074ec7c2b25f0d8..3be9a0e6c12404b35acc92c450cb2828264fe96b 100644 (file)
@@ -1,16 +1,14 @@
-#pragma once
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
+#pragma once
 
-#include <sys/epoll.h>
-#include <sys/timerfd.h>
-#include <sys/wait.h>
+#include <signal.h>
+#include <sys/signalfd.h>
 
 #include "sd-event.h"
 
-#include "hashmap.h"
+#include "forward.h"
 #include "inotify-util.h"
 #include "list.h"
-#include "prioq.h"
 #include "ratelimit.h"
 
 typedef enum EventSourceType {
index d7f15882c8f8f65df5c97ce2522433a56ea374f6..7e8c481bcf4727c57f06831af5c1b6a3c15fc39e 100644 (file)
@@ -1,13 +1,16 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
-#include <errno.h>
+#include "sd-event.h"
 
-#include "errno-util.h"
+#include "alloc-util.h"
 #include "event-source.h"
 #include "event-util.h"
 #include "fd-util.h"
+#include "hash-funcs.h"
 #include "log.h"
+#include "pidref.h"
 #include "string-util.h"
+#include "time-util.h"
 
 #define SI_FLAG_FORWARD  (INT32_C(1) << 30)
 #define SI_FLAG_POSITIVE (INT32_C(1) << 29)
index 02dc3929ca77370a94a618c17ea1e01ab98e8356..7cc56a38d889501b3000d53552f37fa4bdb32080 100644 (file)
@@ -1,12 +1,9 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 #pragma once
 
-#include <stdbool.h>
-
 #include "sd-event.h"
 
-#include "hash-funcs.h"
-#include "pidref.h"
+#include "forward.h"
 
 extern const struct hash_ops event_source_hash_ops;
 
index 5e055330e017593858e9cf2aa1663e7a2c5ac0da..6d8a207b5d4b17b34532525b236c4e228df9f6d7 100644 (file)
@@ -1,6 +1,6 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
-#include <sys/epoll.h>
+#include <stdlib.h>
 #include <sys/timerfd.h>
 #include <sys/wait.h>
 #include <threads.h>
 #include "sd-messages.h"
 
 #include "alloc-util.h"
-#include "env-util.h"
+#include "errno-util.h"
 #include "event-source.h"
 #include "fd-util.h"
-#include "fs-util.h"
+#include "format-util.h"
 #include "glyph-util.h"
 #include "hashmap.h"
 #include "hexdecoct.h"
 #include "list.h"
+#include "log.h"
 #include "logarithm.h"
-#include "macro.h"
 #include "mallinfo-util.h"
 #include "memory-util.h"
 #include "missing_magic.h"
-#include "missing_syscall.h"
 #include "missing_wait.h"
 #include "origin-id.h"
 #include "path-util.h"
@@ -34,6 +33,7 @@
 #include "psi-util.h"
 #include "set.h"
 #include "signal-util.h"
+#include "siphash24.h"
 #include "socket-util.h"
 #include "stat-util.h"
 #include "string-table.h"
index 6394507994fba68b8797f0ec7d8bdd84ac70e376..23a45c7276abe40d36e46fda3a9d64f219564af4 100644 (file)
@@ -1,22 +1,17 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
-#if HAVE_PIDFD_OPEN
-#include <sys/pidfd.h>
-#endif
 #include <sys/wait.h>
 #include <unistd.h>
 
 #include "sd-event.h"
 
 #include "alloc-util.h"
-#include "exec-util.h"
 #include "fd-util.h"
 #include "fs-util.h"
 #include "log.h"
-#include "macro.h"
-#include "missing_syscall.h"
 #include "parse-util.h"
 #include "path-util.h"
+#include "pidfd-util.h"
 #include "process-util.h"
 #include "random-util.h"
 #include "rm-rf.h"
@@ -24,6 +19,7 @@
 #include "stdio-util.h"
 #include "string-util.h"
 #include "tests.h"
+#include "time-util.h"
 #include "tmpfile-util.h"
 
 static int prepare_handler(sd_event_source *s, void *userdata) {
index b26eb594edc5a8d613dfae5458d455a9793a7410..65c810416a2ef0885dea63e88f2a631380568d4d 100644 (file)
@@ -1,11 +1,10 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 #pragma once
 
-#include <stdint.h>
 #include <sys/stat.h>
 
-#include "constants.h"
-#include "hashmap.h"
+#include "forward.h"
+#include "iterator.h"
 #include "sparse-endian.h"
 
 #define HWDB_SIG { 'K', 'S', 'L', 'P', 'H', 'H', 'R', 'H' }
index fce62e12e44fabb373c9a15dfec6f4c31043855d..bc96e409074c813e3a726aec103066396c6aba0c 100644 (file)
@@ -3,9 +3,7 @@
   Copyright Â© 2008 Alan Jenkins <alan.christopher.jenkins@googlemail.com>
 ***/
 
-#include <errno.h>
 #include <fnmatch.h>
-#include <inttypes.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <sys/mman.h>
@@ -21,7 +19,6 @@
 #include "log.h"
 #include "nulstr-util.h"
 #include "string-util.h"
-#include "time-util.h"
 
 struct linebuf {
         char bytes[LINE_MAX];
index 44b0e1dddab05caf3ab49b686ea5ec9fbc572a24..f5dcf2ecf259016a76cfbb78b59435ddf6c1f1fd 100644 (file)
@@ -1,19 +1,19 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
-#include <errno.h>
 #include <fcntl.h>
+#include <stdlib.h>
+#include <sys/socket.h>
 #include <unistd.h>
 
 #include "fd-util.h"
 #include "fs-util.h"
-#include "hexdecoct.h"
+#include "hash-funcs.h"
 #include "id128-util.h"
 #include "io-util.h"
-#include "log.h"
 #include "namespace-util.h"
 #include "process-util.h"
 #include "sha256.h"
-#include "stdio-util.h"
+#include "siphash24.h"
 #include "string-util.h"
 #include "strv.h"
 #include "sync-util.h"
index 458d43077198f26713f2c1afdf6df471e538e768..874fc9f4460e08648b6dcaf7459d1db708cb01f0 100644 (file)
@@ -1,14 +1,10 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 #pragma once
 
-#include <fcntl.h>
-#include <stdbool.h>
-
 #include "sd-id128.h"
 
 #include "errno-util.h"
-#include "hash-funcs.h"
-#include "macro.h"
+#include "forward.h"
 
 bool id128_is_valid(const char *s) _pure_;
 
index 54fb403a54b24d9327db87b7d4b20eb697f71ccc..54fab9284a7c22c3d8437a1b3c5c32ebdbeed7f9 100644 (file)
@@ -1,9 +1,8 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
-#include <errno.h>
 #include <fcntl.h>
+#include <stdlib.h>
 #include <threads.h>
-#include <unistd.h>
 
 #include "sd-id128.h"
 
 #include "hexdecoct.h"
 #include "hmac.h"
 #include "id128-util.h"
-#include "io-util.h"
 #include "keyring-util.h"
-#include "log.h"
-#include "macro.h"
 #include "missing_syscall.h"
 #include "path-util.h"
 #include "random-util.h"
index fffc58ad92ac6f377f4ff55b53ea2390156eeaa4..85b4c47bb02b84bc5c85117e4e90f208c6140d9b 100644 (file)
@@ -3,8 +3,7 @@
 
 #include <stdio.h>
 
-#include "alloc-util.h"
-#include "macro.h"
+#include "forward.h"
 
 const char* audit_type_to_string(int type);
 int audit_type_from_string(const char *s);
index 1ecf335fb864c4e68add041bb55b52f9f1fa8583..3ca3b2dab4735dbcf34e26bbf3b736d5c53df712 100644 (file)
@@ -1,13 +1,11 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
-#include <errno.h>
 #include <fcntl.h>
 #include <locale.h>
 #include <stdio.h>
+#include <stdlib.h>
 #include <sys/mman.h>
 #include <sys/stat.h>
-#include <sys/types.h>
-#include <unistd.h>
 
 #include "sd-id128.h"
 
@@ -22,7 +20,6 @@
 #include "log.h"
 #include "memory-util.h"
 #include "mkdir.h"
-#include "path-util.h"
 #include "siphash24.h"
 #include "sort-util.h"
 #include "sparse-endian.h"
index e6a8c9b8dbb1bd164a917e5326f8e1dc3ce52bc1..c2a20aaddbf1767e2bb667c2afa0f104f8254700 100644 (file)
@@ -1,12 +1,7 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 #pragma once
 
-#include <stdbool.h>
-#include <stdio.h>
-
-#include "sd-id128.h"
-
-#include "hashmap.h"
+#include "forward.h"
 
 int catalog_import_file(OrderedHashmap **h, const char *path);
 int catalog_update(const char *database, const char *root, const char* const *dirs);
index a0594cd4382273e41ce979eed876be1ded90e930..f65c5f9e06aa62f52a5c5069895f41612910976a 100644 (file)
@@ -7,10 +7,7 @@
  * Contact: fsprg@point-at-infinity.org
  */
 
-#include <inttypes.h>
-#include <sys/types.h>
-
-#include "macro.h"
+#include "forward.h"
 
 #ifdef __cplusplus
 extern "C" {
index 9ad9ce3ef3349f8d6dd32f1c2136df9ff56f705a..60a60f26f598b25a958912fd401754be87f08c78 100644 (file)
@@ -2,7 +2,9 @@
 
 #include <fcntl.h>
 #include <sys/mman.h>
+#include <sys/stat.h>
 
+#include "alloc-util.h"
 #include "fd-util.h"
 #include "fsprg.h"
 #include "gcrypt-util.h"
@@ -12,6 +14,7 @@
 #include "journal-file.h"
 #include "log.h"
 #include "memory-util.h"
+#include "string-util.h"
 #include "time-util.h"
 
 static void* fssheader_free(FSSHeader *p) {
index e895722865d6e4734cf0398f1876525b2ffa8dd1..21c69ad30b800e7bcc82d2eda18997d66dc0c1ee 100644 (file)
@@ -1,8 +1,7 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 #pragma once
 
-#include <stdbool.h>
-
+#include "forward.h"
 #include "journal-file.h"
 
 int journal_file_append_tag(JournalFile *f);
index 28cccca21a7641647c765a6b643dcebc8e190e83..f3fef931d0371bab3f97fac43a93ddd921c67f05 100644 (file)
@@ -1,11 +1,9 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 #pragma once
 
-#include <errno.h>
-
 #include "sd-id128.h"
 
-#include "macro.h"
+#include "forward.h"
 #include "sparse-endian.h"
 
 /*
index dfc3e8aa9132e96189d5c8e103a7652e7e28d2b3..ec06ea8e20fcb644fbe7f9fbe5188d76380ed3ec 100644 (file)
@@ -1,10 +1,9 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
-#include <errno.h>
 #include <fcntl.h>
 #include <linux/magic.h>
 #include <pthread.h>
-#include <stddef.h>
+#include <stdlib.h>
 #include <sys/mman.h>
 #include <sys/statvfs.h>
 #include <sys/uio.h>
@@ -21,6 +20,7 @@
 #include "format-util.h"
 #include "fs-util.h"
 #include "gcrypt-util.h"
+#include "hashmap.h"
 #include "id128-util.h"
 #include "journal-authenticate.h"
 #include "journal-def.h"
 #include "log-ratelimit.h"
 #include "lookup3.h"
 #include "memory-util.h"
-#include "missing_fs.h"
 #include "parse-util.h"
 #include "path-util.h"
 #include "prioq.h"
 #include "random-util.h"
 #include "ratelimit.h"
-#include "set.h"
 #include "sort-util.h"
 #include "stat-util.h"
 #include "string-table.h"
 #include "string-util.h"
 #include "strv.h"
+#include "siphash24.h"
 #include "sync-util.h"
+#include "time-util.h"
 #include "user-util.h"
 #include "xattr-util.h"
 
index 89b06b0834557c1f8f081d1a7df091b4025b3dcb..12a66468530694f0196a3b2be2e3e384cb521dc6 100644 (file)
@@ -1,20 +1,13 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 #pragma once
 
-#include <inttypes.h>
-#include <sys/uio.h>
-
-#include "sd-event.h"
-#include "sd-id128.h"
-
 #include "compress.h"
+#include "forward.h"
 #include "gcrypt-util.h"
-#include "hashmap.h"
 #include "journal-def.h"
 #include "missing_fcntl.h"
 #include "mmap-cache.h"
 #include "sparse-endian.h"
-#include "time-util.h"
 
 typedef struct JournalMetrics {
         /* For all these: UINT64_MAX means "pick automatically", and 0 means "no limit enforced" */
index badec0e94380dbec3973ce0ca278670f0748aca2..15dc934db0f0167058df63bb9307b627a4324540 100644 (file)
@@ -1,18 +1,10 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 #pragma once
 
-#include <inttypes.h>
-#include <stdbool.h>
-#include <sys/types.h>
-
-#include "sd-id128.h"
-#include "sd-journal.h"
-
-#include "hashmap.h"
-#include "journal-def.h"
 #include "journal-file.h"
 #include "list.h"
-#include "prioq.h"
+#include "forward.h"
+#include "time-util.h"
 
 #define JOURNAL_FILES_MAX 7168u
 
@@ -28,7 +20,7 @@ typedef enum MatchType {
         MATCH_AND_TERM,
 } MatchType;
 
-struct Match {
+typedef struct Match {
         MatchType type;
         Match *parent;
         LIST_FIELDS(Match, matches);
@@ -40,9 +32,9 @@ struct Match {
 
         /* For terms */
         LIST_HEAD(Match, matches);
-};
+} Match;
 
-struct Location {
+typedef struct Location {
         LocationType type;
 
         bool seqnum_set:1;
@@ -59,22 +51,22 @@ struct Location {
         sd_id128_t boot_id;
 
         uint64_t xor_hash;
-};
+} Location;
 
-struct Directory {
+typedef struct Directory {
         sd_journal *journal;
         char *path;
         int wd;
         bool is_root;
         unsigned last_seen_generation;
-};
+} Directory;
 
 typedef struct NewestByBootId {
         sd_id128_t boot_id;
         Prioq *prioq; /* JournalFile objects ordered by monotonic timestamp of last update. */
 } NewestByBootId;
 
-struct sd_journal {
+typedef struct sd_journal {
         int toplevel_fd;
 
         char *path;
@@ -134,7 +126,7 @@ struct sd_journal {
         Hashmap *directories_by_wd;
 
         Hashmap *errors;
-};
+} sd_journal;
 
 char* journal_make_match_string(sd_journal *j);
 void journal_print_header(sd_journal *j);
index d043e1882d0179f3a395a7c51fc39bc056e84543..8a1e0b1fdf187ebef844af2a72bd7d35d689fe5a 100644 (file)
@@ -1,10 +1,5 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
-#include <errno.h>
-#include <fcntl.h>
-#include <printf.h>
-#include <stddef.h>
-#include <sys/un.h>
 #include <unistd.h>
 #if HAVE_VALGRIND_VALGRIND_H
 #  include <valgrind/valgrind.h>
@@ -24,7 +19,6 @@
 #include "log.h"
 #include "memfd-util.h"
 #include "missing_mman.h"
-#include "missing_syscall.h"
 #include "process-util.h"
 #include "socket-util.h"
 #include "stdio-util.h"
index 6fe6325090ec768c08c58af37babfbe1aa33a152..e5394e947182b18de844dc01bf4de3d388d112cb 100644 (file)
@@ -1,9 +1,6 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 #pragma once
 
-#include <stdbool.h>
-#include <stddef.h>
-
 #include "syslog-util.h"
 
 int journal_fd_nonblock(bool nonblock);
index b50a0179d0bb07c27c2b5e61d21b2c86715833fe..7301b72e950ca2a21cbfdd356fbef97820c80749 100644 (file)
@@ -12,7 +12,6 @@
 #include "format-util.h"
 #include "fs-util.h"
 #include "journal-def.h"
-#include "journal-file.h"
 #include "journal-internal.h"
 #include "journal-vacuum.h"
 #include "log.h"
index d87c847da602040b1390d27d6e20560f27e1834b..e134a9d4b90aef5275e91683f99c4fd06cc54246 100644 (file)
@@ -1,9 +1,6 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 #pragma once
 
-#include <inttypes.h>
-#include <stdbool.h>
-
-#include "time-util.h"
+#include "forward.h"
 
 int journal_directory_vacuum(const char *directory, uint64_t max_use, uint64_t n_max_files, usec_t max_retention_usec, usec_t *oldest_usec, bool verbose);
index 87d66aac4333a17d458628bd2108371252de701d..db566288b72e62e0cbf222b7c4f282401eb8f4f3 100644 (file)
@@ -1,9 +1,7 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
 #include <fcntl.h>
-#include <stddef.h>
 #include <sys/mman.h>
-#include <unistd.h>
 
 #include "alloc-util.h"
 #include "ansi-color.h"
@@ -17,9 +15,8 @@
 #include "journal-file.h"
 #include "journal-verify.h"
 #include "log.h"
-#include "lookup3.h"
-#include "macro.h"
 #include "terminal-util.h"
+#include "time-util.h"
 #include "tmpfile-util.h"
 
 static void draw_progress(uint64_t p, usec_t *last_usec) {
index 04e493e95eacb6d26e0e256f1aef214052d9065b..e4709490e20af82459e24f26522f471a184156df 100644 (file)
@@ -1,10 +1,7 @@
 /* SPDX-License-Identifier: LicenseRef-lookup3-public-domain */
 #pragma once
 
-#include <inttypes.h>
-#include <sys/types.h>
-
-#include "macro.h"
+#include "forward.h"
 
 uint32_t jenkins_hashword(const uint32_t *k, size_t length, uint32_t initval) _pure_;
 void jenkins_hashword2(const uint32_t *k, size_t length, uint32_t *pc, uint32_t *pb);
index 49e1e5fc81415205d123340e23474a8bbca359f5..2c2f6c677d35763c381b443c6ef7d29b302be82e 100644 (file)
@@ -1,6 +1,5 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
-#include <errno.h>
 #include <stdlib.h>
 #include <sys/mman.h>
 
@@ -11,7 +10,6 @@
 #include "hashmap.h"
 #include "list.h"
 #include "log.h"
-#include "macro.h"
 #include "memory-util.h"
 #include "mmap-cache.h"
 #include "sigbus.h"
index 3e088ef8ef8fedee5d39baf070d9e501bf5f8646..bdd34945890546242db264cf0767b973fd206ad1 100644 (file)
@@ -1,12 +1,8 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 #pragma once
 
-#include <errno.h>
-#include <stdbool.h>
-#include <sys/stat.h>
-
+#include "forward.h"
 #include "journal-def.h"
-#include "memory-util.h"
 
 typedef struct MMapCache MMapCache;
 typedef struct MMapFileDescriptor MMapFileDescriptor;
index b6d3a7f627756e1abfde509082d7a7229de88831..8ec1fe450c36d0a9fb79e356870090b4b32938f3 100644 (file)
@@ -1,11 +1,8 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
-#include <errno.h>
 #include <fcntl.h>
-#include <inttypes.h>
-#include <linux/magic.h>
 #include <poll.h>
-#include <stddef.h>
+#include <stdlib.h>
 #include <sys/inotify.h>
 #include <sys/vfs.h>
 #include <unistd.h>
 
 #include "alloc-util.h"
 #include "catalog.h"
-#include "compress.h"
 #include "dirent-util.h"
 #include "env-file.h"
 #include "escape.h"
+#include "extract-word.h"
 #include "fd-util.h"
 #include "fileio.h"
 #include "format-util.h"
-#include "fs-util.h"
 #include "hashmap.h"
 #include "hostname-util.h"
 #include "id128-util.h"
 #include "journal-file.h"
 #include "journal-internal.h"
 #include "list.h"
+#include "log.h"
 #include "lookup3.h"
 #include "nulstr-util.h"
 #include "origin-id.h"
 #include "path-util.h"
 #include "prioq.h"
-#include "process-util.h"
 #include "replace-var.h"
+#include "set.h"
 #include "sort-util.h"
 #include "stat-util.h"
 #include "stdio-util.h"
 #include "string-util.h"
 #include "strv.h"
 #include "syslog-util.h"
+#include "time-util.h"
 #include "uid-classification.h"
 
 #define JOURNAL_FILES_RECHECK_USEC (2 * USEC_PER_SEC)
index ee8bd4e0ec4204a4584081090dab4b312796f79d..d86fd533f7bcd4d0d2d8300c831216a343755f70 100644 (file)
@@ -1,7 +1,5 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
-#include <errno.h>
-#include <fcntl.h>
 #include <locale.h>
 #include <unistd.h>
 
@@ -10,12 +8,8 @@
 #include "alloc-util.h"
 #include "catalog.h"
 #include "fd-util.h"
-#include "fs-util.h"
+#include "hashmap.h"
 #include "log.h"
-#include "macro.h"
-#include "path-util.h"
-#include "string-util.h"
-#include "strv.h"
 #include "tests.h"
 #include "tmpfile-util.h"
 
index ff4f86329b8ea0fde7997d476d529836f5260ac0..6530cdae8fa79b1c76c5351edd6b78aaa3a9e126 100644 (file)
@@ -6,8 +6,6 @@
 #include <unistd.h>
 
 #include "chattr-util.h"
-#include "fd-util.h"
-#include "fs-util.h"
 #include "iovec-util.h"
 #include "journal-file-util.h"
 #include "log.h"
@@ -15,9 +13,8 @@
 #include "parse-util.h"
 #include "random-util.h"
 #include "rm-rf.h"
-#include "strv.h"
-#include "terminal-util.h"
 #include "tests.h"
+#include "time-util.h"
 #include "tmpfile-util.h"
 
 static int journal_append_message(JournalFile *mj, const char *message) {
index d101fe76f214e95f27aa843d1ef178c35a957bb8..cc17ea189186685fa9ac23faa05e842704a36c1b 100644 (file)
@@ -4,9 +4,6 @@
 
 #include "sd-journal.h"
 
-#include "journal-internal.h"
-#include "log.h"
-#include "macro.h"
 #include "tests.h"
 
 int main(int argc, char *argv[]) {
index 729de1fe52d6b2eba826fffe7e998cefbe9c4e44..52b1328fb08e9c62fed9ba7c54fd47362bd4b2be 100644 (file)
@@ -1,12 +1,9 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
-#include <errno.h>
-#include <stdlib.h>
 #include <unistd.h>
 
 #include "journal-file.h"
 #include "tests.h"
-#include "user-util.h"
 
 static void test_journal_file_parse_uid_from_filename_simple(
                 const char *path,
index 05252d7f096ef9f2ce291d4a844f1eb2378df093..ef5acca9c0c93f467917f65be47ba9672e7b56d1 100644 (file)
@@ -1,7 +1,7 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
 #include <fcntl.h>
-#include <unistd.h>
+#include <stdlib.h>
 
 #include "sd-journal.h"
 
 #include "journal-file-util.h"
 #include "journal-internal.h"
 #include "logs-show.h"
-#include "macro.h"
 #include "output-mode.h"
 #include "path-util.h"
 #include "rm-rf.h"
 #include "string-util.h"
 #include "strv.h"
 #include "tests.h"
+#include "time-util.h"
 #include "tmpfile-util.h"
 
 static int open_archive_file(sd_journal **ret) {
index 45663b0dbec6444a2d25d257e3ef60bb225a6910..7f7e12fbdd904a7ee90f49bc77f34e86aef7fc19 100644 (file)
@@ -1,5 +1,6 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
+#include <stdlib.h>
 #include <unistd.h>
 
 #include "sd-journal.h"
index 9703f46c429423bff97e96df7e42442aa9ef8760..d5d6506a44c70f74e63ce35faa47b70843844970 100644 (file)
@@ -19,6 +19,7 @@
 #include "rm-rf.h"
 #include "strv.h"
 #include "tests.h"
+#include "time-util.h"
 #include "tmpfile-util.h"
 
 /* This program tests skipping around in a multi-file journal. */
index c2c345fb07fee81910bdc0757c8bdafc7dced675..2b3886445de86ff033aa5a2444112b149c171449 100644 (file)
@@ -6,8 +6,6 @@
 
 #include "alloc-util.h"
 #include "journal-internal.h"
-#include "log.h"
-#include "string-util.h"
 #include "tests.h"
 
 int main(int argc, char *argv[]) {
index ca1fe7c303055e645cf712a758fbb36142c00156..e4959521f6ac577083b9535879aadca3a8fc0d82 100644 (file)
@@ -1,6 +1,5 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
-#include <errno.h>
 #include <stdlib.h>
 #include <unistd.h>
 
@@ -8,8 +7,6 @@
 
 #include "fileio.h"
 #include "journal-send.h"
-#include "macro.h"
-#include "memory-util.h"
 #include "tests.h"
 
 TEST(journal_print) {
index c8103bf113a2798dc12cf15981b42b07c74999e5..512ec132ef6ef3eb648e9866fe4548648ea2f992 100644 (file)
 #include "journal-file-util.h"
 #include "journal-internal.h"
 #include "log.h"
-#include "macro.h"
 #include "parse-util.h"
 #include "rm-rf.h"
 #include "tests.h"
+#include "time-util.h"
 
 #define N_ENTRIES 200
 
index 9bf4f86258735da0b40a1ad0bcb250979974670a..bc66a96aee008190a964fe9fe1d1fcf89f6c55a8 100644 (file)
@@ -2,6 +2,7 @@
 
 #include <fcntl.h>
 #include <stdio.h>
+#include <sys/stat.h>
 #include <unistd.h>
 
 #include "ansi-color.h"
@@ -13,9 +14,8 @@
 #include "log.h"
 #include "mmap-cache.h"
 #include "rm-rf.h"
-#include "strv.h"
-#include "terminal-util.h"
 #include "tests.h"
+#include "time-util.h"
 
 #define N_ENTRIES 6000
 #define RANDOM_RANGE 77
index 6f6aa9d275193daf2ff0f9738c8e9f08b2dc4809..fb0a02d9bfbbf113a55a84597a2cd7a85a2102cc 100644 (file)
@@ -12,6 +12,7 @@
 #include "log.h"
 #include "rm-rf.h"
 #include "tests.h"
+#include "time-util.h"
 
 static bool arg_keep = false;
 
index ce5ea123c689d9e7c1d271824c137388315ba608..dc7e334247836986aaa31a196d76b0c0478e36d2 100644 (file)
@@ -1,12 +1,9 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
-#include <fcntl.h>
-#include <stdlib.h>
 #include <sys/mman.h>
 #include <unistd.h>
 
 #include "fd-util.h"
-#include "macro.h"
 #include "mmap-cache.h"
 #include "tests.h"
 #include "tmpfile-util.h"
index 9ecdd6bb1a152763fbe6a76183ff4ba171efda3e..d42d1c6be5b992eaa822edb50581bbc399956c83 100644 (file)
@@ -2,11 +2,7 @@
 
 #pragma once
 
-#include <stdbool.h>
-
-#include "sd-json.h"
-
-#include "macro.h"
+#include "forward.h"
 
 /* This header should include all prototypes only the JSON parser itself and
  * its tests need access to. Normal code consuming the JSON parser should not
index a4beb54cba5518e4fa608b6e1c67b04e55adb373..2c7f3240b6150972e2b84e7db7aeffd5a91d0ee4 100644 (file)
@@ -1,5 +1,6 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
+#include <netinet/in.h>
 #include <sys/sysmacros.h>
 
 #include "alloc-util.h"
@@ -8,15 +9,16 @@
 #include "errno-util.h"
 #include "fd-util.h"
 #include "glyph-util.h"
-#include "in-addr-util.h"
 #include "iovec-util.h"
 #include "json-util.h"
 #include "log.h"
 #include "mountpoint-util.h"
 #include "parse-util.h"
 #include "path-util.h"
+#include "pidref.h"
 #include "process-util.h"
 #include "stat-util.h"
+#include "stdio-util.h"
 #include "string-util.h"
 #include "strv.h"
 #include "syslog-util.h"
index 861c1876ff10057951840751d8ca6d681281cdd5..0d0f41bf37822bd499e547ac721c010d6c5966e1 100644 (file)
@@ -5,9 +5,9 @@
 
 #include "sd-json.h"
 
+#include "forward.h"
 #include "log.h"
-#include "macro.h"
-#include "pidref.h"
+#include "string-util.h"
 
 #define JSON_VARIANT_REPLACE(v, q)        \
         do {                              \
index 03f94ce663ecd166f8ab6f8cc99f287711e22938..9add7be9a881e7d9454034bf9e9e9ed1f8e5ec95 100644 (file)
@@ -1,10 +1,7 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
-#include <errno.h>
 #include <locale.h>
-#include <stdarg.h>
 #include <stdlib.h>
-#include <sys/types.h>
 
 #include "sd-json.h"
 #include "sd-messages.h"
 #include "errno-util.h"
 #include "escape.h"
 #include "ether-addr-util.h"
-#include "fd-util.h"
 #include "fileio.h"
 #include "float.h"
-#include "glyph-util.h"
 #include "hexdecoct.h"
 #include "in-addr-util.h"
-#include "iovec-util.h"
 #include "json-internal.h"
 #include "json-util.h"
 #include "log.h"
-#include "macro.h"
 #include "math-util.h"
 #include "memory-util.h"
 #include "memstream-util.h"
 #include "ordered-set.h"
 #include "parse-util.h"
-#include "path-util.h"
-#include "process-util.h"
+#include "pidref.h"
 #include "ratelimit.h"
-#include "set.h"
 #include "signal-util.h"
 #include "string-table.h"
 #include "string-util.h"
 #include "strv.h"
 #include "terminal-util.h"
+#include "time-util.h"
 #include "user-util.h"
 #include "utf8.h"
 
index cf5f39b90ac6af9b3a7fa2769c478a1fe90821c3..efe40c70f5b6db7236b79c2cec4f2db01be76aa0 100644 (file)
@@ -1,6 +1,5 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
-#include <errno.h>
 #include <poll.h>
 #include <sys/inotify.h>
 #include <unistd.h>
 #include "fs-util.h"
 #include "hostname-util.h"
 #include "io-util.h"
-#include "log.h"
 #include "login-util.h"
-#include "macro.h"
 #include "parse-util.h"
 #include "path-util.h"
 #include "pidfd-util.h"
-#include "process-util.h"
+#include "pidref.h"
 #include "socket-util.h"
-#include "stdio-util.h"
 #include "string-util.h"
 #include "strv.h"
 #include "user-util.h"
index f7dab9b72363d3c1058ed663cf9dbe0d97a4c69b..a4ab2659b21e290f25d007c6e741d2b06b2ce79d 100644 (file)
@@ -1,9 +1,7 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
 #include <poll.h>
-#if HAVE_PIDFD_OPEN
-#include <sys/pidfd.h>
-#endif
+#include <sys/socket.h>
 
 #include "sd-login.h"
 
@@ -13,8 +11,7 @@
 #include "fd-util.h"
 #include "format-util.h"
 #include "log.h"
-#include "missing_syscall.h"
-#include "mountpoint-util.h"
+#include "pidfd-util.h"
 #include "process-util.h"
 #include "string-util.h"
 #include "strv.h"
index a388a199a96d6fd08b677f9e656aba94533a7c22..1153fb0965a16a1c150f4e11e4106e6ef9aeafcc 100644 (file)
@@ -3,11 +3,13 @@
 #include "sd-login.h"
 
 #include "alloc-util.h"
+#include "errno-util.h"
 #include "format-util.h"
+#include "log.h"
 #include "main-func.h"
 #include "parse-util.h"
+#include "string-util.h"
 #include "strv.h"
-#include "tests.h"
 
 static const char *arg_verb = NULL;  /* NULL means all */
 static pid_t arg_pid = 0;            /* 0 == self */
index 9c31105772f0ec460d80f3313ee294b54831d733..d4d33ae52da15e4cb4eb36b18a210f707cdce0fd 100644 (file)
@@ -5,10 +5,12 @@
 #include "sd-netlink.h"
 
 #include "alloc-util.h"
+#include "hashmap.h"
 #include "log.h"
 #include "netlink-genl.h"
 #include "netlink-internal.h"
 #include "netlink-types.h"
+#include "string-util.h"
 
 typedef struct GenericNetlinkFamily {
         sd_netlink *genl;
index b06be05952d7856576ec336b97f61428a3d5c15b..ea9135ac32a00b10ac7473bedfb5e7f0a489ea6b 100644 (file)
@@ -1,7 +1,7 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 #pragma once
 
-#include "sd-netlink.h"
+#include "forward.h"
 
 #define CTRL_GENL_NAME "nlctrl"
 
index 7346902bdc92058ee817f7c762bb4a5502f2ff32..625b73263a8202c750202327030eaa10698e0617 100644 (file)
@@ -2,14 +2,11 @@
 #pragma once
 
 #include <linux/netlink.h>
+#include <sys/socket.h>
 
-#include "sd-netlink.h"
-
+#include "forward.h"
 #include "list.h"
 #include "netlink-types.h"
-#include "ordered-set.h"
-#include "prioq.h"
-#include "time-util.h"
 
 #define NETLINK_DEFAULT_TIMEOUT_USEC ((usec_t) (25 * USEC_PER_SEC))
 
@@ -40,7 +37,7 @@ typedef enum NetlinkSlotType {
         _NETLINK_SLOT_INVALID = -EINVAL,
 } NetlinkSlotType;
 
-struct sd_netlink_slot {
+typedef struct sd_netlink_slot {
         unsigned n_ref;
         NetlinkSlotType type:8;
         bool floating;
@@ -56,9 +53,9 @@ struct sd_netlink_slot {
                 struct reply_callback reply_callback;
                 struct match_callback match_callback;
         };
-};
+} sd_netlink_slot;
 
-struct sd_netlink {
+typedef struct sd_netlink {
         unsigned n_ref;
 
         int fd;
@@ -98,7 +95,7 @@ struct sd_netlink {
 
         Hashmap *genl_family_by_name;
         Hashmap *genl_family_by_id;
-};
+} sd_netlink;
 
 struct netlink_attribute {
         size_t offset; /* offset from hdr to attribute */
@@ -113,7 +110,7 @@ struct netlink_container {
         uint16_t max_attribute; /* the maximum attribute in container */
 };
 
-struct sd_netlink_message {
+typedef struct sd_netlink_message {
         unsigned n_ref;
 
         int protocol;
@@ -125,7 +122,7 @@ struct sd_netlink_message {
         bool sealed:1;
 
         sd_netlink_message *next; /* next in a chain of multi-part messages */
-};
+} sd_netlink_message;
 
 int message_new_empty(sd_netlink *nl, sd_netlink_message **ret);
 int message_new_full(
@@ -138,10 +135,7 @@ int message_new_full(
 int message_new(sd_netlink *nl, sd_netlink_message **ret, uint16_t type, uint16_t flags);
 int message_new_synthetic_error(sd_netlink *nl, int error, uint32_t serial, sd_netlink_message **ret);
 
-static inline uint32_t message_get_serial(sd_netlink_message *m) {
-        assert(m);
-        return ASSERT_PTR(m->hdr)->nlmsg_seq;
-}
+uint32_t message_get_serial(sd_netlink_message *m);
 
 void message_seal(sd_netlink_message *m);
 
index 321b9b2006dd0d8dc412adc9b56444d171a86576..d33a690e36db09bc6fe7e240f3a8f14aaf3aa898 100644 (file)
@@ -3,15 +3,14 @@
 #include <linux/netfilter.h>
 #include <linux/netfilter/nf_tables.h>
 #include <linux/netfilter/nfnetlink.h>
-#include <netinet/in.h>
 
 #include "sd-netlink.h"
 
 #include "alloc-util.h"
+#include "errno-util.h"
 #include "iovec-util.h"
 #include "log.h"
 #include "netlink-internal.h"
-#include "netlink-types.h"
 #include "netlink-util.h"
 
 bool nfproto_is_valid(int nfproto) {
index b730b63fb02ef3148ff03fb5696656aa2de0b87b..ee6bba8d03a7c05694834faae7f3b61e2a8651ef 100644 (file)
@@ -4,18 +4,11 @@
 #include <linux/if_addrlabel.h>
 #include <linux/if_bridge.h>
 #include <linux/nexthop.h>
-#include <netinet/in.h>
-#include <stdbool.h>
-#include <unistd.h>
 
 #include "sd-netlink.h"
 
-#include "format-util.h"
-#include "log.h"
+#include "in-addr-util.h"
 #include "netlink-internal.h"
-#include "netlink-types.h"
-#include "netlink-util.h"
-#include "socket-util.h"
 
 static bool rtnl_message_type_is_neigh(uint16_t type) {
         return IN_SET(type, RTM_NEWNEIGH, RTM_GETNEIGH, RTM_DELNEIGH);
index 76617b686d1daa4d4d38cd30bb0e744d8c25ddc7..e55b0f0da5efec1515febe765bfad20afb684f51 100644 (file)
@@ -1,19 +1,18 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
 #include <netinet/in.h>
-#include <stdbool.h>
-#include <unistd.h>
 
 #include "sd-netlink.h"
 
 #include "alloc-util.h"
-#include "format-util.h"
+#include "ether-addr-util.h"
 #include "log.h"
 #include "memory-util.h"
 #include "netlink-internal.h"
 #include "netlink-types.h"
 #include "netlink-util.h"
 #include "socket-util.h"
+#include "string-util.h"
 #include "strv.h"
 
 #define GET_CONTAINER(m, i) ((struct rtattr*)((uint8_t*)(m)->hdr + (m)->containers[i].offset))
@@ -112,6 +111,11 @@ int message_new_synthetic_error(sd_netlink *nl, int error, uint32_t serial, sd_n
         return 0;
 }
 
+uint32_t message_get_serial(sd_netlink_message *m) {
+        assert(m);
+        return ASSERT_PTR(m->hdr)->nlmsg_seq;
+}
+
 int sd_netlink_message_set_request_dump(sd_netlink_message *m, int dump) {
         assert_return(m, -EINVAL);
         assert_return(m->hdr, -EINVAL);
index 145c376ca46dab820162a874e87004aced9e9d57..f1e270de6acb59584f3be3d7c3449f353f2a9c64 100644 (file)
@@ -1,13 +1,12 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
-#include <errno.h>
-
 #include "sd-netlink.h"
 
 #include "alloc-util.h"
-#include "log.h"
+#include "hashmap.h"
 #include "netlink-internal.h"
 #include "netlink-slot.h"
+#include "prioq.h"
 #include "string-util.h"
 
 int netlink_slot_allocate(
index 4098061d31fa14567ecd1752b15b99fc2941742a..9ed1746b61912e484a5b1ec0c1d42d96abca8a9d 100644 (file)
@@ -1,10 +1,7 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 #pragma once
 
-#include <stdbool.h>
-
-#include "sd-netlink.h"
-
+#include "forward.h"
 #include "netlink-internal.h"
 
 int netlink_slot_allocate(
index 0ed222ea200aee3f6c344f0ac32863af3575cbf7..177be0c2bc84688468fd84946b15bf936a66a855 100644 (file)
@@ -5,7 +5,6 @@
 
 #include "netlink-internal.h"
 #include "netlink-sock-diag.h"
-#include "netlink-util.h"
 
 int sd_sock_diag_socket_open(sd_netlink **ret) {
         return netlink_open_family(ret, NETLINK_SOCK_DIAG);
index 043913889c80d5da52fb423acb6b6971dc2e4c19..e12e55a285935426b4cabc5c87c08cdbcc113764 100644 (file)
@@ -1,8 +1,6 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 #pragma once
 
-#include <sys/types.h>
-
 #include "sd-netlink.h"
 
 /* TODO: to be exported later */
index 0f00e3f2fcc21ada04ae26800b0b07dbd7be2e8e..28fd2bc3d9b03b537dadf552019fd497091c04c4 100644 (file)
@@ -1,19 +1,15 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
-#include <malloc.h>
-#include <netinet/in.h>
-#include <stdbool.h>
-#include <unistd.h>
-
 #include "sd-netlink.h"
 
 #include "alloc-util.h"
-#include "fd-util.h"
-#include "format-util.h"
+#include "errno-util.h"
+#include "hashmap.h"
 #include "iovec-util.h"
 #include "log.h"
 #include "netlink-internal.h"
 #include "netlink-types.h"
+#include "ordered-set.h"
 #include "socket-util.h"
 
 static int broadcast_groups_get(sd_netlink *nl) {
index ebb091b90fb90940d5cd0fafcf198945b34ac895..422ae7e6910bffae3f693a69051cba34453b7341 100644 (file)
@@ -4,12 +4,12 @@
 #include <linux/fou.h>
 #include <linux/genetlink.h>
 #include <linux/if.h>
+#include <linux/if_ether.h>
 #include <linux/if_macsec.h>
 #include <linux/l2tp.h>
 #include <linux/nl80211.h>
 #include <linux/wireguard.h>
 #include <netinet/in.h>
-#include <sys/socket.h>
 
 #include "missing_network.h"
 #include "netlink-genl.h"
index 1412514f9ba77362e17d021dd417ef72ec929e7a..d634098eba165115c72625a3c88fdecd79cca1d0 100644 (file)
@@ -1,7 +1,6 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 #pragma once
 
-#include "macro.h"
 #include "netlink-types.h"
 
 /* C.f. see 'struct nla_policy' at include/net/netlink.h. */
index 8ef4d45d42680859dadc816682307a3d8bc602c9..289040935bdd84bf796574fda2a301affc32257a 100644 (file)
@@ -3,6 +3,7 @@
 #include <linux/if.h>
 #include <linux/netfilter/nf_tables.h>
 #include <linux/netfilter/nfnetlink.h>
+#include <linux/netlink.h>
 
 #include "netlink-types-internal.h"
 
index 7af44ab14480ab4bafce0287130fd4564e8100a5..4dc98f0504e343a0f2b13b610a776e8ec8fe58d2 100644 (file)
@@ -5,24 +5,17 @@
 #include <linux/can/vxcan.h>
 #include <linux/cfm_bridge.h>
 #include <linux/fib_rules.h>
-#include <linux/fou.h>
 #include <linux/if.h>
 #include <linux/if_addr.h>
 #include <linux/if_addrlabel.h>
 #include <linux/if_bridge.h>
 #include <linux/if_link.h>
-#include <linux/if_macsec.h>
 #include <linux/if_tunnel.h>
-#include <linux/ip.h>
-#include <linux/l2tp.h>
 #include <linux/net_namespace.h>
-#include <linux/netlink.h>
 #include <linux/nexthop.h>
-#include <linux/nl80211.h>
 #include <linux/pkt_sched.h>
 #include <linux/rtnetlink.h>
 #include <linux/veth.h>
-#include <linux/wireguard.h>
 #include <netinet/in.h>
 #include <sys/socket.h>
 
index 146f4177fde30ceec15858a26aae058fbdf07953..6b72efb86bc08e97f207c174c246ab1d5cb8f393 100644 (file)
@@ -1,9 +1,9 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
+#include <linux/netlink.h>
 #include <linux/sock_diag.h>
 #include <linux/unix_diag.h>
 
-#include "missing_network.h"
 #include "netlink-types-internal.h"
 #include "netlink-types.h"
 
index e10a90c5aadbec81382beda22779099823868139..c9951a040e745fd2ed4f41da1c371b214da869a3 100644 (file)
@@ -2,9 +2,9 @@
 
 #include <linux/netlink.h>
 
-#include "netlink-genl.h"
 #include "netlink-internal.h"
 #include "netlink-types-internal.h"
+#include "string-util.h"
 
 static const NLAPolicy empty_policies[1] = {
         /* fake array to avoid .types==NULL, which denotes invalid type-systems */
index 85ff925edd41571d79cb6d9eb8014ea466b89388..99d1246ef6dccae7711065863e571d77741745b4 100644 (file)
@@ -1,9 +1,7 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 #pragma once
 
-#include <errno.h>
-
-#include "sd-netlink.h"
+#include "forward.h"
 
 typedef enum NLAType {
         NETLINK_TYPE_UNSPEC,                    /* NLA_UNSPEC */
index 2a561827509f77eb027d96d20c885c80ac7ab466..3cb5820ff612866c8235aaa10dc0607b909a37db 100644 (file)
@@ -2,7 +2,9 @@
 
 #include "sd-netlink.h"
 
+#include "ether-addr-util.h"
 #include "fd-util.h"
+#include "hashmap.h"
 #include "iovec-util.h"
 #include "log.h"
 #include "memory-util.h"
@@ -10,6 +12,8 @@
 #include "netlink-util.h"
 #include "parse-util.h"
 #include "process-util.h"
+#include "socket-util.h"
+#include "string-util.h"
 #include "strv.h"
 
 static int parse_newlink_message(
index 25b27291bac869db9a0e3d282e943ee89455e377..a25e38d4732437d6ed57eec5f193f74437613064 100644 (file)
@@ -3,12 +3,8 @@
 
 #include <linux/rtnetlink.h>
 
-#include "sd-netlink.h"
-
-#include "ether-addr-util.h"
+#include "forward.h"
 #include "in-addr-util.h"
-#include "ordered-set.h"
-#include "socket-util.h"
 
 #define RTA_FLAGS(rta) ((rta)->rta_type & ~NLA_TYPE_MASK)
 #define RTA_TYPE(rta)  ((rta)->rta_type & NLA_TYPE_MASK)
index d71a1c579c2ae0e62c2a4307d868ff03f290c6d0..57e5a652149d9c45ff019541f90fdc0b57a67d8c 100644 (file)
@@ -1,22 +1,28 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
+#include <linux/filter.h>
 #include <poll.h>
+#include <stdlib.h>
 
+#include "sd-event.h"
 #include "sd-netlink.h"
 
 #include "alloc-util.h"
+#include "errno-util.h"
 #include "fd-util.h"
 #include "hashmap.h"
 #include "io-util.h"
 #include "log.h"
-#include "macro.h"
 #include "netlink-genl.h"
 #include "netlink-internal.h"
 #include "netlink-slot.h"
 #include "netlink-util.h"
+#include "ordered-set.h"
+#include "prioq.h"
 #include "process-util.h"
 #include "socket-util.h"
 #include "string-util.h"
+#include "time-util.h"
 
 /* Some really high limit, to catch programming errors */
 #define REPLY_CALLBACKS_MAX UINT16_MAX
@@ -68,7 +74,7 @@ static int netlink_new(sd_netlink **ret) {
 
 int sd_netlink_open_fd(sd_netlink **ret, int fd) {
         _cleanup_(sd_netlink_unrefp) sd_netlink *nl = NULL;
-        int r, protocol;
+        int r, protocol = 0; /* Avoid maybe-uninitialized false positive */
 
         assert_return(ret, -EINVAL);
         assert_return(fd >= 0, -EBADF);
index 252bb46b6efed58306cc413025cd5a9cd75b2b06..ae29b438df49b259054affced0dfdd1f0cec3788 100644 (file)
@@ -6,27 +6,27 @@
 #include <linux/l2tp.h>
 #include <linux/nl80211.h>
 #include <linux/unix_diag.h>
+#include <net/ethernet.h>
 #include <net/if.h>
-#include <netinet/ether.h>
 #include <netinet/in.h>
 #include <sys/stat.h>
 #include <unistd.h>
 
+#include "sd-event.h"
 #include "sd-netlink.h"
 
 #include "alloc-util.h"
-#include "ether-addr-util.h"
 #include "fd-util.h"
-#include "macro.h"
+#include "missing_network.h"
 #include "netlink-genl.h"
 #include "netlink-internal.h"
 #include "netlink-sock-diag.h"
 #include "netlink-util.h"
 #include "socket-util.h"
 #include "stdio-util.h"
-#include "string-util.h"
 #include "strv.h"
 #include "tests.h"
+#include "time-util.h"
 
 TEST(message_newlink_bridge) {
         _cleanup_(sd_netlink_unrefp) sd_netlink *rtnl = NULL;
index 80b4cc3cd61a2550b8c9ca1eeef95f3bc8403bcf..84ae36ad367cc5b7e92b098a77aa74dc71099a35 100644 (file)
@@ -1,12 +1,10 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 #pragma once
 
-#include <errno.h>
-#include <netinet/in.h>
-#include <stdbool.h>
+#include <sys/socket.h>
 
 #include "constants.h"
-#include "macro.h"
+#include "forward.h"
 
 #define NETWORK_DIRS ((const char* const*) CONF_PATHS_STRV("systemd/network"))
 #define NETWORK_DIRS_NULSTR CONF_PATHS_NULSTR("systemd/network")
index 60213c2fcf5adac27246e02972a27b852e16d441..9d95f8b5be279a532f84250bc6d90a62ec59d1de 100644 (file)
@@ -1,8 +1,9 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
-#include <errno.h>
 #include <poll.h>
 #include <sys/inotify.h>
+#include <sys/stat.h>
+#include <unistd.h>
 
 #include "sd-network.h"
 
@@ -11,9 +12,7 @@
 #include "errno-util.h"
 #include "extract-word.h"
 #include "fd-util.h"
-#include "fs-util.h"
 #include "inotify-util.h"
-#include "macro.h"
 #include "parse-util.h"
 #include "stdio-util.h"
 #include "string-util.h"
index a3b09208cb3f8a819270966677d8d600f8d235e8..3ddbda0e9f80561c86baa7f04f7b392470bbebbb 100644 (file)
@@ -1,21 +1,16 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
-#include <errno.h>
-#include <stdio.h>
 #include <stdlib.h>
 
 #include "alloc-util.h"
 #include "fs-util.h"
 #include "log.h"
-#include "macro.h"
-#include "nulstr-util.h"
 #include "path-lookup.h"
 #include "path-util.h"
 #include "stat-util.h"
 #include "string-util.h"
 #include "strv.h"
 #include "tmpfile-util.h"
-#include "user-util.h"
 
 int user_search_dirs(const char *suffix, char ***ret_config_dirs, char ***ret_data_dirs) {
         _cleanup_strv_free_ char **config_dirs = NULL, **data_dirs = NULL;
index 1289e7ac6fc34569ef70dd775013b1de7e932252..84570533394fa91aa0b2c66bf83e594dd2e85eb1 100644 (file)
@@ -1,10 +1,9 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 #pragma once
 
-#include <stdbool.h>
-
 #include "sd-path.h"
 
+#include "forward.h"
 #include "runtime-scope.h"
 
 typedef enum LookupPathsFlags {
index b8fd0ae0a78888e271f39e85d436ddfec02c59ba..f562e3a7ecbbb8f42495f8700aaeae762aee5e61 100644 (file)
@@ -1,5 +1,7 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
+#include <stdlib.h>
+
 #include "sd-path.h"
 
 #include "alloc-util.h"
@@ -7,7 +9,6 @@
 #include "fd-util.h"
 #include "fileio.h"
 #include "fs-util.h"
-#include "log.h"
 #include "network-util.h"
 #include "nulstr-util.h"
 #include "path-lookup.h"
index 81052e7ec1ca0aee672ab6511bb5e59bc355ca1b..03ebfbb02cd22289915efbabb0438b5c95a60e4a 100644 (file)
@@ -1,18 +1,15 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
-#include <errno.h>
+#include <netdb.h>
 #include <poll.h>
 #include <pthread.h>
-#include <resolv.h>
 #include <signal.h>
-#include <stdint.h>
 #include <stdio.h>
-#include <stdlib.h>
 #include <string.h>
-#include <sys/prctl.h>
 #include <threads.h>
 #include <unistd.h>
 
+#include "sd-event.h"
 #include "sd-resolve.h"
 
 #include "alloc-util.h"
@@ -24,7 +21,6 @@
 #include "list.h"
 #include "log.h"
 #include "memory-util.h"
-#include "missing_syscall.h"
 #include "process-util.h"
 #include "resolve-private.h"
 #include "socket-util.h"
index 7a599925f4c51448ef88725fc6ae9fd3a91ce780..18e29d9835e7e4d0ff34cf90a194fefb8f8aeb8d 100644 (file)
@@ -1,16 +1,14 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
 #include <arpa/inet.h>
-#include <errno.h>
-#include <net/if_arp.h>
+#include <netdb.h>
 #include <netinet/in.h>
-#include <resolv.h>
 #include <stdio.h>
+#include <stdlib.h>
 
 #include "sd-resolve.h"
 
 #include "alloc-util.h"
-#include "macro.h"
 #include "socket-util.h"
 #include "string-util.h"
 #include "tests.h"
index 1184bd5951cd5ca7d6f785d09f9720c1c35115a1..c0afc8c4e71f0e9afe5a6d813841e1130704e359 100644 (file)
@@ -4,12 +4,13 @@
 
 #include "alloc-util.h"
 #include "ansi-color.h"
+#include "extract-word.h"
 #include "json-util.h"
 #include "log.h"
 #include "memstream-util.h"
 #include "set.h"
+#include "string-util.h"
 #include "strv.h"
-#include "terminal-util.h"
 #include "utf8.h"
 #include "varlink-idl-util.h"
 
index d20b36704fb8f27f0e21adfd39da2e868054c8ca..3255bf8ed3770a729ec1ccf26b798811a9e5356a 100644 (file)
@@ -1,16 +1,20 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
-#include <malloc.h>
 #include <poll.h>
+#include <stdlib.h>
+#include <unistd.h>
 
 #include "sd-daemon.h"
+#include "sd-event.h"
 #include "sd-varlink.h"
 
 #include "alloc-util.h"
 #include "errno-list.h"
 #include "errno-util.h"
 #include "escape.h"
+#include "extract-word.h"
 #include "fd-util.h"
+#include "format-util.h"
 #include "glyph-util.h"
 #include "hashmap.h"
 #include "io-util.h"
@@ -21,7 +25,6 @@
 #include "mkdir.h"
 #include "path-util.h"
 #include "process-util.h"
-#include "set.h"
 #include "socket-util.h"
 #include "string-table.h"
 #include "string-util.h"
index 990eb804a976a3173c50d62640d58313a759da82..0640a269959b7cf8a390af9edfa8c90710cf560c 100644 (file)
@@ -4,7 +4,7 @@
 #include "sd-varlink.h"
 #include "sd-varlink-idl.h"
 
-#include "memory-util.h"
+#include "forward.h"
 
 bool varlink_idl_field_name_is_valid(const char *name);
 bool varlink_idl_symbol_name_is_valid(const char *name);
index 5ff233f210e785c05c4db1ab9241bea7dd993769..a163f81061d707427442668d38bdf059c385a978 100644 (file)
@@ -3,11 +3,10 @@
 
 #include <sys/socket.h>
 
-#include "sd-event.h"
 #include "sd-varlink.h"
 
-#include "hashmap.h"
 #include "list.h"
+#include "forward.h"
 
 typedef enum VarlinkState {
         /* Client side states */
index 438ef6bd7ad773134b5843074fb9f6891d413b99..dfefe08862860b7cd3572cbbde89c22356df8aa7 100644 (file)
@@ -3,8 +3,9 @@
 #include "alloc-util.h"
 #include "errno-util.h"
 #include "log.h"
+#include "pidref.h"
+#include "set.h"
 #include "string-util.h"
-#include "varlink-internal.h"
 #include "varlink-util.h"
 #include "version.h"
 
index 449b96276703ef694ea253eab6cfeb3725f2667c..3a340b221653d8260fac3a5dd6658c68c9fb7531 100644 (file)
@@ -3,8 +3,7 @@
 
 #include "sd-varlink.h"
 
-#include "pidref.h"
-#include "set.h"
+#include "forward.h"
 
 int varlink_get_peer_pidref(sd_varlink *v, PidRef *ret);
 
index 00537eaf16453b9615f9ba446d61f9385f455194..bf2e20e201132d49eb6f5d7eb08b152f37d0192d 100644 (file)
   along with systemd; If not, see <https://www.gnu.org/licenses/>.
 ***/
 
+#include <errno.h>
+#include <inttypes.h>
+#include <stdarg.h>
+#include <stddef.h>
+#include <stdint.h>
+#include <sys/types.h>
+
 /* This is a private header; never even think of including this directly! */
 
 #if defined(__INCLUDE_LEVEL__) && __INCLUDE_LEVEL__ <= 1 && !defined(__COVERITY__) && !defined(__clang_analyzer__)
index 4ab5cf674f930618de5a7dd982f39b69998a0811..5c11ca8ae5b7193768322f00e532305b74783da4 100644 (file)
@@ -17,9 +17,6 @@
   along with systemd; If not, see <https://www.gnu.org/licenses/>.
 ***/
 
-#include <stddef.h>
-#include <stdint.h>
-
 #include "_sd-common.h"
 #include "sd-bus-protocol.h"
 
index 77cb834121e37ccf8289cf4b3f664e50b5bcb900..8842aa63ec32d13e59dd2f195632b3f8b673373e 100644 (file)
   along with systemd; If not, see <https://www.gnu.org/licenses/>.
 ***/
 
-#include <inttypes.h>
-#include <stdarg.h>
 #include <stdio.h>
-#include <sys/types.h>
 #include <sys/uio.h>
 
 #include "_sd-common.h"
index a18a9211b90f06f1baefd85053e1be0e98bf06a3..932e8ea53e0da0c02d914f6731aa56a500ed7701 100644 (file)
@@ -17,9 +17,7 @@
   along with systemd; If not, see <https://www.gnu.org/licenses/>.
 ***/
 
-#include <inttypes.h>
 #include <sys/socket.h>
-#include <sys/types.h>
 
 #include "_sd-common.h"
 
index 71d8c89983b9293b2744a0ae5c23970d240bf9cf..05e977c5ce155edfc7b9b61d753a60e7dc34cd85 100644 (file)
   along with systemd; If not, see <https://www.gnu.org/licenses/>.
 ***/
 
-#include <errno.h>
-#include <inttypes.h>
 #include <sys/stat.h>
 #include <sys/sysmacros.h>
-#include <sys/types.h>
 
 #include "_sd-common.h"
 #include "sd-event.h"
index 404c01b1ebe9d6536028cdef578fa31a1c8c8f7a..21a237af0a978c65e6b37d51761de8a6f139d361 100644 (file)
   along with systemd; If not, see <https://www.gnu.org/licenses/>.
 ***/
 
-#include <inttypes.h>
-#include <sys/types.h>
-
 #include "_sd-common.h"
-#include "sd-dhcp-duid.h"
 
 _SD_BEGIN_DECLARATIONS;
 
 typedef struct sd_dhcp_client_id sd_dhcp_client_id;
+typedef struct sd_dhcp_duid sd_dhcp_duid;
 
 int sd_dhcp_client_id_new(sd_dhcp_client_id **ret);
 sd_dhcp_client_id* sd_dhcp_client_id_free(sd_dhcp_client_id *client_id);
index 0fb87e2684ab72387417841658cfffd8f39c19cd..4e288f08285449b568e83803f7e414fc56b6c36f 100644 (file)
   along with systemd; If not, see <https://www.gnu.org/licenses/>.
 ***/
 
-#include <inttypes.h>
-#include <net/ethernet.h>
-#include <netinet/in.h>
 #include <stdbool.h>
-#include <sys/types.h>
 
 #include "_sd-common.h"
-#include "sd-device.h"
-#include "sd-dhcp-client-id.h"
-#include "sd-dhcp-lease.h"
-#include "sd-dhcp-option.h"
-#include "sd-event.h"
 
 _SD_BEGIN_DECLARATIONS;
 
+struct in_addr;
+
+typedef struct sd_device sd_device;
+typedef struct sd_dhcp_client_id sd_dhcp_client_id;
+typedef struct sd_dhcp_lease sd_dhcp_lease;
+typedef struct sd_dhcp_option sd_dhcp_option;
+typedef struct sd_event sd_event;
+
 enum {
         SD_DHCP_CLIENT_EVENT_STOP               = 0,
         SD_DHCP_CLIENT_EVENT_IP_ACQUIRE         = 1,
index 555b40e9d8911e5199b99b1ca82500f9f8911187..6451c7fcaebc7bda5c5c83a7a0692987275530eb 100644 (file)
@@ -17,9 +17,6 @@
   along with systemd; If not, see <https://www.gnu.org/licenses/>.
 ***/
 
-#include <inttypes.h>
-#include <sys/types.h>
-
 #include "_sd-common.h"
 
 _SD_BEGIN_DECLARATIONS;
index fa5772019c738cab6bdce8c5fe26a7dfcd934930..4bdfb5bf2dda6757b6eb35f4ea3ad05e6b78307a 100644 (file)
   along with systemd; If not, see <https://www.gnu.org/licenses/>.
 ***/
 
-#include <errno.h>
-#include <inttypes.h>
-#include <net/ethernet.h>
-#include <netinet/in.h>
-#include <sys/types.h>
-
 #include "_sd-common.h"
-#include "sd-dhcp-client-id.h"
 
 _SD_BEGIN_DECLARATIONS;
 
+struct in_addr;
+struct in6_addr;
+
+typedef struct sd_dhcp_client_id sd_dhcp_client_id;
 typedef struct sd_dhcp_lease sd_dhcp_lease;
 typedef struct sd_dhcp_route sd_dhcp_route;
 typedef struct sd_dns_resolver sd_dns_resolver;
index 14141da1dba742540d30948ea9107f4835416de6..bfb5be8b2bdcf691950c0edc42b0e54a74d5f952 100644 (file)
   along with systemd; If not, see <https://www.gnu.org/licenses/>.
 ***/
 
-#include <inttypes.h>
-#include <sys/types.h>
-
 #include "_sd-common.h"
-#include "sd-dhcp-protocol.h"
+#include "sd-dhcp-protocol.h"   /* IWYU pragma: export */
 
 _SD_BEGIN_DECLARATIONS;
 
index 0ef4d132cfda5ed76416446b2ce3bb2de156385f..d6940ac7f8657ecb3fa36db401b511501227f837 100644 (file)
   along with systemd; If not, see <https://www.gnu.org/licenses/>.
 ***/
 
-#include <inttypes.h>
 #include <netinet/in.h>
 
 #include "_sd-common.h"
 #include "sd-dhcp-lease.h"
-#include "sd-dhcp-option.h"
-#include "sd-event.h"
 
 _SD_BEGIN_DECLARATIONS;
 
+typedef struct sd_event sd_event;
+typedef struct sd_dhcp_option sd_dhcp_option;
 typedef struct sd_dhcp_server sd_dhcp_server;
 
 enum {
index 6054dc44323196f38e2425e377597f8882889d32..b388acc137bbf74eb7e6b1c38a9e7259ec6f07d5 100644 (file)
   along with systemd; If not, see <https://www.gnu.org/licenses/>.
 ***/
 
-#include <inttypes.h>
-#include <net/ethernet.h>
-#include <sys/types.h>
-
 #include "_sd-common.h"
-#include "sd-device.h"
-#include "sd-dhcp-duid.h"
-#include "sd-dhcp6-lease.h"
-#include "sd-dhcp6-option.h"
-#include "sd-event.h"
 
 _SD_BEGIN_DECLARATIONS;
 
+struct in6_addr;
+
+typedef struct sd_dhcp_duid sd_dhcp_duid;
+typedef struct sd_dhcp6_option sd_dhcp6_option;
+typedef struct sd_dhcp6_lease sd_dhcp6_lease;
+typedef struct sd_device sd_device;
+typedef struct sd_event sd_event;
+
 enum {
         SD_DHCP6_CLIENT_EVENT_STOP                      = 0,
         SD_DHCP6_CLIENT_EVENT_RESEND_EXPIRE             = 10,
index 5d082b0cbe7d629246b7f95ceb782c884bd53426..766adf3121b70c075d6b91b2a66c091f6625e276 100644 (file)
   along with systemd; If not, see <https://www.gnu.org/licenses/>.
 ***/
 
-#include <inttypes.h>
-#include <netinet/in.h>
-#include <sys/types.h>
 
 #include "_sd-common.h"
-#include "sd-dhcp6-option.h"
 
 _SD_BEGIN_DECLARATIONS;
 
+struct in6_addr;
+
 typedef struct sd_dhcp6_lease sd_dhcp6_lease;
+typedef struct sd_dhcp6_option sd_dhcp6_option;
 typedef struct sd_dns_resolver sd_dns_resolver;
 
 int sd_dhcp6_lease_get_timestamp(sd_dhcp6_lease *lease, clockid_t clock, uint64_t *ret);
index 69f3eaa39de8b5cf671890a1fde9130243312274..b86441d93f710fd7de733d614fe936917d41b13e 100644 (file)
   along with systemd; If not, see <https://www.gnu.org/licenses/>.
 ***/
 
-#include <inttypes.h>
-#include <sys/types.h>
-
 #include "_sd-common.h"
-#include "sd-dhcp6-protocol.h"
+#include "sd-dhcp6-protocol.h"  /* IWYU pragma: export */
 
 _SD_BEGIN_DECLARATIONS;
 
index 4d89b3472c0e99289927ef856de36c8324ef19de..ac98b67da4509a771a4484ac030dddb57213d2e8 100644 (file)
   along with systemd; If not, see <https://www.gnu.org/licenses/>.
 ***/
 
-#include <inttypes.h>
 #include <signal.h>
 #include <sys/epoll.h>
 #include <sys/inotify.h>
 #include <sys/signalfd.h>
-#include <sys/types.h>
 #include <sys/wait.h>
 #include <time.h>
 
index 7be690400d12f9ae82b3771928924a5080e89647..da095a1e17fa6d54a071ce8b0345ee3edb38c877 100644 (file)
@@ -17,8 +17,6 @@
   along with systemd; If not, see <https://www.gnu.org/licenses/>.
 ***/
 
-#include <inttypes.h>
-#include <stdarg.h>
 #include <string.h>
 
 #include "_sd-common.h"
index 33879af5166bbee35c7c707269d42cee9390cc33..bcc5222aec14ccf43ba3d02b15f4ca83c35c446b 100644 (file)
   along with systemd; If not, see <https://www.gnu.org/licenses/>.
 ***/
 
-#include <net/ethernet.h>
-#include <netinet/in.h>
 #include <stdbool.h>
 
 #include "_sd-common.h"
-#include "sd-event.h"
 
 _SD_BEGIN_DECLARATIONS;
 
+struct ether_addr;
+struct in_addr;
+
+typedef struct sd_event sd_event;
+
 enum {
         SD_IPV4ACD_EVENT_STOP           = 0,
         SD_IPV4ACD_EVENT_BIND           = 1,
index 6c687fef20c0b75035c17f0b1bb347016dafade6..351cce0c2fc7299a0b96b4ef62ac58db86bfb478 100644 (file)
   along with systemd; If not, see <https://www.gnu.org/licenses/>.
 ***/
 
-#include <net/ethernet.h>
-#include <netinet/in.h>
-
 #include "_sd-common.h"
-#include "sd-event.h"
 
 _SD_BEGIN_DECLARATIONS;
 
+struct ether_addr;
+struct in_addr;
+
+typedef struct sd_event sd_event;
+
 enum {
         SD_IPV4LL_EVENT_STOP            = 0,
         SD_IPV4LL_EVENT_BIND            = 1,
index ca062ca681ee58a1ebc8521d7e6688de9c2b6500..ec1568904e57e07bd496d7165ab29c6e2011a0c2 100644 (file)
@@ -17,9 +17,6 @@
   along with systemd; If not, see <https://www.gnu.org/licenses/>.
 ***/
 
-#include <inttypes.h>
-#include <stdarg.h>
-#include <sys/types.h>
 #include <sys/uio.h>
 #include <syslog.h>
 
index 754ce73db8637da935f00dd8462d370d690dbf5d..fabec8a7a404d48cf7354ff805eecc220f1f5971 100644 (file)
   along with systemd; If not, see <https://www.gnu.org/licenses/>.
 ***/
 
-#include <errno.h>
 #include <fcntl.h>
-#include <inttypes.h>
-#include <stddef.h>
 #include <stdio.h>
 
 #include "_sd-common.h"
index d4e135512e76fbc5a00cf9a580b245c92c08e486..552ab813293d273fbf30caa1723c0a003e961cd7 100644 (file)
   along with systemd; If not, see <https://www.gnu.org/licenses/>.
 ***/
 
-#include <errno.h>
-#include <inttypes.h>
-#include <net/ethernet.h>
-#include <sys/types.h>
-
 #include "_sd-common.h"
-#include "sd-event.h"
-#include "sd-lldp.h"
+#include "sd-lldp.h"    /* IWYU pragma: export*/
 
 _SD_BEGIN_DECLARATIONS;
 
+struct ether_addr;
+
+typedef struct sd_event sd_event;
 typedef struct sd_lldp_rx sd_lldp_rx;
 typedef struct sd_lldp_neighbor sd_lldp_neighbor;
 
index 73b9f2ad3c3a4f1c1fe8728823d694c0aa61943b..107292027da35ca1c191dc3cb4de4d491da7fd5f 100644 (file)
   along with systemd; If not, see <https://www.gnu.org/licenses/>.
 ***/
 
-#include <errno.h>
-#include <inttypes.h>
-#include <net/ethernet.h>
-#include <sys/types.h>
-
 #include "_sd-common.h"
-#include "sd-event.h"
-#include "sd-lldp.h"
+#include "sd-lldp.h"    /* IWYU pragma: export*/
 
 _SD_BEGIN_DECLARATIONS;
 
+struct ether_addr;
+
+typedef struct sd_event sd_event;
 typedef struct sd_lldp_tx sd_lldp_tx;
 
 __extension__ typedef enum _SD_ENUM_TYPE_S64(sd_lldp_multicast_mode_t) {
index 4069c5b2999e95887d20ba43e3a4691e9fe617c8..7c68dc6e33121f39d41449ae9c0e81530e1e210c 100644 (file)
@@ -17,8 +17,6 @@
   along with systemd; If not, see <https://www.gnu.org/licenses/>.
 ***/
 
-#include <inttypes.h>
-
 #include "_sd-common.h"
 
 _SD_BEGIN_DECLARATIONS;
index cb80431b16ffbbf5162d2a2afeacc81b9bb31e2f..dbf69c2106abd49f389b7fcb3ee56e311d49bd86 100644 (file)
@@ -17,9 +17,6 @@
   along with systemd; If not, see <https://www.gnu.org/licenses/>.
 ***/
 
-#include <inttypes.h>
-#include <sys/types.h>
-
 #include "_sd-common.h"
 
 /*
index 2ea033741fa58ccbd46a7c4b1723a0f63f08e05d..750f048b87071bb2a1e6d0cd44c706757a94b30f 100644 (file)
   along with systemd; If not, see <https://www.gnu.org/licenses/>.
 ***/
 
-#include <inttypes.h>
-#include <net/ethernet.h>
-#include <netinet/in.h>
-#include <sys/types.h>
-#include <time.h>
-
 #include "_sd-common.h"
 
 _SD_BEGIN_DECLARATIONS;
 
+struct in6_addr;
+struct ether_addr;
+
 typedef struct sd_ndisc_neighbor sd_ndisc_neighbor;
 
 sd_ndisc_neighbor *sd_ndisc_neighbor_ref(sd_ndisc_neighbor *na);
index 60b43f769de3e9d0a6e61a7baca540764b0e519f..6c3a7b9f78d2f1450008f118c44570ffe1ebf81f 100644 (file)
   along with systemd; If not, see <https://www.gnu.org/licenses/>.
 ***/
 
-#include <inttypes.h>
-#include <net/ethernet.h>
-#include <netinet/in.h>
-#include <netinet/ip6.h>
-#include <sys/types.h>
-#include <time.h>
-
 #include "_sd-common.h"
 
 _SD_BEGIN_DECLARATIONS;
 
+struct ether_addr;
+struct in6_addr;
+struct ip6_hdr;
+
 typedef struct sd_ndisc_redirect sd_ndisc_redirect;
 
 sd_ndisc_redirect* sd_ndisc_redirect_ref(sd_ndisc_redirect *na);
index ff8c903af834f000e502fce53b10f518c7dd3a79..819f3b874ef9ff8e96ceda0283f2f08cc0d7fc86 100644 (file)
   along with systemd; If not, see <https://www.gnu.org/licenses/>.
 ***/
 
-#include <inttypes.h>
-#include <net/ethernet.h>
-#include <netinet/in.h>
-#include <sys/types.h>
-
 #include "_sd-common.h"
 
+struct in6_addr;
+struct ether_addr;
+
 _SD_BEGIN_DECLARATIONS;
 
 typedef struct sd_ndisc_router_solicit sd_ndisc_router_solicit;
index a7f1365381c041bf9ef7a1c42e1ac2f89c731270..823f3aede8f9daf517670d6b7aabe64850efe705 100644 (file)
   along with systemd; If not, see <https://www.gnu.org/licenses/>.
 ***/
 
-#include <inttypes.h>
-#include <net/ethernet.h>
-#include <netinet/in.h>
-#include <sys/types.h>
-#include <time.h>
-
 #include "_sd-common.h"
 
 _SD_BEGIN_DECLARATIONS;
 
+struct ether_addr;
+struct in6_addr;
+
 typedef struct sd_ndisc_router sd_ndisc_router;
 typedef struct sd_dns_resolver sd_dns_resolver;
 
index a8f8c47b68a1595aa4ff0f40fac87f12fea5fbb0..57cb32ef758ed6f080a132e07d10e235f8d30a18 100644 (file)
   along with systemd; If not, see <https://www.gnu.org/licenses/>.
 ***/
 
-#include <errno.h>
-#include <inttypes.h>
-#include <net/ethernet.h>
-#include <netinet/in.h>
-#include <sys/types.h>
-
 #include "_sd-common.h"
-#include "sd-event.h"
-#include "sd-ndisc-neighbor.h"
-#include "sd-ndisc-protocol.h"
-#include "sd-ndisc-redirect.h"
-#include "sd-ndisc-router.h"
+#include "sd-ndisc-neighbor.h"  /* IWYU pragma: export */
+#include "sd-ndisc-protocol.h"  /* IWYU pragma: export */
+#include "sd-ndisc-redirect.h"  /* IWYU pragma: export */
+#include "sd-ndisc-router.h"    /* IWYU pragma: export */
 
 _SD_BEGIN_DECLARATIONS;
 
+struct ether_addr;
+struct in6_addr;
+
+typedef struct sd_event sd_event;
 typedef struct sd_ndisc sd_ndisc;
 
 __extension__ typedef enum _SD_ENUM_TYPE_S64(sd_ndisc_event_t) {
index 5f8f143db1af842460bb4f11113941a71b7a4cfe..ea7a5cf69db42fb85de21f120e0755bb447880d3 100644 (file)
   along with systemd; If not, see <https://www.gnu.org/licenses/>.
 ***/
 
-#include <errno.h>
-#include <inttypes.h>
-#include <linux/filter.h>
-#include <linux/neighbour.h>
-#include <linux/rtnetlink.h>
-#include <net/ethernet.h>
-#include <netinet/in.h>
+#include <linux/rtnetlink.h> /* IWYU pragma: export */
 
 #include "_sd-common.h"
-#include "sd-event.h"
 
 _SD_BEGIN_DECLARATIONS;
 
+struct ether_addr;
+struct in_addr;
+struct in6_addr;
+struct sockaddr_in;
+struct sockaddr_in6;
+struct sock_filter;
+struct ifa_cacheinfo;
+
+typedef struct sd_event sd_event;
+
 typedef struct sd_netlink sd_netlink;
 typedef struct sd_netlink_message sd_netlink_message;
 typedef struct sd_netlink_slot sd_netlink_slot;
index d310d238d07b5dca20f9455cf462d545508df621..2a9261b246ff9353ae3727c4c925b08fcebc0260 100644 (file)
   along with systemd; If not, see <https://www.gnu.org/licenses/>.
 ***/
 
-#include <inttypes.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-
 #include "_sd-common.h"
 
 /*
@@ -44,6 +40,8 @@
 
 _SD_BEGIN_DECLARATIONS;
 
+struct stat;
+
 /* Get overall operational state
  * Possible states: down, up, dormant, carrier, degraded, routable
  * Possible return codes:
index bd3a60150cdb92684dc20d83771d8642dee56d92..5d5bdfe206629d89d251854036ca34b22e3b8b38 100644 (file)
@@ -17,8 +17,6 @@
   along with systemd; If not, see <https://www.gnu.org/licenses/>.
 ***/
 
-#include <inttypes.h>
-
 #include "_sd-common.h"
 
 _SD_BEGIN_DECLARATIONS;
index 6c1c4154e25215189a785bf23752f83d9d4cce93..8823049b525b9ed7f215b63d93540326d095e325 100644 (file)
   along with systemd; If not, see <https://www.gnu.org/licenses/>.
 ***/
 
-#include <inttypes.h>
-#include <net/ethernet.h>
-#include <netinet/in.h>
-#include <sys/types.h>
-
 #include "_sd-common.h"
-#include "sd-event.h"
-#include "sd-ndisc-protocol.h"
-#include "sd-ndisc-router-solicit.h"
 
 _SD_BEGIN_DECLARATIONS;
 
+struct ether_addr;
+struct in6_addr;
+
+typedef struct sd_event sd_event;
 typedef struct sd_radv sd_radv;
 
 int sd_radv_new(sd_radv **ret);
index 53780406847bf2c907047e4d1fafce431d8b27f7..ad05bd7e400d306c03879b19ec04104aefceea16 100644 (file)
 #define _GNU_SOURCE 1
 #endif
 
-#include <inttypes.h>
-#include <netdb.h>
 #include <sys/socket.h>
-#include <sys/types.h>
 
 #include "_sd-common.h"
-#include "sd-event.h"
 
 _SD_BEGIN_DECLARATIONS;
 
+struct addrinfo;
+
+typedef struct sd_event sd_event;
+
 /* An opaque sd-resolve session structure */
 typedef struct sd_resolve sd_resolve;
 
index 0fe49b8677e454959e6326058fc26ace5bd2a234..c0d49716b0aad1a2f25a7cd5da693b13a778a64b 100644 (file)
@@ -17,7 +17,6 @@
   along with systemd; If not, see <https://www.gnu.org/licenses/>.
 ***/
 
-#include <errno.h>
 #include <stdio.h>
 
 #include "_sd-common.h"
index c584112bfaf52a5f87fe12ead74f2247ca0e9262..d1f5087492601458ed84f03b4a471b62e5177726 100644 (file)
@@ -17,9 +17,6 @@
   along with systemd; If not, see <https://www.gnu.org/licenses/>.
 ***/
 
-#include <stdarg.h>
-#include <sys/types.h>
-
 #include "_sd-common.h"
 #include "sd-event.h"
 #include "sd-json.h"