Index: uspace/srv/net/cfg/modular/general
===================================================================
--- uspace/srv/net/cfg/modular/general	(revision 9f2ea2842550ba0536881449ffe27c8947d72804)
+++ uspace/srv/net/cfg/modular/general	(revision a64c64d04f3d981abf5d095ae65ed7ed4b40a244)
@@ -3,7 +3,10 @@
 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/module/general
===================================================================
--- uspace/srv/net/cfg/module/general	(revision 9f2ea2842550ba0536881449ffe27c8947d72804)
+++ uspace/srv/net/cfg/module/general	(revision a64c64d04f3d981abf5d095ae65ed7ed4b40a244)
@@ -3,7 +3,10 @@
 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/checksum.c
===================================================================
--- uspace/srv/net/checksum.c	(revision 9f2ea2842550ba0536881449ffe27c8947d72804)
+++ uspace/srv/net/checksum.c	(revision a64c64d04f3d981abf5d095ae65ed7ed4b40a244)
@@ -47,60 +47,11 @@
 #define CRC_DIVIDER_LE	0xEDB88320
 
-uint32_t compute_crc32_le(uint32_t seed, uint8_t * data, size_t length){
-	size_t index;
+uint16_t compact_checksum(uint32_t sum){
+	// shorten to the 16 bits
+	while(sum >> 16){
+		sum = (sum &0xFFFF) + (sum >> 16);
+	}
 
-	while(length >= 8){
-		seed ^= (*data);
-		for(index = 0; index < 8; ++ index){
-			if(seed &1){
-				seed = (seed >> 1) ^ ((uint32_t) CRC_DIVIDER_LE);
-			}else{
-				seed >>= 1;
-			}
-		}
-		++ data;
-		length -= 8;
-	}
-	if(length > 0){
-		seed ^= (*data) >> (8 - length);
-		for(index = 0; index < length; ++ index){
-			if(seed &1){
-				seed = (seed >> 1) ^ ((uint32_t) CRC_DIVIDER_LE);
-			}else{
-				seed >>= 1;
-			}
-		}
-		length -= 8;
-	}
-	return seed;
-}
-
-uint32_t compute_crc32_be(uint32_t seed, uint8_t * data, size_t length){
-	size_t index;
-
-	while(length >= 8){
-		seed ^= (*data) << 24;
-		for(index = 0; index < 8; ++ index){
-			if(seed &0x80000000){
-				seed = (seed << 1) ^ ((uint32_t) CRC_DIVIDER_BE);
-			}else{
-				seed <<= 1;
-			}
-		}
-		++ data;
-		length -= 8;
-	}
-	if(length > 0){
-		seed ^= ((*data) &(0xFF << (8 - length))) << 24;
-		for(index = 0; index < length; ++ index){
-			if(seed &0x80000000){
-				seed = (seed << 1) ^ ((uint32_t) CRC_DIVIDER_BE);
-			}else{
-				seed <<= 1;
-			}
-		}
-		length -= 8;
-	}
-	return seed;
+	return (uint16_t) sum;
 }
 
@@ -121,11 +72,87 @@
 }
 
