Index: HelenOS.config
===================================================================
--- HelenOS.config	(revision 24ab58b348754b301fea741628d74d49704735d6)
+++ HelenOS.config	(revision 14f1db0aaed5208d5e8340c816ca6e555f81f67e)
@@ -522,7 +522,4 @@
 ! CONFIG_WRITE_CORE_FILES (n/y)
 
-% Networking architecture
-@ "modular" Modular
-@ "module" One module
-! CONFIG_NETWORKING (choice)
-
+% Bundle netif/nil network layer
+! CONFIG_NETIF_NIL_BUNDLE (n/y)
Index: boot/Makefile.common
===================================================================
--- boot/Makefile.common	(revision 24ab58b348754b301fea741628d74d49704735d6)
+++ boot/Makefile.common	(revision 14f1db0aaed5208d5e8340c816ca6e555f81f67e)
@@ -40,7 +40,9 @@
 	$(USPACEDIR)/srv/bd/rd/rd \
 	$(USPACEDIR)/srv/vfs/vfs
+
 ifeq ($(RDFMT),tmpfs)
 	INIT_TASKS += $(USPACEDIR)/srv/fs/tmpfs/tmpfs
 endif
+
 ifeq ($(RDFMT),fat)
 	INIT_TASKS += $(USPACEDIR)/srv/fs/fat/fat
@@ -60,9 +62,18 @@
 	$(USPACEDIR)/srv/taskmon/taskmon \
 	$(USPACEDIR)/srv/hw/netif/dp8390/dp8390 \
+	$(USPACEDIR)/srv/net/netif/lo/lo \
+	$(USPACEDIR)/srv/net/il/arp/arp \
+	$(USPACEDIR)/srv/net/il/ip/ip \
+	$(USPACEDIR)/srv/net/tl/icmp/icmp \
+	$(USPACEDIR)/srv/net/tl/udp/udp \
+	$(USPACEDIR)/srv/net/tl/tcp/tcp \
 	$(USPACEDIR)/srv/net/net/net \
 	$(USPACEDIR)/srv/net/netstart/netstart \
-	$(USPACEDIR)/srv/net/netif/lo/lo \
-	$(USPACEDIR)/srv/net/nil/eth/eth \
-	$(USPACEDIR)/srv/net/nil/nildummy/nildummy
+
+ifneq ($(CONFIG_NETIF_NIL_BUNDLE),y)
+	RD_SRVS += \
+		$(USPACEDIR)/srv/net/nil/eth/eth \
+		$(USPACEDIR)/srv/net/nil/nildummy/nildummy
+endif
 
 RD_APPS = \
@@ -78,8 +89,8 @@
 	$(USPACEDIR)/app/tetris/tetris \
 	$(USPACEDIR)/app/trace/trace \
+	$(USPACEDIR)/app/nettest1/nettest1 \
+	$(USPACEDIR)/app/nettest2/nettest2 \
 	$(USPACEDIR)/app/netecho/netecho \
-	$(USPACEDIR)/app/ping/ping \
-	$(USPACEDIR)/app/nettest1/nettest1 \
-	$(USPACEDIR)/app/nettest2/nettest2
+	$(USPACEDIR)/app/ping/ping
 
 COMPONENTS = \
@@ -91,7 +102,9 @@
 	$(USPACEDIR)/srv/bd/rd/rd \
 	$(USPACEDIR)/srv/vfs/vfs
+
 ifeq ($(RDFMT),tmpfs)
 	COMPONENTS += $(USPACEDIR)/srv/fs/tmpfs/tmpfs
 endif
+
 ifeq ($(RDFMT),fat)
 	COMPONENTS += $(USPACEDIR)/srv/fs/fat/fat
@@ -99,14 +112,5 @@
 
 NET_CFG = \
-	$(USPACEDIR)/srv/net/cfg/$(CONFIG_NETWORKING)/general \
-	$(USPACEDIR)/srv/net/cfg/$(CONFIG_NETWORKING)/lo \
-	$(USPACEDIR)/srv/net/cfg/$(CONFIG_NETWORKING)/ne2k
-
-ifeq ($(CONFIG_NETWORKING),modular)
-	RD_SRVS += \
-		$(USPACEDIR)/srv/net/il/ip/ip \
-		$(USPACEDIR)/srv/net/il/arp/arp \
-		$(USPACEDIR)/srv/net/tl/udp/udp \
-		$(USPACEDIR)/srv/net/tl/tcp/tcp \
-		$(USPACEDIR)/srv/net/tl/icmp/icmp
-endif
+	$(USPACEDIR)/srv/net/cfg/general \
+	$(USPACEDIR)/srv/net/cfg/lo \
+	$(USPACEDIR)/srv/net/cfg/ne2k
Index: defaults/amd64/Makefile.config
===================================================================
--- defaults/amd64/Makefile.config	(revision 24ab58b348754b301fea741628d74d49704735d6)
+++ defaults/amd64/Makefile.config	(revision 14f1db0aaed5208d5e8340c816ca6e555f81f67e)
@@ -62,4 +62,4 @@
 CONFIG_MOUNT_DATA = n
 
-# Default networking architecture
-CONFIG_NETWORKING = modular
+# Bundle netif/nil network layer
+CONFIG_NETIF_NIL_BUNDLE = n
Index: defaults/arm32/Makefile.config
===================================================================
--- defaults/arm32/Makefile.config	(revision 24ab58b348754b301fea741628d74d49704735d6)
+++ defaults/arm32/Makefile.config	(revision 14f1db0aaed5208d5e8340c816ca6e555f81f67e)
@@ -38,4 +38,4 @@
 CONFIG_MOUNT_DATA = n
 
-# Default networking architecture
-CONFIG_NETWORKING = modular
+# Bundle netif/nil network layer
+CONFIG_NETIF_NIL_BUNDLE = n
Index: defaults/ia32/Makefile.config
===================================================================
--- defaults/ia32/Makefile.config	(revision 24ab58b348754b301fea741628d74d49704735d6)
+++ defaults/ia32/Makefile.config	(revision 14f1db0aaed5208d5e8340c816ca6e555f81f67e)
@@ -68,4 +68,4 @@
 CONFIG_MOUNT_DATA = n
 
-# Default networking architecture
-CONFIG_NETWORKING = modular
+# Bundle netif/nil network layer
+CONFIG_NETIF_NIL_BUNDLE = n
Index: defaults/ia64/Makefile.config
===================================================================
--- defaults/ia64/Makefile.config	(revision 24ab58b348754b301fea741628d74d49704735d6)
+++ defaults/ia64/Makefile.config	(revision 14f1db0aaed5208d5e8340c816ca6e555f81f67e)
@@ -50,4 +50,4 @@
 CONFIG_MOUNT_DATA = n
 
-# Default networking architecture
-CONFIG_NETWORKING = modular
+# Bundle netif/nil network layer
+CONFIG_NETIF_NIL_BUNDLE = n
Index: defaults/mips32/Makefile.config
===================================================================
--- defaults/mips32/Makefile.config	(revision 24ab58b348754b301fea741628d74d49704735d6)
+++ defaults/mips32/Makefile.config	(revision 14f1db0aaed5208d5e8340c816ca6e555f81f67e)
@@ -44,4 +44,4 @@
 CONFIG_MOUNT_DATA = n
 
-# Default networking architecture
-CONFIG_NETWORKING = modular
+# Bundle netif/nil network layer
+CONFIG_NETIF_NIL_BUNDLE = n
Index: defaults/ppc32/Makefile.config
===================================================================
--- defaults/ppc32/Makefile.config	(revision 24ab58b348754b301fea741628d74d49704735d6)
+++ defaults/ppc32/Makefile.config	(revision 14f1db0aaed5208d5e8340c816ca6e555f81f67e)
@@ -44,4 +44,4 @@
 CONFIG_MOUNT_DATA = n
 
-# Default networking architecture
-CONFIG_NETWORKING = modular
+# Bundle netif/nil network layer
+CONFIG_NETIF_NIL_BUNDLE = n
Index: defaults/sparc64/Makefile.config
===================================================================
--- defaults/sparc64/Makefile.config	(revision 24ab58b348754b301fea741628d74d49704735d6)
+++ defaults/sparc64/Makefile.config	(revision 14f1db0aaed5208d5e8340c816ca6e555f81f67e)
@@ -62,4 +62,4 @@
 CONFIG_MOUNT_DATA = n
 
-# Default networking architecture
-CONFIG_NETWORKING = modular
+# Bundle netif/nil network layer
+CONFIG_NETIF_NIL_BUNDLE = n
Index: defaults/special/Makefile.config
===================================================================
--- defaults/special/Makefile.config	(revision 24ab58b348754b301fea741628d74d49704735d6)
+++ defaults/special/Makefile.config	(revision 14f1db0aaed5208d5e8340c816ca6e555f81f67e)
@@ -29,4 +29,4 @@
 CONFIG_START_BD = n
 
-# Default networking architecture
-CONFIG_NETWORKING = modular
+# Bundle netif/nil network layer
+CONFIG_NETIF_NIL_BUNDLE = n
Index: uspace/Makefile
===================================================================
--- uspace/Makefile	(revision 24ab58b348754b301fea741628d74d49704735d6)
+++ uspace/Makefile	(revision 14f1db0aaed5208d5e8340c816ca6e555f81f67e)
@@ -66,5 +66,31 @@
 	srv/hid/kbd \
 	srv/hw/char/i8042 \
-	srv/hw/netif/dp8390
+	srv/hw/netif/dp8390 \
+	srv/net/cfg \
+	srv/net/netif/lo \
+	srv/net/il/arp \
+	srv/net/il/ip \
+	srv/net/tl/icmp \
+	srv/net/tl/udp \
+	srv/net/tl/tcp \
+	srv/net/net \
+	srv/net/netstart \
+	app/netecho \
+	app/nettest1 \
+	app/nettest2 \
+	app/ping
+
+## Networking
+#
+
+ifeq ($(CONFIG_NETIF_NIL_BUNDLE),y)
+	LIBN = \
+		srv/net/nil/eth \
+		srv/net/nil/nildummy
+else
+	DIRS += \
+		srv/net/nil/eth \
+		srv/net/nil/nildummy
+endif
 
 ## Platform-specific hardware support
@@ -93,25 +119,4 @@
 endif
 
-## Networking
-#
-
-NETWORKING_COMMON = \
-	srv/net/netif/lo \
-	srv/net/nil/eth \
-	srv/net/nil/nildummy \
-	srv/net/net \
-	srv/net/netstart \
-	app/netecho \
-	app/nettest1 \
-	app/nettest2 \
-	app/ping
-
-NETWORKING_MODULAR = \
-	srv/net/il/arp \
-	srv/net/il/ip \
-	srv/net/tl/icmp \
-	srv/net/tl/udp \
-	srv/net/tl/tcp
-
 ## System libraries
 #
@@ -125,6 +130,5 @@
 	lib/softfloat \
 	lib/socket \
-	lib/net \
-	lib/netif
+	lib/net
 
 ifeq ($(UARCH),amd64)
@@ -139,16 +143,10 @@
 LIBC_BUILD = $(addsuffix .build,$(LIBC))
 LIBS_BUILD = $(addsuffix .build,$(LIBS))
+LIBN_BUILD = $(addsuffix .build,$(LIBN))
+BUILDS := $(addsuffix .build,$(DIRS))
 
-ifeq ($(CONFIG_NETWORKING),modular)
-	BUILDS := $(addsuffix .build,$(DIRS)) $(addsuffix .build,$(NETWORKING_COMMON)) $(addsuffix .build,$(NETWORKING_MODULAR))
-endif
+CLEANS := $(addsuffix .clean,$(DIRS)) $(addsuffix .clean,$(LIBN)) $(addsuffix .clean,$(LIBS)) $(addsuffix .clean,$(LIBC))
 
-ifeq ($(CONFIG_NETWORKING),module)
-	BUILDS := $(addsuffix .build,$(DIRS)) $(addsuffix .build,$(NETWORKING_COMMON))
-endif
-
-CLEANS := $(addsuffix .clean,$(DIRS)) $(addsuffix .clean,$(NETWORKING_COMMON)) $(addsuffix .clean,$(NETWORKING_MODULAR)) $(addsuffix .clean,$(LIBS)) $(addsuffix .clean,$(LIBC))
-
-.PHONY: all $(LIBC_BUILD) $(LIBS_BUILD) $(BUILDS) $(CLEANS) clean
+.PHONY: all $(LIBC_BUILD) $(LIBS_BUILD) $(LIBN_BUILD) $(BUILDS) $(CLEANS) clean
 
 all: $(BUILDS)
@@ -159,5 +157,8 @@
 	-$(MAKE) -C $(basename $@) clean
 
-$(BUILDS): $(LIBC_BUILD) $(LIBS_BUILD)
+$(BUILDS): $(LIBC_BUILD) $(LIBS_BUILD) $(LIBN_BUILD)
+	$(MAKE) -C $(basename $@) all PRECHECK=$(PRECHECK)
+
+$(LIBN_BUILD): $(LIBC_BUILD) $(LIBS_BUILD)
 	$(MAKE) -C $(basename $@) all PRECHECK=$(PRECHECK)
 
Index: uspace/Makefile.common
===================================================================
--- uspace/Makefile.common	(revision 24ab58b348754b301fea741628d74d49704735d6)
+++ uspace/Makefile.common	(revision 14f1db0aaed5208d5e8340c816ca6e555f81f67e)
@@ -90,5 +90,4 @@
 LIBSOCKET_PREFIX = $(LIB_PREFIX)/socket
 LIBNET_PREFIX = $(LIB_PREFIX)/net
-LIBNETIF_PREFIX = $(LIB_PREFIX)/netif
 
 BASE_LIBS = $(LIBC_PREFIX)/libc.a $(LIBSOFTINT_PREFIX)/libsoftint.a
Index: uspace/lib/net/Makefile
===================================================================
--- uspace/lib/net/Makefile	(revision 24ab58b348754b301fea741628d74d49704735d6)
+++ uspace/lib/net/Makefile	(revision 14f1db0aaed5208d5e8340c816ca6e555f81f67e)
@@ -37,6 +37,6 @@
 	generic/packet_remote.c \
 	adt/module_map.c \
-	netif/netif.c \
-	netif/netif_standalone.c \
+	netif/netif_local.c \
+	netif/netif_remote.c \
 	netif/netif_nil_bundle.c \
 	nil/nil_remote.c \
Index: uspace/lib/net/generic/net_remote.c
===================================================================
--- uspace/lib/net/generic/net_remote.c	(revision 24ab58b348754b301fea741628d74d49704735d6)
+++ uspace/lib/net/generic/net_remote.c	(revision 14f1db0aaed5208d5e8340c816ca6e555f81f67e)
@@ -32,5 +32,5 @@
 
 /** @file
- *  Networking interface implementation for standalone remote modules.
+ *  Networking interface implementation for remote modules.
  *  @see net_interface.h
  */
Index: uspace/lib/net/generic/packet_remote.c
===================================================================
--- uspace/lib/net/generic/packet_remote.c	(revision 24ab58b348754b301fea741628d74d49704735d6)
+++ uspace/lib/net/generic/packet_remote.c	(revision 14f1db0aaed5208d5e8340c816ca6e555f81f67e)
@@ -32,5 +32,5 @@
 
 /** @file
- *  Packet client interface implementation for standalone remote modules.
+ *  Packet client interface implementation for remote modules.
  *  @see packet_client.h
  */
@@ -47,94 +47,107 @@
 #include <packet/packet_header.h>
 #include <packet/packet_messages.h>
+#include <packet_remote.h>
 
-/** Obtains the packet from the packet server as the shared memory block.
- *  Creates the local packet mapping as well.
- *  @param[in] phone The packet server module phone.
- *  @param[out] packet The packet reference pointer to store the received packet reference.
- *  @param[in] packet_id The packet identifier.
- *  @param[in] size The packet total size in bytes.
- *  @returns EOK on success.
- *  @returns Other error codes as defined for the pm_add() function.
- *  @returns Other error codes as defined for the async_share_in_start() function.
+/** Obtain the packet from the packet server as the shared memory block.
+ *
+ * Create the local packet mapping as well.
+ *
+ * @param[in]  phone     The packet server module phone.
+ * @param[out] packet    The packet reference pointer to store the received
+ *                       packet reference.
+ * @param[in]  packet_id The packet identifier.
+ * @param[in]  size      The packet total size in bytes.
+ *
+ * @return EOK on success.
+ * @return Other error codes as defined for the pm_add() function.
+ * @return Other error codes as defined for the async_share_in_start() function.
+ *
  */
