refactored the IP address handling code

It is now split up much more cleanly, has less stuff running on the
cRIO, and doesn't do as much of the stuff with string manipulation.

Before, it was kind of ridicilous how many times the code converted IP
addresses back and forth between 32-bit ints and strings to do various
manipulations and pass them around. Also, there was various junk that
the cRIO code did that it did not need to be doing.
diff --git a/aos/common/util.cc b/aos/common/util.cc
new file mode 100644
index 0000000..1b7ca93
--- /dev/null
+++ b/aos/common/util.cc
@@ -0,0 +1,31 @@
+#include "aos/common/util.h"
+
+#include <stdlib.h>
+#ifndef __VXWORKS__
+#include <string.h>
+#endif
+
+namespace aos {
+namespace util {
+
+const char *MakeIPAddress(const in_addr &base_address,
+                          ::aos::NetworkAddress last_segment) {
+  in_addr address = base_address;
+  SetLastSegment(&address, last_segment);
+
+#ifdef __VXWORKS__
+  char *r = static_cast<char *>(malloc(INET_ADDR_LEN));
+  inet_ntoa_b(address, r);
+  return r;
+#else
+  return strdup(inet_ntoa(address));
+#endif
+}
+
+void SetLastSegment(in_addr *address, ::aos::NetworkAddress last_segment) {
+  address->s_addr &= ~0xFF;
+  address->s_addr |= static_cast<uint8_t>(last_segment);
+}
+
+}  // namespace util
+}  // namespace aos