-uint16_t compact_checksum(uint32_t sum){
-	// shorten to the 16 bits
-	while(sum >> 16){
-		sum = (sum &0xFFFF) + (sum >> 16);
+uint32_t compute_crc32_be(uint32_t seed, uint8_t * data, size_t length){
+	size_t index;
+
+	// process full bytes
+	while(length >= 8){
+		// add the data
+		seed ^= (*data) << 24;
+		// for each added bit
+		for(index = 0; index < 8; ++ index){
+			// if the first bit is set
+			if(seed &0x80000000){
+				// shift and divide the checksum
+				seed = (seed << 1) ^ ((uint32_t) CRC_DIVIDER_BE);
+			}else{
+				// shift otherwise
+				seed <<= 1;
+			}
+		}
+		// move to the next byte
+		++ data;
+		length -= 8;
 	}
 
-	return (uint16_t) sum;
+	// process the odd bits
+	if(length > 0){
+		// add the data with zero padding
+		seed ^= ((*data) &(0xFF << (8 - length))) << 24;
+		// for each added bit
+		for(index = 0; index < length; ++ index){
+			// if the first bit is set
+			if(seed &0x80000000){
+				// shift and divide the checksum
+				seed = (seed << 1) ^ ((uint32_t) CRC_DIVIDER_BE);
+			}else{
+				// shift otherwise
+				seed <<= 1;
+			}
+		}
+	}
+
+	return seed;
+}
+
+uint32_t compute_crc32_le(uint32_t seed, uint8_t * data, size_t length){
+	size_t index;
+
+	// process full bytes
+	while(length >= 8){
+		// add the data
+		seed ^= (*data);
+		// for each added bit
+		for(index = 0; index < 8; ++ index){
+			// if the last bit is set
+			if(seed &1){
+				// shift and divide the checksum
+				seed = (seed >> 1) ^ ((uint32_t) CRC_DIVIDER_LE);
+			}else{
+				// shift otherwise
+				seed >>= 1;
+			}
+		}
+		// move to the next byte
+		++ data;
+		length -= 8;
+	}
+
+	// process the odd bits
+	if(length > 0){
+		// add the data with zero padding
+		seed ^= (*data) >> (8 - length);
+		for(index = 0; index < length; ++ index){
+			// if the last bit is set
+			if(seed &1){
+				// shift and divide the checksum
+				seed = (seed >> 1) ^ ((uint32_t) CRC_DIVIDER_LE);
+			}else{
+				// shift otherwise
+				seed >>= 1;
+			}
+		}
+	}
+
+	return seed;
 }
 
@@ -137,4 +164,5 @@
 
 uint16_t ip_checksum(uint8_t * data, size_t length){
+	// compute, compact and flip the data checksum
 	return flip_checksum(compact_checksum(compute_checksum(0, data, length)));
 }
Index: uspace/srv/net/configuration.h
===================================================================
--- uspace/srv/net/configuration.h	(revision 9f2ea2842550ba0536881449ffe27c8947d72804)
+++ uspace/srv/net/configuration.h	(revision a64c64d04f3d981abf5d095ae65ed7ed4b40a244)
@@ -46,10 +46,4 @@
 /*@{*/
 
-/** Activates the measured strings self test.
- *  The NET_SELF_TEST has to be activated.
- *  @see measured_strings.h
- */
-#define NET_SELF_TEST_MEASURED_STRINGS	1
-
 /** Activates the char map self test.
  *  The NET_SELF_TEST has to be activated.
@@ -57,4 +51,28 @@
  */
 #define NET_SELF_TEST_CHAR_MAP			1
+
+/** Activates the CRC computation self test.
+ *  The NET_SELF_TEST has to be activated.
+ *  @see crc.h
+ */
+#define NET_SELF_TEST_CRC				1
+
+/** Activates the dynamic fifo self test.
+ *  The NET_SELF_TEST has to be activated.
+ *  @see dynamic_fifo.h
+ */
+#define NET_SELF_TEST_DYNAMIC_FIFO		1
+
+/** Activates the generic char map self test.
+ *  The NET_SELF_TEST has to be activated.
+ *  @see generic_char_map.h
+ */
+#define NET_SELF_TEST_GENERIC_CHAR_MAP	1
+
+/** Activates the generic field self test.
+ *  The NET_SELF_TEST has to be activated.
+ *  @see generic_field.h
+ */
+#define NET_SELF_TEST_GENERIC_FIELD		1
 
 /** Activates the integral map self test.
@@ -64,27 +82,9 @@
 #define NET_SELF_TEST_INT_MAP			1
 
-/** Activates the generic field self test.
+/** Activates the measured strings self test.
  *  The NET_SELF_TEST has to be activated.
- *  @see generic_field.h
+ *  @see measured_strings.h
  */
-#define NET_SELF_TEST_GENERIC_FIELD		1
-
-/** Activates the generic char map self test.
- *  The NET_SELF_TEST has to be activated.
- *  @see generic_char_map.h
- */
-#define NET_SELF_TEST_GENERIC_CHAR_MAP	1
-
-/** Activates the CRC computation self test.
- *  The NET_SELF_TEST has to be activated.
- *  @see crc.h
- */
-#define NET_SELF_TEST_CRC	1
-
-/** Activates the dynamic fifo self test.
- *  The NET_SELF_TEST has to be activated.
- *  @see dynamic_fifo.h
- */
-#define NET_SELF_TEST_DYNAMIC_FIFO	1
+#define NET_SELF_TEST_MEASURED_STRINGS	1
 
 /*@}*/
Index: uspace/srv/net/err.h
===================================================================
--- uspace/srv/net/err.h	(revision 9f2ea2842550ba0536881449ffe27c8947d72804)
+++ uspace/srv/net/err.h	(revision a64c64d04f3d981abf5d095ae65ed7ed4b40a244)
@@ -62,5 +62,7 @@
 #ifdef CONFIG_DEBUG
 
-#define ERROR_OCCURRED(value)		(((ERROR_CODE = (value)) != EOK) && ({printf("error at %s:%d %d\n", __FILE__, __LINE__, ERROR_CODE); 1;}))
+#define ERROR_OCCURRED(value)												\
+	(((ERROR_CODE = (value)) != EOK)										\
+	&& ({printf("error at %s:%d %d\n", __FILE__, __LINE__, ERROR_CODE); 1;}))
 
 #else
Index: uspace/srv/net/il/arp/arp.c
===================================================================
--- uspace/srv/net/il/arp/arp.c	(revision 9f2ea2842550ba0536881449ffe27c8947d72804)
+++ uspace/srv/net/il/arp/arp.c	(revision a64c64d04f3d981abf5d095ae65ed7ed4b40a244)
@@ -73,4 +73,9 @@
 arp_globals_t	arp_globals;
 
+/** Clears the device specific data.
+ *  @param[in] device The device specific data.
+ */
+void arp_clear_device(arp_device_ref device);
+
 /** Creates new protocol specific data.
  *  Allocates and returns the needed memory block as the proto parameter.
@@ -82,9 +87,4 @@
  */
 int arp_proto_create(arp_proto_ref * proto, services_t service, measured_string_ref address);
-
-/** Clears the device specific data.
- *  @param[in] device The device specific data.
- */
-void arp_clear_device(arp_device_ref device);
 
 /** @name Message processing functions
@@ -105,16 +105,11 @@
 int arp_device_message(device_id_t device_id, services_t service, services_t protocol, measured_string_ref address);
 
-/** Returns the hardware address for the given protocol address.
- *  Sends the ARP request packet if the hardware address is not found in the cache.
+/** Updates the device content length according to the new MTU value.
  *  @param[in] device_id The device identifier.
- *  @param[in] protocol The protocol service.
- *  @param[in] target The target protocol address.
- *  @returns The hardware address of the target.
- *  @returns NULL if the target parameter is NULL.
- *  @returns NULL if the device is not found.
- *  @returns NULL if the device packet is too small to send a&nbsp;request.
- *  @returns NULL if the hardware address is not found in the cache.
- */
-measured_string_ref arp_translate_message(device_id_t device_id, services_t protocol, measured_string_ref target);
+ *  @param[in] mtu The new mtu value.
+ *  @returns ENOENT if device is not found.
+ *  @returns EOK on success.
+ */
+int arp_mtu_changed_message(device_id_t device_id, size_t mtu);
 
 /** Processes the received ARP packet.
@@ -133,11 +128,16 @@
 int arp_receive_message(device_id_t device_id, packet_t packet);
 
-/** Updates the device content length according to the new MTU value.
+/** Returns the hardware address for the given protocol address.
+ *  Sends the ARP request packet if the hardware address is not found in the cache.
  *  @param[in] device_id The device identifier.
- *  @param[in] mtu The new mtu value.
- *  @returns ENOENT if device is not found.
- *  @returns EOK on success.
- */
-int arp_mtu_changed_message(device_id_t device_id, size_t mtu);
+ *  @param[in] protocol The protocol service.
+ *  @param[in] target The target protocol address.
+ *  @returns The hardware address of the target.
+ *  @returns NULL if the target parameter is NULL.
+ *  @returns NULL if the device is not found.
+ *  @returns NULL if the device packet is too small to send a&nbsp;request.
+ *  @returns NULL if the hardware address is not found in the cache.
+ */
+measured_string_ref arp_translate_message(device_id_t device_id, services_t protocol, measured_string_ref target);
 
 /*@}*/
@@ -148,43 +148,4 @@
 
 GENERIC_CHAR_MAP_IMPLEMENT(arp_addr, measured_string_t)
-
-task_id_t arp_task_get_id(void){
-	return task_get_id();
-}
-
-int arp_clear_device_req(int arp_phone, device_id_t device_id){
-	arp_device_ref device;
-
-	fibril_rwlock_write_lock(&arp_globals.lock);
-	device = arp_cache_find(&arp_globals.cache, device_id);
-	if(! device){
-		fibril_rwlock_write_unlock(&arp_globals.lock);
-		return ENOENT;
-	}
-	arp_clear_device(device);
-	printf("Device %d cleared\n", device_id);
-	fibril_rwlock_write_unlock(&arp_globals.lock);
-	return EOK;
-}
-
-int arp_clear_address_req(int arp_phone, device_id_t device_id, services_t protocol, measured_string_ref address){
-	arp_device_ref device;
-	arp_proto_ref proto;
-
-	fibril_rwlock_write_lock(&arp_globals.lock);
-	device = arp_cache_find(&arp_globals.cache, device_id);
-	if(! device){
-		fibril_rwlock_write_unlock(&arp_globals.lock);
-		return ENOENT;
-	}
-	proto = arp_protos_find(&device->protos, protocol);
-	if(! proto){
-		fibril_rwlock_write_unlock(&arp_globals.lock);
-		return ENOENT;
-	}
-	arp_addr_exclude(&proto->addresses, address->value, address->length);
-	fibril_rwlock_write_unlock(&arp_globals.lock);
-	return EOK;
-}
 
 int arp_clean_cache_req(int arp_phone){
@@ -211,62 +172,61 @@
 }
 
-int arp_device_req(int arp_phone, device_id_t device_id, services_t protocol, services_t netif, measured_string_ref address){
-	ERROR_DECLARE;
-
-	measured_string_ref tmp;
-
-	// copy the given address for exclusive use
-	tmp = measured_string_copy(address);
-	if(ERROR_OCCURRED(arp_device_message(device_id, netif, protocol, tmp))){
-		free(tmp->value);
-		free(tmp);
-	}
-	return ERROR_CODE;
-}
-
-int arp_translate_req(int arp_phone, device_id_t device_id, services_t protocol, measured_string_ref address, measured_string_ref * translation, char ** data){
-	measured_string_ref tmp;
-
-	fibril_rwlock_read_lock(&arp_globals.lock);
-	tmp = arp_translate_message(device_id, protocol, address);
-	if(tmp){
-		*translation = measured_string_copy(tmp);
-		fibril_rwlock_read_unlock(&arp_globals.lock);
-		if(*translation){
-			*data = (** translation).value;
-			return EOK;
-		}else{
-			return ENOMEM;
-		}
-	}else{
-		fibril_rwlock_read_unlock(&arp_globals.lock);
+int arp_clear_address_req(int arp_phone, device_id_t device_id, services_t protocol, measured_string_ref address){
+	arp_device_ref device;
+	arp_proto_ref proto;
+
+	fibril_rwlock_write_lock(&arp_globals.lock);
+	device = arp_cache_find(&arp_globals.cache, device_id);
+	if(! device){
+		fibril_rwlock_write_unlock(&arp_globals.lock);
 		return ENOENT;
 	}
-}
-
-int arp_initialize(async_client_conn_t client_connection){
-	ERROR_DECLARE;
-
-	fibril_rwlock_initialize(&arp_globals.lock);
+	proto = arp_protos_find(&device->protos, protocol);
+	if(! proto){
+		fibril_rwlock_write_unlock(&arp_globals.lock);
+		return ENOENT;
+	}
+	arp_addr_exclude(&proto->addresses, address->value, address->length);
+	fibril_rwlock_write_unlock(&arp_globals.lock);
+	return EOK;
+}
+
+void arp_clear_device(arp_device_ref device){
+	int count;
+	arp_proto_ref proto;
+
+	for(count = arp_protos_count(&device->protos) - 1; count >= 0; -- count){
+		proto = arp_protos_get_index(&device->protos, count);
+		if(proto){
+			if(proto->addr){
+				free(proto->addr);
+			}
+			if(proto->addr_data){
+				free(proto->addr_data);
+			}
+			arp_addr_destroy(&proto->addresses);
+		}
+	}
+	arp_protos_clear(&device->protos);
+}
+
+int arp_clear_device_req(int arp_phone, device_id_t device_id){
+	arp_device_ref device;
+
 	fibril_rwlock_write_lock(&arp_globals.lock);
-	arp_globals.client_connection = client_connection;
-	ERROR_PROPAGATE(arp_cache_initialize(&arp_globals.cache));
+	device = arp_cache_find(&arp_globals.cache, device_id);
+	if(! device){
+		fibril_rwlock_write_unlock(&arp_globals.lock);
+		return ENOENT;
+	}
+	arp_clear_device(device);
+	printf("Device %d cleared\n", device_id);
 	fibril_rwlock_write_unlock(&arp_globals.lock);
 	return EOK;
 }
 
-int arp_proto_create(arp_proto_ref * proto, services_t service, measured_string_ref address){
-	ERROR_DECLARE;
-
-	*proto = (arp_proto_ref) malloc(sizeof(arp_proto_t));
-	if(!(*proto)){
-		return ENOMEM;
-	}
-	(** proto).service = service;
-	(** proto).addr = address;
-	(** proto).addr_data = address->value;
-	if(ERROR_OCCURRED(arp_addr_initialize(&(** proto).addresses))){
-		free(*proto);
-		return ERROR_CODE;
+int arp_connect_module(services_t service){
+	if(service != SERVICE_ARP){
+		return EINVAL;
 	}
 	return EOK;
@@ -383,168 +343,25 @@
 }
 
-measured_string_ref arp_translate_message(device_id_t device_id, services_t protocol, measured_string_ref target){
-	arp_device_ref device;
-	arp_proto_ref proto;
-	measured_string_ref addr;
-	size_t length;
-	packet_t packet;
-	arp_header_ref header;
-
-	if(! target){
-		return NULL;
-	}
-	device = arp_cache_find(&arp_globals.cache, device_id);
-	if(! device){
-		return NULL;
-	}
-	proto = arp_protos_find(&device->protos, protocol);
-	if((! proto) || (proto->addr->length != target->length)){
-		return NULL;
-	}
-	addr = arp_addr_find(&proto->addresses, target->value, target->length);
-	if(addr){
-		return addr;
-	}
-	// ARP packet content size = header + (address + translation) * 2
-	length = 8 + (CONVERT_SIZE(char, uint8_t, proto->addr->length) + CONVERT_SIZE(char, uint8_t, device->addr->length)) * 2;
-	if(length > device->packet_dimension.content){
-		return NULL;
-	}
-	packet = packet_get_4(arp_globals.net_phone, device->packet_dimension.addr_len, device->packet_dimension.prefix, length, device->packet_dimension.suffix);
-	if(! packet){
-		return NULL;
-	}
-	header = (arp_header_ref) packet_suffix(packet, length);
-	if(! header){
-		pq_release(arp_globals.net_phone, packet_get_id(packet));
-		return NULL;
-	}
-	header->hardware = htons(device->hardware);
-	header->hardware_length = (uint8_t) device->addr->length;
-	header->protocol = htons(protocol_map(device->service, protocol));
-	header->protocol_length = (uint8_t) proto->addr->length;
-	header->operation = htons(ARPOP_REQUEST);
-	length = sizeof(arp_header_t);
-	memcpy(((uint8_t *) header) + length, device->addr->value, device->addr->length);
-	length += device->addr->length;
-	memcpy(((uint8_t *) header) + length, proto->addr->value, proto->addr->length);
-	length += proto->addr->length;
-	bzero(((uint8_t *) header) + length, device->addr->length);
-	length += device->addr->length;
-	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));
-		return NULL;
-	}
-	nil_send_msg(device->phone, device_id, packet, SERVICE_ARP);
-	return NULL;
-}
-
-int arp_receive_message(device_id_t device_id, packet_t packet){
+int arp_device_req(int arp_phone, device_id_t device_id, services_t protocol, services_t netif, measured_string_ref address){
 	ERROR_DECLARE;
 
-	size_t length;
-	arp_header_ref header;
-	arp_device_ref device;
-	arp_proto_ref proto;
-	measured_string_ref hw_source;
-	uint8_t * src_hw;
-	uint8_t * src_proto;
-	uint8_t * des_hw;
-	uint8_t * des_proto;
-
-	length = packet_get_data_length(packet);
-	if(length <= sizeof(arp_header_t)){
-		return EINVAL;
-	}
-	device = arp_cache_find(&arp_globals.cache, device_id);
-	if(! device){
-		return ENOENT;
-	}
-	header = (arp_header_ref) packet_get_data(packet);
-	if((ntohs(header->hardware) != device->hardware)
-		|| (length < sizeof(arp_header_t) + header->hardware_length * 2u + header->protocol_length * 2u)){
-		return EINVAL;
-	}
-	proto = arp_protos_find(&device->protos, protocol_unmap(device->service, ntohs(header->protocol)));
-	if(! proto){
-		return ENOENT;
-	}
-	src_hw = ((uint8_t *) header) + sizeof(arp_header_t);
-	src_proto = src_hw + header->hardware_length;
-	des_hw = src_proto + header->protocol_length;
-	des_proto = des_hw + header->hardware_length;
-	hw_source = arp_addr_find(&proto->addresses, (char *) src_proto, CONVERT_SIZE(uint8_t, char, header->protocol_length));
-	// exists?
-	if(hw_source){
-		if(hw_source->length != CONVERT_SIZE(uint8_t, char, header->hardware_length)){
-			return EINVAL;
-		}
-		memcpy(hw_source->value, src_hw, hw_source->length);
-	}
-	// is my protocol address?
-	if(proto->addr->length != CONVERT_SIZE(uint8_t, char, header->protocol_length)){
-		return EINVAL;
-	}
-	if(! str_lcmp(proto->addr->value, (char *) des_proto, proto->addr->length)){
-		// not already upadted?
-		if(! hw_source){
-			hw_source = measured_string_create_bulk((char *) src_hw, CONVERT_SIZE(uint8_t, char, header->hardware_length));
-			if(! hw_source){
-				return ENOMEM;
-			}
-			ERROR_PROPAGATE(arp_addr_add(&proto->addresses, (char *) src_proto, CONVERT_SIZE(uint8_t, char, header->protocol_length), hw_source));
-		}
-		if(ntohs(header->operation) == ARPOP_REQUEST){
-			header->operation = htons(ARPOP_REPLY);
-			memcpy(des_proto, src_proto, header->protocol_length);
-			memcpy(src_proto, proto->addr->value, header->protocol_length);
-			memcpy(src_hw, device->addr->value, device->packet_dimension.addr_len);
-			memcpy(des_hw, hw_source->value, header->hardware_length);
-			ERROR_PROPAGATE(packet_set_addr(packet, src_hw, des_hw, header->hardware_length));
-			nil_send_msg(device->phone, device_id, packet, SERVICE_ARP);
-			return 1;
-		}
-	}
-	return EOK;
-}
-
-void arp_clear_device(arp_device_ref device){
-	int count;
-	arp_proto_ref proto;
-
-	for(count = arp_protos_count(&device->protos) - 1; count >= 0; -- count){
-		proto = arp_protos_get_index(&device->protos, count);
-		if(proto){
-			if(proto->addr){
-				free(proto->addr);
-			}
-			if(proto->addr_data){
-				free(proto->addr_data);
-			}
-			arp_addr_destroy(&proto->addresses);
-		}
-	}
-	arp_protos_clear(&device->protos);
-}
-
-int arp_connect_module(services_t service){
-	if(service != SERVICE_ARP){
-		return EINVAL;
-	}
-	return EOK;
-}
-
-int arp_mtu_changed_message(device_id_t device_id, size_t mtu){
-	arp_device_ref device;
-
+	measured_string_ref tmp;
+
+	// copy the given address for exclusive use
+	tmp = measured_string_copy(address);
+	if(ERROR_OCCURRED(arp_device_message(device_id, netif, protocol, tmp))){
+		free(tmp->value);
+		free(tmp);
+	}
+	return ERROR_CODE;
+}
+
+int arp_initialize(async_client_conn_t client_connection){
+	ERROR_DECLARE;
+
+	fibril_rwlock_initialize(&arp_globals.lock);
 	fibril_rwlock_write_lock(&arp_globals.lock);
-	device = arp_cache_find(&arp_globals.cache, device_id);
-	if(! device){
-		fibril_rwlock_write_unlock(&arp_globals.lock);
-		return ENOENT;
-	}
-	device->packet_dimension.content = mtu;
-	printf("arp - device %d changed mtu to %d\n\n", device_id, mtu);
+	arp_globals.client_connection = client_connection;
+	ERROR_PROPAGATE(arp_cache_initialize(&arp_globals.cache));
 	fibril_rwlock_write_unlock(&arp_globals.lock);
 	return EOK;
@@ -618,4 +435,187 @@
 }
 
+int arp_mtu_changed_message(device_id_t device_id, size_t mtu){
+	arp_device_ref device;
+
+	fibril_rwlock_write_lock(&arp_globals.lock);
+	device = arp_cache_find(&arp_globals.cache, device_id);
+	if(! device){
+		fibril_rwlock_write_unlock(&arp_globals.lock);
+		return ENOENT;
+	}
+	device->packet_dimension.content = mtu;
+	printf("arp - device %d changed mtu to %d\n\n", device_id, mtu);
+	fibril_rwlock_write_unlock(&arp_globals.lock);
+	return EOK;
+}
+
+int arp_proto_create(arp_proto_ref * proto, services_t service, measured_string_ref address){
+	ERROR_DECLARE;
+
+	*proto = (arp_proto_ref) malloc(sizeof(arp_proto_t));
+	if(!(*proto)){
+		return ENOMEM;
+	}
+	(** proto).service = service;
+	(** proto).addr = address;
+	(** proto).addr_data = address->value;
+	if(ERROR_OCCURRED(arp_addr_initialize(&(** proto).addresses))){
+		free(*proto);
+		return ERROR_CODE;
+	}
+	return EOK;
+}
+
+int arp_receive_message(device_id_t device_id, packet_t packet){
+	ERROR_DECLARE;
+
+	size_t length;
+	arp_header_ref header;
+	arp_device_ref device;
+	arp_proto_ref proto;
+	measured_string_ref hw_source;
+	uint8_t * src_hw;
+	uint8_t * src_proto;
+	uint8_t * des_hw;
+	uint8_t * des_proto;
+
+	length = packet_get_data_length(packet);
+	if(length <= sizeof(arp_header_t)){
+		return EINVAL;
+	}
+	device = arp_cache_find(&arp_globals.cache, device_id);
+	if(! device){
+		return ENOENT;
+	}
+	header = (arp_header_ref) packet_get_data(packet);
+	if((ntohs(header->hardware) != device->hardware)
+		|| (length < sizeof(arp_header_t) + header->hardware_length * 2u + header->protocol_length * 2u)){
+		return EINVAL;
+	}
+	proto = arp_protos_find(&device->protos, protocol_unmap(device->service, ntohs(header->protocol)));
+	if(! proto){
+		return ENOENT;
+	}
+	src_hw = ((uint8_t *) header) + sizeof(arp_header_t);
+	src_proto = src_hw + header->hardware_length;
+	des_hw = src_proto + header->protocol_length;
+	des_proto = des_hw + header->hardware_length;
+	hw_source = arp_addr_find(&proto->addresses, (char *) src_proto, CONVERT_SIZE(uint8_t, char, header->protocol_length));
+	// exists?
+	if(hw_source){
+		if(hw_source->length != CONVERT_SIZE(uint8_t, char, header->hardware_length)){
+			return EINVAL;
+		}
+		memcpy(hw_source->value, src_hw, hw_source->length);
+	}
+	// is my protocol address?
+	if(proto->addr->length != CONVERT_SIZE(uint8_t, char, header->protocol_length)){
+		return EINVAL;
+	}
+	if(! str_lcmp(proto->addr->value, (char *) des_proto, proto->addr->length)){
+		// not already upadted?
+		if(! hw_source){
+			hw_source = measured_string_create_bulk((char *) src_hw, CONVERT_SIZE(uint8_t, char, header->hardware_length));
+			if(! hw_source){
+				return ENOMEM;
+			}
+			ERROR_PROPAGATE(arp_addr_add(&proto->addresses, (char *) src_proto, CONVERT_SIZE(uint8_t, char, header->protocol_length), hw_source));
+		}
+		if(ntohs(header->operation) == ARPOP_REQUEST){
+			header->operation = htons(ARPOP_REPLY);
+			memcpy(des_proto, src_proto, header->protocol_length);
+			memcpy(src_proto, proto->addr->value, header->protocol_length);
+			memcpy(src_hw, device->addr->value, device->packet_dimension.addr_len);
+			memcpy(des_hw, hw_source->value, header->hardware_length);
+			ERROR_PROPAGATE(packet_set_addr(packet, src_hw, des_hw, header->hardware_length));
+			nil_send_msg(device->phone, device_id, packet, SERVICE_ARP);
+			return 1;
+		}
+	}
+	return EOK;
+}
+
+task_id_t arp_task_get_id(void){
+	return task_get_id();
+}
+
+measured_string_ref arp_translate_message(device_id_t device_id, services_t protocol, measured_string_ref target){
+	arp_device_ref device;
+	arp_proto_ref proto;
+	measured_string_ref addr;
+	size_t length;
+	packet_t packet;
+	arp_header_ref header;
+
+	if(! target){
+		return NULL;
+	}
+	device = arp_cache_find(&arp_globals.cache, device_id);
+	if(! device){
+		return NULL;
+	}
+	proto = arp_protos_find(&device->protos, protocol);
+	if((! proto) || (proto->addr->length != target->length)){
+		return NULL;
+	}
+	addr = arp_addr_find(&proto->addresses, target->value, target->length);
+	if(addr){
+		return addr;
+	}
+	// ARP packet content size = header + (address + translation) * 2
+	length = 8 + (CONVERT_SIZE(char, uint8_t, proto->addr->length) + CONVERT_SIZE(char, uint8_t, device->addr->length)) * 2;
+	if(length > device->packet_dimension.content){
+		return NULL;
+	}
+	packet = packet_get_4(arp_globals.net_phone, device->packet_dimension.addr_len, device->packet_dimension.prefix, length, device->packet_dimension.suffix);
+	if(! packet){
+		return NULL;
+	}
+	header = (arp_header_ref) packet_suffix(packet, length);
+	if(! header){
+		pq_release(arp_globals.net_phone, packet_get_id(packet));
+		return NULL;
+	}
+	header->hardware = htons(device->hardware);
+	header->hardware_length = (uint8_t) device->addr->length;
+	header->protocol = htons(protocol_map(device->service, protocol));
+	header->protocol_length = (uint8_t) proto->addr->length;
+	header->operation = htons(ARPOP_REQUEST);
+	length = sizeof(arp_header_t);
+	memcpy(((uint8_t *) header) + length, device->addr->value, device->addr->length);
+	length += device->addr->length;
+	memcpy(((uint8_t *) header) + length, proto->addr->value, proto->addr->length);
+	length += proto->addr->length;
+	bzero(((uint8_t *) header) + length, device->addr->length);
+	length += device->addr->length;
+	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));
+		return NULL;
+	}
+	nil_send_msg(device->phone, device_id, packet, SERVICE_ARP);
+	return NULL;
+}
+
+int arp_translate_req(int arp_phone, device_id_t device_id, services_t protocol, measured_string_ref address, measured_string_ref * translation, char ** data){
+	measured_string_ref tmp;
+
+	fibril_rwlock_read_lock(&arp_globals.lock);
+	tmp = arp_translate_message(device_id, protocol, address);
+	if(tmp){
+		*translation = measured_string_copy(tmp);
+		fibril_rwlock_read_unlock(&arp_globals.lock);
+		if(*translation){
+			*data = (** translation).value;
+			return EOK;
+		}else{
+			return ENOMEM;
+		}
+	}else{
+		fibril_rwlock_read_unlock(&arp_globals.lock);
+		return ENOENT;
+	}
+}
+
 /** @}
  */
Index: uspace/srv/net/il/arp/arp.h
===================================================================
--- uspace/srv/net/il/arp/arp.h	(revision 9f2ea2842550ba0536881449ffe27c8947d72804)
+++ uspace/srv/net/il/arp/arp.h	(revision a64c64d04f3d981abf5d095ae65ed7ed4b40a244)
@@ -51,9 +51,4 @@
 
 
-/** Type definition of the ARP global data.
- *  @see arp_globals
- */
-typedef struct arp_globals	arp_globals_t;
-
 /** Type definition of the ARP device specific data.
  *  @see arp_device
@@ -66,4 +61,9 @@
 typedef arp_device_t *		arp_device_ref;
 
+/** Type definition of the ARP global data.
+ *  @see arp_globals
+ */
+typedef struct arp_globals	arp_globals_t;
+
 /** Type definition of the ARP protocol specific data.
  *  @see arp_proto
@@ -75,4 +75,10 @@
  */
 typedef arp_proto_t *		arp_proto_ref;
+
+/** ARP address map.
+ *  Translates addresses.
+ *  @see generic_char_map.h
+ */
+GENERIC_CHAR_MAP_DECLARE(arp_addr, measured_string_t)
 
 /** ARP address cache.
@@ -88,22 +94,7 @@
 INT_MAP_DECLARE(arp_protos, arp_proto_t)
 
-/** ARP address map.
- *  Translates addresses.
- *  @see generic_char_map.h
- */
-GENERIC_CHAR_MAP_DECLARE(arp_addr, measured_string_t)
-
 /** ARP device specific data.
  */
 struct arp_device{
-	/** Device identifier.
-	 */
-	device_id_t device_id;
-	/** Hardware type.
-	 */
-	hw_type_t hardware;
-	/** Packet dimension.
-	 */
-	packet_dimension_t packet_dimension;
 	/** Actual device hardware address.
 	 */
@@ -118,7 +109,13 @@
 	 */
 	char * broadcast_data;
-	/** Device module service.
+	/** Device identifier.
 	 */
-	services_t service;
+	device_id_t device_id;
+	/** Hardware type.
+	 */
+	hw_type_t hardware;
+	/** Packet dimension.
+	 */
+	packet_dimension_t packet_dimension;
 	/** Device module phone.
 	 */
@@ -128,4 +125,25 @@
 	 */
 	arp_protos_t protos;
+	/** Device module service.
+	 */
+	services_t service;
+};
+
+/** ARP global data.
+ */
+struct	arp_globals{
+	/** ARP address cache.
+	 */
+	arp_cache_t cache;
+	/** The client connection processing function.
+	 *  The module skeleton propagates its own one.
+	 */
+	async_client_conn_t client_connection;
+	/** Networking module phone.
+	 */
+	int net_phone;
+	/** Safety lock.
+	 */
+	fibril_rwlock_t lock;
 };
 
@@ -133,7 +151,4 @@
  */
 struct arp_proto{
-	/** Protocol service.
-	 */
-	services_t service;
 	/** Actual device protocol address.
 	 */
@@ -145,22 +160,7 @@
 	 */
 	arp_addr_t addresses;
-};
-
-/** ARP global data.
- */
-struct	arp_globals{
-	/** Networking module phone.
+	/** Protocol service.
 	 */
-	int net_phone;
-	/** Safety lock.
-	 */
-	fibril_rwlock_t lock;
-	/** ARP address cache.
-	 */
-	arp_cache_t cache;
-	/** The client connection processing function.
-	 *  The module skeleton propagates its own one.
-	 */
-	async_client_conn_t client_connection;
+	services_t service;
 };
 
Index: uspace/srv/net/il/arp/arp_messages.h
===================================================================
--- uspace/srv/net/il/arp/arp_messages.h	(revision 9f2ea2842550ba0536881449ffe27c8947d72804)
+++ uspace/srv/net/il/arp/arp_messages.h	(revision a64c64d04f3d981abf5d095ae65ed7ed4b40a244)
@@ -46,24 +46,24 @@
  */
 typedef enum{
-	/** New device message.
-	 *  @see arp_device_req()
+	/** Clean cache message.
+	 *  @see arp_clean_cache()
 	 */
-	NET_ARP_DEVICE = NET_ARP_FIRST,
-	/** Address translation message.
-	 *  @see arp_translate_req()
+	NET_ARP_CLEAN_CACHE = NET_ARP_FIRST,
+	/** Clear address cache message.
+	 *  @see arp_clear_address_msg()
 	 */
-	NET_ARP_TRANSLATE,
+	NET_ARP_CLEAR_ADDRESS,
 	/** Clear device cache message.
 	 *  @see arp_clear_device_req()
 	 */
 	NET_ARP_CLEAR_DEVICE,
-	/** Clear address cache message.
-	 *  @see arp_clear_address_msg()
+	/** New device message.
+	 *  @see arp_device_req()
 	 */
-	NET_ARP_CLEAR_ADDRESS,
-	/** Clean cache message.
-	 *  @see arp_clean_cache()
+	NET_ARP_DEVICE,
+	/** Address translation message.
+	 *  @see arp_translate_req()
 	 */
-	NET_ARP_CLEAN_CACHE,
+	NET_ARP_TRANSLATE
 } arp_messages;
 
Index: uspace/srv/net/il/arp/arp_module.c
===================================================================
--- uspace/srv/net/il/arp/arp_module.c	(revision 9f2ea2842550ba0536881449ffe27c8947d72804)
+++ uspace/srv/net/il/arp/arp_module.c	(revision a64c64d04f3d981abf5d095ae65ed7ed4b40a244)
@@ -58,4 +58,18 @@
 #define NAME	"ARP protocol"
 
+/** ARP module global data.
+ */
+extern arp_globals_t	arp_globals;
+
+/** Processes the ARP message.
+ *  @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 Other error codes as defined for the arp_message() function.
+ */
+int module_message(ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count);
+
 /** Prints the module name.
  *  @see NAME
@@ -72,17 +86,7 @@
 int module_start(async_client_conn_t client_connection);
 
-/** Processes the ARP message.
- *  @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 Other error codes as defined for the arp_message() function.
- */
-int module_message(ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count);
-
-/** ARP module global data.
- */
-extern arp_globals_t	arp_globals;
+int 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);
+}
 
 void module_print_name(void){
@@ -110,8 +114,4 @@
 }
 
