in-addr-util: move IPV4_ADDRESS_FMT_STR/VAL macros from networkd-address.h

This commit is contained in:
Yu Watanabe
2021-05-06 16:21:18 +09:00
parent ae7b68db97
commit 280323984b
2 changed files with 7 additions and 7 deletions

View File

@@ -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

View File

@@ -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