+void IPC_Init(void)
+{
+ int tmp;
+ // TODO: Check this
+ giNetworkFileHandle = open("/Devices/ip/loop/udp", OPENFLAG_READ);
+ tmp = AXWIN_PORT; ioctl(giIPCFileHandle, 4, &tmp); // TODO: Don't hard-code IOCtl number
+
+ // TODO: Open a handle to something like /Devices/proc/cur/messages to watch for messages
+// giMessagesFileHandle = open("/Devices/"
+}
+
+void IPC_FillSelect(int *nfds, fd_set *set)
+{
+ if( giNetworkFileHandle > *nfds ) *nfds = giNetworkFileHandle;
+ FD_SET(giNetworkFileHandle, set);
+}
+
+void IPC_HandleSelect(fd_set *set)
+{
+ if( FD_ISSET(giIPCFileHandle, set) )
+ {
+ char staticBuf[STATICBUF_SIZE];
+ int readlen, identlen;
+ char *msg;
+
+ readlen = read(giIPCFileHandle, sizeof(staticBuf), staticBuf);
+
+ // Assume that all connections are from localhost
+ identlen = 4 + Net_GetAddressSize( ((uint16_t*)staticBuf)[1] );
+ msg = staticBuf + identlen;
+
+ Messages_Handle(staticBuf, readlen - identlen, (void*)msg, Messages_RespondIPC);
+ }
+}
+
+#if 0