-int 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);
-}
-
 /** @}
  */
Index: uspace/srv/net/il/arp/arp_oc.h
===================================================================
--- uspace/srv/net/il/arp/arp_oc.h	(revision 9f2ea2842550ba0536881449ffe27c8947d72804)
+++ uspace/srv/net/il/arp/arp_oc.h	(revision a64c64d04f3d981abf5d095ae65ed7ed4b40a244)
@@ -44,81 +44,81 @@
 /** REQUEST operation code.
  */
-#define ARPOP_REQUEST		1
+#define ARPOP_REQUEST					1
 
 /** REPLY operation code.
  */
-#define ARPOP_REPLY		2
+#define ARPOP_REPLY						2
 
 /** Reverse request operation code.
  */
-#define ARPOP_RREQUEST		3
+#define ARPOP_RREQUEST					3
 
 /** Reverse reply operation code.
  */
-#define ARPOP_RREPLY		4
+#define ARPOP_RREPLY					4
 
 /** DRARP-Request operation code.
  */
-#define ARPOP_DRARP_Request		5
+#define ARPOP_DRARP_Request				5
 
 /** DRARP-Reply operation code.
  */
-#define ARPOP_DRARP_Reply		6
+#define ARPOP_DRARP_Reply				6
 
 /** DRARP-Error operation code.
  */
-#define ARPOP_DRARP_Error		7
+#define ARPOP_DRARP_Error				7
 
 /** InARP-Request operation code.
  */
-#define ARPOP_InREQUEST		8
+#define ARPOP_InREQUEST					8
 
 /** InARP-Reply operation code.
  */
-#define ARPOP_InREPLY		9
+#define ARPOP_InREPLY					9
 
 /** ARP-NAK operation code.
  */
-#define ARPOP_NAK		10
+#define ARPOP_NAK						10
 
 /** MARS-Request operation code.
  */
-#define ARPOP_MARS_Request		11
+#define ARPOP_MARS_Request				11
 
 /** MARS-Multi operation code.
  */
-#define ARPOP_MARS_Multi		12
+#define ARPOP_MARS_Multi				12
 
 /** MARS-MServ operation code.
  */
-#define ARPOP_MARS_MServ		13
+#define ARPOP_MARS_MServ				13
 
 /** MARS-Join operation code.
  */
-#define ARPOP_MARS_Join		14
+#define ARPOP_MARS_Join					14
 
 /** MARS-Leave operation code.
  */
-#define ARPOP_MARS_Leave		15
+#define ARPOP_MARS_Leave				15
 
 /** MARS-NAK operation code.
  */
-#define ARPOP_MARS_NAK		16
+#define ARPOP_MARS_NAK					16
 
 /** MARS-Unserv operation code.
  */
-#define ARPOP_MARS_Unserv		17
+#define ARPOP_MARS_Unserv				17
 
 /** MARS-SJoin operation code.
  */
-#define ARPOP_MARS_SJoin		18
+#define ARPOP_MARS_SJoin				18
 
 /** MARS-SLeave operation code.
  */
-#define ARPOP_MARS_SLeave		19
+#define ARPOP_MARS_SLeave				19
 
 /** MARS-Grouplist-Request operation code.
  */
-#define ARPOP_MARS_Grouplist_Request		20
+#define ARPOP_MARS_Grouplist_Request	20
 
 /** MARS-Grouplist-Reply operation code.
@@ -128,9 +128,9 @@
 /** MARS-Redirect-Map operation code.
  */
-#define ARPOP_MARS_Redirect_Map		22
+#define ARPOP_MARS_Redirect_Map			22
 
 /** MAPOS-UNARP operation code.
  */
-#define ARPOP_MAPOS_UNARP		23
+#define ARPOP_MAPOS_UNARP				23
 
 /*@}*/
Index: uspace/srv/net/il/arp/arp_remote.c
===================================================================
--- uspace/srv/net/il/arp/arp_remote.c	(revision 9f2ea2842550ba0536881449ffe27c8947d72804)
+++ uspace/srv/net/il/arp/arp_remote.c	(revision a64c64d04f3d981abf5d095ae65ed7ed4b40a244)
@@ -52,20 +52,13 @@
 #include "arp_messages.h"
 
-int arp_device_req(int arp_phone, device_id_t device_id, services_t protocol, services_t netif, measured_string_ref address){
-	aid_t message_id;
-	ipcarg_t result;
-
-	message_id = async_send_3(arp_phone, NET_ARP_DEVICE, (ipcarg_t) device_id, protocol, netif, NULL);
-	measured_strings_send(arp_phone, address, 1);
-	async_wait_for(message_id, &result);
-	return (int) result;
+int arp_connect_module(services_t service){
+	if(service != SERVICE_ARP){
+		return EINVAL;
+	}
+	return connect_to_service(SERVICE_ARP);
 }
 
-int arp_translate_req(int arp_phone, device_id_t device_id, services_t protocol, measured_string_ref address, measured_string_ref * translation, char ** data){
-	return generic_translate_req(arp_phone, NET_ARP_TRANSLATE, device_id, protocol, address, 1, translation, data);
-}
-
-int arp_clear_device_req(int arp_phone, device_id_t device_id){
-	return (int) async_req_1_0(arp_phone, NET_ARP_CLEAR_DEVICE, (ipcarg_t) device_id);
+int arp_clean_cache_req(int arp_phone){
+	return (int) async_req_0_0(arp_phone, NET_ARP_CLEAN_CACHE);
 }
 
@@ -80,13 +73,16 @@
 }
 
-int arp_clean_cache_req(int arp_phone){
-	return (int) async_req_0_0(arp_phone, NET_ARP_CLEAN_CACHE);
+int arp_clear_device_req(int arp_phone, device_id_t device_id){
+	return (int) async_req_1_0(arp_phone, NET_ARP_CLEAR_DEVICE, (ipcarg_t) device_id);
 }
 
-int arp_connect_module(services_t service){
-	if(service != SERVICE_ARP){
-		return EINVAL;
-	}
-	return connect_to_service(SERVICE_ARP);
+int arp_device_req(int arp_phone, device_id_t device_id, services_t protocol, services_t netif, measured_string_ref address){
+	aid_t message_id;
+	ipcarg_t result;
+
+	message_id = async_send_3(arp_phone, NET_ARP_DEVICE, (ipcarg_t) device_id, protocol, netif, NULL);
+	measured_strings_send(arp_phone, address, 1);
+	async_wait_for(message_id, &result);
+	return (int) result;
 }
 
@@ -95,4 +91,8 @@
 }
 
+int arp_translate_req(int arp_phone, device_id_t device_id, services_t protocol, measured_string_ref address, measured_string_ref * translation, char ** data){
+	return generic_translate_req(arp_phone, NET_ARP_TRANSLATE, device_id, protocol, address, 1, translation, data);
+}
+
 /** @}
  */
Index: uspace/srv/net/il/il_messages.h
===================================================================
--- uspace/srv/net/il/il_messages.h	(revision 9f2ea2842550ba0536881449ffe27c8947d72804)
+++ uspace/srv/net/il/il_messages.h	(revision a64c64d04f3d981abf5d095ae65ed7ed4b40a244)
@@ -53,4 +53,12 @@
 	 */
 	NET_IL_DEVICE_STATE,
+	/** Device MTU changed message.
+	 *  @see il_mtu_changed_msg()
+	 */
+	NET_IL_MTU_CHANGED,
+	/** Packet size message.
+	 *  @see il_packet_size_req()
+	 */
+	NET_IL_PACKET_SPACE,
 	/** Packet received message.
 	 *  @see il_received_msg()
@@ -60,13 +68,5 @@
 	 *  @see il_send_msg()
 	 */
-	NET_IL_SEND,
-	/** Packet size message.
-	 *  @see il_packet_size_req()
-	 */
-	NET_IL_PACKET_SPACE,
-	/** Device MTU changed message.
-	 *  @see il_mtu_changed_msg()
-	 */
-	NET_IL_MTU_CHANGED
+	NET_IL_SEND
 } il_messages;
 
@@ -83,5 +83,5 @@
  *  @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: uspace/srv/net/il/ip/ip.h
===================================================================
--- uspace/srv/net/il/ip/ip.h	(revision 9f2ea2842550ba0536881449ffe27c8947d72804)
+++ uspace/srv/net/il/ip/ip.h	(revision a64c64d04f3d981abf5d095ae65ed7ed4b40a244)
@@ -106,38 +106,38 @@
  */
 struct	ip_netif{
-	/** Device identifier.
-	 */
-	device_id_t device_id;
-	/** Netif module service.
-	 */
-	services_t service;
-	/** Netif module phone.
-	 */
-	int phone;
 	/** ARP module.
 	 *  Assigned if using ARP.
 	 */
 	module_ref arp;
+	/** Broadcast address.
+	 */
+	in_addr_t broadcast;
+	/** Device identifier.
+	 */
+	device_id_t device_id;
+	/** Indicates whether using DHCP.
+	 */
+	int dhcp;
 	/** IP version.
 	 */
 	int ipv;
-	/** Indicates whether using DHCP.
-	 */
-	int dhcp;
+	/** Packet dimension.
+	 */
+	packet_dimension_t packet_dimension;
+	/** Netif module phone.
+	 */
+	int phone;
+	/** Routing table.
+	 */
+	ip_routes_t routes;
 	/** Indicates whether IP routing is enabled.
 	 */
 	int routing;
+	/** Netif module service.
+	 */
+	services_t service;
 	/** Device state.
 	 */
 	device_state_t state;
-	/** Broadcast address.
-	 */
-	in_addr_t broadcast;
-	/** Routing table.
-	 */
-	ip_routes_t routes;
-	/** Packet dimension.
-	 */
-	packet_dimension_t packet_dimension;
 };
 
@@ -145,16 +145,16 @@
  */
 struct ip_proto{
+	/** Protocol module phone.
+	 */
+	int phone;
 	/** Protocol number.
 	 */
 	int protocol;
+	/** Protocol packet receiving function.
+	 */
+	tl_received_msg_t received_msg;
 	/** Protocol module service.
 	 */
 	services_t service;
-	/** Protocol module phone.
-	 */
-	int phone;
-	/** Protocol packet receiving function.
-	 */
-	tl_received_msg_t received_msg;
 };
 
@@ -165,7 +165,4 @@
 	 */
 	in_addr_t address;
-	/** Target network mask.
-	 */
-	in_addr_t netmask;
 	/** Gateway.
 	 */
@@ -174,4 +171,7 @@
 	 */
 	ip_netif_ref netif;
+	/** Target network mask.
+	 */
+	in_addr_t netmask;
 };
 
@@ -179,4 +179,16 @@
  */
 struct	ip_globals{
+	/** Default client connection function for support modules.
+	 */
+	async_client_conn_t client_connection;
+	/** Default gateway.
+	 */
+	ip_route_t gateway;
+	/** Safety lock.
+	 */
+	fibril_rwlock_t lock;
+	/** Known support modules.
+	 */
+	modules_t modules;
 	/** Networking module phone.
 	 */
@@ -188,4 +200,7 @@
 	 */
 	fibril_rwlock_t netifs_lock;
+	/** Packet counter.
+	 */
+	uint16_t packet_counter;
 	/** Registered protocols.
 	 */
@@ -194,19 +209,4 @@
 	 */
 	fibril_rwlock_t protos_lock;
-	/** Default gateway.
-	 */
-	ip_route_t gateway;
-	/** Known support modules.
-	 */
-	modules_t modules;
-	/** Default client connection function for support modules.
-	 */
-	async_client_conn_t client_connection;
-	/** Packet counter.
-	 */
-	uint16_t packet_counter;
-	/** Safety lock.
-	 */
-	fibril_rwlock_t lock;
 };
 
Index: uspace/srv/net/il/ip/ip_client.c
===================================================================
--- uspace/srv/net/il/ip/ip_client.c	(revision 9f2ea2842550ba0536881449ffe27c8947d72804)
+++ uspace/srv/net/il/ip/ip_client.c	(revision a64c64d04f3d981abf5d095ae65ed7ed4b40a244)
@@ -48,60 +48,4 @@
 #include "ip_header.h"
 
-int ip_client_prepare_packet(packet_t packet, ip_protocol_t protocol, ip_ttl_t ttl, ip_tos_t tos, int dont_fragment, size_t ipopt_length){
-	ip_header_ref header;
-	uint8_t * data;
-	size_t padding;
-
-	padding =  ipopt_length % 4;
-	if(padding){
-		padding = 4 - padding;
-		ipopt_length += padding;
-	}
-	data = (uint8_t *) packet_prefix(packet, sizeof(ip_header_t) + padding);
-	if(! data){
-		return ENOMEM;
-	}
-	while(padding --){
-		data[sizeof(ip_header_t) + padding] = IPOPT_NOOP;
-	}
-	header = (ip_header_ref) data;
-	header->header_length = IP_COMPUTE_HEADER_LENGTH(sizeof(ip_header_t) + ipopt_length);
-	header->ttl = (ttl ? ttl : IPDEFTTL); //(((ttl) <= MAXTTL) ? ttl : MAXTTL) : IPDEFTTL;
-	header->tos = tos;
-	header->protocol = protocol;
-	if(dont_fragment){
-		header->flags = IPFLAG_DONT_FRAGMENT;
-	}
-	return EOK;
-}
-
-int ip_client_process_packet(packet_t packet, ip_protocol_t * protocol, ip_ttl_t * ttl, ip_tos_t * tos, int * dont_fragment, size_t * ipopt_length){
-	ip_header_ref header;
-
-	header = (ip_header_ref) packet_get_data(packet);
-	if((! header)
-		|| (packet_get_data_length(packet) < sizeof(ip_header_t))){
-		return ENOMEM;
-	}
-	if(protocol){
-		*protocol = header->protocol;
-	}
-	if(ttl){
-		*ttl = header->ttl;
-	}
-	if(tos){
-		*tos = header->tos;
-	}
-	if(dont_fragment){
-		*dont_fragment = header->flags &IPFLAG_DONT_FRAGMENT;
-	}
-	if(ipopt_length){
-		*ipopt_length = IP_HEADER_LENGTH(header) - sizeof(ip_header_t);
-		return sizeof(ip_header_t);
-	}else{
-		return IP_HEADER_LENGTH(header);
-	}
-}
-
 size_t ip_client_header_length(packet_t packet){
 	ip_header_ref header;
@@ -113,19 +57,4 @@
 	}
 	return IP_HEADER_LENGTH(header);
-}
-
-int ip_client_set_pseudo_header_data_length(ip_pseudo_header_ref header, size_t headerlen, size_t data_length){
-	ipv4_pseudo_header_ref header_in;
-
-	if(! header){
-		return EBADMEM;
-	}
-	if(headerlen == sizeof(ipv4_pseudo_header_t)){
-		header_in = (ipv4_pseudo_header_ref) header;
-		header_in->data_length = htons(data_length);
-		return EOK;
-	}else{
-		return EINVAL;
-	}
 }
 
@@ -140,4 +69,5 @@
 		return EINVAL;
 	}
+
 	switch(src->sa_family){
 		case AF_INET:
@@ -171,4 +101,87 @@
 }
 
+int ip_client_prepare_packet(packet_t packet, ip_protocol_t protocol, ip_ttl_t ttl, ip_tos_t tos, int dont_fragment, size_t ipopt_length){
+	ip_header_ref header;
+	uint8_t * data;
+	size_t padding;
+
+	// compute the padding if IP options are set
+	// multiple of 4 bytes
+	padding =  ipopt_length % 4;
+	if(padding){
+		padding = 4 - padding;
+		ipopt_length += padding;
+	}
+
+	// prefix the header
+	data = (uint8_t *) packet_prefix(packet, sizeof(ip_header_t) + padding);
+	if(! data){
+		return ENOMEM;
+	}
+
+	// add the padding
+	while(padding --){
+		data[sizeof(ip_header_t) + padding] = IPOPT_NOOP;
+	}
+
+	// set the header
+	header = (ip_header_ref) data;
+	header->header_length = IP_COMPUTE_HEADER_LENGTH(sizeof(ip_header_t) + ipopt_length);
+	header->ttl = (ttl ? ttl : IPDEFTTL); //(((ttl) <= MAXTTL) ? ttl : MAXTTL) : IPDEFTTL;
+	header->tos = tos;
+	header->protocol = protocol;
+
+	if(dont_fragment){
+		header->flags = IPFLAG_DONT_FRAGMENT;
+	}
+	return EOK;
+}
+
+int ip_client_process_packet(packet_t packet, ip_protocol_t * protocol, ip_ttl_t * ttl, ip_tos_t * tos, int * dont_fragment, size_t * ipopt_length){
+	ip_header_ref header;
+
+	header = (ip_header_ref) packet_get_data(packet);
+	if((! header)
+		|| (packet_get_data_length(packet) < sizeof(ip_header_t))){
+		return ENOMEM;
+	}
+
+	if(protocol){
+		*protocol = header->protocol;
+	}
+	if(ttl){
+		*ttl = header->ttl;
+	}
+	if(tos){
+		*tos = header->tos;
+	}
+	if(dont_fragment){
+		*dont_fragment = header->flags &IPFLAG_DONT_FRAGMENT;
+	}
+	if(ipopt_length){
+		*ipopt_length = IP_HEADER_LENGTH(header) - sizeof(ip_header_t);
+		return sizeof(ip_header_t);
+	}else{
+		return IP_HEADER_LENGTH(header);
+	}
+}
+
+int ip_client_set_pseudo_header_data_length(ip_pseudo_header_ref header, size_t headerlen, size_t data_length){
+	ipv4_pseudo_header_ref header_in;
+
+	if(! header){
+		return EBADMEM;
+	}
+
+	if(headerlen == sizeof(ipv4_pseudo_header_t)){
+		header_in = (ipv4_pseudo_header_ref) header;
+		header_in->data_length = htons(data_length);
+		return EOK;
+	// TODO IPv6
+	}else{
+		return EINVAL;
+	}
+}
+
 /** @}
  */
