chiark / gitweb /
nss-myhostname: move local address listing logic into shared, so that we can make...
[elogind.git] / src / libsystemd / sd-rtnl / local-addresses.h
similarity index 81%
rename from src/nss-myhostname/addresses.h
rename to src/libsystemd/sd-rtnl/local-addresses.h
index 1bfb357..cc26fc4 100644 (file)
 
 #include "socket-util.h"
 
-struct address {
+struct local_address {
+        int ifindex;
         unsigned char family, scope;
         union in_addr_union address;
-        int ifindex;
 };
 
-static inline size_t PROTO_ADDRESS_SIZE(int proto) {
-        assert(proto == AF_INET || proto == AF_INET6);
-
-        return proto == AF_INET6 ? 16 : 4;
-}
-
-int acquire_addresses(struct address **_list, unsigned *_n_list);
+int local_addresses(struct local_address **ret);