--- /dev/null
+/* $Id$
+
+This file is part of libmspnet
+Copyright © 2008 Mikkosoft Productions, Mikko Rasa
+Distributed under the LGPL
+*/
+
+#include <msp/core/except.h>
+#include "inet.h"
+
+namespace Msp {
+namespace Net {
+
+SockAddr *SockAddr::create(sockaddr &sa)
+{
+ switch(sa.sa_family)
+ {
+ case AF_INET:
+ return new InetAddr(reinterpret_cast<sockaddr_in &>(sa));
+ default:
+ throw InvalidParameterValue("Unknown address family");
+ }
+}
+
+} // namespace Net
+} // namespace Msp