From cca3e923a992a4bf4c7dd143e5af6079d0dfcf15 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Fri, 26 Mar 2021 15:36:21 +0800 Subject: [PATCH] common/pick_address: document find_ip_in_subnet_list() Signed-off-by: Kefu Chai (cherry picked from commit b106ec0bbf7fa726062989114f461f2d0a1f93a9) --- src/common/pick_address.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/common/pick_address.h b/src/common/pick_address.h index 2621fed8108db..7d80d42fec640 100644 --- a/src/common/pick_address.h +++ b/src/common/pick_address.h @@ -68,6 +68,19 @@ std::string pick_iface(CephContext *cct, const struct sockaddr_storage &network) */ bool have_local_addr(CephContext *cct, const std::list& ls, entity_addr_t *match); +/** + * filter the addresses in @c ifa with specified interfaces, networks and IPv + * + * @param cct + * @param ifa a list of network interface addresses to be filtered + * @param ipv bitmask of CEPH_PICK_ADDRESS_IPV4 and CEPH_PICK_ADDRESS_IPV6. + * it is used to filter the @c networks + * @param networks a comma separated list of networks as the allow list. only + * the addresses in the specified networks are allowed. all addresses + * are accepted if it is empty. + * @param interfaces a comma separated list of interfaces for the allow list. + * all addresses are accepted if it is empty + */ const struct sockaddr *find_ip_in_subnet_list( CephContext *cct, const struct ifaddrs *ifa, -- 2.39.5