Index: uspace/lib/c/generic/net/modules.c
===================================================================
--- uspace/lib/c/generic/net/modules.c	(revision 3c106e8814a50268257db9a33c79a75e51e871ec)
+++ uspace/lib/c/generic/net/modules.c	(revision 774e6d1abebc631f873d85e623bf7aa61b0aecea)
@@ -32,5 +32,5 @@
 
 /** @file
- * Generic module functions implementation. 
+ * Generic module functions implementation.
  *
  * @todo MAKE IT POSSIBLE TO REMOVE THIS FILE VIA EITHER REPLACING PART OF ITS
@@ -52,18 +52,18 @@
 #define MODULE_WAIT_TIME	(10 * 1000)
 
-/** Answers the call.
- *
- * @param[in] callid	The call identifier.
- * @param[in] result	The message processing result.
- * @param[in] answer	The message processing answer.
- * @param[in] answer_count The number of answer parameters.
- */
-void
-answer_call(ipc_callid_t callid, int result, ipc_call_t *answer,
-    int answer_count)
-{
-	/* Choose the most efficient answer function */
-	if (answer || (!answer_count)) {
-		switch (answer_count) {
+/** Answer a call.
+ *
+ * @param[in] callid Call identifier.
+ * @param[in] result Message processing result.
+ * @param[in] answer Message processing answer.
+ * @param[in] count  Number of answer parameters.
+ *
+ */
+void answer_call(ipc_callid_t callid, int result, ipc_call_t *answer,
+    size_t count)
+{
+	/* Choose the most efficient function */
+	if ((answer != NULL) || (count == 0)) {
+		switch (count) {
 		case 0:
 			ipc_answer_0(callid, (sysarg_t) result);
@@ -228,19 +228,19 @@
 }
 
-/** Refreshes answer structure and parameters count.
- *
- * Erases all attributes.
- *
- * @param[in,out] answer The message processing answer structure.
- * @param[in,out] answer_count The number of answer parameters.
- */
-void refresh_answer(ipc_call_t *answer, int *answer_count)
-{
-	if (answer_count)
-		*answer_count = 0;
-
-	if (answer) {
+/** Refresh answer structure and argument count.
+ *
+ * Erase all arguments.
+ *
+ * @param[in,out] answer Message processing answer structure.
+ * @param[in,out] count  Number of answer arguments.
+ *
+ */
+void refresh_answer(ipc_call_t *answer, size_t *count)
+{
+	if (count != NULL)
+		*count = 0;
+	
+	if (answer != NULL) {
 		IPC_SET_RETVAL(*answer, 0);
-		/* Just to be precise */
 		IPC_SET_IMETHOD(*answer, 0);
 		IPC_SET_ARG1(*answer, 0);
Index: uspace/lib/c/include/ipc/arp.h
===================================================================
--- uspace/lib/c/include/ipc/arp.h	(revision 3c106e8814a50268257db9a33c79a75e51e871ec)
+++ uspace/lib/c/include/ipc/arp.h	(revision 774e6d1abebc631f873d85e623bf7aa61b0aecea)
@@ -69,12 +69,10 @@
 /*@{*/
 
-/** Returns the protocol service message parameter.
- * @param[in] call The message call structure.
+/** Return the protocol service message parameter.
+ *
+ * @param[in] call Message call structure.
+ *
  */
-#define ARP_GET_NETIF(call) \
-	({ \
-		services_t service = (services_t) IPC_GET_ARG2(*call); \
-		service; \
-	})
+#define ARP_GET_NETIF(call) ((services_t) IPC_GET_ARG2(call))
 
 /*@}*/
Index: uspace/lib/c/include/ipc/icmp.h
===================================================================
--- uspace/lib/c/include/ipc/icmp.h	(revision 3c106e8814a50268257db9a33c79a75e51e871ec)
+++ uspace/lib/c/include/ipc/icmp.h	(revision 774e6d1abebc631f873d85e623bf7aa61b0aecea)
@@ -82,83 +82,58 @@
 /*@{*/
 
-/** Returns the ICMP code message parameter.
+/** Return the ICMP code message parameter.
  *
- * @param[in] call	The message call structure.
+ * @param[in] call Message call structure.
+ *
  */
-#define ICMP_GET_CODE(call) \
-	({ \
-		icmp_code_t code = (icmp_code_t) IPC_GET_ARG1(*call); \
-		code; \
-	})
+#define ICMP_GET_CODE(call)  ((icmp_code_t) IPC_GET_ARG1(call))
 
-/** Returns the ICMP link MTU message parameter.
+/** Return the ICMP link MTU message parameter.
  *
- * @param[in] call	The message call structure.
+ * @param[in] call Message call structure.
+ *
  */
-#define ICMP_GET_MTU(call) \
-	({ \
-		icmp_param_t mtu = (icmp_param_t) IPC_GET_ARG3(*call); \
-		mtu; \
-	})
+#define ICMP_GET_MTU(call)  ((icmp_param_t) IPC_GET_ARG3(call))
 
-/** Returns the pointer message parameter.
+/** Return the pointer message parameter.
  *
- * @param[in] call	The message call structure.
+ * @param[in] call Message call structure.
+ *
  */
-#define ICMP_GET_POINTER(call) \
-	({ \
-		icmp_param_t pointer = (icmp_param_t) IPC_GET_ARG3(*call); \
-		pointer; \
-	})
+#define ICMP_GET_POINTER(call)  ((icmp_param_t) IPC_GET_ARG3(call))
 
-/** Returns the size message parameter.
+/** Return the size message parameter.
  *
- * @param[in] call	The message call structure.
+ * @param[in] call Message call structure.
+ *
  */
-#define ICMP_GET_SIZE(call) \
-	({ \
-		size_t size = (size_t) IPC_GET_ARG1(call); \
-		size; \
-	})
+#define ICMP_GET_SIZE(call)  ((size_t) IPC_GET_ARG1(call))
 
-/** Returns the timeout message parameter.
+/** Return the timeout message parameter.
  *
- * @param[in] call	The message call structure.
+ * @param[in] call Message call structure.
+ *
  */
-#define ICMP_GET_TIMEOUT(call) \
-	({ \
-		suseconds_t timeout = (suseconds_t) IPC_GET_ARG2(call); \
-		timeout; \
-	})
+#define ICMP_GET_TIMEOUT(call)  ((suseconds_t) IPC_GET_ARG2(call))
 
-/** Returns the time to live message parameter.
+/** Return the time to live message parameter.
  *
- * @param[in] call	The message call structure.
+ * @param[in] call Message call structure.
+ *
  */
-#define ICMP_GET_TTL(call) \
-	({ \
-		ip_ttl_t ttl = (ip_ttl_t) IPC_GET_ARG3(call); \
-		ttl; \
-	})
+#define ICMP_GET_TTL(call)  ((ip_ttl_t) IPC_GET_ARG3(call))
 
-/** Returns the type of service message parameter.
+/** Return the type of service message parameter.
  *
- * @param[in] call	The message call structure.
+ * @param[in] call Message call structure.
+ *
  */
-#define ICMP_GET_TOS(call) \
-	({ \
-		ip_tos_t tos = (ip_tos_t) IPC_GET_ARG4(call); \
-		tos; \
-	})
+#define ICMP_GET_TOS(call)  ((ip_tos_t) IPC_GET_ARG4(call))
 
-/** Returns the dont fragment message parameter.
+/** Return the dont fragment message parameter.
  *
- * @param[in] call	The message call structure.
+ * @param[in] call Message call structure.
  */
-#define ICMP_GET_DONT_FRAGMENT(call) \
-	({ \
-		int dont_fragment = (int) IPC_GET_ARG5(call); \
-		dont_fragment; \
-	})
+#define ICMP_GET_DONT_FRAGMENT(call)  ((int) IPC_GET_ARG5(call))
 
 /*@}*/
Index: uspace/lib/c/include/ipc/il.h
===================================================================
--- uspace/lib/c/include/ipc/il.h	(revision 3c106e8814a50268257db9a33c79a75e51e871ec)
+++ uspace/lib/c/include/ipc/il.h	(revision 774e6d1abebc631f873d85e623bf7aa61b0aecea)
@@ -75,12 +75,16 @@
 
 /** Return the protocol number message parameter.
- * @param[in] call The message call structure.
+ *
+ * @param[in] call Message call structure.
+ *
  */
-#define IL_GET_PROTO(call)	(int) IPC_GET_ARG1(*call)
+#define IL_GET_PROTO(call)  ((int) IPC_GET_ARG1(call))
 
 /** Return the registering service message parameter.
- * @param[in] call The message call structure.
+ *
+ * @param[in] call Message call structure.
+ *
  */
-#define IL_GET_SERVICE(call)	(services_t) IPC_GET_ARG2(*call)
+#define IL_GET_SERVICE(call)  ((services_t) IPC_GET_ARG2(call))
 
 /*@}*/
Index: uspace/lib/c/include/ipc/ip.h
===================================================================
--- uspace/lib/c/include/ipc/ip.h	(revision 3c106e8814a50268257db9a33c79a75e51e871ec)
+++ uspace/lib/c/include/ipc/ip.h	(revision 774e6d1abebc631f873d85e623bf7aa61b0aecea)
@@ -51,12 +51,15 @@
 	 */
 	NET_IP_ADD_ROUTE = NET_IP_FIRST,
+	
 	/** Gets the actual route information.
 	 * @see ip_get_route()
 	 */
 	NET_IP_GET_ROUTE,
+	
 	/** Processes the received error notification.
 	 * @see ip_received_error_msg()
 	 */
 	NET_IP_RECEIVED_ERROR,
+	
 	/** Sets the default gateway.
 	 * @see ip_set_default_gateway()
@@ -68,51 +71,53 @@
 /*@{*/
 
-/** Returns the address message parameter.
- * @param[in] call The message call structure.
+/** Return the address message parameter.
+ *
+ * @param[in] call Message call structure.
+ *
  */
 #define IP_GET_ADDRESS(call) \
 	({ \
 		in_addr_t addr; \
-		addr.s_addr = IPC_GET_ARG3(*call); \
+		addr.s_addr = IPC_GET_ARG3(call); \
 		addr; \
 	})
 
-/** Returns the gateway message parameter.
- * @param[in] call The message call structure.
+/** Return the gateway message parameter.
+ *
+ * @param[in] call Message call structure.
+ *
  */
 #define IP_GET_GATEWAY(call) \
 	({ \
 		in_addr_t addr; \
-		addr.s_addr = IPC_GET_ARG2(*call); \
+		addr.s_addr = IPC_GET_ARG2(call); \
 		addr; \
 	})
 
-/** Sets the header length in the message answer.
- * @param[out] answer The message answer structure.
+/** Set the header length in the message answer.
+ *
+ * @param[out] answer Message answer structure.
+ *
  */
-#define IP_SET_HEADERLEN(answer, value) \
-	do { \
-		sysarg_t argument = (sysarg_t) (value); \
-		IPC_SET_ARG2(*answer, argument); \
-	} while (0)
+#define IP_SET_HEADERLEN(answer, value)  IPC_SET_ARG2(answer, (sysarg_t) (value))
 
-/** Returns the network mask message parameter.
- * @param[in] call The message call structure.
+/** Return the network mask message parameter.
+ *
+ * @param[in] call Message call structure.
+ *
  */
 #define IP_GET_NETMASK(call) \
 	({ \
 		in_addr_t addr; \
-		addr.s_addr = IPC_GET_ARG4(*call); \
+		addr.s_addr = IPC_GET_ARG4(call); \
 		addr; \
 	})
 
-/** Returns the protocol message parameter.
- * @param[in] call The message call structure.
+/** Return the protocol message parameter.
+ *
+ * @param[in] call Message call structure.
+ *
  */
-#define IP_GET_PROTOCOL(call) \
-	({ \
-		ip_protocol_t protocol = (ip_protocol_t) IPC_GET_ARG1(*call); \
-		protocol; \
-	})
+#define IP_GET_PROTOCOL(call)  ((ip_protocol_t) IPC_GET_ARG1(call))
 
 /*@}*/
Index: uspace/lib/c/include/ipc/net.h
===================================================================
--- uspace/lib/c/include/ipc/net.h	(revision 3c106e8814a50268257db9a33c79a75e51e871ec)
+++ uspace/lib/c/include/ipc/net.h	(revision 774e6d1abebc631f873d85e623bf7aa61b0aecea)
@@ -44,8 +44,10 @@
 #include <net/packet.h>
 
-/** Returns a value indicating whether the value is in the interval.
- * @param[in] item	The value to be checked.
- * @param[in] first_inclusive The first value in the interval inclusive.
- * @param[in] last_exclusive The first value after the interval.
+/** Return a value indicating whether the value is in the interval.
+ *
+ * @param[in] item            Value to be checked.
+ * @param[in] first_inclusive First value in the interval inclusive.
+ * @param[in] last_exclusive  First value after the interval.
+ *
  */
 #define IS_IN_INTERVAL(item, first_inclusive, last_exclusive) \
@@ -55,42 +57,17 @@
 /*@{*/
 
-/** The number of ARP messages. */
-#define NET_ARP_COUNT		5
-
-/** The number of Ethernet messages. */
-#define NET_ETH_COUNT		0
-
-/** The number of ICMP messages. */
-#define NET_ICMP_COUNT		6
-
-/** The number of inter-network messages. */
-#define NET_IL_COUNT		6
-
-/** The number of IP messages. */
-#define NET_IP_COUNT		4
-
-/** The number of general networking messages. */
-#define NET_NET_COUNT		3
-
-/** The number of network interface driver messages. */
-#define NET_NETIF_COUNT		6
-
-/** The number of network interface layer messages. */
-#define NET_NIL_COUNT		7
-
-/** The number of packet management system messages. */
-#define NET_PACKET_COUNT	5
-
-/** The number of socket messages. */
-#define NET_SOCKET_COUNT	14
-
-/** The number of TCP messages. */
-#define NET_TCP_COUNT		0
-
-/** The number of transport layer messages. */
-#define NET_TL_COUNT		1
-
-/** The number of UDP messages. */
-#define NET_UDP_COUNT		0
+#define NET_ARP_COUNT     5   /**< Number of ARP messages. */
+#define NET_ETH_COUNT     0   /**< Number of Ethernet messages. */
+#define NET_ICMP_COUNT    6   /**< Number of ICMP messages. */
+#define NET_IL_COUNT      6   /**< Number of inter-network messages. */
+#define NET_IP_COUNT      4   /**< Number of IP messages. */
+#define NET_NET_COUNT     3   /**< Number of general networking messages. */
+#define NET_NETIF_COUNT   6   /**< Number of network interface driver messages. */
+#define NET_NIL_COUNT     7   /**< Number of network interface layer messages. */
+#define NET_PACKET_COUNT  5   /**< Number of packet management system messages. */
+#define NET_SOCKET_COUNT  14  /**< Number of socket messages. */
+#define NET_TCP_COUNT     0   /**< Number of TCP messages. */
+#define NET_TL_COUNT      1   /**< Number of transport layer messages. */
+#define NET_UDP_COUNT     0   /**< Number of UDP messages. */
 
 /*@}*/
@@ -100,173 +77,195 @@
 /*@{*/
 
-/** The first networking message. */
-#define NET_FIRST		2000
-
-/** The first network interface layer message. */
-#define NET_NETIF_FIRST		NET_FIRST
-
-/** The last network interface layer message. */
-#define NET_NETIF_LAST		(NET_NETIF_FIRST + NET_NETIF_COUNT)
-
-/** The first general networking message. */
-#define NET_NET_FIRST		(NET_NETIF_LAST + 0)
-
-/** The last general networking message. */
-#define NET_NET_LAST		(NET_NET_FIRST + NET_NET_COUNT)
-
-/** The first network interface layer message. */
-#define NET_NIL_FIRST		(NET_NET_LAST + 0)
-
-/** The last network interface layer message. */
-#define NET_NIL_LAST		(NET_NIL_FIRST + NET_NIL_COUNT)
-
-/** The first Ethernet message. */
-#define NET_ETH_FIRST		(NET_NIL_LAST + 0)
-
-/** The last Ethernet message. */
-#define NET_ETH_LAST		(NET_ETH_FIRST + NET_ETH_COUNT)
-
-/** The first inter-network message. */
-#define NET_IL_FIRST		(NET_ETH_LAST + 0)
-
-/** The last inter-network message. */
-#define NET_IL_LAST		(NET_IL_FIRST + NET_IL_COUNT)
-
-/** The first IP message. */
-#define NET_IP_FIRST		(NET_IL_LAST + 0)
-
-/** The last IP message. */
-#define NET_IP_LAST		(NET_IP_FIRST + NET_IP_COUNT)
-
-/** The first ARP message. */
-#define NET_ARP_FIRST		(NET_IP_LAST + 0)
-
-/** The last ARP message. */
-#define NET_ARP_LAST		(NET_ARP_FIRST + NET_ARP_COUNT)
-
-/** The first ICMP message. */
-#define NET_ICMP_FIRST		(NET_ARP_LAST + 0)
-
-/** The last ICMP message. */
-#define NET_ICMP_LAST		(NET_ICMP_FIRST + NET_ICMP_COUNT)
-
-/** The first ICMP message. */
-#define NET_TL_FIRST		(NET_ICMP_LAST + 0)
-
-/** The last ICMP message. */
-#define NET_TL_LAST		(NET_TL_FIRST + NET_TL_COUNT)
-
-/** The first UDP message. */
-#define NET_UDP_FIRST		(NET_TL_LAST + 0)
-
-/** The last UDP message. */
-#define NET_UDP_LAST		(NET_UDP_FIRST + NET_UDP_COUNT)
-
-/** The first TCP message. */
-#define NET_TCP_FIRST		(NET_UDP_LAST + 0)
-
-/** The last TCP message. */
-#define NET_TCP_LAST		(NET_TCP_FIRST + NET_TCP_COUNT)
-
-/** The first socket message. */
-#define NET_SOCKET_FIRST	(NET_TCP_LAST + 0)
-
-/** The last socket message. */
-#define NET_SOCKET_LAST		(NET_SOCKET_FIRST + NET_SOCKET_COUNT)
-
-/** The first packet management system message. */
-#define NET_PACKET_FIRST	(NET_SOCKET_LAST + 0)
-
-/** The last packet management system message. */
-#define NET_PACKET_LAST		(NET_PACKET_FIRST + NET_PACKET_COUNT)
-
-/** The last networking message. */
-#define NET_LAST		NET_PACKET_LAST
-
-/** The number of networking messages. */
-#define NET_COUNT		(NET_LAST - NET_FIRST)
-
-/** Returns a value indicating whether the IPC call is a generic networking
- * message.
- * @param[in] call The IPC call to be checked.
+
+/** First networking message. */
+#define NET_FIRST  2000
+
+/** First network interface layer message. */
+#define NET_NETIF_FIRST  NET_FIRST
+
+/** Last network interface layer message. */
+#define NET_NETIF_LAST  (NET_NETIF_FIRST + NET_NETIF_COUNT)
+
+/** First general networking message. */
+#define NET_NET_FIRST  (NET_NETIF_LAST + 0)
+
+/** Last general networking message. */
+#define NET_NET_LAST  (NET_NET_FIRST + NET_NET_COUNT)
+
+/** First network interface layer message. */
+#define NET_NIL_FIRST  (NET_NET_LAST + 0)
+
+/** Last network interface layer message. */
+#define NET_NIL_LAST  (NET_NIL_FIRST + NET_NIL_COUNT)
+
+/** First Ethernet message. */
+#define NET_ETH_FIRST  (NET_NIL_LAST + 0)
+
+/** Last Ethernet message. */
+#define NET_ETH_LAST  (NET_ETH_FIRST + NET_ETH_COUNT)
+
+/** First inter-network message. */
+#define NET_IL_FIRST  (NET_ETH_LAST + 0)
+
+/** Last inter-network message. */
+#define NET_IL_LAST  (NET_IL_FIRST + NET_IL_COUNT)
+
+/** First IP message. */
+#define NET_IP_FIRST  (NET_IL_LAST + 0)
+
+/** Last IP message. */
+#define NET_IP_LAST  (NET_IP_FIRST + NET_IP_COUNT)
+
+/** First ARP message. */
+#define NET_ARP_FIRST  (NET_IP_LAST + 0)
+
+/** Last ARP message. */
+#define NET_ARP_LAST  (NET_ARP_FIRST + NET_ARP_COUNT)
+
+/** First ICMP message. */
+#define NET_ICMP_FIRST  (NET_ARP_LAST + 0)
+
+/** Last ICMP message. */
+#define NET_ICMP_LAST  (NET_ICMP_FIRST + NET_ICMP_COUNT)
+
+/** First ICMP message. */
+#define NET_TL_FIRST  (NET_ICMP_LAST + 0)
+
+/** Last ICMP message. */
+#define NET_TL_LAST  (NET_TL_FIRST + NET_TL_COUNT)
+
+/** First UDP message. */
+#define NET_UDP_FIRST  (NET_TL_LAST + 0)
+
+/** Last UDP message. */
+#define NET_UDP_LAST  (NET_UDP_FIRST + NET_UDP_COUNT)
+
+/** First TCP message. */
+#define NET_TCP_FIRST  (NET_UDP_LAST + 0)
+
+/** Last TCP message. */
+#define NET_TCP_LAST  (NET_TCP_FIRST + NET_TCP_COUNT)
+
+/** First socket message. */
+#define NET_SOCKET_FIRST  (NET_TCP_LAST + 0)
+
+/** Last socket message. */
+#define NET_SOCKET_LAST  (NET_SOCKET_FIRST + NET_SOCKET_COUNT)
+
+/** First packet management system message. */
+#define NET_PACKET_FIRST  (NET_SOCKET_LAST + 0)
+
+/** Last packet management system message. */
+#define NET_PACKET_LAST  (NET_PACKET_FIRST + NET_PACKET_COUNT)
+
+/** Last networking message. */
+#define NET_LAST  NET_PACKET_LAST
+
+/** Number of networking messages. */
+#define NET_COUNT  (NET_LAST - NET_FIRST)
+
+/** Check if the IPC call is a generic networking message.
+ *
+ * @param[in] call IPC call to be checked.
+ *
  */
 #define IS_NET_MESSAGE(call) \
-	IS_IN_INTERVAL(IPC_GET_IMETHOD(*call), NET_FIRST, NET_LAST)
-
-/** Returns a value indicating whether the IPC call is an ARP message.
- * @param[in] call The IPC call to be checked.
+	IS_IN_INTERVAL(IPC_GET_IMETHOD(call), NET_FIRST, NET_LAST)
+
+/** Check if the IPC call is an ARP message.
+ *
+ * @param[in] call IPC call to be checked.
+ *
  */
 #define IS_NET_ARP_MESSAGE(call) \
-	IS_IN_INTERVAL(IPC_GET_IMETHOD(*call), NET_ARP_FIRST, NET_ARP_LAST)
-
-/** Returns a value indicating whether the IPC call is an Ethernet message.
- * @param[in] call The IPC call to be checked.
+	IS_IN_INTERVAL(IPC_GET_IMETHOD(call), NET_ARP_FIRST, NET_ARP_LAST)
+
+/** Check if the IPC call is an Ethernet message.
+ *
+ * @param[in] call IPC call to be checked.
+ *
  */
 #define IS_NET_ETH_MESSAGE(call) \
-	IS_IN_INTERVAL(IPC_GET_IMETHOD(*call), NET_ETH_FIRST, NET_ETH_LAST)
-
-/** Returns a value indicating whether the IPC call is an ICMP message.
- * @param[in] call The IPC call to be checked.
+	IS_IN_INTERVAL(IPC_GET_IMETHOD(call), NET_ETH_FIRST, NET_ETH_LAST)
+
+/** Check if the IPC call is an ICMP message.
+ *
+ * @param[in] call IPC call to be checked.
+ *
  */
 #define IS_NET_ICMP_MESSAGE(call) \
-	IS_IN_INTERVAL(IPC_GET_IMETHOD(*call), NET_ICMP_FIRST, NET_ICMP_LAST)
-
-/** Returns a value indicating whether the IPC call is an inter-network layer
- * message.
- * @param[in] call The IPC call to be checked.
+	IS_IN_INTERVAL(IPC_GET_IMETHOD(call), NET_ICMP_FIRST, NET_ICMP_LAST)
+
+/** Check if the IPC call is an inter-network layer message.
+ *
+ * @param[in] call IPC call to be checked.
+ *
  */
 #define IS_NET_IL_MESSAGE(call) \
-	IS_IN_INTERVAL(IPC_GET_IMETHOD(*call), NET_IL_FIRST, NET_IL_LAST)
-
-/** Returns a value indicating whether the IPC call is an IP message.
- * @param[in] call The IPC call to be checked.
+	IS_IN_INTERVAL(IPC_GET_IMETHOD(call), NET_IL_FIRST, NET_IL_LAST)
+
+/** Check if the IPC call is an IP message.
+ *
+ * @param[in] call IPC call to be checked.
+ *
  */
 #define IS_NET_IP_MESSAGE(call) \
-	IS_IN_INTERVAL(IPC_GET_IMETHOD(*call), NET_IP_FIRST, NET_IP_LAST)
-
-/** Returns a value indicating whether the IPC call is a generic networking
- * message.
- * @param[in] call The IPC call to be checked.
+	IS_IN_INTERVAL(IPC_GET_IMETHOD(call), NET_IP_FIRST, NET_IP_LAST)
+
+/** Check if the IPC call is a generic networking message.
+ *
+ * @param[in] call IPC call to be checked.
+ *
  */
 #define IS_NET_NET_MESSAGE(call) \
-	IS_IN_INTERVAL(IPC_GET_IMETHOD(*call), NET_NET_FIRST, NET_NET_LAST)
-
-/** Returns a value indicating whether the IPC call is a network interface layer
- * message.
- * @param[in] call The IPC call to be checked.
+	IS_IN_INTERVAL(IPC_GET_IMETHOD(call), NET_NET_FIRST, NET_NET_LAST)
+
+/** Check if the IPC call is a network interface layer message.
+ *
+ * @param[in] call IPC call to be checked.
+ *
  */
 #define IS_NET_NIL_MESSAGE(call) \
-	IS_IN_INTERVAL(IPC_GET_IMETHOD(*call), NET_NIL_FIRST, NET_NIL_LAST)
-
-/** Returns a value indicating whether the IPC call is a packet manaagement
- * system message.
- * @param[in] call The IPC call to be checked.
+	IS_IN_INTERVAL(IPC_GET_IMETHOD(call), NET_NIL_FIRST, NET_NIL_LAST)
+
+/** Check if the IPC call is a packet manaagement system message.
+ *
+ * @param[in] call IPC call to be checked.
+ *
  */
 #define IS_NET_PACKET_MESSAGE(call) \
-	IS_IN_INTERVAL(IPC_GET_IMETHOD(*call), NET_PACKET_FIRST, NET_PACKET_LAST)
-
-/** Returns a value indicating whether the IPC call is a socket message.
- * @param[in] call The IPC call to be checked.
+	IS_IN_INTERVAL(IPC_GET_IMETHOD(call), NET_PACKET_FIRST, NET_PACKET_LAST)
+
+/** Check if the IPC call is a socket message.
+ *
+ * @param[in] call IPC call to be checked.
+ *
  */
 #define IS_NET_SOCKET_MESSAGE(call) \
-	IS_IN_INTERVAL(IPC_GET_IMETHOD(*call), NET_SOCKET_FIRST, NET_SOCKET_LAST)
-
-/** Returns a value indicating whether the IPC call is a TCP message.
- * @param[in] call The IPC call to be checked.
+	IS_IN_INTERVAL(IPC_GET_IMETHOD(call), NET_SOCKET_FIRST, NET_SOCKET_LAST)
+
+/** Check if the IPC call is a TCP message.
+ *
+ * @param[in] call IPC call to be checked.
+ *
  */
 #define IS_NET_TCP_MESSAGE(call) \
-	IS_IN_INTERVAL(IPC_GET_IMETHOD(*call), NET_TCP_FIRST, NET_TCP_LAST)
-
-/** Returns a value indicating whether the IPC call is a transport layer message.
- * @param[in] call The IPC call to be checked.
+	IS_IN_INTERVAL(IPC_GET_IMETHOD(call), NET_TCP_FIRST, NET_TCP_LAST)
+
+/** Check if the IPC call is a transport layer message.
+ *
+ * @param[in] call IPC call to be checked.
+ *
  */
 #define IS_NET_TL_MESSAGE(call) \
-	IS_IN_INTERVAL(IPC_GET_IMETHOD(*call), NET_TL_FIRST, NET_TL_LAST)
-
-/** Returns a value indicating whether the IPC call is a UDP message.
- * @param[in] call The IPC call to be checked.
+	IS_IN_INTERVAL(IPC_GET_IMETHOD(call), NET_TL_FIRST, NET_TL_LAST)
+
+/** Check if the IPC call is a UDP message.
+ *
+ * @param[in] call IPC call to be checked.
+ *
  */
 #define IS_NET_UDP_MESSAGE(call) \
-	IS_IN_INTERVAL(IPC_GET_IMETHOD(*call), NET_UDP_FIRST, NET_UDP_LAST)
+	IS_IN_INTERVAL(IPC_GET_IMETHOD(call), NET_UDP_FIRST, NET_UDP_LAST)
 
 /*@}*/
@@ -275,138 +274,113 @@
 /*@{*/
 
-/** Returns the device identifier message argument.
- * @param[in] call The message call structure.
- */
-#define IPC_GET_DEVICE(call) \
-	({ \
-		device_id_t device_id = (device_id_t) IPC_GET_ARG1(*call); \
-		device_id; \
-	})
-
-/** Returns the packet identifier message argument.
- * @param[in] call The message call structure.
- */
-#define IPC_GET_PACKET(call) \
-	({ \
-		packet_id_t packet_id = (packet_id_t) IPC_GET_ARG2(*call); \
-		packet_id; \
-	})
-
-/** Returns the count message argument.
- * @param[in] call The message call structure.
- */
-#define IPC_GET_COUNT(call) \
-	({ \
-		size_t size = (size_t) IPC_GET_ARG2(*call); \
-		size; \
-	})
-
-/** Returns the device state message argument.
- * @param[in] call The message call structure.
- */
-#define IPC_GET_STATE(call) \
-	({ \
-		device_state_t state = (device_state_t) IPC_GET_ARG2(*call); \
-		state; \
-	})
-
-/** Returns the maximum transmission unit message argument.
- * @param[in] call The message call structure.
- */
-#define IPC_GET_MTU(call) \
-	({ \
-		size_t size = (size_t) IPC_GET_ARG2(*call); \
-		size; \
-	})
-
-/** Returns the device driver service message argument.
- * @param[in] call The message call structure.
- */
-#define IPC_GET_SERVICE(call) \
-	({ \
-		services_t service = (services_t) IPC_GET_ARG3(*call); \
-		service; \
-	})
-
-/** Returns the target service message argument.
- * @param[in] call The message call structure.
- */
-#define IPC_GET_TARGET(call) \
-	({ \
-		services_t service = (services_t) IPC_GET_ARG3(*call); \
-		service; \
-	})
-
-/** Returns the sender service message argument.
- * @param[in] call The message call structure.
- */
-#define IPC_GET_SENDER(call) \
-	({ \
-		services_t service = (services_t) IPC_GET_ARG3(*call); \
-		service; \
-	})
-
-/** Returns the error service message argument.
- * @param[in] call The message call structure.
- */
-#define IPC_GET_ERROR(call) \
-	({ \
-		services_t service = (services_t) IPC_GET_ARG4(*call); \
-		service; \
-	})
-
-/** Returns the phone message argument.
- * @param[in] call The message call structure.
- */
-#define IPC_GET_PHONE(call) \
-	({ \
-		int phone = (int) IPC_GET_ARG5(*call); \
-		phone; \
-	})
-
-/** Sets the device identifier in the message answer.
- * @param[out] answer The message answer structure.
- */
-#define IPC_SET_DEVICE(answer, value) \
-	do { \
-		sysarg_t argument = (sysarg_t) (value); \
-		IPC_SET_ARG1(*answer, argument); \
-	} while (0)
-
-/** Sets the minimum address length in the message answer.
- * @param[out] answer The message answer structure.
- */
-#define IPC_SET_ADDR(answer, value) \
-	do { \
-		sysarg_t argument = (sysarg_t) (value); \
-		IPC_SET_ARG1(*answer, argument); \
-	} while (0)
-
-/** Sets the minimum prefix size in the message answer.
- * @param[out] answer The message answer structure.
- */
-#define IPC_SET_PREFIX(answer, value) \
-	do { \
-		sysarg_t argument = (sysarg_t) (value); \
-		IPC_SET_ARG2(*answer, argument); \
-	} while (0)
-
-/** Sets the maximum content size in the message answer.
- * @param[out] answer The message answer structure.
- */
-#define IPC_SET_CONTENT(answer, value) \
-	do { \
-		sysarg_t argument = (sysarg_t) (value); \
-		IPC_SET_ARG3(*answer, argument); \
-	} while (0)
-
-/** Sets the minimum suffix size in the message answer.
- * @param[out] answer The message answer structure.
- */
-#define IPC_SET_SUFFIX(answer, value) \
-	do { \
-		sysarg_t argument = (sysarg_t) (value); \
-		IPC_SET_ARG4(*answer, argument); \
-	} while (0)
+/** Return the device identifier message argument.
+ *
+ * @param[in] call Message call structure.
+ *
+ */
+#define IPC_GET_DEVICE(call)  ((device_id_t) IPC_GET_ARG1(call))
+
+/** Return the packet identifier message argument.
+ *
+ * @param[in] call Message call structure.
+ *
+ */
+#define IPC_GET_PACKET(call)  ((packet_id_t) IPC_GET_ARG2(call))
+
+/** Return the count message argument.
+ *
+ * @param[in] call Message call structure.
+ *
+ */
+#define IPC_GET_COUNT(call)  ((size_t) IPC_GET_ARG2(call))
+
+/** Return the device state message argument.
+ *
+ * @param[in] call Message call structure.
+ *
+ */
+#define IPC_GET_STATE(call)  ((device_state_t) IPC_GET_ARG2(call))
+
+/** Return the maximum transmission unit message argument.
+ *
+ * @param[in] call Message call structure.
+ *
+ */
+#define IPC_GET_MTU(call)  ((size_t) IPC_GET_ARG2(call))
+
+/** Return the device driver service message argument.
+ *
+ * @param[in] call Message call structure.
+ *
+ */
+#define IPC_GET_SERVICE(call)  ((services_t) IPC_GET_ARG3(call))
+
+/** Return the target service message argument.
+ *
+ * @param[in] call Message call structure.
+ *
+ */
+#define IPC_GET_TARGET(call)  ((services_t) IPC_GET_ARG3(call))
+
+/** Return the sender service message argument.
+ *
+ * @param[in] call Message call structure.
+ *
+ */
+#define IPC_GET_SENDER(call)  ((services_t) IPC_GET_ARG3(call))
+
+/** Return the error service message argument.
+ &
+ * @param[in] call Message call structure.
+ *
+ */
+#define IPC_GET_ERROR(call)  ((services_t) IPC_GET_ARG4(call))
+
+/** Return the phone message argument.
+ *
+ * @param[in] call Message call structure.
+ *
+ */
+#define IPC_GET_PHONE(call)  ((int) IPC_GET_ARG5(call))
+
+/** Set the device identifier in the message answer.
+ *
+ * @param[out] answer Message answer structure.
+ * @param[in]  value  Value to set.
+ *
+ */
+#define IPC_SET_DEVICE(answer, value)  IPC_SET_ARG1(answer, (sysarg_t) (value))
+
+/** Set the minimum address length in the message answer.
+ *
+ * @param[out] answer Message answer structure.
+ * @param[in]  value  Value to set.
+ *
+ */
+#define IPC_SET_ADDR(answer, value)  IPC_SET_ARG1(answer, (sysarg_t) (value))
+
+/** Set the minimum prefix size in the message answer.
+ *
+ * @param[out] answer Message answer structure.
+ * @param[in]  value  Value to set.
+ *
+ */
+#define IPC_SET_PREFIX(answer, value)  IPC_SET_ARG2(answer, (sysarg_t) (value))
+
+/** Set the maximum content size in the message answer.
+ *
+ * @param[out] answer Message answer structure.
+ * @param[in]  value  Value to set.
+ *
+ */
+#define IPC_SET_CONTENT(answer, value)  IPC_SET_ARG3(answer, (sysarg_t) (value))
+
+/** Set the minimum suffix size in the message answer.
+ *
+ * @param[out] answer Message answer structure.
+ * @param[in]  value  Value to set.
+ *
+ */
+#define IPC_SET_SUFFIX(answer, value)  IPC_SET_ARG4(answer, (sysarg_t) (value))
 
 /*@}*/
Index: uspace/lib/c/include/ipc/netif.h
===================================================================
--- uspace/lib/c/include/ipc/netif.h	(revision 3c106e8814a50268257db9a33c79a75e51e871ec)
+++ uspace/lib/c/include/ipc/netif.h	(revision 774e6d1abebc631f873d85e623bf7aa61b0aecea)
@@ -47,20 +47,25 @@
 	 */
 	NET_NETIF_PROBE = NET_NETIF_FIRST,
+	
 	/** Send packet message.
 	 * @see netif_send_msg()
 	 */
 	NET_NETIF_SEND,
+	
 	/** Start device message.
 	 * @see netif_start_req()
 	 */
 	NET_NETIF_START,
+	
 	/** Get device usage statistics message.
 	 * @see netif_stats_req()
 	 */
 	NET_NETIF_STATS,
+	
 	/** Stop device message.
 	 * @see netif_stop_req()
 	 */
 	NET_NETIF_STOP,
+	
 	/** Get device address message.
 	 * @see netif_get_addr_req()
@@ -73,20 +78,16 @@
 
 /** Return the interrupt number message parameter.
- * @param[in] call The message call structure.
+ *
+ * @param[in] call Mmessage call structure.
+ *
  */
-#define NETIF_GET_IRQ(call) \
-	({ \
-		int irq = (int) IPC_GET_ARG2(*call); \
-		irq; \
-	})
+#define NETIF_GET_IRQ(call) ((int) IPC_GET_ARG2(call))
 
 /** Return the input/output address message parameter.
- * @param[in] call The message call structure.
+ *
+ * @param[in] call Message call structure.
+ *
  */
-#define NETIF_GET_IO(call) \
-	({ \
-		int io = (int) IPC_GET_ARG3(*call); \
-		io; \
-	})
+#define NETIF_GET_IO(call) ((void *) IPC_GET_ARG3(call))
 
 /*@}*/
Index: uspace/lib/c/include/ipc/nil.h
===================================================================
--- uspace/lib/c/include/ipc/nil.h	(revision 3c106e8814a50268257db9a33c79a75e51e871ec)
+++ uspace/lib/c/include/ipc/nil.h	(revision 774e6d1abebc631f873d85e623bf7aa61b0aecea)
@@ -77,9 +77,5 @@
 
 /** Return the protocol service message parameter. */
-#define NIL_GET_PROTO(call) \
-	({ \
-		services_t service = (services_t) IPC_GET_ARG2(*call); \
-		service; \
-	})
+#define NIL_GET_PROTO(call)  ((services_t) IPC_GET_ARG2(call))
 
 /*@}*/
Index: uspace/lib/c/include/ipc/packet.h
===================================================================
--- uspace/lib/c/include/ipc/packet.h	(revision 3c106e8814a50268257db9a33c79a75e51e871ec)
+++ uspace/lib/c/include/ipc/packet.h	(revision 774e6d1abebc631f873d85e623bf7aa61b0aecea)
@@ -70,21 +70,21 @@
 } packet_messages;
 
-/** Returns the protocol service message parameter. */
-#define ARP_GET_PROTO(call)	(services_t) IPC_GET_ARG2(*call)
+/** Return the protocol service message parameter. */
+#define ARP_GET_PROTO(call)  ((services_t) IPC_GET_ARG2(call))
 
-/** Returns the packet identifier message parameter. */
-#define IPC_GET_ID(call)	(packet_id_t) IPC_GET_ARG1(*call)
+/** Return the packet identifier message parameter. */
+#define IPC_GET_ID(call)  ((packet_id_t) IPC_GET_ARG1(call))
 
-/** Returns the maximal content length message parameter. */
-#define IPC_GET_CONTENT(call)	(size_t) IPC_GET_ARG1(*call)
+/** Return the maximal content length message parameter. */
+#define IPC_GET_CONTENT(call)  ((size_t) IPC_GET_ARG1(call))
 
-/** Returns the maximal address length message parameter. */
-#define IPC_GET_ADDR_LEN(call)	(size_t) IPC_GET_ARG2(*call)
+/** Return the maximal address length message parameter. */
+#define IPC_GET_ADDR_LEN(call)  ((size_t) IPC_GET_ARG2(call))
 
-/** Returns the maximal prefix length message parameter. */
-#define IPC_GET_PREFIX(call)	(size_t) IPC_GET_ARG3(*call)
+/** Return the maximal prefix length message parameter. */
+#define IPC_GET_PREFIX(call)  ((size_t) IPC_GET_ARG3(call))
 
-/** Returns the maximal suffix length message parameter. */
-#define IPC_GET_SUFFIX(call)	(size_t) IPC_GET_ARG4(*call)
+/** Return the maximal suffix length message parameter. */
+#define IPC_GET_SUFFIX(call)  ((size_t) IPC_GET_ARG4(call))
 
 #endif
Index: uspace/lib/c/include/net/in.h
===================================================================
--- uspace/lib/c/include/net/in.h	(revision 3c106e8814a50268257db9a33c79a75e51e871ec)
+++ uspace/lib/c/include/net/in.h	(revision 774e6d1abebc631f873d85e623bf7aa61b0aecea)
@@ -43,10 +43,10 @@
 
 /** INET string address maximum length. */
-#define INET_ADDRSTRLEN		(4 * 3 + 3 + 1)
+#define INET_ADDRSTRLEN  (4 * 3 + 3 + 1)
 
 /** Type definition of the INET address.
  * @see in_addr
  */
-typedef struct in_addr		in_addr_t;
+typedef struct in_addr in_addr_t;
 
 /** Type definition of the INET socket address.
Index: uspace/lib/c/include/net/modules.h
===================================================================
--- uspace/lib/c/include/net/modules.h	(revision 3c106e8814a50268257db9a33c79a75e51e871ec)
+++ uspace/lib/c/include/net/modules.h	(revision 774e6d1abebc631f873d85e623bf7aa61b0aecea)
@@ -51,10 +51,12 @@
 /** Connect to the needed module function type definition.
  *
- * @param[in] need	The needed module service.
- * @return		The phone of the needed service.
+ * @param[in] need The needed module service.
+ *
+ * @return The phone of the needed service.
+ *
  */
 typedef int connect_module_t(services_t need);
 
-extern void answer_call(ipc_callid_t, int, ipc_call_t *, int);
+extern void answer_call(ipc_callid_t, int, ipc_call_t *, size_t);
 extern int bind_service(services_t, sysarg_t, sysarg_t, sysarg_t,
     async_client_conn_t);
@@ -64,5 +66,5 @@
 extern int connect_to_service_timeout(services_t, suseconds_t);
 extern int data_reply(void *, size_t);
-extern void refresh_answer(ipc_call_t *, int *);
+extern void refresh_answer(ipc_call_t *, size_t *);
 
 #endif
Index: uspace/lib/net/Makefile
===================================================================
--- uspace/lib/net/Makefile	(revision 3c106e8814a50268257db9a33c79a75e51e871ec)
+++ uspace/lib/net/Makefile	(revision 774e6d1abebc631f873d85e623bf7aa61b0aecea)
@@ -40,6 +40,6 @@
 	generic/protocol_map.c \
 	adt/module_map.c \
-	netif/netif_local.c \
 	netif/netif_remote.c \
+	netif/netif_skel.c \
 	nil/nil_remote.c \
 	il/il_interface.c \
Index: uspace/lib/net/il/ip_remote.c
===================================================================
--- uspace/lib/net/il/ip_remote.c	(revision 3c106e8814a50268257db9a33c79a75e51e871ec)
+++ uspace/lib/net/il/ip_remote.c	(revision 774e6d1abebc631f873d85e623bf7aa61b0aecea)
@@ -170,5 +170,5 @@
 		free(*header);
 	else
-		*device_id = IPC_GET_DEVICE(&answer);
+		*device_id = IPC_GET_DEVICE(answer);
 	
 	return (int) result;
Index: uspace/lib/net/include/il_local.h
===================================================================
--- uspace/lib/net/include/il_local.h	(revision 3c106e8814a50268257db9a33c79a75e51e871ec)
+++ uspace/lib/net/include/il_local.h	(revision 774e6d1abebc631f873d85e623bf7aa61b0aecea)
@@ -49,5 +49,5 @@
  */
 extern int il_module_message_standalone(ipc_callid_t callid, ipc_call_t *call,
-    ipc_call_t *answer, int *answer_count);
+    ipc_call_t *answer, size_t *answer_count);
 
 /** Starts the Internet layer module.
Index: uspace/lib/net/include/netif_interface.h
===================================================================
--- uspace/lib/net/include/netif_interface.h	(revision 3c106e8814a50268257db9a33c79a75e51e871ec)
+++ 	(revision )
@@ -1,52 +1,0 @@
-/*
- * Copyright (c) 2009 Lukas Mejdrech
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup libnet
- * @{
- */
-
-#ifndef LIBNET_NETIF_INTERFACE_H_
-#define LIBNET_NETIF_INTERFACE_H_
-
-#include <netif_remote.h>
-#include <packet_client.h>
-
-#define netif_module_message    netif_module_message_standalone
-#define netif_module_start      netif_module_start_standalone
-#define netif_get_addr_req      netif_get_addr_req_remote
-#define netif_probe_req         netif_probe_req_remote
-#define netif_send_msg          netif_send_msg_remote
-#define netif_start_req         netif_start_req_remote
-#define netif_stop_req          netif_stop_req_remote
-#define netif_stats_req         netif_stats_req_remote
-#define netif_bind_service      netif_bind_service_remote
-
-#endif
-
-/** @}
- */
Index: uspace/lib/net/include/netif_local.h
===================================================================
--- uspace/lib/net/include/netif_local.h	(revision 3c106e8814a50268257db9a33c79a75e51e871ec)
+++ 	(revision )
@@ -1,220 +1,0 @@
-/*
- * Copyright (c) 2009 Lukas Mejdrech
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup libnet
- * @{
- */
-
-/** @file
- * Network interface module skeleton.
- * The skeleton has to be part of each network interface module.
- */
-
-#ifndef NET_NETIF_LOCAL_H_
-#define NET_NETIF_LOCAL_H_
-
-#include <async.h>
-#include <fibril_synch.h>
-#include <ipc/ipc.h>
-#include <ipc/services.h>
-
-#include <adt/measured_strings.h>
-#include <net/device.h>
-#include <net/packet.h>
-
-/** Network interface device specific data. */
-typedef struct {
-	device_id_t device_id;  /**< Device identifier. */
-	int nil_phone;          /**< Receiving network interface layer phone. */
-	device_state_t state;   /**< Actual device state. */
-	void *specific;         /**< Driver specific data. */
-} netif_device_t;
-
-/** Device map.
- *
- * Maps device identifiers to the network interface device specific data.
- * @see device.h
- *
- */
-DEVICE_MAP_DECLARE(netif_device_map, netif_device_t);
-
-/** Network interface module skeleton global data. */
-typedef struct {
-	int net_phone;                  /**< Networking module phone. */
-	netif_device_map_t device_map;  /**< Device map. */
-	fibril_rwlock_t lock;           /**< Safety lock. */
-} netif_globals_t;
-
-extern netif_globals_t netif_globals;
-
-/** Initialize the specific module.
- *
- * This function has to be implemented in user code.
- */
-extern int netif_initialize(void);
-
-/** Probe the existence of the device.
- *
- * This has to be implemented in user code.
- *
- * @param[in] device_id	The device identifier.
- * @param[in] irq	The device interrupt number.
- * @param[in] io	The device input/output address.
- *
- * @return		EOK on success.
- * @return		Other error codes as defined for the find_device()
- *			function.
- * @return		Other error codes as defined for the specific module
- *			message implementation.
- */
-extern int netif_probe_message(device_id_t device_id, int irq, uintptr_t io);
-
-/** Send the packet queue.
- *
- * This has to be implemented in user code.
- *
- * @param[in] device_id	The device identifier.
- * @param[in] packet	The packet queue.
- * @param[in] sender	The sending module service.
- *
- * @return		EOK on success.
- * @return		EFORWARD if the device is not active (in the
- *			NETIF_ACTIVE state).
- * @return		Other error codes as defined for the find_device()
- *			function.
- * @return		Other error codes as defined for the specific module
- *			message implementation.
- */
-extern int netif_send_message(device_id_t device_id, packet_t *packet,
-    services_t sender);
-
-/** Start the device.
- *
- * This has to be implemented in user code.
- *
- * @param[in] device	The device structure.
- *
- * @return		EOK on success.
- * @return		Other error codes as defined for the find_device()
- *			function.
- * @return		Other error codes as defined for the specific module
- *			message implementation.
- */
-extern int netif_start_message(netif_device_t *device);
-
-/** Stop the device.
- *
- * This has to be implemented in user code.
- *
- * @param[in] device	The device structure.
- *
- * @return		EOK on success.
- * @return		Other error codes as defined for the find_device()
- *			function.
- * @return		Other error codes as defined for the specific module
- *			message implementation.
- */
-extern int netif_stop_message(netif_device_t *device);
-
-/** Return the device local hardware address.
- *
- * This has to be implemented in user code.
- *
- * @param[in] device_id	The device identifier.
- * @param[out] address	The device local hardware address.
- *
- * @return		EOK on success.
- * @return		EBADMEM if the address parameter is NULL.
- * @return		ENOENT if there no such device.
- * @return		Other error codes as defined for the find_device()
- *			function.
- * @return		Other error codes as defined for the specific module
- *			message implementation.
- */
-extern int netif_get_addr_message(device_id_t device_id,
-    measured_string_t *address);
-
-/** Process the netif driver specific message.
- *
- * This function is called for uncommon messages received by the netif
- * skeleton. This has to be implemented in user code.
- *
- * @param[in] callid	The message identifier.
- * @param[in] call	The message parameters.
- * @param[out] answer	The message answer parameters.
- * @param[out] answer_count The last parameter for the actual answer in
- *			the answer parameter.
- *
- * @return		EOK on success.
- * @return		ENOTSUP if the message is not known.
- * @return		Other error codes as defined for the specific module
- *			message implementation.
- */
-extern int netif_specific_message(ipc_callid_t callid, ipc_call_t *call,
-    ipc_call_t *answer, int *answer_count);
-
-/** Return the device usage statistics.
- *
- * This has to be implemented in user code.
- *
- * @param[in] device_id	The device identifier.
- * @param[out] stats	The device usage statistics.
- *
- * @return		EOK on success.
- * @return		Other error codes as defined for the find_device()
- *			function.
- * @return		Other error codes as defined for the specific module
- *			message implementation.
- */
-extern int netif_get_device_stats(device_id_t device_id,
-    device_stats_t *stats);
-
-extern int netif_get_addr_req_local(int, device_id_t, measured_string_t **,
-    uint8_t **);
-extern int netif_probe_req_local(int, device_id_t, int, int);
-extern int netif_send_msg_local(int, device_id_t, packet_t *, services_t);
-extern int netif_start_req_local(int, device_id_t);
-extern int netif_stop_req_local(int, device_id_t);
-extern int netif_stats_req_local(int, device_id_t, device_stats_t *);
-extern int netif_bind_service_local(services_t, device_id_t, services_t,
-    async_client_conn_t);
-
-extern int find_device(device_id_t, netif_device_t **);
-extern void null_device_stats(device_stats_t *);
-extern void netif_pq_release(packet_id_t);
-extern packet_t *netif_packet_get_1(size_t);
-extern int netif_init_module(async_client_conn_t);
-
-extern int netif_module_message_standalone(const char *, ipc_callid_t,
-    ipc_call_t *, ipc_call_t *, int *);
-extern int netif_module_start_standalone(async_client_conn_t);
-
-#endif
-
-/** @}
- */
Index: uspace/lib/net/include/netif_remote.h
===================================================================
--- uspace/lib/net/include/netif_remote.h	(revision 3c106e8814a50268257db9a33c79a75e51e871ec)
+++ uspace/lib/net/include/netif_remote.h	(revision 774e6d1abebc631f873d85e623bf7aa61b0aecea)
@@ -41,12 +41,12 @@
 #include <net/packet.h>
 
-extern int netif_get_addr_req_remote(int, device_id_t, measured_string_t **,
+extern int netif_get_addr_req(int, device_id_t, measured_string_t **,
     uint8_t **);
-extern int netif_probe_req_remote(int, device_id_t, int, int);
-extern int netif_send_msg_remote(int, device_id_t, packet_t *, services_t);
-extern int netif_start_req_remote(int, device_id_t);
-extern int netif_stop_req_remote(int, device_id_t);
-extern int netif_stats_req_remote(int, device_id_t, device_stats_t *);
-extern int netif_bind_service_remote(services_t, device_id_t, services_t,
+extern int netif_probe_req(int, device_id_t, int, void *);
+extern int netif_send_msg(int, device_id_t, packet_t *, services_t);
+extern int netif_start_req(int, device_id_t);
+extern int netif_stop_req(int, device_id_t);
+extern int netif_stats_req(int, device_id_t, device_stats_t *);
+extern int netif_bind_service(services_t, device_id_t, services_t,
     async_client_conn_t);
 
Index: uspace/lib/net/include/netif_skel.h
===================================================================
--- uspace/lib/net/include/netif_skel.h	(revision 774e6d1abebc631f873d85e623bf7aa61b0aecea)
+++ uspace/lib/net/include/netif_skel.h	(revision 774e6d1abebc631f873d85e623bf7aa61b0aecea)
@@ -0,0 +1,215 @@
+/*
+ * Copyright (c) 2009 Lukas Mejdrech
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/** @addtogroup libnet
+ * @{
+ */
+
+/** @file
+ * Network interface module skeleton.
+ * The skeleton has to be part of each network interface module.
+ */
+
+#ifndef NET_NETIF_SKEL_H_
+#define NET_NETIF_SKEL_H_
+
+#include <async.h>
+#include <fibril_synch.h>
+#include <ipc/ipc.h>
+#include <ipc/services.h>
+
+#include <adt/measured_strings.h>
+#include <net/device.h>
+#include <net/packet.h>
+
+/** Network interface device specific data. */
+typedef struct {
+	device_id_t device_id;  /**< Device identifier. */
+	int nil_phone;          /**< Receiving network interface layer phone. */
+	device_state_t state;   /**< Actual device state. */
+	void *specific;         /**< Driver specific data. */
+} netif_device_t;
+
+/** Device map.
+ *
+ * Maps device identifiers to the network interface device specific data.
+ * @see device.h
+ *
+ */
+DEVICE_MAP_DECLARE(netif_device_map, netif_device_t);
+
+/** Network interface module skeleton global data. */
+typedef struct {
+	int net_phone;                  /**< Networking module phone. */
+	netif_device_map_t device_map;  /**< Device map. */
+	fibril_rwlock_t lock;           /**< Safety lock. */
+} netif_globals_t;
+
+extern netif_globals_t netif_globals;
+
+/** Initialize the specific module.
+ *
+ * This function has to be implemented in user code.
+ *
+ */
+extern int netif_initialize(void);
+
+/** Probe the existence of the device.
+ *
+ * This has to be implemented in user code.
+ *
+ * @param[in] device_id Device identifier.
+ * @param[in] irq       Device interrupt number.
+ * @param[in] io        Device input/output address.
+ *
+ * @return EOK on success.
+ * @return Other error codes as defined for the find_device()
+ *         function.
+ * @return Other error codes as defined for the specific module
+ *         message implementation.
+ *
+ */
+extern int netif_probe_message(device_id_t device_id, int irq, void *io);
+
+/** Send the packet queue.
+ *
+ * This has to be implemented in user code.
+ *
+ * @param[in] device_id Device identifier.
+ * @param[in] packet    Packet queue.
+ * @param[in] sender    Sending module service.
+ *
+ * @return EOK on success.
+ * @return EFORWARD if the device is not active (in the
+ *         NETIF_ACTIVE state).
+ * @return Other error codes as defined for the find_device()
+ *         function.
+ * @return Other error codes as defined for the specific module
+ *         message implementation.
+ *
+ */
+extern int netif_send_message(device_id_t device_id, packet_t *packet,
+    services_t sender);
+
+/** Start the device.
+ *
+ * This has to be implemented in user code.
+ *
+ * @param[in] device Device structure.
+ *
+ * @return New network interface state (non-negative values).
+ * @return Other error codes as defined for the find_device()
+ *         function.
+ * @return Other error codes as defined for the specific module
+ *         message implementation.
+ 
+ *
+ */
+extern int netif_start_message(netif_device_t *device);
+
+/** Stop the device.
+ *
+ * This has to be implemented in user code.
+ *
+ * @param[in] device Device structure.
+ *
+ * @return EOK on success.
+ * @return Other error codes as defined for the find_device()
+ *         function.
+ * @return Other error codes as defined for the specific module
+ *         message implementation.
+ *
+ */
+extern int netif_stop_message(netif_device_t *device);
+
+/** Return the device local hardware address.
+ *
+ * This has to be implemented in user code.
+ *
+ * @param[in] device_id Device identifier.
+ * @param[out] address  Device local hardware address.
+ *
+ * @return EOK on success.
+ * @return EBADMEM if the address parameter is NULL.
+ * @return ENOENT if there no such device.
+ * @return Other error codes as defined for the find_device()
+ *         function.
+ * @return Other error codes as defined for the specific module
+ *         message implementation.
+ *
+ */
+extern int netif_get_addr_message(device_id_t device_id,
+    measured_string_t *address);
+
+/** Process the netif driver specific message.
+ *
+ * This function is called for uncommon messages received by the netif
+ * skeleton. This has to be implemented in user code.
+ *
+ * @param[in]  callid Message identifier.
+ * @param[in]  call   Message.
+ * @param[out] answer Answer.
+ * @param[out] count  Number of answer arguments.
+ *
+ * @return EOK on success.
+ * @return ENOTSUP if the message is not known.
+ * @return Other error codes as defined for the specific module
+ *         message implementation.
+ *
+ */
+extern int netif_specific_message(ipc_callid_t callid, ipc_call_t *call,
+    ipc_call_t *answer, size_t *count);
+
+/** Return the device usage statistics.
+ *
+ * This has to be implemented in user code.
+ *
+ * @param[in]  device_id Device identifier.
+ * @param[out] stats     Device usage statistics.
+ *
+ * @return EOK on success.
+ * @return Other error codes as defined for the find_device()
+ *         function.
+ * @return Other error codes as defined for the specific module
+ *         message implementation.
+ *
+ */
+extern int netif_get_device_stats(device_id_t device_id,
+    device_stats_t *stats);
+
+extern int find_device(device_id_t, netif_device_t **);
+extern void null_device_stats(device_stats_t *);
+extern void netif_pq_release(packet_id_t);
+extern packet_t *netif_packet_get_1(size_t);
+
+extern int netif_module_start(void);
+
+#endif
+
+/** @}
+ */
Index: uspace/lib/net/include/nil_local.h
===================================================================
--- uspace/lib/net/include/nil_local.h	(revision 3c106e8814a50268257db9a33c79a75e51e871ec)
+++ uspace/lib/net/include/nil_local.h	(revision 774e6d1abebc631f873d85e623bf7aa61b0aecea)
@@ -96,5 +96,5 @@
  */
 extern int nil_message_standalone(const char *, ipc_callid_t, ipc_call_t *,
-    ipc_call_t *, int *);
+    ipc_call_t *, size_t *);
 
 /** Pass the parameters to the module specific nil_message() function.
@@ -112,5 +112,5 @@
  */
 extern int nil_module_message_standalone(const char *, ipc_callid_t,
-    ipc_call_t *, ipc_call_t *, int *);
+    ipc_call_t *, ipc_call_t *, size_t *);
 
 /** Start the standalone nil layer module.
Index: uspace/lib/net/include/tl_local.h
===================================================================
--- uspace/lib/net/include/tl_local.h	(revision 3c106e8814a50268257db9a33c79a75e51e871ec)
+++ uspace/lib/net/include/tl_local.h	(revision 774e6d1abebc631f873d85e623bf7aa61b0aecea)
@@ -52,6 +52,5 @@
  */
 extern int tl_module_message_standalone(ipc_callid_t, ipc_call_t *,
-    ipc_call_t *, int *);
-
+    ipc_call_t *, size_t *);
 
 /** Processes the TL module message.
Index: uspace/lib/net/netif/netif_local.c
===================================================================
--- uspace/lib/net/netif/netif_local.c	(revision 3c106e8814a50268257db9a33c79a75e51e871ec)
+++ 	(revision )
@@ -1,458 +1,0 @@
-/*
- * Copyright (c) 2009 Lukas Mejdrech
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup libnet 
- * @{
- */
-
-/** @file
- * Network interface module skeleton implementation.
- * @see netif.h
- */
-
-#include <async.h>
-#include <mem.h>
-#include <fibril_synch.h>
-#include <stdio.h>
-#include <ipc/ipc.h>
-#include <ipc/services.h>
-#include <ipc/netif.h>
-#include <errno.h>
-
-#include <generic.h>
-#include <net/modules.h>
-#include <net/packet.h>
-#include <packet_client.h>
-#include <packet_remote.h>
-#include <adt/measured_strings.h>
-#include <net/device.h>
-#include <nil_interface.h>
-#include <netif_local.h>
-#include <netif_interface.h>
-
-DEVICE_MAP_IMPLEMENT(netif_device_map, netif_device_t);
-
-/** Network interface global data. */
-netif_globals_t netif_globals;
-
-/** Probe the existence of the device.
- *
- * @param[in] netif_phone The network interface phone.
- * @param[in] device_id	The device identifier.
- * @param[in] irq	The device interrupt number.
- * @param[in] io	The device input/output address.
- * @return		EOK on success.
- * @return		Other error codes as defined for the
- *			netif_probe_message().
- */
-int
-netif_probe_req_local(int netif_phone, device_id_t device_id, int irq, int io)
-{
-	fibril_rwlock_write_lock(&netif_globals.lock);
-	int result = netif_probe_message(device_id, irq, io);
-	fibril_rwlock_write_unlock(&netif_globals.lock);
-	
-	return result;
-}
-
-/** Send the packet queue.
- *
- * @param[in] netif_phone The network interface phone.
- * @param[in] device_id	The device identifier.
- * @param[in] packet	The packet queue.
- * @param[in] sender	The sending module service.
- * @return		EOK on success.
- * @return		Other error codes as defined for the generic_send_msg()
- *			function.
- */
-int netif_send_msg_local(int netif_phone, device_id_t device_id,
-    packet_t *packet, services_t sender)
-{
-	fibril_rwlock_write_lock(&netif_globals.lock);
-	int result = netif_send_message(device_id, packet, sender);
-	fibril_rwlock_write_unlock(&netif_globals.lock);
-	
-	return result;
-}
-
-/** Start the device.
- *
- * @param[in] netif_phone The network interface phone.
- * @param[in] device_id	The device identifier.
- * @return		EOK on success.
- * @return		Other error codes as defined for the find_device()
- *			function.
- * @return		Other error codes as defined for the
- *			netif_start_message() function.
- */
-int netif_start_req_local(int netif_phone, device_id_t device_id)
-{
-	int rc;
-	
-	fibril_rwlock_write_lock(&netif_globals.lock);
-	
-	netif_device_t *device;
-	rc = find_device(device_id, &device);
-	if (rc != EOK) {
-		fibril_rwlock_write_unlock(&netif_globals.lock);
-		return rc;
-	}
-	
-	int result = netif_start_message(device);
-	if (result > NETIF_NULL) {
-		int phone = device->nil_phone;
-		fibril_rwlock_write_unlock(&netif_globals.lock);
-		nil_device_state_msg(phone, device_id, result);
-		return EOK;
-	}
-	
-	fibril_rwlock_write_unlock(&netif_globals.lock);
-	
-	return result;
-}
-
-/** Stop the device.
- *
- * @param[in] netif_phone The network interface phone.
- * @param[in] device_id	The device identifier.
- * @return		EOK on success.
- * @return		Other error codes as defined for the find_device()
- *			function.
- * @return		Other error codes as defined for the
- *			netif_stop_message() function.
- */
-int netif_stop_req_local(int netif_phone, device_id_t device_id)
-{
-	int rc;
-	
-	fibril_rwlock_write_lock(&netif_globals.lock);
-	
-	netif_device_t *device;
-	rc = find_device(device_id, &device);
-	if (rc != EOK) {
-		fibril_rwlock_write_unlock(&netif_globals.lock);
-		return rc;
-	}
-	
-	int result = netif_stop_message(device);
-	if (result > NETIF_NULL) {
-		int phone = device->nil_phone;
-		fibril_rwlock_write_unlock(&netif_globals.lock);
-		nil_device_state_msg(phone, device_id, result);
-		return EOK;
-	}
-	
-	fibril_rwlock_write_unlock(&netif_globals.lock);
-	
-	return result;
-}
-
-/** Return the device usage statistics.
- *
- * @param[in] netif_phone The network interface phone.
- * @param[in] device_id	The device identifier.
- * @param[out] stats	The device usage statistics.
- * @return EOK on success.
- */
-int netif_stats_req_local(int netif_phone, device_id_t device_id,
-    device_stats_t *stats)
-{
-	fibril_rwlock_read_lock(&netif_globals.lock);
-	int res = netif_get_device_stats(device_id, stats);
-	fibril_rwlock_read_unlock(&netif_globals.lock);
-	
-	return res;
-}
-
-/** Return the device local hardware address.
- *
- * @param[in] netif_phone The network interface phone.
- * @param[in] device_id	The device identifier.
- * @param[out] address	The device local hardware address.
- * @param[out] data	The address data.
- * @return		EOK on success.
- * @return		EBADMEM if the address parameter is NULL.
- * @return		ENOENT if there no such device.
- * @return		Other error codes as defined for the
- *			netif_get_addr_message() function.
- */
-int netif_get_addr_req_local(int netif_phone, device_id_t device_id,
-    measured_string_t **address, uint8_t **data)
-{
-	int rc;
-	
-	if (!address || !data)
-		return EBADMEM;
-	
-	fibril_rwlock_read_lock(&netif_globals.lock);
-	
-	measured_string_t translation;
-	rc = netif_get_addr_message(device_id, &translation);
-	if (rc == EOK) {
-		*address = measured_string_copy(&translation);
-		rc = (*address) ? EOK : ENOMEM;
-	}
-	
-	fibril_rwlock_read_unlock(&netif_globals.lock);
-	
-	*data = (**address).value;
-	
-	return rc;
-}
-
-/** Find the device specific data.
- *
- * @param[in] device_id	The device identifier.
- * @param[out] device	The device specific data.
- * @return		EOK on success.
- * @return		ENOENT if device is not found.
- * @return		EPERM if the device is not initialized.
- */
-int find_device(device_id_t device_id, netif_device_t **device)
-{
-	if (!device)
-		return EBADMEM;
-	
-	*device = netif_device_map_find(&netif_globals.device_map, device_id);
-	if (*device == NULL)
-		return ENOENT;
-	
-	if ((*device)->state == NETIF_NULL)
-		return EPERM;
-	
-	return EOK;
-}
-
-/** Clear the usage statistics.
- *
- * @param[in] stats	The usage statistics.
- */
-void null_device_stats(device_stats_t *stats)
-{
-	bzero(stats, sizeof(device_stats_t));
-}
-
-/** Initialize the netif module.
- *
- * @param[in] client_connection The client connection functio to be registered.
- * @return		EOK on success.
- * @return		Other error codes as defined for each specific module
- *			message function.
- */
-int netif_init_module(async_client_conn_t client_connection)
-{
-	int rc;
-	
-	async_set_client_connection(client_connection);
-	
-	netif_globals.net_phone = connect_to_service(SERVICE_NETWORKING);
-	netif_device_map_initialize(&netif_globals.device_map);
-	
-	rc = pm_init();
-	if (rc != EOK)
-		return rc;
-	
-	fibril_rwlock_initialize(&netif_globals.lock);
-	
-	rc = netif_initialize();
-	if (rc != EOK) {
-		pm_destroy();
-		return rc;
-	}
-	
-	return EOK;
-}
-
-/** Release the given packet.
- *
- * Prepared for future optimization.
- *
- * @param[in] packet_id	The packet identifier.
- */
-void netif_pq_release(packet_id_t packet_id)
-{
-	pq_release_remote(netif_globals.net_phone, packet_id);
-}
-
-/** Allocate new packet to handle the given content size.
- *
- * @param[in] content	The minimum content size.
- * @return		The allocated packet.
- * @return		NULL if there is an error.
- *
- */
-packet_t *netif_packet_get_1(size_t content)
-{
-	return packet_get_1_remote(netif_globals.net_phone, content);
-}
-
-/** Register the device notification receiver, the network interface layer
- * module.
- *
- * @param[in] name	Module name.
- * @param[in] device_id	The device identifier.
- * @param[in] phone	The network interface layer module phone.
- * @return		EOK on success.
- * @return		ENOENT if there is no such device.
- * @return		ELIMIT if there is another module registered.
- */
-static int register_message(const char *name, device_id_t device_id, int phone)
-{
-	netif_device_t *device;
-	int rc;
-	
-	rc = find_device(device_id, &device);
-	if (rc != EOK)
-		return rc;
-	
-	if (device->nil_phone > 0)
-		return ELIMIT;
-	
-	device->nil_phone = phone;
-	printf("%s: Receiver of device %d registered (phone: %d)\n",
-	    name, device->device_id, device->nil_phone);
-	return EOK;
-}
-
-/** Process the netif module messages.
- *
- * @param[in] name 	Module name.
- * @param[in] callid	The message identifier.
- * @param[in] call	The message parameters.
- * @param[out] answer	The message answer parameters.
- * @param[out] answer_count The last parameter for the actual answer in the
- *			answer parameter.
- * @return		EOK on success.
- * @return		ENOTSUP if the message is not known.
- * @return		Other error codes as defined for each specific module
- *			message function.
- *
- * @see IS_NET_NETIF_MESSAGE()
- *
- */
-int netif_module_message_standalone(const char *name, ipc_callid_t callid,
-    ipc_call_t *call, ipc_call_t *answer, int *answer_count)
-{
-	size_t length;
-	device_stats_t stats;
-	packet_t *packet;
-	measured_string_t address;
-	int rc;
-	
-	*answer_count = 0;
-	switch (IPC_GET_IMETHOD(*call)) {
-	case IPC_M_PHONE_HUNGUP:
-		return EOK;
-	
-	case NET_NETIF_PROBE:
-		return netif_probe_req_local(0, IPC_GET_DEVICE(call),
-		    NETIF_GET_IRQ(call), NETIF_GET_IO(call));
-		    
-	case IPC_M_CONNECT_TO_ME:
-		fibril_rwlock_write_lock(&netif_globals.lock);
-		rc = register_message(name, IPC_GET_DEVICE(call),
-		    IPC_GET_PHONE(call));
-		fibril_rwlock_write_unlock(&netif_globals.lock);
-		return rc;
-		
-	case NET_NETIF_SEND:
-		rc = packet_translate_remote(netif_globals.net_phone, &packet,
-		    IPC_GET_PACKET(call));
-		if (rc != EOK)
-			return rc;
-		return netif_send_msg_local(0, IPC_GET_DEVICE(call), packet,
-		    IPC_GET_SENDER(call));
-		
-	case NET_NETIF_START:
-		return netif_start_req_local(0, IPC_GET_DEVICE(call));
-		
-	case NET_NETIF_STATS:
-		fibril_rwlock_read_lock(&netif_globals.lock);
-
-		rc = async_data_read_receive(&callid, &length);
-		if (rc != EOK) {
-			fibril_rwlock_read_unlock(&netif_globals.lock);
-			return rc;
-		}
-		if (length < sizeof(device_stats_t)) {
-			fibril_rwlock_read_unlock(&netif_globals.lock);
-			return EOVERFLOW;
-		}
-
-		rc = netif_get_device_stats(IPC_GET_DEVICE(call), &stats);
-		if (rc == EOK) {
-			rc = async_data_read_finalize(callid, &stats,
-			    sizeof(device_stats_t));
-		}
-
-		fibril_rwlock_read_unlock(&netif_globals.lock);
-		return rc;
-
-	case NET_NETIF_STOP:
-		return netif_stop_req_local(0, IPC_GET_DEVICE(call));
-		
-	case NET_NETIF_GET_ADDR:
-		fibril_rwlock_read_lock(&netif_globals.lock);
-		rc = netif_get_addr_message(IPC_GET_DEVICE(call), &address);
-		if (rc == EOK)
-			rc = measured_strings_reply(&address, 1);
-		fibril_rwlock_read_unlock(&netif_globals.lock);
-		return rc;
-	}
-	
-	return netif_specific_message(callid, call, answer, answer_count);
-}
-
-/** Start the network interface module.
- *
- * Initialize the client connection serving function, initialize the module,
- * registers the module service and start the async manager, processing IPC
- * messages in an infinite loop.
- *
- * @param[in] client_connection The client connection processing function.
- *			The module skeleton propagates its own one.
- * @return		EOK on success.
- * @return		Other error codes as defined for each specific module
- *			message function.
- */
-int netif_module_start_standalone(async_client_conn_t client_connection)
-{
-	int rc;
-	
-	rc = netif_init_module(client_connection);
-	if (rc != EOK)
-		return rc;
-	
-	async_manager();
-	
-	pm_destroy();
-	return EOK;
-}
-
-/** @}
- */
Index: uspace/lib/net/netif/netif_remote.c
===================================================================
--- uspace/lib/net/netif/netif_remote.c	(revision 3c106e8814a50268257db9a33c79a75e51e871ec)
+++ uspace/lib/net/netif/netif_remote.c	(revision 774e6d1abebc631f873d85e623bf7aa61b0aecea)
@@ -27,5 +27,5 @@
  */
 
-/** @addtogroup libnet 
+/** @addtogroup libnet
  * @{
  */
@@ -49,15 +49,17 @@
 /** Return the device local hardware address.
  *
- * @param[in] netif_phone The network interface phone.
- * @param[in] device_id	The device identifier.
- * @param[out] address	The device local hardware address.
- * @param[out] data	The address data.
- * @return		EOK on success.
- * @return		EBADMEM if the address parameter is NULL.
- * @return		ENOENT if there no such device.
- * @return		Other error codes as defined for the
- *			netif_get_addr_message() function.
+ * @param[in]  netif_phone Network interface phone.
+ * @param[in]  device_id   Device identifier.
+ * @param[out] address     Device local hardware address.
+ * @param[out] data        Address data.
+ *
+ * @return EOK on success.
+ * @return EBADMEM if the address parameter is NULL.
+ * @return ENOENT if there no such device.
+ * @return Other error codes as defined for the
+ *         netif_get_addr_message() function.
+ *
  */
-int netif_get_addr_req_remote(int netif_phone, device_id_t device_id,
+int netif_get_addr_req(int netif_phone, device_id_t device_id,
     measured_string_t **address, uint8_t **data)
 {
@@ -68,30 +70,33 @@
 /** Probe the existence of the device.
  *
- * @param[in] netif_phone The network interface phone.
- * @param[in] device_id	The device identifier.
- * @param[in] irq	The device interrupt number.
- * @param[in] io	The device input/output address.
- * @return		EOK on success.
- * @return		Other error codes as defined for the
- *			netif_probe_message().
+ * @param[in] netif_phone Network interface phone.
+ * @param[in] device_id   Device identifier.
+ * @param[in] irq         Device interrupt number.
+ * @param[in] io          Device input/output address.
+ *
+ * @return EOK on success.
+ * @return Other error codes as defined for the
+ *         netif_probe_message().
+ *
  */
-int
-netif_probe_req_remote(int netif_phone, device_id_t device_id, int irq, int io)
+int netif_probe_req(int netif_phone, device_id_t device_id, int irq, void *io)
 {
-	return async_req_3_0(netif_phone, NET_NETIF_PROBE, device_id, irq, io);
+	return async_req_3_0(netif_phone, NET_NETIF_PROBE, device_id, irq,
+	    (sysarg_t) io);
 }
 
 /** Send the packet queue.
  *
- * @param[in] netif_phone The network interface phone.
- * @param[in] device_id	The device identifier.
- * @param[in] packet	The packet queue.
- * @param[in] sender	The sending module service.
- * @return		EOK on success.
- * @return		Other error codes as defined for the generic_send_msg()
- *			function.
+ * @param[in] netif_phone Network interface phone.
+ * @param[in] device_id   Device identifier.
+ * @param[in] packet      Packet queue.
+ * @param[in] sender      Sending module service.
+ *
+ * @return EOK on success.
+ * @return Other error codes as defined for the generic_send_msg()
+ *         function.
+ *
  */
-int
-netif_send_msg_remote(int netif_phone, device_id_t device_id, packet_t *packet,
+int netif_send_msg(int netif_phone, device_id_t device_id, packet_t *packet,
     services_t sender)
 {
@@ -102,13 +107,15 @@
 /** Start the device.
  *
- * @param[in] netif_phone The network interface phone.
- * @param[in] device_id	The device identifier.
- * @return		EOK on success.
- * @return		Other error codes as defined for the find_device()
- *			function.
- * @return		Other error codes as defined for the
- *			netif_start_message() function.
+ * @param[in] netif_phone Network interface phone.
+ * @param[in] device_id   Device identifier.
+ *
+ * @return EOK on success.
+ * @return Other error codes as defined for the find_device()
+ *         function.
+ * @return Other error codes as defined for the
+ *         netif_start_message() function.
+ *
  */
-int netif_start_req_remote(int netif_phone, device_id_t device_id)
+int netif_start_req(int netif_phone, device_id_t device_id)
 {
 	return async_req_1_0(netif_phone, NET_NETIF_START, device_id);
@@ -117,13 +124,15 @@
 /** Stop the device.
  *
- * @param[in] netif_phone The network interface phone.
- * @param[in] device_id	The device identifier.
- * @return		EOK on success.
- * @return		Other error codes as defined for the find_device()
- *			function.
- * @return		Other error codes as defined for the
- *			netif_stop_message() function.
+ * @param[in] netif_phone Network interface phone.
+ * @param[in] device_id   Device identifier.
+ *
+ * @return EOK on success.
+ * @return Other error codes as defined for the find_device()
+ *         function.
+ * @return Other error codes as defined for the
+ *         netif_stop_message() function.
+ *
  */
-int netif_stop_req_remote(int netif_phone, device_id_t device_id)
+int netif_stop_req(int netif_phone, device_id_t device_id)
 {
 	return async_req_1_0(netif_phone, NET_NETIF_STOP, device_id);
@@ -132,10 +141,12 @@
 /** Return the device usage statistics.
  *
- * @param[in] netif_phone The network interface phone.
- * @param[in] device_id	The device identifier.
- * @param[out] stats	The device usage statistics.
+ * @param[in] netif_phone Network interface phone.
+ * @param[in] device_id   Device identifier.
+ * @param[out] stats      Device usage statistics.
+ *
  * @return EOK on success.
+ *
  */
-int netif_stats_req_remote(int netif_phone, device_id_t device_id,
+int netif_stats_req(int netif_phone, device_id_t device_id,
     device_stats_t *stats)
 {
@@ -153,6 +164,8 @@
 }
 
-/** Create bidirectional connection with the network interface module and
- * registers the message receiver.
+/** Create bidirectional connection with the network interface module
+ *
+ * Create bidirectional connection with the network interface module and
+ * register the message receiver.
  *
  * @param[in] service   The network interface module service.
@@ -161,11 +174,11 @@
  * @param[in] receiver  The message receiver.
  *
- * @return		The phone of the needed service.
- * @return		EOK on success.
- * @return		Other error codes as defined for the bind_service()
- *			function.
+ * @return The phone of the needed service.
+ * @return EOK on success.
+ * @return Other error codes as defined for the bind_service()
+ *         function.
+ *
  */
-int
-netif_bind_service_remote(services_t service, device_id_t device_id,
+int netif_bind_service(services_t service, device_id_t device_id,
     services_t me, async_client_conn_t receiver)
 {
Index: uspace/lib/net/netif/netif_skel.c
===================================================================
--- uspace/lib/net/netif/netif_skel.c	(revision 774e6d1abebc631f873d85e623bf7aa61b0aecea)
+++ uspace/lib/net/netif/netif_skel.c	(revision 774e6d1abebc631f873d85e623bf7aa61b0aecea)
@@ -0,0 +1,434 @@
+/*
+ * Copyright (c) 2009 Lukas Mejdrech
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/** @addtogroup libnet
+ * @{
+ */
+
+/** @file
+ * Network interface module skeleton implementation.
+ * @see netif.h
+ */
+
+#include <async.h>
+#include <mem.h>
+#include <fibril_synch.h>
+#include <stdio.h>
+#include <ipc/ipc.h>
+#include <ipc/services.h>
+#include <ipc/netif.h>
+#include <errno.h>
+
+#include <generic.h>
+#include <net/modules.h>
+#include <net/packet.h>
+#include <packet_client.h>
+#include <packet_remote.h>
+#include <adt/measured_strings.h>
+#include <net/device.h>
+#include <nil_interface.h>
+#include <netif_skel.h>
+
+DEVICE_MAP_IMPLEMENT(netif_device_map, netif_device_t);
+
+/** Network interface global data. */
+netif_globals_t netif_globals;
+
+/** Probe the existence of the device.
+ *
+ * @param[in] netif_phone Network interface phone.
+ * @param[in] device_id   Device identifier.
+ * @param[in] irq         Device interrupt number.
+ * @param[in] io          Device input/output address.
+ *
+ * @return EOK on success.
+ * @return Other error codes as defined for the
+ *         netif_probe_message().
+ *
+ */
+static int netif_probe_req_local(int netif_phone, device_id_t device_id,
+    int irq, void *io)
+{
+	fibril_rwlock_write_lock(&netif_globals.lock);
+	int result = netif_probe_message(device_id, irq, io);
+	fibril_rwlock_write_unlock(&netif_globals.lock);
+	
+	return result;
+}
+
+/** Send the packet queue.
+ *
+ * @param[in] netif_phone Network interface phone.
+ * @param[in] device_id   Device identifier.
+ * @param[in] packet      Packet queue.
+ * @param[in] sender      Sending module service.
+ *
+ * @return EOK on success.
+ * @return Other error codes as defined for the generic_send_msg()
+ *         function.
+ *
+ */
+static int netif_send_msg_local(int netif_phone, device_id_t device_id,
+    packet_t *packet, services_t sender)
+{
+	fibril_rwlock_write_lock(&netif_globals.lock);
+	int result = netif_send_message(device_id, packet, sender);
+	fibril_rwlock_write_unlock(&netif_globals.lock);
+	
+	return result;
+}
+
+/** Start the device.
+ *
+ * @param[in] netif_phone Network interface phone.
+ * @param[in] device_id   Device identifier.
+ *
+ * @return EOK on success.
+ * @return Other error codes as defined for the find_device()
+ *         function.
+ * @return Other error codes as defined for the
+ *         netif_start_message() function.
+ *
+ */
+static int netif_start_req_local(int netif_phone, device_id_t device_id)
+{
+	fibril_rwlock_write_lock(&netif_globals.lock);
+	
+	netif_device_t *device;
+	int rc = find_device(device_id, &device);
+	if (rc != EOK) {
+		fibril_rwlock_write_unlock(&netif_globals.lock);
+		return rc;
+	}
+	
+	int result = netif_start_message(device);
+	if (result > NETIF_NULL) {
+		int phone = device->nil_phone;
+		fibril_rwlock_write_unlock(&netif_globals.lock);
+		nil_device_state_msg(phone, device_id, result);
+		return EOK;
+	}
+	
+	fibril_rwlock_write_unlock(&netif_globals.lock);
+	
+	return result;
+}
+
+/** Stop the device.
+ *
+ * @param[in] netif_phone Network interface phone.
+ * @param[in] device_id   Device identifier.
+ *
+ * @return EOK on success.
+ * @return Other error codes as defined for the find_device()
+ *         function.
+ * @return Other error codes as defined for the
+ *         netif_stop_message() function.
+ *
+ */
+static int netif_stop_req_local(int netif_phone, device_id_t device_id)
+{
+	fibril_rwlock_write_lock(&netif_globals.lock);
+	
+	netif_device_t *device;
+	int rc = find_device(device_id, &device);
+	if (rc != EOK) {
+		fibril_rwlock_write_unlock(&netif_globals.lock);
+		return rc;
+	}
+	
+	int result = netif_stop_message(device);
+	if (result > NETIF_NULL) {
+		int phone = device->nil_phone;
+		fibril_rwlock_write_unlock(&netif_globals.lock);
+		nil_device_state_msg(phone, device_id, result);
+		return EOK;
+	}
+	
+	fibril_rwlock_write_unlock(&netif_globals.lock);
+	
+	return result;
+}
+
+/** Find the device specific data.
+ *
+ * @param[in]  device_id Device identifier.
+ * @param[out] device    Device specific data.
+ *
+ * @return EOK on success.
+ * @return ENOENT if device is not found.
+ * @return EPERM if the device is not initialized.
+ *
+ */
+int find_device(device_id_t device_id, netif_device_t **device)
+{
+	if (!device)
+		return EBADMEM;
+	
+	*device = netif_device_map_find(&netif_globals.device_map, device_id);
+	if (*device == NULL)
+		return ENOENT;
+	
+	if ((*device)->state == NETIF_NULL)
+		return EPERM;
+	
+	return EOK;
+}
+
+/** Clear the usage statistics.
+ *
+ * @param[in] stats The usage statistics.
+ *
+ */
+void null_device_stats(device_stats_t *stats)
+{
+	bzero(stats, sizeof(device_stats_t));
+}
+
+/** Release the given packet.
+ *
+ * Prepared for future optimization.
+ *
+ * @param[in] packet_id The packet identifier.
+ *
+ */
+void netif_pq_release(packet_id_t packet_id)
+{
+	pq_release_remote(netif_globals.net_phone, packet_id);
+}
+
+/** Allocate new packet to handle the given content size.
+ *
+ * @param[in] content Minimum content size.
+ *
+ * @return The allocated packet.
+ * @return NULL on error.
+ *
+ */
+packet_t *netif_packet_get_1(size_t content)
+{
+	return packet_get_1_remote(netif_globals.net_phone, content);
+}
+
+/** Register the device notification receiver,
+ *
+ * Register a  network interface layer module as the device
+ * notification receiver.
+ *
+ * @param[in] device_id Device identifier.
+ * @param[in] phone     Network interface layer module phone.
+ *
+ * @return EOK on success.
+ * @return ENOENT if there is no such device.
+ * @return ELIMIT if there is another module registered.
+ *
+ */
+static int register_message(device_id_t device_id, int phone)
+{
+	netif_device_t *device;
+	int rc = find_device(device_id, &device);
+	if (rc != EOK)
+		return rc;
+	
+	if (device->nil_phone >= 0)
+		return ELIMIT;
+	
+	device->nil_phone = phone;
+	return EOK;
+}
+
+/** Process the netif module messages.
+ *
+ * @param[in]  callid Mmessage identifier.
+ * @param[in]  call   Message.
+ * @param[out] answer Answer.
+ * @param[out] count  Number of arguments of the answer.
+ *
+ * @return EOK on success.
+ * @return ENOTSUP if the message is unknown.
+ * @return Other error codes as defined for each specific module
+ *         message function.
+ *
+ * @see IS_NET_NETIF_MESSAGE()
+ *
+ */
+static int netif_module_message(ipc_callid_t callid, ipc_call_t *call,
+    ipc_call_t *answer, size_t *count)
+{
+	size_t length;
+	device_stats_t stats;
+	packet_t *packet;
+	measured_string_t address;
+	int rc;
+	
+	*count = 0;
+	
+	switch (IPC_GET_IMETHOD(*call)) {
+	case IPC_M_PHONE_HUNGUP:
+		return EOK;
+	
+	case NET_NETIF_PROBE:
+		return netif_probe_req_local(0, IPC_GET_DEVICE(*call),
+		    NETIF_GET_IRQ(*call), NETIF_GET_IO(*call));
+	
+	case IPC_M_CONNECT_TO_ME:
+		fibril_rwlock_write_lock(&netif_globals.lock);
+		
+		rc = register_message(IPC_GET_DEVICE(*call), IPC_GET_PHONE(*call));
+		
+		fibril_rwlock_write_unlock(&netif_globals.lock);
+		return rc;
+	
+	case NET_NETIF_SEND:
+		rc = packet_translate_remote(netif_globals.net_phone, &packet,
+		    IPC_GET_PACKET(*call));
+		if (rc != EOK)
+			return rc;
+		
+		return netif_send_msg_local(0, IPC_GET_DEVICE(*call), packet,
+		    IPC_GET_SENDER(*call));
+	
+	case NET_NETIF_START:
+		return netif_start_req_local(0, IPC_GET_DEVICE(*call));
+	
+	case NET_NETIF_STATS:
+		fibril_rwlock_read_lock(&netif_globals.lock);
+		
+		rc = async_data_read_receive(&callid, &length);
+		if (rc != EOK) {
+			fibril_rwlock_read_unlock(&netif_globals.lock);
+			return rc;
+		}
+		
+		if (length < sizeof(device_stats_t)) {
+			fibril_rwlock_read_unlock(&netif_globals.lock);
+			return EOVERFLOW;
+		}
+		
+		rc = netif_get_device_stats(IPC_GET_DEVICE(*call), &stats);
+		if (rc == EOK) {
+			rc = async_data_read_finalize(callid, &stats,
+			    sizeof(device_stats_t));
+		}
+		
+		fibril_rwlock_read_unlock(&netif_globals.lock);
+		return rc;
+	
+	case NET_NETIF_STOP:
+		return netif_stop_req_local(0, IPC_GET_DEVICE(*call));
+	
+	case NET_NETIF_GET_ADDR:
+		fibril_rwlock_read_lock(&netif_globals.lock);
+		
+		rc = netif_get_addr_message(IPC_GET_DEVICE(*call), &address);
+		if (rc == EOK)
+			rc = measured_strings_reply(&address, 1);
+		
+		fibril_rwlock_read_unlock(&netif_globals.lock);
+		return rc;
+	}
+	
+	return netif_specific_message(callid, call, answer, count);
+}
+
+/** Default fibril for new module connections.
+ *
+ * @param[in] iid   Initial message identifier.
+ * @param[in] icall Initial message call structure.
+ *
+ */
+static void netif_client_connection(ipc_callid_t iid, ipc_call_t *icall)
+{
+	/*
+	 * Accept the connection by answering
+	 * the initial IPC_M_CONNECT_ME_TO call.
+	 */
+	ipc_answer_0(iid, EOK);
+	
+	while (true) {
+		ipc_call_t answer;
+		size_t count;
+		
+		/* Clear the answer structure */
+		refresh_answer(&answer, &count);
+		
+		/* Fetch the next message */
+		ipc_call_t call;
+		ipc_callid_t callid = async_get_call(&call);
+		
+		/* Process the message */
+		int res = netif_module_message(callid, &call, &answer, &count);
+		
+		/* End if said to either by the message or the processing result */
+		if ((IPC_GET_IMETHOD(call) == IPC_M_PHONE_HUNGUP) ||
+		    (res == EHANGUP))
+			return;
+		
+		/* Answer the message */
+		answer_call(callid, res, &answer, count);
+	}
+}
+
+/** Start the network interface module.
+ *
+ * Initialize the client connection serving function, initialize the module,
+ * registers the module service and start the async manager, processing IPC
+ * messages in an infinite loop.
+ *
+ * @return EOK on success.
+ * @return Other error codes as defined for each specific module
+ *         message function.
+ *
+ */
+int netif_module_start(void)
+{
+	async_set_client_connection(netif_client_connection);
+	
+	netif_globals.net_phone = connect_to_service(SERVICE_NETWORKING);
+	netif_device_map_initialize(&netif_globals.device_map);
+	
+	int rc = pm_init();
+	if (rc != EOK)
+		return rc;
+	
+	fibril_rwlock_initialize(&netif_globals.lock);
+	
+	rc = netif_initialize();
+	if (rc != EOK) {
+		pm_destroy();
+		return rc;
+	}
+	
+	async_manager();
+	
+	pm_destroy();
+	return EOK;
+}
+
+/** @}
+ */
Index: uspace/lib/packet/generic/packet_server.c
===================================================================
--- uspace/lib/packet/generic/packet_server.c	(revision 3c106e8814a50268257db9a33c79a75e51e871ec)
+++ uspace/lib/packet/generic/packet_server.c	(revision 774e6d1abebc631f873d85e623bf7aa61b0aecea)
@@ -322,5 +322,5 @@
 int
 packet_server_message(ipc_callid_t callid, ipc_call_t *call, ipc_call_t *answer,
-    int *answer_count)
+    size_t *answer_count)
 {
 	packet_t *packet;
@@ -333,5 +333,5 @@
 	case NET_PACKET_CREATE_1:
 		packet = packet_get_local(DEFAULT_ADDR_LEN, DEFAULT_PREFIX,
-		    IPC_GET_CONTENT(call), DEFAULT_SUFFIX);
+		    IPC_GET_CONTENT(*call), DEFAULT_SUFFIX);
 		if (!packet)
 			return ENOMEM;
@@ -343,9 +343,9 @@
 	case NET_PACKET_CREATE_4:
 		packet = packet_get_local(
-		    ((DEFAULT_ADDR_LEN < IPC_GET_ADDR_LEN(call)) ?
-		    IPC_GET_ADDR_LEN(call) : DEFAULT_ADDR_LEN),
-		    DEFAULT_PREFIX + IPC_GET_PREFIX(call),
-		    IPC_GET_CONTENT(call),
-		    DEFAULT_SUFFIX + IPC_GET_SUFFIX(call));
+		    ((DEFAULT_ADDR_LEN < IPC_GET_ADDR_LEN(*call)) ?
+		    IPC_GET_ADDR_LEN(*call) : DEFAULT_ADDR_LEN),
+		    DEFAULT_PREFIX + IPC_GET_PREFIX(*call),
+		    IPC_GET_CONTENT(*call),
+		    DEFAULT_SUFFIX + IPC_GET_SUFFIX(*call));
 		if (!packet)
 			return ENOMEM;
@@ -356,5 +356,5 @@
 	
 	case NET_PACKET_GET:
-		packet = pm_find(IPC_GET_ID(call));
+		packet = pm_find(IPC_GET_ID(*call));
 		if (!packet_is_valid(packet))
 			return ENOENT;
@@ -362,5 +362,5 @@
 	
 	case NET_PACKET_GET_SIZE:
-		packet = pm_find(IPC_GET_ID(call));
+		packet = pm_find(IPC_GET_ID(*call));
 		if (!packet_is_valid(packet))
 			return ENOENT;
@@ -370,5 +370,5 @@
 	
 	case NET_PACKET_RELEASE:
-		return packet_release_wrapper(IPC_GET_ID(call));
+		return packet_release_wrapper(IPC_GET_ID(*call));
 	}
 	
Index: uspace/lib/packet/include/packet_server.h
===================================================================
--- uspace/lib/packet/include/packet_server.h	(revision 3c106e8814a50268257db9a33c79a75e51e871ec)
+++ uspace/lib/packet/include/packet_server.h	(revision 774e6d1abebc631f873d85e623bf7aa61b0aecea)
@@ -48,5 +48,5 @@
 
 extern int packet_server_message(ipc_callid_t, ipc_call_t *, ipc_call_t *,
-    int *);
+    size_t *);
 
 #endif
Index: uspace/srv/net/il/arp/arp.c
===================================================================
--- uspace/srv/net/il/arp/arp.c	(revision 3c106e8814a50268257db9a33c79a75e51e871ec)
+++ uspace/srv/net/il/arp/arp.c	(revision 774e6d1abebc631f873d85e623bf7aa61b0aecea)
@@ -457,5 +457,5 @@
 	uint8_t *des_proto;
 	int rc;
-
+	
 	length = packet_get_data_length(packet);
 	if (length <= sizeof(arp_header_t))
@@ -677,5 +677,5 @@
 int
 arp_message_standalone(ipc_callid_t callid, ipc_call_t *call,
-    ipc_call_t *answer, int *answer_count)
+    ipc_call_t *answer, size_t *answer_count)
 {
 	measured_string_t *address;
@@ -696,6 +696,6 @@
 			return rc;
 		
-		rc = arp_device_message(IPC_GET_DEVICE(call),
-		    IPC_GET_SERVICE(call), ARP_GET_NETIF(call), address);
+		rc = arp_device_message(IPC_GET_DEVICE(*call),
+		    IPC_GET_SERVICE(*call), ARP_GET_NETIF(*call), address);
 		if (rc != EOK) {
 			free(address);
@@ -710,6 +710,6 @@
 		
 		fibril_mutex_lock(&arp_globals.lock);
-		rc = arp_translate_message(IPC_GET_DEVICE(call),
-		    IPC_GET_SERVICE(call), address, &translation);
+		rc = arp_translate_message(IPC_GET_DEVICE(*call),
+		    IPC_GET_SERVICE(*call), address, &translation);
 		free(address);
 		free(data);
@@ -727,5 +727,5 @@
 
 	case NET_ARP_CLEAR_DEVICE:
-		return arp_clear_device_req(0, IPC_GET_DEVICE(call));
+		return arp_clear_device_req(0, IPC_GET_DEVICE(*call));
 
 	case NET_ARP_CLEAR_ADDRESS:
@@ -734,6 +734,6 @@
 			return rc;
 		
-		arp_clear_address_req(0, IPC_GET_DEVICE(call),
-		    IPC_GET_SERVICE(call), address);
+		arp_clear_address_req(0, IPC_GET_DEVICE(*call),
+		    IPC_GET_SERVICE(*call), address);
 		free(address);
 		free(data);
@@ -750,5 +750,5 @@
 		
 		rc = packet_translate_remote(arp_globals.net_phone, &packet,
-		    IPC_GET_PACKET(call));
+		    IPC_GET_PACKET(*call));
 		if (rc != EOK)
 			return rc;
@@ -757,5 +757,5 @@
 		do {
 			next = pq_detach(packet);
-			rc = arp_receive_message(IPC_GET_DEVICE(call), packet);
+			rc = arp_receive_message(IPC_GET_DEVICE(*call), packet);
 			if (rc != 1) {
 				pq_release_remote(arp_globals.net_phone,
@@ -769,6 +769,6 @@
 	
 	case NET_IL_MTU_CHANGED:
-		return arp_mtu_changed_message(IPC_GET_DEVICE(call),
-		    IPC_GET_MTU(call));
+		return arp_mtu_changed_message(IPC_GET_DEVICE(*call),
+		    IPC_GET_MTU(*call));
 	}
 	
@@ -791,8 +791,8 @@
 	while (true) {
 		ipc_call_t answer;
-		int answer_count;
+		size_t count;
 		
 		/* Clear the answer structure */
-		refresh_answer(&answer, &answer_count);
+		refresh_answer(&answer, &count);
 		
 		/* Fetch the next message */
@@ -802,5 +802,5 @@
 		/* Process the message */
 		int res = il_module_message_standalone(callid, &call, &answer,
-		    &answer_count);
+		    &count);
 		
 		/*
@@ -813,5 +813,5 @@
 		
 		/* Answer the message */
-		answer_call(callid, res, &answer, answer_count);
+		answer_call(callid, res, &answer, count);
 	}
 }
Index: uspace/srv/net/il/arp/arp_module.c
===================================================================
--- uspace/srv/net/il/arp/arp_module.c	(revision 3c106e8814a50268257db9a33c79a75e51e871ec)
+++ uspace/srv/net/il/arp/arp_module.c	(revision 774e6d1abebc631f873d85e623bf7aa61b0aecea)
@@ -58,7 +58,7 @@
 
 int il_module_message_standalone(ipc_callid_t callid, ipc_call_t *call,
-    ipc_call_t *answer, int *answer_count)
+    ipc_call_t *answer, size_t *count)
 {
-	return arp_message_standalone(callid, call, answer, answer_count);
+	return arp_message_standalone(callid, call, answer, count);
 }
 
Index: uspace/srv/net/il/arp/arp_module.h
===================================================================
--- uspace/srv/net/il/arp/arp_module.h	(revision 3c106e8814a50268257db9a33c79a75e51e871ec)
+++ uspace/srv/net/il/arp/arp_module.h	(revision 774e6d1abebc631f873d85e623bf7aa61b0aecea)
@@ -44,5 +44,5 @@
 extern int arp_initialize(async_client_conn_t);
 extern int arp_message_standalone(ipc_callid_t, ipc_call_t *, ipc_call_t *,
-    int *);
+    size_t *);
 
 #endif
Index: uspace/srv/net/il/ip/ip.c
===================================================================
--- uspace/srv/net/il/ip/ip.c	(revision 3c106e8814a50268257db9a33c79a75e51e871ec)
+++ uspace/srv/net/il/ip/ip.c	(revision 774e6d1abebc631f873d85e623bf7aa61b0aecea)
@@ -477,4 +477,9 @@
 		ip_globals.gateway.gateway.s_addr = gateway.s_addr;
 		ip_globals.gateway.netif = ip_netif;
+		
+		char defgateway[INET_ADDRSTRLEN];
+		inet_ntop(AF_INET, (uint8_t *) &gateway.s_addr,
+		    defgateway, INET_ADDRSTRLEN);
+		printf("%s: Default gateway (%s)\n", NAME, defgateway);
 	}
 
@@ -1069,16 +1074,15 @@
 	int index;
 	ip_route_t *route;
-
+	
 	if (!netif)
 		return NULL;
-
-	// start with the first one - the direct route
+	
+	/* Start with the first one (the direct route) */
 	for (index = 0; index < ip_routes_count(&netif->routes); index++) {
 		route = ip_routes_get_index(&netif->routes, index);
-		if (route &&
+		if ((route) &&
 		    ((route->address.s_addr & route->netmask.s_addr) ==
-		    (destination.s_addr & route->netmask.s_addr))) {
+		    (destination.s_addr & route->netmask.s_addr)))
 			return route;
-		}
 	}
 
@@ -1288,5 +1292,5 @@
 	if (device_id > 0) {
 		netif = ip_netifs_find(&ip_globals.netifs, device_id);
-		route = ip_netif_find_route(netif, * dest);
+		route = ip_netif_find_route(netif, *dest);
 		if (netif && !route && (ip_globals.gateway.netif == netif))
 			route = &ip_globals.gateway;
@@ -1318,5 +1322,5 @@
 		}
 	}
-
+	
 	// if the local host is the destination
 	if ((route->address.s_addr == dest->s_addr) &&
@@ -1562,5 +1566,5 @@
 	socklen_t addrlen;
 	int rc;
-
+	
 	header = (ip_header_t *) packet_get_data(packet);
 	if (!header)
@@ -1588,5 +1592,5 @@
 		return EINVAL;
 	}
-
+	
 	// process ipopt and get destination
 	dest = ip_get_destination(header);
@@ -1609,5 +1613,5 @@
 	if (rc != EOK)
 		return rc;
-
+	
 	route = ip_find_route(dest);
 	if (!route) {
@@ -1886,5 +1890,5 @@
 int
 ip_message_standalone(ipc_callid_t callid, ipc_call_t *call, ipc_call_t *answer,
-    int *answer_count)
+    size_t *answer_count)
 {
 	packet_t *packet;
@@ -1905,46 +1909,46 @@
 	
 	case IPC_M_CONNECT_TO_ME:
-		return ip_register(IL_GET_PROTO(call), IL_GET_SERVICE(call),
-		    IPC_GET_PHONE(call), NULL);
+		return ip_register(IL_GET_PROTO(*call), IL_GET_SERVICE(*call),
+		    IPC_GET_PHONE(*call), NULL);
 	
 	case NET_IL_DEVICE:
-		return ip_device_req_local(0, IPC_GET_DEVICE(call),
-		    IPC_GET_SERVICE(call));
+		return ip_device_req_local(0, IPC_GET_DEVICE(*call),
+		    IPC_GET_SERVICE(*call));
 	
 	case NET_IL_SEND:
 		rc = packet_translate_remote(ip_globals.net_phone, &packet,
-		    IPC_GET_PACKET(call));
+		    IPC_GET_PACKET(*call));
 		if (rc != EOK)
 			return rc;
-		return ip_send_msg_local(0, IPC_GET_DEVICE(call), packet, 0,
-		    IPC_GET_ERROR(call));
+		return ip_send_msg_local(0, IPC_GET_DEVICE(*call), packet, 0,
+		    IPC_GET_ERROR(*call));
 	
 	case NET_IL_DEVICE_STATE:
-		return ip_device_state_message(IPC_GET_DEVICE(call),
-		    IPC_GET_STATE(call));
+		return ip_device_state_message(IPC_GET_DEVICE(*call),
+		    IPC_GET_STATE(*call));
 	
 	case NET_IL_RECEIVED:
 		rc = packet_translate_remote(ip_globals.net_phone, &packet,
-		    IPC_GET_PACKET(call));
+		    IPC_GET_PACKET(*call));
 		if (rc != EOK)
 			return rc;
-		return ip_receive_message(IPC_GET_DEVICE(call), packet);
+		return ip_receive_message(IPC_GET_DEVICE(*call), packet);
 	
 	case NET_IP_RECEIVED_ERROR:
 		rc = packet_translate_remote(ip_globals.net_phone, &packet,
-		    IPC_GET_PACKET(call));
+		    IPC_GET_PACKET(*call));
 		if (rc != EOK)
 			return rc;
-		return ip_received_error_msg_local(0, IPC_GET_DEVICE(call),
-		    packet, IPC_GET_TARGET(call), IPC_GET_ERROR(call));
+		return ip_received_error_msg_local(0, IPC_GET_DEVICE(*call),
+		    packet, IPC_GET_TARGET(*call), IPC_GET_ERROR(*call));
 	
 	case NET_IP_ADD_ROUTE:
-		return ip_add_route_req_local(0, IPC_GET_DEVICE(call),
-		    IP_GET_ADDRESS(call), IP_GET_NETMASK(call),
-		    IP_GET_GATEWAY(call));
+		return ip_add_route_req_local(0, IPC_GET_DEVICE(*call),
+		    IP_GET_ADDRESS(*call), IP_GET_NETMASK(*call),
+		    IP_GET_GATEWAY(*call));
 
 	case NET_IP_SET_GATEWAY:
-		return ip_set_gateway_req_local(0, IPC_GET_DEVICE(call),
-		    IP_GET_GATEWAY(call));
+		return ip_set_gateway_req_local(0, IPC_GET_DEVICE(*call),
+		    IP_GET_GATEWAY(*call));
 
 	case NET_IP_GET_ROUTE:
@@ -1954,11 +1958,11 @@
 			return rc;
 		
-		rc = ip_get_route_req_local(0, IP_GET_PROTOCOL(call), addr,
+		rc = ip_get_route_req_local(0, IP_GET_PROTOCOL(*call), addr,
 		    (socklen_t) addrlen, &device_id, &header, &headerlen);
 		if (rc != EOK)
 			return rc;
 		
-		IPC_SET_DEVICE(answer, device_id);
-		IP_SET_HEADERLEN(answer, headerlen);
+		IPC_SET_DEVICE(*answer, device_id);
+		IP_SET_HEADERLEN(*answer, headerlen);
 		
 		*answer_count = 2;
@@ -1972,19 +1976,19 @@
 	
 	case NET_IL_PACKET_SPACE:
-		rc = ip_packet_size_message(IPC_GET_DEVICE(call), &addrlen,
+		rc = ip_packet_size_message(IPC_GET_DEVICE(*call), &addrlen,
 		    &prefix, &content, &suffix);
 		if (rc != EOK)
 			return rc;
 		
-		IPC_SET_ADDR(answer, addrlen);
-		IPC_SET_PREFIX(answer, prefix);
-		IPC_SET_CONTENT(answer, content);
-		IPC_SET_SUFFIX(answer, suffix);
+		IPC_SET_ADDR(*answer, addrlen);
+		IPC_SET_PREFIX(*answer, prefix);
+		IPC_SET_CONTENT(*answer, content);
+		IPC_SET_SUFFIX(*answer, suffix);
 		*answer_count = 4;
 		return EOK;
 	
 	case NET_IL_MTU_CHANGED:
-		return ip_mtu_changed_message(IPC_GET_DEVICE(call),
-		    IPC_GET_MTU(call));
+		return ip_mtu_changed_message(IPC_GET_DEVICE(*call),
+		    IPC_GET_MTU(*call));
 	}
 	
@@ -2007,8 +2011,8 @@
 	while (true) {
 		ipc_call_t answer;
-		int answer_count;
+		size_t count;
 		
 		/* Clear the answer structure */
-		refresh_answer(&answer, &answer_count);
+		refresh_answer(&answer, &count);
 		
 		/* Fetch the next message */
@@ -2018,5 +2022,5 @@
 		/* Process the message */
 		int res = il_module_message_standalone(callid, &call, &answer,
-		    &answer_count);
+		    &count);
 		
 		/*
@@ -2030,5 +2034,5 @@
 		
 		/* Answer the message */
-		answer_call(callid, res, &answer, answer_count);
+		answer_call(callid, res, &answer, count);
 	}
 }
Index: uspace/srv/net/il/ip/ip_module.c
===================================================================
--- uspace/srv/net/il/ip/ip_module.c	(revision 3c106e8814a50268257db9a33c79a75e51e871ec)
+++ uspace/srv/net/il/ip/ip_module.c	(revision 774e6d1abebc631f873d85e623bf7aa61b0aecea)
@@ -59,7 +59,7 @@
 int
 il_module_message_standalone(ipc_callid_t callid, ipc_call_t *call,
-    ipc_call_t *answer, int *answer_count)
+    ipc_call_t *answer, size_t *count)
 {
-	return ip_message_standalone(callid, call, answer, answer_count);
+	return ip_message_standalone(callid, call, answer, count);
 }
 
Index: uspace/srv/net/il/ip/ip_module.h
===================================================================
--- uspace/srv/net/il/ip/ip_module.h	(revision 3c106e8814a50268257db9a33c79a75e51e871ec)
+++ uspace/srv/net/il/ip/ip_module.h	(revision 774e6d1abebc631f873d85e623bf7aa61b0aecea)
@@ -43,5 +43,5 @@
 extern int ip_initialize(async_client_conn_t);
 extern int ip_message_standalone(ipc_callid_t, ipc_call_t *, ipc_call_t *,
-    int *);
+    size_t *);
 
 #endif
Index: uspace/srv/net/net/net.c
===================================================================
--- uspace/srv/net/net/net.c	(revision 3c106e8814a50268257db9a33c79a75e51e871ec)
+++ uspace/srv/net/net/net.c	(revision 774e6d1abebc631f873d85e623bf7aa61b0aecea)
@@ -474,7 +474,7 @@
 	
 	setting = measured_strings_find(&netif->configuration, (uint8_t *) CONF_IO, 0);
-	int io = setting ? strtol((char *) setting->value, NULL, 16) : 0;
-	
-	rc = netif_probe_req_remote(netif->driver->phone, netif->id, irq, io);
+	uintptr_t io = setting ? strtol((char *) setting->value, NULL, 16) : 0;
+	
+	rc = netif_probe_req(netif->driver->phone, netif->id, irq, (void *) io);
 	if (rc != EOK)
 		return rc;
@@ -511,5 +511,5 @@
 	}
 	