Index: uspace/srv/net/il/ip/ip_header.h
===================================================================
--- uspace/srv/net/il/ip/ip_header.h	(revision 9f2ea2842550ba0536881449ffe27c8947d72804)
+++ uspace/srv/net/il/ip/ip_header.h	(revision a64c64d04f3d981abf5d095ae65ed7ed4b40a244)
@@ -42,8 +42,13 @@
 #include <sys/types.h>
 
-/** Returns the actual IP header length in bytes.
- *  @param[in] header The IP packet header.
- */
-#define IP_HEADER_LENGTH(header)		((header)->header_length * 4u)
+/** Returns the fragment offest high bits.
+ *  @param[in] length The prefixed data total length.
+ */
+#define IP_COMPUTE_FRAGMENT_OFFSET_HIGH(length) ((((length) / 8u) &0x1F00) >> 8)
+
+/** Returns the fragment offest low bits.
+ *  @param[in] length The prefixed data total length.
+ */
+#define IP_COMPUTE_FRAGMENT_OFFSET_LOW(length) (((length) / 8u) &0xFF)
 
 /** Returns the IP header length.
@@ -52,4 +57,24 @@
 #define IP_COMPUTE_HEADER_LENGTH(length)		((uint8_t) ((length) / 4u))
 
+/** Returns the fragment offest.
+ *  @param[in] header The IP packet header.
+ */
+#define IP_FRAGMENT_OFFSET(header) ((((header)->fragment_offset_high << 8) + (header)->fragment_offset_low) * 8u)
+
+/** Returns the IP packet header checksum.
+ *  @param[in] header The IP packet header.
+ */
+#define IP_HEADER_CHECKSUM(header)	(htons(ip_checksum((uint8_t *)(header), IP_HEADER_LENGTH(header))))
+
+/** Returns the actual IP packet data length.
+ *  @param[in] header The IP packet header.
+ */
+#define IP_HEADER_DATA_LENGTH(header)	(IP_TOTAL_LENGTH(header) - IP_HEADER_LENGTH(header))
+
+/** Returns the actual IP header length in bytes.
+ *  @param[in] header The IP packet header.
+ */
+#define IP_HEADER_LENGTH(header)		((header)->header_length * 4u)
+
 /** Returns the actual IP packet total length.
  *  @param[in] header The IP packet header.
@@ -57,28 +82,37 @@
 #define IP_TOTAL_LENGTH(header)		ntohs((header)->total_length)
 
-/** Returns the actual IP packet data length.
- *  @param[in] header The IP packet header.
- */
-#define IP_HEADER_DATA_LENGTH(header)	(IP_TOTAL_LENGTH(header) - IP_HEADER_LENGTH(header))
-
-/** Returns the IP packet header checksum.
- *  @param[in] header The IP packet header.
- */
-#define IP_HEADER_CHECKSUM(header)	(htons(ip_checksum((uint8_t *)(header), IP_HEADER_LENGTH(header))))
-
-/** Returns the fragment offest.
- *  @param[in] header The IP packet header.
- */
-#define IP_FRAGMENT_OFFSET(header) ((((header)->fragment_offset_high << 8) + (header)->fragment_offset_low) * 8u)
-
-/** Returns the fragment offest high bits.
- *  @param[in] length The prefixed data total length.
- */
-#define IP_COMPUTE_FRAGMENT_OFFSET_HIGH(length) ((((length) / 8u) &0x1F00) >> 8)
-
-/** Returns the fragment offest low bits.
- *  @param[in] length The prefixed data total length.
- */
-#define IP_COMPUTE_FRAGMENT_OFFSET_LOW(length) (((length) / 8u) &0xFF)
+/** @name IP flags definitions
+ */
+/*@{*/
+
+/** Fragment flag field shift.
+ */
+#define IPFLAG_FRAGMENT_SHIFT		1
+
+/** Fragmented flag field shift.
+ */
+#define IPFLAG_FRAGMENTED_SHIFT		0
+
+/** Don't fragment flag value.
+ *  Permits the packet fragmentation.
+ */
+#define IPFLAG_DONT_FRAGMENT		(0x1 << IPFLAG_FRAGMENT_SHIFT)
+
+/** Last fragment flag value.
+ *  Indicates the last packet fragment.
+ */
+#define IPFLAG_LAST_FRAGMENT		(0x0 << IPFLAG_FRAGMENTED_SHIFT)
+
+/** May fragment flag value.
+ *  Allows the packet fragmentation.
+ */
+#define IPFLAG_MAY_FRAGMENT			(0x0 << IPFLAG_FRAGMENT_SHIFT)
+
+/** More fragments flag value.
+ *  Indicates that more packet fragments follow.
+ */
+#define IPFLAG_MORE_FRAGMENTS		(0x1 << IPFLAG_FRAGMENTED_SHIFT)
+
+/*@}*/
 
 /** Type definition of the internet header.
@@ -91,4 +125,24 @@
  */
 typedef ip_header_t *		ip_header_ref;
+
+/** Type definition of the internet option header.
+ *  @see ip_header
+ */
+typedef struct ip_option	ip_option_t;
+
+/** Type definition of the internet option header pointer.
+ *  @see ip_header
+ */
+typedef ip_option_t *		ip_option_ref;
+
+/** Type definition of the internet version 4 pseudo header.
+ *  @see ipv4_pseudo_header
+ */
+typedef struct ipv4_pseudo_header	ipv4_pseudo_header_t;
+
+/** Type definition of the internet version 4 pseudo header pointer.
+ *  @see ipv4_pseudo_header
+ */
+typedef ipv4_pseudo_header_t *		ipv4_pseudo_header_ref;
 
 /** Internet header.
@@ -171,14 +225,4 @@
 } __attribute__ ((packed));
 
-/** Type definition of the internet option header.
- *  @see ip_header
- */
-typedef struct ip_option	ip_option_t;
-
-/** Type definition of the internet option header pointer.
- *  @see ip_header
- */
-typedef ip_option_t *		ip_option_ref;
-
 /** Internet option header.
  *  Only type field is always valid.
@@ -212,48 +256,4 @@
 } __attribute__ ((packed));
 
-/** @name IP flags definitions
- */
-/*@{*/
-
-/** Fragment flag field shift.
- */
-#define IPFLAG_FRAGMENT_SHIFT		1
-
-/** Fragmented flag field shift.
- */
-#define IPFLAG_FRAGMENTED_SHIFT		0
-
-/** May fragment flag value.
- *  Allows the packet fragmentation.
- */
-#define IPFLAG_MAY_FRAGMENT			(0x0 << IPFLAG_FRAGMENT_SHIFT)
-
-/** Don't fragment flag value.
- *  Permits the packet fragmentation.
- */
-#define IPFLAG_DONT_FRAGMENT		(0x1 << IPFLAG_FRAGMENT_SHIFT)
-
-/** Last fragment flag value.
- *  Indicates the last packet fragment.
- */
-#define IPFLAG_LAST_FRAGMENT		(0x0 << IPFLAG_FRAGMENTED_SHIFT)
-
-/** More fragments flag value.
- *  Indicates that more packet fragments follow.
- */
-#define IPFLAG_MORE_FRAGMENTS		(0x1 << IPFLAG_FRAGMENTED_SHIFT)
-
-/*@}*/
-
-/** Type definition of the internet version 4 pseudo header.
- *  @see ipv4_pseudo_header
- */
-typedef struct ipv4_pseudo_header	ipv4_pseudo_header_t;
-
-/** Type definition of the internet version 4 pseudo header pointer.
- *  @see ipv4_pseudo_header
- */
-typedef ipv4_pseudo_header_t *		ipv4_pseudo_header_ref;
-
 /** Internet version 4 pseudo header.
  */
Index: uspace/srv/net/il/ip/ip_messages.h
===================================================================
--- uspace/srv/net/il/ip/ip_messages.h	(revision 9f2ea2842550ba0536881449ffe27c8947d72804)
+++ uspace/srv/net/il/ip/ip_messages.h	(revision a64c64d04f3d981abf5d095ae65ed7ed4b40a244)
@@ -51,16 +51,16 @@
 	 */
 	NET_IP_ADD_ROUTE = NET_IP_FIRST,
-	/** Sets the default gateway.
-	 *  @see ip_set_default_gateway()
+	/** Gets the actual route information.
+	 *  @see ip_get_route()
 	 */
-	NET_IP_SET_GATEWAY,
+	NET_IP_GET_ROUTE,
 	/** Processes the received error notification.
 	 *  @see ip_received_error_msg()
 	 */
 	NET_IP_RECEIVED_ERROR,
-	/** Gets the actual route information.
-	 *  @see ip_get_route()
+	/** Sets the default gateway.
+	 *  @see ip_set_default_gateway()
 	 */
-	NET_IP_GET_ROUTE
+	NET_IP_SET_GATEWAY
 } ip_messages;
 
@@ -69,4 +69,9 @@
 /*@{*/
 
+/** Returns the address message parameter.
+ *  @param[in] call The message call structure.
+ */
+#define IP_GET_ADDRESS(call)		({in_addr_t addr; addr.s_addr = IPC_GET_ARG3(*call); addr;})
+
 /** Returns the gateway message parameter.
  *  @param[in] call The message call structure.
@@ -74,8 +79,8 @@
 #define IP_GET_GATEWAY(call)		({in_addr_t addr; addr.s_addr = IPC_GET_ARG2(*call); addr;})
 
-/** Returns the address message parameter.
- *  @param[in] call The message call structure.
+/** Sets the header length in the message answer.
+ *  @param[out] answer The message answer structure.
  */
-#define IP_GET_ADDRESS(call)		({in_addr_t addr; addr.s_addr = IPC_GET_ARG3(*call); addr;})
+#define IP_SET_HEADERLEN(answer)	((size_t *) &IPC_GET_ARG2(*answer))
 
 /** Returns the network mask message parameter.
@@ -89,9 +94,4 @@
 #define IP_GET_PROTOCOL(call)		((ip_protocol_t) IPC_GET_ARG1(*call))
 
-/** Sets the header length in the message answer.
- *  @param[out] answer The message answer structure.
- */
-#define IP_SET_HEADERLEN(answer)	((size_t *) &IPC_GET_ARG2(*answer))
-
 /*@}*/
 
Index: uspace/srv/net/il/ip/ip_module.c
===================================================================
--- uspace/srv/net/il/ip/ip_module.c	(revision 9f2ea2842550ba0536881449ffe27c8947d72804)
+++ uspace/srv/net/il/ip/ip_module.c	(revision a64c64d04f3d981abf5d095ae65ed7ed4b40a244)
@@ -58,4 +58,18 @@
 #define NAME	"IP protocol"
 
+/** IP module global data.
+ */
+extern ip_globals_t	ip_globals;
+
+/** Processes the IP message.
+ *  @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 Other error codes as defined for the ip_message() function.
+ */
+int module_message(ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count);
+
 /** Prints the module name.
  *  @see NAME
@@ -72,17 +86,7 @@
 int module_start(async_client_conn_t client_connection);
 
-/** Processes the IP message.
- *  @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 Other error codes as defined for the ip_message() function.
- */
-int module_message(ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count);
-
-/** IP module global data.
- */
-extern ip_globals_t	ip_globals;
+int 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);
+}
 
 void module_print_name(void){
@@ -110,8 +114,4 @@
 }
 
-int 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);
-}
-
 /** @}
  */
Index: uspace/srv/net/il/ip/ip_remote.c
===================================================================
--- uspace/srv/net/il/ip/ip_remote.c	(revision 9f2ea2842550ba0536881449ffe27c8947d72804)
+++ uspace/srv/net/il/ip/ip_remote.c	(revision a64c64d04f3d981abf5d095ae65ed7ed4b40a244)
@@ -52,10 +52,10 @@
 #include "ip_messages.h"
 
-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_add_route_req(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, (ipcarg_t) device_id, (ipcarg_t) gateway.s_addr, (ipcarg_t) address.s_addr, (ipcarg_t) netmask.s_addr);
 }
 
-int ip_send_msg(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, packet_get_id(packet), sender, error);
+int ip_bind_service(services_t service, int protocol, services_t me, async_client_conn_t receiver, tl_received_msg_t tl_received_msg){
+	return (int) bind_service(service, (ipcarg_t) protocol, me, service, receiver);
 }
 
@@ -64,22 +64,6 @@
 }
 
-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){
-	return (int) async_req_4_0(ip_phone, NET_IP_ADD_ROUTE, (ipcarg_t) device_id, (ipcarg_t) gateway.s_addr, (ipcarg_t) address.s_addr, (ipcarg_t) netmask.s_addr);
-}
-
-int ip_set_gateway_req(int ip_phone, device_id_t device_id, in_addr_t gateway){
-	return (int) async_req_2_0(ip_phone, NET_IP_SET_GATEWAY, (ipcarg_t) device_id, (ipcarg_t) gateway.s_addr);
-}
-
-int ip_packet_size_req(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, packet_dimension);
-}
-
-int ip_bind_service(services_t service, int protocol, services_t me, async_client_conn_t receiver, tl_received_msg_t tl_received_msg){
-	return (int) bind_service(service, (ipcarg_t) protocol, me, service, receiver);
-}
-
-int ip_received_error_msg(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_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);
 }
 
@@ -95,4 +79,5 @@
 		return EBADMEM;
 	}
+
 	*header = NULL;
 	message_id = async_send_1(ip_phone, NET_IP_GET_ROUTE, (ipcarg_t) protocol, &answer);
@@ -108,4 +93,5 @@
 	}
 	async_wait_for(message_id, &result);
+
 	if((result != EOK) && (*header)){
 		free(*header);
@@ -116,4 +102,20 @@
 }
 
+int ip_packet_size_req(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, packet_dimension);
+}
+
+int ip_received_error_msg(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, services_t sender, services_t error){
+	return generic_send_msg(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){
+	return (int) async_req_2_0(ip_phone, NET_IP_SET_GATEWAY, (ipcarg_t) device_id, (ipcarg_t) gateway.s_addr);
+}
+
 /** @}
  */
Index: uspace/srv/net/inet.c
===================================================================
--- uspace/srv/net/inet.c	(revision 9f2ea2842550ba0536881449ffe27c8947d72804)
+++ uspace/srv/net/inet.c	(revision a64c64d04f3d981abf5d095ae65ed7ed4b40a244)
@@ -45,11 +45,45 @@
 #include "include/socket_codes.h"
 
+int inet_ntop(uint16_t family, const uint8_t * data, char * address, size_t length){
+	if((! data) || (! address)){
+		return EINVAL;
+	}
+
+	switch(family){
+		case AF_INET:
+			// check the output buffer size
+			if(length < INET_ADDRSTRLEN){
+				return ENOMEM;
+			}
+			// fill the buffer with the IPv4 address
+			snprintf(address, length, "%hhu.%hhu.%hhu.%hhu", data[0], data[1], data[2], data[3]);
+			return EOK;
+		case AF_INET6:
+			// check the output buffer size
+			if(length < INET6_ADDRSTRLEN){
+				return ENOMEM;
+			}
+			// fill the buffer with the IPv6 address
+			snprintf(address, length, "%hhx%hhx:%hhx%hhx:%hhx%hhx:%hhx%hhx:%hhx%hhx:%hhx%hhx:%hhx%hhx:%hhx%hhx", data[0], data[1], data[2], data[3], data[4], data[5], data[6], data[7], data[8], data[9], data[10], data[11], data[12], data[13], data[14], data[15]);
+			return EOK;
+		default:
+			return ENOTSUP;
+	}
+}
+
 int inet_pton(uint16_t family, const char * address, uint8_t * data){
+	/** The base number of the values.
+	 */
+	int base;
+	/** The number of bytes per a section.
+	 */
+	size_t bytes;
+	/** The number of bytes of the address data.
+	 */
+	int count;
+
 	const char * next;
 	char * last;
 	int index;
-	int count;
-	int base;
-	size_t bytes;
 	size_t shift;
 	unsigned long value;
@@ -58,4 +92,6 @@
 		return EINVAL;
 	}
+
+	// set the processing parameters
 	switch(family){
 		case AF_INET:
@@ -72,17 +108,31 @@
 			return ENOTSUP;
 	}
+
+	// erase if no address
 	if(! address){
 		bzero(data, count);
 		return ENOENT;
 	}
+
+	// process the string from the beginning
 	next = address;
 	index = 0;
 	do{
+		// if the actual character is set
 		if(next && (*next)){
+
+			// if not on the first character
 			if(index){
+				// move to the next character
 				++ next;
 			}
+
+			// parse the actual integral value
 			value = strtoul(next, &last, base);
+			// remember the last problematic character
+			// should be either '.' or ':' but is ignored to be more generic
 			next = last;
+
+			// fill the address data byte by byte
 			shift = bytes - 1;
 			do{
@@ -91,33 +141,14 @@
 				value >>= 8;
 			}while(shift --);
+
 			index += bytes;
 		}else{
+			// erase the rest of the address
 			bzero(data + index, count - index);
 			return EOK;
 		}
 	}while(index < count);
+
 	return EOK;
-}
-
-int inet_ntop(uint16_t family, const uint8_t * data, char * address, size_t length){
-	if((! data) || (! address)){
-		return EINVAL;
-	}
-	switch(family){
-		case AF_INET:
-			if(length < INET_ADDRSTRLEN){
-				return ENOMEM;
-			}
-			snprintf(address, length, "%hhu.%hhu.%hhu.%hhu", data[0], data[1], data[2], data[3]);
-			return EOK;
-		case AF_INET6:
-			if(length < INET6_ADDRSTRLEN){
-				return ENOMEM;
-			}
-			snprintf(address, length, "%hhx%hhx:%hhx%hhx:%hhx%hhx:%hhx%hhx:%hhx%hhx:%hhx%hhx:%hhx%hhx:%hhx%hhx", data[0], data[1], data[2], data[3], data[4], data[5], data[6], data[7], data[8], data[9], data[10], data[11], data[12], data[13], data[14], data[15]);
-			return EOK;
-		default:
-			return ENOTSUP;
-	}
 }
 
Index: uspace/srv/net/messages.h
===================================================================
--- uspace/srv/net/messages.h	(revision 9f2ea2842550ba0536881449ffe27c8947d72804)
+++ uspace/srv/net/messages.h	(revision a64c64d04f3d981abf5d095ae65ed7ed4b40a244)
@@ -48,182 +48,4 @@
 #include "structures/packet/packet.h"
 
