From: Nathan Cutler Date: Sat, 9 Sep 2017 07:33:27 +0000 (+0200) Subject: doc: document include/ipaddr.h X-Git-Tag: v13.0.1~944^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=c501fc1f318e184ba2cd7c593464d1bdf738462e;p=ceph.git doc: document include/ipaddr.h Fixes: http://tracker.ceph.com/issues/12056 Signed-off-by: Nathan Cutler --- diff --git a/src/include/ipaddr.h b/src/include/ipaddr.h index d9e096886545..e4c9d4cf0c51 100644 --- a/src/include/ipaddr.h +++ b/src/include/ipaddr.h @@ -2,16 +2,26 @@ #define CEPH_IPADDR_H /* - Find an IP address that is in the wanted subnet. - - If there are multiple matches, the first one is returned; this order - is system-dependent and should not be relied on. + * Find an IP address that is in the wanted subnet. + * + * If there are multiple matches, the first one is returned; this order + * is system-dependent and should not be relied on. */ const struct ifaddrs *find_ip_in_subnet(const struct ifaddrs *addrs, const struct sockaddr *net, unsigned int prefix_len); - +/* + * Validate and parse IPv4 or IPv6 network + * + * Given a network (e.g. "192.168.0.0/24") and pointers to a sockaddr_storage + * struct and an unsigned int: + * + * if the network string is valid, return true and populate sockaddr_storage + * and prefix_len; + * + * if the network string is invalid, return false. + */ bool parse_network(const char *s, struct sockaddr_storage *network, unsigned int *prefix_len); #endif