chiark / gitweb /
basic: include only what we use
[elogind.git] / src / basic / socket-util.c
index 1acab1ef95bab65534dad3bf0717a1b5e083235e..091789851711f753b16b0871a0cb38bbfb19bb0d 100644 (file)
 
 #include <arpa/inet.h>
 #include <errno.h>
+#include <limits.h>
 #include <net/if.h>
 #include <netdb.h>
 #include <netinet/ip.h>
 #include <stddef.h>
+#include <stdint.h>
 #include <stdio.h>
+#include <stdlib.h>
 #include <string.h>
-#include <sys/types.h>
 #include <unistd.h>
 
 #include "alloc-util.h"
 #include "parse-util.h"
 #include "path-util.h"
 #include "socket-util.h"
+#include "log.h"
 #include "string-table.h"
 #include "string-util.h"
 #include "user-util.h"
 #include "util.h"
 
+#if 0 /// UNNEEDED by elogind
 int socket_address_parse(SocketAddress *a, const char *s) {
         char *e, *n;
         unsigned u;
@@ -435,6 +439,7 @@ const char* socket_address_get_path(const SocketAddress *a) {
 
         return a->sockaddr.un.sun_path;
 }
+#endif // 0
 
 bool socket_ipv6_is_supported(void) {
         _cleanup_free_ char *l = NULL;
@@ -450,6 +455,7 @@ bool socket_ipv6_is_supported(void) {
         return l[0] == '0';
 }
 
+#if 0 /// UNNEEDED by elogind
 bool socket_address_matches_fd(const SocketAddress *a, int fd) {
         SocketAddress b;
         socklen_t solen;
@@ -755,6 +761,7 @@ bool sockaddr_equal(const union sockaddr_union *a, const union sockaddr_union *b
 
         return false;
 }
+#endif // 0
 
 int fd_inc_sndbuf(int fd, size_t n) {
         int r, value;
@@ -791,6 +798,7 @@ int fd_inc_rcvbuf(int fd, size_t n) {
         return 1;
 }
 
+#if 0 /// UNNEEDED by elogind
 static const char* const ip_tos_table[] = {
         [IPTOS_LOWDELAY] = "low-delay",
         [IPTOS_THROUGHPUT] = "throughput",
@@ -799,6 +807,7 @@ static const char* const ip_tos_table[] = {
 };
 
 DEFINE_STRING_TABLE_LOOKUP_WITH_FALLBACK(ip_tos, int, 0xff);
+#endif // 0
 
 int getpeercred(int fd, struct ucred *ucred) {
         socklen_t n = sizeof(struct ucred);
@@ -894,6 +903,7 @@ int send_one_fd(int transport_fd, int fd, int flags) {
         return 0;
 }
 
+#if 0 /// UNNEEDED by elogind
 int receive_one_fd(int transport_fd, int flags) {
         union {
                 struct cmsghdr cmsghdr;
@@ -935,3 +945,4 @@ int receive_one_fd(int transport_fd, int flags) {
 
         return *(int*) CMSG_DATA(found);
 }
+#endif // 0