From: Yu Watanabe Date: Thu, 6 May 2021 07:21:18 +0000 (+0900) Subject: in-addr-util: move IPV4_ADDRESS_FMT_STR/VAL macros from networkd-address.h X-Git-Tag: v249-rc1~240^2~22 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=280323984b0f4b228333f8a64a3bd531274310fb;p=thirdparty%2Fsystemd.git in-addr-util: move IPV4_ADDRESS_FMT_STR/VAL macros from networkd-address.h --- diff --git a/src/basic/in-addr-util.h b/src/basic/in-addr-util.h index 5f3c717615f..906b3fe97e5 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 58f44cd4cd4..b8030c99df2 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