libsystemd: Clean up includes

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.
This commit is contained in:
Daan De Meyer
2025-05-22 11:27:45 +02:00
committed by Yu Watanabe
parent b416ac0e15
commit 5cdf13c70c
272 changed files with 569 additions and 987 deletions

View 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) {

View 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);

View 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.

View 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 {

View 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

View 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;

View 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(

View 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,

View 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"

View 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 {

View 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>

View 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,

View 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"

View 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 */

View 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;

View 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(

View 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 {

View 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 {

View 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"

View 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"
@@ -14,10 +14,11 @@
#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"

View 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 {

View 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 {

View 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);

View 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"

View 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"

View 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"

View 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"

View 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"

View 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 = {

View 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);

View 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 {

View 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;

View File

@@ -1,6 +1,4 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
#include "icmp6-util.h"
extern int test_fd[2];

View 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"

View 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) { { { \

View 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) {

View 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 {

View 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"

View 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);

View 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;

View 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_;

View 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);

View 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;

View 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 });
}

View 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);

View 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);

View 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);

View 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"

View 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,

View 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,

View 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.

View 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"

View 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"
@@ -31,12 +28,12 @@
#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)

View 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)

View 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"

View 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) {

View 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)

View 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"

View 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"

View 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"

View 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;

View 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"

View 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"
@@ -16,10 +11,8 @@
#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)

View 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

View 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"

View 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)

View 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)

View 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)

View 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)

View 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"

View 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;

View 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"

View 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 = {

View 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"

View 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) {

View 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"

View 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"

View 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;

View 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"

View 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 = {

View 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"

View 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"

View 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"

View 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"

View 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"

View 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);

View 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"

View 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);

View 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) {

View 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"

View 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, \

View 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);

View 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"
@@ -14,11 +14,10 @@
#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)

View 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);

View 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) {

View 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);

View 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"

View 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))

View 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 \

View 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;

Some files were not shown because too many files have changed in this diff Show More