-/** @name Networking message counts
- */
-/*@{*/
-
-/** The number of network interface driver messages.
- */
-#define NET_NETIF_COUNT		6
-
-/** The number of general networking messages.
- */
-#define NET_NET_COUNT		3
-
-/** The number of network interface layer messages.
- */
-#define NET_NIL_COUNT		7
-
-/** The number of Ethernet messages.
- */
-#define NET_ETH_COUNT		0
-
-/** The number of inter-network messages.
- */
-#define NET_IL_COUNT		6
-
-/** The number of IP messages.
- */
-#define NET_IP_COUNT		4
-
-/** The number of ARP messages.
- */
-#define NET_ARP_COUNT		5
-
-/** The number of ICMP messages.
- */
-#define NET_ICMP_COUNT		6
-
-/** The number of transport layer messages.
- */
-#define NET_TL_COUNT		1
-
-/** The number of UDP messages.
- */
-#define NET_UDP_COUNT		0
-
-/** The number of TCP messages.
- */
-#define NET_TCP_COUNT		0
-
-/** The number of packet management system messages.
- */
-#define NET_PACKET_COUNT	5
-
-/** The number of socket messages.
- */
-#define NET_SOCKET_COUNT	14
-
-/*@}*/
-
-/** @name Networking message intervals
- */
-/*@{*/
-
-/** The first networking message.
- */
-#define NET_FIRST			2000
-
-/** The first network interface layer message.
- */
-#define NET_NETIF_FIRST		NET_FIRST
-
-/** The last network interface layer message.
- */
-#define NET_NETIF_LAST		(NET_NETIF_FIRST + NET_NETIF_COUNT)
-
-/** The first general networking message.
- */
-#define NET_NET_FIRST		(NET_NETIF_LAST + 0)
-
-/** The last general networking message.
- */
-#define NET_NET_LAST		(NET_NET_FIRST + NET_NET_COUNT)
-
-/** The first network interface layer message.
- */
-#define NET_NIL_FIRST		(NET_NET_LAST + 0)
-
-/** The last network interface layer message.
- */
-#define NET_NIL_LAST		(NET_NIL_FIRST + NET_NIL_COUNT)
-
-/** The first Ethernet message.
- */
-#define NET_ETH_FIRST		(NET_NIL_LAST + 0)
-
-/** The last Ethernet message.
- */
-#define NET_ETH_LAST		(NET_ETH_FIRST + NET_ETH_COUNT)
-
-/** The first inter-network message.
- */
-#define NET_IL_FIRST		(NET_ETH_LAST + 0)
-
-/** The last inter-network message.
- */
-#define NET_IL_LAST			(NET_IL_FIRST + NET_IL_COUNT)
-
-/** The first IP message.
- */
-#define NET_IP_FIRST		(NET_IL_LAST + 0)
-
-/** The last IP message.
- */
-#define NET_IP_LAST			(NET_IP_FIRST + NET_IP_COUNT)
-
-/** The first ARP message.
- */
-#define NET_ARP_FIRST		(NET_IP_LAST + 0)
-
-/** The last ARP message.
- */
-#define NET_ARP_LAST		(NET_ARP_FIRST + NET_ARP_COUNT)
-
-/** The first ICMP message.
- */
-#define NET_ICMP_FIRST		(NET_ARP_LAST + 0)
-
-/** The last ICMP message.
- */
-#define NET_ICMP_LAST		(NET_ICMP_FIRST + NET_ICMP_COUNT)
-
-/** The first ICMP message.
- */
-#define NET_TL_FIRST		(NET_ICMP_LAST + 0)
-
-/** The last ICMP message.
- */
-#define NET_TL_LAST			(NET_TL_FIRST + NET_TL_COUNT)
-
-/** The first UDP message.
- */
-#define NET_UDP_FIRST		(NET_TL_LAST + 0)
-
-/** The last UDP message.
- */
-#define NET_UDP_LAST		(NET_UDP_FIRST + NET_UDP_COUNT)
-
-/** The first TCP message.
- */
-#define NET_TCP_FIRST		(NET_UDP_LAST + 0)
-
-/** The last TCP message.
- */
-#define NET_TCP_LAST		(NET_TCP_FIRST + NET_TCP_COUNT)
-
-/** The first socket message.
- */
-#define NET_SOCKET_FIRST	(NET_TCP_LAST + 0)
-
-/** The last socket message.
- */
-#define NET_SOCKET_LAST		(NET_SOCKET_FIRST + NET_SOCKET_COUNT)
-
-/** The first packet management system message.
- */
-#define NET_PACKET_FIRST	(NET_SOCKET_LAST + 0)
-
-/** The last packet management system message.
- */
-#define NET_PACKET_LAST		(NET_PACKET_FIRST + NET_PACKET_COUNT)
-
-/** The last networking message.
- */
-#define NET_LAST			NET_PACKET_LAST
-
-/** The number of networking messages.
- */
-#define NET_COUNT			(NET_LAST - NET_FIRST)
-
 /** Returns a value indicating whether the value is in the interval.
  *  @param[in] item The value to be checked.
@@ -233,4 +55,182 @@
 #define IS_IN_INTERVAL(item, first_inclusive, last_exclusive)	(((item) >= (first_inclusive)) && ((item) < (last_exclusive)))
 
+/** @name Networking message counts
+ */
+/*@{*/
+
+/** The number of ARP messages.
+ */
+#define NET_ARP_COUNT		5
+
+/** The number of Ethernet messages.
+ */
+#define NET_ETH_COUNT		0
+
+/** The number of ICMP messages.
+ */
+#define NET_ICMP_COUNT		6
+
+/** The number of inter-network messages.
+ */
+#define NET_IL_COUNT		6
+
+/** The number of IP messages.
+ */
+#define NET_IP_COUNT		4
+
+/** The number of general networking messages.
+ */
+#define NET_NET_COUNT		3
+
+/** The number of network interface driver messages.
+ */
+#define NET_NETIF_COUNT		6
+
+/** The number of network interface layer messages.
+ */
+#define NET_NIL_COUNT		7
+
+/** The number of packet management system messages.
+ */
+#define NET_PACKET_COUNT	5
+
+/** The number of socket messages.
+ */
+#define NET_SOCKET_COUNT	14
+
+/** The number of TCP messages.
+ */
+#define NET_TCP_COUNT		0
+
+/** The number of transport layer messages.
+ */
+#define NET_TL_COUNT		1
+
+/** The number of UDP messages.
+ */
+#define NET_UDP_COUNT		0
+
+/*@}*/
+
+/** @name Networking message intervals
+ */
+/*@{*/
+
+/** The first networking message.
+ */
+#define NET_FIRST			2000
+
+/** The first network interface layer message.
+ */
+#define NET_NETIF_FIRST		NET_FIRST
+
+/** The last network interface layer message.
+ */
+#define NET_NETIF_LAST		(NET_NETIF_FIRST + NET_NETIF_COUNT)
+
+/** The first general networking message.
+ */
+#define NET_NET_FIRST		(NET_NETIF_LAST + 0)
+
+/** The last general networking message.
+ */
+#define NET_NET_LAST		(NET_NET_FIRST + NET_NET_COUNT)
+
+/** The first network interface layer message.
+ */
+#define NET_NIL_FIRST		(NET_NET_LAST + 0)
+
+/** The last network interface layer message.
+ */
+#define NET_NIL_LAST		(NET_NIL_FIRST + NET_NIL_COUNT)
+
+/** The first Ethernet message.
+ */
+#define NET_ETH_FIRST		(NET_NIL_LAST + 0)
+
+/** The last Ethernet message.
+ */
+#define NET_ETH_LAST		(NET_ETH_FIRST + NET_ETH_COUNT)
+
+/** The first inter-network message.
+ */
+#define NET_IL_FIRST		(NET_ETH_LAST + 0)
+
+/** The last inter-network message.
+ */
+#define NET_IL_LAST			(NET_IL_FIRST + NET_IL_COUNT)
+
+/** The first IP message.
+ */
+#define NET_IP_FIRST		(NET_IL_LAST + 0)
+
+/** The last IP message.
+ */
+#define NET_IP_LAST			(NET_IP_FIRST + NET_IP_COUNT)
+
+/** The first ARP message.
+ */
+#define NET_ARP_FIRST		(NET_IP_LAST + 0)
+
+/** The last ARP message.
+ */
+#define NET_ARP_LAST		(NET_ARP_FIRST + NET_ARP_COUNT)
+
+/** The first ICMP message.
+ */
+#define NET_ICMP_FIRST		(NET_ARP_LAST + 0)
+
+/** The last ICMP message.
+ */
+#define NET_ICMP_LAST		(NET_ICMP_FIRST + NET_ICMP_COUNT)
+
+/** The first ICMP message.
+ */
+#define NET_TL_FIRST		(NET_ICMP_LAST + 0)
+
+/** The last ICMP message.
+ */
+#define NET_TL_LAST			(NET_TL_FIRST + NET_TL_COUNT)
+
+/** The first UDP message.
+ */
+#define NET_UDP_FIRST		(NET_TL_LAST + 0)
+
+/** The last UDP message.
+ */
+#define NET_UDP_LAST		(NET_UDP_FIRST + NET_UDP_COUNT)
+
+/** The first TCP message.
+ */
+#define NET_TCP_FIRST		(NET_UDP_LAST + 0)
+
+/** The last TCP message.
+ */
+#define NET_TCP_LAST		(NET_TCP_FIRST + NET_TCP_COUNT)
+
+/** The first socket message.
+ */
+#define NET_SOCKET_FIRST	(NET_TCP_LAST + 0)
+
+/** The last socket message.
+ */
+#define NET_SOCKET_LAST		(NET_SOCKET_FIRST + NET_SOCKET_COUNT)
+
+/** The first packet management system message.
+ */
+#define NET_PACKET_FIRST	(NET_SOCKET_LAST + 0)
+
+/** The last packet management system message.
+ */
+#define NET_PACKET_LAST		(NET_PACKET_FIRST + NET_PACKET_COUNT)
+
+/** The last networking message.
+ */
+#define NET_LAST			NET_PACKET_LAST
+
+/** The number of networking messages.
+ */
+#define NET_COUNT			(NET_LAST - NET_FIRST)
+
 /** Returns a value indicating whether the IPC call is a generic networking message.
  *  @param[in] call The IPC call to be checked.
@@ -238,4 +238,29 @@
 #define IS_NET_MESSAGE(call)			IS_IN_INTERVAL(IPC_GET_METHOD(*call), NET_FIRST, NET_LAST)
 
+/** Returns a value indicating whether the IPC call is an ARP message.
+ *  @param[in] call The IPC call to be checked.
+ */
+#define IS_NET_ARP_MESSAGE(call)		IS_IN_INTERVAL(IPC_GET_METHOD(*call), NET_ARP_FIRST, NET_ARP_LAST)
+
+/** Returns a value indicating whether the IPC call is an Ethernet message.
+ *  @param[in] call The IPC call to be checked.
+ */
+#define IS_NET_ETH_MESSAGE(call)		IS_IN_INTERVAL(IPC_GET_METHOD(*call), NET_ETH_FIRST, NET_ETH_LAST)
+
+/** Returns a value indicating whether the IPC call is an ICMP message.
+ *  @param[in] call The IPC call to be checked.
+ */
+#define IS_NET_ICMP_MESSAGE(call)		IS_IN_INTERVAL(IPC_GET_METHOD(*call), NET_ICMP_FIRST, NET_ICMP_LAST)
+
+/** Returns a value indicating whether the IPC call is an inter-network layer message.
+ *  @param[in] call The IPC call to be checked.
+ */
+#define IS_NET_IL_MESSAGE(call)		IS_IN_INTERVAL(IPC_GET_METHOD(*call), NET_IL_FIRST, NET_IL_LAST)
+
+/** Returns a value indicating whether the IPC call is an IP message.
+ *  @param[in] call The IPC call to be checked.
+ */
+#define IS_NET_IP_MESSAGE(call)		IS_IN_INTERVAL(IPC_GET_METHOD(*call), NET_IP_FIRST, NET_IP_LAST)
+
 /** Returns a value indicating whether the IPC call is a generic networking message.
  *  @param[in] call The IPC call to be checked.
@@ -248,28 +273,18 @@
 #define IS_NET_NIL_MESSAGE(call)		IS_IN_INTERVAL(IPC_GET_METHOD(*call), NET_NIL_FIRST, NET_NIL_LAST)
 
-/** Returns a value indicating whether the IPC call is an Ethernet message.
- *  @param[in] call The IPC call to be checked.
- */
-#define IS_NET_ETH_MESSAGE(call)		IS_IN_INTERVAL(IPC_GET_METHOD(*call), NET_ETH_FIRST, NET_ETH_LAST)
-
-/** Returns a value indicating whether the IPC call is an inter-network layer message.
- *  @param[in] call The IPC call to be checked.
- */
-#define IS_NET_IL_MESSAGE(call)		IS_IN_INTERVAL(IPC_GET_METHOD(*call), NET_IL_FIRST, NET_IL_LAST)
-
-/** Returns a value indicating whether the IPC call is an IP message.
- *  @param[in] call The IPC call to be checked.
- */
-#define IS_NET_IP_MESSAGE(call)		IS_IN_INTERVAL(IPC_GET_METHOD(*call), NET_IP_FIRST, NET_IP_LAST)
-
-/** Returns a value indicating whether the IPC call is an ARP message.
- *  @param[in] call The IPC call to be checked.
- */
-#define IS_NET_ARP_MESSAGE(call)		IS_IN_INTERVAL(IPC_GET_METHOD(*call), NET_ARP_FIRST, NET_ARP_LAST)
-
-/** Returns a value indicating whether the IPC call is an ICMP message.
- *  @param[in] call The IPC call to be checked.
- */
-#define IS_NET_ICMP_MESSAGE(call)		IS_IN_INTERVAL(IPC_GET_METHOD(*call), NET_ICMP_FIRST, NET_ICMP_LAST)
+/** Returns a value indicating whether the IPC call is a packet manaagement system message.
+ *  @param[in] call The IPC call to be checked.
+ */
+#define IS_NET_PACKET_MESSAGE(call)	IS_IN_INTERVAL(IPC_GET_METHOD(*call), NET_PACKET_FIRST, NET_PACKET_LAST)
+
+/** Returns a value indicating whether the IPC call is a socket message.
+ *  @param[in] call The IPC call to be checked.
+ */
+#define IS_NET_SOCKET_MESSAGE(call)	IS_IN_INTERVAL(IPC_GET_METHOD(*call), NET_SOCKET_FIRST, NET_SOCKET_LAST)
+
+/** Returns a value indicating whether the IPC call is a TCP message.
+ *  @param[in] call The IPC call to be checked.
+ */
+#define IS_NET_TCP_MESSAGE(call)		IS_IN_INTERVAL(IPC_GET_METHOD(*call), NET_TCP_FIRST, NET_TCP_LAST)
 
 /** Returns a value indicating whether the IPC call is a transport layer message.
@@ -283,74 +298,93 @@
 #define IS_NET_UDP_MESSAGE(call)		IS_IN_INTERVAL(IPC_GET_METHOD(*call), NET_UDP_FIRST, NET_UDP_LAST)
 
-/** Returns a value indicating whether the IPC call is a TCP message.
- *  @param[in] call The IPC call to be checked.
- */
-#define IS_NET_TCP_MESSAGE(call)		IS_IN_INTERVAL(IPC_GET_METHOD(*call), NET_TCP_FIRST, NET_TCP_LAST)
-
-/** Returns a value indicating whether the IPC call is a socket message.
- *  @param[in] call The IPC call to be checked.
- */
-#define IS_NET_SOCKET_MESSAGE(call)	IS_IN_INTERVAL(IPC_GET_METHOD(*call), NET_SOCKET_FIRST, NET_SOCKET_LAST)
-
-/** Returns a value indicating whether the IPC call is a packet manaagement system message.
- *  @param[in] call The IPC call to be checked.
- */
-#define IS_NET_PACKET_MESSAGE(call)	IS_IN_INTERVAL(IPC_GET_METHOD(*call), NET_PACKET_FIRST, NET_PACKET_LAST)
-
-/*@}*/
-
-/** @name Networking specific message parameters definitions
- */
-/*@{*/
-
-/** Returns the device identifier message parameter.
+/*@}*/
+
+/** @name Networking specific message arguments definitions
+ */
+/*@{*/
+
+/** @name First arguments
+ */
+/*@{*/
+
+/** Returns the device identifier message argument.
  *  @param[in] call The message call structure.
  */
 #define IPC_GET_DEVICE(call)		(device_id_t) IPC_GET_ARG1(*call)
 
-/** Returns the packet identifier message parameter.
+/*@}*/
+
+/** @name Second arguments
+ */
+/*@{*/
+
+/** Returns the packet identifier message argument.
  *  @param[in] call The message call structure.
  */
 #define IPC_GET_PACKET(call)		(packet_id_t) IPC_GET_ARG2(*call)
 
-/** Returns the count message parameter.
+/** Returns the count message argument.
  *  @param[in] call The message call structure.
  */
 #define IPC_GET_COUNT(call)		(size_t) IPC_GET_ARG2(*call)
 
-/** Returns the device state message parameter.
+/** Returns the device state message argument.
  *  @param[in] call The message call structure.
  */
 #define IPC_GET_STATE(call)		(device_state_t) IPC_GET_ARG2(*call)
 
-/** Returns the maximum transmission unit message parameter.
+/** Returns the maximum transmission unit message argument.
  *  @param[in] call The message call structure.
  */
 #define IPC_GET_MTU(call)			(size_t) IPC_GET_ARG2(*call)
 
-/** Returns the device driver service message parameter.
+/*@}*/
+
+/** @name Third arguments
+ */
+/*@{*/
+
+/** Returns the device driver service message argument.
  *  @param[in] call The message call structure.
  */
 #define IPC_GET_SERVICE(call)		(services_t) IPC_GET_ARG3(*call)
 
-/** Returns the target service message parameter.
+/** Returns the target service message argument.
  *  @param[in] call The message call structure.
  */
 #define IPC_GET_TARGET(call)		(services_t) IPC_GET_ARG3(*call)
 
-/** Returns the sender service message parameter.
+/** Returns the sender service message argument.
  *  @param[in] call The message call structure.
  */
 #define IPC_GET_SENDER(call)		(services_t) IPC_GET_ARG3(*call)
 
-/** Returns the error service message parameter.
+/*@}*/
+
+/** @name Fourth arguments
+ */
+/*@{*/
+
+/** Returns the error service message argument.
  *  @param[in] call The message call structure.
  */
 #define IPC_GET_ERROR(call)		(services_t) IPC_GET_ARG4(*call)
 
-/** Returns the phone message parameter.
+/*@}*/
+
+/** @name Fifth arguments
+ */
+/*@{*/
+
+/** Returns the phone message argument.
  *  @param[in] call The message call structure.
  */
 #define IPC_GET_PHONE(call)		(int) IPC_GET_ARG5(*call)
