initial code repo
[stor4nfv.git] / src / ceph / src / include / ipaddr.h
diff --git a/src/ceph/src/include/ipaddr.h b/src/ceph/src/include/ipaddr.h
new file mode 100644 (file)
index 0000000..d9e0968
--- /dev/null
@@ -0,0 +1,17 @@
+#ifndef CEPH_IPADDR_H
+#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.
+ */
+const struct ifaddrs *find_ip_in_subnet(const struct ifaddrs *addrs,
+                                        const struct sockaddr *net,
+                                        unsigned int prefix_len);
+
+
+bool parse_network(const char *s, struct sockaddr_storage *network, unsigned int *prefix_len);
+
+#endif