-int packet_return(int phone, packet_ref packet, packet_id_t packet_id, size_t size);
-
-int packet_translate(int phone, packet_ref packet, packet_id_t packet_id){
+static int packet_return(int phone, packet_ref packet, packet_id_t packet_id, size_t size){
 	ERROR_DECLARE;
-
-	ipcarg_t size;
-	packet_t next;
-
-	if(! packet){
-		return EINVAL;
-	}
-	*packet = pm_find(packet_id);
-	if(!(*packet)){
-		ERROR_PROPAGATE(async_req_1_1(phone, NET_PACKET_GET_SIZE, packet_id, &size));
-		ERROR_PROPAGATE(packet_return(phone, packet, packet_id, size));
-	}
-	if((** packet).next){
-		return packet_translate(phone, &next, (** packet).next);
-	}else return EOK;
-}
-
-int packet_return(int phone, packet_ref packet, packet_id_t packet_id, size_t size){
-	ERROR_DECLARE;
-
-	aid_t message;
+	
 	ipc_call_t answer;
-	ipcarg_t result;
-
-	message = async_send_1(phone, NET_PACKET_GET, packet_id, &answer);
+	aid_t message = async_send_1(phone, NET_PACKET_GET, packet_id, &answer);
 	*packet = (packet_t) as_get_mappable_page(size);
-	if(ERROR_OCCURRED(async_share_in_start_0_0(phone, * packet, size))
-		|| ERROR_OCCURRED(pm_add(*packet))){
+	if (ERROR_OCCURRED(async_share_in_start_0_0(phone, *packet, size))
+	    || ERROR_OCCURRED(pm_add(*packet))) {
 		munmap(*packet, size);
 		async_wait_for(message, NULL);
 		return ERROR_CODE;
 	}
+	
+	ipcarg_t result;
 	async_wait_for(message, &result);
+	
 	return result;
 }
 
-packet_t packet_get_4(int phone, size_t max_content, size_t addr_len, size_t max_prefix, size_t max_suffix){
+int packet_translate_remote(int phone, packet_ref packet, packet_id_t packet_id)
+{
 	ERROR_DECLARE;
+	
+	if (!packet)
+		return EINVAL;
+	
+	*packet = pm_find(packet_id);
+	if (!(*packet)) {
+		ipcarg_t size;
+		
+		ERROR_PROPAGATE(async_req_1_1(phone, NET_PACKET_GET_SIZE, packet_id, &size));
+		ERROR_PROPAGATE(packet_return(phone, packet, packet_id, size));
+	}
+	if ((** packet).next) {
+		packet_t next;
+		
+		return packet_translate_remote(phone, &next, (** packet).next);
+	}
+	
+	return EOK;
+}
 
+packet_t packet_get_4_remote(int phone, size_t max_content, size_t addr_len,
+    size_t max_prefix, size_t max_suffix)
+{
+	ERROR_DECLARE;
+	
 	ipcarg_t packet_id;
 	ipcarg_t size;
-	packet_t packet;
-
-	if(ERROR_OCCURRED(async_req_4_2(phone, NET_PACKET_CREATE_4, max_content, addr_len, max_prefix, max_suffix, &packet_id, &size))){
+	
+	if (ERROR_OCCURRED(async_req_4_2(phone, NET_PACKET_CREATE_4, max_content,
+	    addr_len, max_prefix, max_suffix, &packet_id, &size)))
 		return NULL;
+	
+	
+	packet_t packet = pm_find(packet_id);
+	if (!packet) {
+		if (ERROR_OCCURRED(packet_return(phone, &packet, packet_id, size)))
+			return NULL;
 	}
-	packet = pm_find(packet_id);
-	if(! packet){
-		if(ERROR_OCCURRED(packet_return(phone, &packet, packet_id, size))){
-			return NULL;
-		}
-	}
+	
 	return packet;
 }
 
-packet_t packet_get_1(int phone, size_t content){
+packet_t packet_get_1_remote(int phone, size_t content)
+{
 	ERROR_DECLARE;
-
+	
 	ipcarg_t packet_id;
 	ipcarg_t size;
-	packet_t packet;
-
-	if(ERROR_OCCURRED(async_req_1_2(phone, NET_PACKET_CREATE_1, content, &packet_id, &size))){
+	
+	if (ERROR_OCCURRED(async_req_1_2(phone, NET_PACKET_CREATE_1, content,
+	    &packet_id, &size)))
 		return NULL;
+	
+	packet_t packet = pm_find(packet_id);
+	if (!packet) {
+		if (ERROR_OCCURRED(packet_return(phone, &packet, packet_id, size)))
+			return NULL;
 	}
-	packet = pm_find(packet_id);
-	if(! packet){
-		if(ERROR_OCCURRED(packet_return(phone, &packet, packet_id, size))){
-			return NULL;
-		}
-	}
+	
 	return packet;
 }
 
-void pq_release(int phone, packet_id_t packet_id){
+void pq_release_remote(int phone, packet_id_t packet_id)
+{
 	async_msg_1(phone, NET_PACKET_RELEASE, packet_id);
 }
Index: uspace/lib/net/il/arp_remote.c
===================================================================
--- uspace/lib/net/il/arp_remote.c	(revision 24ab58b348754b301fea741628d74d49704735d6)
+++ uspace/lib/net/il/arp_remote.c	(revision 14f1db0aaed5208d5e8340c816ca6e555f81f67e)
@@ -32,5 +32,5 @@
 
 /** @file
- *  ARP interface implementation for standalone remote modules.
+ *  ARP interface implementation for remote modules.
  *  @see arp_interface.h
  */
Index: uspace/lib/net/il/ip_client.c
===================================================================
--- uspace/lib/net/il/ip_client.c	(revision 24ab58b348754b301fea741628d74d49704735d6)
+++ uspace/lib/net/il/ip_client.c	(revision 14f1db0aaed5208d5e8340c816ca6e555f81f67e)
@@ -56,5 +56,5 @@
 }
 
-int ip_client_get_pseudo_header(ip_protocol_t protocol, struct sockaddr * src, socklen_t srclen, struct sockaddr * dest, socklen_t destlen, size_t data_length, ip_pseudo_header_ref * header, size_t * headerlen){
+int ip_client_get_pseudo_header(ip_protocol_t protocol, struct sockaddr * src, socklen_t srclen, struct sockaddr * dest, socklen_t destlen, size_t data_length, void **header, size_t * headerlen){
 	ipv4_pseudo_header_ref header_in;
 	struct sockaddr_in * address_in;
@@ -84,5 +84,5 @@
 			header_in->protocol = protocol;
 			header_in->data_length = htons(data_length);
-			*header = (ip_pseudo_header_ref) header_in;
+			*header = header_in;
 			return EOK;
 		// TODO IPv6
@@ -164,5 +164,5 @@
 }
 
-int ip_client_set_pseudo_header_data_length(ip_pseudo_header_ref header, size_t headerlen, size_t data_length){
+int ip_client_set_pseudo_header_data_length(void *header, size_t headerlen, size_t data_length){
 	ipv4_pseudo_header_ref header_in;
 
Index: uspace/lib/net/il/ip_remote.c
===================================================================
--- uspace/lib/net/il/ip_remote.c	(revision 24ab58b348754b301fea741628d74d49704735d6)
+++ uspace/lib/net/il/ip_remote.c	(revision 14f1db0aaed5208d5e8340c816ca6e555f81f67e)
@@ -33,5 +33,5 @@
 /** @file
  *
- * IP interface implementation for standalone remote modules.
+ * IP interface implementation for remote modules.
  *
  * @see ip_interface.h
@@ -50,7 +50,19 @@
 #include <il_messages.h>
 #include <ip_messages.h>
-
-int ip_add_route_req(int ip_phone, device_id_t device_id, in_addr_t address,
-    in_addr_t netmask, in_addr_t gateway)
+#include <ip_remote.h>
+
+/** Add a route to the device routing table.
+ *
+ * The target network is routed using this device.
+ *
+ * @param[in] ip_phone  The IP module phone used for (semi)remote calls.
+ * @param[in] device_id The device identifier.
+ * @param[in] address   The target network address.
+ * @param[in] netmask   The target network mask.
+ * @param[in] gateway   The target network gateway. Not used if zero.
+ *
+ */
+int ip_add_route_req_remote(int ip_phone, device_id_t device_id,
+    in_addr_t address, in_addr_t netmask, in_addr_t gateway)
 {
 	return (int) async_req_4_0(ip_phone, NET_IP_ADD_ROUTE,
@@ -71,12 +83,44 @@
 }
 
-int ip_device_req(int ip_phone, device_id_t device_id, services_t service)
-{
-	return generic_device_req(ip_phone, NET_IL_DEVICE, device_id, 0, service);
-}
-
-int ip_get_route_req(int ip_phone, ip_protocol_t protocol,
+/** Register the new device.
+ *
+ * Register itself as the ip packet receiver.
+ * If the device uses ARP registers also the new ARP device.
+ *
+ * @param[in] ip_phone  The IP module phone used for (semi)remote calls.
+ * @param[in] device_id The new device identifier.
+ * @param[in] netif     The underlying device network interface layer service.
+ *
+ * @return EOK on success.
+ * @return ENOMEM if there is not enough memory left.
+ * @return EINVAL if the device configuration is invalid.
+ * @return ENOTSUP if the device uses IPv6.
+ * @return ENOTSUP if the device uses DHCP.
+ * @return Other error codes as defined for the net_get_device_conf_req()
+ *         function.
+ * @return Other error codes as defined for the arp_device_req() function.
+ *
+ */
+int ip_device_req_remote(int ip_phone, device_id_t device_id,
+    services_t service)
+{
+	return generic_device_req_remote(ip_phone, NET_IL_DEVICE, device_id, 0,
+	    service);
+}
+
+/** Return the device identifier and the IP pseudo header based on the destination address.
+ *
+ * @param[in]  ip_phone    The IP module phone used for (semi)remote calls.
+ * @param[in]  protocol    The transport protocol.
+ * @param[in]  destination The destination address.
+ * @param[in]  addrlen     The destination address length.
+ * @param[out] device_id   The device identifier.
+ * @param[out] header      The constructed IP pseudo header.
+ * @param[out] headerlen   The IP pseudo header length.
+ *
+ */
+int ip_get_route_req_remote(int ip_phone, ip_protocol_t protocol,
     const struct sockaddr *destination, socklen_t addrlen,
-    device_id_t *device_id, ip_pseudo_header_ref *header, size_t *headerlen)
+    device_id_t *device_id, void **header, size_t *headerlen)
 {
 	if ((!destination) || (addrlen == 0))
@@ -95,5 +139,5 @@
 	    && (async_data_read_start(ip_phone, headerlen, sizeof(*headerlen)) == EOK)
 	    && (*headerlen > 0)) {
-		*header = (ip_pseudo_header_ref) malloc(*headerlen);
+		*header = malloc(*headerlen);
 		if (*header) {
 			if (async_data_read_start(ip_phone, *header, *headerlen) != EOK)
@@ -113,26 +157,77 @@
 }
 
-int ip_packet_size_req(int ip_phone, device_id_t device_id,
+/** Return the device packet dimension for sending.
+ *
+ * @param[in]  ip_phone         The IP module phone used for (semi)remote calls.
+ * @param[in]  device_id        The device identifier.
+ * @param[out] packet_dimension The packet dimension.
+ *
+ * @return EOK on success.
+ * @return ENOENT if there is no such device.
+ * @return Other error codes as defined for the
+ *         generic_packet_size_req_remote() function.
+ *
+ */
+int ip_packet_size_req_remote(int ip_phone, device_id_t device_id,
     packet_dimension_ref packet_dimension)
 {
-	return generic_packet_size_req(ip_phone, NET_IL_PACKET_SPACE, device_id,
+	return generic_packet_size_req_remote(ip_phone, NET_IL_PACKET_SPACE, device_id,
 	    packet_dimension);
 }
 
-int ip_received_error_msg(int ip_phone, device_id_t device_id,
+/** Notify the IP module about the received error notification packet.
+ *
+ * @param[in] ip_phone  The IP module phone used for (semi)remote calls.
+ * @param[in] device_id The device identifier.
+ * @param[in] packet    The received packet or the received packet queue.
+ * @param[in] target    The target internetwork module service to be
+ *                      delivered to.
+ * @param[in] error     The packet error reporting service. Prefixes the
+ *                      received packet.
+ *
+ * @return EOK on success.
+ *
+ */
+int ip_received_error_msg_remote(int ip_phone, device_id_t device_id,
     packet_t packet, services_t target, services_t error)
 {
-	return generic_received_msg(ip_phone, NET_IP_RECEIVED_ERROR, device_id,
-	    packet_get_id(packet), target, error);
-}
-
-int ip_send_msg(int ip_phone, device_id_t device_id, packet_t packet,
+	return generic_received_msg_remote(ip_phone, NET_IP_RECEIVED_ERROR,
+	    device_id, packet_get_id(packet), target, error);
+}
+
+/** Send the packet queue.
+ *
+ * The packets may get fragmented if needed.
+ *
+ * @param[in] ip_phone  The IP module phone used for (semi)remote calls.
+ * @param[in] device_id The device identifier.
+ * @param[in] packet    The packet fragments as a packet queue. All the
+ *                      packets have to have the same destination address.
+ * @param[in] sender    The sending module service.
+ * @param[in] error     The packet error reporting service. Prefixes the
+ *                      received packet.
+ *
+ * @return EOK on success.
+ * @return Other error codes as defined for the generic_send_msg() function.
+ *
+ */
+int ip_send_msg_remote(int ip_phone, device_id_t device_id, packet_t packet,
     services_t sender, services_t error)
 {
-	return generic_send_msg(ip_phone, NET_IL_SEND, device_id,
+	return generic_send_msg_remote(ip_phone, NET_IL_SEND, device_id,
 	    packet_get_id(packet), sender, error);
 }
 
-int ip_set_gateway_req(int ip_phone, device_id_t device_id, in_addr_t gateway)
+/** Set the default gateway.
+ *
+ * This gateway is used if no other route is found.
+ *
+ * @param[in] ip_phone  The IP module phone used for (semi)remote calls.
+ * @param[in] device_id The device identifier.
+ * @param[in] gateway   The default gateway.
+ *
+ */
+int ip_set_gateway_req_remote(int ip_phone, device_id_t device_id,
+    in_addr_t gateway)
 {
 	return (int) async_req_2_0(ip_phone, NET_IP_SET_GATEWAY,
Index: uspace/lib/net/include/arp_interface.h
===================================================================
--- uspace/lib/net/include/arp_interface.h	(revision 24ab58b348754b301fea741628d74d49704735d6)
+++ uspace/lib/net/include/arp_interface.h	(revision 14f1db0aaed5208d5e8340c816ca6e555f81f67e)
@@ -29,11 +29,4 @@
 /** @addtogroup arp
  *  @{
- */
-
-/** @file
- *  ARP module interface.
- *  The same interface is used for standalone remote modules as well as for bundle modules.
- *  The standalone remote modules have to be compiled with the arp_remote.c source file.
- *  The bundle modules with the arp.c source file.
  */
 
Index: uspace/lib/net/include/icmp_interface.h
===================================================================
--- uspace/lib/net/include/icmp_interface.h	(revision 24ab58b348754b301fea741628d74d49704735d6)
+++ uspace/lib/net/include/icmp_interface.h	(revision 14f1db0aaed5208d5e8340c816ca6e555f81f67e)
@@ -29,11 +29,4 @@
 /** @addtogroup icmp
  *  @{
- */
-
-/** @file
- *  ICMP module interface.
- *  The same interface is used for standalone remote modules as well as for bundle modules.
- *  The standalone remote modules have to be compiled with the icmp_remote.c source file.
- *  The bundle modules with the icmp.c source file.
  */
 
Index: uspace/lib/net/include/il_interface.h
===================================================================
--- uspace/lib/net/include/il_interface.h	(revision 24ab58b348754b301fea741628d74d49704735d6)
+++ uspace/lib/net/include/il_interface.h	(revision 14f1db0aaed5208d5e8340c816ca6e555f81f67e)
@@ -32,6 +32,6 @@
 
 /** @file
- *  Internetwork layer module interface for the underlying network interface layer.
- *  This interface is always called by the standalone remote modules.
+ * Internetwork layer module interface for the underlying network interface layer.
+ * This interface is always called by the remote modules.
  */
 
@@ -50,39 +50,63 @@
 
 /** @name Internetwork layer module interface
- *  This interface is used by other modules.
+ * This interface is used by other modules.
  */
 /*@{*/
 
-/** Notifies the internetwork layer modules about the device state change.
- *  @param[in] il_phone The internetwork layer module phone used for (semi)remote calls.
- *  @param[in] device_id The device identifier.
- *  @param[in] state The new device state.
- *  @param[in] target The target internetwork module service to be delivered to.
- *  @returns EOK on success.
+/** Notify the internetwork layer modules about the device state change.
+ *
+ * @param[in] il_phone  The internetwork layer module phone used for
+ *                      (semi)remote calls.
+ * @param[in] device_id The device identifier.
+ * @param[in] state     The new device state.
+ * @param[in] target    The target internetwork module service to be
+ *                      delivered to.
+ *
+ * @return EOK on success.
+ *
  */
-static inline int il_device_state_msg(int il_phone, device_id_t device_id, device_state_t state, services_t target){
-	return generic_device_state_msg(il_phone, NET_IL_DEVICE_STATE, device_id, state, target);
+static inline int il_device_state_msg(int il_phone, device_id_t device_id,
+    device_state_t state, services_t target)
+{
+	return generic_device_state_msg_remote(il_phone, NET_IL_DEVICE_STATE,
+	    device_id, state, target);
 }
 
-/** Notifies the internetwork layer modules about the received packet/s.
- *  @param[in] il_phone The internetwork layer module phone used for (semi)remote calls.
- *  @param[in] device_id The device identifier.
- *  @param[in] packet The received packet or the received packet queue.
- *  @param[in] target The target internetwork module service to be delivered to.
- *  @returns EOK on success.
+/** Notify the internetwork layer modules about the received packet/s.
+ *
+ * @param[in] il_phone  The internetwork layer module phone used for
+ *                      (semi)remote calls.
+ * @param[in] device_id The device identifier.
+ * @param[in] packet    The received packet or the received packet queue.
+ * @param[in] target    The target internetwork module service to be
+ *                      delivered to.
+ *
+ * @return EOK on success.
+ *
  */
-inline static int il_received_msg(int il_phone, device_id_t device_id, packet_t packet, services_t target){
-	return generic_received_msg(il_phone, NET_IL_RECEIVED, device_id, packet_get_id(packet), target, 0);
+inline static int il_received_msg(int il_phone, device_id_t device_id,
+    packet_t packet, services_t target)
+{
+	return generic_received_msg_remote(il_phone, NET_IL_RECEIVED, device_id,
+	    packet_get_id(packet), target, 0);
 }
 
-/** Notifies the internetwork layer modules about the mtu change.
- *  @param[in] il_phone The internetwork layer module phone used for (semi)remote calls.
- *  @param[in] device_id The device identifier.
- *  @param[in] mtu The new mtu value.
- *  @param[in] target The target internetwork module service to be delivered to.
- *  @returns EOK on success.
+/** Notify the internetwork layer modules about the mtu change.
+ *
+ * @param[in] il_phone  The internetwork layer module phone used for
+ *                      (semi)remote calls.
+ * @param[in] device_id The device identifier.
+ * @param[in] mtu       The new mtu value.
+ * @param[in] target    The target internetwork module service to be
+ *                      delivered to.
+ *
+ * @return EOK on success.
+ *
  */
-inline static int il_mtu_changed_msg(int il_phone, device_id_t device_id, size_t mtu, services_t target){
-	return generic_device_state_msg(il_phone, NET_IL_MTU_CHANGED, device_id, (int) mtu, target);
+inline static int il_mtu_changed_msg(int il_phone, device_id_t device_id,
+    size_t mtu, services_t target)
+{
+	return generic_device_state_msg_remote(il_phone, NET_IL_MTU_CHANGED,
+	    device_id, (int) mtu, target);
 }
 
Index: uspace/lib/net/include/il_local.h
===================================================================
--- uspace/lib/net/include/il_local.h	(revision 14f1db0aaed5208d5e8340c816ca6e555f81f67e)
+++ uspace/lib/net/include/il_local.h	(revision 14f1db0aaed5208d5e8340c816ca6e555f81f67e)
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2010 Martin Decky
+ * 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 il_local
+ *  @{
+ */
+
+#ifndef __IL_LOCAL_H__
+#define __IL_LOCAL_H__
+
+#include <ipc/ipc.h>
+#include <async.h>
+
+extern int il_module_message_standalone(ipc_callid_t callid, ipc_call_t *call,
+    ipc_call_t *answer, int *answer_count);
+extern int il_module_start_standalone(async_client_conn_t client_connection);
+
+#endif
+
+/** @}
+ */
Index: uspace/lib/net/include/il_messages.h
===================================================================
--- uspace/lib/net/include/il_messages.h	(revision 24ab58b348754b301fea741628d74d49704735d6)
+++ uspace/lib/net/include/il_messages.h	(revision 14f1db0aaed5208d5e8340c816ca6e555f81f67e)
@@ -28,11 +28,11 @@
 
 /** @addtogroup net_il
- *  @{
+ * @{
  */
 
 /** @file
- *  Internetwork layer modules messages.
- *  @see il_interface.h
- *  @see ip_interface.h
+ * Internetwork layer modules messages.
+ * @see il_interface.h
+ * @see ip_interface.h
  */
 
@@ -72,16 +72,19 @@
 
 /** @name Internetwork layer specific message parameters definitions
+ *
  */
 /*@{*/
 
-/** Returns the protocol number message parameter.
- *  @param[in] call The message call structure.
+/** Return the protocol number message parameter.
+ * @param[in] call The message call structure.
+ *
  */
-#define IL_GET_PROTO(call)		(int) IPC_GET_ARG1(*call)
+#define IL_GET_PROTO(call)  (int) IPC_GET_ARG1(*call)
 
-/** Returns the registering service message parameter.
- *  @param[in] call The message call structure.
+/** Return the registering service message parameter.
+ * @param[in] call The 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: pace/lib/net/include/il_standalone.h
===================================================================
--- uspace/lib/net/include/il_standalone.h	(revision 24ab58b348754b301fea741628d74d49704735d6)
+++ 	(revision )
@@ -1,46 +1,0 @@
-/*
- * Copyright (c) 2010 Martin Decky
- * 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 il_standalone
- *  @{
- */
-
-#ifndef __IL_STANDALONE_H__
-#define __IL_STANDALONE_H__
-
-#include <ipc/ipc.h>
-#include <async.h>
-
-extern int il_module_message(ipc_callid_t callid, ipc_call_t *call,
-    ipc_call_t *answer, int *answer_count);
-extern int il_module_start(async_client_conn_t client_connection);
-
-#endif
-
-/** @}
- */
Index: uspace/lib/net/include/ip_client.h
===================================================================
--- uspace/lib/net/include/ip_client.h	(revision 24ab58b348754b301fea741628d74d49704735d6)
+++ uspace/lib/net/include/ip_client.h	(revision 14f1db0aaed5208d5e8340c816ca6e555f81f67e)
@@ -87,5 +87,5 @@
  *  @returns EINVAL if the headerlen parameter is not IPv4 pseudo header length.
  */
-extern int ip_client_set_pseudo_header_data_length(ip_pseudo_header_ref header, size_t headerlen, size_t data_length);
+extern int ip_client_set_pseudo_header_data_length(void *header, size_t headerlen, size_t data_length);
 
 /** Constructs the IPv4 pseudo header.
@@ -107,5 +107,5 @@
  *  @returns ENOMEM if there is not enough memory left.
  */
-extern int ip_client_get_pseudo_header(ip_protocol_t protocol, struct sockaddr * src, socklen_t srclen, struct sockaddr * dest, socklen_t destlen, size_t data_length, ip_pseudo_header_ref * header, size_t * headerlen);
+extern int ip_client_get_pseudo_header(ip_protocol_t protocol, struct sockaddr * src, socklen_t srclen, struct sockaddr * dest, socklen_t destlen, size_t data_length, void **header, size_t * headerlen);
 
 // TODO ipopt manipulation
Index: uspace/lib/net/include/ip_interface.h
===================================================================
--- uspace/lib/net/include/ip_interface.h	(revision 24ab58b348754b301fea741628d74d49704735d6)
+++ uspace/lib/net/include/ip_interface.h	(revision 14f1db0aaed5208d5e8340c816ca6e555f81f67e)
@@ -31,11 +31,4 @@
  */
 
-/** @file
- *  IP module interface.
- *  The same interface is used for standalone remote modules as well as for bundle modules.
- *  The standalone remote modules have to be compiled with the ip_remote.c source file.
- *  The bundle modules with the ip.c source file.
- */
-
 #ifndef __NET_IP_INTERFACE_H__
 #define __NET_IP_INTERFACE_H__
@@ -51,12 +44,34 @@
 #include <socket_codes.h>
 
+#ifdef CONFIG_IL_TL_BUNDLE
+
+#include <ip_local.h>
+
+#define ip_received_error_msg  ip_received_error_msg_local
+#define ip_set_gateway_req     ip_set_gateway_req_local
+#define ip_packet_size_req     ip_packet_size_req_local
+#define ip_device_req          ip_device_req_local
+#define ip_add_route_req       ip_add_route_req_local
+#define ip_send_msg            ip_send_msg_local
+#define ip_get_route_req       ip_get_route_req_local
+
+#else
+
+#include <ip_remote.h>
+
+#define ip_received_error_msg  ip_received_error_msg_remote
+#define ip_set_gateway_req     ip_set_gateway_req_remote
+#define ip_packet_size_req     ip_packet_size_req_remote
+#define ip_device_req          ip_device_req_remote
+#define ip_add_route_req       ip_add_route_req_remote
+#define ip_send_msg            ip_send_msg_remote
+#define ip_get_route_req       ip_get_route_req_remote
+
+#endif
+
 /** @name IP module interface
  *  This interface is used by other modules.
  */
 /*@{*/
-
-/** Type definition of the internet pseudo header pointer.
- */
-typedef void *		ip_pseudo_header_ref;
 
 /** The transport layer notification function type definition.
@@ -82,32 +97,4 @@
 extern int ip_bind_service(services_t service, int protocol, services_t me, async_client_conn_t receiver, tl_received_msg_t tl_received_msg);
 
-/** Registers the new device.
- *  Registers itself as the ip packet receiver.
- *  If the device uses ARP registers also the new ARP device.
- *  @param[in] ip_phone The IP module phone used for (semi)remote calls.
- *  @param[in] device_id The new device identifier.
- *  @param[in] netif The underlying device network interface layer service.
- *  @returns EOK on success.
- *  @returns ENOMEM if there is not enough memory left.
- *  @returns EINVAL if the device configuration is invalid.
- *  @returns ENOTSUP if the device uses IPv6.
- *  @returns ENOTSUP if the device uses DHCP.
- *  @returns Other error codes as defined for the net_get_device_conf_req() function.
- *  @returns Other error codes as defined for the arp_device_req() function.
- */
-extern int ip_device_req(int, device_id_t, services_t);
-
-/** Sends the packet queue.
- *  The packets may get fragmented if needed.
- *  @param[in] ip_phone The IP module phone used for (semi)remote calls.
- *  @param[in] device_id The device identifier.
- *  @param[in] packet The packet fragments as a~packet queue. All the packets have to have the same destination address.
- *  @param[in] sender The sending module service.
- *  @param[in] error The packet error reporting service. Prefixes the received packet.
- *  @returns EOK on success.
- *  @returns Other error codes as defined for the generic_send_msg() function.
- */
-extern int ip_send_msg(int ip_phone, device_id_t device_id, packet_t packet, services_t sender, services_t error);
-
 /** Connects to the IP module.
  *  @param service The IP module service. Ignored parameter.
@@ -117,53 +104,4 @@
 extern int ip_connect_module(services_t service);
 
-/** Adds a route to the device routing table.
- *  The target network is routed using this device.
- *  @param[in] ip_phone The IP module phone used for (semi)remote calls.
- *  @param[in] device_id The device identifier.
- *  @param[in] address The target network address.
- *  @param[in] netmask The target network mask.
- *  @param[in] gateway The target network gateway. Not used if zero.
- */
-extern int ip_add_route_req(int ip_phone, device_id_t device_id, in_addr_t address, in_addr_t netmask, in_addr_t gateway);
-
-/** Sets the default gateway.
- *  This gateway is used if no other route is found.
- *  @param[in] ip_phone The IP module phone used for (semi)remote calls.
- *  @param[in] device_id The device identifier.
- *  @param[in] gateway The default gateway.
- */
-extern int ip_set_gateway_req(int ip_phone, device_id_t device_id, in_addr_t gateway);
-
-/** Returns the device packet dimension for sending.
- *  @param[in] ip_phone The IP module phone used for (semi)remote calls.
- *  @param[in] device_id The device identifier.
- *  @param[out] packet_dimension The packet dimension.
- *  @returns EOK on success.
- *  @returns ENOENT if there is no such device.
- *  @returns Other error codes as defined for the generic_packet_size_req() function.
- */
-extern int ip_packet_size_req(int ip_phone, device_id_t device_id, packet_dimension_ref packet_dimension);
-
-/** Notifies the IP module about the received error notification packet.
- *  @param[in] ip_phone The IP module phone used for (semi)remote calls.
- *  @param[in] device_id The device identifier.
- *  @param[in] packet The received packet or the received packet queue.
- *  @param[in] target The target internetwork module service to be delivered to.
- *  @param[in] error The packet error reporting service. Prefixes the received packet.
- *  @returns EOK on success.
- */
-extern int ip_received_error_msg(int ip_phone, device_id_t device_id, packet_t packet, services_t target, services_t error);
-
-/** Returns the device identifier and the IP pseudo header based on the destination address.
- *  @param[in] ip_phone The IP module phone used for (semi)remote calls.
- *  @param[in] protocol The transport protocol.
- *  @param[in] destination The destination address.
- *  @param[in] addrlen The destination address length.
- *  @param[out] device_id The device identifier.
- *  @param[out] header The constructed IP pseudo header.
- *  @param[out] headerlen The IP pseudo header length.
- */
-extern int ip_get_route_req(int ip_phone, ip_protocol_t protocol, const struct sockaddr * destination, socklen_t addrlen, device_id_t * device_id, ip_pseudo_header_ref * header, size_t * headerlen);
-
 /*@}*/
 
Index: uspace/lib/net/include/ip_local.h
===================================================================
--- uspace/lib/net/include/ip_local.h	(revision 14f1db0aaed5208d5e8340c816ca6e555f81f67e)
+++ uspace/lib/net/include/ip_local.h	(revision 14f1db0aaed5208d5e8340c816ca6e555f81f67e)
@@ -0,0 +1,61 @@
+/*
+ * 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 ip
+ * @{
+ */
+
+#ifndef __NET_IP_LOCAL_H__
+#define __NET_IP_LOCAL_H__
+
+#include <async.h>
+#include <ipc/services.h>
+
+#include <ip_codes.h>
+#include <inet.h>
+#include <in.h>
+#include <socket.h>
+
+extern int ip_received_error_msg_local(int, device_id_t, packet_t, services_t,
+    services_t);
+extern int ip_set_gateway_req_local(int, device_id_t, in_addr_t);
+extern int ip_packet_size_req_local(int, device_id_t, packet_dimension_ref);
+extern int ip_received_error_msg_local(int, device_id_t, packet_t, services_t,
+    services_t);
+extern int ip_device_req_local(int, device_id_t, services_t);
+extern int ip_add_route_req_local(int, device_id_t, in_addr_t, in_addr_t,
+    in_addr_t);
+extern int ip_send_msg_local(int, device_id_t, packet_t, services_t,
+    services_t);
+extern int ip_get_route_req_local(int, ip_protocol_t, const struct sockaddr *,
+    socklen_t, device_id_t *, void **, size_t *);
+
+#endif
+
+/** @}
+ */
Index: uspace/lib/net/include/ip_remote.h
===================================================================
--- uspace/lib/net/include/ip_remote.h	(revision 14f1db0aaed5208d5e8340c816ca6e555f81f67e)
+++ uspace/lib/net/include/ip_remote.h	(revision 14f1db0aaed5208d5e8340c816ca6e555f81f67e)
@@ -0,0 +1,59 @@
+/*
+ * 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 ip
+ * @{
+ */
+
+#ifndef __NET_IP_REMOTE_H__
+#define __NET_IP_REMOTE_H__
+
+#include <async.h>
+#include <ipc/services.h>
+
+#include <ip_codes.h>
+#include <inet.h>
+#include <in.h>
+#include <socket.h>
+
+extern int ip_set_gateway_req_remote(int, device_id_t, in_addr_t);
+extern int ip_packet_size_req_remote(int, device_id_t, packet_dimension_ref);
+extern int ip_received_error_msg_remote(int, device_id_t, packet_t, services_t,
+    services_t);
+extern int ip_device_req_remote(int, device_id_t, services_t);
+extern int ip_add_route_req_remote(int, device_id_t, in_addr_t, in_addr_t,
+    in_addr_t);
+extern int ip_send_msg_remote(int, device_id_t, packet_t, services_t,
+    services_t);
+extern int ip_get_route_req_remote(int, ip_protocol_t, const struct sockaddr *,
+    socklen_t, device_id_t *, void **, size_t *);
+
+#endif
+
+/** @}
+ */
Index: uspace/lib/net/include/net_interface.h
===================================================================
--- uspace/lib/net/include/net_interface.h	(revision 24ab58b348754b301fea741628d74d49704735d6)
+++ uspace/lib/net/include/net_interface.h	(revision 14f1db0aaed5208d5e8340c816ca6e555f81f67e)
@@ -29,11 +29,4 @@
 /** @addtogroup net
  *  @{
- */
-
-/** @file
- *  Networking module interface.
- *  The same interface is used for standalone remote modules as well as for bundle modules.
- *  The standalone remote modules have to be compiled with the net_remote.c source file.
- *  The bundle networking module is compiled with the net_bundle.c source file and the choosen bundle module implementation source files.
  */
 
Index: pace/lib/net/include/netif.h
===================================================================
--- uspace/lib/net/include/netif.h	(revision 24ab58b348754b301fea741628d74d49704735d6)
+++ 	(revision )
@@ -1,168 +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 netif
- *  @{
- */
-
-/** @file
- *  Network interface module skeleton.
- *  The skeleton has to be part of each network interface module.
- *  The skeleton can be also part of the module bundled with the network interface layer.
- */
-
-#ifndef __NET_NETIF_H__
-#define __NET_NETIF_H__
-
-#include <async.h>
-#include <fibril_synch.h>
-
-#include <ipc/ipc.h>
-
-#include <net_err.h>
-#include <net_device.h>
-#include <packet/packet.h>
-
-/** Network interface module skeleton global data.
- */
-typedef struct netif_globals	netif_globals_t;
-
-/** Type definition of the device specific data.
- *  @see netif_device
- */
-typedef struct netif_device	device_t;
-
-/** Type definition of the device specific data pointer.
- *  @see netif_device
- */
-typedef device_t *			device_ref;
-
-/** Device map.
- *  Maps device identifiers to the network interface device specific data.
- *  @see device.h
- */
-DEVICE_MAP_DECLARE(device_map, device_t);
-
-/** Network interface device specific data.
- */
-struct	netif_device{
-	/** Device identifier.
-	 */
-	device_id_t device_id;
-	/** Receiving network interface layer phone.
-	 */
-	int nil_phone;
-	/** Actual device state.
-	 */
-	device_state_t state;
-	/** Driver specific data.
-	 */
-	void * specific;
-};
-
-/** Network interface module skeleton global data.
- */
-struct	netif_globals{
-	/** Networking module phone.
-	 */
-	int net_phone;
-	/**	Device map.
-	 */
-	device_map_t device_map;
-	/** Safety lock.
-	 */
-	fibril_rwlock_t lock;
-};
-
-extern netif_globals_t netif_globals;
-
-/**	Finds the device specific data.
- *  @param[in] device_id The device identifier.
- *  @param[out] device The device specific data.
- *  @returns EOK on success.
- *  @returns ENOENT if device is not found.
- *  @returns EPERM if the device is not initialized.
- */
-extern int find_device(device_id_t device_id, device_ref * device);
-
-/** Clears the usage statistics.
- *  @param[in] stats The usage statistics.
- */
-extern void null_device_stats(device_stats_ref stats);
-
-// prepared for future optimalizations
-/** Releases the given packet.
- *  @param[in] packet_id The packet identifier.
- */
-extern void netif_pq_release(packet_id_t packet_id);
-
-/** Allocates new packet to handle the given content size.
- *  @param[in] content The minimum content size.
- *  @returns The allocated packet.
- *  @returns NULL if there is an error.
- */
-extern packet_t netif_packet_get_1(size_t content);
-
-/** 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 netif_interface.h
- * @see IS_NET_NETIF_MESSAGE()
- *
- */
-extern int netif_message(const char *, ipc_callid_t, ipc_call_t *,
-    ipc_call_t *, int *);
-
-/** Initializes the netif module.
- *  The function has to be defined in each module.
- *  @param[in] net_client_connection The client connection functio to be registered.
- *  @returns EOK on success.
- *  @returns Other error codes as defined for each specific module message function.
- */
-extern int netif_init_module(async_client_conn_t client_connection);
-
-/** Starts and maintains the netif module until terminated.
- *  @returns EOK after the module is terminated.
- */
-extern int netif_run_module(void);
-
-#endif
-
-/** @}
- */
-
Index: uspace/lib/net/include/netif_interface.h
===================================================================
--- uspace/lib/net/include/netif_interface.h	(revision 24ab58b348754b301fea741628d74d49704735d6)
+++ uspace/lib/net/include/netif_interface.h	(revision 14f1db0aaed5208d5e8340c816ca6e555f81f67e)
@@ -28,12 +28,5 @@
 
 /** @addtogroup netif
- *  @{
- */
-
-/** @file
- *  Network interface module interface.
- *  The same interface is used for standalone remote modules as well as for bundle network interface layer modules.
- *  The standalone remote modules have to be compiled with the netif_remote.c source file.
- *  The bundle network interface layer modules are compiled with the netif_nil_bundle.c source file and the choosen network interface layer implementation source file.
+ * @{
  */
 
@@ -41,86 +34,36 @@
 #define __NET_NETIF_INTERFACE_H__
 
-#include <ipc/services.h>
+#ifdef CONFIG_NETIF_NIL_BUNDLE
 
-#include <net_messages.h>
-#include <adt/measured_strings.h>
-#include <packet/packet.h>
-#include <net_device.h>
+#include <netif_local.h>
+#include <netif_nil_bundle.h>
+#include <packet/packet_server.h>
 
-/** @name Network interface module interface
- *  This interface is used by other modules.
- */
-/*@{*/
+#define netif_module_message    netif_nil_module_message
+#define netif_module_start      netif_nil_module_start
+#define netif_get_addr_req      netif_get_addr_req_local
+#define netif_probe_req         netif_probe_req_local
+#define netif_send_msg          netif_send_msg_local
+#define netif_start_req         netif_start_req_local
+#define netif_stop_req          netif_stop_req_local
+#define netif_stats_req         netif_stats_req_local
+#define netif_bind_service      netif_bind_service_local
 
-/** Returns 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.
- *  @returns EOK on success.
- *  @returns EBADMEM if the address parameter is NULL.
- *  @returns ENOENT if there no such device.
- *  @returns Other error codes as defined for the netif_get_addr_message() function.
- */
-extern int netif_get_addr_req(int netif_phone, device_id_t device_id, measured_string_ref * address, char ** data);
+#else /* CONFIG_NETIF_NIL_BUNDLE */
 
-/** Probes 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.
- *  @returns EOK on success.
- *  @returns Other errro codes as defined for the netif_probe_message().
- */
-extern int netif_probe_req(int netif_phone, device_id_t device_id, int irq, int io);
+#include <netif_remote.h>
+#include <packet/packet_client.h>
 
-/** Sends 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.
- *  @returns EOK on success.
- *  @returns Other error codes as defined for the generic_send_msg() function.
- */
-extern int netif_send_msg(int netif_phone, device_id_t device_id, packet_t packet, services_t sender);
+#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
 
-/** Starts the device.
- *  @param[in] netif_phone The network interface phone.
- *  @param[in] device_id The device identifier.
- *  @returns EOK on success.
- *  @returns Other error codes as defined for the find_device() function.
- *  @returns Other error codes as defined for the netif_start_message() function.
- */
-extern int netif_start_req(int netif_phone, device_id_t device_id);
-
-/** Stops the device.
- *  @param[in] netif_phone The network interface phone.
- *  @param[in] device_id The device identifier.
- *  @returns EOK on success.
- *  @returns Other error codes as defined for the find_device() function.
- *  @returns Other error codes as defined for the netif_stop_message() function.
- */
-extern int netif_stop_req(int netif_phone, device_id_t device_id);
-
-/** Returns 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.
- *  @returns EOK on success.
- */
-extern int netif_stats_req(int netif_phone, device_id_t device_id, device_stats_ref stats);
-
-/** Creates bidirectional connection with the network interface module and registers the message receiver.
- *  @param[in] service The network interface module service.
- *  @param[in] device_id The device identifier.
- *  @param[in] me The requesting module service.
- *  @param[in] receiver The message receiver.
- *  @returns The phone of the needed service.
- *  @returns EOK on success.
- *  @returns Other error codes as defined for the bind_service() function.
- */
-extern int netif_bind_service(services_t service, device_id_t device_id, services_t me, async_client_conn_t receiver);
-
-/*@}*/
+#endif /* CONFIG_NETIF_NIL_BUNDLE */
 
 #endif
Index: uspace/lib/net/include/netif_local.h
===================================================================
--- uspace/lib/net/include/netif_local.h	(revision 14f1db0aaed5208d5e8340c816ca6e555f81f67e)
+++ uspace/lib/net/include/netif_local.h	(revision 14f1db0aaed5208d5e8340c816ca6e555f81f67e)
@@ -0,0 +1,227 @@
+/*
+ * 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 netif
+ * @{
+ */
+
+/** @file
+ * Network interface module skeleton.
+ * The skeleton has to be part of each network interface module.
+ * The skeleton can be also part of the module bundled with the network interface layer.
+ */
+
+#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_err.h>
+#include <net_device.h>
+#include <packet/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_ref 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_ref stats);
+
+extern int netif_get_addr_req_local(int, device_id_t, measured_string_ref *,
+    char **);
+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_ref);
+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_ref);
+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_messages.h
===================================================================
--- uspace/lib/net/include/netif_messages.h	(revision 24ab58b348754b301fea741628d74d49704735d6)
+++ uspace/lib/net/include/netif_messages.h	(revision 14f1db0aaed5208d5e8340c816ca6e555f81f67e)
@@ -28,10 +28,9 @@
 
 /** @addtogroup netif
- *  @{
+ * @{
  */
 
 /** @file
- *  Network interface common module messages.
- *  @see netif_interface.h
+ * Network interface common module messages.
  */
 
@@ -76,12 +75,12 @@
 /*@{*/
 
-/** Returns the interrupt number message parameter.
- *  @param[in] call The message call structure.
+/** Return the interrupt number message parameter.
+ * @param[in] call The message call structure.
  */
 #define NETIF_GET_IRQ(call) \
 	({int irq = (int) IPC_GET_ARG2(*call); irq;})
 
-/** Returns the input/output address message parameter.
- *  @param[in] call The message call structure.
+/** Return the input/output address message parameter.
+ * @param[in] call The message call structure.
  */
 #define NETIF_GET_IO(call) \
Index: pace/lib/net/include/netif_module.h
===================================================================
--- uspace/lib/net/include/netif_module.h	(revision 24ab58b348754b301fea741628d74d49704735d6)
+++ 	(revision )
@@ -1,125 +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 netif
- *  @{
- */
-
-/** @file
- *  Network interface module interface.
- *  The interface has to be implemented by each network interface module.
- *  The interface is used by the network interface module skeleton.
- */
-
-#ifndef __NET_NETIF_MODULE_H__
-#define __NET_NETIF_MODULE_H__
-
-#include <ipc/ipc.h>
-#include <ipc/services.h>
-
-#include <adt/measured_strings.h>
-#include <packet/packet.h>
-#include <net_device.h>
-
-/** Initializes the specific module.
- */
-extern int netif_initialize(void);
-
-/** Probes the existence of the device.
- *  @param[in] device_id The device identifier.
- *  @param[in] irq The device interrupt number.
- *  @param[in] io The device input/output address.
- *  @returns EOK on success.
- *  @returns Other error codes as defined for the find_device() function.
- *  @returns 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);
-
-/** Sends the packet queue.
- *  @param[in] device_id The device identifier.
- *  @param[in] packet The packet queue.
- *  @param[in] sender The sending module service.
- *  @returns EOK on success.
- *  @returns EFORWARD if the device is not active (in the NETIF_ACTIVE state).
- *  @returns Other error codes as defined for the find_device() function.
- *  @returns 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);
-
-/** Starts the device.
- *  @param[in] device The device structure.
- *  @returns EOK on success.
- *  @returns Other error codes as defined for the find_device() function.
- *  @returns Other error codes as defined for the specific module message implementation.
- */
-extern int netif_start_message(device_ref device);
-
-/** Stops the device.
- *  @param[in] device The device structure.
- *  @returns EOK on success.
- *  @returns Other error codes as defined for the find_device() function.
- *  @returns Other error codes as defined for the specific module message implementation.
- */
-extern int netif_stop_message(device_ref device);
-
-/** Returns the device local hardware address.
- *  @param[in] device_id The device identifier.
- *  @param[out] address The device local hardware address.
- *  @returns EOK on success.
- *  @returns EBADMEM if the address parameter is NULL.
- *  @returns ENOENT if there no such device.
- *  @returns Other error codes as defined for the find_device() function.
- *  @returns Other error codes as defined for the specific module message implementation.
- */
-extern int netif_get_addr_message(device_id_t device_id, measured_string_ref address);
-
-/** Processes the netif driver specific message.
- *  This function is called for uncommon messages received by the netif skeleton.
- *  @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.
- *  @returns EOK on success.
- *  @returns ENOTSUP if the message is not known.
- *  @returns 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);
-
-/** Returns the device usage statistics.
- *  @param[in] device_id The device identifier.
- *  @param[out] stats The device usage statistics.
- *  @returns EOK on success.
- *  @returns Other error codes as defined for the find_device() function.
- *  @returns Other error codes as defined for the specific module message implementation.
- */
-extern int netif_get_device_stats(device_id_t device_id, device_stats_ref stats);
-
-#endif
-
-/** @}
- */
Index: uspace/lib/net/include/netif_remote.h
===================================================================
--- uspace/lib/net/include/netif_remote.h	(revision 14f1db0aaed5208d5e8340c816ca6e555f81f67e)
+++ uspace/lib/net/include/netif_remote.h	(revision 14f1db0aaed5208d5e8340c816ca6e555f81f67e)
@@ -0,0 +1,53 @@
+/*
+ * 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 netif
+ * @{
+ */
+
+#ifndef __NET_NETIF_REMOTE_H__
+#define __NET_NETIF_REMOTE_H__
+
+#include <async.h>
+#include <fibril_synch.h>
+#include <ipc/ipc.h>
+
+extern int netif_get_addr_req_remote(int, device_id_t, measured_string_ref *,
+    char **);
+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_ref);
+extern int netif_bind_service_remote(services_t, device_id_t, services_t,
+    async_client_conn_t);
+
+#endif
+
+/** @}
+ */
Index: pace/lib/net/include/netif_standalone.h
===================================================================
--- uspace/lib/net/include/netif_standalone.h	(revision 24ab58b348754b301fea741628d74d49704735d6)
+++ 	(revision )
@@ -1,46 +1,0 @@
-/*
- * Copyright (c) 2010 Martin Decky
- * 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 netif_standalone
- *  @{
- */
-
-#ifndef __NETIF_STANDALONE_H__
-#define __NETIF_STANDALONE_H__
-
-#include <ipc/ipc.h>
-#include <async.h>
-
-extern int netif_module_message(const char *, ipc_callid_t, ipc_call_t *,
-    ipc_call_t *, int *);
-extern int netif_module_start(async_client_conn_t);
-
-#endif
-
-/** @}
- */
Index: uspace/lib/net/include/nil_interface.h
===================================================================
--- uspace/lib/net/include/nil_interface.h	(revision 24ab58b348754b301fea741628d74d49704735d6)
+++ uspace/lib/net/include/nil_interface.h	(revision 14f1db0aaed5208d5e8340c816ca6e555f81f67e)
@@ -31,12 +31,4 @@
  */
 
-/** @file
- *  Network interface layer module interface.
- *  The same interface is used for standalone remote device modules as well as for bundle device modules.
- *  The standalone remote device modules have to be compiled with the nil_remote.c source file.
- *  The bundle device modules with the appropriate network interface layer source file (eth.c etc.).
- *  The upper layers cannot be bundled with the network interface layer.
- */
-
 #ifndef __NET_NIL_INTERFACE_H__
 #define __NET_NIL_INTERFACE_H__
@@ -53,102 +45,44 @@
 #include <net_device.h>
 
-/** @name Network interface layer module interface
- *  This interface is used by other modules.
- */
-/*@{*/
+#define nil_bind_service(service, device_id, me, receiver) \
+	bind_service(service, device_id, me, 0, receiver)
 
-/** Returns the device local hardware address.
- *  @param[in] nil_phone The network interface layer phone.
- *  @param[in] device_id The device identifier.
- *  @param[out] address The device local hardware address.
- *  @param[out] data The address data.
- *  @returns EOK on success.
- *  @returns EBADMEM if the address parameter and/or the data parameter is NULL.
- *  @returns ENOENT if there no such device.
- *  @returns Other error codes as defined for the generic_get_addr_req() function.
- */
-#define nil_get_addr_req(nil_phone, device_id, address, data)	\
+#define nil_packet_size_req(nil_phone, device_id, packet_dimension) \
+	generic_packet_size_req_remote(nil_phone, NET_NIL_PACKET_SPACE, device_id, \
+	    packet_dimension)
+
+#define nil_get_addr_req(nil_phone, device_id, address, data) \
 	generic_get_addr_req(nil_phone, NET_NIL_ADDR, device_id, address, data)
 
-/** Returns the device broadcast hardware address.
- *  @param[in] nil_phone The network interface layer phone.
- *  @param[in] device_id The device identifier.
- *  @param[out] address The device broadcast hardware address.
- *  @param[out] data The address data.
- *  @returns EOK on success.
- *  @returns EBADMEM if the address parameter is NULL.
- *  @returns ENOENT if there no such device.
- *  @returns Other error codes as defined for the generic_get_addr_req() function.
- */
-#define nil_get_broadcast_addr_req(nil_phone, device_id, address, data)	\
-	generic_get_addr_req(nil_phone, NET_NIL_BROADCAST_ADDR, device_id, address, data)
+#define nil_get_broadcast_addr_req(nil_phone, device_id, address, data) \
+	generic_get_addr_req(nil_phone, NET_NIL_BROADCAST_ADDR, device_id, \
+	    address, data)
 
-/** Sends the packet queue.
- *  @param[in] nil_phone The network interface layer phone.
- *  @param[in] device_id The device identifier.
- *  @param[in] packet The packet queue.
- *  @param[in] sender The sending module service.
- *  @returns EOK on success.
- *  @returns Other error codes as defined for the generic_send_msg() function.
- */
-#define nil_send_msg(nil_phone, device_id, packet, sender)	\
-	generic_send_msg(nil_phone, NET_NIL_SEND, device_id, packet_get_id(packet), sender, 0)
+#define nil_send_msg(nil_phone, device_id, packet, sender) \
+	generic_send_msg_remote(nil_phone, NET_NIL_SEND, device_id, \
+	    packet_get_id(packet), sender, 0)
 
-/** Returns the device packet dimension for sending.
- *  @param[in] nil_phone The network interface layer phone.
- *  @param[in] device_id The device identifier.
- *  @param[out] packet_dimension The packet dimensions.
- *  @returns EOK on success.
- *  @returns ENOENT if there is no such device.
- *  @returns Other error codes as defined for the generic_packet_size_req() function.
- */
-#define nil_packet_size_req(nil_phone, device_id, packet_dimension)	\
-	generic_packet_size_req(nil_phone, NET_NIL_PACKET_SPACE, device_id, packet_dimension)
+#define nil_device_req(nil_phone, device_id, mtu, netif_service) \
+	generic_device_req_remote(nil_phone, NET_NIL_DEVICE, device_id, mtu, \
+	    netif_service)
 
-/** Registers new device or updates the MTU of an existing one.
- *  @param[in] nil_phone The network interface layer phone.
- *  @param[in] device_id The new device identifier.
- *  @param[in] mtu The device maximum transmission unit.
- *  @param[in] netif_service The device driver service.
- *  @returns EOK on success.
- *  @returns EEXIST if the device with the different service exists.
- *  @returns ENOMEM if there is not enough memory left.
- *  @returns Other error codes as defined for the generic_device_req() function.
- */
-#define nil_device_req(nil_phone, device_id, mtu, netif_service)	\
-	generic_device_req(nil_phone, NET_NIL_DEVICE, device_id, mtu, netif_service)
 
-/** Notifies the network interface layer about the device state change.
- *  @param[in] nil_phone The network interface layer phone.
- *  @param[in] device_id The device identifier.
- *  @param[in] state The new device state.
- *  @returns EOK on success.
- *  @returns Other error codes as defined for each specific module device state function.
- */
-extern int nil_device_state_msg(int nil_phone, device_id_t device_id, int state);
+#ifdef CONFIG_NETIF_NIL_BUNDLE
 
-/** Passes the packet queue to the network interface layer.
- *  Processes and redistributes the received packet queue to the registered upper layers.
- *  @param[in] nil_phone The network interface layer phone.
- *  @param[in] device_id The source device identifier.
- *  @param[in] packet The received packet or the received packet queue.
- *  @param target The target service. Ignored parameter.
- *  @returns EOK on success.
- *  @returns Other error codes as defined for each specific module received function.
- */
-extern int nil_received_msg(int nil_phone, device_id_t device_id, packet_t packet, services_t target);
+#include <nil_local.h>
+#include <packet/packet_server.h>
 
-/** Creates bidirectional connection with the network interface layer module and registers the message receiver.
- *  @param[in] service The network interface layer module service.
- *  @param[in] device_id The device identifier.
- *  @param[in] me The requesting module service.
- *  @param[in] receiver The message receiver.
- *  @returns The phone of the needed service.
- *  @returns EOK on success.
- *  @returns Other error codes as defined for the bind_service() function.
- */
-#define	nil_bind_service(service, device_id, me, receiver)	\
-	bind_service(service, device_id, me, 0, receiver);
-/*@}*/
+#define nil_device_state_msg  nil_device_state_msg_local
+#define nil_received_msg      nil_received_msg_local
+
+#else /* CONFIG_NETIF_NIL_BUNDLE */
+
+#include <nil_remote.h>
+#include <packet/packet_server.h>
+
+#define nil_device_state_msg  nil_device_state_msg_remote
+#define nil_received_msg      nil_received_msg_remote
+
+#endif /* CONFIG_NETIF_NIL_BUNDLE */
 
 #endif
Index: uspace/lib/net/include/nil_local.h
===================================================================
--- uspace/lib/net/include/nil_local.h	(revision 14f1db0aaed5208d5e8340c816ca6e555f81f67e)
+++ uspace/lib/net/include/nil_local.h	(revision 14f1db0aaed5208d5e8340c816ca6e555f81f67e)
@@ -0,0 +1,86 @@
+/*
+ * 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 net_nil
+ *  @{
+ */
+
+/** @file
+ * Network interface layer modules common skeleton.
+ * All network interface layer modules have to implement this interface.
+ */
+
+#ifndef __NET_NIL_LOCAL_H__
+#define __NET_NIL_LOCAL_H__
+
+#include <ipc/ipc.h>
+
+/** Module initialization.
+ *
+ * Is called by the module_start() function.
+ *
+ * @param[in] net_phone The networking moduel phone.
+ *
+ * @return EOK on success.
+ * @return Other error codes as defined for each specific module initialize function.
+ *
+ */
+extern int nil_initialize(int);
+
+extern int nil_device_state_msg_local(int, device_id_t, int);
+extern int nil_received_msg_local(int, device_id_t, packet_t, services_t);
+
+/** Message processing function.
+ *
+ * @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 nil_interface.h
+ * @see IS_NET_NIL_MESSAGE()
+ *
+ */
+extern int nil_message_standalone(const char *, ipc_callid_t, ipc_call_t *, ipc_call_t *,
+    int *);
+
+extern int nil_module_message_standalone(const char *, ipc_callid_t,
+    ipc_call_t *, ipc_call_t *, int *);
+extern int nil_module_start_standalone(async_client_conn_t);
+
+#endif
+
+/** @}
+ */
Index: uspace/lib/net/include/nil_messages.h
===================================================================
--- uspace/lib/net/include/nil_messages.h	(revision 24ab58b348754b301fea741628d74d49704735d6)
+++ uspace/lib/net/include/nil_messages.h	(revision 14f1db0aaed5208d5e8340c816ca6e555f81f67e)
@@ -28,10 +28,9 @@
 
 /** @addtogroup net_nil
- *  @{
+ * @{
  */
 
 /** @file
- *  Network interface layer module messages.
- *  @see nil_interface.h
+ * Network interface layer module messages.
  */
 
@@ -43,5 +42,5 @@
 #include <net_messages.h>
 
-/**  Network interface layer module messages.
+/** Network interface layer module messages.
  */
 typedef enum {
@@ -80,5 +79,5 @@
 /*@{*/
 
-/** Returns the protocol service message parameter.
+/** Return the protocol service message parameter.
  */
 #define NIL_GET_PROTO(call) \
Index: pace/lib/net/include/nil_module.h
===================================================================
--- uspace/lib/net/include/nil_module.h	(revision 24ab58b348754b301fea741628d74d49704735d6)
+++ 	(revision )
@@ -1,79 +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 net_nil
- *  @{
- */
-
-/** @file
- *  Network interface layer modules common skeleton.
- *  All network interface layer modules have to implement this interface.
- */
-
-#ifndef __NET_NIL_MODULE_H__
-#define __NET_NIL_MODULE_H__
-
-#include <ipc/ipc.h>
-
-/** Module initialization.
- *
- * Is called by the module_start() function.
- *
- * @param[in] net_phone The networking moduel phone.
- *
- * @return EOK on success.
- * @return Other error codes as defined for each specific module initialize function.
- *
- */
-extern int nil_initialize(int);
-
-/** Message processing function.
- *
- * @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 nil_interface.h
- * @see IS_NET_NIL_MESSAGE()
- *
- */
-extern int nil_message(const char *, ipc_callid_t, ipc_call_t *, ipc_call_t *,
-    int *);
-
-#endif
-
-/** @}
- */
Index: uspace/lib/net/include/nil_remote.h
===================================================================
--- uspace/lib/net/include/nil_remote.h	(revision 14f1db0aaed5208d5e8340c816ca6e555f81f67e)
+++ uspace/lib/net/include/nil_remote.h	(revision 14f1db0aaed5208d5e8340c816ca6e555f81f67e)
@@ -0,0 +1,46 @@
+/*
+ * 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 netif
+ * @{
+ */
+
+#ifndef __NET_NIL_REMOTE_H__
+#define __NET_NIL_REMOTE_H__
+
+#include <async.h>
+#include <fibril_synch.h>
+#include <ipc/ipc.h>
+
+extern int nil_device_state_msg_remote(int, device_id_t, int);
+extern int nil_received_msg_remote(int, device_id_t, packet_t, services_t);
+
+#endif
+
+/** @}
+ */
Index: pace/lib/net/include/nil_standalone.h
===================================================================
--- uspace/lib/net/include/nil_standalone.h	(revision 24ab58b348754b301fea741628d74d49704735d6)
+++ 	(revision )
@@ -1,46 +1,0 @@
-/*
- * Copyright (c) 2010 Martin Decky
- * 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 nil_standalone
- *  @{
- */
-
-#ifndef __NIL_STANDALONE_H__
-#define __NIL_STANDALONE_H__
-
-#include <ipc/ipc.h>
-#include <async.h>
-
-extern int nil_module_message(const char *, ipc_callid_t, ipc_call_t *,
-    ipc_call_t *, int *);
-extern int nil_module_start(async_client_conn_t);
-
-#endif
-
-/** @}
- */
Index: uspace/lib/net/include/packet_remote.h
===================================================================
--- uspace/lib/net/include/packet_remote.h	(revision 14f1db0aaed5208d5e8340c816ca6e555f81f67e)
+++ uspace/lib/net/include/packet_remote.h	(revision 14f1db0aaed5208d5e8340c816ca6e555f81f67e)
@@ -0,0 +1,46 @@
+/*
+ * 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 packet
+ * @{
+ */
+
+#ifndef __NET_PACKET_REMOTE_H__
+#define __NET_PACKET_REMOTE_H__
+
+#include <packet/packet.h>
+
+extern int packet_translate_remote(int, packet_ref, packet_id_t);
+extern packet_t packet_get_4_remote(int, size_t, size_t, size_t, size_t);
+extern packet_t packet_get_1_remote(int, size_t);
+extern void pq_release_remote(int, packet_id_t);
+
+#endif
+
+/** @}
+ */
Index: uspace/lib/net/include/tl_common.h
===================================================================
--- uspace/lib/net/include/tl_common.h	(revision 24ab58b348754b301fea741628d74d49704735d6)
+++ uspace/lib/net/include/tl_common.h	(revision 14f1db0aaed5208d5e8340c816ca6e555f81f67e)
@@ -49,4 +49,7 @@
 DEVICE_MAP_DECLARE(packet_dimensions, packet_dimension_t);
 
+extern int tl_get_ip_packet_dimension(int, packet_dimensions_ref,
+    device_id_t, packet_dimension_ref *);
+
 /** Gets the address port.
  *  Supports AF_INET and AF_INET6 address families.
@@ -59,19 +62,4 @@
  */
 extern int tl_get_address_port(const struct sockaddr * addr, int addrlen, uint16_t * port);
-
-/** Gets IP packet dimensions.
- *  Tries to search a cache and queries the IP module if not found.
- *  The reply is cached then.
- *  @param[in] ip_phone The IP moduel phone for (semi)remote calls.
- *  @param[in] packet_dimensions The packet dimensions cache.
- *  @param[in] device_id The device identifier.
- *  @param[out] packet_dimension The IP packet dimensions.
- *  @returns EOK on success.
- *  @returns EBADMEM if the packet_dimension parameter is NULL.
- *  @return ENOMEM if there is not enough memory left.
- *  @returns EINVAL if the packet_dimensions cache is not valid.
- *  @returns Other codes as defined for the ip_packet_size_req() function.
- */
-extern int tl_get_ip_packet_dimension(int ip_phone, packet_dimensions_ref packet_dimensions, device_id_t device_id, packet_dimension_ref * packet_dimension);
 
 /** Updates IP device packet dimensions cache.
Index: uspace/lib/net/include/tl_interface.h
===================================================================
--- uspace/lib/net/include/tl_interface.h	(revision 24ab58b348754b301fea741628d74d49704735d6)
+++ uspace/lib/net/include/tl_interface.h	(revision 14f1db0aaed5208d5e8340c816ca6e555f81f67e)
@@ -32,5 +32,5 @@
 
 /** @file
- *  Transport layer module interface for the underlying internetwork layer.
+ * Transport layer module interface for the underlying internetwork layer.
  */
 
@@ -48,18 +48,29 @@
 
 /** @name Transport layer module interface
- *  This interface is used by other modules.
+ * This interface is used by other modules.
  */
 /*@{*/
 
-/** Notifies the remote transport layer modules about the received packet/s.
- *  @param[in] tl_phone The transport layer module phone used for remote calls.
- *  @param[in] device_id The device identifier.
- *  @param[in] packet The received packet or the received packet queue. The packet queue is used to carry a~fragmented datagram. The first packet contains the headers, the others contain only data.
- *  @param[in] target The target transport layer module service to be delivered to.
- *  @param[in] error The packet error reporting service. Prefixes the received packet.
- *  @returns EOK on success.
+/** Notify the remote transport layer modules about the received packet/s.
+ *
+ * @param[in] tl_phone  The transport layer module phone used for remote calls.
+ * @param[in] device_id The device identifier.
+ * @param[in] packet    The received packet or the received packet queue.
+ *                      The packet queue is used to carry a fragmented
+ *                      datagram. The first packet contains the headers,
+ *                      the others contain only data.
+ * @param[in] target    The target transport layer module service to be
+ *                      delivered to.
+ * @param[in] error     The packet error reporting service. Prefixes the
+ *                      received packet.
+ *
+ * @return EOK on success.
+ *
  */
-inline static int tl_received_msg(int tl_phone, device_id_t device_id, packet_t packet, services_t target, services_t error){
-	return generic_received_msg(tl_phone, NET_TL_RECEIVED, device_id, packet_get_id(packet), target, error);
+inline static int tl_received_msg(int tl_phone, device_id_t device_id,
+    packet_t packet, services_t target, services_t error)
+{
+	return generic_received_msg_remote(tl_phone, NET_TL_RECEIVED, device_id,
+	    packet_get_id(packet), target, error);
 }
 
Index: uspace/lib/net/include/tl_local.h
===================================================================
--- uspace/lib/net/include/tl_local.h	(revision 14f1db0aaed5208d5e8340c816ca6e555f81f67e)
+++ uspace/lib/net/include/tl_local.h	(revision 14f1db0aaed5208d5e8340c816ca6e555f81f67e)
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2010 Martin Decky
+ * 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 tl_local
+ *  @{
+ */
+
+#ifndef __TL_LOCAL_H__
+#define __TL_LOCAL_H__
+
+#include <ipc/ipc.h>
+#include <async.h>
+
+extern int tl_module_message_standalone(ipc_callid_t, ipc_call_t *,
+    ipc_call_t *, int *);
+extern int tl_module_start_standalone(async_client_conn_t);
+
+#endif
+
+/** @}
+ */
Index: pace/lib/net/include/tl_standalone.h
===================================================================
--- uspace/lib/net/include/tl_standalone.h	(revision 24ab58b348754b301fea741628d74d49704735d6)
+++ 	(revision )
@@ -1,46 +1,0 @@
-/*
- * Copyright (c) 2010 Martin Decky
- * 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 tl_standalone
- *  @{
- */
-
-#ifndef __TL_STANDALONE_H__
-#define __TL_STANDALONE_H__
-
-#include <ipc/ipc.h>
-#include <async.h>
-
-extern int tl_module_message(ipc_callid_t callid, ipc_call_t *call,
-    ipc_call_t *answer, int *answer_count);
-extern int tl_module_start(async_client_conn_t client_connection);
-
-#endif
-
-/** @}
- */
Index: pace/lib/net/netif/netif.c
===================================================================
--- uspace/lib/net/netif/netif.c	(revision 24ab58b348754b301fea741628d74d49704735d6)
+++ 	(revision )
@@ -1,293 +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 netif
- *  @{
- */
-
-/** @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 <net_err.h>
-#include <net_messages.h>
-#include <net_modules.h>
-#include <packet/packet.h>
-#include <packet/packet_client.h>
-#include <adt/measured_strings.h>
-#include <net_device.h>
-#include <netif_interface.h>
-#include <nil_interface.h>
-#include <netif.h>
-#include <netif_messages.h>
-#include <netif_module.h>
-
-DEVICE_MAP_IMPLEMENT(device_map, device_t)
-
-/** Network interface global data.
- */
-netif_globals_t netif_globals;
-
-int netif_probe_req(int netif_phone, device_id_t device_id, int irq, int io){
-	int result;
-
-	fibril_rwlock_write_lock(&netif_globals.lock);
-	result = netif_probe_message(device_id, irq, io);
-	fibril_rwlock_write_unlock(&netif_globals.lock);
-	return result;
-}
-
-int netif_send_msg(int netif_phone, device_id_t device_id, packet_t packet, services_t sender){
-	int result;
-
-	fibril_rwlock_write_lock(&netif_globals.lock);
-	result = netif_send_message(device_id, packet, sender);
-	fibril_rwlock_write_unlock(&netif_globals.lock);
-	return result;
-}
-
-int netif_start_req(int netif_phone, device_id_t device_id){
-	ERROR_DECLARE;
-
-	device_ref device;
-	int result;
-	int phone;
-
-	fibril_rwlock_write_lock(&netif_globals.lock);
-	if(ERROR_OCCURRED(find_device(device_id, &device))){
-		fibril_rwlock_write_unlock(&netif_globals.lock);
-		return ERROR_CODE;
-	}
-	result = netif_start_message(device);
-	if(result > NETIF_NULL){
-		phone = device->nil_phone;
-		fibril_rwlock_write_unlock(&netif_globals.lock);
-		nil_device_state_msg(phone, device_id, result);
-		return EOK;
-	}else{
-		fibril_rwlock_write_unlock(&netif_globals.lock);
-	}
-	return result;
-}
-
-int netif_stop_req(int netif_phone, device_id_t device_id){
-	ERROR_DECLARE;
-
-	device_ref device;
-	int result;
-	int phone;
-
-	fibril_rwlock_write_lock(&netif_globals.lock);
-	if(ERROR_OCCURRED(find_device(device_id, &device))){
-		fibril_rwlock_write_unlock(&netif_globals.lock);
-		return ERROR_CODE;
-	}
-	result = netif_stop_message(device);
-	if(result > NETIF_NULL){
-		phone = device->nil_phone;
-		fibril_rwlock_write_unlock(&netif_globals.lock);
-		nil_device_state_msg(phone, device_id, result);
-		return EOK;
-	}else{
-		fibril_rwlock_write_unlock(&netif_globals.lock);
-	}
-	return result;
-}
-
-int netif_stats_req(int netif_phone, device_id_t device_id, device_stats_ref stats){
-	int res;
-
-	fibril_rwlock_read_lock(&netif_globals.lock);
-	res = netif_get_device_stats(device_id, stats);
-	fibril_rwlock_read_unlock(&netif_globals.lock);
-	return res;
-}
-
-int netif_get_addr_req(int netif_phone, device_id_t device_id, measured_string_ref * address, char ** data){
-	ERROR_DECLARE;
-
-	measured_string_t translation;
-
-	if(!(address && data)){
-		return EBADMEM;
-	}
-	fibril_rwlock_read_lock(&netif_globals.lock);
-	if(! ERROR_OCCURRED(netif_get_addr_message(device_id, &translation))){
-		*address = measured_string_copy(&translation);
-		ERROR_CODE = (*address) ? EOK : ENOMEM;
-	}
-	fibril_rwlock_read_unlock(&netif_globals.lock);
-	*data = (** address).value;
-	return ERROR_CODE;
-}
-
-int netif_bind_service(services_t service, device_id_t device_id, services_t me, async_client_conn_t receiver){
-	return EOK;
-}
-
-int find_device(device_id_t device_id, device_ref * device){
-	if(! device){
-		return EBADMEM;
-	}
-	*device = device_map_find(&netif_globals.device_map, device_id);
-	if(! * device){
-		return ENOENT;
-	}
-	if((** device).state == NETIF_NULL) return EPERM;
-	return EOK;
-}
-
-void null_device_stats(device_stats_ref stats){
-	bzero(stats, sizeof(device_stats_t));
-}
-
-/** 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)
-{
-	ERROR_DECLARE;
-	
-	device_ref device;
-	ERROR_PROPAGATE(find_device(device_id, &device));
-	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;
-}
-
-int netif_message(const char *name, ipc_callid_t callid, ipc_call_t *call,
-    ipc_call_t *answer, int *answer_count)
-{
-	ERROR_DECLARE;
-	
-	size_t length;
-	device_stats_t stats;
-	packet_t packet;
-	measured_string_t address;
-	
-	*answer_count = 0;
-	switch(IPC_GET_METHOD(*call)){
-		case IPC_M_PHONE_HUNGUP:
-			return EOK;
-		case NET_NETIF_PROBE:
-			return netif_probe_req(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);
-			ERROR_CODE = register_message(name, IPC_GET_DEVICE(call),
-			    IPC_GET_PHONE(call));
-			fibril_rwlock_write_unlock(&netif_globals.lock);
-			return ERROR_CODE;
-		case NET_NETIF_SEND:
-			ERROR_PROPAGATE(packet_translate(netif_globals.net_phone,
-			    &packet, IPC_GET_PACKET(call)));
-			return netif_send_msg(0, IPC_GET_DEVICE(call), packet,
-			    IPC_GET_SENDER(call));
-		case NET_NETIF_START:
-			return netif_start_req(0, IPC_GET_DEVICE(call));
-		case NET_NETIF_STATS:
-			fibril_rwlock_read_lock(&netif_globals.lock);
-			if (!ERROR_OCCURRED(async_data_read_receive(&callid, &length))) {
-				if (length < sizeof(device_stats_t))
-					ERROR_CODE = EOVERFLOW;
-				else {
-					if (!ERROR_OCCURRED(netif_get_device_stats(
-					    IPC_GET_DEVICE(call), &stats)))
-						ERROR_CODE = async_data_read_finalize(callid, &stats,
-						    sizeof(device_stats_t));
-				}
-			}
-			fibril_rwlock_read_unlock(&netif_globals.lock);
-			return ERROR_CODE;
-		case NET_NETIF_STOP:
-			return netif_stop_req(0, IPC_GET_DEVICE(call));
-		case NET_NETIF_GET_ADDR:
-			fibril_rwlock_read_lock(&netif_globals.lock);
-			if (!ERROR_OCCURRED(netif_get_addr_message(IPC_GET_DEVICE(call),
-			    &address)))
-				ERROR_CODE = measured_strings_reply(&address, 1);
-			fibril_rwlock_read_unlock(&netif_globals.lock);
-			return ERROR_CODE;
-	}
-	
-	return netif_specific_message(callid, call, answer, answer_count);
-}
-
-int netif_init_module(async_client_conn_t client_connection){
-	ERROR_DECLARE;
-
-	async_set_client_connection(client_connection);
-	netif_globals.net_phone = connect_to_service(SERVICE_NETWORKING);
-	device_map_initialize(&netif_globals.device_map);
-	ERROR_PROPAGATE(pm_init());
-	fibril_rwlock_initialize(&netif_globals.lock);
-	if(ERROR_OCCURRED(netif_initialize())){
-		pm_destroy();
-		return ERROR_CODE;
-	}
-	return EOK;
-}
-
-int netif_run_module(void){
-	async_manager();
-
-	pm_destroy();
-	return EOK;
-}
-
-void netif_pq_release(packet_id_t packet_id){
-	pq_release(netif_globals.net_phone, packet_id);
-}
-
-packet_t netif_packet_get_1(size_t content){
-	return packet_get_1(netif_globals.net_phone, content);
-}
-
-/** @}
- */
Index: uspace/lib/net/netif/netif_local.c
===================================================================
--- uspace/lib/net/netif/netif_local.c	(revision 14f1db0aaed5208d5e8340c816ca6e555f81f67e)
+++ uspace/lib/net/netif/netif_local.c	(revision 14f1db0aaed5208d5e8340c816ca6e555f81f67e)
@@ -0,0 +1,468 @@
+/*
+ * 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 netif
+ * @{
+ */
+
+/** @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 <net_err.h>
+#include <net_messages.h>
+#include <net_modules.h>
+#include <packet/packet.h>
+#include <packet/packet_client.h>
+#include <packet/packet_server.h>
+#include <packet_remote.h>
+#include <adt/measured_strings.h>
+#include <net_device.h>
+#include <nil_interface.h>
+#include <netif_local.h>
+#include <netif_messages.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 errro 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)
+{
+	ERROR_DECLARE;
+	
+	fibril_rwlock_write_lock(&netif_globals.lock);
+	
+	netif_device_t *device;
+	if (ERROR_OCCURRED(find_device(device_id, &device))) {
+		fibril_rwlock_write_unlock(&netif_globals.lock);
+		return ERROR_CODE;
+	}
+	
+	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)
+{
+	ERROR_DECLARE;
+	
+	fibril_rwlock_write_lock(&netif_globals.lock);
+	
+	netif_device_t *device;
+	if (ERROR_OCCURRED(find_device(device_id, &device))) {
+		fibril_rwlock_write_unlock(&netif_globals.lock);
+		return ERROR_CODE;
+	}
+	
+	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_ref 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_ref *address, char **data)
+{
+	ERROR_DECLARE;
+	
+	if ((!address) || (!data))
+		return EBADMEM;
+	
+	fibril_rwlock_read_lock(&netif_globals.lock);
+	
+	measured_string_t translation;
+	if (!ERROR_OCCURRED(netif_get_addr_message(device_id, &translation))) {
+		*address = measured_string_copy(&translation);
+		ERROR_CODE = (*address) ? EOK : ENOMEM;
+	}
+	
+	fibril_rwlock_read_unlock(&netif_globals.lock);
+	
+	*data = (**address).value;
+	
+	return ERROR_CODE;
+}
+
+/** Create bidirectional connection with the network interface module and registers the message receiver.
+ *
+ * @param[in] service   The network interface module service.
+ * @param[in] device_id The device identifier.
+ * @param[in] me        The requesting module service.
+ * @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.
+ *
+ */
+int netif_bind_service_local(services_t service, device_id_t device_id,
+    services_t me, async_client_conn_t receiver)
+{
+	return EOK;
+}
+
+/** 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_ref 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)
+{
+	ERROR_DECLARE;
+	
+	async_set_client_connection(client_connection);
+	
+	netif_globals.net_phone = connect_to_service(SERVICE_NETWORKING);
+	netif_device_map_initialize(&netif_globals.device_map);
+	
+	ERROR_PROPAGATE(pm_init());
+	
+	fibril_rwlock_initialize(&netif_globals.lock);
+	if (ERROR_OCCURRED(netif_initialize())) {
+		pm_destroy();
+		return ERROR_CODE;
+	}
+	
+	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)
+{
+	ERROR_DECLARE;
+	
+	netif_device_t *device;
+	ERROR_PROPAGATE(find_device(device_id, &device));
+	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)
+{
+	ERROR_DECLARE;
+	
+	size_t length;
+	device_stats_t stats;
+	packet_t packet;
+	measured_string_t address;
+	
+	*answer_count = 0;
+	switch (IPC_GET_METHOD(*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);
+			ERROR_CODE = register_message(name, IPC_GET_DEVICE(call),
+			    IPC_GET_PHONE(call));
+			fibril_rwlock_write_unlock(&netif_globals.lock);
+			return ERROR_CODE;
+		case NET_NETIF_SEND:
+			ERROR_PROPAGATE(packet_translate_remote(netif_globals.net_phone,
+			    &packet, IPC_GET_PACKET(call)));
+			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);
+			if (!ERROR_OCCURRED(async_data_read_receive(&callid, &length))) {
+				if (length < sizeof(device_stats_t))
+					ERROR_CODE = EOVERFLOW;
+				else {
+					if (!ERROR_OCCURRED(netif_get_device_stats(
+					    IPC_GET_DEVICE(call), &stats)))
+						ERROR_CODE = async_data_read_finalize(callid, &stats,
+						    sizeof(device_stats_t));
+				}
+			}
+			fibril_rwlock_read_unlock(&netif_globals.lock);
+			return ERROR_CODE;
+		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);
+			if (!ERROR_OCCURRED(netif_get_addr_message(IPC_GET_DEVICE(call),
+			    &address)))
+				ERROR_CODE = measured_strings_reply(&address, 1);
+			fibril_rwlock_read_unlock(&netif_globals.lock);
+			return ERROR_CODE;
+	}
+	
+	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)
+{
+	ERROR_DECLARE;
+	
+	ERROR_PROPAGATE(netif_init_module(client_connection));
+	
+	async_manager();
+	
+	pm_destroy();
+	return EOK;
+}
+
+/** @}
+ */
Index: uspace/lib/net/netif/netif_nil_bundle.c
===================================================================
--- uspace/lib/net/netif/netif_nil_bundle.c	(revision 24ab58b348754b301fea741628d74d49704735d6)
+++ uspace/lib/net/netif/netif_nil_bundle.c	(revision 14f1db0aaed5208d5e8340c816ca6e555f81f67e)
@@ -41,7 +41,7 @@
 #include <net_messages.h>
 #include <packet/packet.h>
-#include <nil_module.h>
 #include <netif_nil_bundle.h>
-#include <netif.h>
+#include <netif_local.h>
+#include <nil_local.h>
 
 /** Distribute the messages between the module parts.
@@ -62,26 +62,42 @@
     ipc_call_t *call, ipc_call_t *answer, int *answer_count)
 {
-	if (IS_NET_NIL_MESSAGE(call)
+	if ((IS_NET_NIL_MESSAGE(call))
 	    || (IPC_GET_METHOD(*call) == IPC_M_CONNECT_TO_ME))
-		return nil_message(name, callid, call, answer, answer_count);
+		return nil_message_standalone(name, callid, call, answer,
+		    answer_count);
 	else
-		return netif_message(name, callid, call, answer, answer_count);
+		return netif_module_message_standalone(name, callid, call, answer,
+		    answer_count);
 }
 
-/** Starts the bundle network interface module.
- *  Initializes the client connection serving function, initializes both module parts, registers the module service and starts 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.
- *  @returns EOK on success.
- *  @returns Other error codes as defined for each specific module message function.
+/** Start the bundle network interface module.
+ *
+ * Initialize the client connection serving function, initialize
+ * both module parts, register 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_nil_module_start(async_client_conn_t client_connection){
+int netif_nil_module_start(async_client_conn_t client_connection)
+{
 	ERROR_DECLARE;
-
+	
 	ERROR_PROPAGATE(netif_init_module(client_connection));
-	if(ERROR_OCCURRED(nil_initialize(netif_globals.net_phone))){
+	if (ERROR_OCCURRED(nil_initialize(netif_globals.net_phone))) {
 		pm_destroy();
 		return ERROR_CODE;
 	}
-	return netif_run_module();
+	
+	async_manager();
+	
+	pm_destroy();
+	return EOK;
 }
 
Index: uspace/lib/net/netif/netif_remote.c
===================================================================
--- uspace/lib/net/netif/netif_remote.c	(revision 14f1db0aaed5208d5e8340c816ca6e555f81f67e)
+++ uspace/lib/net/netif/netif_remote.c	(revision 14f1db0aaed5208d5e8340c816ca6e555f81f67e)
@@ -0,0 +1,99 @@
+/*
+ * 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 netif
+ * @{
+ */
+
+/** @file
+ * Network interface module interface implementation for remote modules.
+ */
+
+#include <ipc/services.h>
+
+#include <net_modules.h>
+#include <adt/measured_strings.h>
+#include <packet/packet.h>
+#include <packet/packet_client.h>
+#include <net_device.h>
+#include <netif_remote.h>
+#include <netif_messages.h>
+
+int netif_get_addr_req_remote(int netif_phone, device_id_t device_id,
+    measured_string_ref *address, char **data)
+{
+	return generic_get_addr_req(netif_phone, NET_NETIF_GET_ADDR, device_id,
+	    address, data);
+}
+
+int netif_probe_req_remote(int netif_phone, device_id_t device_id, int irq, int io)
+{
+	return async_req_3_0(netif_phone, NET_NETIF_PROBE, device_id, irq, io);
+}
+
+int netif_send_msg_remote(int netif_phone, device_id_t device_id, packet_t packet,
+    services_t sender)
+{
+	return generic_send_msg_remote(netif_phone, NET_NETIF_SEND, device_id,
+	    packet_get_id(packet), sender, 0);
+}
+
+int netif_start_req_remote(int netif_phone, device_id_t device_id)
+{
+	return async_req_1_0(netif_phone, NET_NETIF_START, device_id);
+}
+
+int netif_stop_req_remote(int netif_phone, device_id_t device_id)
+{
+	return async_req_1_0(netif_phone, NET_NETIF_STOP, device_id);
+}
+
+int netif_stats_req_remote(int netif_phone, device_id_t device_id,
+    device_stats_ref stats)
+{
+	if (!stats)
+		return EBADMEM;
+	
+	aid_t message_id = async_send_1(netif_phone, NET_NETIF_STATS,
+	    (ipcarg_t) device_id, NULL);
+	async_data_read_start(netif_phone, stats, sizeof(*stats));
+	
+	ipcarg_t result;
+	async_wait_for(message_id, &result);
+	
+	return (int) result;
+}
+
+int netif_bind_service_remote(services_t service, device_id_t device_id, services_t me,
+    async_client_conn_t receiver)
+{
+	return bind_service(service, device_id, me, 0, receiver);
+}
+
+/** @}
+ */
Index: pace/lib/net/netif/netif_standalone.c
===================================================================
--- uspace/lib/net/netif/netif_standalone.c	(revision 24ab58b348754b301fea741628d74d49704735d6)
+++ 	(revision )
@@ -1,77 +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 netif
- *  @{
- */
-
-/** @file
- *  Wrapper for the standalone network interface module.
- */
-
-#include <async.h>
-#include <ipc/ipc.h>
-
-#include <netif.h>
-#include <netif_standalone.h>
-
-/** Delegate the messages to the netif_message() function.
- *
- * @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.
- *
- */
-int netif_module_message(const char *name, ipc_callid_t callid,
-    ipc_call_t *call, ipc_call_t *answer, int *answer_count)
-{
-	return netif_message(name, callid, call, answer, answer_count);
-}
-
-/** Starts the network interface module.
- *  Initializes the client connection serving function, initializes the module, registers the module service and starts 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.
- *  @returns EOK on success.
- *  @returns Other error codes as defined for each specific module message function.
- */
-int netif_module_start(async_client_conn_t client_connection){
-	ERROR_DECLARE;
-
-	ERROR_PROPAGATE(netif_init_module(client_connection));
-	return netif_run_module();
-}
-
-/** @}
- */
Index: uspace/lib/net/nil/nil_remote.c
===================================================================
--- uspace/lib/net/nil/nil_remote.c	(revision 24ab58b348754b301fea741628d74d49704735d6)
+++ uspace/lib/net/nil/nil_remote.c	(revision 14f1db0aaed5208d5e8340c816ca6e555f81f67e)
@@ -28,10 +28,10 @@
 
 /** @addtogroup net_nil
- *  @{
+ * @{
  */
 
 /** @file
- *  Network interface layer interface implementation for standalone remote modules.
- *  @see nil_interface.h
+ * Network interface layer interface implementation for remote modules.
+ * @see nil_interface.h
  */
 
@@ -42,11 +42,43 @@
 #include <packet/packet_client.h>
 #include <nil_messages.h>
+#include <nil_remote.h>
 
-int nil_device_state_msg(int nil_phone, device_id_t device_id, int state){
-	return generic_device_state_msg(nil_phone, NET_NIL_DEVICE_STATE, device_id, state, 0);
+/** Notify the network interface layer about the device state change.
+ *
+ * @param[in] nil_phone The network interface layer phone.
+ * @param[in] device_id The device identifier.
+ * @param[in] state     The new device state.
+ *
+ * @return EOK on success.
+ * @return Other error codes as defined for each specific module device
+ *         state function.
+ *
+ */
+int nil_device_state_msg_remote(int nil_phone, device_id_t device_id, int state)
+{
+	return generic_device_state_msg_remote(nil_phone, NET_NIL_DEVICE_STATE,
+	    device_id, state, 0);
 }
 
-int nil_received_msg(int nil_phone, device_id_t device_id, packet_t packet, services_t target){
-	return generic_received_msg(nil_phone, NET_NIL_RECEIVED, device_id, packet_get_id(packet), target, 0);
+/** Pass the packet queue to the network interface layer.
+ *
+ * Process and redistribute the received packet queue to the registered
+ * upper layers.
+ *
+ * @param[in] nil_phone The network interface layer phone.
+ * @param[in] device_id The source device identifier.
+ * @param[in] packet    The received packet or the received packet queue.
+ * @param     target    The target service. Ignored parameter.
+ *
+ * @return EOK on success.
+ * @return Other error codes as defined for each specific module
+ *         received function.
+ *
+ */
+int nil_received_msg_remote(int nil_phone, device_id_t device_id,
+    packet_t packet, services_t target)
+{
+	return generic_received_msg_remote(nil_phone, NET_NIL_RECEIVED, device_id,
+	    packet_get_id(packet), target, 0);
 }
 
Index: uspace/lib/net/tl/icmp_remote.c
===================================================================
--- uspace/lib/net/tl/icmp_remote.c	(revision 24ab58b348754b301fea741628d74d49704735d6)
+++ uspace/lib/net/tl/icmp_remote.c	(revision 14f1db0aaed5208d5e8340c816ca6e555f81f67e)
@@ -32,5 +32,5 @@
 
 /** @file
- *  ICMP interface implementation for standalone remote modules.
+ *  ICMP interface implementation for remote modules.
  *  @see icmp_interface.h
  */
Index: uspace/lib/net/tl/tl_common.c
===================================================================
--- uspace/lib/net/tl/tl_common.c	(revision 24ab58b348754b301fea741628d74d49704735d6)
+++ uspace/lib/net/tl/tl_common.c	(revision 14f1db0aaed5208d5e8340c816ca6e555f81f67e)
@@ -42,4 +42,5 @@
 #include <packet/packet.h>
 #include <packet/packet_client.h>
+#include <packet_remote.h>
 #include <net_device.h>
 #include <icmp_interface.h>
@@ -47,7 +48,10 @@
 #include <in6.h>
 #include <inet.h>
-#include <ip_interface.h>
+#include <ip_local.h>
+#include <ip_remote.h>
 #include <socket_codes.h>
 #include <socket_errno.h>
+#include <ip_interface.h>
+#include <tl_interface.h>
 #include <tl_common.h>
 
@@ -82,28 +86,51 @@
 }
 
-int tl_get_ip_packet_dimension(int ip_phone, packet_dimensions_ref packet_dimensions, device_id_t device_id, packet_dimension_ref * packet_dimension){
+/** Get IP packet dimensions.
+ *
+ * Try to search a cache and query the IP module if not found.
+ * The reply is cached then.
+ *
+ * @param[in]  ip_phone          The IP moduel phone for (semi)remote calls.
+ * @param[in]  packet_dimensions The packet dimensions cache.
+ * @param[in]  device_id         The device identifier.
+ * @param[out] packet_dimension  The IP packet dimensions.
+ *
+ * @return EOK on success.
+ * @return EBADMEM if the packet_dimension parameter is NULL.
+ * @return ENOMEM if there is not enough memory left.
+ * @return EINVAL if the packet_dimensions cache is not valid.
+ * @return Other codes as defined for the ip_packet_size_req() function.
+ *
+ */
+int tl_get_ip_packet_dimension(int ip_phone,
+    packet_dimensions_ref packet_dimensions, device_id_t device_id,
+    packet_dimension_ref *packet_dimension)
+{
 	ERROR_DECLARE;
-
-	if(! packet_dimension){
+	
+	if (!packet_dimension)
 		return EBADMEM;
-	}
-
+	
 	*packet_dimension = packet_dimensions_find(packet_dimensions, device_id);
-	if(! * packet_dimension){
-		// ask for and remember them if not found
-		*packet_dimension = malloc(sizeof(** packet_dimension));
-		if(! * packet_dimension){
+	if (!*packet_dimension) {
+		/* Ask for and remember them if not found */
+		*packet_dimension = malloc(sizeof(**packet_dimension));
+		if(!*packet_dimension)
 			return ENOMEM;
-		}
-		if(ERROR_OCCURRED(ip_packet_size_req(ip_phone, device_id, * packet_dimension))){
+		
+		if (ERROR_OCCURRED(ip_packet_size_req(ip_phone, device_id,
+		    *packet_dimension))) {
 			free(*packet_dimension);
 			return ERROR_CODE;
 		}
-		ERROR_CODE = packet_dimensions_add(packet_dimensions, device_id, * packet_dimension);
-		if(ERROR_CODE < 0){
+		
+		ERROR_CODE = packet_dimensions_add(packet_dimensions, device_id,
+		    *packet_dimension);
+		if (ERROR_CODE < 0) {
 			free(*packet_dimension);
 			return ERROR_CODE;
 		}
 	}
+	
 	return EOK;
 }
@@ -169,7 +196,7 @@
 	// detach the first packet and release the others
 	next = pq_detach(packet);
-	if(next){
-		pq_release(packet_phone, packet_get_id(next));
-	}
+	if (next)
+		pq_release_remote(packet_phone, packet_get_id(next));
+	
 	length = packet_get_addr(packet, &src, NULL);
 	if((length > 0)
@@ -180,5 +207,5 @@
 		return EOK;
 	}else{
-		pq_release(packet_phone, packet_get_id(packet));
+		pq_release_remote(packet_phone, packet_get_id(packet));
 	}
 	return ENOENT;
@@ -200,5 +227,5 @@
 	}
 	// get a new packet
-	*packet = packet_get_4(packet_phone, length, dimension->addr_len, prefix + dimension->prefix, dimension->suffix);
+	*packet = packet_get_4_remote(packet_phone, length, dimension->addr_len, prefix + dimension->prefix, dimension->suffix);
 	if(! packet){
 		return ENOMEM;
@@ -207,5 +234,5 @@
 	data = packet_suffix(*packet, length);
 	if(! data){
-		pq_release(packet_phone, packet_get_id(*packet));
+		pq_release_remote(packet_phone, packet_get_id(*packet));
 		return ENOMEM;
 	}
@@ -214,5 +241,5 @@
 	// set the packet destination address
 		|| ERROR_OCCURRED(packet_set_addr(*packet, NULL, (uint8_t *) addr, addrlen))){
-		pq_release(packet_phone, packet_get_id(*packet));
+		pq_release_remote(packet_phone, packet_get_id(*packet));
 		return ERROR_CODE;
 	}
Index: pace/lib/netif/Makefile
===================================================================
--- uspace/lib/netif/Makefile	(revision 24ab58b348754b301fea741628d74d49704735d6)
+++ 	(revision )
@@ -1,37 +1,0 @@
-#
-# Copyright (c) 2005 Martin Decky
-# Copyright (c) 2007 Jakub Jermar
-# 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.
-#
-
-USPACE_PREFIX = ../..
-EXTRA_CFLAGS = -Iinclude -I$(LIBNET_PREFIX)/include -I$(LIBSOCKET_PREFIX)/include
-LIBRARY = libnetif
-
-SOURCES = \
-	generic/netif_remote.c
-
-include $(USPACE_PREFIX)/Makefile.common
Index: pace/lib/netif/generic/netif_remote.c
===================================================================
--- uspace/lib/netif/generic/netif_remote.c	(revision 24ab58b348754b301fea741628d74d49704735d6)
+++ 	(revision )
@@ -1,86 +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 netif
- *  @{
- */
-
-/** @file
- *  Network interface module interface implementation for standalone remote modules.
- *  @see netif_interface.h
- */
-
-#include <ipc/services.h>
-
-#include <net_modules.h>
-#include <adt/measured_strings.h>
-#include <packet/packet.h>
-#include <packet/packet_client.h>
-#include <net_device.h>
-#include <netif_interface.h>
-#include <netif_messages.h>
-
-int netif_get_addr_req(int netif_phone, device_id_t device_id, measured_string_ref * address, char ** data){
-	return generic_get_addr_req(netif_phone, NET_NETIF_GET_ADDR, device_id, address, data);
-}
-
-int netif_probe_req(int netif_phone, device_id_t device_id, int irq, int io){
-	return async_req_3_0(netif_phone, NET_NETIF_PROBE, device_id, irq, io);
-}
-
-int netif_send_msg(int netif_phone, device_id_t device_id, packet_t packet, services_t sender){
-	return generic_send_msg(netif_phone, NET_NETIF_SEND, device_id, packet_get_id(packet), sender, 0);
-}
-
-int netif_start_req(int netif_phone, device_id_t device_id){
-	return async_req_1_0(netif_phone, NET_NETIF_START, 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);
-}
-
-int netif_stats_req(int netif_phone, device_id_t device_id, device_stats_ref stats){
-	aid_t message_id;
-	ipcarg_t result;
-
-	if(! stats){
-		return EBADMEM;
-	}
-	message_id = async_send_1(netif_phone, NET_NETIF_STATS, (ipcarg_t) device_id, NULL);
-	async_data_read_start(netif_phone, stats, sizeof(*stats));
-	async_wait_for(message_id, &result);
-	return (int) result;
-}
-
-int netif_bind_service(services_t service, device_id_t device_id, services_t me, async_client_conn_t receiver){
-	return bind_service(service, device_id, me, 0, receiver);
-}
-
-/** @}
- */
Index: uspace/lib/socket/generic/net_modules.c
===================================================================
--- uspace/lib/socket/generic/net_modules.c	(revision 24ab58b348754b301fea741628d74d49704735d6)
+++ uspace/lib/socket/generic/net_modules.c	(revision 14f1db0aaed5208d5e8340c816ca6e555f81f67e)
@@ -77,20 +77,49 @@
 }
 
-int bind_service(services_t need, ipcarg_t arg1, ipcarg_t arg2, ipcarg_t arg3, async_client_conn_t client_receiver){
+/** Create bidirectional connection with the needed module service and registers the message receiver.
+ *
+ * @param[in] need            The needed module service.
+ * @param[in] arg1            The first parameter.
+ * @param[in] arg2            The second parameter.
+ * @param[in] arg3            The third parameter.
+ * @param[in] client_receiver The message receiver.
+ *
+ * @return The phone of the needed service.
+ * @return Other error codes as defined for the ipc_connect_to_me() function.
+ *
+ */
+int bind_service(services_t need, ipcarg_t arg1, ipcarg_t arg2, ipcarg_t arg3,
+    async_client_conn_t client_receiver)
+{
 	return bind_service_timeout(need, arg1, arg2, arg3, client_receiver, 0);
 }
 
-int bind_service_timeout(services_t need, ipcarg_t arg1, ipcarg_t arg2, ipcarg_t arg3, async_client_conn_t client_receiver, suseconds_t timeout){
+/** Create bidirectional connection with the needed module service and registers the message receiver.
+ *
+ * @param[in] need            The needed module service.
+ * @param[in] arg1            The first parameter.
+ * @param[in] arg2            The second parameter.
+ * @param[in] arg3            The third parameter.
+ * @param[in] client_receiver The message receiver.
+ * @param[in] timeout         The connection timeout in microseconds.
+ *                            No timeout if set to zero (0).
+ *
+ * @return The phone of the needed service.
+ * @return ETIMEOUT if the connection timeouted.
+ * @return Other error codes as defined for the ipc_connect_to_me() function.
+ *
+ */
+int bind_service_timeout(services_t need, ipcarg_t arg1, ipcarg_t arg2,
+    ipcarg_t arg3, async_client_conn_t client_receiver, suseconds_t timeout)
+{
 	ERROR_DECLARE;
-
-	int phone;
-	ipcarg_t phonehash;
-
-	// connect to the needed service
-	phone = connect_to_service_timeout(need, timeout);
-	// if connected
-	if(phone >= 0){
-		// request the bidirectional connection
-		if(ERROR_OCCURRED(ipc_connect_to_me(phone, arg1, arg2, arg3, &phonehash))){
+	
+	/* Connect to the needed service */
+	int phone = connect_to_service_timeout(need, timeout);
+	if (phone >= 0) {
+		/* Request the bidirectional connection */
+		ipcarg_t phonehash;
+		if (ERROR_OCCURRED(ipc_connect_to_me(phone, arg1, arg2, arg3,
+		    &phonehash))) {
 			ipc_hangup(phone);
 			return ERROR_CODE;
@@ -98,4 +127,5 @@
 		async_new_connection(phonehash, 0, NULL, client_receiver);
 	}
+	
 	return phone;
 }
Index: uspace/lib/socket/generic/socket_core.c
===================================================================
--- uspace/lib/socket/generic/socket_core.c	(revision 24ab58b348754b301fea741628d74d49704735d6)
+++ uspace/lib/socket/generic/socket_core.c	(revision 14f1db0aaed5208d5e8340c816ca6e555f81f67e)
@@ -90,5 +90,5 @@
 	// release all received packets
 	while((packet_id = dyn_fifo_pop(&socket->received)) >= 0){
-		pq_release(packet_phone, packet_id);
+		pq_release_local(packet_phone, packet_id);
 	}
 	dyn_fifo_destroy(&socket->received);
Index: uspace/lib/socket/include/net_messages.h
===================================================================
--- uspace/lib/socket/include/net_messages.h	(revision 24ab58b348754b301fea741628d74d49704735d6)
+++ uspace/lib/socket/include/net_messages.h	(revision 14f1db0aaed5208d5e8340c816ca6e555f81f67e)
@@ -462,28 +462,41 @@
 /*@}*/
 
-/** Notifies the module about the device state change.
- *  @param[in] phone The service module phone.
- *  @param[in] message The service specific message.
- *  @param[in] device_id The device identifier.
- *  @param[in] state The new device state.
- *  @param[in] target The target module service.
- *  @returns EOK on success.
- */
-static inline int generic_device_state_msg(int phone, int message, device_id_t device_id, int state, services_t target){
-	async_msg_3(phone, (ipcarg_t) message, (ipcarg_t) device_id, (ipcarg_t) state, target);
+/** Notify the module about the device state change.
+ *
+ * @param[in] phone     The service module phone.
+ * @param[in] message   The service specific message.
+ * @param[in] device_id The device identifier.
+ * @param[in] state     The new device state.
+ * @param[in] target    The target module service.
+ *
+ * @return EOK on success.
+ *
+ */
+static inline int generic_device_state_msg_remote(int phone, int message,
+    device_id_t device_id, int state, services_t target)
+{
+	async_msg_3(phone, (ipcarg_t) message, (ipcarg_t) device_id,
+	    (ipcarg_t) state, target);
+	
 	return EOK;
 }
 
-/** Notifies a module about the device.
- *  @param[in] phone The service module phone.
- *  @param[in] message The service specific message.
- *  @param[in] device_id The device identifier.
- *  @param[in] arg2 The second argument of the message.
- *  @param[in] service The device module service.
- *  @returns EOK on success.
- *  @returns Other error codes as defined for the specific service message.
- */
-static inline int generic_device_req(int phone, int message, device_id_t device_id, int arg2, services_t service){
-	return (int) async_req_3_0(phone, (ipcarg_t) message, (ipcarg_t) device_id, (ipcarg_t) arg2, (ipcarg_t) service);
+/** Notify a module about the device.
+ *
+ * @param[in] phone     The service module phone.
+ * @param[in] message   The service specific message.
+ * @param[in] device_id The device identifier.
+ * @param[in] arg2      The second argument of the message.
+ * @param[in] service   The device module service.
+ *
+ * @return EOK on success.
+ * @return Other error codes as defined for the specific service message.
+ *
+ */
+static inline int generic_device_req_remote(int phone, int message,
+    device_id_t device_id, int arg2, services_t service)
+{
+	return (int) async_req_3_0(phone, (ipcarg_t) message, (ipcarg_t) device_id,
+	    (ipcarg_t) arg2, (ipcarg_t) service);
 }
 
@@ -521,64 +534,88 @@
 }
 
-/** Returns the device packet dimension for sending.
- *  @param[in] phone The service module phone.
- *  @param[in] message The service specific message.
- *  @param[in] device_id The device identifier.
- *  @param[out] packet_dimension The packet dimension.
- *  @returns EOK on success.
- *  @returns EBADMEM if the packet_dimension parameter is NULL.
- *  @returns Other error codes as defined for the specific service message.
- */
-static inline int generic_packet_size_req(int phone, int message, device_id_t device_id, packet_dimension_ref packet_dimension){
-	ipcarg_t result;
+/** Return the device packet dimension for sending.
+ *
+ * @param[in]  phone            The service module phone.
+ * @param[in]  message          The service specific message.
+ * @param[in]  device_id        The device identifier.
+ * @param[out] packet_dimension The packet dimension.
+ *
+ * @return EOK on success.
+ * @return EBADMEM if the packet_dimension parameter is NULL.
+ * @return Other error codes as defined for the specific service message.
+ *
+ */
+static inline int generic_packet_size_req_remote(int phone, int message,
+    device_id_t device_id, packet_dimension_ref packet_dimension)
+{
+	if (!packet_dimension)
+		return EBADMEM;
+	
+	ipcarg_t addr_len;
 	ipcarg_t prefix;
 	ipcarg_t content;
 	ipcarg_t suffix;
-	ipcarg_t addr_len;
-
-	if(! packet_dimension){
-		return EBADMEM;
-	}
-	result = async_req_1_4(phone, (ipcarg_t) message, (ipcarg_t) device_id, &addr_len, &prefix, &content, &suffix);
+	
+	ipcarg_t result = async_req_1_4(phone, (ipcarg_t) message,
+	    (ipcarg_t) device_id, &addr_len, &prefix, &content, &suffix);
+	
 	packet_dimension->prefix = (size_t) prefix;
 	packet_dimension->content = (size_t) content;
 	packet_dimension->suffix = (size_t) suffix;
 	packet_dimension->addr_len = (size_t) addr_len;
+	
 	return (int) result;
 }
 
-/** Passes the packet queue to the module.
- *  @param[in] phone The service module phone.
- *  @param[in] message The service specific message.
- *  @param[in] device_id The device identifier.
- *  @param[in] packet_id The received packet or the received packet queue identifier.
- *  @param[in] target The target module service.
- *  @param[in] error The error module service.
- *  @returns EOK on success.
- */
-static inline int generic_received_msg(int phone, int message, device_id_t device_id, packet_id_t packet_id, services_t target, services_t error){
-	if(error){
-		async_msg_4(phone, (ipcarg_t) message, (ipcarg_t) device_id, (ipcarg_t) packet_id, (ipcarg_t) target, (ipcarg_t) error);
-	}else{
-		async_msg_3(phone, (ipcarg_t) message, (ipcarg_t) device_id, (ipcarg_t) packet_id, (ipcarg_t) target);
-	}
+/** Pass the packet queue to the module.
+ *
+ * @param[in] phone     The service module phone.
+ * @param[in] message   The service specific message.
+ * @param[in] device_id The device identifier.
+ * @param[in] packet_id The received packet or the received packet queue
+ *                      identifier.
+ * @param[in] target    The target module service.
+ * @param[in] error     The error module service.
+ *
+ * @return EOK on success.
+ *
+ */
+static inline int generic_received_msg_remote(int phone, int message,
+    device_id_t device_id, packet_id_t packet_id, services_t target,
+    services_t error)
+{
+	if (error)
+		async_msg_4(phone, (ipcarg_t) message, (ipcarg_t) device_id,
+		    (ipcarg_t) packet_id, (ipcarg_t) target, (ipcarg_t) error);
+	else
+		async_msg_3(phone, (ipcarg_t) message, (ipcarg_t) device_id,
+		    (ipcarg_t) packet_id, (ipcarg_t) target);
+	
 	return EOK;
 }
 
-/** Sends the packet queue.
- *  @param[in] phone The service module phone.
- *  @param[in] message The service specific message.
- *  @param[in] device_id The device identifier.
- *  @param[in] packet_id The packet or the packet queue identifier.
- *  @param[in] sender The sending module service.
- *  @param[in] error The error module service.
- *  @returns EOK on success.
- */
-static inline int generic_send_msg(int phone, int message, device_id_t device_id, packet_id_t packet_id, services_t sender, services_t error){
-	if(error){
-		async_msg_4(phone, (ipcarg_t) message, (ipcarg_t) device_id, (ipcarg_t) packet_id, (ipcarg_t) sender, (ipcarg_t) error);
-	}else{
-		async_msg_3(phone, (ipcarg_t) message, (ipcarg_t) device_id, (ipcarg_t) packet_id, (ipcarg_t) sender);
-	}
+/** Send the packet queue.
+ *
+ * @param[in] phone     The service module phone.
+ * @param[in] message   The service specific message.
+ * @param[in] device_id The device identifier.
+ * @param[in] packet_id The packet or the packet queue identifier.
+ * @param[in] sender    The sending module service.
+ * @param[in] error     The error module service.
+ *
+ * @return EOK on success.
+ *
+ */
+static inline int generic_send_msg_remote(int phone, int message,
+    device_id_t device_id, packet_id_t packet_id, services_t sender,
+    services_t error)
+{
+	if (error)
+		async_msg_4(phone, (ipcarg_t) message, (ipcarg_t) device_id,
+		    (ipcarg_t) packet_id, (ipcarg_t) sender, (ipcarg_t) error);
+	else
+		async_msg_3(phone, (ipcarg_t) message, (ipcarg_t) device_id,
+		    (ipcarg_t) packet_id, (ipcarg_t) sender);
+	
 	return EOK;
 }
Index: uspace/lib/socket/include/net_modules.h
===================================================================
--- uspace/lib/socket/include/net_modules.h	(revision 24ab58b348754b301fea741628d74d49704735d6)
+++ uspace/lib/socket/include/net_modules.h	(revision 14f1db0aaed5208d5e8340c816ca6e555f81f67e)
@@ -72,27 +72,8 @@
 extern void answer_call(ipc_callid_t callid, int result, ipc_call_t * answer, int answer_count);
 
-/** Creates bidirectional connection with the needed module service and registers the message receiver.
- *  @param[in] need The needed module service.
- *  @param[in] arg1 The first parameter.
- *  @param[in] arg2 The second parameter.
- *  @param[in] arg3 The third parameter.
- *  @param[in] client_receiver The message receiver.
- *  @returns The phone of the needed service.
- *  @returns Other error codes as defined for the ipc_connect_to_me() function.
- */
-extern int bind_service(services_t need, ipcarg_t arg1, ipcarg_t arg2, ipcarg_t arg3, async_client_conn_t client_receiver);
-
-/** Creates bidirectional connection with the needed module service and registers the message receiver.
- *  @param[in] need The needed module service.
- *  @param[in] arg1 The first parameter.
- *  @param[in] arg2 The second parameter.
- *  @param[in] arg3 The third parameter.
- *  @param[in] client_receiver The message receiver.
- *  @param[in] timeout The connection timeout in microseconds. No timeout if set to zero (0).
- *  @returns The phone of the needed service.
- *  @returns ETIMEOUT if the connection timeouted.
- *  @returns Other error codes as defined for the ipc_connect_to_me() function.
- */
-extern int bind_service_timeout(services_t need, ipcarg_t arg1, ipcarg_t arg2, ipcarg_t arg3, async_client_conn_t client_receiver, suseconds_t timeout);
+extern int bind_service(services_t, ipcarg_t, ipcarg_t, ipcarg_t,
+    async_client_conn_t);
+extern int bind_service_timeout(services_t, ipcarg_t, ipcarg_t, ipcarg_t,
+    async_client_conn_t, suseconds_t);
 
 /** Connects to the needed module.
Index: uspace/lib/socket/include/packet/packet_client.h
===================================================================
--- uspace/lib/socket/include/packet/packet_client.h	(revision 24ab58b348754b301fea741628d74d49704735d6)
+++ uspace/lib/socket/include/packet/packet_client.h	(revision 14f1db0aaed5208d5e8340c816ca6e555f81f67e)
@@ -45,5 +45,5 @@
 #define __NET_PACKET_CLIENT_H__
 
-#include "packet.h"
+#include <packet/packet.h>
 
 /** @name Packet client interface
@@ -172,5 +172,5 @@
  *  @returns Other error codes as defined for the packet_return() function.
  */
-extern int packet_translate(int phone, packet_ref packet, packet_id_t packet_id);
+extern int packet_translate_local(int phone, packet_ref packet, packet_id_t packet_id);
 
 /** Obtains the packet of the given dimensions.
@@ -184,5 +184,5 @@
  *  @returns NULL on error.
  */
-extern packet_t packet_get_4(int phone, size_t max_content, size_t addr_len, size_t max_prefix, size_t max_suffix);
+extern packet_t packet_get_4_local(int phone, size_t max_content, size_t addr_len, size_t max_prefix, size_t max_suffix);
 
 /** Obtains the packet of the given content size.
@@ -193,5 +193,5 @@
  *  @returns NULL on error.
  */
-extern packet_t packet_get_1(int phone, size_t content);
+extern packet_t packet_get_1_local(int phone, size_t content);
 
 /** Releases the packet queue.
@@ -202,5 +202,5 @@
  *  @param[in] packet_id The packet identifier.
  */
-extern void pq_release(int phone, packet_id_t packet_id);
+extern void pq_release_local(int phone, packet_id_t packet_id);
 
 /** Returns the packet copy.
Index: uspace/lib/socket/packet/packet_client.c
===================================================================
--- uspace/lib/socket/packet/packet_client.c	(revision 24ab58b348754b301fea741628d74d49704735d6)
+++ uspace/lib/socket/packet/packet_client.c	(revision 14f1db0aaed5208d5e8340c816ca6e555f81f67e)
@@ -164,5 +164,5 @@
 	}
 	// get a new packet
-	copy = packet_get_4(phone, PACKET_DATA_LENGTH(packet), PACKET_MAX_ADDRESS_LENGTH(packet), packet->max_prefix, PACKET_MIN_SUFFIX(packet));
+	copy = packet_get_4_local(phone, PACKET_DATA_LENGTH(packet), PACKET_MAX_ADDRESS_LENGTH(packet), packet->max_prefix, PACKET_MIN_SUFFIX(packet));
 	if(! copy){
 		return NULL;
@@ -178,5 +178,5 @@
 		return copy;
 	}else{
-		pq_release(phone, copy->packet_id);
+		pq_release_local(phone, copy->packet_id);
 		return NULL;
 	}
Index: uspace/lib/socket/packet/packet_server.c
===================================================================
--- uspace/lib/socket/packet/packet_server.c	(revision 24ab58b348754b301fea741628d74d49704735d6)
+++ uspace/lib/socket/packet/packet_server.c	(revision 14f1db0aaed5208d5e8340c816ca6e555f81f67e)
@@ -97,8 +97,9 @@
 };
 
-int packet_translate(int phone, packet_ref packet, packet_id_t packet_id){
-	if(! packet){
+int packet_translate_local(int phone, packet_ref packet, packet_id_t packet_id)
+{
+	if (!packet)
 		return EINVAL;
-	}
+	
 	*packet = pm_find(packet_id);
 	return (*packet) ? EOK : ENOENT;
@@ -161,60 +162,79 @@
 }
 
-/** Returns the packet of dimensions at least as given.
- *  Tries to reuse free packets first.
- *  Creates a&nbsp;new packet aligned to the memory page size if none available.
- *  Locks the global data during its processing.
- *  @param[in] addr_len The source and destination addresses maximal length in bytes.
- *  @param[in] max_prefix The maximal prefix length in bytes.
- *  @param[in] max_content The maximal content length in bytes.
- *  @param[in] max_suffix The maximal suffix length in bytes.
- *  @returns The packet of dimensions at least as given.
- *  @returns NULL if there is not enough memory left.
- */
-static packet_t packet_get(size_t addr_len, size_t max_prefix, size_t max_content, size_t max_suffix){
-	int index;
+/** Return the packet of dimensions at least as given.
+ *
+ * Try to reuse free packets first.
+ * Create a new packet aligned to the memory page size if none available.
+ * Lock the global data during its processing.
+ *
+ * @param[in] addr_len    The source and destination addresses
+ *                        maximal length in bytes.
+ * @param[in] max_prefix  The maximal prefix length in bytes.
+ * @param[in] max_content The maximal content length in bytes.
+ * @param[in] max_suffix  The maximal suffix length in bytes.
+ *
+ * @return The packet of dimensions at least as given.
+ * @return NULL if there is not enough memory left.
+ *
+ */
+static packet_t packet_get_local(size_t addr_len, size_t max_prefix,
+    size_t max_content, size_t max_suffix)
+{
+	size_t length = ALIGN_UP(sizeof(struct packet) + 2 * addr_len + max_prefix
+	    + max_content + max_suffix, PAGE_SIZE);
+	
+	fibril_mutex_lock(&ps_globals.lock);
+	
 	packet_t packet;
-	size_t length;
-
-	length = ALIGN_UP(sizeof(struct packet) + 2 * addr_len + max_prefix + max_content + max_suffix, PAGE_SIZE);
-	fibril_mutex_lock(&ps_globals.lock);
-	for(index = 0; index < FREE_QUEUES_COUNT - 1; ++ index){
-		if(length <= ps_globals.sizes[index]){
+	unsigned int index;
+	
+	for (index = 0; index < FREE_QUEUES_COUNT - 1; index++) {
+		if (length <= ps_globals.sizes[index]) {
 			packet = ps_globals.free[index];
-			while(packet_is_valid(packet) && (packet->length < length)){
+			
+			while (packet_is_valid(packet) && (packet->length < length))
 				packet = pm_find(packet->next);
-			}
-			if(packet_is_valid(packet)){
-				if(packet == ps_globals.free[index]){
+			
+			if (packet_is_valid(packet)) {
+				if (packet == ps_globals.free[index])
 					ps_globals.free[index] = pq_detach(packet);
-				}else{
+				else
 					pq_detach(packet);
-				}
-				packet_init(packet, addr_len, max_prefix, max_content, max_suffix);
+				
+				packet_init(packet, addr_len, max_prefix, max_content,
+				    max_suffix);
 				fibril_mutex_unlock(&ps_globals.lock);
-				// remove debug dump
-//				printf("packet %d got\n", packet->packet_id);
+				
 				return packet;
 			}
 		}
 	}
-	packet = packet_create(length, addr_len, max_prefix, max_content, max_suffix);
+	
+	packet = packet_create(length, addr_len, max_prefix, max_content,
+	    max_suffix);
+	
 	fibril_mutex_unlock(&ps_globals.lock);
-	// remove debug dump
-//	printf("packet %d created\n", packet->packet_id);
+	
 	return packet;
 }
 
-packet_t packet_get_4(int phone, size_t max_content, size_t addr_len, size_t max_prefix, size_t max_suffix){
-	return packet_get(addr_len, max_prefix, max_content, max_suffix);
-}
-
-packet_t packet_get_1(int phone, size_t content){
-	return packet_get(DEFAULT_ADDR_LEN, DEFAULT_PREFIX, content, DEFAULT_SUFFIX);
-}
-
-/** Releases the packet and returns it to the appropriate free packet queue.
+packet_t packet_get_4_local(int phone, size_t max_content, size_t addr_len,
+    size_t max_prefix, size_t max_suffix)
+{
+	return packet_get_local(addr_len, max_prefix, max_content, max_suffix);
+}
+
+packet_t packet_get_1_local(int phone, size_t content)
+{
+	return packet_get_local(DEFAULT_ADDR_LEN, DEFAULT_PREFIX, content,
+	    DEFAULT_SUFFIX);
+}
+
+/** Release the packet and returns it to the appropriate free packet queue.
+ *
  *  Should be used only when the global data are locked.
+ *
  *  @param[in] packet The packet to be released.
+ *
  */
 static void packet_release(packet_t packet){
@@ -247,5 +267,6 @@
 }
 
-void pq_release(int phone, packet_id_t packet_id){
+void pq_release_local(int phone, packet_id_t packet_id)
+{
 	(void) packet_release_wrapper(packet_id);
 }
@@ -281,5 +302,5 @@
 			return EOK;
 		case NET_PACKET_CREATE_1:
-			packet = packet_get(DEFAULT_ADDR_LEN, DEFAULT_PREFIX, IPC_GET_CONTENT(call), DEFAULT_SUFFIX);
+			packet = packet_get_local(DEFAULT_ADDR_LEN, DEFAULT_PREFIX, IPC_GET_CONTENT(call), DEFAULT_SUFFIX);
 			if(! packet){
 				return ENOMEM;
@@ -290,5 +311,5 @@
 			return EOK;
 		case NET_PACKET_CREATE_4:
-			packet = packet_get(((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));
+			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));
 			if(! packet){
 				return ENOMEM;
Index: uspace/srv/hw/netif/dp8390/Makefile
===================================================================
--- uspace/srv/hw/netif/dp8390/Makefile	(revision 24ab58b348754b301fea741628d74d49704735d6)
+++ uspace/srv/hw/netif/dp8390/Makefile	(revision 14f1db0aaed5208d5e8340c816ca6e555f81f67e)
@@ -39,11 +39,9 @@
 -include $(CONFIG_MAKEFILE)
 
-ifeq ($(CONFIG_NETWORKING),modular)
-	BINARY = dp8390
+ifeq ($(CONFIG_NETIF_NIL_BUNDLE),y)
+	LIBS += $(USPACE_PREFIX)/srv/net/nil/eth/libeth.a
 endif
 
-ifeq ($(CONFIG_NETWORKING),module)
-	LIBRARY = libdp8390
-endif
+BINARY = dp8390
 
 SOURCES = \
Index: uspace/srv/hw/netif/dp8390/dp8390.c
===================================================================
--- uspace/srv/hw/netif/dp8390/dp8390.c	(revision 24ab58b348754b301fea741628d74d49704735d6)
+++ uspace/srv/hw/netif/dp8390/dp8390.c	(revision 14f1db0aaed5208d5e8340c816ca6e555f81f67e)
@@ -37,9 +37,7 @@
 
 #include <net_byteorder.h>
-
+#include <netif_local.h>
 #include <packet/packet.h>
 #include <packet/packet_client.h>
-
-#include <netif.h>
 
 #include "dp8390_drv.h"
Index: uspace/srv/hw/netif/dp8390/dp8390_module.c
===================================================================
--- uspace/srv/hw/netif/dp8390/dp8390_module.c	(revision 24ab58b348754b301fea741628d74d49704735d6)
+++ uspace/srv/hw/netif/dp8390/dp8390_module.c	(revision 14f1db0aaed5208d5e8340c816ca6e555f81f67e)
@@ -50,6 +50,6 @@
 #include <net_device.h>
 #include <nil_interface.h>
-#include <netif.h>
-#include <netif_module.h>
+#include <netif_interface.h>
+#include <netif_local.h>
 
 #include "dp8390.h"
@@ -95,8 +95,4 @@
 };
 
-/** Network interface module global data.
- */
-netif_globals_t netif_globals;
-
 /** Handles the interrupt messages.
  *  This is the interrupt handler callback function.
@@ -104,61 +100,7 @@
  *  @param[in] call The interrupt message.
  */
-void irq_handler(ipc_callid_t iid, ipc_call_t * call);
-
-/** Changes the network interface state.
- *  @param[in,out] device The network interface.
- *  @param[in] state The new state.
- *  @returns The new state.
- */
-int change_state(device_ref device, device_state_t state);
-
-int netif_specific_message(ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count){
-	return ENOTSUP;
-}
-
-int netif_get_device_stats(device_id_t device_id, device_stats_ref stats){
-	ERROR_DECLARE;
-
-	device_ref device;
-	eth_stat_t * de_stat;
-
-	if(! stats){
-		return EBADMEM;
-	}
-	ERROR_PROPAGATE(find_device(device_id, &device));
-	de_stat = &((dpeth_t *) device->specific)->de_stat;
-	null_device_stats(stats);
-	stats->receive_errors = de_stat->ets_recvErr;
-	stats->send_errors = de_stat->ets_sendErr;
-	stats->receive_crc_errors = de_stat->ets_CRCerr;
-	stats->receive_frame_errors = de_stat->ets_frameAll;
-	stats->receive_missed_errors = de_stat->ets_missedP;
-	stats->receive_packets = de_stat->ets_packetR;
-	stats->send_packets = de_stat->ets_packetT;
-	stats->collisions = de_stat->ets_collision;
-	stats->send_aborted_errors = de_stat->ets_transAb;
-	stats->send_carrier_errors = de_stat->ets_carrSense;
-	stats->send_heartbeat_errors = de_stat->ets_CDheartbeat;
-	stats->send_window_errors = de_stat->ets_OWC;
-	return EOK;
-}
-
-int netif_get_addr_message(device_id_t device_id, measured_string_ref address){
-	ERROR_DECLARE;
-
-	device_ref device;
-
-	if(! address){
-		return EBADMEM;
-	}
-	ERROR_PROPAGATE(find_device(device_id, &device));
-	address->value = (char *) (&((dpeth_t *) device->specific)->de_address);
-	address->length = CONVERT_SIZE(ether_addr_t, char, 1);
-	return EOK;
-}
-
-void irq_handler(ipc_callid_t iid, ipc_call_t * call)
+static void irq_handler(ipc_callid_t iid, ipc_call_t * call)
 {
-	device_ref device;
+	netif_device_t * device;
 	dpeth_t * dep;
 	packet_t received;
@@ -203,11 +145,77 @@
 }
 
+/** Changes the network interface state.
+ *  @param[in,out] device The network interface.
+ *  @param[in] state The new state.
+ *  @returns The new state.
+ */
+static int change_state(netif_device_t * device, device_state_t state)
+{
+	if (device->state != state) {
+		device->state = state;
+		
+		printf("%s: State changed to %s\n", NAME,
+		    (state == NETIF_ACTIVE) ? "active" : "stopped");
+		
+		return state;
+	}
+	
+	return EOK;
+}
+
+int netif_specific_message(ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count){
+	return ENOTSUP;
+}
+
+int netif_get_device_stats(device_id_t device_id, device_stats_ref stats){
+	ERROR_DECLARE;
+
+	netif_device_t * device;
+	eth_stat_t * de_stat;
+
+	if(! stats){
+		return EBADMEM;
+	}
+	ERROR_PROPAGATE(find_device(device_id, &device));
+	de_stat = &((dpeth_t *) device->specific)->de_stat;
+	null_device_stats(stats);
+	stats->receive_errors = de_stat->ets_recvErr;
+	stats->send_errors = de_stat->ets_sendErr;
+	stats->receive_crc_errors = de_stat->ets_CRCerr;
+	stats->receive_frame_errors = de_stat->ets_frameAll;
+	stats->receive_missed_errors = de_stat->ets_missedP;
+	stats->receive_packets = de_stat->ets_packetR;
+	stats->send_packets = de_stat->ets_packetT;
+	stats->collisions = de_stat->ets_collision;
+	stats->send_aborted_errors = de_stat->ets_transAb;
+	stats->send_carrier_errors = de_stat->ets_carrSense;
+	stats->send_heartbeat_errors = de_stat->ets_CDheartbeat;
+	stats->send_window_errors = de_stat->ets_OWC;
+	return EOK;
+}
+
+int netif_get_addr_message(device_id_t device_id, measured_string_ref address){
+	ERROR_DECLARE;
+
+	netif_device_t * device;
+
+	if(! address){
+		return EBADMEM;
+	}
+	ERROR_PROPAGATE(find_device(device_id, &device));
+	address->value = (char *) (&((dpeth_t *) device->specific)->de_address);
+	address->length = CONVERT_SIZE(ether_addr_t, char, 1);
+	return EOK;
+}
+
+
+
 int netif_probe_message(device_id_t device_id, int irq, uintptr_t io){
 	ERROR_DECLARE;
 
-	device_ref device;
-	dpeth_t * dep;
-
-	device = (device_ref) malloc(sizeof(device_t));
+	netif_device_t * device;
+	dpeth_t * dep;
+
+	device = (netif_device_t *) malloc(sizeof(netif_device_t));
 	if(! device){
 		return ENOMEM;
@@ -218,5 +226,5 @@
 		return ENOMEM;
 	}
-	bzero(device, sizeof(device_t));
+	bzero(device, sizeof(netif_device_t));
 	bzero(dep, sizeof(dpeth_t));
 	device->device_id = device_id;
@@ -233,5 +241,5 @@
 		return ERROR_CODE;
 	}
-	if(ERROR_OCCURRED(device_map_add(&netif_globals.device_map, device->device_id, device))){
+	if(ERROR_OCCURRED(netif_device_map_add(&netif_globals.device_map, device->device_id, device))){
 		free(dep);
 		free(device);
@@ -244,5 +252,5 @@
 	ERROR_DECLARE;
 
-	device_ref device;
+	netif_device_t * device;
 	dpeth_t * dep;
 	packet_t next;
@@ -271,5 +279,5 @@
 }
 
-int netif_start_message(device_ref device){
+int netif_start_message(netif_device_t * device){
 	ERROR_DECLARE;
 
@@ -290,5 +298,5 @@
 }
 
-int netif_stop_message(device_ref device){
+int netif_stop_message(netif_device_t * device){
 	dpeth_t * dep;
 
@@ -302,18 +310,4 @@
 }
 
-int change_state(device_ref device, device_state_t state)
-{
-	if (device->state != state) {
-		device->state = state;
-		
-		printf("%s: State changed to %s\n", NAME,
-		    (state == NETIF_ACTIVE) ? "active" : "stopped");
-		
-		return state;
-	}
-	
-	return EOK;
-}
-
 int netif_initialize(void){
 	ipcarg_t phonehash;
@@ -323,8 +317,4 @@
 	return REGISTER_ME(SERVICE_DP8390, &phonehash);
 }
-
-#ifdef CONFIG_NETWORKING_modular
-
-#include <netif_standalone.h>
 
 /** Default thread for new connections.
@@ -386,7 +376,4 @@
 }
 
-#endif /* CONFIG_NETWORKING_modular */
-
-
 /** @}
  */
Index: uspace/srv/net/cfg/Makefile
===================================================================
--- uspace/srv/net/cfg/Makefile	(revision 14f1db0aaed5208d5e8340c816ca6e555f81f67e)
+++ uspace/srv/net/cfg/Makefile	(revision 14f1db0aaed5208d5e8340c816ca6e555f81f67e)
@@ -0,0 +1,60 @@
+#
+# Copyright (c) 2010 Martin Decky
+# 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.
+#
+
+USPACE_PREFIX = ../../..
+ROOT_PATH = $(USPACE_PREFIX)/..
+
+COMMON_MAKEFILE = $(ROOT_PATH)/Makefile.common
+CONFIG_MAKEFILE = $(ROOT_PATH)/Makefile.config
+
+-include $(COMMON_MAKEFILE)
+-include $(CONFIG_MAKEFILE)
+
+ifeq ($(CONFIG_NETIF_NIL_BUNDLE),y)
+	LO_SOURCE = lo.netif_nil_bundle
+	NE2K_SOURCE = ne2k.netif_nil_bundle
+else
+	LO_SOURCE = lo.netif_standalone
+	NE2K_SOURCE = ne2k.netif_standalone
+endif
+
+LO_TARGET = lo
+NE2K_TARGET = ne2k
+
+.PHONY: all clean
+
+all: $(LO_TARGET) $(NE2K_TARGET)
+
+clean:
+	rm -f $(LO_TARGET) $(NE2K_TARGET)
+
+$(LO_TARGET): $(LO_SOURCE)
+	cp $< $@
+
+$(NE2K_TARGET): $(NE2K_SOURCE)
+	cp $< $@
Index: uspace/srv/net/cfg/general
===================================================================
--- uspace/srv/net/cfg/general	(revision 14f1db0aaed5208d5e8340c816ca6e555f81f67e)
+++ uspace/srv/net/cfg/general	(revision 14f1db0aaed5208d5e8340c816ca6e555f81f67e)
@@ -0,0 +1,12 @@
+# general configuration
+
+IPV=4
+IP_ROUTING=no
+
+MTU=1500
+
+ICMP_ERROR_REPORTING=yes
+ICMP_ECHO_REPLYING=yes
+
+UDP_CHECKSUM_COMPUTING=yes
+UDP_AUTOBINDING=yes
Index: uspace/srv/net/cfg/lo.netif_nil_bundle
===================================================================
--- uspace/srv/net/cfg/lo.netif_nil_bundle	(revision 14f1db0aaed5208d5e8340c816ca6e555f81f67e)
+++ uspace/srv/net/cfg/lo.netif_nil_bundle	(revision 14f1db0aaed5208d5e8340c816ca6e555f81f67e)
@@ -0,0 +1,13 @@
+# loopback configuration
+
+NAME=lo
+
+NETIF=lo
+NIL=lo
+IL=ip
+
+IP_CONFIG=static
+IP_ADDR=127.0.0.1
+IP_NETMASK=255.0.0.0
+
+MTU=15535
Index: uspace/srv/net/cfg/lo.netif_standalone
===================================================================
--- uspace/srv/net/cfg/lo.netif_standalone	(revision 14f1db0aaed5208d5e8340c816ca6e555f81f67e)
+++ uspace/srv/net/cfg/lo.netif_standalone	(revision 14f1db0aaed5208d5e8340c816ca6e555f81f67e)
@@ -0,0 +1,13 @@
+# loopback configuration
+
+NAME=lo
+
+NETIF=lo
+NIL=nildummy
+IL=ip
+
+IP_CONFIG=static
+IP_ADDR=127.0.0.1
+IP_NETMASK=255.0.0.0
+
+MTU=15535
Index: pace/srv/net/cfg/modular/general
===================================================================
--- uspace/srv/net/cfg/modular/general	(revision 24ab58b348754b301fea741628d74d49704735d6)
+++ 	(revision )
@@ -1,12 +1,0 @@
-# general configuration
-
-IPV=4
-IP_ROUTING=no
-
-MTU=1500
-
-ICMP_ERROR_REPORTING=yes
-ICMP_ECHO_REPLYING=yes
-
-UDP_CHECKSUM_COMPUTING=yes
-UDP_AUTOBINDING=yes
Index: pace/srv/net/cfg/modular/lo
===================================================================
--- uspace/srv/net/cfg/modular/lo	(revision 24ab58b348754b301fea741628d74d49704735d6)
+++ 	(revision )
@@ -1,13 +1,0 @@
-# loopback configuration
-
-NAME=lo
-
-NETIF=lo
-NIL=nildummy
-IL=ip
-
-IP_CONFIG=static
-IP_ADDR=127.0.0.1
-IP_NETMASK=255.0.0.0
-
-MTU=15535
Index: pace/srv/net/cfg/modular/ne2k
===================================================================
--- uspace/srv/net/cfg/modular/ne2k	(revision 24ab58b348754b301fea741628d74d49704735d6)
+++ 	(revision )
@@ -1,25 +1,0 @@
-# DP8390 (NE2k) configuration
-
-NAME=ne2k
-
-NETIF=dp8390
-NIL=eth
-IL=ip
-
-# sysinfo_value("netif.dp8390.inr")
-IRQ=9
-IO=300
-
-# 8023_2_LSAP, 8023_2_SNAP
-ETH_MODE=DIX
-ETH_DUMMY=no
-
-IP_CONFIG=static
-IP_ADDR=10.0.2.15
-IP_ROUTING=yes
-IP_NETMASK=255.255.255.240
-IP_BROADCAST=10.0.2.255
-IP_GATEWAY=10.0.2.2
-ARP=arp
-
-MTU=1492
Index: pace/srv/net/cfg/module/general
===================================================================
--- uspace/srv/net/cfg/module/general	(revision 24ab58b348754b301fea741628d74d49704735d6)
+++ 	(revision )
@@ -1,12 +1,0 @@
-# general configuration
-
-IPV=4
-IP_ROUTING=no
-
-MTU=1500
-
-ICMP_ERROR_REPORTING=yes
-ICMP_ECHO_REPLYING=yes
-
-UDP_CHECKSUM_COMPUTING=yes
-UDP_AUTOBINDING=yes
Index: pace/srv/net/cfg/module/lo
===================================================================
--- uspace/srv/net/cfg/module/lo	(revision 24ab58b348754b301fea741628d74d49704735d6)
+++ 	(revision )
@@ -1,13 +1,0 @@
-# loopback configuration
-
-NAME=lo
-
-NETIF=lo
-NIL=lo
-IL=ip
-
-IP_CONFIG=static
-IP_ADDR=127.0.0.1
-IP_NETMASK=255.0.0.0
-
-MTU=15535
Index: pace/srv/net/cfg/module/ne2k
===================================================================
--- uspace/srv/net/cfg/module/ne2k	(revision 24ab58b348754b301fea741628d74d49704735d6)
+++ 	(revision )
@@ -1,25 +1,0 @@
-# DP8390 (NE2k) configuration
-
-NAME=ne2k
-
-NETIF=dp8390
-NIL=dp8390
-IL=ip
-
-# sysinfo_value("netif.dp8390.inr")
-IRQ=9
-IO=300
-
-# 8023_2_LSAP, 8023_2_SNAP
-ETH_MODE=DIX
-ETH_DUMMY=no
-
-IP_CONFIG=static
-IP_ADDR=10.0.2.15
-IP_ROUTING=yes
-IP_NETMASK=255.255.255.240
-IP_BROADCAST=10.0.2.255
-IP_GATEWAY=10.0.2.2
-ARP=arp
-
-MTU=1492
Index: uspace/srv/net/cfg/ne2k.netif_nil_bundle
===================================================================
--- uspace/srv/net/cfg/ne2k.netif_nil_bundle	(revision 14f1db0aaed5208d5e8340c816ca6e555f81f67e)
+++ uspace/srv/net/cfg/ne2k.netif_nil_bundle	(revision 14f1db0aaed5208d5e8340c816ca6e555f81f67e)
@@ -0,0 +1,25 @@
+# DP8390 (NE2k) configuration
+
+NAME=ne2k
+
+NETIF=dp8390
+NIL=dp8390
+IL=ip
+
+# sysinfo_value("netif.dp8390.inr")
+IRQ=9
+IO=300
+
+# 8023_2_LSAP, 8023_2_SNAP
+ETH_MODE=DIX
+ETH_DUMMY=no
+
+IP_CONFIG=static
+IP_ADDR=10.0.2.15
+IP_ROUTING=yes
+IP_NETMASK=255.255.255.240
+IP_BROADCAST=10.0.2.255
+IP_GATEWAY=10.0.2.2
+ARP=arp
+
+MTU=1492
Index: uspace/srv/net/cfg/ne2k.netif_standalone
===================================================================
--- uspace/srv/net/cfg/ne2k.netif_standalone	(revision 14f1db0aaed5208d5e8340c816ca6e555f81f67e)
+++ uspace/srv/net/cfg/ne2k.netif_standalone	(revision 14f1db0aaed5208d5e8340c816ca6e555f81f67e)
@@ -0,0 +1,25 @@
+# DP8390 (NE2k) configuration
+
+NAME=ne2k
+
+NETIF=dp8390
+NIL=eth
+IL=ip
+
+# sysinfo_value("netif.dp8390.inr")
+IRQ=9
+IO=300
+
+# 8023_2_LSAP, 8023_2_SNAP
+ETH_MODE=DIX
+ETH_DUMMY=no
+
+IP_CONFIG=static
+IP_ADDR=10.0.2.15
+IP_ROUTING=yes
+IP_NETMASK=255.255.255.240
+IP_BROADCAST=10.0.2.255
+IP_GATEWAY=10.0.2.2
+ARP=arp
+
+MTU=1492
Index: uspace/srv/net/il/arp/arp.c
===================================================================
--- uspace/srv/net/il/arp/arp.c	(revision 24ab58b348754b301fea741628d74d49704735d6)
+++ uspace/srv/net/il/arp/arp.c	(revision 14f1db0aaed5208d5e8340c816ca6e555f81f67e)
@@ -57,5 +57,8 @@
 #include <packet/packet.h>
 #include <packet/packet_client.h>
+#include <packet_remote.h>
 #include <il_messages.h>
+#include <il_interface.h>
+#include <il_local.h>
 #include <arp_messages.h>
 
@@ -370,7 +373,9 @@
 }
 
-int arp_message(ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count){
+int arp_message_standalone(ipc_callid_t callid, ipc_call_t *call,
+    ipc_call_t *answer, int *answer_count)
+{
 	ERROR_DECLARE;
-
+	
 	measured_string_ref address;
 	measured_string_ref translation;
@@ -378,8 +383,7 @@
 	packet_t packet;
 	packet_t next;
-
-//	printf("message %d - %d\n", IPC_GET_METHOD(*call), NET_ARP_FIRST);
+	
 	*answer_count = 0;
-	switch(IPC_GET_METHOD(*call)){
+	switch (IPC_GET_METHOD(*call)) {
 		case IPC_M_PHONE_HUNGUP:
 			return EOK;
@@ -418,5 +422,5 @@
 			return EOK;
 		case NET_IL_RECEIVED:
-			if(! ERROR_OCCURRED(packet_translate(arp_globals.net_phone, &packet, IPC_GET_PACKET(call)))){
+			if(! ERROR_OCCURRED(packet_translate_remote(arp_globals.net_phone, &packet, IPC_GET_PACKET(call)))){
 				fibril_rwlock_read_lock(&arp_globals.lock);
 				do{
@@ -424,5 +428,5 @@
 					ERROR_CODE = arp_receive_message(IPC_GET_DEVICE(call), packet);
 					if(ERROR_CODE != 1){
-						pq_release(arp_globals.net_phone, packet_get_id(packet));
+						pq_release_remote(arp_globals.net_phone, packet_get_id(packet));
 					}
 					packet = next;
@@ -434,4 +438,5 @@
 			return arp_mtu_changed_message(IPC_GET_DEVICE(call), IPC_GET_MTU(call));
 	}
+	
 	return ENOTSUP;
 }
@@ -570,5 +575,5 @@
 		return NULL;
 	}
-	packet = packet_get_4(arp_globals.net_phone, device->packet_dimension.addr_len, device->packet_dimension.prefix, length, device->packet_dimension.suffix);
+	packet = packet_get_4_remote(arp_globals.net_phone, device->packet_dimension.addr_len, device->packet_dimension.prefix, length, device->packet_dimension.suffix);
 	if(! packet){
 		return NULL;
@@ -576,5 +581,5 @@
 	header = (arp_header_ref) packet_suffix(packet, length);
 	if(! header){
-		pq_release(arp_globals.net_phone, packet_get_id(packet));
+		pq_release_remote(arp_globals.net_phone, packet_get_id(packet));
 		return NULL;
 	}
@@ -593,5 +598,5 @@
 	memcpy(((uint8_t *) header) + length, target->value, target->length);
 	if(packet_set_addr(packet, (uint8_t *) device->addr->value, (uint8_t *) device->broadcast_addr->value, CONVERT_SIZE(char, uint8_t, device->addr->length)) != EOK){
-		pq_release(arp_globals.net_phone, packet_get_id(packet));
+		pq_release_remote(arp_globals.net_phone, packet_get_id(packet));
 		return NULL;
 	}
@@ -619,8 +624,4 @@
 	}
 }
-
-#ifdef CONFIG_NETWORKING_modular
-
-#include <il_standalone.h>
 
 /** Default thread for new connections.
@@ -650,5 +651,6 @@
 		
 		/* Process the message */
-		int res = il_module_message(callid, &call, &answer, &answer_count);
+		int res = il_module_message_standalone(callid, &call, &answer,
+		    &answer_count);
 		
 		/* End if said to either by the message or the processing result */
@@ -675,5 +677,5 @@
 	
 	/* Start the module */
-	if (ERROR_OCCURRED(il_module_start(il_client_connection)))
+	if (ERROR_OCCURRED(il_module_start_standalone(il_client_connection)))
 		return ERROR_CODE;
 	
@@ -681,6 +683,4 @@
 }
 
-#endif /* CONFIG_NETWORKING_modular */
-
 /** @}
  */
Index: uspace/srv/net/il/arp/arp_module.c
===================================================================
--- uspace/srv/net/il/arp/arp_module.c	(revision 24ab58b348754b301fea741628d74d49704735d6)
+++ uspace/srv/net/il/arp/arp_module.c	(revision 14f1db0aaed5208d5e8340c816ca6e555f81f67e)
@@ -48,5 +48,5 @@
 #include <net_interface.h>
 #include <packet/packet.h>
-#include <il_standalone.h>
+#include <il_local.h>
 
 #include "arp.h"
@@ -65,6 +65,6 @@
  *  @returns Other error codes as defined for the arp_message() function.
  */
-int il_module_message(ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count){
-	return arp_message(callid, call, answer, answer_count);
+int il_module_message_standalone(ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count){
+	return arp_message_standalone(callid, call, answer, answer_count);
 }
 
@@ -76,20 +76,20 @@
  *  @returns Other error codes as defined for the REGISTER_ME() macro function.
  */
-int il_module_start(async_client_conn_t client_connection){
+int il_module_start_standalone(async_client_conn_t client_connection){
 	ERROR_DECLARE;
-
-	ipcarg_t phonehash;
-
+	
 	async_set_client_connection(client_connection);
 	arp_globals.net_phone = net_connect_module(SERVICE_NETWORKING);
 	ERROR_PROPAGATE(pm_init());
-	if(ERROR_OCCURRED(arp_initialize(client_connection))
-		|| ERROR_OCCURRED(REGISTER_ME(SERVICE_ARP, &phonehash))){
+	
+	ipcarg_t phonehash;
+	if (ERROR_OCCURRED(arp_initialize(client_connection))
+	    || ERROR_OCCURRED(REGISTER_ME(SERVICE_ARP, &phonehash))) {
 		pm_destroy();
 		return ERROR_CODE;
 	}
-
+	
 	async_manager();
-
+	
 	pm_destroy();
 	return EOK;
Index: uspace/srv/net/il/arp/arp_module.h
===================================================================
--- uspace/srv/net/il/arp/arp_module.h	(revision 24ab58b348754b301fea741628d74d49704735d6)
+++ uspace/srv/net/il/arp/arp_module.h	(revision 14f1db0aaed5208d5e8340c816ca6e555f81f67e)
@@ -58,5 +58,5 @@
  *  @see IS_NET_ARP_MESSAGE()
  */
-int arp_message(ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count);
+int arp_message_standalone(ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count);
 
 #endif
Index: uspace/srv/net/il/ip/ip.c
===================================================================
--- uspace/srv/net/il/ip/ip.c	(revision 24ab58b348754b301fea741628d74d49704735d6)
+++ uspace/srv/net/il/ip/ip.c	(revision 14f1db0aaed5208d5e8340c816ca6e555f81f67e)
@@ -69,6 +69,9 @@
 #include <adt/module_map.h>
 #include <packet/packet_client.h>
+#include <packet_remote.h>
 #include <nil_messages.h>
 #include <il_messages.h>
+#include <il_local.h>
+#include <ip_local.h>
 
 #include "ip.h"
@@ -424,5 +427,5 @@
 }
 
-int ip_device_req(int il_phone, device_id_t device_id, services_t netif){
+int ip_device_req_local(int il_phone, device_id_t device_id, services_t netif){
 	ERROR_DECLARE;
 
@@ -656,5 +659,5 @@
 }
 
-int ip_send_msg(int il_phone, device_id_t device_id, packet_t packet, services_t sender, services_t error){
+int ip_send_msg_local(int il_phone, device_id_t device_id, packet_t packet, services_t sender, services_t error){
 	ERROR_DECLARE;
 
@@ -782,5 +785,5 @@
 //			sleep(1);
 //			ERROR_PROPAGATE(arp_translate_req(netif->arp->phone, netif->device_id, SERVICE_IP, &destination, &translation, &data));
-			pq_release(ip_globals.net_phone, packet_get_id(packet));
+			pq_release_remote(ip_globals.net_phone, packet_get_id(packet));
 			return ERROR_CODE;
 		}
@@ -799,5 +802,5 @@
 	}else translation = NULL;
 	if(ERROR_OCCURRED(ip_prepare_packet(src, dest, packet, translation))){
-		pq_release(ip_globals.net_phone, packet_get_id(packet));
+		pq_release_remote(ip_globals.net_phone, packet_get_id(packet));
 	}else{
 		packet = ip_split_packet(packet, netif->packet_dimension.prefix, netif->packet_dimension.content, netif->packet_dimension.suffix, netif->packet_dimension.addr_len, error);
@@ -891,54 +894,69 @@
 }
 
-int ip_message(ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count){
+int ip_message_standalone(ipc_callid_t callid, ipc_call_t *call,
+    ipc_call_t *answer, int * answer_count)
+{
 	ERROR_DECLARE;
-
+	
 	packet_t packet;
-	struct sockaddr * addr;
+	struct sockaddr *addr;
 	size_t addrlen;
 	size_t prefix;
 	size_t suffix;
 	size_t content;
-	ip_pseudo_header_ref header;
+	void *header;
 	size_t headerlen;
 	device_id_t device_id;
-
+	
 	*answer_count = 0;
-	switch(IPC_GET_METHOD(*call)){
+	switch (IPC_GET_METHOD(*call)) {
 		case IPC_M_PHONE_HUNGUP:
 			return EOK;
 		case NET_IL_DEVICE:
-			return ip_device_req(0, IPC_GET_DEVICE(call), IPC_GET_SERVICE(call));
+			return ip_device_req_local(0, IPC_GET_DEVICE(call),
+			    IPC_GET_SERVICE(call));
 		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_SEND:
-			ERROR_PROPAGATE(packet_translate(ip_globals.net_phone, &packet, IPC_GET_PACKET(call)));
-			return ip_send_msg(0, IPC_GET_DEVICE(call), packet, 0, IPC_GET_ERROR(call));
+			ERROR_PROPAGATE(packet_translate_remote(ip_globals.net_phone, &packet,
+			    IPC_GET_PACKET(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:
-			ERROR_PROPAGATE(packet_translate(ip_globals.net_phone, &packet, IPC_GET_PACKET(call)));
+			ERROR_PROPAGATE(packet_translate_remote(ip_globals.net_phone, &packet,
+			    IPC_GET_PACKET(call)));
 			return ip_receive_message(IPC_GET_DEVICE(call), packet);
 		case NET_IP_RECEIVED_ERROR:
-			ERROR_PROPAGATE(packet_translate(ip_globals.net_phone, &packet, IPC_GET_PACKET(call)));
-			return ip_received_error_msg(0, IPC_GET_DEVICE(call), packet, IPC_GET_TARGET(call), IPC_GET_ERROR(call));
+			ERROR_PROPAGATE(packet_translate_remote(ip_globals.net_phone, &packet,
+			    IPC_GET_PACKET(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(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(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:
 			ERROR_PROPAGATE(data_receive((void **) &addr, &addrlen));
-			ERROR_PROPAGATE(ip_get_route_req(0, IP_GET_PROTOCOL(call), addr, (socklen_t) addrlen,
-			    &device_id, &header, &headerlen));
+			ERROR_PROPAGATE(ip_get_route_req_local(0, IP_GET_PROTOCOL(call),
+			    addr, (socklen_t) addrlen, &device_id, &header, &headerlen));
 			IPC_SET_DEVICE(answer, device_id);
 			IP_SET_HEADERLEN(answer, headerlen);
+			
 			*answer_count = 2;
-			if(! ERROR_OCCURRED(data_reply(&headerlen, sizeof(headerlen)))){
+			
+			if (!ERROR_OCCURRED(data_reply(&headerlen, sizeof(headerlen))))
 				ERROR_CODE = data_reply(header, headerlen);
-			}
+			
 			free(header);
 			return ERROR_CODE;
 		case NET_IL_PACKET_SPACE:
-			ERROR_PROPAGATE(ip_packet_size_message(IPC_GET_DEVICE(call), &addrlen, &prefix, &content, &suffix));
+			ERROR_PROPAGATE(ip_packet_size_message(IPC_GET_DEVICE(call),
+			    &addrlen, &prefix, &content, &suffix));
 			IPC_SET_ADDR(answer, addrlen);
 			IPC_SET_PREFIX(answer, prefix);
@@ -948,14 +966,20 @@
 			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));
+	}
+	
 	return ENOTSUP;
 }
 
-int ip_packet_size_req(int ip_phone, device_id_t device_id, packet_dimension_ref packet_dimension){
-	if(! packet_dimension){
+int ip_packet_size_req_local(int ip_phone, device_id_t device_id,
+    packet_dimension_ref packet_dimension)
+{
+	if (!packet_dimension)
 		return EBADMEM;
-	}
-	return ip_packet_size_message(device_id, &packet_dimension->addr_len, &packet_dimension->prefix, &packet_dimension->content, &packet_dimension->suffix);
+	
+	return ip_packet_size_message(device_id, &packet_dimension->addr_len,
+	    &packet_dimension->prefix, &packet_dimension->content,
+	    &packet_dimension->suffix);
 }
 
@@ -1003,5 +1027,5 @@
 }
 
-int ip_add_route_req(int ip_phone, device_id_t device_id, in_addr_t address, in_addr_t netmask, in_addr_t gateway){
+int ip_add_route_req_local(int ip_phone, device_id_t device_id, in_addr_t address, in_addr_t netmask, in_addr_t gateway){
 	ip_route_ref route;
 	ip_netif_ref netif;
@@ -1067,5 +1091,6 @@
 }
 
-int ip_set_gateway_req(int ip_phone, device_id_t device_id, in_addr_t gateway){
+int ip_set_gateway_req_local(int ip_phone, device_id_t device_id, in_addr_t gateway)
+{
 	ip_netif_ref netif;
 
@@ -1112,5 +1137,5 @@
 					}
 				}else{
-					pq_release(ip_globals.net_phone, packet_get_id(next));
+					pq_release_remote(ip_globals.net_phone, packet_get_id(next));
 				}
 				next = new_packet;
@@ -1153,5 +1178,5 @@
 	}
 	// create the last fragment
-	new_packet = packet_get_4(ip_globals.net_phone, prefix, length, suffix, ((addrlen > addr_len) ? addrlen : addr_len));
+	new_packet = packet_get_4_remote(ip_globals.net_phone, prefix, length, suffix, ((addrlen > addr_len) ? addrlen : addr_len));
 	if(! new_packet){
 		return ENOMEM;
@@ -1177,5 +1202,5 @@
 	// create middle framgents
 	while(IP_TOTAL_LENGTH(header) > length){
-		new_packet = packet_get_4(ip_globals.net_phone, prefix, length, suffix, ((addrlen >= addr_len) ? addrlen : addr_len));
+		new_packet = packet_get_4_remote(ip_globals.net_phone, prefix, length, suffix, ((addrlen >= addr_len) ? addrlen : addr_len));
 		if(! new_packet){
 			return ENOMEM;
@@ -1357,5 +1382,18 @@
 }
 
-int ip_received_error_msg(int ip_phone, device_id_t device_id, packet_t packet, services_t target, services_t error){
+/** Notify the IP module about the received error notification packet.
+ *
+ * @param[in] ip_phone  The IP module phone used for (semi)remote calls.
+ * @param[in] device_id The device identifier.
+ * @param[in] packet    The received packet or the received packet queue.
+ * @param[in] target    The target internetwork module service to be
+ *                      delivered to.
+ * @param[in] error     The packet error reporting service. Prefixes the
+ *                      received packet.
+ *
+ * @return EOK on success.
+ *
+ */
+int ip_received_error_msg_local(int ip_phone, device_id_t device_id, packet_t packet, services_t target, services_t error){
 	uint8_t * data;
 	int offset;
@@ -1492,5 +1530,5 @@
 	next = pq_detach(packet);
 	if(next){
-		pq_release(ip_globals.net_phone, packet_get_id(next));
+		pq_release_remote(ip_globals.net_phone, packet_get_id(next));
 	}
 	if(! header){
@@ -1556,9 +1594,9 @@
 
 int ip_release_and_return(packet_t packet, int result){
-	pq_release(ip_globals.net_phone, packet_get_id(packet));
+	pq_release_remote(ip_globals.net_phone, packet_get_id(packet));
 	return result;
 }
 
-int ip_get_route_req(int ip_phone, ip_protocol_t protocol, const struct sockaddr * destination, socklen_t addrlen, device_id_t * device_id, ip_pseudo_header_ref * header, size_t * headerlen){
+int ip_get_route_req_local(int ip_phone, ip_protocol_t protocol, const struct sockaddr * destination, socklen_t addrlen, device_id_t * device_id, void **header, size_t * headerlen){
 	struct sockaddr_in * address_in;
 //	struct sockaddr_in6 *	address_in6;
@@ -1624,11 +1662,7 @@
 	header_in->protocol = protocol;
 	header_in->data_length = 0;
-	*header = (ip_pseudo_header_ref) header_in;
+	*header = header_in;
 	return EOK;
 }
-
-#ifdef CONFIG_NETWORKING_modular
-
-#include <il_standalone.h>
 
 /** Default thread for new connections.
@@ -1658,5 +1692,6 @@
 		
 		/* Process the message */
-		int res = il_module_message(callid, &call, &answer, &answer_count);
+		int res = il_module_message_standalone(callid, &call, &answer,
+		    &answer_count);
 		
 		/* End if said to either by the message or the processing result */
@@ -1683,5 +1718,5 @@
 	
 	/* Start the module */
-	if (ERROR_OCCURRED(il_module_start(il_client_connection)))
+	if (ERROR_OCCURRED(il_module_start_standalone(il_client_connection)))
 		return ERROR_CODE;
 	
@@ -1689,6 +1724,4 @@
 }
 
-#endif /* CONFIG_NETWORKING_modular */
-
 /** @}
  */
Index: uspace/srv/net/il/ip/ip_module.c
===================================================================
--- uspace/srv/net/il/ip/ip_module.c	(revision 24ab58b348754b301fea741628d74d49704735d6)
+++ uspace/srv/net/il/ip/ip_module.c	(revision 14f1db0aaed5208d5e8340c816ca6e555f81f67e)
@@ -47,5 +47,5 @@
 #include <net_interface.h>
 #include <packet/packet.h>
-#include <il_standalone.h>
+#include <il_local.h>
 
 #include "ip.h"
@@ -54,5 +54,5 @@
 /** IP module global data.
  */
-extern ip_globals_t	ip_globals;
+extern ip_globals_t ip_globals;
 
 /** Processes the IP message.
@@ -64,6 +64,6 @@
  *  @returns Other error codes as defined for the ip_message() function.
  */
-int il_module_message(ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count){
-	return ip_message(callid, call, answer, answer_count);
+int il_module_message_standalone(ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count){
+	return ip_message_standalone(callid, call, answer, answer_count);
 }
 
@@ -75,20 +75,20 @@
  *  @returns Other error codes as defined for the REGISTER_ME() macro function.
  */
-int il_module_start(async_client_conn_t client_connection){
+int il_module_start_standalone(async_client_conn_t client_connection){
 	ERROR_DECLARE;
-
-	ipcarg_t phonehash;
-
+	
 	async_set_client_connection(client_connection);
 	ip_globals.net_phone = net_connect_module(SERVICE_NETWORKING);
 	ERROR_PROPAGATE(pm_init());
-	if(ERROR_OCCURRED(ip_initialize(client_connection))
-		|| ERROR_OCCURRED(REGISTER_ME(SERVICE_IP, &phonehash))){
+	
+	ipcarg_t phonehash;
+	if (ERROR_OCCURRED(ip_initialize(client_connection))
+	    || ERROR_OCCURRED(REGISTER_ME(SERVICE_IP, &phonehash))) {
 		pm_destroy();
 		return ERROR_CODE;
 	}
-
+	
 	async_manager();
-
+	
 	pm_destroy();
 	return EOK;
Index: uspace/srv/net/il/ip/ip_module.h
===================================================================
--- uspace/srv/net/il/ip/ip_module.h	(revision 24ab58b348754b301fea741628d74d49704735d6)
+++ uspace/srv/net/il/ip/ip_module.h	(revision 14f1db0aaed5208d5e8340c816ca6e555f81f67e)
@@ -59,5 +59,5 @@
  *  @see IS_NET_IP_MESSAGE()
  */
-int ip_message(ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count);
+int ip_message_standalone(ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count);
 
 #endif
Index: uspace/srv/net/net/Makefile
===================================================================
--- uspace/srv/net/net/Makefile	(revision 24ab58b348754b301fea741628d74d49704735d6)
+++ uspace/srv/net/net/Makefile	(revision 14f1db0aaed5208d5e8340c816ca6e555f81f67e)
@@ -30,6 +30,6 @@
 USPACE_PREFIX = ../../..
 ROOT_PATH = $(USPACE_PREFIX)/..
-LIBS = $(LIBNETIF_PREFIX)/libnetif.a $(LIBNET_PREFIX)/libnet.a $(LIBSOCKET_PREFIX)/libsocket.a
-EXTRA_CFLAGS = -I$(LIBNETIF_PREFIX)/include -I$(LIBNET_PREFIX)/include -I$(LIBSOCKET_PREFIX)/include
+LIBS = $(LIBNET_PREFIX)/libnet.a $(LIBSOCKET_PREFIX)/libsocket.a
+EXTRA_CFLAGS = -I$(LIBNET_PREFIX)/include -I$(LIBSOCKET_PREFIX)/include
 
 COMMON_MAKEFILE = $(ROOT_PATH)/Makefile.common
Index: uspace/srv/net/net/net.c
===================================================================
--- uspace/srv/net/net/net.c	(revision 24ab58b348754b301fea741628d74d49704735d6)
+++ uspace/srv/net/net/net.c	(revision 14f1db0aaed5208d5e8340c816ca6e555f81f67e)
@@ -56,6 +56,6 @@
 #include <packet/packet.h>
 #include <il_messages.h>
+#include <netif_remote.h>
 #include <net_device.h>
-#include <netif_interface.h>
 #include <nil_interface.h>
 #include <net_interface.h>
@@ -461,5 +461,5 @@
 	int io = setting ? strtol(setting->value, NULL, 16) : 0;
 	
-	ERROR_PROPAGATE(netif_probe_req(netif->driver->phone, netif->id, irq, io));
+	ERROR_PROPAGATE(netif_probe_req_remote(netif->driver->phone, netif->id, irq, io));
 	
 	/* Network interface layer startup */
@@ -490,5 +490,5 @@
 	}
 	
-	ERROR_PROPAGATE(netif_start_req(netif->driver->phone, netif->id));
+	ERROR_PROPAGATE(netif_start_req_remote(netif->driver->phone, netif->id));
 	return EOK;
 }
Index: uspace/srv/net/net/net_standalone.c
===================================================================
--- uspace/srv/net/net/net_standalone.c	(revision 24ab58b348754b301fea741628d74d49704735d6)
+++ uspace/srv/net/net/net_standalone.c	(revision 14f1db0aaed5208d5e8340c816ca6e555f81f67e)
@@ -49,49 +49,60 @@
 /** Networking module global data.
  */
-extern net_globals_t	net_globals;
+extern net_globals_t net_globals;
 
-/** Initializes the networking module for the chosen subsystem build type.
- *  @param[in] client_connection The client connection processing function. The module skeleton propagates its own one.
- *  @returns EOK on success.
- *  @returns ENOMEM if there is not enough memory left.
+/** Initialize the networking module for the chosen subsystem build type.
+ *
+ *  @param[in] client_connection The client connection processing function.
+ *                               The module skeleton propagates its own one.
+ *
+ *  @return EOK on success.
+ *  @return ENOMEM if there is not enough memory left.
+ *
  */
 int net_initialize_build(async_client_conn_t client_connection){
 	ERROR_DECLARE;
-
-	task_id_t task_id;
-
-	task_id = spawn("/srv/ip");
-	if(! task_id){
+	
+	task_id_t task_id = spawn("/srv/ip");
+	if (!task_id)
 		return EINVAL;
-	}
-	ERROR_PROPAGATE(add_module(NULL, &net_globals.modules, IP_NAME, IP_FILENAME, SERVICE_IP, task_id, ip_connect_module));
-	if(! spawn("/srv/icmp")){
+	
+	ERROR_PROPAGATE(add_module(NULL, &net_globals.modules, IP_NAME,
+	    IP_FILENAME, SERVICE_IP, task_id, ip_connect_module));
+	
+	if (!spawn("/srv/icmp"))
 		return EINVAL;
-	}
-	if(! spawn("/srv/udp")){
+	
+	if (!spawn("/srv/udp"))
 		return EINVAL;
-	}
-	if(! spawn("/srv/tcp")){
+	
+	if (!spawn("/srv/tcp"))
 		return EINVAL;
-	}
+	
 	return EOK;
 }
 
-/** Processes the module message.
- *  Distributes the message to the right bundled module.
- *  @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.
- *  @returns EOK on success.
- *  @returns ENOTSUP if the message is not known.
- *  @returns Other error codes as defined for each bundled module message function.
+/** Process the module message.
+ *
+ * Distribute the message to the right module.
+ *
+ * @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 bundled module
+ *         message function.
+ *
  */
-int net_module_message(ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count){
-	if(IS_NET_PACKET_MESSAGE(call)){
+int net_module_message(ipc_callid_t callid, ipc_call_t *call,
+    ipc_call_t *answer, int *answer_count)
+{
+	if (IS_NET_PACKET_MESSAGE(call))
 		return packet_server_message(callid, call, answer, answer_count);
-	}else{
-		return net_message(callid, call, answer, answer_count);
-	}
+	
+	return net_message(callid, call, answer, answer_count);
 }
 
Index: uspace/srv/net/netif/lo/Makefile
===================================================================
--- uspace/srv/net/netif/lo/Makefile	(revision 24ab58b348754b301fea741628d74d49704735d6)
+++ uspace/srv/net/netif/lo/Makefile	(revision 14f1db0aaed5208d5e8340c816ca6e555f81f67e)
@@ -39,11 +39,9 @@
 -include $(CONFIG_MAKEFILE)
 
-ifeq ($(CONFIG_NETWORKING),modular)
-	BINARY = lo
+ifeq ($(CONFIG_NETIF_NIL_BUNDLE),y)
+	LIBS += $(USPACE_PREFIX)/srv/net/nil/nildummy/libnildummy.a
 endif
 
-ifeq ($(CONFIG_NETWORKING),module)
-	LIBRARY = liblo
-endif
+BINARY = lo
 
 SOURCES = \
Index: uspace/srv/net/netif/lo/lo.c
===================================================================
--- uspace/srv/net/netif/lo/lo.c	(revision 24ab58b348754b301fea741628d74d49704735d6)
+++ uspace/srv/net/netif/lo/lo.c	(revision 14f1db0aaed5208d5e8340c816ca6e555f81f67e)
@@ -51,6 +51,6 @@
 #include <nil_interface.h>
 #include <nil_messages.h>
-#include <netif.h>
-#include <netif_module.h>
+#include <netif_interface.h>
+#include <netif_local.h>
 
 /** Default hardware address.
@@ -76,5 +76,5 @@
  *  @returns EOK otherwise.
  */
-int change_state_message(device_ref device, device_state_t state);
+int change_state_message(netif_device_t * device, device_state_t state);
 
 /** Creates and returns the loopback network interface structure.
@@ -85,5 +85,5 @@
  *  @returns ENOMEM if there is not enough memory left.
  */
-int create(device_id_t device_id, device_ref * device);
+int create(device_id_t device_id, netif_device_t * * device);
 
 int netif_specific_message(ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count){
@@ -103,5 +103,5 @@
 	ERROR_DECLARE;
 
-	device_ref device;
+	netif_device_t * device;
 
 	if(! stats){
@@ -113,5 +113,5 @@
 }
 
-int change_state_message(device_ref device, device_state_t state)
+int change_state_message(netif_device_t * device, device_state_t state)
 {
 	if (device->state != state) {
@@ -127,11 +127,11 @@
 }
 
-int create(device_id_t device_id, device_ref * device){
+int create(device_id_t device_id, netif_device_t * * device){
 	int index;
 
-	if(device_map_count(&netif_globals.device_map) > 0){
+	if(netif_device_map_count(&netif_globals.device_map) > 0){
 		return EXDEV;
 	}else{
-		*device = (device_ref) malloc(sizeof(device_t));
+		*device = (netif_device_t *) malloc(sizeof(netif_device_t));
 		if(!(*device)){
 			return ENOMEM;
@@ -146,5 +146,5 @@
 		(** device).nil_phone = -1;
 		(** device).state = NETIF_STOPPED;
-		index = device_map_add(&netif_globals.device_map, (** device).device_id, * device);
+		index = netif_device_map_add(&netif_globals.device_map, (** device).device_id, * device);
 		if(index < 0){
 			free(*device);
@@ -166,5 +166,5 @@
 	ERROR_DECLARE;
 
-	device_ref device;
+	netif_device_t * device;
 
 	// create a new device
@@ -178,5 +178,5 @@
 	ERROR_DECLARE;
 
-	device_ref device;
+	netif_device_t * device;
 	size_t length;
 	packet_t next;
@@ -204,23 +204,19 @@
 }
 
-int netif_start_message(device_ref device){
+int netif_start_message(netif_device_t * device){
 	return change_state_message(device, NETIF_ACTIVE);
 }
 
-int netif_stop_message(device_ref device){
+int netif_stop_message(netif_device_t * device){
 	return change_state_message(device, NETIF_STOPPED);
 }
 
-#ifdef CONFIG_NETWORKING_modular
-
-#include <netif_standalone.h>
-
 /** 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)
+ * @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)
 {
 	/*
@@ -254,13 +250,4 @@
 }
 
-/** Starts the module.
- *
- *  @param argc The count of the command line arguments. Ignored parameter.
- *  @param argv The command line parameters. Ignored parameter.
- *
- *  @returns EOK on success.
- *  @returns Other error codes as defined for each specific module start function.
- *
- */
 int main(int argc, char *argv[])
 {
@@ -274,6 +261,4 @@
 }
 
-#endif /* CONFIG_NETWORKING_modular */
-
 /** @}
  */
Index: uspace/srv/net/nil/eth/Makefile
===================================================================
--- uspace/srv/net/nil/eth/Makefile	(revision 24ab58b348754b301fea741628d74d49704735d6)
+++ uspace/srv/net/nil/eth/Makefile	(revision 14f1db0aaed5208d5e8340c816ca6e555f81f67e)
@@ -29,7 +29,19 @@
 
 USPACE_PREFIX = ../../../..
-LIBS = $(LIBNETIF_PREFIX)/libnetif.a $(LIBNET_PREFIX)/libnet.a $(LIBSOCKET_PREFIX)/libsocket.a
-EXTRA_CFLAGS = -I$(LIBNETIF_PREFIX)/include -I$(LIBNET_PREFIX)/include -I$(LIBSOCKET_PREFIX)/include
-BINARY = eth
+ROOT_PATH = $(USPACE_PREFIX)/..
+LIBS = $(LIBNET_PREFIX)/libnet.a $(LIBSOCKET_PREFIX)/libsocket.a
+EXTRA_CFLAGS = -I$(LIBNET_PREFIX)/include -I$(LIBSOCKET_PREFIX)/include
+
+COMMON_MAKEFILE = $(ROOT_PATH)/Makefile.common
+CONFIG_MAKEFILE = $(ROOT_PATH)/Makefile.config
+
+-include $(COMMON_MAKEFILE)
+-include $(CONFIG_MAKEFILE)
+
+ifeq ($(CONFIG_NETIF_NIL_BUNDLE),y)
+	LIBRARY = libeth
+else
+	BINARY = eth
+endif
 
 SOURCES = \
Index: uspace/srv/net/nil/eth/eth.c
===================================================================
--- uspace/srv/net/nil/eth/eth.c	(revision 24ab58b348754b301fea741628d74d49704735d6)
+++ uspace/srv/net/nil/eth/eth.c	(revision 14f1db0aaed5208d5e8340c816ca6e555f81f67e)
@@ -60,5 +60,6 @@
 #include <adt/measured_strings.h>
 #include <packet/packet_client.h>
-#include <nil_module.h>
+#include <packet_remote.h>
+#include <nil_local.h>
 
 #include "eth.h"
@@ -271,5 +272,5 @@
 INT_MAP_IMPLEMENT(eth_protos, eth_proto_t)
 
-int nil_device_state_msg(int nil_phone, device_id_t device_id, int state){
+int nil_device_state_msg_local(int nil_phone, device_id_t device_id, int state){
 	int index;
 	eth_proto_ref proto;
@@ -475,5 +476,5 @@
 }
 
-int nil_received_msg(int nil_phone, device_id_t device_id, packet_t packet, services_t target){
+int nil_received_msg_local(int nil_phone, device_id_t device_id, packet_t packet, services_t target){
 	eth_proto_ref proto;
 	packet_t next;
@@ -497,5 +498,5 @@
 		}else{
 			// drop invalid/unknown
-			pq_release(eth_globals.net_phone, packet_get_id(packet));
+			pq_release_remote(eth_globals.net_phone, packet_get_id(packet));
 		}
 		packet = next;
@@ -681,5 +682,5 @@
 	ethertype = htons(protocol_map(SERVICE_ETHERNET, sender));
 	if(! ethertype){
-		pq_release(eth_globals.net_phone, packet_get_id(packet));
+		pq_release_remote(eth_globals.net_phone, packet_get_id(packet));
 		return EINVAL;
 	}
@@ -699,5 +700,5 @@
 				packet = tmp;
 			}
-			pq_release(eth_globals.net_phone, packet_get_id(next));
+			pq_release_remote(eth_globals.net_phone, packet_get_id(next));
 			next = tmp;
 		}else{
@@ -713,5 +714,5 @@
 }
 
-int nil_message(const char *name, ipc_callid_t callid, ipc_call_t *call,
+int nil_message_standalone(const char *name, ipc_callid_t callid, ipc_call_t *call,
     ipc_call_t *answer, int *answer_count)
 {
@@ -733,5 +734,5 @@
 			    IPC_GET_SERVICE(call), IPC_GET_MTU(call));
 		case NET_NIL_SEND:
-			ERROR_PROPAGATE(packet_translate(eth_globals.net_phone, &packet,
+			ERROR_PROPAGATE(packet_translate_remote(eth_globals.net_phone, &packet,
 			    IPC_GET_PACKET(call)));
 			return eth_send_message(IPC_GET_DEVICE(call), packet,
@@ -771,10 +772,10 @@
 		switch(IPC_GET_METHOD(*icall)){
 			case NET_NIL_DEVICE_STATE:
-				nil_device_state_msg(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:
-				if(! ERROR_OCCURRED(packet_translate(eth_globals.net_phone, &packet, IPC_GET_PACKET(icall)))){
-					ERROR_CODE = nil_received_msg(0, IPC_GET_DEVICE(icall), packet, 0);
+				if(! ERROR_OCCURRED(packet_translate_remote(eth_globals.net_phone, &packet, IPC_GET_PACKET(icall)))){
+					ERROR_CODE = nil_received_msg_local(0, IPC_GET_DEVICE(icall), packet, 0);
 				}
 				ipc_answer_0(iid, (ipcarg_t) ERROR_CODE);
@@ -787,15 +788,13 @@
 }
 
-#ifdef CONFIG_NETWORKING_modular
-
-#include <nil_standalone.h>
+#ifndef CONFIG_NETIF_NIL_BUNDLE
 
 /** Default thread for new connections.
  *
- *  @param[in] iid The initial message identifier.
- *  @param[in] icall The initial message call structure.
+ * @param[in] iid The initial message identifier.
+ * @param[in] icall The initial message call structure.
  *
  */
-static void nil_client_connection(ipc_callid_t iid, ipc_call_t * icall)
+static void nil_client_connection(ipc_callid_t iid, ipc_call_t *icall)
 {
 	/*
@@ -817,5 +816,5 @@
 		
 		/* Process the message */
-		int res = nil_module_message(NAME, callid, &call, &answer,
+		int res = nil_module_message_standalone(NAME, callid, &call, &answer,
 		    &answer_count);
 		
@@ -829,13 +828,4 @@
 }
 
-/** Starts the module.
- *
- *  @param argc The count of the command line arguments. Ignored parameter.
- *  @param argv The command line parameters. Ignored parameter.
- *
- *  @returns EOK on success.
- *  @returns Other error codes as defined for each specific module start function.
- *
- */
 int main(int argc, char *argv[])
 {
@@ -843,5 +833,5 @@
 	
 	/* Start the module */
-	if (ERROR_OCCURRED(nil_module_start(nil_client_connection)))
+	if (ERROR_OCCURRED(nil_module_start_standalone(nil_client_connection)))
 		return ERROR_CODE;
 	
@@ -849,5 +839,5 @@
 }
 
-#endif /* CONFIG_NETWORKING_modular */
+#endif /* CONFIG_NETIF_NIL_BUNDLE */
 
 /** @}
Index: uspace/srv/net/nil/eth/eth_module.c
===================================================================
--- uspace/srv/net/nil/eth/eth_module.c	(revision 24ab58b348754b301fea741628d74d49704735d6)
+++ uspace/srv/net/nil/eth/eth_module.c	(revision 14f1db0aaed5208d5e8340c816ca6e555f81f67e)
@@ -46,6 +46,5 @@
 #include <net_interface.h>
 #include <packet/packet.h>
-#include <nil_module.h>
-#include <nil_standalone.h>
+#include <nil_local.h>
 
 #include "eth.h"
@@ -59,21 +58,21 @@
  *  @returns Other error codes as defined for the REGISTER_ME() macro function.
  */
-int nil_module_start(async_client_conn_t client_connection){
+int nil_module_start_standalone(async_client_conn_t client_connection)
+{
 	ERROR_DECLARE;
-
+	
+	async_set_client_connection(client_connection);
+	int net_phone = net_connect_module(SERVICE_NETWORKING);
+	ERROR_PROPAGATE(pm_init());
+	
 	ipcarg_t phonehash;
-	int net_phone;
-
-	async_set_client_connection(client_connection);
-	net_phone = net_connect_module(SERVICE_NETWORKING);
-	ERROR_PROPAGATE(pm_init());
-	if(ERROR_OCCURRED(nil_initialize(net_phone))
-		|| ERROR_OCCURRED(REGISTER_ME(SERVICE_ETHERNET, &phonehash))){
+	if (ERROR_OCCURRED(nil_initialize(net_phone))
+	    || ERROR_OCCURRED(REGISTER_ME(SERVICE_ETHERNET, &phonehash))) {
 		pm_destroy();
 		return ERROR_CODE;
 	}
-
+	
 	async_manager();
-
+	
 	pm_destroy();
 	return EOK;
@@ -95,8 +94,8 @@
  *
  */
-int nil_module_message(const char *name, ipc_callid_t callid, ipc_call_t *call,
+int nil_module_message_standalone(const char *name, ipc_callid_t callid, ipc_call_t *call,
     ipc_call_t *answer, int *answer_count)
 {
-	return nil_message(name, callid, call, answer, answer_count);
+	return nil_message_standalone(name, callid, call, answer, answer_count);
 }
 
Index: uspace/srv/net/nil/nildummy/Makefile
===================================================================
--- uspace/srv/net/nil/nildummy/Makefile	(revision 24ab58b348754b301fea741628d74d49704735d6)
+++ uspace/srv/net/nil/nildummy/Makefile	(revision 14f1db0aaed5208d5e8340c816ca6e555f81f67e)
@@ -29,7 +29,19 @@
 
 USPACE_PREFIX = ../../../..
-LIBS = $(LIBNETIF_PREFIX)/libnetif.a $(LIBNET_PREFIX)/libnet.a $(LIBSOCKET_PREFIX)/libsocket.a
-EXTRA_CFLAGS = -I$(LIBNETIF_PREFIX)/include -I$(LIBNET_PREFIX)/include -I$(LIBSOCKET_PREFIX)/include
-BINARY = nildummy
+ROOT_PATH = $(USPACE_PREFIX)/..
+LIBS = $(LIBNET_PREFIX)/libnet.a $(LIBSOCKET_PREFIX)/libsocket.a
+EXTRA_CFLAGS = -I$(LIBNET_PREFIX)/include -I$(LIBSOCKET_PREFIX)/include
+
+COMMON_MAKEFILE = $(ROOT_PATH)/Makefile.common
+CONFIG_MAKEFILE = $(ROOT_PATH)/Makefile.config
+
+-include $(COMMON_MAKEFILE)
+-include $(CONFIG_MAKEFILE)
+
+ifeq ($(CONFIG_NETIF_NIL_BUNDLE),y)
+	LIBRARY = libnildummy
+else
+	BINARY = nildummy
+endif
 
 SOURCES = \
Index: uspace/srv/net/nil/nildummy/nildummy.c
===================================================================
--- uspace/srv/net/nil/nildummy/nildummy.c	(revision 24ab58b348754b301fea741628d74d49704735d6)
+++ uspace/srv/net/nil/nildummy/nildummy.c	(revision 14f1db0aaed5208d5e8340c816ca6e555f81f67e)
@@ -28,10 +28,10 @@
 
 /** @addtogroup nildummy
- *  @{
+ * @{
  */
 
 /** @file
- *  Dummy network interface layer module implementation.
- *  @see nildummy.h
+ * Dummy network interface layer module implementation.
+ * @see nildummy.h
  */
 
@@ -41,5 +41,4 @@
 #include <stdio.h>
 #include <str.h>
-
 #include <ipc/ipc.h>
 #include <ipc/services.h>
@@ -54,113 +53,106 @@
 #include <adt/measured_strings.h>
 #include <packet/packet.h>
-#include <nil_module.h>
+#include <packet_remote.h>
+#include <nil_local.h>
 
 #include "nildummy.h"
 
 /** The module name.
+ *
  */
 #define NAME  "nildummy"
 
 /** Default maximum transmission unit.
- */
-#define NET_DEFAULT_MTU	1500
+ *
+ */
+#define NET_DEFAULT_MTU  1500
 
 /** Network interface layer module global data.
- */
-nildummy_globals_t	nildummy_globals;
-
-/** @name Message processing functions
- */
-/*@{*/
-
-/** Processes IPC messages from the registered device driver modules in an infinite loop.
- *  @param[in] iid The message identifier.
- *  @param[in,out] icall The message parameters.
- */
-void nildummy_receiver(ipc_callid_t iid, ipc_call_t * icall);
-
-/** Registers new device or updates the MTU of an existing one.
- *  Determines the device local hardware address.
- *  @param[in] device_id The new device identifier.
- *  @param[in] service The device driver service.
- *  @param[in] mtu The device maximum transmission unit.
- *  @returns EOK on success.
- *  @returns EEXIST if the device with the different service exists.
- *  @returns ENOMEM if there is not enough memory left.
- *  @returns Other error codes as defined for the netif_bind_service() function.
- *  @returns Other error codes as defined for the netif_get_addr_req() function.
- */
-int nildummy_device_message(device_id_t device_id, services_t service, size_t mtu);
-
-/** Returns the device packet dimensions for sending.
- *  @param[in] device_id The device identifier.
- *  @param[out] addr_len The minimum reserved address length.
- *  @param[out] prefix The minimum reserved prefix size.
- *  @param[out] content The maximum content size.
- *  @param[out] suffix The minimum reserved suffix size.
- *  @returns EOK on success.
- *  @returns EBADMEM if either one of the parameters is NULL.
- *  @returns ENOENT if there is no such device.
- */
-int nildummy_packet_space_message(device_id_t device_id, size_t * addr_len, size_t * prefix, size_t * content, size_t * suffix);
-
-/** Registers receiving module service.
- *  Passes received packets for this service.
- *  @param[in] service The module service.
- *  @param[in] phone The service phone.
- *  @returns EOK on success.
- *  @returns ENOENT if the service is not known.
- *  @returns ENOMEM if there is not enough memory left.
- */
-int nildummy_register_message(services_t service, int phone);
-
-/** Sends the packet queue.
- *  @param[in] device_id The device identifier.
- *  @param[in] packet The packet queue.
- *  @param[in] sender The sending module service.
- *  @returns EOK on success.
- *  @returns ENOENT if there no such device.
- *  @returns EINVAL if the service parameter is not known.
- */
-int nildummy_send_message(device_id_t device_id, packet_t packet, services_t sender);
-
-/** Returns the device hardware address.
- *  @param[in] device_id The device identifier.
- *  @param[out] address The device hardware address.
- *  @returns EOK on success.
- *  @returns EBADMEM if the address parameter is NULL.
- *  @returns ENOENT if there no such device.
- */
-int nildummy_addr_message(device_id_t device_id, measured_string_ref * address);
-
-/*@}*/
-
-DEVICE_MAP_IMPLEMENT(nildummy_devices, nildummy_device_t)
-
-int nil_device_state_msg(int nil_phone, device_id_t device_id, int state){
+ *
+ */
+nildummy_globals_t nildummy_globals;
+
+DEVICE_MAP_IMPLEMENT(nildummy_devices, nildummy_device_t);
+
+int nil_device_state_msg_local(int nil_phone, device_id_t device_id, int state)
+{
 	fibril_rwlock_read_lock(&nildummy_globals.protos_lock);
-	if(nildummy_globals.proto.phone){
-		il_device_state_msg(nildummy_globals.proto.phone, device_id, state, nildummy_globals.proto.service);
-	}
+	
+	if (nildummy_globals.proto.phone)
+		il_device_state_msg(nildummy_globals.proto.phone, device_id, state,
+		    nildummy_globals.proto.service);
+	
 	fibril_rwlock_read_unlock(&nildummy_globals.protos_lock);
-	return EOK;
-}
-
-int nil_initialize(int net_phone){
+	
+	return EOK;
+}
+
+int nil_initialize(int net_phone)
+{
 	ERROR_DECLARE;
-
+	
 	fibril_rwlock_initialize(&nildummy_globals.devices_lock);
 	fibril_rwlock_initialize(&nildummy_globals.protos_lock);
 	fibril_rwlock_write_lock(&nildummy_globals.devices_lock);
 	fibril_rwlock_write_lock(&nildummy_globals.protos_lock);
+	
 	nildummy_globals.net_phone = net_phone;
 	nildummy_globals.proto.phone = 0;
 	ERROR_PROPAGATE(nildummy_devices_initialize(&nildummy_globals.devices));
+	
 	fibril_rwlock_write_unlock(&nildummy_globals.protos_lock);
 	fibril_rwlock_write_unlock(&nildummy_globals.devices_lock);
-	return EOK;
-}
-
-int nildummy_device_message(device_id_t device_id, services_t service, size_t mtu){
+	
+	return EOK;
+}
+
+/** Process IPC messages from the registered device driver modules in an infinite loop.
+ *
+ * @param[in]     iid   The message identifier.
+ * @param[in,out] icall The message parameters.
+ *
+ */
+static void nildummy_receiver(ipc_callid_t iid, ipc_call_t * icall){
+	ERROR_DECLARE;
+
+	packet_t packet;
+
+	while(true){
+		switch(IPC_GET_METHOD(*icall)){
+			case NET_NIL_DEVICE_STATE:
+				ERROR_CODE = nil_device_state_msg_local(0, IPC_GET_DEVICE(icall), IPC_GET_STATE(icall));
+				ipc_answer_0(iid, (ipcarg_t) ERROR_CODE);
+				break;
+			case NET_NIL_RECEIVED:
+				if(! ERROR_OCCURRED(packet_translate_remote(nildummy_globals.net_phone, &packet, IPC_GET_PACKET(icall)))){
+					ERROR_CODE = nil_received_msg_local(0, IPC_GET_DEVICE(icall), packet, 0);
+				}
+				ipc_answer_0(iid, (ipcarg_t) ERROR_CODE);
+				break;
+			default:
+				ipc_answer_0(iid, (ipcarg_t) ENOTSUP);
+		}
+		iid = async_get_call(icall);
+	}
+}
+
+/** Register new device or updates the MTU of an existing one.
+ *
+ * Determine the device local hardware address.
+ *
+ * @param[in] device_id The new device identifier.
+ * @param[in] service   The device driver service.
+ * @param[in] mtu       The device maximum transmission unit.
+ *
+ * @returns EOK on success.
+ * @returns EEXIST if the device with the different service exists.
+ * @returns ENOMEM if there is not enough memory left.
+ * @returns Other error codes as defined for the netif_bind_service() function.
+ * @returns Other error codes as defined for the netif_get_addr_req() function.
+ *
+ */
+static int nildummy_device_message(device_id_t device_id, services_t service,
+    size_t mtu)
+{
 	ERROR_DECLARE;
 
@@ -235,5 +227,17 @@
 }
 
-int nildummy_addr_message(device_id_t device_id, measured_string_ref * address){
+/** Return the device hardware address.
+ *
+ * @param[in]  device_id The device identifier.
+ * @param[out] address   The device hardware address.
+ *
+ * @return EOK on success.
+ * @return EBADMEM if the address parameter is NULL.
+ * @return ENOENT if there no such device.
+ *
+ */
+static int nildummy_addr_message(device_id_t device_id,
+    measured_string_ref *address)
+{
 	nildummy_device_ref device;
 
@@ -252,5 +256,20 @@
 }
 
-int nildummy_packet_space_message(device_id_t device_id, size_t * addr_len, size_t * prefix, size_t * content, size_t * suffix){
+/** Return the device packet dimensions for sending.
+ *
+ * @param[in]  device_id The device identifier.
+ * @param[out] addr_len  The minimum reserved address length.
+ * @param[out] prefix    The minimum reserved prefix size.
+ * @param[out] content   The maximum content size.
+ * @param[out] suffix    The minimum reserved suffix size.
+ *
+ * @return EOK on success.
+ * @return EBADMEM if either one of the parameters is NULL.
+ * @return ENOENT if there is no such device.
+ *
+ */
+static int nildummy_packet_space_message(device_id_t device_id,
+    size_t *addr_len, size_t *prefix, size_t *content, size_t *suffix)
+{
 	nildummy_device_ref device;
 
@@ -272,5 +291,5 @@
 }
 
-int nil_received_msg(int nil_phone, device_id_t device_id, packet_t packet, services_t target){
+int nil_received_msg_local(int nil_phone, device_id_t device_id, packet_t packet, services_t target){
 	packet_t next;
 
@@ -287,5 +306,18 @@
 }
 
-int nildummy_register_message(services_t service, int phone){
+/** Register receiving module service.
+ *
+ * Pass received packets for this service.
+ *
+ * @param[in] service The module service.
+ * @param[in] phone   The service phone.
+ *
+ * @return EOK on success.
+ * @return ENOENT if the service is not known.
+ * @return ENOMEM if there is not enough memory left.
+ *
+ */
+static int nildummy_register_message(services_t service, int phone)
+{
 	fibril_rwlock_write_lock(&nildummy_globals.protos_lock);
 	nildummy_globals.proto.service = service;
@@ -299,5 +331,18 @@
 }
 
-int nildummy_send_message(device_id_t device_id, packet_t packet, services_t sender){
+/** Send the packet queue.
+ *
+ * @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 ENOENT if there no such device.
+ * @return EINVAL if the service parameter is not known.
+ *
+ */
+static int nildummy_send_message(device_id_t device_id, packet_t packet,
+    services_t sender)
+{
 	nildummy_device_ref device;
 
@@ -316,5 +361,5 @@
 }
 
-int nil_message(const char *name, ipc_callid_t callid, ipc_call_t *call,
+int nil_message_standalone(const char *name, ipc_callid_t callid, ipc_call_t *call,
     ipc_call_t *answer, int *answer_count)
 {
@@ -336,5 +381,5 @@
 			    IPC_GET_SERVICE(call), IPC_GET_MTU(call));
 		case NET_NIL_SEND:
-			ERROR_PROPAGATE(packet_translate(nildummy_globals.net_phone,
+			ERROR_PROPAGATE(packet_translate_remote(nildummy_globals.net_phone,
 			    &packet, IPC_GET_PACKET(call)));
 			return nildummy_send_message(IPC_GET_DEVICE(call), packet,
@@ -353,4 +398,8 @@
 			    &address));
 			return measured_strings_reply(address, 1);
+		case NET_NIL_BROADCAST_ADDR:
+			ERROR_PROPAGATE(nildummy_addr_message(IPC_GET_DEVICE(call),
+			    &address));
+			return measured_strings_reply(address, 1);
 		case IPC_M_CONNECT_TO_ME:
 			return nildummy_register_message(NIL_GET_PROTO(call),
@@ -361,40 +410,13 @@
 }
 
-void nildummy_receiver(ipc_callid_t iid, ipc_call_t * icall){
-	ERROR_DECLARE;
-
-	packet_t packet;
-
-	while(true){
-//		printf("message %d - %d\n", IPC_GET_METHOD(*icall), NET_NIL_FIRST);
-		switch(IPC_GET_METHOD(*icall)){
-			case NET_NIL_DEVICE_STATE:
-				ERROR_CODE = nil_device_state_msg(0, IPC_GET_DEVICE(icall), IPC_GET_STATE(icall));
-				ipc_answer_0(iid, (ipcarg_t) ERROR_CODE);
-				break;
-			case NET_NIL_RECEIVED:
-				if(! ERROR_OCCURRED(packet_translate(nildummy_globals.net_phone, &packet, IPC_GET_PACKET(icall)))){
-					ERROR_CODE = nil_received_msg(0, IPC_GET_DEVICE(icall), packet, 0);
-				}
-				ipc_answer_0(iid, (ipcarg_t) ERROR_CODE);
-				break;
-			default:
-				ipc_answer_0(iid, (ipcarg_t) ENOTSUP);
-		}
-		iid = async_get_call(icall);
-	}
-}
-
-#ifdef CONFIG_NETWORKING_modular
-
-#include <nil_standalone.h>
+#ifndef CONFIG_NETIF_NIL_BUNDLE
 
 /** Default thread for new connections.
  *
- *  @param[in] iid The initial message identifier.
- *  @param[in] icall The initial message call structure.
- *
- */
-static void nil_client_connection(ipc_callid_t iid, ipc_call_t * icall)
+ * @param[in] iid   The initial message identifier.
+ * @param[in] icall The initial message call structure.
+ *
+ */
+static void nil_client_connection(ipc_callid_t iid, ipc_call_t *icall)
 {
 	/*
@@ -416,5 +438,5 @@
 		
 		/* Process the message */
-		int res = nil_module_message(NAME, callid, &call, &answer,
+		int res = nil_module_message_standalone(NAME, callid, &call, &answer,
 		    &answer_count);
 		
@@ -428,13 +450,4 @@
 }
 
-/** Starts the module.
- *
- *  @param argc The count of the command line arguments. Ignored parameter.
- *  @param argv The command line parameters. Ignored parameter.
- *
- *  @returns EOK on success.
- *  @returns Other error codes as defined for each specific module start function.
- *
- */
 int main(int argc, char *argv[])
 {
@@ -442,5 +455,5 @@
 	
 	/* Start the module */
-	if (ERROR_OCCURRED(nil_module_start(nil_client_connection)))
+	if (ERROR_OCCURRED(nil_module_start_standalone(nil_client_connection)))
 		return ERROR_CODE;
 	
@@ -448,5 +461,5 @@
 }
 
-#endif /* CONFIG_NETWORKING_modular */
+#endif /* CONFIG_NETIF_NIL_BUNDLE */
 
 /** @}
Index: uspace/srv/net/nil/nildummy/nildummy_module.c
===================================================================
--- uspace/srv/net/nil/nildummy/nildummy_module.c	(revision 24ab58b348754b301fea741628d74d49704735d6)
+++ uspace/srv/net/nil/nildummy/nildummy_module.c	(revision 14f1db0aaed5208d5e8340c816ca6e555f81f67e)
@@ -46,6 +46,5 @@
 #include <net_interface.h>
 #include <packet/packet.h>
-#include <nil_module.h>
-#include <nil_standalone.h>
+#include <nil_local.h>
 
 #include "nildummy.h"
@@ -67,5 +66,5 @@
  *
  */
-int nil_module_start(async_client_conn_t client_connection)
+int nil_module_start_standalone(async_client_conn_t client_connection)
 {
 	ERROR_DECLARE;
@@ -103,8 +102,8 @@
  *
  */
-int nil_module_message(const char *name, ipc_callid_t callid,
+int nil_module_message_standalone(const char *name, ipc_callid_t callid,
     ipc_call_t *call, ipc_call_t *answer, int *answer_count)
 {
-	return nil_message(name, callid, call, answer, answer_count);
+	return nil_message_standalone(name, callid, call, answer, answer_count);
 }
 
Index: uspace/srv/net/tl/icmp/icmp.c
===================================================================
--- uspace/srv/net/tl/icmp/icmp.c	(revision 24ab58b348754b301fea741628d74d49704735d6)
+++ uspace/srv/net/tl/icmp/icmp.c	(revision 14f1db0aaed5208d5e8340c816ca6e555f81f67e)
@@ -51,4 +51,5 @@
 #include <net_modules.h>
 #include <packet/packet_client.h>
+#include <packet_remote.h>
 #include <net_byteorder.h>
 #include <net_checksum.h>
@@ -67,4 +68,6 @@
 #include <socket_errno.h>
 #include <tl_messages.h>
+#include <tl_interface.h>
+#include <tl_local.h>
 #include <icmp_messages.h>
 #include <icmp_header.h>
@@ -288,5 +291,5 @@
 	// TODO do not ask all the time
 	ERROR_PROPAGATE(ip_packet_size_req(icmp_globals.ip_phone, -1, &icmp_globals.packet_dimension));
-	packet = packet_get_4(icmp_globals.net_phone, size, icmp_globals.packet_dimension.addr_len, ICMP_HEADER_SIZE + icmp_globals.packet_dimension.prefix, icmp_globals.packet_dimension.suffix);
+	packet = packet_get_4_remote(icmp_globals.net_phone, size, icmp_globals.packet_dimension.addr_len, ICMP_HEADER_SIZE + icmp_globals.packet_dimension.prefix, icmp_globals.packet_dimension.suffix);
 	if(! packet){
 		return ENOMEM;
@@ -626,5 +629,5 @@
 	// compute the reply key
 	reply_key = ICMP_GET_REPLY_KEY(header->un.echo.identifier, header->un.echo.sequence_number);
-	pq_release(icmp_globals.net_phone, packet_get_id(packet));
+	pq_release_remote(icmp_globals.net_phone, packet_get_id(packet));
 	// lock the globals
 	fibril_rwlock_write_lock(&icmp_globals.lock);
@@ -641,5 +644,5 @@
 }
 
-int icmp_message(ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count){
+int icmp_message_standalone(ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count){
 	ERROR_DECLARE;
 
@@ -649,5 +652,5 @@
 	switch(IPC_GET_METHOD(*call)){
 		case NET_TL_RECEIVED:
-			if(! ERROR_OCCURRED(packet_translate(icmp_globals.net_phone, &packet, IPC_GET_PACKET(call)))){
+			if(! ERROR_OCCURRED(packet_translate_remote(icmp_globals.net_phone, &packet, IPC_GET_PACKET(call)))){
 				ERROR_CODE = icmp_received_msg(IPC_GET_DEVICE(call), packet, SERVICE_ICMP, IPC_GET_ERROR(call));
 			}
@@ -759,20 +762,20 @@
 	switch(IPC_GET_METHOD(*call)){
 		case NET_ICMP_DEST_UNREACH:
-			if(! ERROR_OCCURRED(packet_translate(icmp_globals.net_phone, &packet, IPC_GET_PACKET(call)))){
+			if(! ERROR_OCCURRED(packet_translate_remote(icmp_globals.net_phone, &packet, IPC_GET_PACKET(call)))){
 				ERROR_CODE = icmp_destination_unreachable_msg(0, ICMP_GET_CODE(call), ICMP_GET_MTU(call), packet);
 			}
 			return ERROR_CODE;
 		case NET_ICMP_SOURCE_QUENCH:
-			if(! ERROR_OCCURRED(packet_translate(icmp_globals.net_phone, &packet, IPC_GET_PACKET(call)))){
+			if(! ERROR_OCCURRED(packet_translate_remote(icmp_globals.net_phone, &packet, IPC_GET_PACKET(call)))){
 				ERROR_CODE = icmp_source_quench_msg(0, packet);
 			}
 			return ERROR_CODE;
 		case NET_ICMP_TIME_EXCEEDED:
-			if(! ERROR_OCCURRED(packet_translate(icmp_globals.net_phone, &packet, IPC_GET_PACKET(call)))){
+			if(! ERROR_OCCURRED(packet_translate_remote(icmp_globals.net_phone, &packet, IPC_GET_PACKET(call)))){
 				ERROR_CODE = icmp_time_exceeded_msg(0, ICMP_GET_CODE(call), packet);
 			}
 			return ERROR_CODE;
 		case NET_ICMP_PARAMETERPROB:
-			if(! ERROR_OCCURRED(packet_translate(icmp_globals.net_phone, &packet, IPC_GET_PACKET(call)))){
+			if(! ERROR_OCCURRED(packet_translate_remote(icmp_globals.net_phone, &packet, IPC_GET_PACKET(call)))){
 				ERROR_CODE = icmp_parameter_problem_msg(0, ICMP_GET_CODE(call), ICMP_GET_POINTER(call), packet);
 			}
@@ -784,5 +787,5 @@
 
 int icmp_release_and_return(packet_t packet, int result){
-	pq_release(icmp_globals.net_phone, packet_get_id(packet));
+	pq_release_remote(icmp_globals.net_phone, packet_get_id(packet));
 	return result;
 }
@@ -819,8 +822,4 @@
 }
 
-#ifdef CONFIG_NETWORKING_modular
-
-#include <tl_standalone.h>
-
 /** Default thread for new connections.
  *
@@ -849,5 +848,6 @@
 		
 		/* Process the message */
-		int res = tl_module_message(callid, &call, &answer, &answer_count);
+		int res = tl_module_message_standalone(callid, &call, &answer,
+		    &answer_count);
 		
 		/* End if said to either by the message or the processing result */
@@ -874,5 +874,5 @@
 	
 	/* Start the module */
-	if (ERROR_OCCURRED(tl_module_start(tl_client_connection)))
+	if (ERROR_OCCURRED(tl_module_start_standalone(tl_client_connection)))
 		return ERROR_CODE;
 	
@@ -880,6 +880,4 @@
 }
 
-#endif /* CONFIG_NETWORKING_modular */
-
 /** @}
  */
Index: uspace/srv/net/tl/icmp/icmp_module.c
===================================================================
--- uspace/srv/net/tl/icmp/icmp_module.c	(revision 24ab58b348754b301fea741628d74d49704735d6)
+++ uspace/srv/net/tl/icmp/icmp_module.c	(revision 14f1db0aaed5208d5e8340c816ca6e555f81f67e)
@@ -47,5 +47,5 @@
 #include <packet/packet.h>
 #include <net_interface.h>
-#include <tl_standalone.h>
+#include <tl_local.h>
 
 #include "icmp.h"
@@ -63,5 +63,5 @@
  *  @returns Other error codes as defined for the REGISTER_ME() macro function.
  */
-int tl_module_start(async_client_conn_t client_connection){
+int tl_module_start_standalone(async_client_conn_t client_connection){
 	ERROR_DECLARE;
 
@@ -94,6 +94,6 @@
  *  @returns Other error codes as defined for the icmp_message() function.
  */
-int tl_module_message(ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count){
-	return icmp_message(callid, call, answer, answer_count);
+int tl_module_message_standalone(ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count){
+	return icmp_message_standalone(callid, call, answer, answer_count);
 }
 
Index: uspace/srv/net/tl/icmp/icmp_module.h
===================================================================
--- uspace/srv/net/tl/icmp/icmp_module.h	(revision 24ab58b348754b301fea741628d74d49704735d6)
+++ uspace/srv/net/tl/icmp/icmp_module.h	(revision 14f1db0aaed5208d5e8340c816ca6e555f81f67e)
@@ -59,5 +59,5 @@
  *  @see IS_NET_ICMP_MESSAGE()
  */
-int icmp_message(ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count);
+int icmp_message_standalone(ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count);
 
 #endif
Index: uspace/srv/net/tl/tcp/tcp.c
===================================================================
--- uspace/srv/net/tl/tcp/tcp.c	(revision 24ab58b348754b301fea741628d74d49704735d6)
+++ uspace/srv/net/tl/tcp/tcp.c	(revision 14f1db0aaed5208d5e8340c816ca6e555f81f67e)
@@ -51,4 +51,5 @@
 #include <adt/dynamic_fifo.h>
 #include <packet/packet_client.h>
+#include <packet_remote.h>
 #include <net_checksum.h>
 #include <in.h>
@@ -68,4 +69,6 @@
 #include <tl_common.h>
 #include <tl_messages.h>
+#include <tl_local.h>
+#include <tl_interface.h>
 
 #include "tcp.h"
@@ -421,5 +424,5 @@
 			break;
 		default:
-			pq_release(tcp_globals.net_phone, packet_get_id(packet));
+			pq_release_remote(tcp_globals.net_phone, packet_get_id(packet));
 	}
 
@@ -473,5 +476,5 @@
 			// release the acknowledged packets
 			next_packet = pq_next(packet);
-			pq_release(tcp_globals.net_phone, packet_get_id(packet));
+			pq_release_remote(tcp_globals.net_phone, packet_get_id(packet));
 			packet = next_packet;
 			offset -= length;
@@ -517,5 +520,5 @@
 			next_packet = pq_next(next_packet);
 			pq_insert_after(tmp_packet, next_packet);
-			pq_release(tcp_globals.net_phone, packet_get_id(tmp_packet));
+			pq_release_remote(tcp_globals.net_phone, packet_get_id(tmp_packet));
 		}
 		assert(new_sequence_number + total_length == socket_data->next_incoming + socket_data->window);
@@ -548,5 +551,5 @@
 					socket_data->incoming = next_packet;
 				}
-				pq_release(tcp_globals.net_phone, packet_get_id(packet));
+				pq_release_remote(tcp_globals.net_phone, packet_get_id(packet));
 				packet = next_packet;
 				continue;
@@ -568,5 +571,5 @@
 				if(length <= 0){
 					// remove the empty packet
-					pq_release(tcp_globals.net_phone, packet_get_id(packet));
+					pq_release_remote(tcp_globals.net_phone, packet_get_id(packet));
 					packet = next_packet;
 					continue;
@@ -595,5 +598,5 @@
 				}
 				// remove the duplicit or corrupted packet
-				pq_release(tcp_globals.net_phone, packet_get_id(packet));
+				pq_release_remote(tcp_globals.net_phone, packet_get_id(packet));
 				packet = next_packet;
 				continue;
@@ -617,6 +620,6 @@
 		if(ERROR_OCCURRED(pq_add(&socket_data->incoming, packet, new_sequence_number, length))){
 			// remove the corrupted packets
-			pq_release(tcp_globals.net_phone, packet_get_id(packet));
-			pq_release(tcp_globals.net_phone, packet_get_id(next_packet));
+			pq_release_remote(tcp_globals.net_phone, packet_get_id(packet));
+			pq_release_remote(tcp_globals.net_phone, packet_get_id(next_packet));
 		}else{
 			while(next_packet){
@@ -626,5 +629,5 @@
 				if(ERROR_OCCURRED(pq_set_order(next_packet, new_sequence_number, length))
 					|| ERROR_OCCURRED(pq_insert_after(packet, next_packet))){
-					pq_release(tcp_globals.net_phone, packet_get_id(next_packet));
+					pq_release_remote(tcp_globals.net_phone, packet_get_id(next_packet));
 				}
 				next_packet = tmp_packet;
@@ -634,5 +637,5 @@
 		printf("unexpected\n");
 		// release duplicite or restricted
-		pq_release(tcp_globals.net_phone, packet_get_id(packet));
+		pq_release_remote(tcp_globals.net_phone, packet_get_id(packet));
 	}
 
@@ -679,5 +682,5 @@
 	// queue the received packet
 	if(ERROR_OCCURRED(dyn_fifo_push(&socket->received, packet_get_id(packet), SOCKET_MAX_RECEIVED_SIZE))
-		|| ERROR_OCCURRED(tl_get_ip_packet_dimension(tcp_globals.ip_phone, &tcp_globals.dimensions, socket_data->device_id, &packet_dimension))){
+	    || ERROR_OCCURRED(tl_get_ip_packet_dimension(tcp_globals.ip_phone, &tcp_globals.dimensions, socket_data->device_id, &packet_dimension))){
 		return tcp_release_and_return(packet, ERROR_CODE);
 	}
@@ -710,5 +713,5 @@
 		next_packet = pq_detach(packet);
 		if(next_packet){
-			pq_release(tcp_globals.net_phone, packet_get_id(next_packet));
+			pq_release_remote(tcp_globals.net_phone, packet_get_id(next_packet));
 		}
 		// trim if longer than the header
@@ -780,5 +783,5 @@
 				free(socket_data->addr);
 				free(socket_data);
-				pq_release(tcp_globals.net_phone, packet_get_id(packet));
+				pq_release_remote(tcp_globals.net_phone, packet_get_id(packet));
 				return ERROR_CODE;
 			}
@@ -846,5 +849,5 @@
 			next_packet = pq_detach(packet);
 			if(next_packet){
-				pq_release(tcp_globals.net_phone, packet_get_id(next_packet));
+				pq_release_remote(tcp_globals.net_phone, packet_get_id(next_packet));
 			}
 			// trim if longer than the header
@@ -895,5 +898,5 @@
 
 		socket_data->next_incoming = ntohl(header->sequence_number);// + 1;
-		pq_release(tcp_globals.net_phone, packet_get_id(packet));
+		pq_release_remote(tcp_globals.net_phone, packet_get_id(packet));
 		socket_data->state = TCP_SOCKET_ESTABLISHED;
 		listening_socket = socket_cores_find(socket_data->local_sockets, socket_data->listening_socket_id);
@@ -981,5 +984,5 @@
 					// add to acknowledged or release
 					if(pq_add(&acknowledged, packet, 0, 0) != EOK){
-						pq_release(tcp_globals.net_phone, packet_get_id(packet));
+						pq_release_remote(tcp_globals.net_phone, packet_get_id(packet));
 					}
 					packet = next;
@@ -990,5 +993,5 @@
 			// release acknowledged
 			if(acknowledged){
-				pq_release(tcp_globals.net_phone, packet_get_id(acknowledged));
+				pq_release_remote(tcp_globals.net_phone, packet_get_id(acknowledged));
 			}
 			return;
@@ -1006,5 +1009,5 @@
 }
 
-int tcp_message(ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count){
+int tcp_message_standalone(ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count){
 	ERROR_DECLARE;
 
@@ -1019,5 +1022,5 @@
 		case NET_TL_RECEIVED:
 			//fibril_rwlock_read_lock(&tcp_globals.lock);
-			if(! ERROR_OCCURRED(packet_translate(tcp_globals.net_phone, &packet, IPC_GET_PACKET(call)))){
+			if(! ERROR_OCCURRED(packet_translate_remote(tcp_globals.net_phone, &packet, IPC_GET_PACKET(call)))){
 				ERROR_CODE = tcp_received_msg(IPC_GET_DEVICE(call), packet, SERVICE_TCP, IPC_GET_ERROR(call));
 			}
@@ -1111,5 +1114,5 @@
 					fibril_rwlock_write_unlock(&lock);
 					if(res == EOK){
-						if(tl_get_ip_packet_dimension(tcp_globals.ip_phone, &tcp_globals.dimensions, DEVICE_INVALID_ID, &packet_dimension) == EOK){
+						if (tl_get_ip_packet_dimension(tcp_globals.ip_phone, &tcp_globals.dimensions, DEVICE_INVALID_ID, &packet_dimension) == EOK){
 							SOCKET_SET_DATA_FRAGMENT_SIZE(answer, ((packet_dimension->content < socket_data->data_fragment_size) ? packet_dimension->content : socket_data->data_fragment_size));
 						}
@@ -1565,5 +1568,5 @@
 			}else{
 				if(ERROR_OCCURRED(pq_insert_after(previous, copy))){
-					pq_release(tcp_globals.net_phone, packet_get_id(copy));
+					pq_release_remote(tcp_globals.net_phone, packet_get_id(copy));
 					return sending;
 				}
@@ -1597,5 +1600,5 @@
 	// adjust the pseudo header
 	if(ERROR_OCCURRED(ip_client_set_pseudo_header_data_length(socket_data->pseudo_header, socket_data->headerlen, packet_get_data_length(packet)))){
-		pq_release(tcp_globals.net_phone, packet_get_id(packet));
+		pq_release_remote(tcp_globals.net_phone, packet_get_id(packet));
 		return NULL;
 	}
@@ -1604,5 +1607,5 @@
 	header = (tcp_header_ref) packet_get_data(packet);
 	if(! header){
-		pq_release(tcp_globals.net_phone, packet_get_id(packet));
+		pq_release_remote(tcp_globals.net_phone, packet_get_id(packet));
 		return NULL;
 	}
@@ -1625,5 +1628,5 @@
 	// prepare the timeout
 		|| ERROR_OCCURRED(tcp_prepare_timeout(tcp_timeout, socket, socket_data, sequence_number, socket_data->state, socket_data->timeout, true))){
-		pq_release(tcp_globals.net_phone, packet_get_id(packet));
+		pq_release_remote(tcp_globals.net_phone, packet_get_id(packet));
 		return NULL;
 	}
@@ -1750,5 +1753,5 @@
 		return NO_DATA;
 	}
-	ERROR_PROPAGATE(packet_translate(tcp_globals.net_phone, &packet, packet_id));
+	ERROR_PROPAGATE(packet_translate_remote(tcp_globals.net_phone, &packet, packet_id));
 
 	// reply the packets
@@ -1757,5 +1760,5 @@
 	// release the packet
 	dyn_fifo_pop(&socket->received);
-	pq_release(tcp_globals.net_phone, packet_get_id(packet));
+	pq_release_remote(tcp_globals.net_phone, packet_get_id(packet));
 	// return the total length
 	return (int) length;
@@ -1889,5 +1892,5 @@
 	ERROR_PROPAGATE(tl_get_ip_packet_dimension(tcp_globals.ip_phone, &tcp_globals.dimensions, socket_data->device_id, &packet_dimension));
 	// get a new packet
-	*packet = packet_get_4(tcp_globals.net_phone, TCP_HEADER_SIZE, packet_dimension->addr_len, packet_dimension->prefix, packet_dimension->suffix);
+	*packet = packet_get_4_remote(tcp_globals.net_phone, TCP_HEADER_SIZE, packet_dimension->addr_len, packet_dimension->prefix, packet_dimension->suffix);
 	if(! * packet){
 		return ENOMEM;
@@ -1993,11 +1996,7 @@
 
 int tcp_release_and_return(packet_t packet, int result){
-	pq_release(tcp_globals.net_phone, packet_get_id(packet));
+	pq_release_remote(tcp_globals.net_phone, packet_get_id(packet));
 	return result;
 }
-
-#ifdef CONFIG_NETWORKING_modular
-
-#include <tl_standalone.h>
 
 /** Default thread for new connections.
@@ -2027,5 +2026,6 @@
 		
 		/* Process the message */
-		int res = tl_module_message(callid, &call, &answer, &answer_count);
+		int res = tl_module_message_standalone(callid, &call, &answer,
+		    &answer_count);
 		
 		/* End if said to either by the message or the processing result */
@@ -2052,5 +2052,5 @@
 	
 	/* Start the module */
-	if (ERROR_OCCURRED(tl_module_start(tl_client_connection)))
+	if (ERROR_OCCURRED(tl_module_start_standalone(tl_client_connection)))
 		return ERROR_CODE;
 	
@@ -2058,6 +2058,4 @@
 }
 
-#endif /* CONFIG_NETWORKING_modular */
-
 /** @}
  */
Index: uspace/srv/net/tl/tcp/tcp.h
===================================================================
--- uspace/srv/net/tl/tcp/tcp.h	(revision 24ab58b348754b301fea741628d74d49704735d6)
+++ uspace/srv/net/tl/tcp/tcp.h	(revision 14f1db0aaed5208d5e8340c816ca6e555f81f67e)
@@ -232,5 +232,5 @@
 	/** IP pseudo header.
 	 */
-	ip_pseudo_header_ref pseudo_header;
+	void *pseudo_header;
 	/** IP pseudo header length.
 	 */
Index: uspace/srv/net/tl/tcp/tcp_module.c
===================================================================
--- uspace/srv/net/tl/tcp/tcp_module.c	(revision 24ab58b348754b301fea741628d74d49704735d6)
+++ uspace/srv/net/tl/tcp/tcp_module.c	(revision 14f1db0aaed5208d5e8340c816ca6e555f81f67e)
@@ -49,5 +49,5 @@
 #include <ip_protocols.h>
 #include <ip_interface.h>
-#include <tl_standalone.h>
+#include <tl_local.h>
 
 #include "tcp.h"
@@ -65,20 +65,21 @@
  *  @returns Other error codes as defined for the REGISTER_ME() macro function.
  */
-int tl_module_start(async_client_conn_t client_connection){
+int tl_module_start_standalone(async_client_conn_t client_connection)
+{
 	ERROR_DECLARE;
-
-	ipcarg_t phonehash;
-
+	
 	async_set_client_connection(client_connection);
 	tcp_globals.net_phone = net_connect_module(SERVICE_NETWORKING);
 	ERROR_PROPAGATE(pm_init());
-	if(ERROR_OCCURRED(tcp_initialize(client_connection))
-		|| ERROR_OCCURRED(REGISTER_ME(SERVICE_TCP, &phonehash))){
+	
+	ipcarg_t phonehash;
+	if (ERROR_OCCURRED(tcp_initialize(client_connection))
+	    || ERROR_OCCURRED(REGISTER_ME(SERVICE_TCP, &phonehash))) {
 		pm_destroy();
 		return ERROR_CODE;
 	}
-
+	
 	async_manager();
-
+	
 	pm_destroy();
 	return EOK;
@@ -93,6 +94,6 @@
  *  @returns Other error codes as defined for the tcp_message() function.
  */
-int tl_module_message(ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count){
-	return tcp_message(callid, call, answer, answer_count);
+int tl_module_message_standalone(ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count){
+	return tcp_message_standalone(callid, call, answer, answer_count);
 }
 
Index: uspace/srv/net/tl/tcp/tcp_module.h
===================================================================
--- uspace/srv/net/tl/tcp/tcp_module.h	(revision 24ab58b348754b301fea741628d74d49704735d6)
+++ uspace/srv/net/tl/tcp/tcp_module.h	(revision 14f1db0aaed5208d5e8340c816ca6e555f81f67e)
@@ -59,5 +59,5 @@
  *  @see IS_NET_TCP_MESSAGE()
  */
-extern int tcp_message(ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count);
+extern int tcp_message_standalone(ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count);
 
 #endif
Index: uspace/srv/net/tl/udp/udp.c
===================================================================
--- uspace/srv/net/tl/udp/udp.c	(revision 24ab58b348754b301fea741628d74d49704735d6)
+++ uspace/srv/net/tl/udp/udp.c	(revision 14f1db0aaed5208d5e8340c816ca6e555f81f67e)
@@ -48,4 +48,5 @@
 #include <adt/dynamic_fifo.h>
 #include <packet/packet_client.h>
+#include <packet_remote.h>
 #include <net_checksum.h>
 #include <in.h>
@@ -63,4 +64,6 @@
 #include <socket_messages.h>
 #include <tl_common.h>
+#include <tl_local.h>
+#include <tl_interface.h>
 #include <tl_messages.h>
 
@@ -258,5 +261,5 @@
 	icmp_type_t type;
 	icmp_code_t code;
-	ip_pseudo_header_ref ip_header;
+	void *ip_header;
 	struct sockaddr * src;
 	struct sockaddr * dest;
@@ -356,5 +359,5 @@
 			while(tmp_packet){
 				next_packet = pq_detach(tmp_packet);
-				pq_release(udp_globals.net_phone, packet_get_id(tmp_packet));
+				pq_release_remote(udp_globals.net_phone, packet_get_id(tmp_packet));
 				tmp_packet = next_packet;
 			}
@@ -382,5 +385,5 @@
 	// queue the received packet
 	if(ERROR_OCCURRED(dyn_fifo_push(&socket->received, packet_get_id(packet), SOCKET_MAX_RECEIVED_SIZE))
-		|| ERROR_OCCURRED(tl_get_ip_packet_dimension(udp_globals.ip_phone, &udp_globals.dimensions, device_id, &packet_dimension))){
+	    || ERROR_OCCURRED(tl_get_ip_packet_dimension(udp_globals.ip_phone, &udp_globals.dimensions, device_id, &packet_dimension))){
 		return udp_release_and_return(packet, ERROR_CODE);
 	}
@@ -392,5 +395,5 @@
 }
 
-int udp_message(ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count){
+int udp_message_standalone(ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count){
 	ERROR_DECLARE;
 
@@ -400,5 +403,5 @@
 	switch(IPC_GET_METHOD(*call)){
 		case NET_TL_RECEIVED:
-			if(! ERROR_OCCURRED(packet_translate(udp_globals.net_phone, &packet, IPC_GET_PACKET(call)))){
+			if(! ERROR_OCCURRED(packet_translate_remote(udp_globals.net_phone, &packet, IPC_GET_PACKET(call)))){
 				ERROR_CODE = udp_received_msg(IPC_GET_DEVICE(call), packet, SERVICE_UDP, IPC_GET_ERROR(call));
 			}
@@ -457,5 +460,5 @@
 
 				if(res == EOK){
-					if(tl_get_ip_packet_dimension(udp_globals.ip_phone, &udp_globals.dimensions, DEVICE_INVALID_ID, &packet_dimension) == EOK){
+					if (tl_get_ip_packet_dimension(udp_globals.ip_phone, &udp_globals.dimensions, DEVICE_INVALID_ID, &packet_dimension) == EOK){
 						SOCKET_SET_DATA_FRAGMENT_SIZE(answer, packet_dimension->content);
 					}
@@ -533,5 +536,5 @@
 	uint16_t dest_port;
 	uint32_t checksum;
-	ip_pseudo_header_ref ip_header;
+	void *ip_header;
 	size_t headerlen;
 	device_id_t device_id;
@@ -662,9 +665,9 @@
 		return NO_DATA;
 	}
-	ERROR_PROPAGATE(packet_translate(udp_globals.net_phone, &packet, packet_id));
+	ERROR_PROPAGATE(packet_translate_remote(udp_globals.net_phone, &packet, packet_id));
 	// get udp header
 	data = packet_get_data(packet);
 	if(! data){
-		pq_release(udp_globals.net_phone, packet_id);
+		pq_release_remote(udp_globals.net_phone, packet_id);
 		return NO_DATA;
 	}
@@ -674,5 +677,5 @@
 	result = packet_get_addr(packet, (uint8_t **) &addr, NULL);
 	if(ERROR_OCCURRED(tl_set_address_port(addr, result, ntohs(header->source_port)))){
-		pq_release(udp_globals.net_phone, packet_id);
+		pq_release_remote(udp_globals.net_phone, packet_id);
 		return ERROR_CODE;
 	}
@@ -689,5 +692,5 @@
 	// release the packet
 	dyn_fifo_pop(&socket->received);
-	pq_release(udp_globals.net_phone, packet_get_id(packet));
+	pq_release_remote(udp_globals.net_phone, packet_get_id(packet));
 	// return the total length
 	return (int) length;
@@ -695,11 +698,7 @@
 
 int udp_release_and_return(packet_t packet, int result){
-	pq_release(udp_globals.net_phone, packet_get_id(packet));
+	pq_release_remote(udp_globals.net_phone, packet_get_id(packet));
 	return result;
 }
-
-#ifdef CONFIG_NETWORKING_modular
-
-#include <tl_standalone.h>
 
 /** Default thread for new connections.
@@ -729,5 +728,6 @@
 		
 		/* Process the message */
-		int res = tl_module_message(callid, &call, &answer, &answer_count);
+		int res = tl_module_message_standalone(callid, &call, &answer,
+		    &answer_count);
 		
 		/* End if said to either by the message or the processing result */
@@ -754,5 +754,5 @@
 	
 	/* Start the module */
-	if (ERROR_OCCURRED(tl_module_start(tl_client_connection)))
+	if (ERROR_OCCURRED(tl_module_start_standalone(tl_client_connection)))
 		return ERROR_CODE;
 	
@@ -760,6 +760,4 @@
 }
 
-#endif /* CONFIG_NETWORKING_modular */
-
 /** @}
  */
Index: uspace/srv/net/tl/udp/udp_module.c
===================================================================
--- uspace/srv/net/tl/udp/udp_module.c	(revision 24ab58b348754b301fea741628d74d49704735d6)
+++ uspace/srv/net/tl/udp/udp_module.c	(revision 14f1db0aaed5208d5e8340c816ca6e555f81f67e)
@@ -47,5 +47,5 @@
 #include <packet/packet.h>
 #include <net_interface.h>
-#include <tl_standalone.h>
+#include <tl_local.h>
 
 #include "udp.h"
@@ -63,5 +63,5 @@
  *  @returns Other error codes as defined for the REGISTER_ME() macro function.
  */
-int tl_module_start(async_client_conn_t client_connection){
+int tl_module_start_standalone(async_client_conn_t client_connection){
 	ERROR_DECLARE;
 
@@ -94,6 +94,6 @@
  *  @returns Other error codes as defined for the udp_message() function.
  */
-int tl_module_message(ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count){
-	return udp_message(callid, call, answer, answer_count);
+int tl_module_message_standalone(ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count){
+	return udp_message_standalone(callid, call, answer, answer_count);
 }
 
Index: uspace/srv/net/tl/udp/udp_module.h
===================================================================
--- uspace/srv/net/tl/udp/udp_module.h	(revision 24ab58b348754b301fea741628d74d49704735d6)
+++ uspace/srv/net/tl/udp/udp_module.h	(revision 14f1db0aaed5208d5e8340c816ca6e555f81f67e)
@@ -59,5 +59,5 @@
  *  @see IS_NET_UDP_MESSAGE()
  */
-extern int udp_message(ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count);
+extern int udp_message_standalone(ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count);
 
 #endif