-	return netif_start_req_remote(netif->driver->phone, netif->id);
+	return netif_start_req(netif->driver->phone, netif->id);
 }
 
@@ -613,6 +613,6 @@
 /** Process the networking message.
  *
- * @param[in] callid        The message identifier.
- * @param[in] call          The message parameters.
+ * @param[in]  callid       The message identifier.
+ * @param[in]  call         The message parameters.
  * @param[out] answer       The message answer parameters.
  * @param[out] answer_count The last parameter for the actual answer
@@ -627,5 +627,5 @@
  */
 int net_message(ipc_callid_t callid, ipc_call_t *call, ipc_call_t *answer,
-    int *answer_count)
+    size_t *answer_count)
 {
 	measured_string_t *strings;
@@ -639,27 +639,27 @@
 	case NET_NET_GET_DEVICE_CONF:
 		rc = measured_strings_receive(&strings, &data,
-		    IPC_GET_COUNT(call));
+		    IPC_GET_COUNT(*call));
 		if (rc != EOK)
 			return rc;
-		net_get_device_conf_req(0, IPC_GET_DEVICE(call), &strings,
-		    IPC_GET_COUNT(call), NULL);
+		net_get_device_conf_req(0, IPC_GET_DEVICE(*call), &strings,
+		    IPC_GET_COUNT(*call), NULL);
 		
 		/* Strings should not contain received data anymore */
 		free(data);
 		
