From 280323984b0f4b228333f8a64a3bd531274310fb Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Thu, 6 May 2021 16:21:18 +0900 Subject: in-addr-util: move IPV4_ADDRESS_FMT_STR/VAL macros from networkd-address.h --- src/basic/in-addr-util.h | 7 +++++++ src/network/networkd-address.h | 7 ------- 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'src') 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 -- cgit v1.2.3