util: Refactor addrFromBuf
Change-Id: I1b2deed483eb25034ca9b4717388119af3da1c8d
Signed-off-by: William A. Kennington III <wak@google.com>
diff --git a/src/util.hpp b/src/util.hpp
index f98a7d5..023d375 100644
--- a/src/util.hpp
+++ b/src/util.hpp
@@ -91,10 +91,12 @@
/* @brief converts a sockaddr for the specified address family into
* a type_safe InAddrAny.
- * @param[in] addressFamily - The address family of the buf
+ * @param[in] family - The address family of the buf
* @param[in] buf - The network byte order address
*/
-InAddrAny addrFromBuf(int addressFamily, std::string_view buf);
+template <int family>
+typename FamilyTraits<family>::addr addrFromBuf(std::string_view buf);
+InAddrAny addrFromBuf(int family, std::string_view buf);
/* @brief converts the ip bytes into a string representation
* @param[in] addr - input ip address to convert.