+
+/*@}*/
+
+/** @name First answers
+ */
+/*@{*/
 
 /** Sets the device identifier in the message answer.
@@ -364,4 +398,10 @@
 #define IPC_SET_ADDR(answer)		((size_t *) &IPC_GET_ARG1(*answer))
 
+/*@}*/
+
+/** @name Second answers
+ */
+/*@{*/
+
 /** Sets the minimum prefix size in the message answer.
  *  @param[out] answer The message answer structure.
@@ -369,4 +409,10 @@
 #define IPC_SET_PREFIX(answer)	((size_t *) &IPC_GET_ARG2(*answer))
 
+/*@}*/
+
+/** @name Third answers
+ */
+/*@{*/
+
 /** Sets the maximum content size in the message answer.
  *  @param[out] answer The message answer structure.
@@ -374,4 +420,10 @@
 #define IPC_SET_CONTENT(answer)	((size_t *) &IPC_GET_ARG3(*answer))
 
+/*@}*/
+
+/** @name Fourth answers
+ */
+/*@{*/
+
 /** Sets the minimum suffix size in the message answer.
  *  @param[out] answer The message answer structure.
@@ -380,4 +432,32 @@
 
 /*@}*/
+
+/*@}*/
+
+/** 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);
+	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);
+}
 
 /** Returns the address.
@@ -399,12 +479,80 @@
 		return EBADMEM;
 	}
+
+	// request the address
 	message_id = async_send_1(phone, (ipcarg_t) message, (ipcarg_t) device_id, NULL);
 	string = measured_strings_return(phone, address, data, 1);
 	async_wait_for(message_id, &result);
+
+	// if not successful
 	if((string == EOK) && (result != EOK)){
+		// clear the data
 		free(*address);
 		free(*data);
 	}
 	return (int) result;
+}
+
+/** 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;
+	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);
+	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);
+	}
+	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);
+	}
+	return EOK;
 }
 
@@ -436,104 +584,21 @@
 		return EBADMEM;
 	}
+
+	// request the translation
 	message_id = async_send_3(phone, (ipcarg_t) message, (ipcarg_t) device_id, (ipcarg_t) count, (ipcarg_t) service, NULL);
 	measured_strings_send(phone, configuration, count);
 	string = measured_strings_return(phone, translation, data, count);
 	async_wait_for(message_id, &result);
+
+	// if not successful
 	if((string == EOK) && (result != EOK)){
+		// clear the data
 		free(*translation);
 		free(*data);
 	}
+
 	return (int) result;
 }
 
-/** 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);
-	}
-	return EOK;
-}
-
-/** 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;
-	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);
-	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;
-}
-
-/** 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);
-	return EOK;
-}
-
-/** 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);
-	}
-	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);
-}
-
 #endif
 
Index: uspace/srv/net/module.c
===================================================================
--- uspace/srv/net/module.c	(revision 9f2ea2842550ba0536881449ffe27c8947d72804)
+++ uspace/srv/net/module.c	(revision a64c64d04f3d981abf5d095ae65ed7ed4b40a244)
@@ -104,14 +104,22 @@
 	ipc_answer_0(iid, EOK);
 
+	// process additional messages
 	while(true){
+
+		// clear the answer structure
 		refresh_answer(&answer, &answer_count);
 
+		// fetch the next message
 		callid = async_get_call(&call);
+
+		// process the message
 		res = module_message(callid, &call, &answer, &answer_count);
 
+		// end if said to either by the message or the processing result
 		if((IPC_GET_METHOD(call) == IPC_M_PHONE_HUNGUP) || (res == EHANGUP)){
 			return;
 		}
 
+		// answer the message
 		answer_call(callid, res, &answer, answer_count);
 	}
@@ -121,11 +129,15 @@
 	ERROR_DECLARE;
 
+	// print the module label
 	printf("Task %d - ", task_get_id());
 	module_print_name();
 	printf("\n");
+
+	// start the module
 	if(ERROR_OCCURRED(module_start(client_connection))){
 		printf(" - ERROR %i\n", ERROR_CODE);
 		return ERROR_CODE;
 	}
+
 	return EOK;
 }
Index: uspace/srv/net/modules.c
===================================================================
--- uspace/srv/net/modules.c	(revision 9f2ea2842550ba0536881449ffe27c8947d72804)
+++ uspace/srv/net/modules.c	(revision a64c64d04f3d981abf5d095ae65ed7ed4b40a244)
@@ -51,4 +51,5 @@
 
 void answer_call(ipc_callid_t callid, int result, ipc_call_t * answer, int answer_count){
+	// choose the most efficient answer function
 	if(answer || (! answer_count)){
 		switch(answer_count){
@@ -86,6 +87,9 @@
 	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))){
 			ipc_hangup(phone);
@@ -102,20 +106,25 @@
 
 int connect_to_service_timeout(services_t need, suseconds_t timeout){
-	if (timeout <= 0)
+	int phone;
+
+	// if no timeout is set
+	if (timeout <= 0){
 		return async_connect_me_to_blocking(PHONE_NS, need, 0, 0);
-	
+	}
+
 	while(true){
-		int phone;
+		phone = async_connect_me_to(PHONE_NS, need, 0, 0);
+		if((phone >= 0) || (phone != ENOENT)){
+			return phone;
+		}
 
-		phone = async_connect_me_to(PHONE_NS, need, 0, 0);
-		if((phone >= 0) || (phone != ENOENT))
-			return phone;
-	
-		timeout -= MODULE_WAIT_TIME;
+		// end if no time is left
 		if(timeout <= 0){
 			return ETIMEOUT;
 		}
 
-		usleep(MODULE_WAIT_TIME);
+		// wait the minimum of the module wait time and the timeout
+		usleep((timeout <= MODULE_WAIT_TIME) ? timeout : MODULE_WAIT_TIME);
+		timeout -= MODULE_WAIT_TIME;
 	}
 }
@@ -129,11 +138,17 @@
 		return EBADMEM;
 	}
+
+	// fetch the request
 	if(! async_data_write_receive(&callid, length)){
 		return EINVAL;
 	}
+
+	// allocate the buffer
 	*data = malloc(*length);
 	if(!(*data)){
 		return ENOMEM;
 	}
+
+	// fetch the data
 	if(ERROR_OCCURRED(async_data_write_finalize(callid, * data, * length))){
 		free(data);
@@ -147,18 +162,25 @@
 	ipc_callid_t callid;
 
+	// fetch the request
 	if(! async_data_read_receive(&callid, &length)){
 		return EINVAL;
 	}
+
+	// check the requested data size
 	if(length < data_length){
 		async_data_read_finalize(callid, data, length);
 		return EOVERFLOW;
 	}
+
+	// send the data
 	return async_data_read_finalize(callid, data, data_length);
 }
 
 void refresh_answer(ipc_call_t * answer, int * answer_count){
+
 	if(answer_count){
 		*answer_count = 0;
 	}
+
 	if(answer){
 		IPC_SET_RETVAL(*answer, 0);
Index: uspace/srv/net/net/net.c
===================================================================
--- uspace/srv/net/net/net.c	(revision 9f2ea2842550ba0536881449ffe27c8947d72804)
+++ uspace/srv/net/net/net.c	(revision a64c64d04f3d981abf5d095ae65ed7ed4b40a244)
@@ -66,11 +66,20 @@
 #include "net_messages.h"
 
+/** File read buffer size.
+ */
+#define BUFFER_SIZE	256
+
 /** Networking module name.
  */
 #define NAME	"Networking"
 
-/** File read buffer size.
- */
-#define BUFFER_SIZE	256
+/** Networking module global data.
+ */
+net_globals_t	net_globals;
+
+/** Generates new system-unique device identifier.
+ *  @returns The system-unique devic identifier.
+ */
+device_id_t generate_new_device_id(void);
 
 /** Prints the module name.
@@ -88,7 +97,20 @@
 int module_start(async_client_conn_t client_connection);
 
-/** \todo
- */
-int read_configuration_file(const char * directory, const char * filename, measured_strings_ref configuration);
+/** Returns the configured values.
+ *  The network interface configuration is searched first.
+ *  @param[in] netif_conf The network interface configuration setting.
+ *  @param[out] configuration The found configured values.
+ *  @param[in] count The desired settings count.
+ *  @param[out] data The found configuration settings data.
+ *  @returns EOK.
+ */
+int net_get_conf(measured_strings_ref netif_conf, measured_string_ref configuration, size_t count, char ** data);
+
+/** Initializes the networking module.
+ *  @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.
+ */
+int net_initialize(async_client_conn_t client_connection);
 
 /** \todo
@@ -101,4 +123,16 @@
  */
 int read_configuration(void);
+
+/** \todo
+ */
+int read_configuration_file(const char * directory, const char * filename, measured_strings_ref configuration);
+
+/** Reads the network interface specific configuration.
+ *  @param[in] name The network interface name.
+ *  @param[in,out] netif The network interface structure.
+ *  @returns EOK on success.
+ *  @returns Other error codes as defined for the add_configuration() function.
+ */
+int read_netif_configuration(const char * name, netif_ref netif);
 
 /** Starts the network interface according to its configuration.
@@ -126,41 +160,28 @@
 int startup(void);
 
-/** Generates new system-unique device identifier.
- *  @returns The system-unique devic identifier.
- */
-device_id_t generate_new_device_id(void);
-
-/** Returns the configured values.
- *  The network interface configuration is searched first.
- *  @param[in] netif_conf The network interface configuration setting.
- *  @param[out] configuration The found configured values.
- *  @param[in] count The desired settings count.
- *  @param[out] data The found configuration settings data.
- *  @returns EOK.
- */
-int net_get_conf(measured_strings_ref netif_conf, measured_string_ref configuration, size_t count, char ** data);
-
-/** Initializes the networking module.
- *  @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.
- */
-int net_initialize(async_client_conn_t client_connection);
-
-/** Reads the network interface specific configuration.
- *  @param[in] name The network interface name.
- *  @param[in,out] netif The network interface structure.
- *  @returns EOK on success.
- *  @returns Other error codes as defined for the add_configuration() function.
- */
-int read_netif_configuration(const char * name, netif_ref netif);
-
-/** Networking module global data.
- */
-net_globals_t	net_globals;
+GENERIC_CHAR_MAP_IMPLEMENT(measured_strings, measured_string_t)
 
 DEVICE_MAP_IMPLEMENT(netifs, netif_t)
 
-GENERIC_CHAR_MAP_IMPLEMENT(measured_strings, measured_string_t)
+int add_configuration(measured_strings_ref configuration, const char * name, const char * value){
+	ERROR_DECLARE;
+
+	measured_string_ref setting;
+
+	setting = measured_string_create_bulk(value, 0);
+	if(! setting){
+		return ENOMEM;
+	}
+	// add the configuration setting
+	if(ERROR_OCCURRED(measured_strings_add(configuration, name, 0, setting))){
+		free(setting);
+		return ERROR_CODE;
+	}
+	return EOK;
+}
+
+device_id_t generate_new_device_id(void){
+	return device_assign_devno();
+}
 
 void module_print_name(void){
@@ -187,43 +208,9 @@
 }
 
-int net_initialize(async_client_conn_t client_connection){
-	ERROR_DECLARE;
-
-	netifs_initialize(&net_globals.netifs);
-	char_map_initialize(&net_globals.netif_names);
-	modules_initialize(&net_globals.modules);
-	measured_strings_initialize(&net_globals.configuration);
-
-	// TODO dynamic configuration
-	ERROR_PROPAGATE(read_configuration());
-
-	ERROR_PROPAGATE(add_module(NULL, &net_globals.modules, LO_NAME, LO_FILENAME, SERVICE_LO, 0, connect_to_service));
-	ERROR_PROPAGATE(add_module(NULL, &net_globals.modules, DP8390_NAME, DP8390_FILENAME, SERVICE_DP8390, 0, connect_to_service));
-	ERROR_PROPAGATE(add_module(NULL, &net_globals.modules, ETHERNET_NAME, ETHERNET_FILENAME, SERVICE_ETHERNET, 0, connect_to_service));
-	ERROR_PROPAGATE(add_module(NULL, &net_globals.modules, NILDUMMY_NAME, NILDUMMY_FILENAME, SERVICE_NILDUMMY, 0, connect_to_service));
-
-	// build specific initialization
-	return net_initialize_build(client_connection);
-}
-
-int net_get_device_conf_req(int net_phone, device_id_t device_id, measured_string_ref * configuration, size_t count, char ** data){
-	netif_ref netif;
-
-	if(!(configuration && (count > 0))){
-		return EINVAL;
-	}
-	netif = netifs_find(&net_globals.netifs, device_id);
-	if(netif){
-		return net_get_conf(&netif->configuration, * configuration, count, data);
-	}else{
-		return net_get_conf(NULL, * configuration, count, data);
-	}
-}
-
-int net_get_conf_req(int net_phone, measured_string_ref * configuration, size_t count, char ** data){
-	if(!(configuration && (count > 0))){
-		return EINVAL;
-	}
-	return net_get_conf(NULL, * configuration, count, data);
+int net_connect_module(services_t service){
+	return EOK;
+}
+
+void net_free_settings(measured_string_ref settings, char * data){
 }
 
@@ -235,4 +222,5 @@
 		*data = NULL;
 	}
+
 	for(index = 0; index < count; ++ index){
 		setting = measured_strings_find(netif_conf, configuration[index].value, 0);
@@ -251,9 +239,45 @@
 }
 
-void net_free_settings(measured_string_ref settings, char * data){
-}
-
-int net_connect_module(services_t service){
-	return EOK;
+int net_get_conf_req(int net_phone, measured_string_ref * configuration, size_t count, char ** data){
+	if(!(configuration && (count > 0))){
+		return EINVAL;
+	}
+
+	return net_get_conf(NULL, * configuration, count, data);
+}
+
+int net_get_device_conf_req(int net_phone, device_id_t device_id, measured_string_ref * configuration, size_t count, char ** data){
+	netif_ref netif;
+
+	if(!(configuration && (count > 0))){
+		return EINVAL;
+	}
+
+	netif = netifs_find(&net_globals.netifs, device_id);
+	if(netif){
+		return net_get_conf(&netif->configuration, * configuration, count, data);
+	}else{
+		return net_get_conf(NULL, * configuration, count, data);
+	}
+}
+
+int net_initialize(async_client_conn_t client_connection){
+	ERROR_DECLARE;
+
+	netifs_initialize(&net_globals.netifs);
+	char_map_initialize(&net_globals.netif_names);
+	modules_initialize(&net_globals.modules);
+	measured_strings_initialize(&net_globals.configuration);
+
+	// TODO dynamic configuration
+	ERROR_PROPAGATE(read_configuration());
+
+	ERROR_PROPAGATE(add_module(NULL, &net_globals.modules, LO_NAME, LO_FILENAME, SERVICE_LO, 0, connect_to_service));
+	ERROR_PROPAGATE(add_module(NULL, &net_globals.modules, DP8390_NAME, DP8390_FILENAME, SERVICE_DP8390, 0, connect_to_service));
+	ERROR_PROPAGATE(add_module(NULL, &net_globals.modules, ETHERNET_NAME, ETHERNET_FILENAME, SERVICE_ETHERNET, 0, connect_to_service));
+	ERROR_PROPAGATE(add_module(NULL, &net_globals.modules, NILDUMMY_NAME, NILDUMMY_FILENAME, SERVICE_NILDUMMY, 0, connect_to_service));
+
+	// build specific initialization
+	return net_initialize_build(client_connection);
 }
 
@@ -288,4 +312,73 @@
 	}
 	return ENOTSUP;
+}
+
+int parse_line(measured_strings_ref configuration, char * line){
+	ERROR_DECLARE;
+
+	measured_string_ref setting;
+	char * name;
+	char * value;
+
+	// from the beginning
+	name = line;
+
+	// skip comments and blank lines
+	if((*name == '#') || (*name == '\0')){
+		return EOK;
+	}
+	// skip spaces
+	while(isspace(*name)){
+		++ name;
+	}
+
+	// remember the name start
+	value = name;
+	// skip the name
+	while(isalnum(*value) || (*value == '_')){
+		// make uppercase
+//		*value = toupper(*value);
+		++ value;
+	}
+
+	if(*value == '='){
+		// terminate the name
+		*value = '\0';
+	}else{
+		// terminate the name
+		*value = '\0';
+		// skip until '='
+		++ value;
+		while((*value) && (*value != '=')){
+			++ value;
+		}
+		// not found?
+		if(*value != '='){
+			return EINVAL;
+		}
+	}
+
+	++ value;
+	// skip spaces
+	while(isspace(*value)){
+		++ value;
+	}
+	// create a bulk measured string till the end
+	setting = measured_string_create_bulk(value, 0);
+	if(! setting){
+		return ENOMEM;
+	}
+
+	// add the configuration setting
+	if(ERROR_OCCURRED(measured_strings_add(configuration, name, 0, setting))){
+		free(setting);
+		return ERROR_CODE;
+	}
+	return EOK;
+}
+
+int read_configuration(void){
+	// read the general configuration file
+	return read_configuration_file(CONF_DIR, CONF_GENERAL_FILE, &net_globals.configuration);
 }
 
@@ -341,94 +434,4 @@
 }
 
-int parse_line(measured_strings_ref configuration, char * line){
-	ERROR_DECLARE;
-
-	measured_string_ref setting;
-	char * name;
-	char * value;
-
-	// from the beginning
-	name = line;
-
-	// skip comments and blank lines
-	if((*name == '#') || (*name == '\0')){
-		return EOK;
-	}
-	// skip spaces
-	while(isspace(*name)){
-		++ name;
-	}
-
-	// remember the name start
-	value = name;
-	// skip the name
-	while(isalnum(*value) || (*value == '_')){
-		// make uppercase
-//		*value = toupper(*value);
-		++ value;
-	}
-
-	if(*value == '='){
-		// terminate the name
-		*value = '\0';
-	}else{
-		// terminate the name
-		*value = '\0';
-		// skip until '='
-		++ value;
-		while((*value) && (*value != '=')){
-			++ value;
-		}
-		// not found?
-		if(*value != '='){
-			return EINVAL;
-		}
-	}
-
-	++ value;
-	// skip spaces
-	while(isspace(*value)){
-		++ value;
-	}
-	// create a bulk measured string till the end
-	setting = measured_string_create_bulk(value, 0);
-	if(! setting){
-		return ENOMEM;
-	}
-
-	// add the configuration setting
-	if(ERROR_OCCURRED(measured_strings_add(configuration, name, 0, setting))){
-		free(setting);
-		return ERROR_CODE;
-	}
-	return EOK;
-}
-
-int add_configuration(measured_strings_ref configuration, const char * name, const char * value){
-	ERROR_DECLARE;
-
-	measured_string_ref setting;
-
-	setting = measured_string_create_bulk(value, 0);
-	if(! setting){
-		return ENOMEM;
-	}
-	// add the configuration setting
-	if(ERROR_OCCURRED(measured_strings_add(configuration, name, 0, setting))){
-		free(setting);
-		return ERROR_CODE;
-	}
-	return EOK;
-}
-
-device_id_t generate_new_device_id(void){
-	return device_assign_devno();
-}
-
-int read_configuration(void){
-	// read the general configuration file
-	return read_configuration_file(CONF_DIR, CONF_GENERAL_FILE, &net_globals.configuration);
-}
-
 int read_netif_configuration(const char * name, netif_ref netif){
 	// read the netif configuration file
@@ -452,4 +455,5 @@
 		return EINVAL;
 	}