-		rc = measured_strings_reply(strings, IPC_GET_COUNT(call));
+		rc = measured_strings_reply(strings, IPC_GET_COUNT(*call));
 		free(strings);
 		return rc;
 	case NET_NET_GET_CONF:
 		rc = measured_strings_receive(&strings, &data,
-		    IPC_GET_COUNT(call));
+		    IPC_GET_COUNT(*call));
 		if (rc != EOK)
 			return rc;
-		net_get_conf_req(0, &strings, IPC_GET_COUNT(call), NULL);
+		net_get_conf_req(0, &strings, IPC_GET_COUNT(*call), NULL);
 		
 		/* Strings should not contain received data anymore */
 		free(data);
 		
-		rc = measured_strings_reply(strings, IPC_GET_COUNT(call));
+		rc = measured_strings_reply(strings, IPC_GET_COUNT(*call));
 		free(strings);
 		return rc;
@@ -688,5 +688,5 @@
 		/* Clear the answer structure */
 		ipc_call_t answer;
-		int answer_count;
+		size_t answer_count;
 		refresh_answer(&answer, &answer_count);
 		
Index: uspace/srv/net/net/net.h
===================================================================
--- uspace/srv/net/net/net.h	(revision 3c106e8814a50268257db9a33c79a75e51e871ec)
+++ uspace/srv/net/net/net.h	(revision 774e6d1abebc631f873d85e623bf7aa61b0aecea)
@@ -135,7 +135,7 @@
 extern int add_configuration(measured_strings_t *, const uint8_t *,
     const uint8_t *);
