chiark / gitweb /
in-addr-util: remove family_to_string() API
authorLennart Poettering <lennart@poettering.net>
Fri, 18 Jul 2014 14:15:12 +0000 (16:15 +0200)
committerLennart Poettering <lennart@poettering.net>
Fri, 18 Jul 2014 14:15:12 +0000 (16:15 +0200)
we already have a more complete one with af_to_name(), that is generated
from the header files, no need to duplicate this.

src/resolve/resolved-dns-scope.c
src/shared/in-addr-util.c
src/shared/in-addr-util.h

index 38b64905a4565827724583d8c4284ec2771b781d..e74fcd4491710a8c64e5ddee27817c38e876f1c8 100644 (file)
@@ -23,6 +23,7 @@
 
 #include "strv.h"
 #include "socket-util.h"
+#include "af-list.h"
 #include "resolved-dns-domain.h"
 #include "resolved-dns-scope.h"
 
@@ -47,7 +48,7 @@ int dns_scope_new(Manager *m, DnsScope **ret, Link *l, DnsProtocol protocol, int
 
         dns_scope_llmnr_membership(s, true);
 
-        log_debug("New scope on link %s, protocol %s, family %s", strna(l ? l->name : NULL), dns_protocol_to_string(protocol), family_to_string(family));
+        log_debug("New scope on link %s, protocol %s, family %s", l ? l->name : "*", dns_protocol_to_string(protocol), family == AF_UNSPEC ? "*" : af_to_name(family));
 
         *ret = s;
         return 0;
@@ -57,7 +58,7 @@ DnsScope* dns_scope_free(DnsScope *s) {
         if (!s)
                 return NULL;
 
-        log_debug("Removing scope on link %s, protocol %s, family %s", strna(s->link ? s->link->name : NULL), dns_protocol_to_string(s->protocol), family_to_string(s->family));
+        log_debug("Removing scope on link %s, protocol %s, family %s", s->link ? s->link->name : "*", dns_protocol_to_string(s->protocol), s->family == AF_UNSPEC ? "*" : af_to_name(s->family));
 
         dns_scope_llmnr_membership(s, false);
 
index ffbaa74316724f8758095e50e20d8c58a735cd6b..ff008bd26fb9ab591810b05db5637f54d070841f 100644 (file)
@@ -231,15 +231,3 @@ int in_addr_from_string_auto(const char *s, int *family, union in_addr_union *re
 
         return -EINVAL;
 }
-
-static const char* const family_table[] = {
-        [AF_UNSPEC] = "unspec",
-        [AF_UNIX] = "unix",
-        [AF_INET] = "inet",
-        [AF_INET6] = "inet6",
-        [AF_NETLINK] = "netlink",
-        [AF_PACKET] = "packet",
-        [AF_BLUETOOTH] = "bluetooth",
-        [AF_NFC] = "nfc",
-};
-DEFINE_STRING_TABLE_LOOKUP(family, int);
index d76ea9dc30c1472f51e0f8e6ecc3ab6a73d8e7ca..98de032d959db300c12e521360bb4fe40b091ee1 100644 (file)
@@ -43,6 +43,3 @@ static inline size_t FAMILY_ADDRESS_SIZE(int family) {
         assert(family == AF_INET || family == AF_INET6);
         return family == AF_INET6 ? 16 : 4;
 }
-
-const char* family_to_string(int i) _const_;
-int family_from_string(const char *s) _pure_;