+
 	// optional network interface layer
 	setting = measured_strings_find(&netif->configuration, CONF_NIL, 0);
@@ -463,4 +467,5 @@
 		netif->nil = NULL;
 	}
+
 	// mandatory internet layer
 	setting = measured_strings_find(&netif->configuration, CONF_IL, 0);
@@ -470,6 +475,6 @@
 		return EINVAL;
 	}
-	// end of the static loopback initialization
-	// startup the loopback interface
+
+	// hardware configuration
 	setting = measured_strings_find(&netif->configuration, CONF_IRQ, 0);
 	irq = setting ? strtol(setting->value, NULL, 10) : 0;
@@ -477,4 +482,6 @@
 	io = setting ? strtol(setting->value, NULL, 16) : 0;
 	ERROR_PROPAGATE(netif_probe_req(netif->driver->phone, netif->id, irq, io));
+
+	// network interface layer startup
 	if(netif->nil){
 		setting = measured_strings_find(&netif->configuration, CONF_MTU, 0);
@@ -488,4 +495,6 @@
 		internet_service = netif->driver->service;
 	}
+
+	// inter-network layer startup
 	switch(netif->il->service){
 		case SERVICE_IP:
@@ -525,4 +534,5 @@
 		}
 		ERROR_PROPAGATE(measured_strings_initialize(&netif->configuration));
+
 		// read configuration files
 		if(ERROR_OCCURRED(read_netif_configuration(conf_files[i], netif))){
@@ -531,4 +541,5 @@
 			return ERROR_CODE;
 		}
+
 		// mandatory name
 		setting = measured_strings_find(&netif->configuration, CONF_NAME, 0);
@@ -540,4 +551,5 @@
 		}
 		netif->name = setting->value;
+
 		// add to the netifs map
 		index = netifs_add(&net_globals.netifs, netif->id, netif);
@@ -547,4 +559,5 @@
 			return index;
 		}
+
 		// add to the netif names map
 		if(ERROR_OCCURRED(char_map_add(&net_globals.netif_names, netif->name, 0, index))
@@ -555,4 +568,5 @@
 			return ERROR_CODE;
 		}
+
 		// increment modules' usage
 		++ netif->driver->usage;
Index: uspace/srv/net/net/net.h
===================================================================
--- uspace/srv/net/net/net.h	(revision 9f2ea2842550ba0536881449ffe27c8947d72804)
+++ uspace/srv/net/net/net.h	(revision a64c64d04f3d981abf5d095ae65ed7ed4b40a244)
@@ -52,44 +52,44 @@
 /*@{*/
 
+/** DP8390 network interface module full path filename.
+ */
+#define DP8390_FILENAME		"/srv/dp8390"
+
+/** DP8390 network interface module name.
+ */
+#define DP8390_NAME			"dp8390"
+
+/** Ethernet module full path filename.
+ */
+#define ETHERNET_FILENAME	"/srv/eth"
+
+/** Ethernet module name.
+ */
+#define ETHERNET_NAME		"ethernet"
+
+/** IP module full path filename.
+ */
+#define IP_FILENAME			"/srv/ip"
+
+/** IP module name.
+ */
+#define IP_NAME				"ip"
+
+/** Loopback network interface module full path filename.
+ */
+#define LO_FILENAME			"/srv/lo"
+
 /** Loopback network interface module name.
  */
 #define LO_NAME				"lo"
 
-/** Loopback network interface module full path filename.
- */
-#define LO_FILENAME			"/srv/lo"
-
-/** DP8390 network interface module name.
- */
-#define DP8390_NAME			"dp8390"
-
-/** DP8390 network interface module full path filename.
- */
-#define DP8390_FILENAME		"/srv/dp8390"
+/** Ethernet module full path filename.
+ */
+#define NILDUMMY_FILENAME	"/srv/nildummy"
 
 /** Ethernet module name.
  */
-#define ETHERNET_NAME		"ethernet"
-
-/** Ethernet module full path filename.
- */
-#define ETHERNET_FILENAME	"/srv/eth"
-
-/** Ethernet module name.
- */
 #define NILDUMMY_NAME		"nildummy"
 
-/** Ethernet module full path filename.
- */
-#define NILDUMMY_FILENAME	"/srv/nildummy"
-
-/** IP module name.
- */
-#define IP_NAME				"ip"
-
-/** IP module full path filename.
- */
-#define IP_FILENAME			"/srv/ip"
-
 /*@}*/
 
@@ -98,4 +98,20 @@
 /*@{*/
 
+/** Internet protocol module name configuration label.
+ */
+#define CONF_IL				"IL"
+
+/** Device input/output address configuration label.
+ */
+#define CONF_IO				"IO"
+
+/** Interrupt number configuration label.
+ */
+#define CONF_IRQ			"IRQ"
+
+/** Maximum transmission unit configuration label.
+ */
+#define CONF_MTU			"MTU"
+
 /** Network interface name configuration label.
  */
@@ -110,20 +126,4 @@
 #define CONF_NIL			"NIL"
 
-/** Internet protocol module name configuration label.
- */
-#define CONF_IL				"IL"
-
-/** Interrupt number configuration label.
- */
-#define CONF_IRQ			"IRQ"
-
-/** Device input/output address configuration label.
- */
-#define CONF_IO				"IO"
-
-/** Maximum transmission unit configuration label.
- */
-#define CONF_MTU			"MTU"
-
 /*@}*/
 
@@ -135,4 +135,9 @@
  */
 #define CONF_GENERAL_FILE	"general"
+
+/** Type definition of the networking module global data.
+ *  @see net_globals
+ */
+typedef struct net_globals	net_globals_t;
 
 /** Type definition of the network interface specific data.
@@ -146,8 +151,9 @@
 typedef netif_t *		netif_ref;
 
-/** Type definition of the networking module global data.
- *  @see net_globals
- */
-typedef struct net_globals	net_globals_t;
+/** Configuration settings.
+ *  Maps setting names to the values.
+ *  @see generic_char_map.h
+ */
+GENERIC_CHAR_MAP_DECLARE(measured_strings, measured_string_t)
 
 /** Present network interfaces.
@@ -157,22 +163,33 @@
 DEVICE_MAP_DECLARE(netifs, netif_t)
 
-/** Configuration settings.
- *  Maps setting names to the values.
- *  @see generic_char_map.h
- */
-GENERIC_CHAR_MAP_DECLARE(measured_strings, measured_string_t)
+/** Networking module global variables.
+ */
+struct net_globals{
+	/** Global configuration.
+	 */
+	measured_strings_t configuration;
+	/** Available modules.
+	 */
+	modules_t modules;
+	/** Network interface structure indices by names.
+	 */
+	char_map_t netif_names;
+	/** Present network interfaces.
+	 */
+	netifs_t netifs;
+};
 
 /** Present network interface device.
  */
 struct netif{
+	/** Configuration.
+	 */
+	measured_strings_t configuration;
+	/** Serving network interface driver module index.
+	 */
+	module_ref driver;
 	/** System-unique network interface identifier.
 	 */
 	device_id_t id;
-	/** Serving network interface driver module index.
-	 */
-	module_ref driver;
-	/** Serving link layer module index.
-	 */
-	module_ref nil;
 	/** Serving internet layer module index.
 	 */
@@ -181,24 +198,7 @@
 	 */
 	char * name;
-	/** Configuration.
-	 */
-	measured_strings_t configuration;
-};
-
-/** Networking module global variables.
- */
-struct net_globals{
-	/** Present network interfaces.
-	 */
-	netifs_t netifs;
-	/** Network interface structure indices by names.
-	 */
-	char_map_t netif_names;
-	/** Available modules.
-	 */
-	modules_t modules;
-	/** Global configuration.
-	 */
-	measured_strings_t configuration;
+	/** Serving link layer module index.
+	 */
+	module_ref nil;
 };
 
@@ -211,23 +211,4 @@
  */
 int add_configuration(measured_strings_ref configuration, const char * name, const char * value);
-
-/** Processes the networking message.
- *  @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.
- *  @see net_interface.h
- *  @see IS_NET_NET_MESSAGE()
- */
-int net_message(ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count);
-
-/** 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.
- */
-int net_initialize_build(async_client_conn_t client_connection);
 
 /** Processes the module message.
@@ -243,4 +224,23 @@
 int module_message(ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count);
 
+/** 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.
+ */
+int net_initialize_build(async_client_conn_t client_connection);
+
+/** Processes the networking message.
+ *  @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.
+ *  @see net_interface.h
+ *  @see IS_NET_NET_MESSAGE()
+ */
+int net_message(ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count);
+
 #endif
 
Index: uspace/srv/net/net/net_bundle.c
===================================================================
--- uspace/srv/net/net/net_bundle.c	(revision 9f2ea2842550ba0536881449ffe27c8947d72804)
+++ uspace/srv/net/net/net_bundle.c	(revision a64c64d04f3d981abf5d095ae65ed7ed4b40a244)
@@ -60,4 +60,23 @@
 extern net_globals_t	net_globals;
 
+int net_initialize_build(async_client_conn_t client_connection){
+	ERROR_DECLARE;
+
+	ipcarg_t phonehash;
+
+	ERROR_PROPAGATE(REGISTER_ME(SERVICE_IP, &phonehash));
+	ERROR_PROPAGATE(add_module(NULL, &net_globals.modules, IP_NAME, IP_FILENAME, SERVICE_IP, task_get_id(), ip_connect_module));
+	ERROR_PROPAGATE(ip_initialize(client_connection));
+	ERROR_PROPAGATE(REGISTER_ME(SERVICE_ARP, &phonehash));
+	ERROR_PROPAGATE(arp_initialize(client_connection));
+	ERROR_PROPAGATE(REGISTER_ME(SERVICE_ICMP, &phonehash));
+	ERROR_PROPAGATE(icmp_initialize(client_connection));
+	ERROR_PROPAGATE(REGISTER_ME(SERVICE_UDP, &phonehash));
+	ERROR_PROPAGATE(udp_initialize(client_connection));
+	ERROR_PROPAGATE(REGISTER_ME(SERVICE_TCP, &phonehash));
+	ERROR_PROPAGATE(tcp_initialize(client_connection));
+	return EOK;
+}
+
 int module_message(ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count){
 	if((IPC_GET_METHOD(*call) == IPC_M_CONNECT_TO_ME)
@@ -98,23 +117,4 @@
 }
 
-int net_initialize_build(async_client_conn_t client_connection){
-	ERROR_DECLARE;
-
-	ipcarg_t phonehash;
-
-	ERROR_PROPAGATE(REGISTER_ME(SERVICE_IP, &phonehash));
-	ERROR_PROPAGATE(add_module(NULL, &net_globals.modules, IP_NAME, IP_FILENAME, SERVICE_IP, task_get_id(), ip_connect_module));
-	ERROR_PROPAGATE(ip_initialize(client_connection));
-	ERROR_PROPAGATE(REGISTER_ME(SERVICE_ARP, &phonehash));
-	ERROR_PROPAGATE(arp_initialize(client_connection));
-	ERROR_PROPAGATE(REGISTER_ME(SERVICE_ICMP, &phonehash));
-	ERROR_PROPAGATE(icmp_initialize(client_connection));
-	ERROR_PROPAGATE(REGISTER_ME(SERVICE_UDP, &phonehash));
-	ERROR_PROPAGATE(udp_initialize(client_connection));
-	ERROR_PROPAGATE(REGISTER_ME(SERVICE_TCP, &phonehash));
-	ERROR_PROPAGATE(tcp_initialize(client_connection));
-	return EOK;
-}
-
 /** @}
  */
Index: uspace/srv/net/net/net_remote.c
===================================================================
--- uspace/srv/net/net/net_remote.c	(revision 9f2ea2842550ba0536881449ffe27c8947d72804)
+++ uspace/srv/net/net/net_remote.c	(revision a64c64d04f3d981abf5d095ae65ed7ed4b40a244)
@@ -50,10 +50,6 @@
 #include "net_messages.h"
 
-int net_get_device_conf_req(int net_phone, device_id_t device_id, measured_string_ref * configuration, size_t count, char ** data){
-	return generic_translate_req(net_phone, NET_NET_GET_DEVICE_CONF, device_id, 0, * configuration, count, configuration, data);
-}
-
-int net_get_conf_req(int net_phone, measured_string_ref * configuration, size_t count, char ** data){
-	return generic_translate_req(net_phone, NET_NET_GET_DEVICE_CONF, 0, 0, * configuration, count, configuration, data);
+int net_connect_module(services_t service){
+	return connect_to_service(SERVICE_NETWORKING);
 }
 
@@ -67,6 +63,10 @@
 }
 
-int net_connect_module(services_t service){
-	return connect_to_service(SERVICE_NETWORKING);
+int net_get_conf_req(int net_phone, measured_string_ref * configuration, size_t count, char ** data){
+	return generic_translate_req(net_phone, NET_NET_GET_DEVICE_CONF, 0, 0, * configuration, count, configuration, data);
+}
+
+int net_get_device_conf_req(int net_phone, device_id_t device_id, measured_string_ref * configuration, size_t count, char ** data){
+	return generic_translate_req(net_phone, NET_NET_GET_DEVICE_CONF, device_id, 0, * configuration, count, configuration, data);
 }
 
Index: uspace/srv/net/net/net_standalone.c
===================================================================
--- uspace/srv/net/net/net_standalone.c	(revision 9f2ea2842550ba0536881449ffe27c8947d72804)
+++ uspace/srv/net/net/net_standalone.c	(revision a64c64d04f3d981abf5d095ae65ed7ed4b40a244)
@@ -53,12 +53,4 @@
 extern net_globals_t	net_globals;
 
-int 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);
-	}
-}
-
 int net_initialize_build(async_client_conn_t client_connection){
 	ERROR_DECLARE;
@@ -83,4 +75,12 @@
 }
 
+int 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);
+	}
+}
+
 /** @}
  */
Index: uspace/srv/net/net/start/netstart.c
===================================================================
--- uspace/srv/net/net/start/netstart.c	(revision 9f2ea2842550ba0536881449ffe27c8947d72804)
+++ uspace/srv/net/net/start/netstart.c	(revision a64c64d04f3d981abf5d095ae65ed7ed4b40a244)
@@ -76,14 +76,18 @@
 	int net_phone;
 
+	// print the module label
 	printf("Task %d - ", task_get_id());
 	printf("%s\n", NAME);
+
 	// run self tests
 	ERROR_PROPAGATE(self_test());
-	// start net service
+
+	// start the networking service
 	if(! spawn("/srv/net")){
 		fprintf(stderr, "Could not spawn net\n");
 		return EINVAL;
 	}
-	// start net
+
+	// start the networking
 	net_phone = connect_to_service(SERVICE_NETWORKING);
 	if(ERROR_OCCURRED(ipc_call_sync_0_0(net_phone, NET_NET_STARTUP))){
Index: uspace/srv/net/self_test.c
===================================================================
--- uspace/srv/net/self_test.c	(revision 9f2ea2842550ba0536881449ffe27c8947d72804)
+++ uspace/srv/net/self_test.c	(revision a64c64d04f3d981abf5d095ae65ed7ed4b40a244)
@@ -57,14 +57,30 @@
  *  @param[in] result The expected result.
  */
-#define TEST(name, function_call, result);	{	\
-	printf("\n\t%s", (name)); 					\
-	if((function_call) != (result)){			\
-		printf("\tERROR\n");						\
-		error = 1;									\
-	}else{											\
-		printf("\tOK\n");							\
-	}												\
+#define TEST(name, function_call, result);	{								\
+	printf("\n\t%s", (name)); 												\
+	if((function_call) != (result)){										\
+		printf("\tERROR\n");												\
+		error = 1;															\
+	}else{																	\
+		printf("\tOK\n");													\
+	}																		\
 }
 
+#if NET_SELF_TEST_GENERIC_CHAR_MAP
+
+	GENERIC_CHAR_MAP_DECLARE(int_char_map, int)
+
+	GENERIC_CHAR_MAP_IMPLEMENT(int_char_map, int)
+
+#endif
+
+#if NET_SELF_TEST_GENERIC_FIELD
+
+	GENERIC_FIELD_DECLARE(int_field, int)
+
+	GENERIC_FIELD_IMPLEMENT(int_field, int)
+
+#endif
+
 #if NET_SELF_TEST_INT_MAP
 
@@ -72,20 +88,4 @@
 
 	INT_MAP_IMPLEMENT(int_map, int);
-
-#endif
-
-#if NET_SELF_TEST_GENERIC_FIELD
-
-	GENERIC_FIELD_DECLARE(int_field, int)
-
-	GENERIC_FIELD_IMPLEMENT(int_field, int)
-
-#endif
-
-#if NET_SELF_TEST_GENERIC_CHAR_MAP
-
-	GENERIC_CHAR_MAP_DECLARE(int_char_map, int)
-
-	GENERIC_CHAR_MAP_IMPLEMENT(int_char_map, int)
 
 #endif
@@ -101,13 +101,4 @@
 
 	error = 0;
-
-#if NET_SELF_TEST_MEASURED_STRINGS
-	measured_string_ref string;
-
-	printf("\nMeasured strings test");
-	string = measured_string_create_bulk("I am a measured string!", 0);
-	printf("\n%x, %s at %x of %d", string, string->value, string->value, string->length);
-	printf("\nOK");
-#endif
 
 #if NET_SELF_TEST_CHAR_MAP
@@ -160,4 +151,180 @@
 #endif
 