-extern int net_module_message(ipc_callid_t, ipc_call_t *, ipc_call_t *, int *);
+extern int net_module_message(ipc_callid_t, ipc_call_t *, ipc_call_t *, size_t *);
 extern int net_initialize_build(async_client_conn_t);
-extern int net_message(ipc_callid_t, ipc_call_t *, ipc_call_t *, int *);
+extern int net_message(ipc_callid_t, ipc_call_t *, ipc_call_t *, size_t *);
 
 #endif
Index: uspace/srv/net/net/net_standalone.c
===================================================================
--- uspace/srv/net/net/net_standalone.c	(revision 3c106e8814a50268257db9a33c79a75e51e871ec)
+++ uspace/srv/net/net/net_standalone.c	(revision 774e6d1abebc631f873d85e623bf7aa61b0aecea)
@@ -100,10 +100,10 @@
  */
 int net_module_message(ipc_callid_t callid, ipc_call_t *call,
-    ipc_call_t *answer, int *answer_count)
+    ipc_call_t *answer, size_t *count)
 {
-	if (IS_NET_PACKET_MESSAGE(call))
-		return packet_server_message(callid, call, answer, answer_count);
+	if (IS_NET_PACKET_MESSAGE(*call))
+		return packet_server_message(callid, call, answer, count);
 	
-	return net_message(callid, call, answer, answer_count);
+	return net_message(callid, call, answer, count);
 }
 
