summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2021-05-06 09:21:18 +0200
committerYu Watanabe <watanabe.yu+github@gmail.com>2021-05-12 03:30:45 +0200
commit280323984b0f4b228333f8a64a3bd531274310fb (patch)
tree9a8ac2dc90ae796ab5b69cd91abe7f1e0ee28b65 /src
parentin-addr-util: introduce in6_addr_to_string() or friends (diff)
downloadsystemd-280323984b0f4b228333f8a64a3bd531274310fb.tar.xz
systemd-280323984b0f4b228333f8a64a3bd531274310fb.zip
in-addr-util: move IPV4_ADDRESS_FMT_STR/VAL macros from networkd-address.h
Diffstat (limited to 'src')
-rw-r--r--src/basic/in-addr-util.h7
-rw-r--r--src/network/networkd-address.h7
2 files changed, 7 insertions, 7 deletions
diff --git a/src/basic/in-addr-util.h b/src/basic/in-addr-util.h
index 5f3c717615..906b3fe97e 100644
--- a/src/basic/in-addr-util.h
+++ b/src/basic/in-addr-util.h
@@ -126,3 +126,10 @@ extern const struct hash_ops in_addr_data_hash_ops;
extern const struct hash_ops in_addr_prefix_hash_ops;
extern const struct hash_ops in_addr_prefix_hash_ops_free;
extern const struct hash_ops in6_addr_hash_ops;
+
+#define IPV4_ADDRESS_FMT_STR "%u.%u.%u.%u"
+#define IPV4_ADDRESS_FMT_VAL(address) \
+ be32toh((address).s_addr) >> 24, \
+ (be32toh((address).s_addr) >> 16) & 0xFFu, \
+ (be32toh((address).s_addr) >> 8) & 0xFFu, \
+ be32toh((address).s_addr) & 0xFFu
diff --git a/src/network/networkd-address.h b/src/network/networkd-address.h
index 58f44cd4cd..b8030c99df 100644
--- a/src/network/networkd-address.h
+++ b/src/network/networkd-address.h
@@ -86,10 +86,3 @@ CONFIG_PARSER_PROTOTYPE(config_parse_address_flags);
CONFIG_PARSER_PROTOTYPE(config_parse_address_scope);
CONFIG_PARSER_PROTOTYPE(config_parse_address_route_metric);
CONFIG_PARSER_PROTOTYPE(config_parse_duplicate_address_detection);
-
-#define IPV4_ADDRESS_FMT_STR "%u.%u.%u.%u"
-#define IPV4_ADDRESS_FMT_VAL(address) \
- be32toh((address).s_addr) >> 24, \
- (be32toh((address).s_addr) >> 16) & 0xFFu, \
- (be32toh((address).s_addr) >> 8) & 0xFFu, \
- be32toh((address).s_addr) & 0xFFu