summaryrefslogtreecommitdiffstats
path: root/src/libsystemd-network
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2015-10-24 23:42:56 +0200
committerLennart Poettering <lennart@poettering.net>2015-10-24 23:42:56 +0200
commit04c0136989b7eb896bfb0fb176e11233d69e1453 (patch)
tree8d5bf1ed8a693e902ad3d79fab480cc6e2de85a2 /src/libsystemd-network
parentutil: move logind_running() to login-util.[ch] (diff)
downloadsystemd-04c0136989b7eb896bfb0fb176e11233d69e1453.tar.xz
systemd-04c0136989b7eb896bfb0fb176e11233d69e1453.zip
sd-*.h: clean up exported (or to-be-exported) header files
Exported header files should not include internal headers. Fix that. Exported header files should not use the bool type. So far we opted to stick to C89 for exported headers, and hence use "int" for bools in them. Continue to do so. Exported header files should have #include lines for everything they use including inttypes.h and sys/types.h, so that they may be included in any order. Exported header files should have C++ guards, hence add them. Exported header files should not use gcc extensions like #pragma once, get rid of it.
Diffstat (limited to 'src/libsystemd-network')
-rw-r--r--src/libsystemd-network/sd-dhcp-server.c2
-rw-r--r--src/libsystemd-network/sd-dhcp6-client.c5
-rw-r--r--src/libsystemd-network/sd-ipv4acd.c2
-rw-r--r--src/libsystemd-network/sd-ipv4ll.c2
-rw-r--r--src/libsystemd-network/sd-pppoe.c1
-rw-r--r--src/libsystemd-network/test-dhcp6-client.c2
6 files changed, 7 insertions, 7 deletions
diff --git a/src/libsystemd-network/sd-dhcp-server.c b/src/libsystemd-network/sd-dhcp-server.c
index 39afffc72c..52f7579c5e 100644
--- a/src/libsystemd-network/sd-dhcp-server.c
+++ b/src/libsystemd-network/sd-dhcp-server.c
@@ -94,7 +94,7 @@ int sd_dhcp_server_configure_pool(sd_dhcp_server *server, struct in_addr *addres
return 0;
}
-bool sd_dhcp_server_is_running(sd_dhcp_server *server) {
+int sd_dhcp_server_is_running(sd_dhcp_server *server) {
assert_return(server, false);
return !!server->receive_message;
diff --git a/src/libsystemd-network/sd-dhcp6-client.c b/src/libsystemd-network/sd-dhcp6-client.c
index cb8b0713f4..d4d4b771d9 100644
--- a/src/libsystemd-network/sd-dhcp6-client.c
+++ b/src/libsystemd-network/sd-dhcp6-client.c
@@ -206,9 +206,8 @@ int sd_dhcp6_client_set_duid(
return 0;
}
-int sd_dhcp6_client_set_information_request(sd_dhcp6_client *client, bool enabled) {
+int sd_dhcp6_client_set_information_request(sd_dhcp6_client *client, int enabled) {
assert_return(client, -EINVAL);
-
assert_return(IN_SET(client->state, DHCP6_STATE_STOPPED), -EBUSY);
client->information_request = enabled;
@@ -216,7 +215,7 @@ int sd_dhcp6_client_set_information_request(sd_dhcp6_client *client, bool enable
return 0;
}
-int sd_dhcp6_client_get_information_request(sd_dhcp6_client *client, bool *enabled) {
+int sd_dhcp6_client_get_information_request(sd_dhcp6_client *client, int *enabled) {
assert_return(client, -EINVAL);
assert_return(enabled, -EINVAL);
diff --git a/src/libsystemd-network/sd-ipv4acd.c b/src/libsystemd-network/sd-ipv4acd.c
index ae9805bfaa..d2ad5f75a4 100644
--- a/src/libsystemd-network/sd-ipv4acd.c
+++ b/src/libsystemd-network/sd-ipv4acd.c
@@ -468,7 +468,7 @@ int sd_ipv4acd_set_address(sd_ipv4acd *ll, const struct in_addr *address){
return 0;
}
-bool sd_ipv4acd_is_running(sd_ipv4acd *ll) {
+int sd_ipv4acd_is_running(sd_ipv4acd *ll) {
assert_return(ll, false);
return ll->state != IPV4ACD_STATE_INIT;
diff --git a/src/libsystemd-network/sd-ipv4ll.c b/src/libsystemd-network/sd-ipv4ll.c
index 0d025768a9..68ec58da90 100644
--- a/src/libsystemd-network/sd-ipv4ll.c
+++ b/src/libsystemd-network/sd-ipv4ll.c
@@ -227,7 +227,7 @@ int sd_ipv4ll_set_address_seed(sd_ipv4ll *ll, unsigned seed) {
return 0;
}
-bool sd_ipv4ll_is_running(sd_ipv4ll *ll) {
+int sd_ipv4ll_is_running(sd_ipv4ll *ll) {
assert_return(ll, false);
return sd_ipv4acd_is_running(ll->acd);
diff --git a/src/libsystemd-network/sd-pppoe.c b/src/libsystemd-network/sd-pppoe.c
index 87e3ce4b1d..7456b3218a 100644
--- a/src/libsystemd-network/sd-pppoe.c
+++ b/src/libsystemd-network/sd-pppoe.c
@@ -34,6 +34,7 @@
#include "event-util.h"
#include "random-util.h"
#include "socket-util.h"
+#include "sparse-endian.h"
#include "string-util.h"
#include "utf8.h"
#include "util.h"
diff --git a/src/libsystemd-network/test-dhcp6-client.c b/src/libsystemd-network/test-dhcp6-client.c
index fdf8d2ef89..4872567894 100644
--- a/src/libsystemd-network/test-dhcp6-client.c
+++ b/src/libsystemd-network/test-dhcp6-client.c
@@ -700,7 +700,7 @@ int dhcp6_network_bind_udp_socket(int index, struct in6_addr *local_address) {
static int test_client_solicit(sd_event *e) {
sd_dhcp6_client *client;
usec_t time_now = now(clock_boottime_or_monotonic());
- bool val = true;
+ int val = true;
if (verbose)
printf("* %s\n", __FUNCTION__);