Index: uspace/srv/net/netif/lo/lo.c
===================================================================
--- uspace/srv/net/netif/lo/lo.c	(revision 3c106e8814a50268257db9a33c79a75e51e871ec)
+++ uspace/srv/net/netif/lo/lo.c	(revision 774e6d1abebc631f873d85e623bf7aa61b0aecea)
@@ -49,6 +49,5 @@
 #include <net/device.h>
 #include <nil_interface.h>
-#include <netif_interface.h>
-#include <netif_local.h>
+#include <netif_skel.h>
 
 /** Default hardware address. */
@@ -65,5 +64,5 @@
 
 int netif_specific_message(ipc_callid_t callid, ipc_call_t *call,
-    ipc_call_t *answer, int *answer_count)
+    ipc_call_t *answer, size_t *count)
 {
 	return ENOTSUP;
@@ -172,5 +171,5 @@
 }
 
-int netif_probe_message(device_id_t device_id, int irq, uintptr_t io)
+int netif_probe_message(device_id_t device_id, int irq, void *io)
 {
 	netif_device_t *device;
@@ -233,52 +232,8 @@
 }
 
-/** Default thread for new connections.
- *
- * @param[in] iid	The initial message identifier.
- * @param[in] icall	The initial message call structure.
- */
-static void netif_client_connection(ipc_callid_t iid, ipc_call_t *icall)
-{
-	/*
-	 * Accept the connection
-	 *  - Answer the first IPC_M_CONNECT_ME_TO call.
-	 */
-	ipc_answer_0(iid, EOK);
-	
-	while (true) {
-		ipc_call_t answer;
-		int answer_count;
-		
-		/* Clear the answer structure */
-		refresh_answer(&answer, &answer_count);
-		
-		/* Fetch the next message */
-		ipc_call_t call;
-		ipc_callid_t callid = async_get_call(&call);
-		
-		/* Process the message */
-		int res = netif_module_message(NAME, callid, &call, &answer,
-		    &answer_count);
-		
-		/*
-		 * End if told to either by the message or the processing
-		 * result.
-		 */
-		if ((IPC_GET_IMETHOD(call) == IPC_M_PHONE_HUNGUP) ||
-		    (res == EHANGUP))
-			return;
-		
-		/* Answer the message */
-		answer_call(callid, res, &answer, answer_count);
-	}
-}
-
 int main(int argc, char *argv[])
 {
-	int rc;
-	
 	/* Start the module */
-	rc = netif_module_start(netif_client_connection);
-	return rc;
+	return netif_module_start();
 }
 