+#if NET_SELF_TEST_CRC
+	uint32_t value;
+
+	printf("\nCRC computation test");
+	value = ~ compute_crc32(~ 0, "123456789", 8 * 9);
+	TEST("123456789", value, 0xCBF43926);
+	printf("\t=> %X", value);
+	value = ~ compute_crc32(~ 0, "1", 8);
+	TEST("1", value, 0x83DCEFB7);
+	printf("\t=> %X", value);
+	value = ~ compute_crc32(~ 0, "12", 8 * 2);
+	TEST("12", value, 0x4F5344CD);
+	printf("\t=> %X", value);
+	value = ~ compute_crc32(~ 0, "123", 8 * 3);
+	TEST("123", value, 0x884863D2);
+	printf("\t=> %X", value);
+	value = ~ compute_crc32(~ 0, "1234", 8 * 4);
+	TEST("1234", value, 0x9BE3E0A3);
+	printf("\t=> %X", value);
+	value = ~ compute_crc32(~ 0, "12345678", 8 * 8);
+	TEST("12345678", value, 0x9AE0DAAF);
+	printf("\t=> %X", value);
+	value = ~ compute_crc32(~ 0, "ahoj pane", 8 * 9);
+	TEST("ahoj pane", value, 0x5FC3D706);
+	printf("\t=> %X", value);
+
+	if(error){
+		return EINVAL;
+	}
+
+#endif
+
+#if NET_SELF_TEST_DYNAMIC_FIFO
+	dyn_fifo_t fifo;
+
+	printf("\nDynamic fifo test");
+	TEST("add 1 einval", dyn_fifo_push(&fifo, 1, 0), EINVAL);
+	TEST("initialize", dyn_fifo_initialize(&fifo, 1), EOK);
+	TEST("add 1 eok", dyn_fifo_push(&fifo, 1, 0), EOK);
+	TEST("pop 1", dyn_fifo_pop(&fifo), 1);
+	TEST("pop enoent", dyn_fifo_pop(&fifo), ENOENT);
+	TEST("add 2 eok", dyn_fifo_push(&fifo, 2, 1), EOK);
+	TEST("add 3 enomem", dyn_fifo_push(&fifo, 3, 1), ENOMEM);
+	TEST("add 3 eok", dyn_fifo_push(&fifo, 3, 0), EOK);
+	TEST("pop 2", dyn_fifo_pop(&fifo), 2);
+	TEST("pop 3", dyn_fifo_pop(&fifo), 3);
+	TEST("add 4 eok", dyn_fifo_push(&fifo, 4, 2), EOK);
+	TEST("add 5 eok", dyn_fifo_push(&fifo, 5, 2), EOK);
+	TEST("add 6 enomem", dyn_fifo_push(&fifo, 6, 2), ENOMEM);
+	TEST("add 6 eok", dyn_fifo_push(&fifo, 6, 5), EOK);
+	TEST("add 7 eok", dyn_fifo_push(&fifo, 7, 5), EOK);
+	TEST("pop 4", dyn_fifo_pop(&fifo), 4);
+	TEST("pop 5", dyn_fifo_pop(&fifo), 5);
+	TEST("add 8 eok", dyn_fifo_push(&fifo, 8, 5), EOK);
+	TEST("add 9 eok", dyn_fifo_push(&fifo, 9, 5), EOK);
+	TEST("add 10 eok", dyn_fifo_push(&fifo, 10, 6), EOK);
+	TEST("add 11 eok", dyn_fifo_push(&fifo, 11, 6), EOK);
+	TEST("pop 6", dyn_fifo_pop(&fifo), 6);
+	TEST("pop 7", dyn_fifo_pop(&fifo), 7);
+	TEST("add 12 eok", dyn_fifo_push(&fifo, 12, 6), EOK);
+	TEST("add 13 eok", dyn_fifo_push(&fifo, 13, 6), EOK);
+	TEST("add 14 enomem", dyn_fifo_push(&fifo, 14, 6), ENOMEM);
+	TEST("add 14 eok", dyn_fifo_push(&fifo, 14, 8), EOK);
+	TEST("pop 8", dyn_fifo_pop(&fifo), 8);
+	TEST("pop 9", dyn_fifo_pop(&fifo), 9);
+	TEST("pop 10", dyn_fifo_pop(&fifo), 10);
+	TEST("pop 11", dyn_fifo_pop(&fifo), 11);
+	TEST("pop 12", dyn_fifo_pop(&fifo), 12);
+	TEST("pop 13", dyn_fifo_pop(&fifo), 13);
+	TEST("pop 14", dyn_fifo_pop(&fifo), 14);
+	TEST("destroy", dyn_fifo_destroy(&fifo), EOK);
+	TEST("add 15 einval", dyn_fifo_push(&fifo, 1, 0), EINVAL);
+	if(error){
+		return EINVAL;
+	}
+
+#endif
+
+#if NET_SELF_TEST_GENERIC_CHAR_MAP
+	int_char_map_t icm;
+
+	x = (int *) malloc(sizeof(int));
+	y = (int *) malloc(sizeof(int));
+	z = (int *) malloc(sizeof(int));
+	u = (int *) malloc(sizeof(int));
+	v = (int *) malloc(sizeof(int));
+	w = (int *) malloc(sizeof(int));
+
+	icm.magic = 0;
+	printf("\nGeneric char map test");
+	TEST("add ucho z einval", int_char_map_add(&icm, "ucho", 0, z), EINVAL);
+	TEST("initialize", int_char_map_initialize(&icm), EOK);
+	printf("\n\texclude bla null");
+	int_char_map_exclude(&icm, "bla", 0);
+	TEST("find bla null", int_char_map_find(&icm, "bla", 0), NULL);
+	TEST("add bla x eok", int_char_map_add(&icm, "bla", 0, x), EOK);
+	TEST("find bla x", int_char_map_find(&icm, "bla", 0), x);
+	TEST("add bla y eexists", int_char_map_add(&icm, "bla", 0, y), EEXISTS);
+	printf("\n\texclude bla y");
+	int_char_map_exclude(&icm, "bla", 0);
+	printf("\n\texclude bla null");
+	int_char_map_exclude(&icm, "bla", 0);
+	TEST("add blabla v eok", int_char_map_add(&icm, "blabla", 0, v), EOK);
+	TEST("find blabla v", int_char_map_find(&icm, "blabla", 0), v);
+	TEST("add bla w eok", int_char_map_add(&icm, "bla", 0, w), EOK);
+	TEST("find bla w", int_char_map_find(&icm, "bla", 0), w);
+	printf("\n\texclude bla");
+	int_char_map_exclude(&icm, "bla", 0);
+	TEST("find bla null", int_char_map_find(&icm, "bla", 0), NULL);
+	TEST("find blabla v", int_char_map_find(&icm, "blabla", 0), v);
+	TEST("add auto u eok", int_char_map_add(&icm, "auto", 0, u), EOK);
+	TEST("find auto u", int_char_map_find(&icm, "auto", 0), u);
+	printf("\n\tdestroy");
+	int_char_map_destroy(&icm);
+	TEST("add ucho z einval", int_char_map_add(&icm, "ucho", 0, z), EINVAL);
+	printf("\nOK");
+
+	if(error){
+		return EINVAL;
+	}
+
+#endif
+
+#if NET_SELF_TEST_GENERIC_FIELD
+	int_field_t gf;
+
+	x = (int *) malloc(sizeof(int));
+	y = (int *) malloc(sizeof(int));
+	z = (int *) malloc(sizeof(int));
+	u = (int *) malloc(sizeof(int));
+	v = (int *) malloc(sizeof(int));
+	w = (int *) malloc(sizeof(int));
+
+	gf.magic = 0;
+	printf("\nGeneric field test");
+	TEST("add x einval", int_field_add(&gf, x), EINVAL);
+	TEST("count -1", int_field_count(&gf), -1);
+	TEST("initialize", int_field_initialize(&gf), EOK);
+	TEST("count 0", int_field_count(&gf), 0);
+	TEST("get 1 null", int_field_get_index(&gf, 1), NULL);
+	TEST("add x 0", int_field_add(&gf, x), 0);
+	TEST("get 0 x", int_field_get_index(&gf, 0), x);
+	int_field_exclude_index(&gf, 0);
+	TEST("get 0 null", int_field_get_index(&gf, 0), NULL);
+	TEST("add y 1", int_field_add(&gf, y), 1);
+	TEST("get 1 y", int_field_get_index(&gf, 1), y);
+	TEST("add z 2", int_field_add(&gf, z), 2);
+	TEST("get 2 z", int_field_get_index(&gf, 2), z);
+	TEST("get 1 y", int_field_get_index(&gf, 1), y);
+	TEST("count 3", int_field_count(&gf), 3);
+	TEST("add u 3", int_field_add(&gf, u), 3);
+	TEST("get 3 u", int_field_get_index(&gf, 3), u);
+	TEST("add v 4", int_field_add(&gf, v), 4);
+	TEST("get 4 v", int_field_get_index(&gf, 4), v);
+	TEST("add w 5", int_field_add(&gf, w), 5);
+	TEST("get 5 w", int_field_get_index(&gf, 5), w);
+	TEST("count 6", int_field_count(&gf), 6);
+	int_field_exclude_index(&gf, 1);
+	TEST("get 1 null", int_field_get_index(&gf, 1), NULL);
+	TEST("get 3 u", int_field_get_index(&gf, 3), u);
+	int_field_exclude_index(&gf, 7);
+	TEST("get 3 u", int_field_get_index(&gf, 3), u);
+	TEST("get 5 w", int_field_get_index(&gf, 5), w);
+	int_field_exclude_index(&gf, 4);
+	TEST("get 4 null", int_field_get_index(&gf, 4), NULL);
+	printf("\n\tdestroy");
+	int_field_destroy(&gf);
+	TEST("count -1", int_field_count(&gf), -1);
+	printf("\nOK");
+
+	if(error){
+		return EINVAL;
+	}
+
+#endif
+
 #if NET_SELF_TEST_INT_MAP
 	int_map_t im;
@@ -216,178 +383,11 @@
 #endif
 
-#if NET_SELF_TEST_GENERIC_FIELD
-	int_field_t gf;
-
-	x = (int *) malloc(sizeof(int));
-	y = (int *) malloc(sizeof(int));
-	z = (int *) malloc(sizeof(int));
-	u = (int *) malloc(sizeof(int));
-	v = (int *) malloc(sizeof(int));
-	w = (int *) malloc(sizeof(int));
-
-	gf.magic = 0;
-	printf("\nGeneric field test");
-	TEST("add x einval", int_field_add(&gf, x), EINVAL);
-	TEST("count -1", int_field_count(&gf), -1);
-	TEST("initialize", int_field_initialize(&gf), EOK);
-	TEST("count 0", int_field_count(&gf), 0);
-	TEST("get 1 null", int_field_get_index(&gf, 1), NULL);
-	TEST("add x 0", int_field_add(&gf, x), 0);
-	TEST("get 0 x", int_field_get_index(&gf, 0), x);
-	int_field_exclude_index(&gf, 0);
-	TEST("get 0 null", int_field_get_index(&gf, 0), NULL);
-	TEST("add y 1", int_field_add(&gf, y), 1);
-	TEST("get 1 y", int_field_get_index(&gf, 1), y);
-	TEST("add z 2", int_field_add(&gf, z), 2);
-	TEST("get 2 z", int_field_get_index(&gf, 2), z);
-	TEST("get 1 y", int_field_get_index(&gf, 1), y);
-	TEST("count 3", int_field_count(&gf), 3);
-	TEST("add u 3", int_field_add(&gf, u), 3);
-	TEST("get 3 u", int_field_get_index(&gf, 3), u);
-	TEST("add v 4", int_field_add(&gf, v), 4);
-	TEST("get 4 v", int_field_get_index(&gf, 4), v);
-	TEST("add w 5", int_field_add(&gf, w), 5);
-	TEST("get 5 w", int_field_get_index(&gf, 5), w);
-	TEST("count 6", int_field_count(&gf), 6);
-	int_field_exclude_index(&gf, 1);
-	TEST("get 1 null", int_field_get_index(&gf, 1), NULL);
-	TEST("get 3 u", int_field_get_index(&gf, 3), u);
-	int_field_exclude_index(&gf, 7);
-	TEST("get 3 u", int_field_get_index(&gf, 3), u);
-	TEST("get 5 w", int_field_get_index(&gf, 5), w);
-	int_field_exclude_index(&gf, 4);
-	TEST("get 4 null", int_field_get_index(&gf, 4), NULL);
-	printf("\n\tdestroy");
-	int_field_destroy(&gf);
-	TEST("count -1", int_field_count(&gf), -1);
+#if NET_SELF_TEST_MEASURED_STRINGS
+	measured_string_ref string;
+
+	printf("\nMeasured strings test");
+	string = measured_string_create_bulk("I am a measured string!", 0);
+	printf("\n%x, %s at %x of %d", string, string->value, string->value, string->length);
 	printf("\nOK");
-
-	if(error){
-		return EINVAL;
-	}
-
-#endif
-
-#if NET_SELF_TEST_GENERIC_CHAR_MAP
-	int_char_map_t icm;
-
-	x = (int *) malloc(sizeof(int));
-	y = (int *) malloc(sizeof(int));
-	z = (int *) malloc(sizeof(int));
-	u = (int *) malloc(sizeof(int));
-	v = (int *) malloc(sizeof(int));
-	w = (int *) malloc(sizeof(int));
-
-	icm.magic = 0;
-	printf("\nGeneric char map test");
-	TEST("add ucho z einval", int_char_map_add(&icm, "ucho", 0, z), EINVAL);
-	TEST("initialize", int_char_map_initialize(&icm), EOK);
-	printf("\n\texclude bla null");
-	int_char_map_exclude(&icm, "bla", 0);
-	TEST("find bla null", int_char_map_find(&icm, "bla", 0), NULL);
-	TEST("add bla x eok", int_char_map_add(&icm, "bla", 0, x), EOK);
-	TEST("find bla x", int_char_map_find(&icm, "bla", 0), x);
-	TEST("add bla y eexists", int_char_map_add(&icm, "bla", 0, y), EEXISTS);
-	printf("\n\texclude bla y");
-	int_char_map_exclude(&icm, "bla", 0);
-	printf("\n\texclude bla null");
-	int_char_map_exclude(&icm, "bla", 0);
-	TEST("add blabla v eok", int_char_map_add(&icm, "blabla", 0, v), EOK);
-	TEST("find blabla v", int_char_map_find(&icm, "blabla", 0), v);
-	TEST("add bla w eok", int_char_map_add(&icm, "bla", 0, w), EOK);
-	TEST("find bla w", int_char_map_find(&icm, "bla", 0), w);
-	printf("\n\texclude bla");
-	int_char_map_exclude(&icm, "bla", 0);
-	TEST("find bla null", int_char_map_find(&icm, "bla", 0), NULL);
-	TEST("find blabla v", int_char_map_find(&icm, "blabla", 0), v);
-	TEST("add auto u eok", int_char_map_add(&icm, "auto", 0, u), EOK);
-	TEST("find auto u", int_char_map_find(&icm, "auto", 0), u);
-	printf("\n\tdestroy");
-	int_char_map_destroy(&icm);
-	TEST("add ucho z einval", int_char_map_add(&icm, "ucho", 0, z), EINVAL);
-	printf("\nOK");
-
-	if(error){
-		return EINVAL;
-	}
-
-#endif
-
-#if NET_SELF_TEST_CRC
-	uint32_t value;
-
-	printf("\nCRC computation test");
-	value = ~ compute_crc32(~ 0, "123456789", 8 * 9);
-	TEST("123456789", value, 0xCBF43926);
-	printf("\t=> %X", value);
-	value = ~ compute_crc32(~ 0, "1", 8);
-	TEST("1", value, 0x83DCEFB7);
-	printf("\t=> %X", value);
-	value = ~ compute_crc32(~ 0, "12", 8 * 2);
-	TEST("12", value, 0x4F5344CD);
-	printf("\t=> %X", value);
-	value = ~ compute_crc32(~ 0, "123", 8 * 3);
-	TEST("123", value, 0x884863D2);
-	printf("\t=> %X", value);
-	value = ~ compute_crc32(~ 0, "1234", 8 * 4);
-	TEST("1234", value, 0x9BE3E0A3);
-	printf("\t=> %X", value);
-	value = ~ compute_crc32(~ 0, "12345678", 8 * 8);
-	TEST("12345678", value, 0x9AE0DAAF);
-	printf("\t=> %X", value);
-	value = ~ compute_crc32(~ 0, "ahoj pane", 8 * 9);
-	TEST("ahoj pane", value, 0x5FC3D706);
-	printf("\t=> %X", value);
-
-	if(error){
-		return EINVAL;
-	}
-
-#endif
-
-#if NET_SELF_TEST_DYNAMIC_FIFO
-	dyn_fifo_t fifo;
-
-	printf("\nDynamic fifo test");
-	TEST("add 1 einval", dyn_fifo_push(&fifo, 1, 0), EINVAL);
-	TEST("initialize", dyn_fifo_initialize(&fifo, 1), EOK);
-	TEST("add 1 eok", dyn_fifo_push(&fifo, 1, 0), EOK);
-	TEST("pop 1", dyn_fifo_pop(&fifo), 1);
-	TEST("pop enoent", dyn_fifo_pop(&fifo), ENOENT);
-	TEST("add 2 eok", dyn_fifo_push(&fifo, 2, 1), EOK);
-	TEST("add 3 enomem", dyn_fifo_push(&fifo, 3, 1), ENOMEM);
-	TEST("add 3 eok", dyn_fifo_push(&fifo, 3, 0), EOK);
-	TEST("pop 2", dyn_fifo_pop(&fifo), 2);
-	TEST("pop 3", dyn_fifo_pop(&fifo), 3);
-	TEST("add 4 eok", dyn_fifo_push(&fifo, 4, 2), EOK);
-	TEST("add 5 eok", dyn_fifo_push(&fifo, 5, 2), EOK);
-	TEST("add 6 enomem", dyn_fifo_push(&fifo, 6, 2), ENOMEM);
-	TEST("add 6 eok", dyn_fifo_push(&fifo, 6, 5), EOK);
-	TEST("add 7 eok", dyn_fifo_push(&fifo, 7, 5), EOK);
-	TEST("pop 4", dyn_fifo_pop(&fifo), 4);
-	TEST("pop 5", dyn_fifo_pop(&fifo), 5);
-	TEST("add 8 eok", dyn_fifo_push(&fifo, 8, 5), EOK);
-	TEST("add 9 eok", dyn_fifo_push(&fifo, 9, 5), EOK);
-	TEST("add 10 eok", dyn_fifo_push(&fifo, 10, 6), EOK);
-	TEST("add 11 eok", dyn_fifo_push(&fifo, 11, 6), EOK);
-	TEST("pop 6", dyn_fifo_pop(&fifo), 6);
-	TEST("pop 7", dyn_fifo_pop(&fifo), 7);
-	TEST("add 12 eok", dyn_fifo_push(&fifo, 12, 6), EOK);
-	TEST("add 13 eok", dyn_fifo_push(&fifo, 13, 6), EOK);
-	TEST("add 14 enomem", dyn_fifo_push(&fifo, 14, 6), ENOMEM);
-	TEST("add 14 eok", dyn_fifo_push(&fifo, 14, 8), EOK);
-	TEST("pop 8", dyn_fifo_pop(&fifo), 8);
-	TEST("pop 9", dyn_fifo_pop(&fifo), 9);
-	TEST("pop 10", dyn_fifo_pop(&fifo), 10);
-	TEST("pop 11", dyn_fifo_pop(&fifo), 11);
-	TEST("pop 12", dyn_fifo_pop(&fifo), 12);
-	TEST("pop 13", dyn_fifo_pop(&fifo), 13);
-	TEST("pop 14", dyn_fifo_pop(&fifo), 14);
-	TEST("destroy", dyn_fifo_destroy(&fifo), EOK);
-	TEST("add 15 einval", dyn_fifo_push(&fifo, 1, 0), EINVAL);
-	if(error){
-		return EINVAL;
-	}
-
 #endif
 