Index: uspace/srv/net/nil/eth/eth.c
===================================================================
--- uspace/srv/net/nil/eth/eth.c	(revision 3c106e8814a50268257db9a33c79a75e51e871ec)
+++ uspace/srv/net/nil/eth/eth.c	(revision 774e6d1abebc631f873d85e623bf7aa61b0aecea)
@@ -54,5 +54,5 @@
 #include <protocol_map.h>
 #include <net/device.h>
-#include <netif_interface.h>
+#include <netif_remote.h>
 #include <net_interface.h>
 #include <nil_interface.h>
@@ -239,14 +239,14 @@
 		switch (IPC_GET_IMETHOD(*icall)) {
 		case NET_NIL_DEVICE_STATE:
-			nil_device_state_msg_local(0, IPC_GET_DEVICE(icall),
-			    IPC_GET_STATE(icall));
+			nil_device_state_msg_local(0, IPC_GET_DEVICE(*icall),
+			    IPC_GET_STATE(*icall));
 			ipc_answer_0(iid, EOK);
 			break;
 		case NET_NIL_RECEIVED:
 			rc = packet_translate_remote(eth_globals.net_phone,
-			    &packet, IPC_GET_PACKET(icall));
+			    &packet, IPC_GET_PACKET(*icall));
 			if (rc == EOK) {
 				rc = nil_received_msg_local(0,
-				    IPC_GET_DEVICE(icall), packet, 0);
+				    IPC_GET_DEVICE(*icall), packet, 0);
 			}
 			ipc_answer_0(iid, (sysarg_t) rc);
@@ -837,5 +837,5 @@
 
 int nil_message_standalone(const char *name, ipc_callid_t callid,
-    ipc_call_t *call, ipc_call_t *answer, int *answer_count)
+    ipc_call_t *call, ipc_call_t *answer, size_t *answer_count)
 {
 	measured_string_t *address;
@@ -853,26 +853,26 @@
 	
 	case NET_NIL_DEVICE:
-		return eth_device_message(IPC_GET_DEVICE(call),
-		    IPC_GET_SERVICE(call), IPC_GET_MTU(call));
+		return eth_device_message(IPC_GET_DEVICE(*call),
+		    IPC_GET_SERVICE(*call), IPC_GET_MTU(*call));
 	case NET_NIL_SEND:
 		rc = packet_translate_remote(eth_globals.net_phone, &packet,
-		    IPC_GET_PACKET(call));
+		    IPC_GET_PACKET(*call));
 		if (rc != EOK)
 			return rc;
-		return eth_send_message(IPC_GET_DEVICE(call), packet,
-		    IPC_GET_SERVICE(call));
+		return eth_send_message(IPC_GET_DEVICE(*call), packet,
+		    IPC_GET_SERVICE(*call));
 	case NET_NIL_PACKET_SPACE:
-		rc = eth_packet_space_message(IPC_GET_DEVICE(call), &addrlen,
+		rc = eth_packet_space_message(IPC_GET_DEVICE(*call), &addrlen,
 		    &prefix, &content, &suffix);
 		if (rc != EOK)
 			return rc;
-		IPC_SET_ADDR(answer, addrlen);
-		IPC_SET_PREFIX(answer, prefix);
-		IPC_SET_CONTENT(answer, content);
-		IPC_SET_SUFFIX(answer, suffix);
+		IPC_SET_ADDR(*answer, addrlen);
+		IPC_SET_PREFIX(*answer, prefix);
+		IPC_SET_CONTENT(*answer, content);
+		IPC_SET_SUFFIX(*answer, suffix);
 		*answer_count = 4;
 		return EOK;
 	case NET_NIL_ADDR:
-		rc = eth_addr_message(IPC_GET_DEVICE(call), ETH_LOCAL_ADDR,
+		rc = eth_addr_message(IPC_GET_DEVICE(*call), ETH_LOCAL_ADDR,
 		    &address);
 		if (rc != EOK)
@@ -880,5 +880,5 @@
 		return measured_strings_reply(address, 1);
 	case NET_NIL_BROADCAST_ADDR:
-		rc = eth_addr_message(IPC_GET_DEVICE(call), ETH_BROADCAST_ADDR,
+		rc = eth_addr_message(IPC_GET_DEVICE(*call), ETH_BROADCAST_ADDR,
 		    &address);
 		if (rc != EOK)
@@ -886,6 +886,6 @@
 		return measured_strings_reply(address, 1);
 	case IPC_M_CONNECT_TO_ME:
-		return eth_register_message(NIL_GET_PROTO(call),
-		    IPC_GET_PHONE(call));
+		return eth_register_message(NIL_GET_PROTO(*call),
+		    IPC_GET_PHONE(*call));
 	}
 	
@@ -908,8 +908,8 @@
 	while (true) {
 		ipc_call_t answer;
-		int answer_count;
+		size_t count;
 		
 		/* Clear the answer structure */
-		refresh_answer(&answer, &answer_count);
+		refresh_answer(&answer, &count);
 		
 		/* Fetch the next message */
@@ -919,5 +919,5 @@
 		/* Process the message */
 		int res = nil_module_message_standalone(NAME, callid, &call,
-		    &answer, &answer_count);
+		    &answer, &count);
 		
 		/*
@@ -930,5 +930,5 @@
 		
 		/* Answer the message */
-		answer_call(callid, res, &answer, answer_count);
+		answer_call(callid, res, &answer, count);
 	}
 }
Index: uspace/srv/net/nil/eth/eth_header.h
===================================================================
--- uspace/srv/net/nil/eth/eth_header.h	(revision 3c106e8814a50268257db9a33c79a75e51e871ec)
+++ uspace/srv/net/nil/eth/eth_header.h	(revision 774e6d1abebc631f873d85e623bf7aa61b0aecea)
@@ -42,14 +42,14 @@
 
 /** Ethernet address length. */
-#define ETH_ADDR	6
+#define ETH_ADDR  6
 
 /** Ethernet header preamble value. */
-#define ETH_PREAMBLE	0x55
+#define ETH_PREAMBLE  0x55
 
 /** Ethernet header start of frame value. */
-#define ETH_SFD		0xD5
+#define ETH_SFD  0xD5
 
 /** IEEE 802.2 unordered information control field. */
-#define IEEE_8023_2_UI	0x03
+#define IEEE_8023_2_UI  0x03
 
 /** Type definition of the Ethernet header IEEE 802.3 + 802.2 + SNAP extensions.
Index: uspace/srv/net/nil/eth/eth_module.c
===================================================================
--- uspace/srv/net/nil/eth/eth_module.c	(revision 3c106e8814a50268257db9a33c79a75e51e871ec)
+++ uspace/srv/net/nil/eth/eth_module.c	(revision 774e6d1abebc631f873d85e623bf7aa61b0aecea)
@@ -78,7 +78,7 @@
 
 int nil_module_message_standalone(const char *name, ipc_callid_t callid,
-    ipc_call_t *call, ipc_call_t *answer, int *answer_count)
+    ipc_call_t *call, ipc_call_t *answer, size_t *count)
 {
-	return nil_message_standalone(name, callid, call, answer, answer_count);
+	return nil_message_standalone(name, callid, call, answer, count);
 }
 
Index: uspace/srv/net/nil/nildummy/nildummy.c
===================================================================
--- uspace/srv/net/nil/nildummy/nildummy.c	(revision 3c106e8814a50268257db9a33c79a75e51e871ec)
+++ uspace/srv/net/nil/nildummy/nildummy.c	(revision 774e6d1abebc631f873d85e623bf7aa61b0aecea)
@@ -47,5 +47,4 @@
 #include <net/modules.h>
 #include <net/device.h>
-#include <netif_interface.h>
 #include <nil_interface.h>
 #include <il_interface.h>
@@ -53,4 +52,5 @@
 #include <net/packet.h>
 #include <packet_remote.h>
+#include <netif_remote.h>
 #include <nil_local.h>
 
@@ -113,5 +113,5 @@
 		case NET_NIL_DEVICE_STATE:
 			rc = nil_device_state_msg_local(0,
-			    IPC_GET_DEVICE(icall), IPC_GET_STATE(icall));
+			    IPC_GET_DEVICE(*icall), IPC_GET_STATE(*icall));
 			ipc_answer_0(iid, (sysarg_t) rc);
 			break;
@@ -119,8 +119,8 @@
 		case NET_NIL_RECEIVED:
 			rc = packet_translate_remote(nildummy_globals.net_phone,
-			    &packet, IPC_GET_PACKET(icall));
+			    &packet, IPC_GET_PACKET(*icall));
 			if (rc == EOK) {
 				rc = nil_received_msg_local(0,
-				    IPC_GET_DEVICE(icall), packet, 0);
+				    IPC_GET_DEVICE(*icall), packet, 0);
 			}
 			ipc_answer_0(iid, (sysarg_t) rc);
@@ -375,5 +375,5 @@
 
 int nil_message_standalone(const char *name, ipc_callid_t callid,
-    ipc_call_t *call, ipc_call_t *answer, int *answer_count)
+    ipc_call_t *call, ipc_call_t *answer, size_t *answer_count)
 {
 	measured_string_t *address;
@@ -391,29 +391,29 @@
 	
 	case NET_NIL_DEVICE:
-		return nildummy_device_message(IPC_GET_DEVICE(call),
-		    IPC_GET_SERVICE(call), IPC_GET_MTU(call));
+		return nildummy_device_message(IPC_GET_DEVICE(*call),
+		    IPC_GET_SERVICE(*call), IPC_GET_MTU(*call));
 	
 	case NET_NIL_SEND:
 		rc = packet_translate_remote(nildummy_globals.net_phone,
-		    &packet, IPC_GET_PACKET(call));
+		    &packet, IPC_GET_PACKET(*call));
 		if (rc != EOK)
 			return rc;
-		return nildummy_send_message(IPC_GET_DEVICE(call), packet,
-		    IPC_GET_SERVICE(call));
+		return nildummy_send_message(IPC_GET_DEVICE(*call), packet,
+		    IPC_GET_SERVICE(*call));
 	
 	case NET_NIL_PACKET_SPACE:
-		rc = nildummy_packet_space_message(IPC_GET_DEVICE(call),
+		rc = nildummy_packet_space_message(IPC_GET_DEVICE(*call),
 		    &addrlen, &prefix, &content, &suffix);
 		if (rc != EOK)
 			return rc;
-		IPC_SET_ADDR(answer, addrlen);
-		IPC_SET_PREFIX(answer, prefix);
-		IPC_SET_CONTENT(answer, content);
-		IPC_SET_SUFFIX(answer, suffix);
+		IPC_SET_ADDR(*answer, addrlen);
+		IPC_SET_PREFIX(*answer, prefix);
+		IPC_SET_CONTENT(*answer, content);
+		IPC_SET_SUFFIX(*answer, suffix);
 		*answer_count = 4;
 		return EOK;
 	
 	case NET_NIL_ADDR:
-		rc = nildummy_addr_message(IPC_GET_DEVICE(call), &address);
+		rc = nildummy_addr_message(IPC_GET_DEVICE(*call), &address);
 		if (rc != EOK)
 			return rc;
@@ -421,5 +421,5 @@
 	
 	case NET_NIL_BROADCAST_ADDR:
-		rc = nildummy_addr_message(IPC_GET_DEVICE(call), &address);
+		rc = nildummy_addr_message(IPC_GET_DEVICE(*call), &address);
 		if (rc != EOK)
 			return rc;
@@ -427,6 +427,6 @@
 	
 	case IPC_M_CONNECT_TO_ME:
-		return nildummy_register_message(NIL_GET_PROTO(call),
-		    IPC_GET_PHONE(call));
+		return nildummy_register_message(NIL_GET_PROTO(*call),
+		    IPC_GET_PHONE(*call));
 	}
 	
@@ -449,8 +449,8 @@
 	while (true) {
 		ipc_call_t answer;
-		int answer_count;
+		size_t count;
 		
 		/* Clear the answer structure */
-		refresh_answer(&answer, &answer_count);
+		refresh_answer(&answer, &count);
 		
 		/* Fetch the next message */
@@ -460,5 +460,5 @@
 		/* Process the message */
 		int res = nil_module_message_standalone(NAME, callid, &call,
-		    &answer, &answer_count);
+		    &answer, &count);
 		
 		/*
@@ -471,5 +471,5 @@
 		
 		/* Answer the message */
-		answer_call(callid, res, &answer, answer_count);
+		answer_call(callid, res, &answer, count);
 	}
 }
Index: uspace/srv/net/nil/nildummy/nildummy_module.c
===================================================================
--- uspace/srv/net/nil/nildummy/nildummy_module.c	(revision 3c106e8814a50268257db9a33c79a75e51e871ec)
+++ uspace/srv/net/nil/nildummy/nildummy_module.c	(revision 774e6d1abebc631f873d85e623bf7aa61b0aecea)
@@ -79,7 +79,7 @@
 
 int nil_module_message_standalone(const char *name, ipc_callid_t callid,
-    ipc_call_t *call, ipc_call_t *answer, int *answer_count)
+    ipc_call_t *call, ipc_call_t *answer, size_t *count)
 {
-	return nil_message_standalone(name, callid, call, answer, answer_count);
+	return nil_message_standalone(name, callid, call, answer, count);
 }
 
Index: uspace/srv/net/tl/icmp/icmp.c
===================================================================
--- uspace/srv/net/tl/icmp/icmp.c	(revision 3c106e8814a50268257db9a33c79a75e51e871ec)
+++ uspace/srv/net/tl/icmp/icmp.c	(revision 774e6d1abebc631f873d85e623bf7aa61b0aecea)
@@ -696,12 +696,12 @@
 	case NET_ICMP_DEST_UNREACH:
 		rc = packet_translate_remote(icmp_globals.net_phone, &packet,
-		    IPC_GET_PACKET(call));
+		    IPC_GET_PACKET(*call));
 		if (rc != EOK)
 			return rc;
 		return icmp_destination_unreachable_msg_local(0,
-		    ICMP_GET_CODE(call), ICMP_GET_MTU(call), packet);
+		    ICMP_GET_CODE(*call), ICMP_GET_MTU(*call), packet);
 	case NET_ICMP_SOURCE_QUENCH:
 		rc = packet_translate_remote(icmp_globals.net_phone, &packet,
-		    IPC_GET_PACKET(call));
+		    IPC_GET_PACKET(*call));
 		if (rc != EOK)
 			return rc;
@@ -709,16 +709,16 @@
 	case NET_ICMP_TIME_EXCEEDED:
 		rc = packet_translate_remote(icmp_globals.net_phone, &packet,
-		    IPC_GET_PACKET(call));
+		    IPC_GET_PACKET(*call));
 		if (rc != EOK)
 			return rc;
-		return icmp_time_exceeded_msg_local(0, ICMP_GET_CODE(call),
+		return icmp_time_exceeded_msg_local(0, ICMP_GET_CODE(*call),
 		    packet);
 	case NET_ICMP_PARAMETERPROB:
 		rc = packet_translate_remote(icmp_globals.net_phone, &packet,
-		    IPC_GET_PACKET(call));
+		    IPC_GET_PACKET(*call));
 		if (rc != EOK)
 			return rc;
-		return icmp_parameter_problem_msg_local(0, ICMP_GET_CODE(call),
-		    ICMP_GET_POINTER(call), packet);
+		return icmp_parameter_problem_msg_local(0, ICMP_GET_CODE(*call),
+		    ICMP_GET_POINTER(*call), packet);
 	default:
 		return ENOTSUP;
@@ -787,5 +787,5 @@
 	bool keep_on_going = true;
 	ipc_call_t answer;
-	int answer_count;
+	size_t answer_count;
 	size_t length;
 	struct sockaddr *addr;
@@ -894,5 +894,5 @@
  */
 int icmp_message_standalone(ipc_callid_t callid, ipc_call_t *call,
-    ipc_call_t *answer, int *answer_count)
+    ipc_call_t *answer, size_t *answer_count)
 {
 	packet_t *packet;
@@ -903,12 +903,12 @@
 	case NET_TL_RECEIVED:
 		rc = packet_translate_remote(icmp_globals.net_phone, &packet,
-		    IPC_GET_PACKET(call));
+		    IPC_GET_PACKET(*call));
 		if (rc != EOK)
 			return rc;
-		return icmp_received_msg_local(IPC_GET_DEVICE(call), packet,
-		    SERVICE_ICMP, IPC_GET_ERROR(call));
+		return icmp_received_msg_local(IPC_GET_DEVICE(*call), packet,
+		    SERVICE_ICMP, IPC_GET_ERROR(*call));
 	
 	case NET_ICMP_INIT:
-		return icmp_process_client_messages(callid, * call);
+		return icmp_process_client_messages(callid, *call);
 	
 	default:
@@ -936,5 +936,5 @@
 	while (true) {
 		ipc_call_t answer;
-		int answer_count;
+		size_t answer_count;
 		
 		/* Clear the answer structure */
Index: uspace/srv/net/tl/icmp/icmp_module.c
===================================================================
--- uspace/srv/net/tl/icmp/icmp_module.c	(revision 3c106e8814a50268257db9a33c79a75e51e871ec)
+++ uspace/srv/net/tl/icmp/icmp_module.c	(revision 774e6d1abebc631f873d85e623bf7aa61b0aecea)
@@ -86,7 +86,7 @@
 
 int tl_module_message_standalone(ipc_callid_t callid, ipc_call_t *call,
-    ipc_call_t *answer, int *answer_count)
+    ipc_call_t *answer, size_t *count)
 {
-	return icmp_message_standalone(callid, call, answer, answer_count);
+	return icmp_message_standalone(callid, call, answer, count);
 }
 
Index: uspace/srv/net/tl/icmp/icmp_module.h
===================================================================
--- uspace/srv/net/tl/icmp/icmp_module.h	(revision 3c106e8814a50268257db9a33c79a75e51e871ec)
+++ uspace/srv/net/tl/icmp/icmp_module.h	(revision 774e6d1abebc631f873d85e623bf7aa61b0aecea)
@@ -44,5 +44,5 @@
 extern int icmp_initialize(async_client_conn_t);
 extern int icmp_message_standalone(ipc_callid_t, ipc_call_t *, ipc_call_t *,
-    int *);
+    size_t *);
 
 #endif
Index: uspace/srv/net/tl/tcp/tcp.c
===================================================================
--- uspace/srv/net/tl/tcp/tcp.c	(revision 3c106e8814a50268257db9a33c79a75e51e871ec)
+++ uspace/srv/net/tl/tcp/tcp.c	(revision 774e6d1abebc631f873d85e623bf7aa61b0aecea)
@@ -1262,5 +1262,5 @@
 int
 tcp_message_standalone(ipc_callid_t callid, ipc_call_t *call,
-    ipc_call_t *answer, int *answer_count)
+    ipc_call_t *answer, size_t *answer_count)
 {
 	packet_t *packet;
@@ -1276,11 +1276,11 @@
 //		fibril_rwlock_read_lock(&tcp_globals.lock);
 		rc = packet_translate_remote(tcp_globals.net_phone, &packet,
-		    IPC_GET_PACKET(call));
+		    IPC_GET_PACKET(*call));
 		if (rc != EOK) {
 //			fibril_rwlock_read_unlock(&tcp_globals.lock);
 			return rc;
 		}
-		rc = tcp_received_msg(IPC_GET_DEVICE(call), packet, SERVICE_TCP,
-		    IPC_GET_ERROR(call));
+		rc = tcp_received_msg(IPC_GET_DEVICE(*call), packet, SERVICE_TCP,
+		    IPC_GET_ERROR(*call));
 //		fibril_rwlock_read_unlock(&tcp_globals.lock);
 		return rc;
@@ -1323,5 +1323,5 @@
 	bool keep_on_going = true;
 	socket_cores_t local_sockets;
-	int app_phone = IPC_GET_PHONE(&call);
+	int app_phone = IPC_GET_PHONE(call);
 	struct sockaddr *addr;
 	int socket_id;
@@ -1330,5 +1330,5 @@
 	fibril_rwlock_t lock;
 	ipc_call_t answer;
-	int answer_count;
+	size_t answer_count;
 	tcp_socket_data_t *socket_data;
 	socket_core_t *socket;
@@ -2502,5 +2502,5 @@
 	while (true) {
 		ipc_call_t answer;
-		int answer_count;
+		size_t answer_count;
 
 		/* Clear the answer structure */
Index: uspace/srv/net/tl/tcp/tcp_module.c
===================================================================
--- uspace/srv/net/tl/tcp/tcp_module.c	(revision 3c106e8814a50268257db9a33c79a75e51e871ec)
+++ uspace/srv/net/tl/tcp/tcp_module.c	(revision 774e6d1abebc631f873d85e623bf7aa61b0aecea)
@@ -87,7 +87,7 @@
 
 int tl_module_message_standalone(ipc_callid_t callid, ipc_call_t *call,
-    ipc_call_t *answer, int *answer_count)
+    ipc_call_t *answer, size_t *count)
 {
-	return tcp_message_standalone(callid, call, answer, answer_count);
+	return tcp_message_standalone(callid, call, answer, count);
 }
 
Index: uspace/srv/net/tl/tcp/tcp_module.h
===================================================================
--- uspace/srv/net/tl/tcp/tcp_module.h	(revision 3c106e8814a50268257db9a33c79a75e51e871ec)
+++ uspace/srv/net/tl/tcp/tcp_module.h	(revision 774e6d1abebc631f873d85e623bf7aa61b0aecea)
@@ -44,5 +44,5 @@
 extern int tcp_initialize(async_client_conn_t);
 extern int tcp_message_standalone(ipc_callid_t, ipc_call_t *, ipc_call_t *,
-    int *);
+    size_t *);
 
 #endif
Index: uspace/srv/net/tl/udp/udp.c
===================================================================
--- uspace/srv/net/tl/udp/udp.c	(revision 3c106e8814a50268257db9a33c79a75e51e871ec)
+++ uspace/srv/net/tl/udp/udp.c	(revision 774e6d1abebc631f873d85e623bf7aa61b0aecea)
@@ -707,5 +707,5 @@
 	bool keep_on_going = true;
 	socket_cores_t local_sockets;
-	int app_phone = IPC_GET_PHONE(&call);
+	int app_phone = IPC_GET_PHONE(call);
 	struct sockaddr *addr;
 	int socket_id;
@@ -713,5 +713,5 @@
 	size_t size;
 	ipc_call_t answer;
-	int answer_count;
+	size_t answer_count;
 	packet_dimension_t *packet_dimension;
 
@@ -861,5 +861,5 @@
  */
 int udp_message_standalone(ipc_callid_t callid, ipc_call_t *call,
-    ipc_call_t *answer, int *answer_count)
+    ipc_call_t *answer, size_t *answer_count)
 {
 	packet_t *packet;
@@ -871,11 +871,11 @@
 	case NET_TL_RECEIVED:
 		rc = packet_translate_remote(udp_globals.net_phone, &packet,
-		    IPC_GET_PACKET(call));
+		    IPC_GET_PACKET(*call));
 		if (rc != EOK)
 			return rc;
-		return udp_received_msg(IPC_GET_DEVICE(call), packet,
-		    SERVICE_UDP, IPC_GET_ERROR(call));
+		return udp_received_msg(IPC_GET_DEVICE(*call), packet,
+		    SERVICE_UDP, IPC_GET_ERROR(*call));
 	case IPC_M_CONNECT_TO_ME:
-		return udp_process_client_messages(callid, * call);
+		return udp_process_client_messages(callid, *call);
 	}
 
@@ -898,5 +898,5 @@
 	while (true) {
 		ipc_call_t answer;
-		int answer_count;
+		size_t answer_count;
 		
 		/* Clear the answer structure */
Index: uspace/srv/net/tl/udp/udp_module.c
===================================================================
--- uspace/srv/net/tl/udp/udp_module.c	(revision 3c106e8814a50268257db9a33c79a75e51e871ec)
+++ uspace/srv/net/tl/udp/udp_module.c	(revision 774e6d1abebc631f873d85e623bf7aa61b0aecea)
@@ -87,7 +87,7 @@
 
 int tl_module_message_standalone(ipc_callid_t callid, ipc_call_t *call,
-    ipc_call_t *answer, int *answer_count)
+    ipc_call_t *answer, size_t *count)
 {
-	return udp_message_standalone(callid, call, answer, answer_count);
+	return udp_message_standalone(callid, call, answer, count);
 }
 
Index: uspace/srv/net/tl/udp/udp_module.h
===================================================================
--- uspace/srv/net/tl/udp/udp_module.h	(revision 3c106e8814a50268257db9a33c79a75e51e871ec)
+++ uspace/srv/net/tl/udp/udp_module.h	(revision 774e6d1abebc631f873d85e623bf7aa61b0aecea)
@@ -44,5 +44,5 @@
 extern int udp_initialize(async_client_conn_t);
 extern int udp_message_standalone(ipc_callid_t, ipc_call_t *, ipc_call_t *,
-    int *);
+    size_t *);
 
 #endif
