Index: boot/generic/include/typedefs.h
===================================================================
--- boot/generic/include/typedefs.h	(revision 32eceb4ff0c0ddeba47997beaa5d0677aee84d3a)
+++ boot/generic/include/typedefs.h	(revision 1b22bd45ebc7f42217757e90fa6e5b57f6ed5d1d)
@@ -37,5 +37,5 @@
 #include <arch/types.h>
 
-#define NULL	((void *) 0)
+#define NULL  0
 
 #define false  0
Index: kernel/arch/amd64/src/debugger.c
===================================================================
--- kernel/arch/amd64/src/debugger.c	(revision 32eceb4ff0c0ddeba47997beaa5d0677aee84d3a)
+++ kernel/arch/amd64/src/debugger.c	(revision 1b22bd45ebc7f42217757e90fa6e5b57f6ed5d1d)
@@ -260,5 +260,5 @@
 	}
 	
-	cur->address = (uintptr_t) NULL;
+	cur->address = NULL;
 	
 	setup_dr(slot);
@@ -313,5 +313,5 @@
 	unsigned int i;
 	for (i = 0; i < BKPOINTS_MAX; i++)
-		breakpoints[i].address = (uintptr_t) NULL;
+		breakpoints[i].address = NULL;
 	
 #ifdef CONFIG_KCONSOLE
Index: kernel/arch/mips32/src/debugger.c
===================================================================
--- kernel/arch/mips32/src/debugger.c	(revision 32eceb4ff0c0ddeba47997beaa5d0677aee84d3a)
+++ kernel/arch/mips32/src/debugger.c	(revision 1b22bd45ebc7f42217757e90fa6e5b57f6ed5d1d)
@@ -247,5 +247,5 @@
 	smc_coherence(((uint32_t *) cur->address)[1]);
 	
-	cur->address = (uintptr_t) NULL;
+	cur->address = NULL;
 	
 	irq_spinlock_unlock(&bkpoint_lock, true);
@@ -289,5 +289,5 @@
 	
 	for (i = 0; i < BKPOINTS_MAX; i++)
-		breakpoints[i].address = (uintptr_t) NULL;
+		breakpoints[i].address = NULL;
 	
 #ifdef CONFIG_KCONSOLE
@@ -417,5 +417,5 @@
 		/* Remove one-shot breakpoint */
 		if ((cur->flags & BKPOINT_ONESHOT))
-			cur->address = (uintptr_t) NULL;
+			cur->address = NULL;
 		
 		/* Remove in-progress flag */
Index: kernel/arch/sparc64/src/mm/sun4u/frame.c
===================================================================
--- kernel/arch/sparc64/src/mm/sun4u/frame.c	(revision 32eceb4ff0c0ddeba47997beaa5d0677aee84d3a)
+++ kernel/arch/sparc64/src/mm/sun4u/frame.c	(revision 1b22bd45ebc7f42217757e90fa6e5b57f6ed5d1d)
@@ -41,5 +41,5 @@
 #include <macros.h>
 
-uintptr_t last_frame = (uintptr_t) NULL;
+uintptr_t last_frame = NULL;
 
 /** Create memory zones according to information stored in memmap.
Index: kernel/generic/include/typedefs.h
===================================================================
--- kernel/generic/include/typedefs.h	(revision 32eceb4ff0c0ddeba47997beaa5d0677aee84d3a)
+++ kernel/generic/include/typedefs.h	(revision 1b22bd45ebc7f42217757e90fa6e5b57f6ed5d1d)
@@ -40,5 +40,5 @@
 #include <arch/types.h>
 
-#define NULL	((void *) 0)
+#define NULL  0UL
 
 #define false  0
Index: kernel/generic/src/main/main.c
===================================================================
--- kernel/generic/src/main/main.c	(revision 32eceb4ff0c0ddeba47997beaa5d0677aee84d3a)
+++ kernel/generic/src/main/main.c	(revision 1b22bd45ebc7f42217757e90fa6e5b57f6ed5d1d)
@@ -97,5 +97,5 @@
 /** Boot allocations. */
 ballocs_t ballocs = {
-	.base = (uintptr_t) NULL,
+	.base = NULL,
 	.size = 0
 };
Index: kernel/generic/src/mm/as.c
===================================================================
--- kernel/generic/src/mm/as.c	(revision 32eceb4ff0c0ddeba47997beaa5d0677aee84d3a)
+++ kernel/generic/src/mm/as.c	(revision 1b22bd45ebc7f42217757e90fa6e5b57f6ed5d1d)
@@ -312,5 +312,5 @@
 	 *
 	 */
-	if (overlaps(va, size, (uintptr_t) NULL, PAGE_SIZE))
+	if (overlaps(va, size, NULL, PAGE_SIZE))
 		return false;
 	
Index: kernel/generic/src/mm/frame.c
===================================================================
--- kernel/generic/src/mm/frame.c	(revision 32eceb4ff0c0ddeba47997beaa5d0677aee84d3a)
+++ kernel/generic/src/mm/frame.c	(revision 1b22bd45ebc7f42217757e90fa6e5b57f6ed5d1d)
@@ -878,5 +878,5 @@
 		 * the assert
 		 */
-		ASSERT(confframe != ADDR2PFN((uintptr_t ) NULL));
+		ASSERT(confframe != NULL);
 		
 		/* If confframe is supposed to be inside our zone, then make sure
@@ -1104,5 +1104,5 @@
 	 */
 	pfn_t pfn = ADDR2PFN(frame);
-	size_t znum = find_zone(pfn, 1, 0);
+	size_t znum = find_zone(pfn, 1, NULL);
 	
 	ASSERT(znum != (size_t) -1);
@@ -1141,5 +1141,5 @@
 	 * First, find host frame zone for addr.
 	 */
-	size_t znum = find_zone(pfn, 1, 0);
+	size_t znum = find_zone(pfn, 1, NULL);
 	
 	ASSERT(znum != (size_t) -1);
Index: kernel/generic/src/synch/smc.c
===================================================================
--- kernel/generic/src/synch/smc.c	(revision 32eceb4ff0c0ddeba47997beaa5d0677aee84d3a)
+++ kernel/generic/src/synch/smc.c	(revision 1b22bd45ebc7f42217757e90fa6e5b57f6ed5d1d)
@@ -44,5 +44,5 @@
 unative_t sys_smc_coherence(uintptr_t va, size_t size)
 {
-	if (overlaps(va, size, (uintptr_t) NULL, PAGE_SIZE))
+	if (overlaps(va, size, NULL, PAGE_SIZE))
 		return EINVAL;
 
Index: kernel/generic/src/udebug/udebug_ops.c
===================================================================
--- kernel/generic/src/udebug/udebug_ops.c	(revision 32eceb4ff0c0ddeba47997beaa5d0677aee84d3a)
+++ kernel/generic/src/udebug/udebug_ops.c	(revision 1b22bd45ebc7f42217757e90fa6e5b57f6ed5d1d)
@@ -428,5 +428,5 @@
  * @param data_size Place to store size of the data.
  *
- * @return EOK.
+ * @returns EOK.
  *
  */
Index: uspace/Makefile
===================================================================
--- uspace/Makefile	(revision 32eceb4ff0c0ddeba47997beaa5d0677aee84d3a)
+++ uspace/Makefile	(revision 1b22bd45ebc7f42217757e90fa6e5b57f6ed5d1d)
@@ -51,4 +51,5 @@
 	app/top \
 	app/virtusbkbd \
+	app/netstart \
 	app/netecho \
 	app/nettest1 \
Index: uspace/app/bdsh/cmds/builtins/builtins.h
===================================================================
--- uspace/app/bdsh/cmds/builtins/builtins.h	(revision 32eceb4ff0c0ddeba47997beaa5d0677aee84d3a)
+++ uspace/app/bdsh/cmds/builtins/builtins.h	(revision 1b22bd45ebc7f42217757e90fa6e5b57f6ed5d1d)
@@ -10,5 +10,5 @@
 #include "cd/cd_def.h"
 #include "exit/exit_def.h"
-	{NULL, NULL, NULL, NULL, 0}
+	{NULL, NULL, NULL, NULL, NULL}
 };
 
Index: uspace/app/netecho/print_error.h
===================================================================
--- uspace/app/netecho/print_error.h	(revision 32eceb4ff0c0ddeba47997beaa5d0677aee84d3a)
+++ uspace/app/netecho/print_error.h	(revision 1b22bd45ebc7f42217757e90fa6e5b57f6ed5d1d)
@@ -43,5 +43,5 @@
  *
  * @param[in] error_code The error code.
- * @return A value indicating whether the error code may be an ICMP error code.
+ * @returns A value indicating whether the error code may be an ICMP error code.
  */
 #define IS_ICMP_ERROR(error_code)	((error_code) > 0)
@@ -50,5 +50,5 @@
  *
  * @param[in] error_code The error code.
- * @return A value indicating whether the error code may be a socket error code.
+ * @returns A value indicating whether the error code may be a socket error code.
  */
 #define IS_SOCKET_ERROR(error_code)	((error_code) < 0)
Index: uspace/app/netstart/Makefile
===================================================================
--- uspace/app/netstart/Makefile	(revision 1b22bd45ebc7f42217757e90fa6e5b57f6ed5d1d)
+++ uspace/app/netstart/Makefile	(revision 1b22bd45ebc7f42217757e90fa6e5b57f6ed5d1d)
@@ -0,0 +1,39 @@
+#
+# Copyright (c) 2005 Martin Decky
+# Copyright (c) 2007 Jakub Jermar
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# - Redistributions of source code must retain the above copyright
+#   notice, this list of conditions and the following disclaimer.
+# - Redistributions in binary form must reproduce the above copyright
+#   notice, this list of conditions and the following disclaimer in the
+#   documentation and/or other materials provided with the distribution.
+# - The name of the author may not be used to endorse or promote products
+#   derived from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+
+USPACE_PREFIX = ../..
+LIBS = 
+EXTRA_CFLAGS = 
+
+BINARY = netstart
+
+SOURCES = \
+	netstart.c
+
+include $(USPACE_PREFIX)/Makefile.common
Index: uspace/app/netstart/netstart.c
===================================================================
--- uspace/app/netstart/netstart.c	(revision 1b22bd45ebc7f42217757e90fa6e5b57f6ed5d1d)
+++ uspace/app/netstart/netstart.c	(revision 1b22bd45ebc7f42217757e90fa6e5b57f6ed5d1d)
@@ -0,0 +1,91 @@
+/*
+ * Copyright (c) 2009 Lukas Mejdrech
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/** @addtogroup net
+ * @{
+ */
+
+/** @file
+ * Start the networking subsystem.
+ */
+
+#define NAME  "netstart"
+
+#include <async.h>
+#include <stdio.h>
+#include <task.h>
+#include <str_error.h>
+#include <ipc/ipc.h>
+#include <ipc/services.h>
+#include <ipc/net_net.h>
+
+#include <net/modules.h>
+
+/** Start a module.
+ *
+ * @param[in] desc	The module description
+ * @param[in] path	The module absolute path.
+ * @returns		True on succesful spanwning.
+ * @returns		False on failure
+ */
+static bool spawn(const char *desc, const char *path)
+{
+	int rc;
+
+	printf("%s: Spawning %s (%s)\n", NAME, desc, path);
+	rc = task_spawnl(NULL, path, path, NULL);
+	if (rc != EOK) {
+		fprintf(stderr, "%s: Error spawning %s (%s)\n", NAME, path,
+		    str_error(rc));
+		return false;
+	}
+	
+	return true;
+}
+
+int main(int argc, char *argv[])
+{
+	int rc;
+	
+	if (!spawn("networking service", "/srv/net"))
+		return EINVAL;
+	
+	printf("%s: Initializing networking\n", NAME);
+	
+	int net_phone = connect_to_service(SERVICE_NETWORKING);
+	rc = ipc_call_sync_0_0(net_phone, NET_NET_STARTUP);
+	if (rc != EOK) {
+		fprintf(stderr, "%s: Startup error %d\n", NAME, rc);
+		return rc;
+	}
+	
+	return EOK;
+}
+
+/** @}
+ */
Index: uspace/app/nettest1/nettest.c
===================================================================
--- uspace/app/nettest1/nettest.c	(revision 32eceb4ff0c0ddeba47997beaa5d0677aee84d3a)
+++ uspace/app/nettest1/nettest.c	(revision 1b22bd45ebc7f42217757e90fa6e5b57f6ed5d1d)
@@ -49,6 +49,6 @@
  * @param[in] family The socket address family.
  * @param[in] type The socket type.
- * @return EOK on success.
- * @return Other error codes as defined for the socket() function.
+ * @returns EOK on success.
+ * @returns Other error codes as defined for the socket() function.
  */
 int sockets_create(int verbose, int *socket_ids, int sockets, int family, sock_type_t type)
@@ -80,6 +80,6 @@
  * @param[in] socket_ids A field of stored socket identifiers.
  * @param[in] sockets The number of sockets in the field. Should be at most the size of the field.
- * @return EOK on success.
- * @return Other error codes as defined for the closesocket() function.
+ * @returns EOK on success.
+ * @returns Other error codes as defined for the closesocket() function.
  */
 int sockets_close(int verbose, int *socket_ids, int sockets)
@@ -114,6 +114,6 @@
  * @param[in] address The destination host address to connect to.
  * @param[in] addrlen The length of the destination address in bytes.
- * @return EOK on success.
- * @return Other error codes as defined for the connect() function.
+ * @returns EOK on success.
+ * @returns Other error codes as defined for the connect() function.
  */
 int sockets_connect(int verbose, int *socket_ids, int sockets, struct sockaddr *address, socklen_t addrlen)
@@ -150,6 +150,6 @@
  * @param[in] size The data size in bytes.
  * @param[in] messages The number of datagrams per socket to be sent.
- * @return EOK on success.
- * @return Other error codes as defined for the sendto() function.
+ * @returns EOK on success.
+ * @returns Other error codes as defined for the sendto() function.
  */
 int sockets_sendto(int verbose, int *socket_ids, int sockets, struct sockaddr *address, socklen_t addrlen, char *data, int size, int messages)
@@ -190,6 +190,6 @@
  * @param[in] size The maximum data size in bytes.
  * @param[in] messages The number of datagrams per socket to be received.
- * @return EOK on success.
- * @return Other error codes as defined for the recvfrom() function.
+ * @returns EOK on success.
+ * @returns Other error codes as defined for the recvfrom() function.
  */
 int sockets_recvfrom(int verbose, int *socket_ids, int sockets, struct sockaddr *address, socklen_t *addrlen, char *data, int size, int messages)
@@ -232,6 +232,6 @@
  * @param[in] size The data size in bytes.
  * @param[in] messages The number of datagrams per socket to be received.
- * @return EOK on success.
- * @return Other error codes as defined for the recvfrom() function.
+ * @returns EOK on success.
+ * @returns Other error codes as defined for the recvfrom() function.
  */
 int sockets_sendto_recvfrom(int verbose, int *socket_ids, int sockets, struct sockaddr *address, socklen_t *addrlen, char *data, int size, int messages)
Index: uspace/app/nettest1/nettest1.c
===================================================================
--- uspace/app/nettest1/nettest1.c	(revision 32eceb4ff0c0ddeba47997beaa5d0677aee84d3a)
+++ uspace/app/nettest1/nettest1.c	(revision 1b22bd45ebc7f42217757e90fa6e5b57f6ed5d1d)
@@ -388,5 +388,5 @@
 		return ENOMEM;
 	}
-	socket_ids[sockets] = 0;
+	socket_ids[sockets] = NULL;
 
 	if (verbose)
Index: uspace/app/nettest2/nettest2.c
===================================================================
--- uspace/app/nettest2/nettest2.c	(revision 32eceb4ff0c0ddeba47997beaa5d0677aee84d3a)
+++ uspace/app/nettest2/nettest2.c	(revision 1b22bd45ebc7f42217757e90fa6e5b57f6ed5d1d)
@@ -336,5 +336,5 @@
 		return ENOMEM;
 	}
-	socket_ids[sockets] = 0;
+	socket_ids[sockets] = NULL;
 
 	if (verbose)
Index: uspace/drv/ns8250/cyclic_buffer.h
===================================================================
--- uspace/drv/ns8250/cyclic_buffer.h	(revision 32eceb4ff0c0ddeba47997beaa5d0677aee84d3a)
+++ uspace/drv/ns8250/cyclic_buffer.h	(revision 1b22bd45ebc7f42217757e90fa6e5b57f6ed5d1d)
@@ -45,5 +45,5 @@
 
 /*
- * @return		False if the buffer is full.
+ * @returns		False if the buffer is full.
  */
 static inline bool buf_push_back(cyclic_buffer_t *buf, uint8_t item)
Index: uspace/lib/c/arch/abs32le/src/stacktrace.c
===================================================================
--- uspace/lib/c/arch/abs32le/src/stacktrace.c	(revision 32eceb4ff0c0ddeba47997beaa5d0677aee84d3a)
+++ uspace/lib/c/arch/abs32le/src/stacktrace.c	(revision 1b22bd45ebc7f42217757e90fa6e5b57f6ed5d1d)
@@ -56,10 +56,10 @@
 uintptr_t stacktrace_fp_get(void)
 {
-	return (uintptr_t) NULL;
+	return NULL;
 }
 
 uintptr_t stacktrace_pc_get(void)
 {
-	return (uintptr_t) NULL;
+	return NULL;
 }
 
Index: uspace/lib/c/arch/abs32le/src/tls.c
===================================================================
--- uspace/lib/c/arch/abs32le/src/tls.c	(revision 32eceb4ff0c0ddeba47997beaa5d0677aee84d3a)
+++ uspace/lib/c/arch/abs32le/src/tls.c	(revision 1b22bd45ebc7f42217757e90fa6e5b57f6ed5d1d)
@@ -46,5 +46,5 @@
 uintptr_t __aeabi_read_tp(void)
 {
-	return (uintptr_t) NULL;
+	return NULL;
 }
 
Index: uspace/lib/c/generic/adt/char_map.c
===================================================================
--- uspace/lib/c/generic/adt/char_map.c	(revision 32eceb4ff0c0ddeba47997beaa5d0677aee84d3a)
+++ uspace/lib/c/generic/adt/char_map.c	(revision 1b22bd45ebc7f42217757e90fa6e5b57f6ed5d1d)
@@ -60,17 +60,17 @@
  * @param[in] value	The integral value to be stored for the key character
  *			string.
- * @return		EOK on success.
- * @return		ENOMEM if there is not enough memory left.
- * @return		EEXIST if the key character string is already used.
+ * @returns		EOK on success.
+ * @returns		ENOMEM if there is not enough memory left.
+ * @returns		EEXIST if the key character string is already used.
  */
 static int
-char_map_add_item(char_map_t *map, const char *identifier, size_t length,
+char_map_add_item(char_map_ref map, const char *identifier, size_t length,
     const int value)
 {
 	if (map->next == (map->size - 1)) {
-		char_map_t **tmp;
-
-		tmp = (char_map_t **) realloc(map->items,
-		    sizeof(char_map_t *) * 2 * map->size);
+		char_map_ref *tmp;
+
+		tmp = (char_map_ref *) realloc(map->items,
+		    sizeof(char_map_ref) * 2 * map->size);
 		if (!tmp)
 			return ENOMEM;
@@ -80,5 +80,5 @@
 	}
 
-	map->items[map->next] = (char_map_t *) malloc(sizeof(char_map_t));
+	map->items[map->next] = (char_map_ref) malloc(sizeof(char_map_t));
 	if (!map->items[map->next])
 		return ENOMEM;
@@ -107,8 +107,8 @@
  *
  * @param[in] map	The character string to integer map.
- * @return		TRUE if the map is valid.
- * @return		FALSE otherwise.
- */
-static int char_map_is_valid(const char_map_t *map)
+ * @returns		TRUE if the map is valid.
+ * @returns		FALSE otherwise.
+ */
+static int char_map_is_valid(const char_map_ref map)
 {
 	return map && (map->magic == CHAR_MAP_MAGIC_VALUE);
@@ -127,17 +127,17 @@
  * @param[in] value	The integral value to be stored for the key character
  *			string.
- * @return		EOK on success.
- * @return		EINVAL if the map is not valid.
- * @return		EINVAL if the identifier parameter is NULL.
- * @return		EINVAL if the length parameter zero (0) and the
+ * @returns		EOK on success.
+ * @returns		EINVAL if the map is not valid.
+ * @returns		EINVAL if the identifier parameter is NULL.
+ * @returns		EINVAL if the length parameter zero (0) and the
  *			identifier parameter is an empty character string (the
  *			first character is the terminating zero ('\0')
  *			character.
- * @return		EEXIST if the key character string is already used.
- * @return		Other error codes as defined for the
+ * @returns		EEXIST if the key character string is already used.
+ * @returns		Other error codes as defined for the
  *			char_map_add_item() function.
  */
 int
-char_map_add(char_map_t *map, const char *identifier, size_t length,
+char_map_add(char_map_ref map, const char *identifier, size_t length,
     const int value)
 {
@@ -172,5 +172,5 @@
  * @param[in,out] map	The character string to integer map.
  */
-void char_map_destroy(char_map_t *map)
+void char_map_destroy(char_map_ref map)
 {
 	if (char_map_is_valid(map)) {
@@ -196,10 +196,10 @@
  *			zero (0) which means that the string is processed until
  *			the terminating zero ('\0') character is found.
- * @return		The node holding the integral value assigned to the key
+ * @returns		The node holding the integral value assigned to the key
  *			character string.
- * @return		NULL if the key is not assigned a node.
- */
-static char_map_t *
-char_map_find_node(const char_map_t *map, const char *identifier,
+ * @returns		NULL if the key is not assigned a node.
+ */
+static char_map_ref
+char_map_find_node(const char_map_ref map, const char *identifier,
     size_t length)
 {
@@ -224,5 +224,5 @@
 	}
 
-	return (char_map_t *) map;
+	return map;
 }
 
@@ -239,10 +239,10 @@
  *			zero (0) which means that the string is processed until
  *			the terminating zero ('\0') character is found.
- * @return		The integral value assigned to the key character string.
- * @return		CHAR_MAP_NULL if the key is not assigned a value.
- */
-int char_map_exclude(char_map_t *map, const char *identifier, size_t length)
-{
-	char_map_t *node;
+ * @returns		The integral value assigned to the key character string.
+ * @returns		CHAR_MAP_NULL if the key is not assigned a value.
+ */
+int char_map_exclude(char_map_ref map, const char *identifier, size_t length)
+{
+	char_map_ref node;
 
 	node = char_map_find_node(map, identifier, length);
@@ -267,10 +267,10 @@
  *			zero (0) which means that the string is processed until
  *			the terminating zero ('\0') character is found.
- *  @return		The integral value assigned to the key character string.
- *  @return		CHAR_MAP_NULL if the key is not assigned a value.
- */
-int char_map_find(const char_map_t *map, const char *identifier, size_t length)
-{
-	char_map_t *node;
+ *  @returns		The integral value assigned to the key character string.
+ *  @returns		CHAR_MAP_NULL if the key is not assigned a value.
+ */
+int char_map_find(const char_map_ref map, const char *identifier, size_t length)
+{
+	char_map_ref node;
 
 	node = char_map_find_node(map, identifier, length);
@@ -281,9 +281,9 @@
  *
  *  @param[in,out] map	The character string to integer map.
- *  @return		EOK on success.
- *  @return		EINVAL if the map parameter is NULL.
- *  @return		ENOMEM if there is not enough memory left.
- */
-int char_map_initialize(char_map_t *map)
+ *  @returns		EOK on success.
+ *  @returns		EINVAL if the map parameter is NULL.
+ *  @returns		ENOMEM if there is not enough memory left.
+ */
+int char_map_initialize(char_map_ref map)
 {
 	if (!map)
@@ -295,5 +295,5 @@
 	map->next = 0;
 
-	map->items = malloc(sizeof(char_map_t *) * map->size);
+	map->items = malloc(sizeof(char_map_ref) * map->size);
 	if (!map->items) {
 		map->magic = 0;
@@ -319,19 +319,19 @@
  *  @param[in] value	The integral value to be stored for the key character
  *			string.
- *  @return		EOK on success.
- *  @return		EINVAL if the map is not valid.
- *  @return		EINVAL if the identifier parameter is NULL.
- *  @return		EINVAL if the length parameter zero (0) and the
+ *  @returns		EOK on success.
+ *  @returns		EINVAL if the map is not valid.
+ *  @returns		EINVAL if the identifier parameter is NULL.
+ *  @returns		EINVAL if the length parameter zero (0) and the
  *			identifier parameter is an empty character string (the
  *			first character is the terminating zero ('\0) character.
- *  @return		EEXIST if the key character string is already used.
- *  @return		Other error codes as defined for the char_map_add_item()
+ *  @returns		EEXIST if the key character string is already used.
+ *  @returns		Other error codes as defined for the char_map_add_item()
  *			function.
  */
 int
-char_map_update(char_map_t *map, const char *identifier, const size_t length,
+char_map_update(char_map_ref map, const char *identifier, const size_t length,
     const int value)
 {
-	char_map_t *node;
+	char_map_ref node;
 
 	node = char_map_find_node(map, identifier, length);
Index: uspace/lib/c/generic/adt/dynamic_fifo.c
===================================================================
--- uspace/lib/c/generic/adt/dynamic_fifo.c	(revision 32eceb4ff0c0ddeba47997beaa5d0677aee84d3a)
+++ uspace/lib/c/generic/adt/dynamic_fifo.c	(revision 1b22bd45ebc7f42217757e90fa6e5b57f6ed5d1d)
@@ -56,8 +56,8 @@
  *
  * @param[in] fifo	The dynamic queue.
- * @return		TRUE if the queue is valid.
- * @return		FALSE otherwise.
- */
-static int dyn_fifo_is_valid(dyn_fifo_t *fifo)
+ * @returns		TRUE if the queue is valid.
+ * @returns		FALSE otherwise.
+ */
+static int dyn_fifo_is_valid(dyn_fifo_ref fifo)
 {
 	return fifo && (fifo->magic_value == DYN_FIFO_MAGIC_VALUE);
@@ -68,10 +68,10 @@
  * @param[in,out] fifo	The dynamic queue.
  * @param[in] size	The initial queue size.
- * @return		EOK on success.
- * @return		EINVAL if the queue is not valid.
- * @return		EBADMEM if the fifo parameter is NULL.
- * @return		ENOMEM if there is not enough memory left.
- */
-int dyn_fifo_initialize(dyn_fifo_t *fifo, int size)
+ * @returns		EOK on success.
+ * @returns		EINVAL if the queue is not valid.
+ * @returns		EBADMEM if the fifo parameter is NULL.
+ * @returns		ENOMEM if there is not enough memory left.
+ */
+int dyn_fifo_initialize(dyn_fifo_ref fifo, int size)
 {
 	if (!fifo)
@@ -100,9 +100,9 @@
  *			this limit. May be zero or negative to indicate no
  *			limit.
- * @return		EOK on success.
- * @return		EINVAL if the queue is not valid.
- * @return		ENOMEM if there is not enough memory left.
- */
-int dyn_fifo_push(dyn_fifo_t *fifo, int value, int max_size)
+ * @returns		EOK on success.
+ * @returns		EINVAL if the queue is not valid.
+ * @returns		ENOMEM if there is not enough memory left.
+ */
+int dyn_fifo_push(dyn_fifo_ref fifo, int value, int max_size)
 {
 	int *new_items;
@@ -150,9 +150,9 @@
  *
  * @param[in,out] fifo	The dynamic queue.
- * @return		Value of the first item in the queue.
- * @return		EINVAL if the queue is not valid.
- * @return		ENOENT if the queue is empty.
- */
-int dyn_fifo_pop(dyn_fifo_t *fifo)
+ * @returns		Value of the first item in the queue.
+ * @returns		EINVAL if the queue is not valid.
+ * @returns		ENOENT if the queue is empty.
+ */
+int dyn_fifo_pop(dyn_fifo_ref fifo)
 {
 	int value;
@@ -172,9 +172,9 @@
  *
  * @param[in,out] fifo	The dynamic queue.
- * @return		Value of the first item in the queue.
- * @return		EINVAL if the queue is not valid.
- * @return		ENOENT if the queue is empty.
- */
-int dyn_fifo_value(dyn_fifo_t *fifo)
+ * @returnsi		Value of the first item in the queue.
+ * @returns		EINVAL if the queue is not valid.
+ * @returns		ENOENT if the queue is empty.
+ */
+int dyn_fifo_value(dyn_fifo_ref fifo)
 {
 	if (!dyn_fifo_is_valid(fifo))
@@ -190,8 +190,8 @@
  *
  * @param[in,out] fifo	The dynamic queue.
- * @return		EOK on success.
- * @return		EINVAL if the queue is not valid.
- */
-int dyn_fifo_destroy(dyn_fifo_t *fifo)
+ * @returns		EOK on success.
+ * @returns		EINVAL if the queue is not valid.
+ */
+int dyn_fifo_destroy(dyn_fifo_ref fifo)
 {
 	if (!dyn_fifo_is_valid(fifo))
Index: uspace/lib/c/generic/adt/measured_strings.c
===================================================================
--- uspace/lib/c/generic/adt/measured_strings.c	(revision 32eceb4ff0c0ddeba47997beaa5d0677aee84d3a)
+++ uspace/lib/c/generic/adt/measured_strings.c	(revision 1b22bd45ebc7f42217757e90fa6e5b57f6ed5d1d)
@@ -55,11 +55,11 @@
  *			appended with the terminating zero ('\0') character
  *			otherwise.
- * @return		The new bundled character string with measured length.
- * @return		NULL if there is not enough memory left.
- */
-measured_string_t *
+ * @returns		The new bundled character string with measured length.
+ * @returns		NULL if there is not enough memory left.
+ */
+measured_string_ref
 measured_string_create_bulk(const char *string, size_t length)
 {
-	measured_string_t *new;
+	measured_string_ref new;
 
 	if (length == 0) {
@@ -67,5 +67,5 @@
 			length++;
 	}
-	new = (measured_string_t *) malloc(sizeof(measured_string_t) +
+	new = (measured_string_ref) malloc(sizeof(measured_string_t) +
 	    (sizeof(char) * (length + 1)));
 	if (!new)
@@ -84,16 +84,16 @@
  *
  * @param[in] source	The source measured string to be copied.
- * @return		The copy of the given measured string.
- * @return		NULL if the source parameter is NULL.
- * @return		NULL if there is not enough memory left.
- */
-measured_string_t *measured_string_copy(measured_string_t *source)
-{
-	measured_string_t *new;
+ * @returns		The copy of the given measured string.
+ * @returns		NULL if the source parameter is NULL.
+ * @returns		NULL if there is not enough memory left.
+ */
+measured_string_ref measured_string_copy(measured_string_ref source)
+{
+	measured_string_ref new;
 
 	if (!source)
 		return NULL;
 
-	new = (measured_string_t *) malloc(sizeof(measured_string_t));
+	new = (measured_string_ref) malloc(sizeof(measured_string_t));
 	if (new) {
 		new->value = (char *) malloc(source->length + 1);
@@ -120,16 +120,16 @@
  *			actual character strings.
  *  @param[in] count	The size of the measured strings array.
- *  @return		EOK on success.
- *  @return		EINVAL if the strings or data parameter is NULL.
- *  @return		EINVAL if the count parameter is zero (0).
- *  @return		EINVAL if the sent array differs in size.
- *  @return		EINVAL if there is inconsistency in sent measured
+ *  @returns		EOK on success.
+ *  @returns		EINVAL if the strings or data parameter is NULL.
+ *  @returns		EINVAL if the count parameter is zero (0).
+ *  @returns		EINVAL if the sent array differs in size.
+ *  @returns		EINVAL if there is inconsistency in sent measured
  *			strings' lengths (should not occur).
- *  @return		ENOMEM if there is not enough memory left.
- *  @return		Other error codes as defined for the
+ *  @returns		ENOMEM if there is not enough memory left.
+ *  @returns		Other error codes as defined for the
  *			async_data_write_finalize() function.
  */
 int
-measured_strings_receive(measured_string_t **strings, char **data,
+measured_strings_receive(measured_string_ref *strings, char **data,
     size_t count)
 {
@@ -166,5 +166,5 @@
 	(*data)[lengths[count] - 1] = '\0';
 
-	*strings = (measured_string_t *) malloc(sizeof(measured_string_t) *
+	*strings = (measured_string_ref) malloc(sizeof(measured_string_t) *
 	    count);
 	if (!*strings) {
@@ -209,8 +209,8 @@
  * @param[in] strings	The measured strings array to be processed.
  * @param[in] count	The measured strings array size.
- * @return		The computed sizes array.
- * @return		NULL if there is not enough memory left.
- */
-static size_t *prepare_lengths(const measured_string_t *strings, size_t count)
+ * @returns		The computed sizes array.
+ * @returns		NULL if there is not enough memory left.
+ */
+static size_t *prepare_lengths(const measured_string_ref strings, size_t count)
 {
 	size_t *lengths;
@@ -238,15 +238,15 @@
  * @param[in] strings	The measured strings array to be transferred.
  * @param[in] count	The measured strings array size.
- * @return		EOK on success.
- * @return		EINVAL if the strings parameter is NULL.
- * @return		EINVAL if the count parameter is zero (0).
- * @return		EINVAL if the calling module does not accept the given
+ * @returns		EOK on success.
+ * @returns		EINVAL if the strings parameter is NULL.
+ * @returns		EINVAL if the count parameter is zero (0).
+ * @returns		EINVAL if the calling module does not accept the given
  *			array size.
- * @return		EINVAL if there is inconsistency in sent measured
+ * @returns		EINVAL if there is inconsistency in sent measured
  *			strings' lengths (should not occur).
- * @return		Other error codes as defined for the
+ * @returns		Other error codes as defined for the
  *			async_data_read_finalize() function.
  */
-int measured_strings_reply(const measured_string_t *strings, size_t count)
+int measured_strings_reply(const measured_string_ref strings, size_t count)
 {
 	size_t *lengths;
@@ -302,14 +302,14 @@
  *			actual character strings.
  * @param[in] count	The size of the measured strings array.
- * @return		EOK on success.
- * @return		EINVAL if the strings or data parameter is NULL.
- * @return		EINVAL if the phone or count parameter is not positive.
- * @return		EINVAL if the sent array differs in size.
- * @return		ENOMEM if there is not enough memory left.
- * @return		Other error codes as defined for the
+ * @returns		EOK on success.
+ * @returns		EINVAL if the strings or data parameter is NULL.
+ * @returns		EINVAL if the phone or count parameter is not positive.
+ * @returns		EINVAL if the sent array differs in size.
+ * @returns		ENOMEM if there is not enough memory left.
+ * @returns		Other error codes as defined for the
  *			async_data_read_start() function.
  */
 int
-measured_strings_return(int phone, measured_string_t **strings, char **data,
+measured_strings_return(int phone, measured_string_ref *strings, char **data,
     size_t count)
 {
@@ -339,5 +339,5 @@
 	}
 
-	*strings = (measured_string_t *) malloc(sizeof(measured_string_t) *
+	*strings = (measured_string_ref) malloc(sizeof(measured_string_t) *
 	    count);
 	if (!*strings) {
@@ -378,12 +378,12 @@
  * @param[in] strings	The measured strings array to be transferred.
  * @param[in] count	The measured strings array size.
- * @return		EOK on success.
- * @return		EINVAL if the strings parameter is NULL.
- * @return		EINVAL if the phone or count parameter is not positive.
- * @return		Other error codes as defined for the
+ * @returns		EOK on success.
+ * @returns		EINVAL if the strings parameter is NULL.
+ * @returns		EINVAL if the phone or count parameter is not positive.
+ * @returns		Other error codes as defined for the
  *			async_data_write_start() function.
  */
 int
-measured_strings_send(int phone, const measured_string_t *strings,
+measured_strings_send(int phone, const measured_string_ref strings,
     size_t count)
 {
Index: uspace/lib/c/generic/async.c
===================================================================
--- uspace/lib/c/generic/async.c	(revision 32eceb4ff0c0ddeba47997beaa5d0677aee84d3a)
+++ uspace/lib/c/generic/async.c	(revision 1b22bd45ebc7f42217757e90fa6e5b57f6ed5d1d)
@@ -536,5 +536,5 @@
 		if (callid)
 			ipc_answer_0(callid, ENOMEM);
-		return (uintptr_t) NULL;
+		return NULL;
 	}
 	
@@ -556,5 +556,5 @@
 		if (callid)
 			ipc_answer_0(callid, ENOMEM);
-		return (uintptr_t) NULL;
+		return NULL;
 	}
 	
Index: uspace/lib/c/generic/io/klog.c
===================================================================
--- uspace/lib/c/generic/io/klog.c	(revision 32eceb4ff0c0ddeba47997beaa5d0677aee84d3a)
+++ uspace/lib/c/generic/io/klog.c	(revision 1b22bd45ebc7f42217757e90fa6e5b57f6ed5d1d)
@@ -52,5 +52,5 @@
 void klog_update(void)
 {
-	(void) __SYSCALL3(SYS_KLOG, 1, (uintptr_t) NULL, 0);
+	(void) __SYSCALL3(SYS_KLOG, 1, NULL, 0);
 }
 
Index: uspace/lib/c/generic/net/icmp_api.c
===================================================================
--- uspace/lib/c/generic/net/icmp_api.c	(revision 32eceb4ff0c0ddeba47997beaa5d0677aee84d3a)
+++ uspace/lib/c/generic/net/icmp_api.c	(revision 1b22bd45ebc7f42217757e90fa6e5b57f6ed5d1d)
@@ -66,12 +66,12 @@
  * @param[in] addr	The target host address.
  * @param[in] addrlen	The torget host address length.
- * @return		ICMP_ECHO on success.
- * @return		ETIMEOUT if the reply has not arrived before the
+ * @returns		ICMP_ECHO on success.
+ * @returns		ETIMEOUT if the reply has not arrived before the
  *			timeout.
- * @return		ICMP type of the received error notification.
- * @return		EINVAL if the addrlen parameter is less or equal to
+ * @returns		ICMP type of the received error notification.
+ * @returns		EINVAL if the addrlen parameter is less or equal to
  *			zero.
- * @return		ENOMEM if there is not enough memory left.
- * @return		EPARTY if there was an internal error.
+ * @returns		ENOMEM if there is not enough memory left.
+ * @returns		EPARTY if there was an internal error.
  */
 int
Index: uspace/lib/c/generic/net/icmp_common.c
===================================================================
--- uspace/lib/c/generic/net/icmp_common.c	(revision 32eceb4ff0c0ddeba47997beaa5d0677aee84d3a)
+++ uspace/lib/c/generic/net/icmp_common.c	(revision 1b22bd45ebc7f42217757e90fa6e5b57f6ed5d1d)
@@ -50,6 +50,6 @@
  * @param[in] timeout	The connection timeout in microseconds. No timeout if
  *			set to zero.
- * @return		The ICMP module phone on success.
- * @return		ETIMEOUT if the connection timeouted.
+ * @returns		The ICMP module phone on success.
+ * @returns		ETIMEOUT if the connection timeouted.
  */
 int icmp_connect_module(services_t service, suseconds_t timeout)
Index: uspace/lib/c/generic/net/inet.c
===================================================================
--- uspace/lib/c/generic/net/inet.c	(revision 32eceb4ff0c0ddeba47997beaa5d0677aee84d3a)
+++ uspace/lib/c/generic/net/inet.c	(revision 1b22bd45ebc7f42217757e90fa6e5b57f6ed5d1d)
@@ -51,8 +51,8 @@
  *  @param[out] address	The character buffer to be filled.
  *  @param[in] length	The buffer length.
- *  @return		EOK on success.
- *  @return		EINVAL if the data or address parameter is NULL.
- *  @return		ENOMEM if the character buffer is not long enough.
- *  @return		ENOTSUP if the address family is not supported.
+ *  @returns		EOK on success.
+ *  @returns		EINVAL if the data or address parameter is NULL.
+ *  @returns		ENOMEM if the character buffer is not long enough.
+ *  @returns		ENOTSUP if the address family is not supported.
  */
 int
@@ -101,8 +101,8 @@
  *  @param[in] address	The character buffer to be parsed.
  *  @param[out] data	The address data to be filled.
- *  @return		EOK on success.
- *  @return		EINVAL if the data parameter is NULL.
- *  @return		ENOENT if the address parameter is NULL.
- *  @return		ENOTSUP if the address family is not supported.
+ *  @returns		EOK on success.
+ *  @returns		EINVAL if the data parameter is NULL.
+ *  @returns		ENOENT if the address parameter is NULL.
+ *  @returns		ENOTSUP if the address family is not supported.
  */
 int inet_pton(uint16_t family, const char *address, uint8_t *data)
Index: uspace/lib/c/generic/net/modules.c
===================================================================
--- uspace/lib/c/generic/net/modules.c	(revision 32eceb4ff0c0ddeba47997beaa5d0677aee84d3a)
+++ uspace/lib/c/generic/net/modules.c	(revision 1b22bd45ebc7f42217757e90fa6e5b57f6ed5d1d)
@@ -159,5 +159,5 @@
  *
  * @param[in] need	The needed module service.
- * @return		The phone of the needed service.
+ * @returns		The phone of the needed service.
  */
 int connect_to_service(services_t need)
@@ -171,6 +171,6 @@
  *  @param[in] timeout	The connection timeout in microseconds. No timeout if
  *			set to zero (0).
- *  @return		The phone of the needed service.
- *  @return		ETIMEOUT if the connection timeouted.
+ *  @returns		The phone of the needed service.
+ *  @returns		ETIMEOUT if the connection timeouted.
  */
 int connect_to_service_timeout(services_t need, suseconds_t timeout)
@@ -204,9 +204,9 @@
  * @param[out] data	The data buffer to be filled.
  * @param[out] length	The buffer length.
- * @return		EOK on success.
- * @return		EBADMEM if the data or the length parameter is NULL.
- * @return		EINVAL if the client does not send data.
- * @return		ENOMEM if there is not enough memory left.
- * @return		Other error codes as defined for the
+ * @returns		EOK on success.
+ * @returns		EBADMEM if the data or the length parameter is NULL.
+ * @returns		EINVAL if the client does not send data.
+ * @returns		ENOMEM if there is not enough memory left.
+ * @returns		Other error codes as defined for the
  *			async_data_write_finalize() function.
  */
@@ -242,9 +242,9 @@
  * @param[in] data	The data buffer to be sent.
  * @param[in] data_length The buffer length.
- * @return		EOK on success.
- * @return		EINVAL if the client does not expect the data.
- * @return		EOVERFLOW if the client does not expect all the data.
+ * @returns		EOK on success.
+ * @returns		EINVAL if the client does not expect the data.
+ * @returns		EOVERFLOW if the client does not expect all the data.
  *			Only partial data are transfered.
- * @return		Other error codes as defined for the
+ * @returns		Other error codes as defined for the
  *			async_data_read_finalize() function.
  */
Index: uspace/lib/c/generic/net/packet.c
===================================================================
--- uspace/lib/c/generic/net/packet.c	(revision 32eceb4ff0c0ddeba47997beaa5d0677aee84d3a)
+++ uspace/lib/c/generic/net/packet.c	(revision 1b22bd45ebc7f42217757e90fa6e5b57f6ed5d1d)
@@ -62,5 +62,8 @@
 
 /** Type definition of the packet map page. */
-typedef packet_t *packet_map_t[PACKET_MAP_SIZE];
+typedef packet_t packet_map_t[PACKET_MAP_SIZE];
+
+/** Type definition of the packet map page pointer. */
+typedef packet_map_t * packet_map_ref;
 
 /** Packet map.
@@ -82,6 +85,6 @@
 /** Initializes the packet map.
  *
- * @return		EOK on success.
- * @return		ENOMEM if there is not enough memory left.
+ * @returns		EOK on success.
+ * @returns		ENOMEM if there is not enough memory left.
  */
 int pm_init(void)
@@ -101,11 +104,11 @@
  *
  * @param[in] packet_id	The packet identifier to be found.
- * @return		The found packet reference.
- * @return		NULL if the mapping does not exist.
- */
-packet_t *pm_find(packet_id_t packet_id)
-{
-	packet_map_t *map;
-	packet_t *packet;
+ * @returns		The found packet reference.
+ * @returns		NULL if the mapping does not exist.
+ */
+packet_t pm_find(packet_id_t packet_id)
+{
+	packet_map_ref map;
+	packet_t packet;
 
 	if (!packet_id)
@@ -130,12 +133,12 @@
  *
  * @param[in] packet	The packet to be remembered.
- * @return		EOK on success.
- * @return		EINVAL if the packet is not valid.
- * @return		EINVAL if the packet map is not initialized.
- * @return		ENOMEM if there is not enough memory left.
- */
-int pm_add(packet_t *packet)
-{
-	packet_map_t *map;
+ * @returns		EOK on success.
+ * @returns		EINVAL if the packet is not valid.
+ * @returns		EINVAL if the packet map is not initialized.
+ * @returns		ENOMEM if there is not enough memory left.
+ */
+int pm_add(packet_t packet)
+{
+	packet_map_ref map;
 	int rc;
 
@@ -151,5 +154,5 @@
 	} else {
 		do {
-			map = (packet_map_t *) malloc(sizeof(packet_map_t));
+			map = (packet_map_ref) malloc(sizeof(packet_map_t));
 			if (!map) {
 				fibril_rwlock_write_unlock(&pm_globals.lock);
@@ -177,6 +180,6 @@
 	int count;
 	int index;
-	packet_map_t *map;
-	packet_t *packet;
+	packet_map_ref map;
+	packet_t packet;
 
 	fibril_rwlock_write_lock(&pm_globals.lock);
@@ -205,11 +208,11 @@
  * @param[in] order	The packet order value.
  * @param[in] metric	The metric value of the packet.
- * @return		EOK on success.
- * @return		EINVAL if the first parameter is NULL.
- * @return		EINVAL if the packet is not valid.
- */
-int pq_add(packet_t **first, packet_t *packet, size_t order, size_t metric)
-{
-	packet_t *item;
+ * @returns		EOK on success.
+ * @returns		EINVAL if the first parameter is NULL.
+ * @returns		EINVAL if the packet is not valid.
+ */
+int pq_add(packet_t * first, packet_t packet, size_t order, size_t metric)
+{
+	packet_t item;
 
 	if (!first || !packet_is_valid(packet))
@@ -249,11 +252,11 @@
  * @param[in] first	The first packet of the queue.
  * @param[in] order	The packet order value.
- * @return		The packet with the given order.
- * @return		NULL if the first packet is not valid.
- * @return		NULL if the packet is not found.
- */
-packet_t *pq_find(packet_t *packet, size_t order)
-{
-	packet_t *item;
+ * @returns		The packet with the given order.
+ * @returns		NULL if the first packet is not valid.
+ * @returns		NULL if the packet is not found.
+ */
+packet_t pq_find(packet_t packet, size_t order)
+{
+	packet_t item;
 
 	if (!packet_is_valid(packet))
@@ -275,10 +278,10 @@
  * @param[in] packet	The packet in the queue.
  * @param[in] new_packet The new packet to be inserted.
- * @return		EOK on success.
- * @return		EINVAL if etiher of the packets is invalid.
- */
-int pq_insert_after(packet_t *packet, packet_t *new_packet)
-{
-	packet_t *item;
+ * @returns		EOK on success.
+ * @returns		EINVAL if etiher of the packets is invalid.
+ */
+int pq_insert_after(packet_t packet, packet_t new_packet)
+{
+	packet_t item;
 
 	if (!packet_is_valid(packet) || !packet_is_valid(new_packet))
@@ -298,13 +301,13 @@
  *
  * @param[in] packet	The packet to be detached.
- * @return		The next packet in the queue. If the packet is the first
+ * @returns		The next packet in the queue. If the packet is the first
  *			one of the queue, this becomes the new first one.
- * @return		NULL if there is no packet left.
- * @return		NULL if the packet is not valid.
- */
-packet_t *pq_detach(packet_t *packet)
-{
-	packet_t *next;
-	packet_t *previous;
+ * @returns		NULL if there is no packet left.
+ * @returns		NULL if the packet is not valid.
+ */
+packet_t pq_detach(packet_t packet)
+{
+	packet_t next;
+	packet_t previous;
 
 	if (!packet_is_valid(packet))
@@ -328,8 +331,8 @@
  * @param[in] order	The packet order value.
  * @param[in] metric	The metric value of the packet.
- * @return		EOK on success.
- * @return		EINVAL if the packet is invalid.
- */
-int pq_set_order(packet_t *packet, size_t order, size_t metric)
+ * @returns		EOK on success.
+ * @returns		EINVAL if the packet is invalid.
+ */
+int pq_set_order(packet_t packet, size_t order, size_t metric)
 {
 	if (!packet_is_valid(packet))
@@ -346,8 +349,8 @@
  * @param[out] order	The packet order value.
  * @param[out] metric	The metric value of the packet.
- * @return		EOK on success.
- * @return		EINVAL if the packet is invalid.
- */
-int pq_get_order(packet_t *packet, size_t *order, size_t *metric)
+ * @returns		EOK on success.
+ * @returns		EINVAL if the packet is invalid.
+ */
+int pq_get_order(packet_t packet, size_t *order, size_t *metric)
 {
 	if (!packet_is_valid(packet))
@@ -372,8 +375,8 @@
  *			packets after its detachment.
  */
-void pq_destroy(packet_t *first, void (*packet_release)(packet_t *packet))
-{
-	packet_t *actual;
-	packet_t *next;
+void pq_destroy(packet_t first, void (*packet_release)(packet_t packet))
+{
+	packet_t actual;
+	packet_t next;
 
 	actual = first;
@@ -391,9 +394,9 @@
  *
  * @param[in] packet	The packet queue member.
- * @return		The next packet in the queue.
- * @return		NULL if there is no next packet.
- * @return		NULL if the packet is not valid.
- */
-packet_t *pq_next(packet_t *packet)
+ * @returns		The next packet in the queue.
+ * @returns		NULL if there is no next packet.
+ * @returns		NULL if the packet is not valid.
+ */
+packet_t pq_next(packet_t packet)
 {
 	if (!packet_is_valid(packet))
@@ -406,9 +409,9 @@
  *
  * @param[in] packet	The packet queue member.
- * @return		The previous packet in the queue.
- * @return		NULL if there is no previous packet.
- * @return		NULL if the packet is not valid.
- */
-packet_t *pq_previous(packet_t *packet)
+ * @returns		The previous packet in the queue.
+ * @returns		NULL if there is no previous packet.
+ * @returns		NULL if the packet is not valid.
+ */
+packet_t pq_previous(packet_t packet)
 {
 	if (!packet_is_valid(packet))
Index: uspace/lib/c/generic/net/socket_client.c
===================================================================
--- uspace/lib/c/generic/net/socket_client.c	(revision 32eceb4ff0c0ddeba47997beaa5d0677aee84d3a)
+++ uspace/lib/c/generic/net/socket_client.c	(revision 1b22bd45ebc7f42217757e90fa6e5b57f6ed5d1d)
@@ -79,4 +79,9 @@
 typedef struct socket socket_t;
 
+/** Type definition of the socket specific data pointer.
+ * @see socket
+ */
+typedef socket_t *socket_ref;
+
 /** Socket specific data.
  *
@@ -157,5 +162,5 @@
 
 	/** Active sockets. */
-	sockets_t *sockets;
+	sockets_ref sockets;
 
 	/** Safety lock.
@@ -178,11 +183,11 @@
 /** Returns the active sockets.
  *
- *  @return		The active sockets.
- */
-static sockets_t *socket_get_sockets(void)
+ *  @returns		The active sockets.
+ */
+static sockets_ref socket_get_sockets(void)
 {
 	if (!socket_globals.sockets) {
 		socket_globals.sockets =
-		    (sockets_t *) malloc(sizeof(sockets_t));
+		    (sockets_ref) malloc(sizeof(sockets_t));
 		if (!socket_globals.sockets)
 			return NULL;
@@ -208,5 +213,5 @@
 	ipc_callid_t callid;
 	ipc_call_t call;
-	socket_t *socket;
+	socket_ref socket;
 	int rc;
 
@@ -286,6 +291,6 @@
  * Connects to the TCP module if necessary.
  *
- * @return		The TCP module phone.
- * @return		Other error codes as defined for the
+ * @returns		The TCP module phone.
+ * @returns		Other error codes as defined for the
  *			bind_service_timeout() function.
  */
@@ -305,6 +310,6 @@
  * Connects to the UDP module if necessary.
  *
- * @return		The UDP module phone.
- * @return		Other error codes as defined for the
+ * @returns		The UDP module phone.
+ * @returns		Other error codes as defined for the
  *			bind_service_timeout() function.
  */
@@ -322,10 +327,10 @@
 /** Tries to find a new free socket identifier.
  *
- * @return		The new socket identifier.
- * @return		ELIMIT if there is no socket identifier available.
+ * @returns		The new socket identifier.
+ * @returns		ELIMIT if there is no socket identifier available.
  */
 static int socket_generate_new_id(void)
 {
-	sockets_t *sockets;
+	sockets_ref sockets;
 	int socket_id = 0;
 	int count;
@@ -367,5 +372,5 @@
  */
 static void
-socket_initialize(socket_t *socket, int socket_id, int phone,
+socket_initialize(socket_ref socket, int socket_id, int phone,
     services_t service)
 {
@@ -387,18 +392,18 @@
  * @param[in] type	Socket type.
  * @param[in] protocol	Socket protocol.
- * @return		The socket identifier on success.
- * @return		EPFNOTSUPPORT if the protocol family is not supported.
- * @return		ESOCKNOTSUPPORT if the socket type is not supported.
- * @return		EPROTONOSUPPORT if the protocol is not supported.
- * @return		ENOMEM if there is not enough memory left.
- * @return		ELIMIT if there was not a free socket identifier found
+ * @returns		The socket identifier on success.
+ * @returns		EPFNOTSUPPORT if the protocol family is not supported.
+ * @returns		ESOCKNOTSUPPORT if the socket type is not supported.
+ * @returns		EPROTONOSUPPORT if the protocol is not supported.
+ * @returns		ENOMEM if there is not enough memory left.
+ * @returns		ELIMIT if there was not a free socket identifier found
  *			this time.
- * @return		Other error codes as defined for the NET_SOCKET message.
- * @return		Other error codes as defined for the
+ * @returns		Other error codes as defined for the NET_SOCKET message.
+ * @returns		Other error codes as defined for the
  *			bind_service_timeout() function.
  */
 int socket(int domain, int type, int protocol)
 {
-	socket_t *socket;
+	socket_ref socket;
 	int phone;
 	int socket_id;
@@ -458,5 +463,5 @@
 
 	// create a new socket structure
-	socket = (socket_t *) malloc(sizeof(socket_t));
+	socket = (socket_ref) malloc(sizeof(socket_t));
 	if (!socket)
 		return ENOMEM;
@@ -509,9 +514,9 @@
  * @param[in] data	The data to be sent.
  * @param[in] datalength The data length.
- * @return		EOK on success.
- * @return		ENOTSOCK if the socket is not found.
- * @return		EBADMEM if the data parameter is NULL.
- * @return		NO_DATA if the datalength parameter is zero (0).
- * @return		Other error codes as defined for the spcific message.
+ * @returns		EOK on success.
+ * @returns		ENOTSOCK if the socket is not found.
+ * @returns		EBADMEM if the data parameter is NULL.
+ * @returns		NO_DATA if the datalength parameter is zero (0).
+ * @returns		Other error codes as defined for the spcific message.
  */
 static int
@@ -519,5 +524,5 @@
     const void *data, size_t datalength)
 {
-	socket_t *socket;
+	socket_ref socket;
 	aid_t message_id;
 	ipcarg_t result;
@@ -554,9 +559,9 @@
  * @param[in] my_addr	The port address.
  * @param[in] addrlen	The address length.
- * @return		EOK on success.
- * @return		ENOTSOCK if the socket is not found.
- * @return		EBADMEM if the my_addr parameter is NULL.
- * @return		NO_DATA if the addlen parameter is zero.
- * @return		Other error codes as defined for the NET_SOCKET_BIND
+ * @returns		EOK on success.
+ * @returns		ENOTSOCK if the socket is not found.
+ * @returns		EBADMEM if the my_addr parameter is NULL.
+ * @returns		NO_DATA if the addlen parameter is zero.
+ * @returns		Other error codes as defined for the NET_SOCKET_BIND
  *			message.
  */
@@ -575,13 +580,13 @@
  * @param[in] socket_id	Socket identifier.
  * @param[in] backlog	The maximum number of waiting sockets to be accepted.
- * @return		EOK on success.
- * @return		EINVAL if the backlog parameter is not positive (<=0).
- * @return		ENOTSOCK if the socket is not found.
- * @return		Other error codes as defined for the NET_SOCKET_LISTEN
+ * @returns		EOK on success.
+ * @returns		EINVAL if the backlog parameter is not positive (<=0).
+ * @returns		ENOTSOCK if the socket is not found.
+ * @returns		Other error codes as defined for the NET_SOCKET_LISTEN
  *			message.
  */
 int listen(int socket_id, int backlog)
 {
-	socket_t *socket;
+	socket_ref socket;
 	int result;
 
@@ -613,15 +618,15 @@
  * @param[out] cliaddr	The remote client address.
  * @param[in] addrlen	The address length.
- * @return		EOK on success.
- * @return		EBADMEM if the cliaddr or addrlen parameter is NULL.
- * @return		EINVAL if the backlog parameter is not positive (<=0).
- * @return		ENOTSOCK if the socket is not found.
- * @return		Other error codes as defined for the NET_SOCKET_ACCEPT
+ * @returns		EOK on success.
+ * @returns		EBADMEM if the cliaddr or addrlen parameter is NULL.
+ * @returns		EINVAL if the backlog parameter is not positive (<=0).
+ * @returns		ENOTSOCK if the socket is not found.
+ * @returns		Other error codes as defined for the NET_SOCKET_ACCEPT
  *			message.
  */
 int accept(int socket_id, struct sockaddr * cliaddr, socklen_t * addrlen)
 {
-	socket_t *socket;
-	socket_t *new_socket;
+	socket_ref socket;
+	socket_ref new_socket;
 	aid_t message_id;
 	ipcarg_t ipc_result;
@@ -656,5 +661,5 @@
 
 	// create a new scoket
-	new_socket = (socket_t *) malloc(sizeof(socket_t));
+	new_socket = (socket_ref) malloc(sizeof(socket_t));
 	if (!new_socket) {
 		fibril_mutex_unlock(&socket->accept_lock);
@@ -716,9 +721,9 @@
  * @param[in] serv_addr	The remote server address.
  * @param[in] addrlen	The address length.
- * @return		EOK on success.
- * @return		EBADMEM if the serv_addr parameter is NULL.
- * @return		NO_DATA if the addlen parameter is zero.
- * @return		ENOTSOCK if the socket is not found.
- * @return		Other error codes as defined for the NET_SOCKET_CONNECT
+ * @returns		EOK on success.
+ * @returns		EBADMEM if the serv_addr parameter is NULL.
+ * @returns		NO_DATA if the addlen parameter is zero.
+ * @returns		ENOTSOCK if the socket is not found.
+ * @returns		Other error codes as defined for the NET_SOCKET_CONNECT
  *			message.
  */
@@ -740,5 +745,5 @@
  * @param[in] socket	The socket to be destroyed.
  */
-static void socket_destroy(socket_t *socket)
+static void socket_destroy(socket_ref socket)
 {
 	int accepted_id;
@@ -756,14 +761,14 @@
  *
  * @param[in] socket_id	Socket identifier.
- * @return		EOK on success.
- * @return		ENOTSOCK if the socket is not found.
- * @return		EINPROGRESS if there is another blocking function in
+ * @returns		EOK on success.
+ * @returns		ENOTSOCK if the socket is not found.
+ * @returns		EINPROGRESS if there is another blocking function in
  *			progress.
- * @return		Other error codes as defined for the NET_SOCKET_CLOSE
+ * @returns		Other error codes as defined for the NET_SOCKET_CLOSE
  *			message.
  */
 int closesocket(int socket_id)
 {
-	socket_t *socket;
+	socket_ref socket;
 	int rc;
 
@@ -806,10 +811,10 @@
  *			sockets.
  * @param[in] addrlen	The address length. Used only if toaddr is not NULL.
- * @return		EOK on success.
- * @return		ENOTSOCK if the socket is not found.
- * @return		EBADMEM if the data or toaddr parameter is NULL.
- * @return		NO_DATA if the datalength or the addrlen parameter is
+ * @returns		EOK on success.
+ * @returns		ENOTSOCK if the socket is not found.
+ * @returns		EBADMEM if the data or toaddr parameter is NULL.
+ * @returns		NO_DATA if the datalength or the addrlen parameter is
  *			zero (0).
- * @return		Other error codes as defined for the NET_SOCKET_SENDTO
+ * @returns		Other error codes as defined for the NET_SOCKET_SENDTO
  *			message.
  */
@@ -819,5 +824,5 @@
     socklen_t addrlen)
 {
-	socket_t *socket;
+	socket_ref socket;
 	aid_t message_id;
 	ipcarg_t result;
@@ -908,9 +913,9 @@
  * @param[in] datalength The data length.
  * @param[in] flags	Various send flags.
- * @return		EOK on success.
- * @return		ENOTSOCK if the socket is not found.
- * @return		EBADMEM if the data parameter is NULL.
- * @return		NO_DATA if the datalength parameter is zero.
- * @return		Other error codes as defined for the NET_SOCKET_SEND
+ * @returns		EOK on success.
+ * @returns		ENOTSOCK if the socket is not found.
+ * @returns		EBADMEM if the data parameter is NULL.
+ * @returns		NO_DATA if the datalength parameter is zero.
+ * @returns		Other error codes as defined for the NET_SOCKET_SEND
  *			message.
  */
@@ -932,10 +937,10 @@
  * @param[in] toaddr	The destination address.
  * @param[in] addrlen	The address length.
- * @return		EOK on success.
- * @return		ENOTSOCK if the socket is not found.
- * @return		EBADMEM if the data or toaddr parameter is NULL.
- * @return		NO_DATA if the datalength or the addrlen parameter is
+ * @returns		EOK on success.
+ * @returns		ENOTSOCK if the socket is not found.
+ * @returns		EBADMEM if the data or toaddr parameter is NULL.
+ * @returns		NO_DATA if the datalength or the addrlen parameter is
  *			zero.
- * @return		Other error codes as defined for the NET_SOCKET_SENDTO
+ * @returns		Other error codes as defined for the NET_SOCKET_SENDTO
  *			message.
  */
@@ -966,9 +971,9 @@
  *			read. The actual address length is set. Used only if
  *			fromaddr is not NULL.
- * @return		EOK on success.
- * @return		ENOTSOCK if the socket is not found.
- * @return		EBADMEM if the data parameter is NULL.
- * @return		NO_DATA if the datalength or addrlen parameter is zero.
- * @return		Other error codes as defined for the spcific message.
+ * @returns		EOK on success.
+ * @returns		ENOTSOCK if the socket is not found.
+ * @returns		EBADMEM if the data parameter is NULL.
+ * @returns		NO_DATA if the datalength or addrlen parameter is zero.
+ * @returns		Other error codes as defined for the spcific message.
  */
 static int
@@ -976,5 +981,5 @@
     int flags, struct sockaddr *fromaddr, socklen_t *addrlen)
 {
-	socket_t *socket;
+	socket_ref socket;
 	aid_t message_id;
 	ipcarg_t ipc_result;
@@ -1095,9 +1100,9 @@
  * @param[in] datalength The data length.
  * @param[in] flags	Various receive flags.
- * @return		EOK on success.
- * @return		ENOTSOCK if the socket is not found.
- * @return		EBADMEM if the data parameter is NULL.
- * @return		NO_DATA if the datalength parameter is zero.
- * @return		Other error codes as defined for the NET_SOCKET_RECV
+ * @returns		EOK on success.
+ * @returns		ENOTSOCK if the socket is not found.
+ * @returns		EBADMEM if the data parameter is NULL.
+ * @returns		NO_DATA if the datalength parameter is zero.
+ * @returns		Other error codes as defined for the NET_SOCKET_RECV
  *			message.
  */
@@ -1118,9 +1123,9 @@
  * @param[in,out] addrlen The address length. The maximum address length is
  *			read. The actual address length is set.
- * @return		EOK on success.
- * @return		ENOTSOCK if the socket is not found.
- * @return		EBADMEM if the data or fromaddr parameter is NULL.
- * @return		NO_DATA if the datalength or addrlen parameter is zero.
- * @return		Other error codes as defined for the NET_SOCKET_RECVFROM
+ * @returns		EOK on success.
+ * @returns		ENOTSOCK if the socket is not found.
+ * @returns		EBADMEM if the data or fromaddr parameter is NULL.
+ * @returns		NO_DATA if the datalength or addrlen parameter is zero.
+ * @returns		Other error codes as defined for the NET_SOCKET_RECVFROM
  *			message.
  */
@@ -1148,9 +1153,9 @@
  * @param[in,out] optlen The value buffer length. The maximum length is read.
  *			The actual length is set.
- * @return		EOK on success.
- * @return		ENOTSOCK if the socket is not found.
- * @return		EBADMEM if the value or optlen parameter is NULL.
- * @return		NO_DATA if the optlen parameter is zero.
- * @return		Other error codes as defined for the
+ * @returns		EOK on success.
+ * @returns		ENOTSOCK if the socket is not found.
+ * @returns		EBADMEM if the value or optlen parameter is NULL.
+ * @returns		NO_DATA if the optlen parameter is zero.
+ * @returns		Other error codes as defined for the
  *			NET_SOCKET_GETSOCKOPT message.
  */
@@ -1158,5 +1163,5 @@
 getsockopt(int socket_id, int level, int optname, void *value, size_t *optlen)
 {
-	socket_t *socket;
+	socket_ref socket;
 	aid_t message_id;
 	ipcarg_t result;
@@ -1201,9 +1206,9 @@
  * @param[in] value	The value to be set.
  * @param[in] optlen	The value length.
- * @return		EOK on success.
- * @return		ENOTSOCK if the socket is not found.
- * @return		EBADMEM if the value parameter is NULL.
- * @return		NO_DATA if the optlen parameter is zero.
- * @return		Other error codes as defined for the
+ * @returns		EOK on success.
+ * @returns		ENOTSOCK if the socket is not found.
+ * @returns		EBADMEM if the value parameter is NULL.
+ * @returns		NO_DATA if the optlen parameter is zero.
+ * @returns		Other error codes as defined for the
  *			NET_SOCKET_SETSOCKOPT message.
  */
Index: uspace/lib/c/include/adt/char_map.h
===================================================================
--- uspace/lib/c/include/adt/char_map.h	(revision 32eceb4ff0c0ddeba47997beaa5d0677aee84d3a)
+++ uspace/lib/c/include/adt/char_map.h	(revision 1b22bd45ebc7f42217757e90fa6e5b57f6ed5d1d)
@@ -48,4 +48,9 @@
 typedef struct char_map	char_map_t;
 
+/** Type definition of the character string to integer map pointer.
+ *  @see char_map
+ */
+typedef char_map_t *char_map_ref;
+
 /** Character string to integer map item.
  *
@@ -64,15 +69,15 @@
 	int next;
 	/** Next character array. */
-	char_map_t **items;
+	char_map_ref *items;
 	/** Consistency check magic value. */
 	int magic;
 };
 
-extern int char_map_initialize(char_map_t *);
-extern void char_map_destroy(char_map_t *);
-extern int char_map_exclude(char_map_t *, const char *, size_t);
-extern int char_map_add(char_map_t *, const char *, size_t, const int);
-extern int char_map_find(const char_map_t *, const char *, size_t);
-extern int char_map_update(char_map_t *, const char *, size_t, const int);
+extern int char_map_initialize(char_map_ref);
+extern void char_map_destroy(char_map_ref);
+extern int char_map_exclude(char_map_ref, const char *, size_t);
+extern int char_map_add(char_map_ref, const char *, size_t, const int);
+extern int char_map_find(const char_map_ref, const char *, size_t);
+extern int char_map_update(char_map_ref, const char *, size_t, const int);
 
 #endif
Index: uspace/lib/c/include/adt/dynamic_fifo.h
===================================================================
--- uspace/lib/c/include/adt/dynamic_fifo.h	(revision 32eceb4ff0c0ddeba47997beaa5d0677aee84d3a)
+++ uspace/lib/c/include/adt/dynamic_fifo.h	(revision 1b22bd45ebc7f42217757e90fa6e5b57f6ed5d1d)
@@ -44,4 +44,9 @@
 typedef struct dyn_fifo	dyn_fifo_t;
 
+/** Type definition of the dynamic fifo queue pointer.
+ *  @see dyn_fifo
+ */
+typedef dyn_fifo_t *dyn_fifo_ref;
+
 /** Dynamic first in first out positive integer queue.
  * Possitive integer values only.
@@ -61,9 +66,9 @@
 };
 
-extern int dyn_fifo_initialize(dyn_fifo_t *, int);
-extern int dyn_fifo_destroy(dyn_fifo_t *);
-extern int dyn_fifo_push(dyn_fifo_t *, int, int);
-extern int dyn_fifo_pop(dyn_fifo_t *);
-extern int dyn_fifo_value(dyn_fifo_t *);
+extern int dyn_fifo_initialize(dyn_fifo_ref, int);
+extern int dyn_fifo_destroy(dyn_fifo_ref);
+extern int dyn_fifo_push(dyn_fifo_ref, int, int);
+extern int dyn_fifo_pop(dyn_fifo_ref);
+extern int dyn_fifo_value(dyn_fifo_ref);
 
 #endif
Index: uspace/lib/c/include/adt/generic_char_map.h
===================================================================
--- uspace/lib/c/include/adt/generic_char_map.h	(revision 32eceb4ff0c0ddeba47997beaa5d0677aee84d3a)
+++ uspace/lib/c/include/adt/generic_char_map.h	(revision 1b22bd45ebc7f42217757e90fa6e5b57f6ed5d1d)
@@ -55,4 +55,5 @@
 	\
 	typedef	struct name name##_t; \
+	typedef	name##_t *name##_ref; \
 	\
 	struct	name { \
@@ -62,11 +63,11 @@
 	}; \
 	\
-	int name##_add(name##_t *, const char *, const size_t, type *); \
-	int name##_count(name##_t *); \
-	void name##_destroy(name##_t *); \
-	void name##_exclude(name##_t *, const char *, const size_t); \
-	type *name##_find(name##_t *, const char *, const size_t); \
-	int name##_initialize(name##_t *); \
-	int name##_is_valid(name##_t *);
+	int name##_add(name##_ref, const char *, const size_t, type *); \
+	int name##_count(name##_ref); \
+	void name##_destroy(name##_ref); \
+	void name##_exclude(name##_ref, const char *, const size_t); \
+	type *name##_find(name##_ref, const char *, const size_t); \
+	int name##_initialize(name##_ref); \
+	int name##_is_valid(name##_ref);
 
 /** Character string to generic type map implementation.
@@ -80,5 +81,5 @@
 	GENERIC_FIELD_IMPLEMENT(name##_items, type) \
 	\
-	int name##_add(name##_t *map, const char *name, const size_t length, \
+	int name##_add(name##_ref map, const char *name, const size_t length, \
 	     type *value) \
 	{ \
@@ -98,5 +99,5 @@
 	} \
 	\
-	int name##_count(name##_t *map) \
+	int name##_count(name##_ref map) \
 	{ \
 		return name##_is_valid(map) ? \
@@ -104,5 +105,5 @@
 	} \
 	\
-	void name##_destroy(name##_t *map) \
+	void name##_destroy(name##_ref map) \
 	{ \
 		if (name##_is_valid(map)) { \
@@ -112,5 +113,5 @@
 	} \
 	\
-	void name##_exclude(name##_t *map, const char *name, \
+	void name##_exclude(name##_ref map, const char *name, \
 	    const size_t length) \
 	{ \
@@ -124,5 +125,5 @@
 	} \
 	\
-	type *name##_find(name##_t *map, const char *name, \
+	type *name##_find(name##_ref map, const char *name, \
 	    const size_t length) \
 	{ \
@@ -137,5 +138,5 @@
 	} \
 	\
-	int name##_initialize(name##_t *map) \
+	int name##_initialize(name##_ref map) \
 	{ \
 		int rc; \
@@ -154,5 +155,5 @@
 	} \
 	\
-	int name##_is_valid(name##_t *map) \
+	int name##_is_valid(name##_ref map) \
 	{ \
 		return map && (map->magic == GENERIC_CHAR_MAP_MAGIC_VALUE); \
Index: uspace/lib/c/include/adt/generic_field.h
===================================================================
--- uspace/lib/c/include/adt/generic_field.h	(revision 32eceb4ff0c0ddeba47997beaa5d0677aee84d3a)
+++ uspace/lib/c/include/adt/generic_field.h	(revision 1b22bd45ebc7f42217757e90fa6e5b57f6ed5d1d)
@@ -53,4 +53,5 @@
 #define GENERIC_FIELD_DECLARE(name, type) \
 	typedef	struct name name##_t; \
+	typedef	name##_t *name##_ref; \
 	\
 	struct	name { \
@@ -61,12 +62,12 @@
 	}; \
 	\
-	int name##_add(name##_t *, type *); \
-	int name##_count(name##_t *); \
-	void name##_destroy(name##_t *); \
-	void name##_exclude_index(name##_t *, int); \
-	type **name##_get_field(name##_t *); \
-	type *name##_get_index(name##_t *, int); \
-	int name##_initialize(name##_t *); \
-	int name##_is_valid(name##_t *);
+	int name##_add(name##_ref, type *); \
+	int name##_count(name##_ref); \
+	void name##_destroy(name##_ref); \
+	void name##_exclude_index(name##_ref, int); \
+	type **name##_get_field(name##_ref); \
+	type *name##_get_index(name##_ref, int); \
+	int name##_initialize(name##_ref); \
+	int name##_is_valid(name##_ref);
 
 /** Generic type field implementation.
@@ -78,5 +79,5 @@
  */
 #define GENERIC_FIELD_IMPLEMENT(name, type) \
-	int name##_add(name##_t *field, type *value) \
+	int name##_add(name##_ref field, type *value) \
 	{ \
 		if (name##_is_valid(field)) { \
@@ -98,10 +99,10 @@
 	} \
 	\
-	int name##_count(name##_t *field) \
+	int name##_count(name##_ref field) \
 	{ \
 		return name##_is_valid(field) ? field->next : -1; \
 	} \
 	\
-	void name##_destroy(name##_t *field) \
+	void name##_destroy(name##_ref field) \
 	{ \
 		if (name##_is_valid(field)) { \
@@ -116,5 +117,5 @@
 	} \
 	 \
-	void name##_exclude_index(name##_t *field, int index) \
+	void name##_exclude_index(name##_ref field, int index) \
 	{ \
 		if (name##_is_valid(field) && (index >= 0) && \
@@ -125,5 +126,5 @@
 	} \
 	 \
-	type *name##_get_index(name##_t *field, int index) \
+	type *name##_get_index(name##_ref field, int index) \
 	{ \
 		if (name##_is_valid(field) && (index >= 0) && \
@@ -133,10 +134,10 @@
 	} \
 	\
-	type **name##_get_field(name##_t *field) \
+	type **name##_get_field(name##_ref field) \
 	{ \
 		return name##_is_valid(field) ? field->items : NULL; \
 	} \
 	\
-	int name##_initialize(name##_t *field) \
+	int name##_initialize(name##_ref field) \
 	{ \
 		if (!field) \
@@ -152,5 +153,5 @@
 	} \
 	\
-	int name##_is_valid(name##_t *field) \
+	int name##_is_valid(name##_ref field) \
 	{ \
 		return field && (field->magic == GENERIC_FIELD_MAGIC_VALUE); \
Index: uspace/lib/c/include/adt/int_map.h
===================================================================
--- uspace/lib/c/include/adt/int_map.h	(revision 32eceb4ff0c0ddeba47997beaa5d0677aee84d3a)
+++ uspace/lib/c/include/adt/int_map.h	(revision 1b22bd45ebc7f42217757e90fa6e5b57f6ed5d1d)
@@ -56,5 +56,7 @@
 #define INT_MAP_DECLARE(name, type) \
 	typedef	struct name name##_t; \
+	typedef	name##_t *name##_ref; \
 	typedef	struct name##_item name##_item_t; \
+	typedef	name##_item_t *name##_item_ref; \
 	\
 	struct	name##_item { \
@@ -67,21 +69,21 @@
 		int size; \
 		int next; \
-		name##_item_t *items; \
+		name##_item_ref items; \
 		int magic; \
 	}; \
 	\
-	int name##_add(name##_t *, int, type *); \
-	void name##_clear(name##_t *); \
-	int name##_count(name##_t *); \
-	void name##_destroy(name##_t *); \
-	void name##_exclude(name##_t *, int); \
-	void name##_exclude_index(name##_t *, int); \
-	type *name##_find(name##_t *, int); \
-	int name##_update(name##_t *, int, int); \
-	type *name##_get_index(name##_t *, int); \
-	int name##_initialize(name##_t *); \
-	int name##_is_valid(name##_t *); \
-	void name##_item_destroy(name##_item_t *); \
-	int name##_item_is_valid(name##_item_t *);
+	int name##_add(name##_ref, int, type *); \
+	void name##_clear(name##_ref); \
+	int name##_count(name##_ref); \
+	void name##_destroy(name##_ref); \
+	void name##_exclude(name##_ref, int); \
+	void name##_exclude_index(name##_ref, int); \
+	type *name##_find(name##_ref, int); \
+	int name##_update(name##_ref, int, int); \
+	type *name##_get_index(name##_ref, int); \
+	int name##_initialize(name##_ref); \
+	int name##_is_valid(name##_ref); \
+	void name##_item_destroy(name##_item_ref); \
+	int name##_item_is_valid(name##_item_ref);
 
 /** Integer to generic type map implementation.
@@ -93,10 +95,10 @@
  */
 #define INT_MAP_IMPLEMENT(name, type) \
-	int name##_add(name##_t *map, int key, type *value) \
+	int name##_add(name##_ref map, int key, type *value) \
 	{ \
 		if (name##_is_valid(map)) { \
 			if (map->next == (map->size - 1)) { \
-				name##_item_t *tmp; \
-				tmp = (name##_item_t *) realloc(map->items, \
+				name##_item_ref tmp; \
+				tmp = (name##_item_ref) realloc(map->items, \
 				    sizeof(name##_item_t) * 2 * map->size); \
 				if (!tmp) \
@@ -115,5 +117,5 @@
 	} \
 	\
-	void name##_clear(name##_t *map) \
+	void name##_clear(name##_ref map) \
 	{ \
 		if (name##_is_valid(map)) { \
@@ -130,10 +132,10 @@
 	} \
 	\
-	int name##_count(name##_t *map) \
+	int name##_count(name##_ref map) \
 	{ \
 		return name##_is_valid(map) ? map->next : -1; \
 	} \
 	\
-	void name##_destroy(name##_t *map) \
+	void name##_destroy(name##_ref map) \
 	{ \
 		if (name##_is_valid(map)) { \
@@ -150,5 +152,5 @@
 	} \
 	\
-	void name##_exclude(name##_t *map, int key) \
+	void name##_exclude(name##_ref map, int key) \
 	{ \
 		if (name##_is_valid(map)) { \
@@ -164,5 +166,5 @@
 	} \
 	\
-	void name##_exclude_index(name##_t *map, int index) \
+	void name##_exclude_index(name##_ref map, int index) \
 	{ \
 		if (name##_is_valid(map) && (index >= 0) && \
@@ -173,5 +175,5 @@
 	} \
 	\
-	type *name##_find(name##_t *map, int key) \
+	type *name##_find(name##_ref map, int key) \
 	{ \
 		if (name##_is_valid(map)) { \
@@ -187,5 +189,5 @@
 	} \
 	\
-	int name##_update(name##_t *map, int key, int new_key) \
+	int name##_update(name##_ref map, int key, int new_key) \
 	{ \
 		if (name##_is_valid(map)) { \
@@ -206,5 +208,5 @@
 	} \
 	\
-	type *name##_get_index(name##_t *map, int index) \
+	type *name##_get_index(name##_ref map, int index) \
 	{ \
 		if (name##_is_valid(map) && (index >= 0) && \
@@ -216,5 +218,5 @@
 	} \
 	\
-	int name##_initialize(name##_t *map) \
+	int name##_initialize(name##_ref map) \
 	{ \
 		if (!map) \
@@ -222,5 +224,5 @@
 		map->size = 2; \
 		map->next = 0; \
-		map->items = (name##_item_t *) malloc(sizeof(name##_item_t) * \
+		map->items = (name##_item_ref) malloc(sizeof(name##_item_t) * \
 		    map->size); \
 		if (!map->items) \
@@ -231,10 +233,10 @@
 	} \
 	\
-	int name##_is_valid(name##_t *map) \
+	int name##_is_valid(name##_ref map) \
 	{ \
 		return map && (map->magic == INT_MAP_MAGIC_VALUE); \
 	} \
 	\
-	void name##_item_destroy(name##_item_t *item) \
+	void name##_item_destroy(name##_item_ref item) \
 	{ \
 		if (name##_item_is_valid(item)) { \
@@ -247,5 +249,5 @@
 	} \
 	\
-	int name##_item_is_valid(name##_item_t *item) \
+	int name##_item_is_valid(name##_item_ref item) \
 	{ \
 		return item && (item->magic == INT_MAP_ITEM_MAGIC_VALUE); \
Index: uspace/lib/c/include/adt/measured_strings.h
===================================================================
--- uspace/lib/c/include/adt/measured_strings.h	(revision 32eceb4ff0c0ddeba47997beaa5d0677aee84d3a)
+++ uspace/lib/c/include/adt/measured_strings.h	(revision 1b22bd45ebc7f42217757e90fa6e5b57f6ed5d1d)
@@ -47,4 +47,9 @@
 typedef struct measured_string measured_string_t;
 
+/** Type definition of the character string with measured length pointer.
+ * @see measured_string
+ */
+typedef measured_string_t *measured_string_ref;
+
 /** Character string with measured length.
  *
@@ -59,10 +64,10 @@
 };
 
-extern measured_string_t *measured_string_create_bulk(const char *, size_t);
-extern measured_string_t *measured_string_copy(measured_string_t *);
-extern int measured_strings_receive(measured_string_t **, char **, size_t);
-extern int measured_strings_reply(const measured_string_t *, size_t);
-extern int measured_strings_return(int, measured_string_t **, char **, size_t);
-extern int measured_strings_send(int, const measured_string_t *, size_t);
+extern measured_string_ref measured_string_create_bulk(const char *, size_t);
+extern measured_string_ref measured_string_copy(measured_string_ref);
+extern int measured_strings_receive(measured_string_ref *, char **, size_t);
+extern int measured_strings_reply(const measured_string_ref, size_t);
+extern int measured_strings_return(int, measured_string_ref *, char **, size_t);
+extern int measured_strings_send(int, const measured_string_ref, size_t);
 
 #endif
Index: uspace/lib/c/include/net/device.h
===================================================================
--- uspace/lib/c/include/net/device.h	(revision 32eceb4ff0c0ddeba47997beaa5d0677aee84d3a)
+++ uspace/lib/c/include/net/device.h	(revision 1b22bd45ebc7f42217757e90fa6e5b57f6ed5d1d)
@@ -59,4 +59,9 @@
  */
 typedef struct device_stats device_stats_t;
+
+/** Type definition of the device usage statistics pointer.
+ * @see device_stats
+ */
+typedef device_stats_t *device_stats_ref;
 
 /** Device state. */
Index: uspace/lib/c/include/net/modules.h
===================================================================
--- uspace/lib/c/include/net/modules.h	(revision 32eceb4ff0c0ddeba47997beaa5d0677aee84d3a)
+++ uspace/lib/c/include/net/modules.h	(revision 1b22bd45ebc7f42217757e90fa6e5b57f6ed5d1d)
@@ -69,5 +69,5 @@
  *
  * @param[in] need	The needed module service.
- * @return		The phone of the needed service.
+ * @returns		The phone of the needed service.
  */
 typedef int connect_module_t(services_t need);
Index: uspace/lib/c/include/net/packet.h
===================================================================
--- uspace/lib/c/include/net/packet.h	(revision 32eceb4ff0c0ddeba47997beaa5d0677aee84d3a)
+++ uspace/lib/c/include/net/packet.h	(revision 1b22bd45ebc7f42217757e90fa6e5b57f6ed5d1d)
@@ -46,5 +46,10 @@
  * @see packet
  */
-typedef struct packet packet_t;
+typedef struct packet * packet_t;
+
+/** Type definition of the packet pointer.
+ * @see packet
+ */
+typedef packet_t * packet_ref;
 
 /** Type definition of the packet dimension.
@@ -52,4 +57,9 @@
  */
 typedef struct packet_dimension	packet_dimension_t;
+
+/** Type definition of the packet dimension pointer.
+ * @see packet_dimension
+ */
+typedef packet_dimension_t * packet_dimension_ref;
 
 /** Packet dimension. */
@@ -69,18 +79,18 @@
 /*@{*/
 
-extern packet_t *pm_find(packet_id_t);
-extern int pm_add(packet_t *);
+extern packet_t pm_find(packet_id_t);
+extern int pm_add(packet_t);
 extern int pm_init(void);
 extern void pm_destroy(void);
 
-extern int pq_add(packet_t **, packet_t *, size_t, size_t);
-extern packet_t *pq_find(packet_t *, size_t);
-extern int pq_insert_after(packet_t *, packet_t *);
-extern packet_t *pq_detach(packet_t *);
-extern int pq_set_order(packet_t *, size_t, size_t);
-extern int pq_get_order(packet_t *, size_t *, size_t *);
-extern void pq_destroy(packet_t *, void (*)(packet_t *));
-extern packet_t *pq_next(packet_t *);
-extern packet_t *pq_previous(packet_t *);
+extern int pq_add(packet_t *, packet_t, size_t, size_t);
+extern packet_t pq_find(packet_t, size_t);
+extern int pq_insert_after(packet_t, packet_t);
+extern packet_t pq_detach(packet_t);
+extern int pq_set_order(packet_t, size_t, size_t);
+extern int pq_get_order(packet_t, size_t *, size_t *);
+extern void pq_destroy(packet_t, void (*)(packet_t));
+extern packet_t pq_next(packet_t);
+extern packet_t pq_previous(packet_t);
 
 /*@}*/
Index: uspace/lib/c/include/net/packet_header.h
===================================================================
--- uspace/lib/c/include/net/packet_header.h	(revision 32eceb4ff0c0ddeba47997beaa5d0677aee84d3a)
+++ uspace/lib/c/include/net/packet_header.h	(revision 1b22bd45ebc7f42217757e90fa6e5b57f6ed5d1d)
@@ -124,9 +124,9 @@
 /** Returns whether the packet is valid.
  * @param[in] packet	The packet to be checked.
- * @return		True if the packet is not NULL and the magic value is
+ * @returns		True if the packet is not NULL and the magic value is
  *			correct.
- * @return		False otherwise.
+ * @returns		False otherwise.
  */
-static inline int packet_is_valid(const packet_t *packet)
+static inline int packet_is_valid(const packet_t packet)
 {
 	return packet && (packet->magic_value == PACKET_MAGIC_VALUE);
Index: uspace/lib/c/include/unistd.h
===================================================================
--- uspace/lib/c/include/unistd.h	(revision 32eceb4ff0c0ddeba47997beaa5d0677aee84d3a)
+++ uspace/lib/c/include/unistd.h	(revision 1b22bd45ebc7f42217757e90fa6e5b57f6ed5d1d)
@@ -41,5 +41,5 @@
 
 #ifndef NULL
-	#define NULL	((void *) 0)
+	#define NULL  0UL
 #endif
 
Index: uspace/lib/net/adt/module_map.c
===================================================================
--- uspace/lib/net/adt/module_map.c	(revision 32eceb4ff0c0ddeba47997beaa5d0677aee84d3a)
+++ uspace/lib/net/adt/module_map.c	(revision 1b22bd45ebc7f42217757e90fa6e5b57f6ed5d1d)
@@ -59,16 +59,16 @@
  *			running.
  * @param[in] connect_module The module connecting function.
- * @return		EOK on success.
- * @return		ENOMEM if there is not enough memory left.
+ * @returns		EOK on success.
+ * @returns		ENOMEM if there is not enough memory left.
  */
 int
-add_module(module_t **module, modules_t *modules, const char *name,
+add_module(module_ref *module, modules_ref modules, const char *name,
     const char *filename, services_t service, task_id_t task_id,
     connect_module_t connect_module)
 {
-	module_t *tmp_module;
+	module_ref tmp_module;
 	int rc;
 
-	tmp_module = (module_t *) malloc(sizeof(module_t));
+	tmp_module = (module_ref) malloc(sizeof(module_t));
 	if (!tmp_module)
 		return ENOMEM;
@@ -100,11 +100,11 @@
  * @param[in] modules	The module map.
  * @param[in] name	The module name.
- * @return		The running module found. It does not have to be
+ * @returns		The running module found. It does not have to be
  *			connected.
- * @return		NULL if there is no such module.
+ * @returns		NULL if there is no such module.
  */
-module_t *get_running_module(modules_t *modules, char *name)
+module_ref get_running_module(modules_ref modules, char *name)
 {
-	module_t *module;
+	module_ref module;
 
 	module = modules_find(modules, name, 0);
@@ -126,6 +126,6 @@
  *
  * @param[in] fname	The module full or relative path filename.
- * @return		The new module task identifier on success.
- * @return		Zero if there is no such module.
+ * @returns		The new module task identifier on success.
+ * @returns		Zero if there is no such module.
  */
 task_id_t spawn(const char *fname)
Index: uspace/lib/net/generic/generic.c
===================================================================
--- uspace/lib/net/generic/generic.c	(revision 32eceb4ff0c0ddeba47997beaa5d0677aee84d3a)
+++ uspace/lib/net/generic/generic.c	(revision 1b22bd45ebc7f42217757e90fa6e5b57f6ed5d1d)
@@ -92,13 +92,13 @@
  * @param[out] address	The desired address.
  * @param[out] data	The address data container.
- * @return		EOK on success.
- * @return		EBADMEM if the address parameter and/or the data
+ * @returns		EOK on success.
+ * @returns		EBADMEM if the address parameter and/or the data
  *			parameter is NULL.
- * @return		Other error codes as defined for the specific service
+ * @returns		Other error codes as defined for the specific service
  *			message.
  */
 int
 generic_get_addr_req(int phone, int message, device_id_t device_id,
-    measured_string_t **address, char ** data)
+    measured_string_ref *address, char ** data)
 {
 	aid_t message_id;
@@ -138,5 +138,5 @@
 int
 generic_packet_size_req_remote(int phone, int message, device_id_t device_id,
-    packet_dimension_t *packet_dimension)
+    packet_dimension_ref packet_dimension)
 {
 	if (!packet_dimension)
@@ -223,16 +223,16 @@
  * @param[out] translation The translated values.
  * @param[out] data	The translation data container.
- * @return		EOK on success.
- * @return		EINVAL if the configuration parameter is NULL.
- * @return		EINVAL if the count parameter is zero.
- * @return		EBADMEM if the translation or the data parameters are
+ * @returns		EOK on success.
+ * @returns		EINVAL if the configuration parameter is NULL.
+ * @returns		EINVAL if the count parameter is zero.
+ * @returns		EBADMEM if the translation or the data parameters are
  *			NULL.
- * @return		Other error codes as defined for the specific service
+ * @returns		Other error codes as defined for the specific service
  *			message.
  */
 int
 generic_translate_req(int phone, int message, device_id_t device_id,
-    services_t service, measured_string_t *configuration, size_t count,
-    measured_string_t **translation, char **data)
+    services_t service, measured_string_ref configuration, size_t count,
+    measured_string_ref *translation, char **data)
 {
 	aid_t message_id;
Index: uspace/lib/net/generic/net_checksum.c
===================================================================
--- uspace/lib/net/generic/net_checksum.c	(revision 32eceb4ff0c0ddeba47997beaa5d0677aee84d3a)
+++ uspace/lib/net/generic/net_checksum.c	(revision 1b22bd45ebc7f42217757e90fa6e5b57f6ed5d1d)
@@ -48,5 +48,5 @@
  *
  * @param[in] sum	Computed checksum.
- * @return		Compacted computed checksum to the 16 bits.
+ * @returns		Compacted computed checksum to the 16 bits.
  */
 uint16_t compact_checksum(uint32_t sum)
@@ -66,5 +66,5 @@
  * @param[in] data	Pointer to the beginning of data to process.
  * @param[in] length	Length of the data in bytes.
- * @return		The computed checksum of the length bytes of the data.
+ * @returns		The computed checksum of the length bytes of the data.
  */
 uint32_t compute_checksum(uint32_t seed, uint8_t *data, size_t length)
@@ -88,5 +88,5 @@
  * @param[in] data	Pointer to the beginning of data to process.
  * @param[in] length	Length of the data in bits.
- * @return		The computed CRC32 of the length bits of the data.
+ * @returns		The computed CRC32 of the length bits of the data.
  */
 uint32_t compute_crc32_be(uint32_t seed, uint8_t * data, size_t length)
@@ -142,5 +142,5 @@
  * @param[in] data	Pointer to the beginning of data to process.
  * @param[in] length	Length of the data in bits.
- * @return		The computed CRC32 of the length bits of the data.
+ * @returns		The computed CRC32 of the length bits of the data.
  */
 uint32_t compute_crc32_le(uint32_t seed, uint8_t * data, size_t length)
@@ -193,6 +193,6 @@
  *
  * @param[in] checksum	The computed checksum.
- * @return		The internet protocol header checksum.
- * @return		0xFFFF if the computed checksum is zero.
+ * @returns		The internet protocol header checksum.
+ * @returns		0xFFFF if the computed checksum is zero.
  */
 uint16_t flip_checksum(uint16_t checksum)
@@ -211,6 +211,6 @@
  * @param[in] data	The header data.
  * @param[in] length	The header length in bytes.
- * @return		The internet protocol header checksum.
- * @return		0xFFFF if the computed checksum is zero.
+ * @returns		The internet protocol header checksum.
+ * @returns		0xFFFF if the computed checksum is zero.
  */
 uint16_t ip_checksum(uint8_t *data, size_t length)
Index: uspace/lib/net/generic/net_remote.c
===================================================================
--- uspace/lib/net/generic/net_remote.c	(revision 32eceb4ff0c0ddeba47997beaa5d0677aee84d3a)
+++ uspace/lib/net/generic/net_remote.c	(revision 1b22bd45ebc7f42217757e90fa6e5b57f6ed5d1d)
@@ -49,5 +49,5 @@
 /** Connects to the networking module.
  *
- * @return		The networking module phone on success.
+ * @returns		The networking module phone on success.
  */
 int net_connect_module(void)
@@ -63,5 +63,5 @@
  * @see net_get_conf_req()
  */
-void net_free_settings(measured_string_t *settings, char *data)
+void net_free_settings(measured_string_ref settings, char *data)
 {
 	if (settings)
@@ -83,12 +83,12 @@
  * @param[in] count	The configuration entries count.
  * @param[in,out] data	The configuration and settings data.
- * @return		EOK on success.
- * @return		EINVAL if the configuration is NULL.
- * @return		EINVAL if the count is zero.
- * @return		Other error codes as defined for the
+ * @returns		EOK on success.
+ * @returns		EINVAL if the configuration is NULL.
+ * @returns		EINVAL if the count is zero.
+ * @returns		Other error codes as defined for the
  *			generic_translate_req() function.
  */
 int
-net_get_conf_req(int net_phone, measured_string_t **configuration,
+net_get_conf_req(int net_phone, measured_string_ref *configuration,
     size_t count, char **data)
 {
@@ -110,13 +110,13 @@
  * @param[in] count	The configuration entries count.
  * @param[in,out] data	The configuration and settings data.
- * @return		EOK on success.
- * @return		EINVAL if the configuration is NULL.
- * @return		EINVAL if the count is zero.
- * @return		Other error codes as defined for the
+ * @returns		EOK on success.
+ * @returns		EINVAL if the configuration is NULL.
+ * @returns		EINVAL if the count is zero.
+ * @returns		Other error codes as defined for the
  *			generic_translate_req() function.
  */
 int
 net_get_device_conf_req(int net_phone, device_id_t device_id,
-    measured_string_t **configuration, size_t count, char **data)
+    measured_string_ref *configuration, size_t count, char **data)
 {
 	return generic_translate_req(net_phone, NET_NET_GET_DEVICE_CONF,
Index: uspace/lib/net/generic/packet_client.c
===================================================================
--- uspace/lib/net/generic/packet_client.c	(revision 32eceb4ff0c0ddeba47997beaa5d0677aee84d3a)
+++ uspace/lib/net/generic/packet_client.c	(revision 1b22bd45ebc7f42217757e90fa6e5b57f6ed5d1d)
@@ -53,9 +53,9 @@
  * @param[in] data	The data to be copied.
  * @param[in] length	The length of the copied data.
- * @return		EOK on success.
- * @return		EINVAL if the packet is not valid.
- * @return		ENOMEM if there is not enough memory left.
- */
-int packet_copy_data(packet_t *packet, const void *data, size_t length)
+ * @returns		EOK on success.
+ * @returns		EINVAL if the packet is not valid.
+ * @returns		ENOMEM if there is not enough memory left.
+ */
+int packet_copy_data(packet_t packet, const void *data, size_t length)
 {
 	if (!packet_is_valid(packet))
@@ -78,11 +78,11 @@
  * @param[in] length	The space length to be allocated at the beginning of the
  *			packet content.
- * @return		The pointer to the allocated memory.
- * @return		NULL if there is not enough memory left.
- */
-void *packet_prefix(packet_t *packet, size_t length)
+ * @returns		The pointer to the allocated memory.
+ * @returns		NULL if there is not enough memory left.
+ */
+void *packet_prefix(packet_t packet, size_t length)
 {
 	if ((!packet_is_valid(packet)) ||
-	    (packet->data_start - sizeof(packet_t) -
+	    (packet->data_start - sizeof(struct packet) -
 	    2 * (packet->dest_addr - packet->src_addr) < length)) {
 		return NULL;
@@ -99,8 +99,8 @@
  * @param[in] length	The space length to be allocated at the end of the
  *			 packet content.
- * @return		The pointer to the allocated memory.
- * @return		NULL if there is not enough memory left.
- */
-void *packet_suffix(packet_t *packet, size_t length)
+ * @returns		The pointer to the allocated memory.
+ * @returns		NULL if there is not enough memory left.
+ */
+void *packet_suffix(packet_t packet, size_t length)
 {
 	if ((!packet_is_valid(packet)) ||
@@ -120,9 +120,9 @@
  * @param[in] suffix	The suffix length to be removed from the end of the
  *			packet content.
- * @return		EOK on success.
- * @return		EINVAL if the packet is not valid.
- * @return		ENOMEM if there is not enough memory left.
- */
-int packet_trim(packet_t *packet, size_t prefix, size_t suffix)
+ * @returns		EOK on success.
+ * @returns		EINVAL if the packet is not valid.
+ * @returns		ENOMEM if there is not enough memory left.
+ */
+int packet_trim(packet_t packet, size_t prefix, size_t suffix)
 {
 	if (!packet_is_valid(packet))
@@ -140,8 +140,8 @@
  *
  * @param[in] packet	The packet.
- * @return		The packet identifier.
- * @return		Zero if the packet is not valid.
- */
-packet_id_t packet_get_id(const packet_t *packet)
+ * @returns		The packet identifier.
+ * @returns		Zero if the packet is not valid.
+ */
+packet_id_t packet_get_id(const packet_t packet)
 {
 	return packet_is_valid(packet) ? packet->packet_id : 0;
@@ -153,9 +153,9 @@
  * @param[out] src	The source address. May be NULL if not desired.
  * @param[out] dest	The destination address. May be NULL if not desired.
- * @return		The stored addresses length.
- * @return		Zero if the addresses are not present.
- * @return		EINVAL if the packet is not valid.
- */
-int packet_get_addr(const packet_t *packet, uint8_t **src, uint8_t **dest)
+ * @returns		The stored addresses length.
+ * @returns		Zero if the addresses are not present.
+ * @returns		EINVAL if the packet is not valid.
+ */
+int packet_get_addr(const packet_t packet, uint8_t **src, uint8_t **dest)
 {
 	if (!packet_is_valid(packet))
@@ -174,8 +174,8 @@
  *
  * @param[in] packet	The packet.
- * @return		The packet content length in bytes.
- * @return		Zero if the packet is not valid.
- */
-size_t packet_get_data_length(const packet_t *packet)
+ * @returns		The packet content length in bytes.
+ * @returns		Zero if the packet is not valid.
+ */
+size_t packet_get_data_length(const packet_t packet)
 {
 	if (!packet_is_valid(packet))
@@ -188,8 +188,8 @@
  *
  * @param[in] packet	The packet.
- * @return		The pointer to the beginning of the packet content.
- * @return		NULL if the packet is not valid.
- */
-void *packet_get_data(const packet_t *packet)
+ * @returns		The pointer to the beginning of the packet content.
+ * @returns		NULL if the packet is not valid.
+ */
+void *packet_get_data(const packet_t packet)
 {
 	if (!packet_is_valid(packet))
@@ -205,10 +205,10 @@
  * @param[in] dest	The new destination address. May be NULL.
  * @param[in] addr_len	The addresses length.
- * @return		EOK on success.
- * @return		EINVAL if the packet is not valid.
- * @return		ENOMEM if there is not enough memory left.
+ * @returns		EOK on success.
+ * @returns		EINVAL if the packet is not valid.
+ * @returns		ENOMEM if there is not enough memory left.
  */
 int
-packet_set_addr(packet_t *packet, const uint8_t *src, const uint8_t *dest,
+packet_set_addr(packet_t packet, const uint8_t *src, const uint8_t *dest,
     size_t addr_len)
 {
@@ -254,10 +254,10 @@
  * @param[in] phone	The packet server module phone.
  * @param[in] packet	The original packet.
- * @return		The packet copy.
- * @return		NULL on error.
- */
-packet_t *packet_get_copy(int phone, packet_t *packet)
-{
-	packet_t *copy;
+ * @returns		The packet copy.
+ * @returns		NULL on error.
+ */
+packet_t packet_get_copy(int phone, packet_t packet)
+{
+	packet_t copy;
 	uint8_t * src = NULL;
 	uint8_t * dest = NULL;
Index: uspace/lib/net/generic/packet_remote.c
===================================================================
--- uspace/lib/net/generic/packet_remote.c	(revision 32eceb4ff0c0ddeba47997beaa5d0677aee84d3a)
+++ uspace/lib/net/generic/packet_remote.c	(revision 1b22bd45ebc7f42217757e90fa6e5b57f6ed5d1d)
@@ -64,5 +64,5 @@
  */
 static int
-packet_return(int phone, packet_t **packet, packet_id_t packet_id, size_t size)
+packet_return(int phone, packet_ref packet, packet_id_t packet_id, size_t size)
 {
 	ipc_call_t answer;
@@ -72,5 +72,5 @@
 	message = async_send_1(phone, NET_PACKET_GET, packet_id, &answer);
 
-	*packet = (packet_t *) as_get_mappable_page(size);
+	*packet = (packet_t) as_get_mappable_page(size);
 	rc = async_share_in_start_0_0(phone, *packet, size);
 	if (rc != EOK) {
@@ -100,12 +100,12 @@
  * @param[out] packet	The packet reference.
  * @param[in] packet_id	The packet identifier.
- * @return		EOK on success.
- * @return		EINVAL if the packet parameter is NULL.
- * @return		Other error codes as defined for the NET_PACKET_GET_SIZE
+ * @returns		EOK on success.
+ * @returns		EINVAL if the packet parameter is NULL.
+ * @returns		Other error codes as defined for the NET_PACKET_GET_SIZE
  *			message.
- * @return		Other error codes as defined for the packet_return()
+ * @returns		Other error codes as defined for the packet_return()
  *			function.
  */
-int packet_translate_remote(int phone, packet_t **packet, packet_id_t packet_id)
+int packet_translate_remote(int phone, packet_ref packet, packet_id_t packet_id)
 {
 	int rc;
@@ -127,5 +127,5 @@
 	}
 	if ((*packet)->next) {
-		packet_t *next;
+		packet_t next;
 		
 		return packet_translate_remote(phone, &next, (*packet)->next);
@@ -145,8 +145,8 @@
  * @param[in] max_content The maximal content length in bytes.
  * @param[in] max_suffix The maximal suffix length in bytes.
- * @return		The packet reference.
- * @return		NULL on error.
- */
-packet_t *packet_get_4_remote(int phone, size_t max_content, size_t addr_len,
+ * @returns		The packet reference.
+ * @returns		NULL on error.
+ */
+packet_t packet_get_4_remote(int phone, size_t max_content, size_t addr_len,
     size_t max_prefix, size_t max_suffix)
 {
@@ -161,5 +161,5 @@
 	
 	
-	packet_t *packet = pm_find(packet_id);
+	packet_t packet = pm_find(packet_id);
 	if (!packet) {
 		rc = packet_return(phone, &packet, packet_id, size);
@@ -177,8 +177,8 @@
  * @param[in] phone	The packet server module phone.
  * @param[in] content	The maximal content length in bytes.
- * @return		The packet reference.
- * @return		NULL on error.
- */
-packet_t *packet_get_1_remote(int phone, size_t content)
+ * @returns		The packet reference.
+ * @returns		NULL on error.
+ */
+packet_t packet_get_1_remote(int phone, size_t content)
 {
 	ipcarg_t packet_id;
@@ -191,5 +191,5 @@
 		return NULL;
 	
-	packet_t *packet = pm_find(packet_id);
+	packet_t packet = pm_find(packet_id);
 	if (!packet) {
 		rc = packet_return(phone, &packet, packet_id, size);
Index: uspace/lib/net/generic/protocol_map.c
===================================================================
--- uspace/lib/net/generic/protocol_map.c	(revision 32eceb4ff0c0ddeba47997beaa5d0677aee84d3a)
+++ uspace/lib/net/generic/protocol_map.c	(revision 1b22bd45ebc7f42217757e90fa6e5b57f6ed5d1d)
@@ -42,7 +42,7 @@
  * @param[in] nil	Network interface layer service.
  * @param[in] il	Internetwork layer service.
- * @return		Network interface layer type of the internetworking
+ * @returns		Network interface layer type of the internetworking
  *			layer service.
- * @return		Zero if mapping is not found.
+ * @returns		Zero if mapping is not found.
  */
 eth_type_t protocol_map(services_t nil, services_t il)
@@ -68,7 +68,7 @@
  * @param[in] nil	Network interface layer service.
  * @param[in] protocol	Network interface layer type.
- * @return		Internetwork layer service of the network interface
+ * @returns		Internetwork layer service of the network interface
  *			layer type.
- * @return		Zero if mapping is not found.
+ * @returns		Zero if mapping is not found.
  */
 services_t protocol_unmap(services_t nil, int protocol)
@@ -94,7 +94,7 @@
  *
  * @param[in] lsap	Link service access point identifier.
- * @return		Ethernet protocol identifier of the link service access
+ * @returns		Ethernet protocol identifier of the link service access
  *			point identifier.
- * @return		ETH_LSAP_NULL if mapping is not found.
+ * @returns		ETH_LSAP_NULL if mapping is not found.
  */
 eth_type_t lsap_map(eth_lsap_t lsap)
@@ -114,6 +114,6 @@
  *
  * @param[in] ethertype	Ethernet protocol identifier.
- * @return		Link service access point identifier.
- * @return		Zero if mapping is not found.
+ * @returns		Link service access point identifier.
+ * @returns		Zero if mapping is not found.
  */
 eth_lsap_t lsap_unmap(eth_type_t ethertype)
@@ -132,6 +132,6 @@
  *
  * @param[in] nil	The network interface service.
- * @return		The hardware type of the network interface service.
- * @return		Zero if mapping is not found.
+ * @returns		The hardware type of the network interface service.
+ * @returns		Zero if mapping is not found.
  */
 hw_type_t hardware_map(services_t nil)
Index: uspace/lib/net/il/arp_remote.c
===================================================================
--- uspace/lib/net/il/arp_remote.c	(revision 32eceb4ff0c0ddeba47997beaa5d0677aee84d3a)
+++ uspace/lib/net/il/arp_remote.c	(revision 1b22bd45ebc7f42217757e90fa6e5b57f6ed5d1d)
@@ -52,5 +52,5 @@
  *
  * @param service	The ARP module service. Ignored parameter.
- * @return		The ARP module phone on success.
+ * @returns		The ARP module phone on success.
  */
 int arp_connect_module(services_t service)
@@ -65,5 +65,5 @@
  *
  * @param[in] arp_phone	The ARP module phone used for (semi)remote calls.
- * @return		EOK on success.
+ * @returns		EOK on success.
  */
 int arp_clean_cache_req(int arp_phone)
@@ -78,10 +78,10 @@
  * @param[in] protocol	The requesting protocol service.
  * @param[in] address	The protocol address to be cleared.
- * @return		EOK on success.
- * @return		ENOENT if the mapping is not found.
+ * @returns		EOK on success.
+ * @returns		ENOENT if the mapping is not found.
  */
 int
 arp_clear_address_req(int arp_phone, device_id_t device_id, services_t protocol,
-    measured_string_t *address)
+    measured_string_ref address)
 {
 	aid_t message_id;
@@ -100,6 +100,6 @@
  * @param[in] arp_phone	The ARP module phone used for (semi)remote calls.
  * @param[in] device_id	The device identifier.
- * @return		EOK on success.
- * @return		ENOENT if the device is not found.
+ * @returns		EOK on success.
+ * @returns		ENOENT if the device is not found.
  */
 int arp_clear_device_req(int arp_phone, device_id_t device_id)
@@ -119,19 +119,19 @@
  * @param[in] netif	The underlying device network interface layer service.
  * @param[in] address	The local requesting protocol address of the device.
- * @return		EOK on success.
- * @return		EEXIST if the device is already used.
- * @return		ENOMEM if there is not enough memory left.
- * @return		ENOENT if the network interface service is not known.
- * @return		EREFUSED if the network interface service is not
+ * @returns		EOK on success.
+ * @returns		EEXIST if the device is already used.
+ * @returns		ENOMEM if there is not enough memory left.
+ * @returns		ENOENT if the network interface service is not known.
+ * @returns		EREFUSED if the network interface service is not
  *			responding.
- * @return		Other error codes as defined for the
+ * @returns		Other error codes as defined for the
  *			nil_packet_get_size() function.
- * @return		Other error codes as defined for the nil_get_addr()
+ * @returns		Other error codes as defined for the nil_get_addr()
  *			function.
- * @return		Other error codes as defined for the
+ * @returns		Other error codes as defined for the
  *			nil_get_broadcast_addr() function.
  */
 int arp_device_req(int arp_phone, device_id_t device_id, services_t protocol,
-    services_t netif, measured_string_t *address)
+    services_t netif, measured_string_ref address)
 {
 	aid_t message_id;
@@ -157,13 +157,13 @@
  * @param[out] translation The translation of the local protocol address.
  * @param[out] data	The allocated raw translation data container.
- * @return		EOK on success.
- * @return		EINVAL if the address parameter is NULL.
- * @return		EBADMEM if the translation or the data parameters are
+ * @returns		EOK on success.
+ * @returns		EINVAL if the address parameter is NULL.
+ * @returns		EBADMEM if the translation or the data parameters are
  *			NULL.
- * @return		ENOENT if the mapping is not found.
+ * @returns		ENOENT if the mapping is not found.
  */
 int
 arp_translate_req(int arp_phone, device_id_t device_id, services_t protocol,
-    measured_string_t *address, measured_string_t **translation, char **data)
+    measured_string_ref address, measured_string_ref *translation, char **data)
 {
 	return generic_translate_req(arp_phone, NET_ARP_TRANSLATE, device_id,
Index: uspace/lib/net/il/il_interface.c
===================================================================
--- uspace/lib/net/il/il_interface.c	(revision 32eceb4ff0c0ddeba47997beaa5d0677aee84d3a)
+++ uspace/lib/net/il/il_interface.c	(revision 1b22bd45ebc7f42217757e90fa6e5b57f6ed5d1d)
@@ -77,5 +77,5 @@
  *
  */
-int il_received_msg(int il_phone, device_id_t device_id, packet_t *packet,
+int il_received_msg(int il_phone, device_id_t device_id, packet_t packet,
     services_t target)
 {
Index: uspace/lib/net/il/ip_client.c
===================================================================
--- uspace/lib/net/il/ip_client.c	(revision 32eceb4ff0c0ddeba47997beaa5d0677aee84d3a)
+++ uspace/lib/net/il/ip_client.c	(revision 1b22bd45ebc7f42217757e90fa6e5b57f6ed5d1d)
@@ -48,12 +48,12 @@
  *
  * @param[in] packet	The packet.
- * @return		The IP header length in bytes.
- * @return		Zero if there is no IP header.
- */
-size_t ip_client_header_length(packet_t *packet)
-{
-	ip_header_t *header;
-
-	header = (ip_header_t *) packet_get_data(packet);
+ * @returns		The IP header length in bytes.
+ * @returns		Zero if there is no IP header.
+ */
+size_t ip_client_header_length(packet_t packet)
+{
+	ip_header_ref header;
+
+	header = (ip_header_ref) packet_get_data(packet);
 	if (!header || (packet_get_data_length(packet) < sizeof(ip_header_t)))
 		return 0;
@@ -72,17 +72,17 @@
  * @param[out] header	The constructed IPv4 pseudo header.
  * @param[out] headerlen The length of the IP pseudo header in bytes.
- * @return		EOK on success.
- * @return		EBADMEM if the header and/or the headerlen parameter is
+ * @returns		EOK on success.
+ * @returns		EBADMEM if the header and/or the headerlen parameter is
  *			NULL.
- * @return		EINVAL if the source address and/or the destination
+ * @returns		EINVAL if the source address and/or the destination
  *			address parameter is NULL.
- * @return		EINVAL if the source address length is less than struct
+ * @returns		EINVAL if the source address length is less than struct
  *			sockaddr length.
- * @return		EINVAL if the source address length differs from the
+ * @returns		EINVAL if the source address length differs from the
  *			destination address length.
- * @return		EINVAL if the source address family differs from the
+ * @returns		EINVAL if the source address family differs from the
  *			destination family.
- * @return		EAFNOSUPPORT if the address family is not supported.
- * @return		ENOMEM if there is not enough memory left.
+ * @returns		EAFNOSUPPORT if the address family is not supported.
+ * @returns		ENOMEM if there is not enough memory left.
  */
 int
@@ -91,5 +91,5 @@
     size_t data_length, void **header, size_t *headerlen)
 {
-	ipv4_pseudo_header_t *header_in;
+	ipv4_pseudo_header_ref header_in;
 	struct sockaddr_in *address_in;
 
@@ -109,5 +109,5 @@
 		
 		*headerlen = sizeof(*header_in);
-		header_in = (ipv4_pseudo_header_t *) malloc(*headerlen);
+		header_in = (ipv4_pseudo_header_ref) malloc(*headerlen);
 		if (!header_in)
 			return ENOMEM;
@@ -148,12 +148,12 @@
  *			disabled.
  * @param[in] ipopt_length The prefixed IP options length in bytes.
- * @return		EOK on success.
- * @return		ENOMEM if there is not enough memory left in the packet.
- */
-int
-ip_client_prepare_packet(packet_t *packet, ip_protocol_t protocol, ip_ttl_t ttl,
+ * @returns		EOK on success.
+ * @returns		ENOMEM if there is not enough memory left in the packet.
+ */
+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_t *header;
+	ip_header_ref header;
 	uint8_t *data;
 	size_t padding;
@@ -177,5 +177,5 @@
 
 	// set the header
-	header = (ip_header_t *) data;
+	header = (ip_header_ref) data;
 	header->header_length = IP_COMPUTE_HEADER_LENGTH(sizeof(ip_header_t) +
 	    ipopt_length);
@@ -203,15 +203,15 @@
  * @param[out] ipopt_length The IP options length in bytes. May be NULL if not
  *			desired.
- * @return		The prefixed IP header length in bytes on success.
- * @return		ENOMEM if the packet is too short to contain the IP
+ * @returns		The prefixed IP header length in bytes on success.
+ * @returns		ENOMEM if the packet is too short to contain the IP
  *			header.
  */
 int
-ip_client_process_packet(packet_t *packet, ip_protocol_t *protocol,
+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_t *header;
-
-	header = (ip_header_t *) packet_get_data(packet);
+	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;
@@ -238,7 +238,7 @@
  * @param[in] headerlen	The length of the IP pseudo header in bytes.
  * @param[in] data_length The data length to be set.
- * @return		EOK on success.
- * @return		EBADMEM if the header parameter is NULL.
- * @return		EINVAL if the headerlen parameter is not IPv4 pseudo
+ * @returns		EOK on success.
+ * @returns		EBADMEM if the header parameter is NULL.
+ * @returns		EINVAL if the headerlen parameter is not IPv4 pseudo
  *			header length.
  */
@@ -247,5 +247,5 @@
     size_t data_length)
 {
-	ipv4_pseudo_header_t *header_in;
+	ipv4_pseudo_header_ref header_in;
 
 	if (!header)
@@ -253,5 +253,5 @@
 
 	if (headerlen == sizeof(ipv4_pseudo_header_t)) {
-		header_in = (ipv4_pseudo_header_t *) header;
+		header_in = (ipv4_pseudo_header_ref) header;
 		header_in->data_length = htons(data_length);
 		return EOK;
Index: uspace/lib/net/il/ip_remote.c
===================================================================
--- uspace/lib/net/il/ip_remote.c	(revision 32eceb4ff0c0ddeba47997beaa5d0677aee84d3a)
+++ uspace/lib/net/il/ip_remote.c	(revision 1b22bd45ebc7f42217757e90fa6e5b57f6ed5d1d)
@@ -78,7 +78,7 @@
  * @param[in] me	The requesting module service.
  * @param[in] receiver	The message receiver. Used for remote connection.
- * @return		The phone of the needed service.
- * @return		EOK on success.
- * @return		Other error codes as defined for the bind_service()
+ * @returns		The phone of the needed service.
+ * @returns		EOK on success.
+ * @returns		Other error codes as defined for the bind_service()
  *			function.
  */
@@ -93,5 +93,5 @@
  *
  * @param service	The IP module service. Ignored parameter.
- * @return		The IP module phone on success.
+ * @returns		The IP module phone on success.
  */
 int ip_connect_module(services_t service)
@@ -186,5 +186,5 @@
  */
 int ip_packet_size_req_remote(int ip_phone, device_id_t device_id,
-    packet_dimension_t *packet_dimension)
+    packet_dimension_ref packet_dimension)
 {
 	return generic_packet_size_req_remote(ip_phone, NET_IL_PACKET_SPACE,
@@ -204,5 +204,5 @@
  */
 int ip_received_error_msg_remote(int ip_phone, device_id_t device_id,
-    packet_t *packet, services_t target, services_t error)
+    packet_t packet, services_t target, services_t error)
 {
 	return generic_received_msg_remote(ip_phone, NET_IP_RECEIVED_ERROR,
@@ -225,5 +225,5 @@
  *			function.
  */
-int ip_send_msg_remote(int ip_phone, device_id_t device_id, packet_t *packet,
+int ip_send_msg_remote(int ip_phone, device_id_t device_id, packet_t packet,
     services_t sender, services_t error)
 {
Index: uspace/lib/net/include/adt/module_map.h
===================================================================
--- uspace/lib/net/include/adt/module_map.h	(revision 32eceb4ff0c0ddeba47997beaa5d0677aee84d3a)
+++ uspace/lib/net/include/adt/module_map.h	(revision 1b22bd45ebc7f42217757e90fa6e5b57f6ed5d1d)
@@ -48,4 +48,9 @@
 typedef struct module_struct module_t;
 
+/** Type definition of the module structure pointer.
+ * @see module_struct
+ */
+typedef module_t *module_ref;
+
 /** Module map.
  * Sorted by module names.
@@ -72,7 +77,7 @@
 };
 
-extern int add_module(module_t **, modules_t *, const char *, const char *,
+extern int add_module(module_ref *, modules_ref, const char *, const char *,
     services_t, task_id_t, connect_module_t *);
-extern module_t *get_running_module(modules_t *, char *);
+extern module_ref get_running_module(modules_ref, char *);
 extern task_id_t spawn(const char *);
 
Index: uspace/lib/net/include/arp_interface.h
===================================================================
--- uspace/lib/net/include/arp_interface.h	(revision 32eceb4ff0c0ddeba47997beaa5d0677aee84d3a)
+++ uspace/lib/net/include/arp_interface.h	(revision 1b22bd45ebc7f42217757e90fa6e5b57f6ed5d1d)
@@ -48,10 +48,10 @@
 
 extern int arp_device_req(int, device_id_t, services_t, services_t,
-    measured_string_t *);
-extern int arp_translate_req(int, device_id_t, services_t, measured_string_t *,
-    measured_string_t **, char **);
+    measured_string_ref);
+extern int arp_translate_req(int, device_id_t, services_t, measured_string_ref,
+    measured_string_ref *, char **);
 extern int arp_clear_device_req(int, device_id_t);
 extern int arp_clear_address_req(int, device_id_t, services_t,
-    measured_string_t *);
+    measured_string_ref);
 extern int arp_clean_cache_req(int);
 extern int arp_connect_module(services_t);
Index: uspace/lib/net/include/generic.h
===================================================================
--- uspace/lib/net/include/generic.h	(revision 32eceb4ff0c0ddeba47997beaa5d0677aee84d3a)
+++ uspace/lib/net/include/generic.h	(revision 1b22bd45ebc7f42217757e90fa6e5b57f6ed5d1d)
@@ -49,8 +49,8 @@
     services_t);
 extern int generic_device_req_remote(int, int, device_id_t, int, services_t);
-extern int generic_get_addr_req(int, int, device_id_t, measured_string_t **,
+extern int generic_get_addr_req(int, int, device_id_t, measured_string_ref *,
     char **);
 extern int generic_packet_size_req_remote(int, int, device_id_t,
-    packet_dimension_t *);
+    packet_dimension_ref);
 extern int generic_received_msg_remote(int, int, device_id_t, packet_id_t,
     services_t, services_t);
@@ -58,5 +58,5 @@
     services_t, services_t);
 extern int generic_translate_req(int, int, device_id_t, services_t,
-    measured_string_t *, size_t, measured_string_t **, char **);
+    measured_string_ref, size_t, measured_string_ref *, char **);
 
 #endif
Index: uspace/lib/net/include/icmp_client.h
===================================================================
--- uspace/lib/net/include/icmp_client.h	(revision 32eceb4ff0c0ddeba47997beaa5d0677aee84d3a)
+++ uspace/lib/net/include/icmp_client.h	(revision 1b22bd45ebc7f42217757e90fa6e5b57f6ed5d1d)
@@ -41,7 +41,7 @@
 #include <net/packet.h>
 
-extern int icmp_client_process_packet(packet_t *, icmp_type_t *, icmp_code_t *,
+extern int icmp_client_process_packet(packet_t, icmp_type_t *, icmp_code_t *,
     icmp_param_t *, icmp_param_t *);
-extern size_t icmp_client_header_length(packet_t *);
+extern size_t icmp_client_header_length(packet_t);
 
 #endif
Index: uspace/lib/net/include/icmp_header.h
===================================================================
--- uspace/lib/net/include/icmp_header.h	(revision 32eceb4ff0c0ddeba47997beaa5d0677aee84d3a)
+++ uspace/lib/net/include/icmp_header.h	(revision 1b22bd45ebc7f42217757e90fa6e5b57f6ed5d1d)
@@ -52,4 +52,9 @@
 typedef struct icmp_echo icmp_echo_t;
 
+/** Type definition of the echo specific data pointer.
+ * @see icmp_echo
+ */
+typedef icmp_echo_t *icmp_echo_ref;
+
 /** Echo specific data. */
 struct icmp_echo {
@@ -64,4 +69,9 @@
  */
 typedef struct icmp_header icmp_header_t;
+
+/** Type definition of the internet control message header pointer.
+ * @see icmp_header
+ */
+typedef icmp_header_t *icmp_header_ref;
 
 /** Internet control message header. */
Index: uspace/lib/net/include/icmp_interface.h
===================================================================
--- uspace/lib/net/include/icmp_interface.h	(revision 32eceb4ff0c0ddeba47997beaa5d0677aee84d3a)
+++ uspace/lib/net/include/icmp_interface.h	(revision 1b22bd45ebc7f42217757e90fa6e5b57f6ed5d1d)
@@ -51,8 +51,8 @@
 
 extern int icmp_destination_unreachable_msg(int, icmp_code_t, icmp_param_t,
-    packet_t *);
-extern int icmp_source_quench_msg(int, packet_t *);
-extern int icmp_time_exceeded_msg(int, icmp_code_t, packet_t *);
-extern int icmp_parameter_problem_msg(int, icmp_code_t, icmp_param_t, packet_t *);
+    packet_t);
+extern int icmp_source_quench_msg(int, packet_t);
+extern int icmp_time_exceeded_msg(int, icmp_code_t, packet_t);
+extern int icmp_parameter_problem_msg(int, icmp_code_t, icmp_param_t, packet_t);
 
 /*@}*/
Index: uspace/lib/net/include/il_interface.h
===================================================================
--- uspace/lib/net/include/il_interface.h	(revision 32eceb4ff0c0ddeba47997beaa5d0677aee84d3a)
+++ uspace/lib/net/include/il_interface.h	(revision 1b22bd45ebc7f42217757e90fa6e5b57f6ed5d1d)
@@ -51,5 +51,5 @@
 
 extern int il_device_state_msg(int, device_id_t, device_state_t, services_t);
-extern int il_received_msg(int, device_id_t, packet_t *, services_t);
+extern int il_received_msg(int, device_id_t, packet_t, services_t);
 extern int il_mtu_changed_msg(int, device_id_t, size_t, services_t);
 
Index: uspace/lib/net/include/il_local.h
===================================================================
--- uspace/lib/net/include/il_local.h	(revision 32eceb4ff0c0ddeba47997beaa5d0677aee84d3a)
+++ uspace/lib/net/include/il_local.h	(revision 1b22bd45ebc7f42217757e90fa6e5b57f6ed5d1d)
@@ -44,6 +44,6 @@
  * @param[out]		answer_count The last parameter for the actual answer in
  *			the answer parameter.
- * @return		EOK on success.
- * @return		Other error codes as defined for the arp_message()
+ * @returns		EOK on success.
+ * @returns		Other error codes as defined for the arp_message()
  *			function.
  */
@@ -59,8 +59,8 @@
  * @param[in] client_connection The client connection processing function. The
  *			module skeleton propagates its own one.
- * @return		EOK on successful module termination.
- * @return		Other error codes as defined for the arp_initialize()
+ * @returns		EOK on successful module termination.
+ * @returns		Other error codes as defined for the arp_initialize()
  *			function.
- * @return		Other error codes as defined for the REGISTER_ME() macro
+ * @returns		Other error codes as defined for the REGISTER_ME() macro
  *			function.
  */
Index: uspace/lib/net/include/ip_client.h
===================================================================
--- uspace/lib/net/include/ip_client.h	(revision 32eceb4ff0c0ddeba47997beaa5d0677aee84d3a)
+++ uspace/lib/net/include/ip_client.h	(revision 1b22bd45ebc7f42217757e90fa6e5b57f6ed5d1d)
@@ -45,9 +45,9 @@
 #include <ip_interface.h>
 
-extern int ip_client_prepare_packet(packet_t *, ip_protocol_t, ip_ttl_t,
-    ip_tos_t, int, size_t);
-extern int ip_client_process_packet(packet_t *, ip_protocol_t *, ip_ttl_t *,
+extern int ip_client_prepare_packet(packet_t, ip_protocol_t, ip_ttl_t, ip_tos_t,
+    int, size_t);
+extern int ip_client_process_packet(packet_t, ip_protocol_t *, ip_ttl_t *,
     ip_tos_t *, int *, size_t *);
-extern size_t ip_client_header_length(packet_t *);
+extern size_t ip_client_header_length(packet_t);
 extern int ip_client_set_pseudo_header_data_length(void *, size_t, size_t);
 extern int ip_client_get_pseudo_header(ip_protocol_t, struct sockaddr *,
Index: uspace/lib/net/include/ip_header.h
===================================================================
--- uspace/lib/net/include/ip_header.h	(revision 32eceb4ff0c0ddeba47997beaa5d0677aee84d3a)
+++ uspace/lib/net/include/ip_header.h	(revision 1b22bd45ebc7f42217757e90fa6e5b57f6ed5d1d)
@@ -127,8 +127,18 @@
 typedef struct ip_header ip_header_t;
 
+/** Type definition of the internet header pointer.
+ * @see ip_header
+ */
+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.
@@ -136,4 +146,9 @@
  */
 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.
Index: uspace/lib/net/include/ip_interface.h
===================================================================
--- uspace/lib/net/include/ip_interface.h	(revision 32eceb4ff0c0ddeba47997beaa5d0677aee84d3a)
+++ uspace/lib/net/include/ip_interface.h	(revision 1b22bd45ebc7f42217757e90fa6e5b57f6ed5d1d)
@@ -68,7 +68,7 @@
  * @param[in] error	The packet error reporting service. Prefixes the
  *			received packet.
- * @return		EOK on success.
+ * @returns		EOK on success.
  */
-typedef int (*tl_received_msg_t)(device_id_t device_id, packet_t *packet,
+typedef int (*tl_received_msg_t)(device_id_t device_id, packet_t packet,
     services_t receiver, services_t error);
 
Index: uspace/lib/net/include/ip_remote.h
===================================================================
--- uspace/lib/net/include/ip_remote.h	(revision 32eceb4ff0c0ddeba47997beaa5d0677aee84d3a)
+++ uspace/lib/net/include/ip_remote.h	(revision 1b22bd45ebc7f42217757e90fa6e5b57f6ed5d1d)
@@ -44,11 +44,11 @@
 
 extern int ip_set_gateway_req_remote(int, device_id_t, in_addr_t);
-extern int ip_packet_size_req_remote(int, device_id_t, packet_dimension_t *);
-extern int ip_received_error_msg_remote(int, device_id_t, packet_t *, services_t,
+extern int ip_packet_size_req_remote(int, device_id_t, packet_dimension_ref);
+extern int ip_received_error_msg_remote(int, device_id_t, packet_t, services_t,
     services_t);
 extern int ip_device_req_remote(int, device_id_t, services_t);
 extern int ip_add_route_req_remote(int, device_id_t, in_addr_t, in_addr_t,
     in_addr_t);
-extern int ip_send_msg_remote(int, device_id_t, packet_t *, services_t,
+extern int ip_send_msg_remote(int, device_id_t, packet_t, services_t,
     services_t);
 extern int ip_get_route_req_remote(int, ip_protocol_t, const struct sockaddr *,
Index: uspace/lib/net/include/net_interface.h
===================================================================
--- uspace/lib/net/include/net_interface.h	(revision 32eceb4ff0c0ddeba47997beaa5d0677aee84d3a)
+++ uspace/lib/net/include/net_interface.h	(revision 1b22bd45ebc7f42217757e90fa6e5b57f6ed5d1d)
@@ -44,8 +44,8 @@
 /*@{*/
 
-extern int net_get_device_conf_req(int, device_id_t, measured_string_t **,
+extern int net_get_device_conf_req(int, device_id_t, measured_string_ref *,
     size_t, char **);
-extern int net_get_conf_req(int, measured_string_t **, size_t, char **);
-extern void net_free_settings(measured_string_t *, char *);
+extern int net_get_conf_req(int, measured_string_ref *, size_t, char **);
+extern void net_free_settings(measured_string_ref, char *);
 extern int net_connect_module(void);
 
Index: uspace/lib/net/include/netif_local.h
===================================================================
--- uspace/lib/net/include/netif_local.h	(revision 32eceb4ff0c0ddeba47997beaa5d0677aee84d3a)
+++ uspace/lib/net/include/netif_local.h	(revision 1b22bd45ebc7f42217757e90fa6e5b57f6ed5d1d)
@@ -111,5 +111,5 @@
  *			message implementation.
  */
-extern int netif_send_message(device_id_t device_id, packet_t *packet,
+extern int netif_send_message(device_id_t device_id, packet_t packet,
     services_t sender);
 
@@ -158,5 +158,5 @@
  */
 extern int netif_get_addr_message(device_id_t device_id,
-    measured_string_t *address);
+    measured_string_ref address);
 
 /** Process the netif driver specific message.
@@ -193,20 +193,20 @@
  */
 extern int netif_get_device_stats(device_id_t device_id,
-    device_stats_t *stats);
-
-extern int netif_get_addr_req_local(int, device_id_t, measured_string_t **,
+    device_stats_ref stats);
+
+extern int netif_get_addr_req_local(int, device_id_t, measured_string_ref *,
     char **);
 extern int netif_probe_req_local(int, device_id_t, int, int);
-extern int netif_send_msg_local(int, device_id_t, packet_t *, services_t);
+extern int netif_send_msg_local(int, device_id_t, packet_t, services_t);
 extern int netif_start_req_local(int, device_id_t);
 extern int netif_stop_req_local(int, device_id_t);
-extern int netif_stats_req_local(int, device_id_t, device_stats_t *);
+extern int netif_stats_req_local(int, device_id_t, device_stats_ref);
 extern int netif_bind_service_local(services_t, device_id_t, services_t,
     async_client_conn_t);
 
 extern int find_device(device_id_t, netif_device_t **);
-extern void null_device_stats(device_stats_t *);
+extern void null_device_stats(device_stats_ref);
 extern void netif_pq_release(packet_id_t);
-extern packet_t *netif_packet_get_1(size_t);
+extern packet_t netif_packet_get_1(size_t);
 extern int netif_init_module(async_client_conn_t);
 
Index: uspace/lib/net/include/netif_remote.h
===================================================================
--- uspace/lib/net/include/netif_remote.h	(revision 32eceb4ff0c0ddeba47997beaa5d0677aee84d3a)
+++ uspace/lib/net/include/netif_remote.h	(revision 1b22bd45ebc7f42217757e90fa6e5b57f6ed5d1d)
@@ -41,11 +41,11 @@
 #include <net/packet.h>
 
-extern int netif_get_addr_req_remote(int, device_id_t, measured_string_t **,
+extern int netif_get_addr_req_remote(int, device_id_t, measured_string_ref *,
     char **);
 extern int netif_probe_req_remote(int, device_id_t, int, int);
-extern int netif_send_msg_remote(int, device_id_t, packet_t *, services_t);
+extern int netif_send_msg_remote(int, device_id_t, packet_t, services_t);
 extern int netif_start_req_remote(int, device_id_t);
 extern int netif_stop_req_remote(int, device_id_t);
-extern int netif_stats_req_remote(int, device_id_t, device_stats_t *);
+extern int netif_stats_req_remote(int, device_id_t, device_stats_ref);
 extern int netif_bind_service_remote(services_t, device_id_t, services_t,
     async_client_conn_t);
Index: uspace/lib/net/include/nil_local.h
===================================================================
--- uspace/lib/net/include/nil_local.h	(revision 32eceb4ff0c0ddeba47997beaa5d0677aee84d3a)
+++ uspace/lib/net/include/nil_local.h	(revision 1b22bd45ebc7f42217757e90fa6e5b57f6ed5d1d)
@@ -77,5 +77,5 @@
  * 			received function.
  */
-extern int nil_received_msg_local(int, device_id_t, packet_t *, services_t);
+extern int nil_received_msg_local(int, device_id_t, packet_t, services_t);
 
 /** Message processing function.
Index: uspace/lib/net/include/nil_remote.h
===================================================================
--- uspace/lib/net/include/nil_remote.h	(revision 32eceb4ff0c0ddeba47997beaa5d0677aee84d3a)
+++ uspace/lib/net/include/nil_remote.h	(revision 1b22bd45ebc7f42217757e90fa6e5b57f6ed5d1d)
@@ -39,5 +39,5 @@
 
 extern int nil_device_state_msg_remote(int, device_id_t, int);
-extern int nil_received_msg_remote(int, device_id_t, packet_t *, services_t);
+extern int nil_received_msg_remote(int, device_id_t, packet_t, services_t);
 
 #endif
Index: uspace/lib/net/include/packet_client.h
===================================================================
--- uspace/lib/net/include/packet_client.h	(revision 32eceb4ff0c0ddeba47997beaa5d0677aee84d3a)
+++ uspace/lib/net/include/packet_client.h	(revision 1b22bd45ebc7f42217757e90fa6e5b57f6ed5d1d)
@@ -61,7 +61,7 @@
  * @param[in] type	The type to be allocated at the beginning of the packet
  *			content.
- * @return		The typed pointer to the allocated memory.
- * @return		NULL if the packet is not valid.
- * @return		NULL if there is not enough memory left.
+ * @returns		The typed pointer to the allocated memory.
+ * @returns		NULL if the packet is not valid.
+ * @returns		NULL if there is not enough memory left.
  */
 #define PACKET_PREFIX(packet, type) \
@@ -76,7 +76,7 @@
  * @param[in] type	The type to be allocated at the end of the packet
  *			content.
- * @return		The typed pointer to the allocated memory.
- * @return		NULL if the packet is not valid.
- * @return		NULL if there is not enough memory left.
+ * @returns		The typed pointer to the allocated memory.
+ * @returns		NULL if the packet is not valid.
+ * @returns		NULL if there is not enough memory left.
  */
 #define PACKET_SUFFIX(packet, type) \
@@ -92,21 +92,21 @@
  * @param[in] suffix	The type of the suffix to be removed from the end of
  *			the packet content.
- * @return		EOK on success.
- * @return		EINVAL if the packet is not valid.
- * @return		ENOMEM if there is not enough memory left.
+ * @returns		EOK on success.
+ * @returns		EINVAL if the packet is not valid.
+ * @returns		ENOMEM if there is not enough memory left.
  */
 #define PACKET_TRIM(packet, prefix, suffix) \
 	packet_trim((packet), sizeof(prefix), sizeof(suffix))
 
-extern void *packet_prefix(packet_t *, size_t);
-extern void *packet_suffix(packet_t *, size_t);
-extern int packet_trim(packet_t *, size_t, size_t);
-extern int packet_copy_data(packet_t *, const void *, size_t);
-extern packet_id_t packet_get_id(const packet_t *);
-extern size_t packet_get_data_length(const packet_t *);
-extern void *packet_get_data(const packet_t *);
-extern int packet_get_addr(const packet_t *, uint8_t **, uint8_t **);
-extern int packet_set_addr(packet_t *, const uint8_t *, const uint8_t *, size_t);
-extern packet_t *packet_get_copy(int, packet_t *);
+extern void *packet_prefix(packet_t, size_t);
+extern void *packet_suffix(packet_t, size_t);
+extern int packet_trim(packet_t, size_t, size_t);
+extern int packet_copy_data(packet_t, const void *, size_t);
+extern packet_id_t packet_get_id(const packet_t);
+extern size_t packet_get_data_length(const packet_t);
+extern void *packet_get_data(const packet_t);
+extern int packet_get_addr(const packet_t, uint8_t **, uint8_t **);
+extern int packet_set_addr(packet_t, const uint8_t *, const uint8_t *, size_t);
+extern packet_t packet_get_copy(int phone, packet_t packet);
 
 /*@}*/
Index: uspace/lib/net/include/packet_remote.h
===================================================================
--- uspace/lib/net/include/packet_remote.h	(revision 32eceb4ff0c0ddeba47997beaa5d0677aee84d3a)
+++ uspace/lib/net/include/packet_remote.h	(revision 1b22bd45ebc7f42217757e90fa6e5b57f6ed5d1d)
@@ -37,7 +37,7 @@
 #include <sys/types.h>
 
-extern int packet_translate_remote(int, packet_t **, packet_id_t);
-extern packet_t *packet_get_4_remote(int, size_t, size_t, size_t, size_t);
-extern packet_t *packet_get_1_remote(int, size_t);
+extern int packet_translate_remote(int, packet_ref, packet_id_t);
+extern packet_t packet_get_4_remote(int, size_t, size_t, size_t, size_t);
+extern packet_t packet_get_1_remote(int, size_t);
 extern void pq_release_remote(int, packet_id_t);
 
Index: uspace/lib/net/include/socket_core.h
===================================================================
--- uspace/lib/net/include/socket_core.h	(revision 32eceb4ff0c0ddeba47997beaa5d0677aee84d3a)
+++ uspace/lib/net/include/socket_core.h	(revision 1b22bd45ebc7f42217757e90fa6e5b57f6ed5d1d)
@@ -66,8 +66,18 @@
 typedef struct socket_core socket_core_t;
 
+/** Type definition of the socket core pointer.
+ * @see socket_core
+ */
+typedef socket_core_t *socket_core_ref;
+
 /** Type definition of the socket port.
  * @see socket_port
  */
 typedef struct socket_port socket_port_t;
+
+/** Type definition of the socket port pointer.
+ * @see socket_port
+ */
+typedef socket_port_t *socket_port_ref;
 
 /** Socket core. */
@@ -101,5 +111,5 @@
  * the other use the remote addresses.
  */
-GENERIC_CHAR_MAP_DECLARE(socket_port_map, socket_core_t *);
+GENERIC_CHAR_MAP_DECLARE(socket_port_map, socket_core_ref);
 
 /** Ports map.
@@ -108,18 +118,18 @@
 INT_MAP_DECLARE(socket_ports, socket_port_t);
 
-extern void socket_cores_release(int, socket_cores_t *, socket_ports_t *,
-    void (*)(socket_core_t *));
-extern int socket_bind(socket_cores_t *, socket_ports_t *, int, void *, size_t,
+extern void socket_cores_release(int, socket_cores_ref, socket_ports_ref,
+    void (*)(socket_core_ref));
+extern int socket_bind(socket_cores_ref, socket_ports_ref, int, void *, size_t,
     int, int, int);
-extern int socket_bind_free_port(socket_ports_t *, socket_core_t *, int, int,
+extern int socket_bind_free_port(socket_ports_ref, socket_core_ref, int, int,
     int);
-extern int socket_create(socket_cores_t *, int, void *, int *);
-extern int socket_destroy(int, int, socket_cores_t *, socket_ports_t *,
-    void (*)(socket_core_t *));
-extern int socket_reply_packets(packet_t *, size_t *);
-extern socket_core_t *socket_port_find(socket_ports_t *, int, const char *,
+extern int socket_create(socket_cores_ref, int, void *, int *);
+extern int socket_destroy(int, int, socket_cores_ref, socket_ports_ref,
+    void (*)(socket_core_ref));
+extern int socket_reply_packets(packet_t, size_t *);
+extern socket_core_ref socket_port_find(socket_ports_ref, int, const char *,
     size_t);
-extern void socket_port_release(socket_ports_t *, socket_core_t *);
-extern int socket_port_add(socket_ports_t *, int, socket_core_t *,
+extern void socket_port_release(socket_ports_ref, socket_core_ref);
+extern int socket_port_add(socket_ports_ref, int, socket_core_ref,
     const char *, size_t);
 
Index: uspace/lib/net/include/tl_common.h
===================================================================
--- uspace/lib/net/include/tl_common.h	(revision 32eceb4ff0c0ddeba47997beaa5d0677aee84d3a)
+++ uspace/lib/net/include/tl_common.h	(revision 1b22bd45ebc7f42217757e90fa6e5b57f6ed5d1d)
@@ -51,13 +51,13 @@
 DEVICE_MAP_DECLARE(packet_dimensions, packet_dimension_t);
 
-extern int tl_get_ip_packet_dimension(int, packet_dimensions_t *,
-    device_id_t, packet_dimension_t **);
+extern int tl_get_ip_packet_dimension(int, packet_dimensions_ref,
+    device_id_t, packet_dimension_ref *);
 extern int tl_get_address_port(const struct sockaddr *, int, uint16_t *);
-extern int tl_update_ip_packet_dimension(packet_dimensions_t *, device_id_t,
+extern int tl_update_ip_packet_dimension(packet_dimensions_ref, device_id_t,
     size_t);
 extern int tl_set_address_port(struct sockaddr *, int, uint16_t);
-extern int tl_prepare_icmp_packet(int, int, packet_t *, services_t);
-extern int tl_socket_read_packet_data(int, packet_t **, size_t,
-    const packet_dimension_t *, const struct sockaddr *, socklen_t);
+extern int tl_prepare_icmp_packet(int, int, packet_t, services_t);
+extern int tl_socket_read_packet_data(int, packet_ref, size_t,
+    const packet_dimension_ref, const struct sockaddr *, socklen_t);
 
 #endif
Index: uspace/lib/net/include/tl_interface.h
===================================================================
--- uspace/lib/net/include/tl_interface.h	(revision 32eceb4ff0c0ddeba47997beaa5d0677aee84d3a)
+++ uspace/lib/net/include/tl_interface.h	(revision 1b22bd45ebc7f42217757e90fa6e5b57f6ed5d1d)
@@ -52,5 +52,5 @@
 /*@{*/
 
-extern int tl_received_msg(int, device_id_t, packet_t *, services_t, services_t);
+extern int tl_received_msg(int, device_id_t, packet_t, services_t, services_t);
 
 /*@}*/
Index: uspace/lib/net/include/tl_local.h
===================================================================
--- uspace/lib/net/include/tl_local.h	(revision 32eceb4ff0c0ddeba47997beaa5d0677aee84d3a)
+++ uspace/lib/net/include/tl_local.h	(revision 1b22bd45ebc7f42217757e90fa6e5b57f6ed5d1d)
@@ -45,8 +45,8 @@
  * @param[in] client_connection The client connection processing function. The
  *			module skeleton propagates its own one.
- * @return		EOK on successful module termination.
- * @return		Other error codes as defined for the module initialize
+ * @returns		EOK on successful module termination.
+ * @returns		Other error codes as defined for the module initialize
  *			function.
- * @return		Other error codes as defined for the REGISTER_ME() macro
+ * @returns		Other error codes as defined for the REGISTER_ME() macro
  *			function.
  */
@@ -62,6 +62,6 @@
  * @param[out] answer_count The last parameter for the actual answer in the
  *			answer parameter.
- * @return		EOK on success.
- * @return		Other error codes as defined for the module's message
+ * @returns		EOK on success.
+ * @returns		Other error codes as defined for the module's message
  *			standalone function.
  */
Index: uspace/lib/net/netif/netif_local.c
===================================================================
--- uspace/lib/net/netif/netif_local.c	(revision 32eceb4ff0c0ddeba47997beaa5d0677aee84d3a)
+++ uspace/lib/net/netif/netif_local.c	(revision 1b22bd45ebc7f42217757e90fa6e5b57f6ed5d1d)
@@ -92,5 +92,5 @@
  */
 int netif_send_msg_local(int netif_phone, device_id_t device_id,
-    packet_t *packet, services_t sender)
+    packet_t packet, services_t sender)
 {
 	fibril_rwlock_write_lock(&netif_globals.lock);
@@ -181,5 +181,5 @@
  */
 int netif_stats_req_local(int netif_phone, device_id_t device_id,
-    device_stats_t *stats)
+    device_stats_ref stats)
 {
 	fibril_rwlock_read_lock(&netif_globals.lock);
@@ -203,5 +203,5 @@
  */
 int netif_get_addr_req_local(int netif_phone, device_id_t device_id,
-    measured_string_t **address, char **data)
+    measured_string_ref *address, char **data)
 {
 	int rc;
@@ -253,5 +253,5 @@
  * @param[in] stats	The usage statistics.
  */
-void null_device_stats(device_stats_t *stats)
+void null_device_stats(device_stats_ref stats)
 {
 	bzero(stats, sizeof(device_stats_t));
@@ -307,5 +307,5 @@
  *
  */
-packet_t *netif_packet_get_1(size_t content)
+packet_t netif_packet_get_1(size_t content)
 {
 	return packet_get_1_remote(netif_globals.net_phone, content);
@@ -361,5 +361,5 @@
 	size_t length;
 	device_stats_t stats;
-	packet_t *packet;
+	packet_t packet;
 	measured_string_t address;
 	int rc;
Index: uspace/lib/net/netif/netif_remote.c
===================================================================
--- uspace/lib/net/netif/netif_remote.c	(revision 32eceb4ff0c0ddeba47997beaa5d0677aee84d3a)
+++ uspace/lib/net/netif/netif_remote.c	(revision 1b22bd45ebc7f42217757e90fa6e5b57f6ed5d1d)
@@ -60,5 +60,5 @@
  */
 int netif_get_addr_req_remote(int netif_phone, device_id_t device_id,
-    measured_string_t **address, char **data)
+    measured_string_ref *address, char **data)
 {
 	return generic_get_addr_req(netif_phone, NET_NETIF_GET_ADDR, device_id,
@@ -93,5 +93,5 @@
  */
 int
-netif_send_msg_remote(int netif_phone, device_id_t device_id, packet_t *packet,
+netif_send_msg_remote(int netif_phone, device_id_t device_id, packet_t packet,
     services_t sender)
 {
@@ -138,5 +138,5 @@
  */
 int netif_stats_req_remote(int netif_phone, device_id_t device_id,
-    device_stats_t *stats)
+    device_stats_ref stats)
 {
 	if (!stats)
Index: uspace/lib/net/nil/nil_remote.c
===================================================================
--- uspace/lib/net/nil/nil_remote.c	(revision 32eceb4ff0c0ddeba47997beaa5d0677aee84d3a)
+++ uspace/lib/net/nil/nil_remote.c	(revision 1b22bd45ebc7f42217757e90fa6e5b57f6ed5d1d)
@@ -74,5 +74,5 @@
  */
 int nil_received_msg_remote(int nil_phone, device_id_t device_id,
-    packet_t *packet, services_t target)
+    packet_t packet, services_t target)
 {
 	return generic_received_msg_remote(nil_phone, NET_NIL_RECEIVED,
Index: uspace/lib/net/tl/icmp_client.c
===================================================================
--- uspace/lib/net/tl/icmp_client.c	(revision 32eceb4ff0c0ddeba47997beaa5d0677aee84d3a)
+++ uspace/lib/net/tl/icmp_client.c	(revision 1b22bd45ebc7f42217757e90fa6e5b57f6ed5d1d)
@@ -57,14 +57,14 @@
  * @param[out] pointer	The ICMP header pointer.
  * @param[out] mtu	The ICMP header MTU.
- * @return		The ICMP header length.
- * @return		Zero if the packet contains no data.
+ * @returns		The ICMP header length.
+ * @returns		Zero if the packet contains no data.
  */
 int
-icmp_client_process_packet(packet_t *packet, icmp_type_t *type,
+icmp_client_process_packet(packet_t packet, icmp_type_t *type,
     icmp_code_t *code, icmp_param_t *pointer, icmp_param_t *mtu)
 {
-	icmp_header_t *header;
+	icmp_header_ref header;
 
-	header = (icmp_header_t *) packet_get_data(packet);
+	header = (icmp_header_ref) packet_get_data(packet);
 	if (!header ||
 	    (packet_get_data_length(packet) < sizeof(icmp_header_t))) {
@@ -92,7 +92,7 @@
  *
  * @param[in] packet	The packet.
- * @return		The ICMP header length in bytes.
+ * @returns		The ICMP header length in bytes.
  */
-size_t icmp_client_header_length(packet_t *packet)
+size_t icmp_client_header_length(packet_t packet)
 {
 	if (packet_get_data_length(packet) < sizeof(icmp_header_t))
Index: uspace/lib/net/tl/icmp_remote.c
===================================================================
--- uspace/lib/net/tl/icmp_remote.c	(revision 32eceb4ff0c0ddeba47997beaa5d0677aee84d3a)
+++ uspace/lib/net/tl/icmp_remote.c	(revision 1b22bd45ebc7f42217757e90fa6e5b57f6ed5d1d)
@@ -57,11 +57,11 @@
  * @param[in] mtu	The error MTU value.
  * @param[in] packet	The original packet.
- * @return		EOK on success.
- * @return		EPERM if the ICMP error notifications are disabled.
- * @return		ENOMEM if there is not enough memory left.
+ * @returns		EOK on success.
+ * @returns		EPERM if the ICMP error notifications are disabled.
+ * @returns		ENOMEM if there is not enough memory left.
  */
 int
 icmp_destination_unreachable_msg(int icmp_phone, icmp_code_t code,
-    icmp_param_t mtu, packet_t *packet)
+    icmp_param_t mtu, packet_t packet)
 {
 	async_msg_3(icmp_phone, NET_ICMP_DEST_UNREACH, (ipcarg_t) code,
@@ -78,9 +78,9 @@
  * @param[in] icmp_phone The ICMP module phone used for (semi)remote calls.
  * @param[in] packet	The original packet.
- * @return		EOK on success.
- * @return		EPERM if the ICMP error notifications are disabled.
- * @return		ENOMEM if there is not enough memory left.
+ * @returns		EOK on success.
+ * @returns		EPERM if the ICMP error notifications are disabled.
+ * @returns		ENOMEM if there is not enough memory left.
  */
-int icmp_source_quench_msg(int icmp_phone, packet_t *packet)
+int icmp_source_quench_msg(int icmp_phone, packet_t packet)
 {
 	async_msg_2(icmp_phone, NET_ICMP_SOURCE_QUENCH, 0,
@@ -98,9 +98,9 @@
  * @param[in] code	The error specific code.
  * @param[in] packet	The original packet.
- * @return		EOK on success.
- * @return		EPERM if the ICMP error notifications are disabled.
- * @return		ENOMEM if there is not enough memory left.
+ * @returns		EOK on success.
+ * @returns		EPERM if the ICMP error notifications are disabled.
+ * @returns		ENOMEM if there is not enough memory left.
  */
-int icmp_time_exceeded_msg(int icmp_phone, icmp_code_t code, packet_t *packet)
+int icmp_time_exceeded_msg(int icmp_phone, icmp_code_t code, packet_t packet)
 {
 	async_msg_2(icmp_phone, NET_ICMP_TIME_EXCEEDED, (ipcarg_t) code,
@@ -119,10 +119,10 @@
  * @param[in] pointer	The problematic parameter offset.
  * @param[in] packet	The original packet.
- * @return		EOK on success.
- * @return		EPERM if the ICMP error notifications are disabled.
- * @return		ENOMEM if there is not enough memory left.
+ * @returns		EOK on success.
+ * @returns		EPERM if the ICMP error notifications are disabled.
+ * @returns		ENOMEM if there is not enough memory left.
  */
 int icmp_parameter_problem_msg(int icmp_phone, icmp_code_t code,
-    icmp_param_t pointer, packet_t *packet)
+    icmp_param_t pointer, packet_t packet)
 {
 	async_msg_3(icmp_phone, NET_ICMP_PARAMETERPROB, (ipcarg_t) code,
Index: uspace/lib/net/tl/socket_core.c
===================================================================
--- uspace/lib/net/tl/socket_core.c	(revision 32eceb4ff0c0ddeba47997beaa5d0677aee84d3a)
+++ uspace/lib/net/tl/socket_core.c	(revision 1b22bd45ebc7f42217757e90fa6e5b57f6ed5d1d)
@@ -68,5 +68,5 @@
 INT_MAP_IMPLEMENT(socket_cores, socket_core_t);
 
-GENERIC_CHAR_MAP_IMPLEMENT(socket_port_map, socket_core_t *);
+GENERIC_CHAR_MAP_IMPLEMENT(socket_port_map, socket_core_ref);
 
 INT_MAP_IMPLEMENT(socket_ports, socket_port_t);
@@ -85,7 +85,7 @@
  */
 static void
-socket_destroy_core(int packet_phone, socket_core_t *socket,
-    socket_cores_t *local_sockets, socket_ports_t *global_sockets,
-    void (* socket_release)(socket_core_t *socket))
+socket_destroy_core(int packet_phone, socket_core_ref socket,
+    socket_cores_ref local_sockets, socket_ports_ref global_sockets,
+    void (* socket_release)(socket_core_ref socket))
 {
 	int packet_id;
@@ -121,7 +121,7 @@
  */
 void
-socket_cores_release(int packet_phone, socket_cores_t *local_sockets,
-    socket_ports_t *global_sockets,
-    void (* socket_release)(socket_core_t *socket))
+socket_cores_release(int packet_phone, socket_cores_ref local_sockets,
+    socket_ports_ref global_sockets,
+    void (* socket_release)(socket_core_ref socket))
 {
 	int index;
@@ -156,12 +156,12 @@
  * @param[in] key	The socket key identifier.
  * @param[in] key_length The socket key length.
- * @return		EOK on success.
- * @return		ENOMEM if there is not enough memory left.
+ * @returns		EOK on success.
+ * @returns		ENOMEM if there is not enough memory left.
  */
 static int
-socket_port_add_core(socket_port_t *socket_port, socket_core_t *socket,
+socket_port_add_core(socket_port_ref socket_port, socket_core_ref socket,
     const char *key, size_t key_length)
 {
-	socket_core_t **socket_ref;
+	socket_core_ref *socket_ref;
 	int rc;
 
@@ -194,14 +194,14 @@
  * @param[in] socket	The socket to be added.
  * @param[in] port	The port number to be bound to.
- * @return		EOK on success.
- * @return		ENOMEM if there is not enough memory left.
- * @return		Other error codes as defined for the
+ * @returns		EOK on success.
+ * @returns		ENOMEM if there is not enough memory left.
+ * @returns		Other error codes as defined for the
  *			 socket_ports_add() function.
  */
 static int
-socket_bind_insert(socket_ports_t *global_sockets, socket_core_t *socket,
+socket_bind_insert(socket_ports_ref global_sockets, socket_core_ref socket,
     int port)
 {
-	socket_port_t *socket_port;
+	socket_port_ref socket_port;
 	int rc;
 
@@ -248,20 +248,20 @@
  * @param[in] free_ports_end The maximum free port.
  * @param[in] last_used_port The last used free port.
- * @return		EOK on success.
- * @return		ENOTSOCK if the socket was not found.
- * @return		EAFNOSUPPORT if the address family is not supported.
- * @return		EADDRINUSE if the port is already in use.
- * @return		Other error codes as defined for the
+ * @returns		EOK on success.
+ * @returns		ENOTSOCK if the socket was not found.
+ * @returns		EAFNOSUPPORT if the address family is not supported.
+ * @returns		EADDRINUSE if the port is already in use.
+ * @returns		Other error codes as defined for the
  *			socket_bind_free_port() function.
- * @return		Other error codes as defined for the
+ * @returns		Other error codes as defined for the
  *			socket_bind_insert() function.
  */
 int
-socket_bind(socket_cores_t *local_sockets, socket_ports_t *global_sockets,
+socket_bind(socket_cores_ref local_sockets, socket_ports_ref global_sockets,
     int socket_id, void *addr, size_t addrlen, int free_ports_start,
     int free_ports_end, int last_used_port)
 {
-	socket_core_t *socket;
-	socket_port_t *socket_port;
+	socket_core_ref socket;
+	socket_port_ref socket_port;
 	struct sockaddr *address;
 	struct sockaddr_in *address_in;
@@ -322,11 +322,11 @@
  * @param[in] free_ports_end The maximum free port.
  * @param[in] last_used_port The last used free port.
- * @return		EOK on success.
- * @return		ENOTCONN if no free port was found.
- * @return		Other error codes as defined for the
+ * @returns		EOK on success.
+ * @returns		ENOTCONN if no free port was found.
+ * @returns		Other error codes as defined for the
  *			socket_bind_insert() function.
  */
 int
-socket_bind_free_port(socket_ports_t *global_sockets, socket_core_t *socket,
+socket_bind_free_port(socket_ports_ref global_sockets, socket_core_ref socket,
     int free_ports_start, int free_ports_end, int last_used_port)
 {
@@ -367,8 +367,8 @@
  *			requested. A negative identifier is requested if set to
  *			false.
- * @return		The new socket identifier.
- * @return		ELIMIT if there is no socket identifier available.
- */
-static int socket_generate_new_id(socket_cores_t *local_sockets, int positive)
+ * @returns		The new socket identifier.
+ * @returns		ELIMIT if there is no socket identifier available.
+ */
+static int socket_generate_new_id(socket_cores_ref local_sockets, int positive)
 {
 	int socket_id;
@@ -410,13 +410,13 @@
  *			chosen if set to zero or negative. A negative identifier
  *			is chosen if set to negative.
- * @return		EOK on success.
- * @return		EINVAL if the socket_id parameter is NULL.
- * @return		ENOMEM if there is not enough memory left.
+ * @returns		EOK on success.
+ * @returns		EINVAL if the socket_id parameter is NULL.
+ * @returns		ENOMEM if there is not enough memory left.
  */
 int
-socket_create(socket_cores_t *local_sockets, int app_phone,
+socket_create(socket_cores_ref local_sockets, int app_phone,
     void *specific_data, int *socket_id)
 {
-	socket_core_t *socket;
+	socket_core_ref socket;
 	int positive;
 	int rc;
@@ -437,5 +437,5 @@
 	}
 	
-	socket = (socket_core_t *) malloc(sizeof(*socket));
+	socket = (socket_core_ref) malloc(sizeof(*socket));
 	if (!socket)
 		return ENOMEM;
@@ -482,13 +482,13 @@
  * @param[in,out] global_sockets The global sockets to be updated.
  * @param[in] socket_release The client release callback function.
- * @return		EOK on success.
- * @return		ENOTSOCK if the socket is not found.
+ * @returns		EOK on success.
+ * @returns		ENOTSOCK if the socket is not found.
  */
 int
-socket_destroy(int packet_phone, int socket_id, socket_cores_t *local_sockets,
-    socket_ports_t *global_sockets,
-    void (*socket_release)(socket_core_t *socket))
-{
-	socket_core_t *socket;
+socket_destroy(int packet_phone, int socket_id, socket_cores_ref local_sockets,
+    socket_ports_ref global_sockets,
+    void (*socket_release)(socket_core_ref socket))
+{
+	socket_core_ref socket;
 	int accepted_id;
 
@@ -516,13 +516,13 @@
  * @param[in] packet	The packet to be transfered.
  * @param[out] length	The total data length.
- * @return		EOK on success.
- * @return		EBADMEM if the length parameter is NULL.
- * @return		ENOMEM if there is not enough memory left.
- * @return		Other error codes as defined for the data_reply()
+ * @returns		EOK on success.
+ * @returns		EBADMEM if the length parameter is NULL.
+ * @returns		ENOMEM if there is not enough memory left.
+ * @returns		Other error codes as defined for the data_reply()
  *			function.
  */
-int socket_reply_packets(packet_t *packet, size_t *length)
-{
-	packet_t *next_packet;
+int socket_reply_packets(packet_t packet, size_t *length)
+{
+	packet_t next_packet;
 	size_t fragments;
 	size_t *lengths;
@@ -598,13 +598,13 @@
  * @param[in] key	The socket key identifier.
  * @param[in] key_length The socket key length.
- * @return		The found socket.
- * @return		NULL if no socket was found.
- */
-socket_core_t *
-socket_port_find(socket_ports_t *global_sockets, int port, const char *key,
+ * @returns		The found socket.
+ * @returns		NULL if no socket was found.
+ */
+socket_core_ref
+socket_port_find(socket_ports_ref global_sockets, int port, const char *key,
     size_t key_length)
 {
-	socket_port_t *socket_port;
-	socket_core_t **socket_ref;
+	socket_port_ref socket_port;
+	socket_core_ref *socket_ref;
 
 	socket_port = socket_ports_find(global_sockets, port);
@@ -628,8 +628,8 @@
  */
 void
-socket_port_release(socket_ports_t *global_sockets, socket_core_t *socket)
-{
-	socket_port_t *socket_port;
-	socket_core_t **socket_ref;
+socket_port_release(socket_ports_ref global_sockets, socket_core_ref socket)
+{
+	socket_port_ref socket_port;
+	socket_core_ref *socket_ref;
 
 	if (!socket->port)
@@ -673,14 +673,14 @@
  * @param[in] key	The socket key identifier.
  * @param[in] key_length The socket key length.
- * @return		EOK on success.
- * @return		ENOENT if the port is not already used.
- * @return		Other error codes as defined for the
+ * @returns		EOK on success.
+ * @returns		ENOENT if the port is not already used.
+ * @returns		Other error codes as defined for the
  *			socket_port_add_core() function.
  */
 int
-socket_port_add(socket_ports_t *global_sockets, int port,
-    socket_core_t *socket, const char *key, size_t key_length)
-{
-	socket_port_t *socket_port;
+socket_port_add(socket_ports_ref global_sockets, int port,
+    socket_core_ref socket, const char *key, size_t key_length)
+{
+	socket_port_ref socket_port;
 	int rc;
 
Index: uspace/lib/net/tl/tl_common.c
===================================================================
--- uspace/lib/net/tl/tl_common.c	(revision 32eceb4ff0c0ddeba47997beaa5d0677aee84d3a)
+++ uspace/lib/net/tl/tl_common.c	(revision 1b22bd45ebc7f42217757e90fa6e5b57f6ed5d1d)
@@ -64,8 +64,8 @@
  * @param[in] addrlen	The address length.
  * @param[out] port	The set port.
- * @return		EOK on success.
- * @return		EINVAL if the address length does not match the address
+ * @returns		EOK on success.
+ * @returns		EINVAL if the address length does not match the address
  *			family.
- * @return		EAFNOSUPPORT if the address family is not supported.
+ * @returns		EAFNOSUPPORT if the address family is not supported.
  */
 int
@@ -120,6 +120,6 @@
 int
 tl_get_ip_packet_dimension(int ip_phone,
-    packet_dimensions_t *packet_dimensions, device_id_t device_id,
-    packet_dimension_t **packet_dimension)
+    packet_dimensions_ref packet_dimensions, device_id_t device_id,
+    packet_dimension_ref *packet_dimension)
 {
 	int rc;
@@ -158,12 +158,12 @@
  * @param[in] device_id	The device identifier.
  * @param[in] content	The new maximum content size.
- * @return		EOK on success.
+ * @returns		EOK on success.
  * @return		ENOENT if the packet dimension is not cached.
  */
 int
-tl_update_ip_packet_dimension(packet_dimensions_t *packet_dimensions,
+tl_update_ip_packet_dimension(packet_dimensions_ref packet_dimensions,
     device_id_t device_id, size_t content)
 {
-	packet_dimension_t *packet_dimension;
+	packet_dimension_ref packet_dimension;
 
 	packet_dimension = packet_dimensions_find(packet_dimensions, device_id);
@@ -196,8 +196,8 @@
  * @param[in] addrlen	The address length.
  * @param[in] port	The port to be set.
- * @return		EOK on success.
- * @return		EINVAL if the address length does not match the address
+ * @returns		EOK on success.
+ * @returns		EINVAL if the address length does not match the address
  *			family.
- * @return		EAFNOSUPPORT if the address family is not supported.
+ * @returns		EAFNOSUPPORT if the address family is not supported.
  */
 int tl_set_address_port(struct sockaddr * addr, int addrlen, uint16_t port)
@@ -244,12 +244,12 @@
  * @param[in] error	The packet error reporting service. Prefixes the
  *			received packet.
- * @return		EOK on success.
- * @return		ENOENT if no packet may be sent.
- */
-int
-tl_prepare_icmp_packet(int packet_phone, int icmp_phone, packet_t *packet,
+ * @returns		EOK on success.
+ * @returns		ENOENT if no packet may be sent.
+ */
+int
+tl_prepare_icmp_packet(int packet_phone, int icmp_phone, packet_t packet,
     services_t error)
 {
-	packet_t *next;
+	packet_t next;
 	uint8_t *src;
 	int length;
@@ -280,13 +280,13 @@
  * @param[in] addr	The destination address.
  * @param[in] addrlen	The address length.
- * @return		Number of bytes received.
- * @return		EINVAL if the client does not send data.
- * @return		ENOMEM if there is not enough memory left.
- * @return		Other error codes as defined for the
+ * @returns		Number of bytes received.
+ * @returns		EINVAL if the client does not send data.
+ * @returns		ENOMEM if there is not enough memory left.
+ * @returns		Other error codes as defined for the
  *			async_data_read_finalize() function.
  */
 int
-tl_socket_read_packet_data(int packet_phone, packet_t **packet, size_t prefix,
-    const packet_dimension_t *dimension, const struct sockaddr *addr,
+tl_socket_read_packet_data(int packet_phone, packet_ref packet, size_t prefix,
+    const packet_dimension_ref dimension, const struct sockaddr *addr,
     socklen_t addrlen)
 {
Index: uspace/lib/net/tl/tl_interface.c
===================================================================
--- uspace/lib/net/tl/tl_interface.c	(revision 32eceb4ff0c0ddeba47997beaa5d0677aee84d3a)
+++ uspace/lib/net/tl/tl_interface.c	(revision 1b22bd45ebc7f42217757e90fa6e5b57f6ed5d1d)
@@ -58,5 +58,5 @@
  */
 int
-tl_received_msg(int tl_phone, device_id_t device_id, packet_t *packet,
+tl_received_msg(int tl_phone, device_id_t device_id, packet_t packet,
     services_t target, services_t error)
 {
Index: uspace/lib/packet/generic/packet_server.c
===================================================================
--- uspace/lib/packet/generic/packet_server.c	(revision 32eceb4ff0c0ddeba47997beaa5d0677aee84d3a)
+++ uspace/lib/packet/generic/packet_server.c	(revision 1b22bd45ebc7f42217757e90fa6e5b57f6ed5d1d)
@@ -36,4 +36,5 @@
 
 #include <packet_server.h>
+#include <packet_local.h>
 
 #include <align.h>
@@ -68,5 +69,5 @@
 	fibril_mutex_t lock;
 	/** Free packet queues. */
-	packet_t *free[FREE_QUEUES_COUNT];
+	packet_t free[FREE_QUEUES_COUNT];
 	
 	/**
@@ -102,4 +103,13 @@
 };
 
+int packet_translate_local(int phone, packet_ref packet, packet_id_t packet_id)
+{
+	if (!packet)
+		return EINVAL;
+	
+	*packet = pm_find(packet_id);
+	return (*packet) ? EOK : ENOENT;
+}
+
 /** Clears and initializes the packet according to the given dimensions.
  *
@@ -112,10 +122,10 @@
  */
 static void
-packet_init(packet_t *packet, size_t addr_len, size_t max_prefix,
+packet_init(packet_t packet, size_t addr_len, size_t max_prefix,
     size_t max_content, size_t max_suffix)
 {
 	// clear the packet content
-	bzero(((void *) packet) + sizeof(packet_t),
-	    packet->length - sizeof(packet_t));
+	bzero(((void *) packet) + sizeof(struct packet),
+	    packet->length - sizeof(struct packet));
 	
 	// clear the packet header
@@ -125,5 +135,5 @@
 	packet->next = 0;
 	packet->addr_len = 0;
-	packet->src_addr = sizeof(packet_t);
+	packet->src_addr = sizeof(struct packet);
 	packet->dest_addr = packet->src_addr + addr_len;
 	packet->max_prefix = max_prefix;
@@ -144,16 +154,16 @@
  * @param[in] max_content The maximal content length in bytes.
  * @param[in] max_suffix The maximal suffix length in bytes.
- * @return		The packet of dimensions at least as given.
- * @return		NULL if there is not enough memory left.
- */
-static packet_t *
+ * @returns		The packet of dimensions at least as given.
+ * @returns		NULL if there is not enough memory left.
+ */
+static packet_t
 packet_create(size_t length, size_t addr_len, size_t max_prefix,
     size_t max_content, size_t max_suffix)
 {
-	packet_t *packet;
+	packet_t packet;
 	int rc;
 
 	// already locked
-	packet = (packet_t *) mmap(NULL, length, PROTO_READ | PROTO_WRITE,
+	packet = (packet_t) mmap(NULL, length, PROTO_READ | PROTO_WRITE,
 	    MAP_SHARED | MAP_ANONYMOUS, 0, 0);
 	if (packet == MAP_FAILED)
@@ -188,14 +198,14 @@
  * @return		NULL if there is not enough memory left.
  */
-static packet_t *
+static packet_t
 packet_get_local(size_t addr_len, size_t max_prefix, size_t max_content,
     size_t max_suffix)
 {
-	size_t length = ALIGN_UP(sizeof(packet_t) + 2 * addr_len +
+	size_t length = ALIGN_UP(sizeof(struct packet) + 2 * addr_len +
 	    max_prefix + max_content + max_suffix, PAGE_SIZE);
 	
 	fibril_mutex_lock(&ps_globals.lock);
 	
-	packet_t *packet;
+	packet_t packet;
 	unsigned int index;
 	
@@ -231,4 +241,16 @@
 }
 
+packet_t packet_get_4_local(int phone, size_t max_content, size_t addr_len,
+    size_t max_prefix, size_t max_suffix)
+{
+	return packet_get_local(addr_len, max_prefix, max_content, max_suffix);
+}
+
+packet_t packet_get_1_local(int phone, size_t content)
+{
+	return packet_get_local(DEFAULT_ADDR_LEN, DEFAULT_PREFIX, content,
+	    DEFAULT_SUFFIX);
+}
+
 /** Release the packet and returns it to the appropriate free packet queue.
  *
@@ -238,5 +260,5 @@
  *
  */
-static void packet_release(packet_t *packet)
+static void packet_release(packet_t packet)
 {
 	int index;
@@ -256,10 +278,10 @@
  *
  * @param[in] packet_id	The first packet identifier.
- * @return		EOK on success.
- * @return		ENOENT if there is no such packet.
+ * @returns		EOK on success.
+ * @returns		ENOENT if there is no such packet.
  */
 static int packet_release_wrapper(packet_id_t packet_id)
 {
-	packet_t *packet;
+	packet_t packet;
 
 	packet = pm_find(packet_id);
@@ -274,14 +296,19 @@
 }
 
+void pq_release_local(int phone, packet_id_t packet_id)
+{
+	(void) packet_release_wrapper(packet_id);
+}
+
 /** Shares the packet memory block.
  * @param[in] packet	The packet to be shared.
- * @return		EOK on success.
- * @return		EINVAL if the packet is not valid.
- * @return		EINVAL if the calling module does not accept the memory.
- * @return		ENOMEM if the desired and actual sizes differ.
- * @return		Other error codes as defined for the
+ * @returns		EOK on success.
+ * @returns		EINVAL if the packet is not valid.
+ * @returns		EINVAL if the calling module does not accept the memory.
+ * @returns		ENOMEM if the desired and actual sizes differ.
+ * @returns		Other error codes as defined for the
  *			async_share_in_finalize() function.
  */
-static int packet_reply(packet_t *packet)
+static int packet_reply(const packet_t packet)
 {
 	ipc_callid_t callid;
@@ -312,10 +339,10 @@
  * @param[out] answer_count The last parameter for the actual answer in the
  *			answer parameter.
- * @return		EOK on success.
- * @return		ENOMEM if there is not enough memory left.
- * @return		ENOENT if there is no such packet as in the packet
+ * @returns		EOK on success.
+ * @returns		ENOMEM if there is not enough memory left.
+ * @returns		ENOENT if there is no such packet as in the packet
  *			message parameter.
- * @return		ENOTSUP if the message is not known.
- * @return		Other error codes as defined for the
+ * @returns		ENOTSUP if the message is not known.
+ * @returns		Other error codes as defined for the
  *			packet_release_wrapper() function.
  */
@@ -324,5 +351,5 @@
     int *answer_count)
 {
-	packet_t *packet;
+	packet_t packet;
 
 	*answer_count = 0;
Index: uspace/lib/packet/include/packet_local.h
===================================================================
--- uspace/lib/packet/include/packet_local.h	(revision 1b22bd45ebc7f42217757e90fa6e5b57f6ed5d1d)
+++ uspace/lib/packet/include/packet_local.h	(revision 1b22bd45ebc7f42217757e90fa6e5b57f6ed5d1d)
@@ -0,0 +1,55 @@
+/*
+ * Copyright (c) 2009 Lukas Mejdrech
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/** @addtogroup libpacket
+ * @{
+ */
+
+/** @file
+ */
+
+#ifndef LIBPACKET_PACKET_LOCAL_H_
+#define LIBPACKET_PACKET_LOCAL_H_
+
+#include <net/packet.h>
+
+/** @name Packet local interface
+ */
+/*@{*/
+
+extern int packet_translate_local(int, packet_ref, packet_id_t);
+extern packet_t packet_get_4_local(int, size_t, size_t, size_t, size_t);
+extern packet_t packet_get_1_local(int, size_t);
+extern void pq_release_local(int, packet_id_t);
+
+/*@}*/
+
+#endif
+
+/** @}
+ */
Index: uspace/lib/usb/src/hcdhubd.c
===================================================================
--- uspace/lib/usb/src/hcdhubd.c	(revision 32eceb4ff0c0ddeba47997beaa5d0677aee84d3a)
+++ uspace/lib/usb/src/hcdhubd.c	(revision 1b22bd45ebc7f42217757e90fa6e5b57f6ed5d1d)
@@ -305,5 +305,5 @@
 	hc->transfer_ops->transfer_out(hc, &dev, &endpoint, buffer, size, NULL, NULL);
 
-	*handle = (usb_handle_t)NULL;
+	*handle = NULL;
 
 	return EOK;
Index: uspace/srv/hid/kbd/genarch/gsp.c
===================================================================
--- uspace/srv/hid/kbd/genarch/gsp.c	(revision 32eceb4ff0c0ddeba47997beaa5d0677aee84d3a)
+++ uspace/srv/hid/kbd/genarch/gsp.c	(revision 1b22bd45ebc7f42217757e90fa6e5b57f6ed5d1d)
@@ -198,6 +198,6 @@
 	if (t == NULL) {
 		printf("gsp_step: not found\n");
-		*mods = 0;
-		*key = 0;
+		*mods = NULL;
+		*key = NULL;
 		return 0;
 	}
Index: uspace/srv/hw/netif/dp8390/dp8390.c
===================================================================
--- uspace/srv/hw/netif/dp8390/dp8390.c	(revision 32eceb4ff0c0ddeba47997beaa5d0677aee84d3a)
+++ uspace/srv/hw/netif/dp8390/dp8390.c	(revision 1b22bd45ebc7f42217757e90fa6e5b57f6ed5d1d)
@@ -62,8 +62,8 @@
  *  @param[in] dep The network interface structure.
  *  @param[in] packet The outgoing packet.
- *  @return EOK on success.
- *  @return EINVAL 
+ *  @returns EOK on success.
+ *  @returns EINVAL 
  */
-int queue_packet(dpeth_t * dep, packet_t *packet);
+int queue_packet(dpeth_t * dep, packet_t packet);
 
 /** Reads a memory block byte by byte.
@@ -336,6 +336,6 @@
 }
 
-int queue_packet(dpeth_t * dep, packet_t *packet){
-	packet_t *tmp;
+int queue_packet(dpeth_t * dep, packet_t packet){
+	packet_t tmp;
 
 	if(dep->packet_count >= MAX_PACKETS){
@@ -361,5 +361,5 @@
  *			based on	do_vwrite				     *
  *===========================================================================*/
-int do_pwrite(dpeth_t * dep, packet_t *packet, int from_int)
+int do_pwrite(dpeth_t * dep, packet_t packet, int from_int)
 {
 //	int port, count, size;
@@ -432,5 +432,5 @@
 	dep->de_write_iovec.iod_iovec[0].iov_size = size;
 	dep->de_write_iovec.iod_iovec_s = 1;
-	dep->de_write_iovec.iod_iovec_addr = (uintptr_t) NULL;
+	dep->de_write_iovec.iod_iovec_addr = NULL;
 
 	if (size < ETH_MIN_PACK_SIZE || size > ETH_MAX_PACK_SIZE_TAGGED)
@@ -910,5 +910,5 @@
 dpeth_t *dep;
 {
-	packet_t *packet;
+	packet_t packet;
 
 //	if (!(dep->de_flags &DEF_SEND_AVAIL))
@@ -1003,5 +1003,5 @@
 {
 	int last, count;
-	packet_t *packet;
+	packet_t packet;
 
 //	if (!(dep->de_flags &DEF_READING))
@@ -1015,5 +1015,5 @@
 	dep->de_read_iovec.iod_iovec[0].iov_size = length;
 	dep->de_read_iovec.iod_iovec_s = 1;
-	dep->de_read_iovec.iod_iovec_addr = (uintptr_t) NULL;
+	dep->de_read_iovec.iod_iovec_addr = NULL;
 
 	last = page + (length - 1) / DP_PAGESIZE;
Index: uspace/srv/hw/netif/dp8390/dp8390.h
===================================================================
--- uspace/srv/hw/netif/dp8390/dp8390.h	(revision 32eceb4ff0c0ddeba47997beaa5d0677aee84d3a)
+++ uspace/srv/hw/netif/dp8390/dp8390.h	(revision 1b22bd45ebc7f42217757e90fa6e5b57f6ed5d1d)
@@ -313,5 +313,5 @@
 	/** Outgoing packets queue.
 	 */
-	packet_t *packet_queue;
+	packet_t packet_queue;
 	/** Outgoing packets count.
 	 */
@@ -320,5 +320,5 @@
 	/** Received packets queue.
 	 */
-	packet_t *received_queue;
+	packet_t received_queue;
 	/** Received packets count.
 	 */
Index: uspace/srv/hw/netif/dp8390/dp8390_drv.h
===================================================================
--- uspace/srv/hw/netif/dp8390/dp8390_drv.h	(revision 32eceb4ff0c0ddeba47997beaa5d0677aee84d3a)
+++ uspace/srv/hw/netif/dp8390/dp8390_drv.h	(revision 1b22bd45ebc7f42217757e90fa6e5b57f6ed5d1d)
@@ -72,5 +72,5 @@
  *  @returns 
  */
-int do_pwrite(dpeth_t * dep, packet_t *packet, int from_int);
+int do_pwrite(dpeth_t * dep, packet_t packet, int from_int);
 
 /** Prints out network interface information.
Index: uspace/srv/hw/netif/dp8390/dp8390_module.c
===================================================================
--- uspace/srv/hw/netif/dp8390/dp8390_module.c	(revision 32eceb4ff0c0ddeba47997beaa5d0677aee84d3a)
+++ uspace/srv/hw/netif/dp8390/dp8390_module.c	(revision 1b22bd45ebc7f42217757e90fa6e5b57f6ed5d1d)
@@ -103,5 +103,5 @@
 	netif_device_t * device;
 	dpeth_t * dep;
-	packet_t *received;
+	packet_t received;
 	device_id_t device_id;
 	int phone;
@@ -127,5 +127,5 @@
 		dep->received_count = 0;
 		fibril_rwlock_write_unlock(&netif_globals.lock);
-		nil_received_msg(phone, device_id, received, SERVICE_NONE);
+		nil_received_msg(phone, device_id, received, NULL);
 	}else{
 		fibril_rwlock_write_unlock(&netif_globals.lock);
@@ -157,6 +157,5 @@
 }
 
-int netif_get_device_stats(device_id_t device_id, device_stats_t *stats)
-{
+int netif_get_device_stats(device_id_t device_id, device_stats_ref stats){
 	netif_device_t * device;
 	eth_stat_t * de_stat;
@@ -186,5 +185,5 @@
 }
 
-int netif_get_addr_message(device_id_t device_id, measured_string_t *address){
+int netif_get_addr_message(device_id_t device_id, measured_string_ref address){
 	netif_device_t * device;
 	int rc;
@@ -247,8 +246,8 @@
 }
 
-int netif_send_message(device_id_t device_id, packet_t *packet, services_t sender){
-	netif_device_t * device;
-	dpeth_t * dep;
-	packet_t *next;
+int netif_send_message(device_id_t device_id, packet_t packet, services_t sender){
+	netif_device_t * device;
+	dpeth_t * dep;
+	packet_t next;
 	int rc;
 
Index: uspace/srv/net/il/arp/arp.c
===================================================================
--- uspace/srv/net/il/arp/arp.c	(revision 32eceb4ff0c0ddeba47997beaa5d0677aee84d3a)
+++ uspace/srv/net/il/arp/arp.c	(revision 1b22bd45ebc7f42217757e90fa6e5b57f6ed5d1d)
@@ -83,8 +83,8 @@
  * @param[in] device	The device specific data.
  */
-static void arp_clear_device(arp_device_t *device)
+static void arp_clear_device(arp_device_ref device)
 {
 	int count;
-	arp_proto_t *proto;
+	arp_proto_ref proto;
 
 	for (count = arp_protos_count(&device->protos) - 1; count >= 0;
@@ -105,5 +105,5 @@
 {
 	int count;
-	arp_device_t *device;
+	arp_device_ref device;
 
 	fibril_rwlock_write_lock(&arp_globals.lock);
@@ -126,8 +126,8 @@
 
 static int arp_clear_address_req(int arp_phone, device_id_t device_id,
-    services_t protocol, measured_string_t *address)
-{
-	arp_device_t *device;
-	arp_proto_t *proto;
+    services_t protocol, measured_string_ref address)
+{
+	arp_device_ref device;
+	arp_proto_ref proto;
 
 	fibril_rwlock_write_lock(&arp_globals.lock);
@@ -150,5 +150,5 @@
 static int arp_clear_device_req(int arp_phone, device_id_t device_id)
 {
-	arp_device_t *device;
+	arp_device_ref device;
 
 	fibril_rwlock_write_lock(&arp_globals.lock);
@@ -171,13 +171,13 @@
  * @param[in] service	The protocol module service.
  * @param[in] address	The actual protocol device address.
- * @return		EOK on success.
- * @return		ENOMEM if there is not enough memory left.
- */
-static int arp_proto_create(arp_proto_t **proto, services_t service,
-    measured_string_t *address)
+ * @returns		EOK on success.
+ * @returns		ENOMEM if there is not enough memory left.
+ */
+static int arp_proto_create(arp_proto_ref *proto, services_t service,
+    measured_string_ref address)
 {
 	int rc;
 
-	*proto = (arp_proto_t *) malloc(sizeof(arp_proto_t));
+	*proto = (arp_proto_ref) malloc(sizeof(arp_proto_t));
 	if (!*proto)
 		return ENOMEM;
@@ -205,16 +205,16 @@
  * @param[in] protocol	The protocol service.
  * @param[in] address	The actual device protocol address.
- * @return		EOK on success.
- * @return		EEXIST if another device with the same device identifier
+ * @returns		EOK on success.
+ * @returns		EEXIST if another device with the same device identifier
  *			and different driver service exists.
- * @return		ENOMEM if there is not enough memory left.
- * @return		Other error codes as defined for the
+ * @returns		ENOMEM if there is not enough memory left.
+ * @returns		Other error codes as defined for the
  *			measured_strings_return() function.
  */
 static int arp_device_message(device_id_t device_id, services_t service,
-    services_t protocol, measured_string_t *address)
-{
-	arp_device_t *device;
-	arp_proto_t *proto;
+    services_t protocol, measured_string_ref address)
+{
+	arp_device_ref device;
+	arp_proto_ref proto;
 	hw_type_t hardware;
 	int index;
@@ -260,5 +260,5 @@
 		
 		/* Create a new device */
-		device = (arp_device_t *) malloc(sizeof(arp_device_t));
+		device = (arp_device_ref) malloc(sizeof(arp_device_t));
 		if (!device) {
 			fibril_rwlock_write_unlock(&arp_globals.lock);
@@ -356,6 +356,6 @@
  *  @param[in] client_connection The client connection processing function.
  *			The module skeleton propagates its own one.
- *  @return		EOK on success.
- *  @return		ENOMEM if there is not enough memory left.
+ *  @returns		EOK on success.
+ *  @returns		ENOMEM if there is not enough memory left.
  */
 int arp_initialize(async_client_conn_t client_connection)
@@ -376,10 +376,10 @@
  * @param[in] device_id	The device identifier.
  * @param[in] mtu	The new mtu value.
- * @return		ENOENT if device is not found.
- * @return		EOK on success.
+ * @returns		ENOENT if device is not found.
+ * @returns		EOK on success.
  */
 static int arp_mtu_changed_message(device_id_t device_id, size_t mtu)
 {
-	arp_device_t *device;
+	arp_device_ref device;
 
 	fibril_rwlock_write_lock(&arp_globals.lock);
@@ -404,22 +404,22 @@
  * @param[in] device_id	The source device identifier.
  * @param[in,out] packet The received packet.
- * @return		EOK on success and the packet is no longer needed.
- * @return		One on success and the packet has been reused.
- * @return		EINVAL if the packet is too small to carry an ARP
+ * @returns		EOK on success and the packet is no longer needed.
+ * @returns		One on success and the packet has been reused.
+ * @returns		EINVAL if the packet is too small to carry an ARP
  *			packet.
- * @return		EINVAL if the received address lengths differs from
+ * @returns		EINVAL if the received address lengths differs from
  *			the registered values.
- * @return		ENOENT if the device is not found in the cache.
- * @return		ENOENT if the protocol for the device is not found in
+ * @returns		ENOENT if the device is not found in the cache.
+ * @returns		ENOENT if the protocol for the device is not found in
  *			the cache.
- * @return		ENOMEM if there is not enough memory left.
- */
-static int arp_receive_message(device_id_t device_id, packet_t *packet)
+ * @returns		ENOMEM if there is not enough memory left.
+ */
+static int arp_receive_message(device_id_t device_id, packet_t packet)
 {
 	size_t length;
-	arp_header_t *header;
-	arp_device_t *device;
-	arp_proto_t *proto;
-	measured_string_t *hw_source;
+	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;
@@ -436,5 +436,5 @@
 		return ENOENT;
 
-	header = (arp_header_t *) packet_get_data(packet);
+	header = (arp_header_ref) packet_get_data(packet);
 	if ((ntohs(header->hardware) != device->hardware) ||
 	    (length < sizeof(arp_header_t) + header->hardware_length * 2U +
@@ -516,21 +516,21 @@
  * @param[in] protocol	The protocol service.
  * @param[in] target	The target protocol address.
- * @return		The hardware address of the target.
- * @return		NULL if the target parameter is NULL.
- * @return		NULL if the device is not found.
- * @return		NULL if the device packet is too small to send a
+ * @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
  *			request.
- * @return		NULL if the hardware address is not found in the cache.
- */
-static measured_string_t *
+ * @returns		NULL if the hardware address is not found in the cache.
+ */
+static measured_string_ref
 arp_translate_message(device_id_t device_id, services_t protocol,
-    measured_string_t *target)
-{
-	arp_device_t *device;
-	arp_proto_t *proto;
-	measured_string_t *addr;
+    measured_string_ref target)
+{
+	arp_device_ref device;
+	arp_proto_ref proto;
+	measured_string_ref addr;
 	size_t length;
-	packet_t *packet;
-	arp_header_t *header;
+	packet_t packet;
+	arp_header_ref header;
 
 	if (!target)
@@ -561,5 +561,5 @@
 		return NULL;
 
-	header = (arp_header_t *) packet_suffix(packet, length);
+	header = (arp_header_ref) packet_suffix(packet, length);
 	if (!header) {
 		pq_release_remote(arp_globals.net_phone, packet_get_id(packet));
@@ -602,6 +602,6 @@
  * @param[out] answer_count The last parameter for the actual answer in the
  *			answer parameter.
- * @return		EOK on success.
- * @return		ENOTSUP if the message is not known.
+ * @returns		EOK on success.
+ * @returns		ENOTSUP if the message is not known.
  *
  * @see arp_interface.h
@@ -612,9 +612,9 @@
     ipc_call_t *answer, int *answer_count)
 {
-	measured_string_t *address;
-	measured_string_t *translation;
+	measured_string_ref address;
+	measured_string_ref translation;
 	char *data;
-	packet_t *packet;
-	packet_t *next;
+	packet_t packet;
+	packet_t next;
 	int rc;
 	
@@ -747,6 +747,6 @@
 /** Starts the module.
  *
- * @return		EOK on success.
- * @return		Other error codes as defined for each specific module
+ * @returns		EOK on success.
+ * @returns		Other error codes as defined for each specific module
  *			start function.
  */
Index: uspace/srv/net/il/arp/arp.h
===================================================================
--- uspace/srv/net/il/arp/arp.h	(revision 32eceb4ff0c0ddeba47997beaa5d0677aee84d3a)
+++ uspace/srv/net/il/arp/arp.h	(revision 1b22bd45ebc7f42217757e90fa6e5b57f6ed5d1d)
@@ -55,4 +55,9 @@
 typedef struct arp_device arp_device_t;
 
+/** Type definition of the ARP device specific data pointer.
+ * @see arp_device
+ */
+typedef arp_device_t *arp_device_ref;
+
 /** Type definition of the ARP global data.
  * @see arp_globals
@@ -64,4 +69,9 @@
  */
 typedef struct arp_proto arp_proto_t;
+
+/** Type definition of the ARP protocol specific data pointer.
+ * @see arp_proto
+ */
+typedef arp_proto_t *arp_proto_ref;
 
 /** ARP address map.
@@ -89,9 +99,9 @@
 struct arp_device {
 	/** Actual device hardware address. */
-	measured_string_t * addr;
+	measured_string_ref addr;
 	/** Actual device hardware address data. */
 	char *addr_data;
 	/** Broadcast device hardware address. */
-	measured_string_t * broadcast_addr;
+	measured_string_ref broadcast_addr;
 	/** Broadcast device hardware address data. */
 	char *broadcast_data;
@@ -135,5 +145,5 @@
 struct arp_proto {
 	/** Actual device protocol address. */
-	measured_string_t *addr;
+	measured_string_ref addr;
 	/** Actual device protocol address data. */
 	char *addr_data;
Index: uspace/srv/net/il/arp/arp_header.h
===================================================================
--- uspace/srv/net/il/arp/arp_header.h	(revision 32eceb4ff0c0ddeba47997beaa5d0677aee84d3a)
+++ uspace/srv/net/il/arp/arp_header.h	(revision 1b22bd45ebc7f42217757e90fa6e5b57f6ed5d1d)
@@ -46,4 +46,9 @@
 typedef struct arp_header arp_header_t;
 
+/** Type definition of an ARP protocol header pointer.
+ * @see arp_header
+ */
+typedef arp_header_t *arp_header_ref;
+
 /** ARP protocol header. */
 struct arp_header {
Index: uspace/srv/net/il/ip/ip.c
===================================================================
--- uspace/srv/net/il/ip/ip.c	(revision 32eceb4ff0c0ddeba47997beaa5d0677aee84d3a)
+++ uspace/srv/net/il/ip/ip.c	(revision 1b22bd45ebc7f42217757e90fa6e5b57f6ed5d1d)
@@ -129,5 +129,5 @@
  * @return		The result parameter.
  */
-static int ip_release_and_return(packet_t *packet, int result)
+static int ip_release_and_return(packet_t packet, int result)
 {
 	pq_release_remote(ip_globals.net_phone, packet_get_id(packet));
@@ -139,10 +139,10 @@
  * Searches the registered protocols.
  *
- * @return		The found ICMP phone.
- * @return		ENOENT if the ICMP is not registered.
+ * @returns		The found ICMP phone.
+ * @returns		ENOENT if the ICMP is not registered.
  */
 static int ip_get_icmp_phone(void)
 {
-	ip_proto_t *proto;
+	ip_proto_ref proto;
 	int phone;
 
@@ -160,17 +160,17 @@
  * @param[in] packet	The packet or the packet queue to be reported as faulty.
  * @param[in] header	The first packet IP header. May be NULL.
- * @return		EOK on success.
- * @return		EINVAL if there are no data in the packet.
- * @return		EINVAL if the packet is a fragment.
- * @return		ENOMEM if the packet is too short to contain the IP
+ * @returns		EOK on success.
+ * @returns		EINVAL if there are no data in the packet.
+ * @returns		EINVAL if the packet is a fragment.
+ * @returns		ENOMEM if the packet is too short to contain the IP
  *			header.
- * @return		EAFNOSUPPORT if the address family is not supported.
- * @return		EPERM if the protocol is not allowed to send ICMP
+ * @returns		EAFNOSUPPORT if the address family is not supported.
+ * @returns		EPERM if the protocol is not allowed to send ICMP
  *			notifications. The ICMP protocol itself.
- * @return		Other error codes as defined for the packet_set_addr().
- */
-static int ip_prepare_icmp(packet_t *packet, ip_header_t *header)
-{
-	packet_t *next;
+ * @returns		Other error codes as defined for the packet_set_addr().
+ */
+static int ip_prepare_icmp(packet_t packet, ip_header_ref header)
+{
+	packet_t next;
 	struct sockaddr *dest;
 	struct sockaddr_in dest_in;
@@ -187,5 +187,5 @@
 
 		// get header
-		header = (ip_header_t *) packet_get_data(packet);
+		header = (ip_header_ref) packet_get_data(packet);
 		if (!header)
 			return EINVAL;
@@ -227,12 +227,12 @@
  * @param[in] packet	The packet or the packet queue to be reported as faulty.
  * @param[in] header	The first packet IP header. May be NULL.
- * @return		The found ICMP phone.
- * @return		EINVAL if the error parameter is set.
- * @return		EINVAL if the ICMP phone is not found.
- * @return		EINVAL if the ip_prepare_icmp() fails.
+ * @returns		The found ICMP phone.
+ * @returns		EINVAL if the error parameter is set.
+ * @returns		EINVAL if the ICMP phone is not found.
+ * @returns		EINVAL if the ip_prepare_icmp() fails.
  */
 static int
-ip_prepare_icmp_and_get_phone(services_t error, packet_t *packet,
-    ip_header_t *header)
+ip_prepare_icmp_and_get_phone(services_t error, packet_t packet,
+    ip_header_ref header)
 {
 	int phone;
@@ -248,6 +248,6 @@
  * @param[in] client_connection The client connection processing function. The
  *			module skeleton propagates its own one.
- * @return		EOK on success.
- * @return		ENOMEM if there is not enough memory left.
+ * @returns		EOK on success.
+ * @returns		ENOMEM if there is not enough memory left.
  */
 int ip_initialize(async_client_conn_t client_connection)
@@ -293,20 +293,20 @@
  *
  * @param[in,out] ip_netif Network interface specific data.
- * @return		EOK on success.
- * @return		ENOTSUP if DHCP is configured.
- * @return		ENOTSUP if IPv6 is configured.
- * @return		EINVAL if any of the addresses is invalid.
- * @return		EINVAL if the used ARP module is not known.
- * @return		ENOMEM if there is not enough memory left.
- * @return		Other error codes as defined for the
+ * @returns		EOK on success.
+ * @returns		ENOTSUP if DHCP is configured.
+ * @returns		ENOTSUP if IPv6 is configured.
+ * @returns		EINVAL if any of the addresses is invalid.
+ * @returns		EINVAL if the used ARP module is not known.
+ * @returns		ENOMEM if there is not enough memory left.
+ * @returns		Other error codes as defined for the
  *			net_get_device_conf_req() function.
- * @return		Other error codes as defined for the bind_service()
+ * @returns		Other error codes as defined for the bind_service()
  *			function.
- * @return		Other error codes as defined for the specific
+ * @returns		Other error codes as defined for the specific
  *			arp_device_req() function.
- * @return		Other error codes as defined for the
+ * @returns		Other error codes as defined for the
  *			nil_packet_size_req() function.
  */
-static int ip_netif_initialize(ip_netif_t *ip_netif)
+static int ip_netif_initialize(ip_netif_ref ip_netif)
 {
 	measured_string_t names[] = {
@@ -344,9 +344,9 @@
 		}
 	};
-	measured_string_t *configuration;
+	measured_string_ref configuration;
 	size_t count = sizeof(names) / sizeof(measured_string_t);
 	char *data;
 	measured_string_t address;
-	ip_route_t *route;
+	ip_route_ref route;
 	in_addr_t gateway;
 	int index;
@@ -378,5 +378,5 @@
 			return ENOTSUP;
 		} else if (ip_netif->ipv == IPV4) {
-			route = (ip_route_t *) malloc(sizeof(ip_route_t));
+			route = (ip_route_ref) malloc(sizeof(ip_route_t));
 			if (!route) {
 				net_free_settings(configuration, data);
@@ -486,10 +486,10 @@
  * @param[in] device_id	The device identifier.
  * @param[in] mtu	The new mtu value.
- * @return		EOK on success.
- * @return		ENOENT if device is not found.
+ * @returns		EOK on success.
+ * @returns		ENOENT if device is not found.
  */
 static int ip_mtu_changed_message(device_id_t device_id, size_t mtu)
 {
-	ip_netif_t *netif;
+	ip_netif_ref netif;
 
 	fibril_rwlock_write_lock(&ip_globals.netifs_lock);
@@ -511,10 +511,10 @@
  * @param[in] device_id	The device identifier.
  * @param[in] state	The new state value.
- * @return		EOK on success.
- * @return		ENOENT if device is not found.
+ * @returns		EOK on success.
+ * @returns		ENOENT if device is not found.
  */
 static int ip_device_state_message(device_id_t device_id, device_state_t state)
 {
-	ip_netif_t *netif;
+	ip_netif_ref netif;
 
 	fibril_rwlock_write_lock(&ip_globals.netifs_lock);
@@ -539,13 +539,13 @@
  * @param[in] packet	The packet to be prefixed.
  * @param[in] last	The last header to be copied.
- * @return		The prefixed middle header.
- * @return		NULL on error.
- */
-static ip_header_t *
-ip_create_middle_header(packet_t *packet, ip_header_t *last)
-{
-	ip_header_t *middle;
-
-	middle = (ip_header_t *) packet_suffix(packet, IP_HEADER_LENGTH(last));
+ * @returns		The prefixed middle header.
+ * @returns		NULL on error.
+ */
+static ip_header_ref
+ip_create_middle_header(packet_t packet, ip_header_ref last)
+{
+	ip_header_ref middle;
+
+	middle = (ip_header_ref) packet_suffix(packet, IP_HEADER_LENGTH(last));
 	if (!middle)
 		return NULL;
@@ -562,7 +562,7 @@
  * @param[in] first	The original header to be copied.
  */
-static void ip_create_last_header(ip_header_t *last, ip_header_t *first)
-{
-	ip_option_t *option;
+static void ip_create_last_header(ip_header_ref last, ip_header_ref first)
+{
+	ip_option_ref option;
 	size_t next;
 	size_t length;
@@ -575,5 +575,5 @@
 	// process all ip options
 	while (next < first->header_length) {
-		option = (ip_option_t *) (((uint8_t *) first) + next);
+		option = (ip_option_ref) (((uint8_t *) first) + next);
 		// skip end or noop
 		if ((option->type == IPOPT_END) ||
@@ -613,21 +613,21 @@
  * @param[in,out] packet The packet to be sent.
  * @param[in] destination The destination hardware address.
- * @return		EOK on success.
- * @return		EINVAL if the packet is too small to contain the IP
+ * @returns		EOK on success.
+ * @returns		EINVAL if the packet is too small to contain the IP
  *			header.
- * @return		EINVAL if the packet is too long than the IP allows.
- * @return		ENOMEM if there is not enough memory left.
- * @return		Other error codes as defined for the packet_set_addr()
+ * @returns		EINVAL if the packet is too long than the IP allows.
+ * @returns		ENOMEM if there is not enough memory left.
+ * @returns		Other error codes as defined for the packet_set_addr()
  *			function.
  */
 static int
-ip_prepare_packet(in_addr_t *source, in_addr_t dest, packet_t *packet,
-    measured_string_t *destination)
+ip_prepare_packet(in_addr_t *source, in_addr_t dest, packet_t packet,
+    measured_string_ref destination)
 {
 	size_t length;
-	ip_header_t *header;
-	ip_header_t *last_header;
-	ip_header_t *middle_header;
-	packet_t *next;
+	ip_header_ref header;
+	ip_header_ref last_header;
+	ip_header_ref middle_header;
+	packet_t next;
 	int rc;
 
@@ -636,5 +636,5 @@
 		return EINVAL;
 
-	header = (ip_header_t *) packet_get_data(packet);
+	header = (ip_header_ref) packet_get_data(packet);
 	if (destination) {
 		rc = packet_set_addr(packet, NULL, (uint8_t *) destination->value,
@@ -660,5 +660,5 @@
 
 	if (pq_next(packet)) {
-		last_header = (ip_header_t *) malloc(IP_HEADER_LENGTH(header));
+		last_header = (ip_header_ref) malloc(IP_HEADER_LENGTH(header));
 		if (!last_header)
 			return ENOMEM;
@@ -666,5 +666,5 @@
 		next = pq_next(packet);
 		while (pq_next(next)) {
-			middle_header = (ip_header_t *) packet_prefix(next,
+			middle_header = (ip_header_ref) packet_prefix(next,
 			    IP_HEADER_LENGTH(last_header));
 			if (!middle_header) {
@@ -698,5 +698,5 @@
 		}
 
-		middle_header = (ip_header_t *) packet_prefix(next,
+		middle_header = (ip_header_ref) packet_prefix(next,
 		    IP_HEADER_LENGTH(last_header));
 		if (!middle_header) {
@@ -746,14 +746,14 @@
  * @param[in] dest	The destiantion address.
  * @param[in] addrlen	The address length.
- * @return		EOK on success.
- * @return		ENOMEM if the target packet is too small.
- * @return		Other error codes as defined for the packet_set_addr()
+ * @returns		EOK on success.
+ * @returns		ENOMEM if the target packet is too small.
+ * @returns		Other error codes as defined for the packet_set_addr()
  *			function.
- * @return		Other error codes as defined for the pq_insert_after()
+ * @returns		Other error codes as defined for the pq_insert_after()
  *			function.
  */
 static int
-ip_fragment_packet_data(packet_t *packet, packet_t *new_packet,
-    ip_header_t *header, ip_header_t *new_header, size_t length,
+ip_fragment_packet_data(packet_t packet, packet_t new_packet,
+    ip_header_ref header, ip_header_ref new_header, size_t length,
     const struct sockaddr *src, const struct sockaddr *dest, socklen_t addrlen)
 {
@@ -799,28 +799,28 @@
  * @param[in] suffix	The minimum suffix size.
  * @param[in] addr_len	The minimum address length.
- * @return		EOK on success.
- * @return		EINVAL if the packet_get_addr() function fails.
- * @return		EINVAL if the packet does not contain the IP header.
- * @return		EPERM if the packet needs to be fragmented and the
+ * @returns		EOK on success.
+ * @returns		EINVAL if the packet_get_addr() function fails.
+ * @returns		EINVAL if the packet does not contain the IP header.
+ * @returns		EPERM if the packet needs to be fragmented and the
  *			fragmentation is not allowed.
- * @return		ENOMEM if there is not enough memory left.
- * @return		ENOMEM if there is no packet available.
- * @return		ENOMEM if the packet is too small to contain the IP
+ * @returns		ENOMEM if there is not enough memory left.
+ * @returns		ENOMEM if there is no packet available.
+ * @returns		ENOMEM if the packet is too small to contain the IP
  *			header.
- * @return		Other error codes as defined for the packet_trim()
+ * @returns		Other error codes as defined for the packet_trim()
  *			function.
- * @return		Other error codes as defined for the
+ * @returns		Other error codes as defined for the
  *			ip_create_middle_header() function.
- * @return		Other error codes as defined for the
+ * @returns		Other error codes as defined for the
  *			ip_fragment_packet_data() function.
  */
 static int
-ip_fragment_packet(packet_t *packet, size_t length, size_t prefix, size_t suffix,
+ip_fragment_packet(packet_t packet, size_t length, size_t prefix, size_t suffix,
     socklen_t addr_len)
 {
-	packet_t *new_packet;
-	ip_header_t *header;
-	ip_header_t *middle_header;
-	ip_header_t *last_header;
+	packet_t new_packet;
+	ip_header_ref header;
+	ip_header_ref middle_header;
+	ip_header_ref last_header;
 	struct sockaddr *src;
 	struct sockaddr *dest;
@@ -838,5 +838,5 @@
 
 	// get header
-	header = (ip_header_t *) packet_get_data(packet);
+	header = (ip_header_ref) packet_get_data(packet);
 	if (!header)
 		return EINVAL;
@@ -853,5 +853,5 @@
 
 	// allocate as much as originally
-	last_header = (ip_header_t *) packet_suffix(new_packet,
+	last_header = (ip_header_ref) packet_suffix(new_packet,
 	    IP_HEADER_LENGTH(header));
 	if (!last_header)
@@ -919,14 +919,14 @@
  * @param[in] addr_len	The minimum address length.
  * @param[in] error	The error module service.
- * @return		The packet or the packet queue of the allowed length.
- * @return		NULL if there are no packets left.
- */
-static packet_t *
-ip_split_packet(packet_t *packet, size_t prefix, size_t content, size_t suffix,
+ * @returns		The packet or the packet queue of the allowed length.
+ * @returns		NULL if there are no packets left.
+ */
+static packet_t
+ip_split_packet(packet_t packet, size_t prefix, size_t content, size_t suffix,
     socklen_t addr_len, services_t error)
 {
 	size_t length;
-	packet_t *next;
-	packet_t *new_packet;
+	packet_t next;
+	packet_t new_packet;
 	int result;
 	int phone;
@@ -986,16 +986,16 @@
  * @param[in] dest	The destination address.
  * @param[in] error	The error module service.
- * @return		EOK on success.
- * @return		Other error codes as defined for the arp_translate_req()
+ * @returns		EOK on success.
+ * @returns		Other error codes as defined for the arp_translate_req()
  *			function.
- * @return		Other error codes as defined for the ip_prepare_packet()
+ * @returns		Other error codes as defined for the ip_prepare_packet()
  *			function.
  */
 static int
-ip_send_route(packet_t *packet, ip_netif_t *netif, ip_route_t *route,
+ip_send_route(packet_t packet, ip_netif_ref netif, ip_route_ref route,
     in_addr_t *src, in_addr_t dest, services_t error)
 {
 	measured_string_t destination;
-	measured_string_t *translation;
+	measured_string_ref translation;
 	char *data;
 	int phone;
@@ -1062,12 +1062,12 @@
  *			NULL.
  * @param[in] destination The destination address.
- * @return		The found route.
- * @return		NULL if no route was found.
- */
-static ip_route_t *
-ip_netif_find_route(ip_netif_t *netif, in_addr_t destination)
+ * @returns		The found route.
+ * @returns		NULL if no route was found.
+ */
+static ip_route_ref
+ip_netif_find_route(ip_netif_ref netif, in_addr_t destination)
 {
 	int index;
-	ip_route_t *route;
+	ip_route_ref route;
 
 	if (!netif)
@@ -1090,11 +1090,11 @@
  *
  * @param[in] destination The destination address.
- * @return		The found route.
- * @return		NULL if no route was found.
- */
-static ip_route_t *ip_find_route(in_addr_t destination) {
+ * @returns		The found route.
+ * @returns		NULL if no route was found.
+ */
+static ip_route_ref ip_find_route(in_addr_t destination) {
 	int index;
-	ip_route_t *route;
-	ip_netif_t *netif;
+	ip_route_ref route;
+	ip_netif_ref netif;
 
 	// start with the last netif - the newest one
@@ -1116,10 +1116,10 @@
  *
  * @param[in] netif	The network interface.
- * @return		The IP address.
- * @return		NULL if no IP address was found.
- */
-static in_addr_t *ip_netif_address(ip_netif_t *netif)
-{
-	ip_route_t *route;
+ * @returns		The IP address.
+ * @returns		NULL if no IP address was found.
+ */
+static in_addr_t *ip_netif_address(ip_netif_ref netif)
+{
+	ip_route_ref route;
 
 	route = ip_routes_get_index(&netif->routes, 0);
@@ -1136,10 +1136,10 @@
  * @param[in] phone	The transport layer module phone.
  * @param[in] received_msg The receiving function.
- * @return		EOK on success.
- * @return		EINVAL if the protocol parameter and/or the service
+ * @returns		EOK on success.
+ * @returns		EINVAL if the protocol parameter and/or the service
  *			parameter is zero.
- * @return		EINVAL if the phone parameter is not a positive number
+ * @returns		EINVAL if the phone parameter is not a positive number
  *			and the tl_receive_msg is NULL.
- * @return		ENOMEM if there is not enough memory left.
+ * @returns		ENOMEM if there is not enough memory left.
  */
 static int
@@ -1147,5 +1147,5 @@
     tl_received_msg_t received_msg)
 {
-	ip_proto_t *proto;
+	ip_proto_ref proto;
 	int index;
 
@@ -1153,5 +1153,5 @@
 		return EINVAL;
 
-	proto = (ip_proto_t *) malloc(sizeof(ip_protos_t));
+	proto = (ip_proto_ref) malloc(sizeof(ip_protos_t));
 	if (!proto)
 		return ENOMEM;
@@ -1180,10 +1180,10 @@
 ip_device_req_local(int il_phone, device_id_t device_id, services_t netif)
 {
-	ip_netif_t *ip_netif;
-	ip_route_t *route;
+	ip_netif_ref ip_netif;
+	ip_route_ref route;
 	int index;
 	int rc;
 
-	ip_netif = (ip_netif_t *) malloc(sizeof(ip_netif_t));
+	ip_netif = (ip_netif_ref) malloc(sizeof(ip_netif_t));
 	if (!ip_netif)
 		return ENOMEM;
@@ -1247,10 +1247,10 @@
 
 static int
-ip_send_msg_local(int il_phone, device_id_t device_id, packet_t *packet,
+ip_send_msg_local(int il_phone, device_id_t device_id, packet_t packet,
     services_t sender, services_t error)
 {
 	int addrlen;
-	ip_netif_t *netif;
-	ip_route_t *route;
+	ip_netif_ref netif;
+	ip_route_ref route;
 	struct sockaddr *addr;
 	struct sockaddr_in *address_in;
@@ -1361,5 +1361,5 @@
  * @param[out] content	The maximum content size.
  * @param[out] suffix	The minimum reserved suffix size.
- * @return		EOK on success.
+ * @returns		EOK on success.
  */
 static int
@@ -1367,5 +1367,5 @@
     size_t *content, size_t *suffix)
 {
-	ip_netif_t *netif;
+	ip_netif_ref netif;
 	int index;
 
@@ -1418,7 +1418,7 @@
  *
  * @param[in] header	The packet IP header to be read.
- * @return		The packet destination address.
- */
-static in_addr_t ip_get_destination(ip_header_t *header)
+ * @returns		The packet destination address.
+ */
+static in_addr_t ip_get_destination(ip_header_ref header)
 {
 	in_addr_t destination;
@@ -1439,20 +1439,20 @@
  * @param[in] header	The first packet IP header. May be NULL.
  * @param[in] error	The packet error service.
- * @return		EOK on success.
- * @return		ENOTSUP if the packet is a fragment.
- * @return		EAFNOSUPPORT if the address family is not supported.
- * @return		ENOENT if the target protocol is not found.
- * @return		Other error codes as defined for the packet_set_addr()
+ * @returns		EOK on success.
+ * @returns		ENOTSUP if the packet is a fragment.
+ * @returns		EAFNOSUPPORT if the address family is not supported.
+ * @returns		ENOENT if the target protocol is not found.
+ * @returns		Other error codes as defined for the packet_set_addr()
  *			function.
- * @return		Other error codes as defined for the packet_trim()
+ * @returns		Other error codes as defined for the packet_trim()
  *			function.
- * @return		Other error codes as defined for the protocol specific
+ * @returns		Other error codes as defined for the protocol specific
  *			tl_received_msg() function.
  */
 static int
-ip_deliver_local(device_id_t device_id, packet_t *packet, ip_header_t *header,
+ip_deliver_local(device_id_t device_id, packet_t packet, ip_header_ref header,
     services_t error)
 {
-	ip_proto_t *proto;
+	ip_proto_ref proto;
 	int phone;
 	services_t service;
@@ -1544,18 +1544,18 @@
  * @param[in] device_id	The source device identifier.
  * @param[in] packet	The received packet to be processed.
- * @return		EOK on success.
- * @return		EINVAL if the TTL is less than two.
- * @return		EINVAL if the checksum is invalid.
- * @return		EAFNOSUPPORT if the address family is not supported.
- * @return		ENOENT if no route was found.
- * @return		ENOENT if the packet is for another host and the routing
+ * @returns		EOK on success.
+ * @returns		EINVAL if the TTL is less than two.
+ * @returns		EINVAL if the checksum is invalid.
+ * @returns		EAFNOSUPPORT if the address family is not supported.
+ * @returns		ENOENT if no route was found.
+ * @returns		ENOENT if the packet is for another host and the routing
  *			is disabled.
  */
 static int
-ip_process_packet(device_id_t device_id, packet_t *packet)
-{
-	ip_header_t *header;
+ip_process_packet(device_id_t device_id, packet_t packet)
+{
+	ip_header_ref header;
 	in_addr_t dest;
-	ip_route_t *route;
+	ip_route_ref route;
 	int phone;
 	struct sockaddr *addr;
@@ -1564,5 +1564,5 @@
 	int rc;
 
-	header = (ip_header_t *) packet_get_data(packet);
+	header = (ip_header_ref) packet_get_data(packet);
 	if (!header)
 		return ip_release_and_return(packet, ENOMEM);
@@ -1647,6 +1647,6 @@
     in_addr_t netmask, in_addr_t gateway)
 {
-	ip_route_t *route;
-	ip_netif_t *netif;
+	ip_route_ref route;
+	ip_netif_ref netif;
 	int index;
 
@@ -1659,5 +1659,5 @@
 	}
 
-	route = (ip_route_t *) malloc(sizeof(ip_route_t));
+	route = (ip_route_ref) malloc(sizeof(ip_route_t));
 	if (!route) {
 		fibril_rwlock_write_unlock(&ip_globals.netifs_lock);
@@ -1681,5 +1681,5 @@
 ip_set_gateway_req_local(int ip_phone, device_id_t device_id, in_addr_t gateway)
 {
-	ip_netif_t *netif;
+	ip_netif_ref netif;
 
 	fibril_rwlock_write_lock(&ip_globals.netifs_lock);
@@ -1715,5 +1715,5 @@
 static int
 ip_received_error_msg_local(int ip_phone, device_id_t device_id,
-    packet_t *packet, services_t target, services_t error)
+    packet_t packet, services_t target, services_t error)
 {
 	uint8_t *data;
@@ -1721,8 +1721,8 @@
 	icmp_type_t type;
 	icmp_code_t code;
-	ip_netif_t *netif;
+	ip_netif_ref netif;
 	measured_string_t address;
-	ip_route_t *route;
-	ip_header_t *header;
+	ip_route_ref route;
+	ip_header_ref header;
 
 	switch (error) {
@@ -1734,5 +1734,5 @@
 
 		data = packet_get_data(packet);
-		header = (ip_header_t *)(data + offset);
+		header = (ip_header_ref)(data + offset);
 
 		// destination host unreachable?
@@ -1782,6 +1782,6 @@
 	in_addr_t *dest;
 	in_addr_t *src;
-	ip_route_t *route;
-	ipv4_pseudo_header_t *header_in;
+	ip_route_ref route;
+	ipv4_pseudo_header_ref header_in;
 
 	if (!destination || (addrlen <= 0))
@@ -1829,5 +1829,5 @@
 
 	*headerlen = sizeof(*header_in);
-	header_in = (ipv4_pseudo_header_t *) malloc(*headerlen);
+	header_in = (ipv4_pseudo_header_ref) malloc(*headerlen);
 	if (!header_in)
 		return ENOMEM;
@@ -1849,17 +1849,17 @@
  * @param[in] device_id	The source device identifier.
  * @param[in,out] packet The received packet.
- * @return		EOK on success and the packet is no longer needed.
- * @return		EINVAL if the packet is too small to carry the IP
+ * @returns		EOK on success and the packet is no longer needed.
+ * @returns		EINVAL if the packet is too small to carry the IP
  *			packet.
- * @return		EINVAL if the received address lengths differs from the
+ * @returns		EINVAL if the received address lengths differs from the
  *			registered values.
- * @return		ENOENT if the device is not found in the cache.
- * @return		ENOENT if the protocol for the device is not found in
+ * @returns		ENOENT if the device is not found in the cache.
+ * @returns		ENOENT if the protocol for the device is not found in
  *			the cache.
- * @return		ENOMEM if there is not enough memory left.
- */
-static int ip_receive_message(device_id_t device_id, packet_t *packet)
-{
-	packet_t *next;
+ * @returns		ENOMEM if there is not enough memory left.
+ */
+static int ip_receive_message(device_id_t device_id, packet_t packet)
+{
+	packet_t next;
 
 	do {
@@ -1879,6 +1879,6 @@
  * @param[out] answer_count The last parameter for the actual answer in the
  *			answer parameter.
- * @return		EOK on success.
- * @return		ENOTSUP if the message is not known.
+ * @returns		EOK on success.
+ * @returns		ENOTSUP if the message is not known.
  *
  * @see ip_interface.h
@@ -1890,5 +1890,5 @@
     int *answer_count)
 {
-	packet_t *packet;
+	packet_t packet;
 	struct sockaddr *addr;
 	size_t addrlen;
@@ -2037,6 +2037,6 @@
 /** Starts the module.
  *
- * @return EOK on success.
- * @return Other error codes as defined for each specific module start function.
+ * @returns EOK on success.
+ * @returns Other error codes as defined for each specific module start function.
  */
 int main(int argc, char *argv[])
Index: uspace/srv/net/il/ip/ip.h
===================================================================
--- uspace/srv/net/il/ip/ip.h	(revision 32eceb4ff0c0ddeba47997beaa5d0677aee84d3a)
+++ uspace/srv/net/il/ip/ip.h	(revision 1b22bd45ebc7f42217757e90fa6e5b57f6ed5d1d)
@@ -59,4 +59,9 @@
 typedef struct ip_netif ip_netif_t;
 
+/** Type definition of the IP network interface specific data pointer.
+ * @see ip_netif
+ */
+typedef ip_netif_t *ip_netif_ref;
+
 /** Type definition of the IP protocol specific data.
  * @see ip_proto
@@ -64,8 +69,18 @@
 typedef struct ip_proto ip_proto_t;
 
+/** Type definition of the IP protocol specific data pointer.
+ * @see ip_proto
+ */
+typedef ip_proto_t *ip_proto_ref;
+
 /** Type definition of the IP route specific data.
  *  @see ip_route
  */
 typedef struct ip_route	ip_route_t;
+
+/** Type definition of the IP route specific data pointer.
+ *  @see ip_route
+ */
+typedef ip_route_t *ip_route_ref;
 
 /** IP network interfaces.
@@ -89,5 +104,5 @@
 struct ip_netif {
 	/** ARP module. Assigned if using ARP. */
-	module_t *arp;
+	module_ref arp;
 	/** Broadcast address. */
 	in_addr_t broadcast;
@@ -131,5 +146,5 @@
 	in_addr_t gateway;
 	/** Parent netif. */
-	ip_netif_t *netif;
+	ip_netif_ref netif;
 	/** Target network mask. */
 	in_addr_t netmask;
Index: uspace/srv/net/net/net.c
===================================================================
--- uspace/srv/net/net/net.c	(revision 32eceb4ff0c0ddeba47997beaa5d0677aee84d3a)
+++ uspace/srv/net/net/net.c	(revision 1b22bd45ebc7f42217757e90fa6e5b57f6ed5d1d)
@@ -78,6 +78,4 @@
 DEVICE_MAP_IMPLEMENT(netifs, netif_t);
 
-static int startup(void);
-
 /** Add the configured setting to the configuration map.
  *
@@ -86,14 +84,14 @@
  * @param[in] value         The setting value.
  *
- * @return EOK on success.
- * @return ENOMEM if there is not enough memory left.
- *
- */
-int add_configuration(measured_strings_t *configuration, const char *name,
+ * @returns EOK on success.
+ * @returns ENOMEM if there is not enough memory left.
+ *
+ */
+int add_configuration(measured_strings_ref configuration, const char *name,
     const char *value)
 {
 	int rc;
 	
-	measured_string_t *setting =
+	measured_string_ref setting =
 	    measured_string_create_bulk(value, 0);
 	if (!setting)
@@ -112,5 +110,5 @@
 /** Generate new system-unique device identifier.
  *
- * @return		The system-unique devic identifier.
+ * @returns		The system-unique devic identifier.
  */
 static device_id_t generate_new_device_id(void)
@@ -119,5 +117,5 @@
 }
 
-static int parse_line(measured_strings_t *configuration, char *line)
+static int parse_line(measured_strings_ref configuration, char *line)
 {
 	int rc;
@@ -165,5 +163,5 @@
 	
 	/* Create a bulk measured string till the end */
-	measured_string_t *setting =
+	measured_string_ref setting =
 	    measured_string_create_bulk(value, 0);
 	if (!setting)
@@ -181,5 +179,5 @@
 
 static int read_configuration_file(const char *directory, const char *filename,
-    measured_strings_t *configuration)
+    measured_strings_ref configuration)
 {
 	printf("%s: Reading configuration file %s/%s\n", NAME, directory, filename);
@@ -237,6 +235,6 @@
  * @param[in,out] netif The network interface structure.
  *
- * @return EOK on success.
- * @return Other error codes as defined for the add_configuration() function.
+ * @returns EOK on success.
+ * @returns Other error codes as defined for the add_configuration() function.
  *
  */
@@ -248,6 +246,6 @@
 /** Read the networking subsystem global configuration.
  *
- * @return EOK on success.
- * @return Other error codes as defined for the add_configuration() function.
+ * @returns EOK on success.
+ * @returns Other error codes as defined for the add_configuration() function.
  *
  */
@@ -264,6 +262,6 @@
  *                              its own one.
  *
- * @return EOK on success.
- * @return ENOMEM if there is not enough memory left.
+ * @returns EOK on success.
+ * @returns ENOMEM if there is not enough memory left.
  *
  */
@@ -315,7 +313,7 @@
  *                              its own one.
  *
- * @return EOK on successful module termination.
- * @return Other error codes as defined for the net_initialize() function.
- * @return Other error codes as defined for the REGISTER_ME() macro function.
+ * @returns EOK on successful module termination.
+ * @returns Other error codes as defined for the net_initialize() function.
+ * @returns Other error codes as defined for the REGISTER_ME() macro function.
  *
  */
@@ -339,9 +337,4 @@
 		goto out;
 	
-	rc = startup();
-	if (rc != EOK)
-		goto out;
-	
-	task_retval(0);
 	async_manager();
 
@@ -360,9 +353,9 @@
  * @param[out] data          The found configuration settings data.
  *
- * @return EOK.
- *
- */
-static int net_get_conf(measured_strings_t *netif_conf,
-    measured_string_t *configuration, size_t count, char **data)
+ * @returns EOK.
+ *
+ */
+static int net_get_conf(measured_strings_ref netif_conf,
+    measured_string_ref configuration, size_t count, char **data)
 {
 	if (data)
@@ -371,5 +364,5 @@
 	size_t index;
 	for (index = 0; index < count; index++) {
-		measured_string_t *setting =
+		measured_string_ref setting =
 		    measured_strings_find(netif_conf, configuration[index].value, 0);
 		if (!setting)
@@ -389,5 +382,5 @@
 }
 
-int net_get_conf_req(int net_phone, measured_string_t **configuration,
+int net_get_conf_req(int net_phone, measured_string_ref *configuration,
     size_t count, char **data)
 {
@@ -399,5 +392,5 @@
 
 int net_get_device_conf_req(int net_phone, device_id_t device_id,
-    measured_string_t **configuration, size_t count, char **data)
+    measured_string_ref *configuration, size_t count, char **data)
 {
 	if ((!configuration) || (count == 0))
@@ -411,5 +404,5 @@
 }
 
-void net_free_settings(measured_string_t *settings, char *data)
+void net_free_settings(measured_string_ref settings, char *data)
 {
 }
@@ -422,11 +415,11 @@
  * @param[in] netif The network interface specific data.
  *
- * @return EOK on success.
- * @return EINVAL if there are some settings missing.
- * @return ENOENT if the internet protocol module is not known.
- * @return Other error codes as defined for the netif_probe_req() function.
- * @return Other error codes as defined for the nil_device_req() function.
- * @return Other error codes as defined for the needed internet layer
- *         registering function.
+ * @returns EOK on success.
+ * @returns EINVAL if there are some settings missing.
+ * @returns ENOENT if the internet protocol module is not known.
+ * @returns Other error codes as defined for the netif_probe_req() function.
+ * @returns Other error codes as defined for the nil_device_req() function.
+ * @returns Other error codes as defined for the needed internet layer
+ *          registering function.
  *
  */
@@ -436,5 +429,5 @@
 	
 	/* Mandatory netif */
-	measured_string_t *setting =
+	measured_string_ref setting =
 	    measured_strings_find(&netif->configuration, CONF_NETIF, 0);
 	
@@ -514,13 +507,13 @@
 /** Read the configuration and start all network interfaces.
  *
- * @return EOK on success.
- * @return EXDEV if there is no available system-unique device identifier.
- * @return EINVAL if any of the network interface names are not configured.
- * @return ENOMEM if there is not enough memory left.
- * @return Other error codes as defined for the read_configuration()
- *         function.
- * @return Other error codes as defined for the read_netif_configuration()
- *         function.
- * @return Other error codes as defined for the start_device() function.
+ * @returns EOK on success.
+ * @returns EXDEV if there is no available system-unique device identifier.
+ * @returns EINVAL if any of the network interface names are not configured.
+ * @returns ENOMEM if there is not enough memory left.
+ * @returns Other error codes as defined for the read_configuration()
+ *          function.
+ * @returns Other error codes as defined for the read_netif_configuration()
+ *          function.
+ * @returns Other error codes as defined for the start_device() function.
  *
  */
@@ -557,5 +550,5 @@
 		
 		/* Mandatory name */
-		measured_string_t *setting =
+		measured_string_ref setting =
 		    measured_strings_find(&netif->configuration, CONF_NAME, 0);
 		if (!setting) {
@@ -617,6 +610,6 @@
  *                          in the answer parameter.
  *
- * @return EOK on success.
- * @return ENOTSUP if the message is not known.
+ * @returns EOK on success.
+ * @returns ENOTSUP if the message is not known.
  *
  * @see net_interface.h
@@ -627,5 +620,5 @@
     int *answer_count)
 {
-	measured_string_t *strings;
+	measured_string_ref strings;
 	char *data;
 	int rc;
Index: uspace/srv/net/net/net.h
===================================================================
--- uspace/srv/net/net/net.h	(revision 32eceb4ff0c0ddeba47997beaa5d0677aee84d3a)
+++ uspace/srv/net/net/net.h	(revision 1b22bd45ebc7f42217757e90fa6e5b57f6ed5d1d)
@@ -103,10 +103,10 @@
 	
 	/** Serving network interface driver module index. */
-	module_t *driver;
+	module_ref driver;
 	
-	device_id_t id;	/**< System-unique network interface identifier. */
-	module_t *il;	/**< Serving internet layer module index. */
-	char *name;	/**< System-unique network interface name. */
-	module_t *nil;	/**< Serving link layer module index. */
+	device_id_t id;  /**< System-unique network interface identifier. */
+	module_ref il;   /**< Serving internet layer module index. */
+	char *name;      /**< System-unique network interface name. */
+	module_ref nil;  /**< Serving link layer module index. */
 } netif_t;
 
@@ -133,5 +133,5 @@
 } net_globals_t;
 
-extern int add_configuration(measured_strings_t *, const char *, const char *);
+extern int add_configuration(measured_strings_ref, const char *, const char *);
 extern int net_module_message(ipc_callid_t, ipc_call_t *, ipc_call_t *, int *);
 extern int net_initialize_build(async_client_conn_t);
Index: uspace/srv/net/netif/lo/lo.c
===================================================================
--- uspace/srv/net/netif/lo/lo.c	(revision 32eceb4ff0c0ddeba47997beaa5d0677aee84d3a)
+++ uspace/srv/net/netif/lo/lo.c	(revision 1b22bd45ebc7f42217757e90fa6e5b57f6ed5d1d)
@@ -70,5 +70,5 @@
 }
 
-int netif_get_addr_message(device_id_t device_id, measured_string_t *address)
+int netif_get_addr_message(device_id_t device_id, measured_string_ref address)
 {
 	if (!address)
@@ -81,5 +81,5 @@
 }
 
-int netif_get_device_stats(device_id_t device_id, device_stats_t *stats)
+int netif_get_device_stats(device_id_t device_id, device_stats_ref stats)
 {
 	netif_device_t *device;
@@ -93,5 +93,5 @@
 		return rc;
 
-	memcpy(stats, (device_stats_t *) device->specific,
+	memcpy(stats, (device_stats_ref) device->specific,
 	    sizeof(device_stats_t));
 
@@ -103,6 +103,6 @@
  * @param[in] device	The device structure.
  * @param[in] state	The new device state.
- * @return		The new state if changed.
- * @return		EOK otherwise.
+ * @returns		The new state if changed.
+ * @returns		EOK otherwise.
  */
 static int change_state_message(netif_device_t *device, device_state_t state)
@@ -124,7 +124,7 @@
  * @param[in] device_id	The new devce identifier.
  * @param[out] device	The device structure.
- * @return		EOK on success.
- * @return		EXDEV if one loopback network interface already exists.
- * @return		ENOMEM if there is not enough memory left.
+ * @returns		EOK on success.
+ * @returns		EXDEV if one loopback network interface already exists.
+ * @returns		ENOMEM if there is not enough memory left.
  */
 static int create(device_id_t device_id, netif_device_t **device)
@@ -145,5 +145,5 @@
 	}
 
-	null_device_stats((device_stats_t *) (*device)->specific);
+	null_device_stats((device_stats_ref) (*device)->specific);
 	(*device)->device_id = device_id;
 	(*device)->nil_phone = -1;
@@ -185,9 +185,9 @@
 }
 
-int netif_send_message(device_id_t device_id, packet_t *packet, services_t sender)
+int netif_send_message(device_id_t device_id, packet_t packet, services_t sender)
 {
 	netif_device_t *device;
 	size_t length;
-	packet_t *next;
+	packet_t next;
 	int phone;
 	int rc;
@@ -204,9 +204,9 @@
 	next = packet;
 	do {
-		((device_stats_t *) device->specific)->send_packets++;
-		((device_stats_t *) device->specific)->receive_packets++;
+		((device_stats_ref) device->specific)->send_packets++;
+		((device_stats_ref) device->specific)->receive_packets++;
 		length = packet_get_data_length(next);
-		((device_stats_t *) device->specific)->send_bytes += length;
-		((device_stats_t *) device->specific)->receive_bytes += length;
+		((device_stats_ref) device->specific)->send_bytes += length;
+		((device_stats_ref) device->specific)->receive_bytes += length;
 		next = pq_next(next);
 	} while(next);
Index: uspace/srv/net/nil/eth/eth.c
===================================================================
--- uspace/srv/net/nil/eth/eth.c	(revision 32eceb4ff0c0ddeba47997beaa5d0677aee84d3a)
+++ uspace/srv/net/nil/eth/eth.c	(revision 1b22bd45ebc7f42217757e90fa6e5b57f6ed5d1d)
@@ -156,4 +156,9 @@
 typedef enum eth_addr_type eth_addr_type_t;
 
+/** Type definition of the ethernet address type pointer.
+ * @see eth_addr_type
+ */
+typedef eth_addr_type_t *eth_addr_type_ref;
+
 /** Ethernet address type. */
 enum eth_addr_type {
@@ -173,5 +178,5 @@
 {
 	int index;
-	eth_proto_t *proto;
+	eth_proto_ref proto;
 
 	fibril_rwlock_read_lock(&eth_globals.protos_lock);
@@ -234,5 +239,5 @@
 static void eth_receiver(ipc_callid_t iid, ipc_call_t *icall)
 {
-	packet_t *packet;
+	packet_t packet;
 	int rc;
 
@@ -268,12 +273,12 @@
  * @param[in] service	The device driver service.
  * @param[in] mtu	The device maximum transmission unit.
- * @return		EOK on success.
- * @return		EEXIST if the device with the different service exists.
- * @return		ENOMEM if there is not enough memory left.
- * @return		Other error codes as defined for the
+ * @returns		EOK on success.
+ * @returns		EEXIST if the device with the different service exists.
+ * @returns		ENOMEM if there is not enough memory left.
+ * @returns		Other error codes as defined for the
  *			net_get_device_conf_req() function.
- * @return		Other error codes as defined for the
+ * @returns		Other error codes as defined for the
  *			netif_bind_service() function.
- * @return		Other error codes as defined for the
+ * @returns		Other error codes as defined for the
  *			netif_get_addr_req() function.
  */
@@ -281,5 +286,5 @@
     size_t mtu)
 {
-	eth_device_t *device;
+	eth_device_ref device;
 	int index;
 	measured_string_t names[2] = {
@@ -293,8 +298,8 @@
 		}
 	};
-	measured_string_t *configuration;
+	measured_string_ref configuration;
 	size_t count = sizeof(names) / sizeof(measured_string_t);
 	char *data;
-	eth_proto_t *proto;
+	eth_proto_ref proto;
 	int rc;
 
@@ -337,5 +342,5 @@
 	
 	/* Create a new device */
-	device = (eth_device_t *) malloc(sizeof(eth_device_t));
+	device = (eth_device_ref) malloc(sizeof(eth_device_t));
 	if (!device)
 		return ENOMEM;
@@ -422,19 +427,19 @@
  * @param[in] flags	The device flags.
  * @param[in] packet	The packet.
- * @return		The target registered module.
- * @return		NULL if the packet is not long enough.
- * @return		NULL if the packet is too long.
- * @return		NULL if the raw ethernet protocol is used.
- * @return		NULL if the dummy device FCS checksum is invalid.
- * @return		NULL if the packet address length is not big enough.
- */
-static eth_proto_t *eth_process_packet(int flags, packet_t *packet)
-{
-	eth_header_snap_t *header;
+ * @returns		The target registered module.
+ * @returns		NULL if the packet is not long enough.
+ * @returns		NULL if the packet is too long.
+ * @returns		NULL if the raw ethernet protocol is used.
+ * @returns		NULL if the dummy device FCS checksum is invalid.
+ * @returns		NULL if the packet address length is not big enough.
+ */
+static eth_proto_ref eth_process_packet(int flags, packet_t packet)
+{
+	eth_header_snap_ref header;
 	size_t length;
 	eth_type_t type;
 	size_t prefix;
 	size_t suffix;
-	eth_fcs_t *fcs;
+	eth_fcs_ref fcs;
 	uint8_t *data;
 	int rc;
@@ -449,5 +454,5 @@
 	
 	data = packet_get_data(packet);
-	header = (eth_header_snap_t *) data;
+	header = (eth_header_snap_ref) data;
 	type = ntohs(header->header.ethertype);
 	
@@ -456,5 +461,5 @@
 		prefix = sizeof(eth_header_t);
 		suffix = 0;
-		fcs = (eth_fcs_t *) data + length - sizeof(eth_fcs_t);
+		fcs = (eth_fcs_ref) data + length - sizeof(eth_fcs_t);
 		length -= sizeof(eth_fcs_t);
 	} else if(type <= ETH_MAX_CONTENT) {
@@ -482,5 +487,5 @@
 
 		suffix = (type < ETH_MIN_CONTENT) ? ETH_MIN_CONTENT - type : 0U;
-		fcs = (eth_fcs_t *) data + prefix + type + suffix;
+		fcs = (eth_fcs_ref) data + prefix + type + suffix;
 		suffix += length - prefix - type;
 		length = prefix + type + suffix;
@@ -509,9 +514,9 @@
 
 int nil_received_msg_local(int nil_phone, device_id_t device_id,
-    packet_t *packet, services_t target)
-{
-	eth_proto_t *proto;
-	packet_t *next;
-	eth_device_t *device;
+    packet_t packet, services_t target)
+{
+	eth_proto_ref proto;
+	packet_t next;
+	eth_device_ref device;
 	int flags;
 
@@ -552,12 +557,12 @@
  * @param[out] content	The maximum content size.
  * @param[out] suffix	The minimum reserved suffix size.
- * @return		EOK on success.
- * @return		EBADMEM if either one of the parameters is NULL.
- * @return		ENOENT if there is no such device.
+ * @returns		EOK on success.
+ * @returns		EBADMEM if either one of the parameters is NULL.
+ * @returns		ENOENT if there is no such device.
  */
 static int eth_packet_space_message(device_id_t device_id, size_t *addr_len,
     size_t *prefix, size_t *content, size_t *suffix)
 {
-	eth_device_t *device;
+	eth_device_ref device;
 
 	if (!addr_len || !prefix || !content || !suffix)
@@ -586,12 +591,12 @@
  * @param[in] type	Type of the desired address.
  * @param[out] address	The device hardware address.
- * @return		EOK on success.
- * @return		EBADMEM if the address parameter is NULL.
- * @return		ENOENT if there no such device.
+ * @returns		EOK on success.
+ * @returns		EBADMEM if the address parameter is NULL.
+ * @returns		ENOENT if there no such device.
  */
 static int eth_addr_message(device_id_t device_id, eth_addr_type_t type,
-    measured_string_t **address)
-{
-	eth_device_t *device;
+    measured_string_ref *address)
+{
+	eth_device_ref device;
 
 	if (!address)
@@ -620,11 +625,11 @@
  * @param[in] service	The module service.
  * @param[in] phone	The service phone.
- * @return		EOK on success.
- * @return		ENOENT if the service is not known.
- * @return		ENOMEM if there is not enough memory left.
+ * @returns		EOK on success.
+ * @returns		ENOENT if the service is not known.
+ * @returns		ENOMEM if there is not enough memory left.
  */
 static int eth_register_message(services_t service, int phone)
 {
-	eth_proto_t *proto;
+	eth_proto_ref proto;
 	int protocol;
 	int index;
@@ -641,5 +646,5 @@
 		return EOK;
 	} else {
-		proto = (eth_proto_t *) malloc(sizeof(eth_proto_t));
+		proto = (eth_proto_ref) malloc(sizeof(eth_proto_t));
 		if (!proto) {
 			fibril_rwlock_write_unlock(&eth_globals.protos_lock);
@@ -673,18 +678,18 @@
  * @param[in] ethertype	The ethernet protocol type.
  * @param[in] mtu	The device maximum transmission unit.
- * @return		EOK on success.
- * @return		EINVAL if the packet addresses length is not long
+ * @returns		EOK on success.
+ * @returns		EINVAL if the packet addresses length is not long
  *			enough.
- * @return		EINVAL if the packet is bigger than the device MTU.
- * @return		ENOMEM if there is not enough memory in the packet.
+ * @returns		EINVAL if the packet is bigger than the device MTU.
+ * @returns		ENOMEM if there is not enough memory in the packet.
  */
 static int
-eth_prepare_packet(int flags, packet_t *packet, uint8_t *src_addr, int ethertype,
+eth_prepare_packet(int flags, packet_t packet, uint8_t *src_addr, int ethertype,
     size_t mtu)
 {
-	eth_header_snap_t *header;
-	eth_header_lsap_t *header_lsap;
-	eth_header_t *header_dix;
-	eth_fcs_t *fcs;
+	eth_header_snap_ref header;
+	eth_header_lsap_ref header_lsap;
+	eth_header_ref header_dix;
+	eth_fcs_ref fcs;
 	uint8_t *src;
 	uint8_t *dest;
@@ -692,5 +697,5 @@
 	int i;
 	void *padding;
-	eth_preamble_t *preamble;
+	eth_preamble_ref preamble;
 
 	i = packet_get_addr(packet, &src, &dest);
@@ -783,14 +788,14 @@
  * @param[in] packet	The packet queue.
  * @param[in] sender	The sending module service.
- * @return		EOK on success.
- * @return		ENOENT if there no such device.
- * @return		EINVAL if the service parameter is not known.
- */
-static int eth_send_message(device_id_t device_id, packet_t *packet,
+ * @returns		EOK on success.
+ * @returns		ENOENT if there no such device.
+ * @returns		EINVAL if the service parameter is not known.
+ */
+static int eth_send_message(device_id_t device_id, packet_t packet,
     services_t sender)
 {
-	eth_device_t *device;
-	packet_t *next;
-	packet_t *tmp;
+	eth_device_ref device;
+	packet_t next;
+	packet_t tmp;
 	int ethertype;
 	int rc;
@@ -840,6 +845,6 @@
     ipc_call_t *call, ipc_call_t *answer, int *answer_count)
 {
-	measured_string_t *address;
-	packet_t *packet;
+	measured_string_ref address;
+	packet_t packet;
 	size_t addrlen;
 	size_t prefix;
Index: uspace/srv/net/nil/eth/eth.h
===================================================================
--- uspace/srv/net/nil/eth/eth.h	(revision 32eceb4ff0c0ddeba47997beaa5d0677aee84d3a)
+++ uspace/srv/net/nil/eth/eth.h	(revision 1b22bd45ebc7f42217757e90fa6e5b57f6ed5d1d)
@@ -54,8 +54,18 @@
 typedef struct eth_device eth_device_t;
 
+/** Type definition of the Ethernet device specific data pointer.
+ * @see eth_device
+ */
+typedef eth_device_t *eth_device_ref;
+
 /** Type definition of the Ethernet protocol specific data.
  * @see eth_proto
  */
 typedef struct eth_proto eth_proto_t;
+
+/** Type definition of the Ethernet protocol specific data pointer.
+ * @see eth_proto
+ */
+typedef eth_proto_t *eth_proto_ref;
 
 /** Ethernet device map.
@@ -90,5 +100,5 @@
 	
 	/** Actual device hardware address. */
-	measured_string_t *addr;
+	measured_string_ref addr;
 	/** Actual device hardware address data. */
 	char *addr_data;
@@ -123,5 +133,5 @@
 	
 	/** Broadcast device hardware address. */
-	measured_string_t *broadcast_addr;
+	measured_string_ref broadcast_addr;
 };
 
Index: uspace/srv/net/nil/eth/eth_header.h
===================================================================
--- uspace/srv/net/nil/eth/eth_header.h	(revision 32eceb4ff0c0ddeba47997beaa5d0677aee84d3a)
+++ uspace/srv/net/nil/eth/eth_header.h	(revision 1b22bd45ebc7f42217757e90fa6e5b57f6ed5d1d)
@@ -58,4 +58,11 @@
 typedef struct eth_header_snap eth_header_snap_t;
 
+/** Type definition of the Ethernet header IEEE 802.3 + 802.2 + SNAP extensions
+ * pointer.
+ *
+ * @see eth_header_snap
+ */
+typedef eth_header_snap_t *eth_header_snap_ref;
+
 /** Type definition of the Ethernet header IEEE 802.3 + 802.2 + SNAP extensions.
  * @see eth_header_lsap
@@ -63,4 +70,9 @@
 typedef struct eth_header_lsap eth_header_lsap_t;
 
+/** Type definition of the Ethernet header IEEE 802.3 + 802.2 extension pointer.
+ * @see eth_header_lsap
+ */
+typedef eth_header_lsap_t *eth_header_lsap_ref;
+
 /** Type definition of the Ethernet header LSAP extension.
  * @see eth_ieee_lsap
@@ -68,4 +80,9 @@
 typedef struct eth_ieee_lsap eth_ieee_lsap_t;
 
+/** Type definition of the Ethernet header LSAP extension pointer.
+ * @see eth_ieee_lsap
+ */
+typedef eth_ieee_lsap_t *eth_ieee_lsap_ref;
+
 /** Type definition of the Ethernet header SNAP extension.
  * @see eth_snap
@@ -73,4 +90,9 @@
 typedef struct eth_snap eth_snap_t;
 
+/** Type definition of the Ethernet header SNAP extension pointer.
+ * @see eth_snap
+ */
+typedef eth_snap_t *eth_snap_ref;
+
 /** Type definition of the Ethernet header preamble.
  * @see preamble
@@ -78,8 +100,18 @@
 typedef struct eth_preamble eth_preamble_t;
 
+/** Type definition of the Ethernet header preamble pointer.
+ * @see eth_preamble
+ */
+typedef eth_preamble_t *eth_preamble_ref;
+
 /** Type definition of the Ethernet header.
  * @see eth_header
  */
 typedef struct eth_header eth_header_t;
+
+/** Type definition of the Ethernet header pointer.
+ * @see eth_header
+ */
+typedef eth_header_t *eth_header_ref;
 
 /** Ethernet header Link Service Access Point extension. */
@@ -187,4 +219,7 @@
 typedef uint32_t eth_fcs_t;
 
+/** Ethernet Frame Check Sequence pointer. */
+typedef eth_fcs_t *eth_fcs_ref;
+
 #endif
 
Index: uspace/srv/net/nil/nildummy/nildummy.c
===================================================================
--- uspace/srv/net/nil/nildummy/nildummy.c	(revision 32eceb4ff0c0ddeba47997beaa5d0677aee84d3a)
+++ uspace/srv/net/nil/nildummy/nildummy.c	(revision 1b22bd45ebc7f42217757e90fa6e5b57f6ed5d1d)
@@ -106,5 +106,5 @@
 static void nildummy_receiver(ipc_callid_t iid, ipc_call_t *icall)
 {
-	packet_t *packet;
+	packet_t packet;
 	int rc;
 
@@ -142,10 +142,10 @@
  * @param[in] service	The device driver service.
  * @param[in] mtu	The device maximum transmission unit.
- * @return		EOK on success.
- * @return		EEXIST if the device with the different service exists.
- * @return		ENOMEM if there is not enough memory left.
- * @return		Other error codes as defined for the
+ * @returns		EOK on success.
+ * @returns		EEXIST if the device with the different service exists.
+ * @returns		ENOMEM if there is not enough memory left.
+ * @returns		Other error codes as defined for the
  *			netif_bind_service() function.
- * @return		Other error codes as defined for the
+ * @returns		Other error codes as defined for the
  *			netif_get_addr_req() function.
  */
@@ -153,5 +153,5 @@
     size_t mtu)
 {
-	nildummy_device_t *device;
+	nildummy_device_ref device;
 	int index;
 	int rc;
@@ -192,5 +192,5 @@
 	
 	/* Create a new device */
-	device = (nildummy_device_t *) malloc(sizeof(nildummy_device_t));
+	device = (nildummy_device_ref) malloc(sizeof(nildummy_device_t));
 	if (!device)
 		return ENOMEM;
@@ -248,7 +248,7 @@
  */
 static int nildummy_addr_message(device_id_t device_id,
-    measured_string_t **address)
-{
-	nildummy_device_t *device;
+    measured_string_ref *address)
+{
+	nildummy_device_ref device;
 
 	if (!address)
@@ -282,5 +282,5 @@
     size_t *prefix, size_t *content, size_t *suffix)
 {
-	nildummy_device_t *device;
+	nildummy_device_ref device;
 
 	if (!addr_len || !prefix || !content || !suffix)
@@ -304,7 +304,7 @@
 
 int nil_received_msg_local(int nil_phone, device_id_t device_id,
-    packet_t *packet, services_t target)
-{
-	packet_t *next;
+    packet_t packet, services_t target)
+{
+	packet_t next;
 
 	fibril_rwlock_read_lock(&nildummy_globals.protos_lock);
@@ -354,8 +354,8 @@
  * @return		EINVAL if the service parameter is not known.
  */
-static int nildummy_send_message(device_id_t device_id, packet_t *packet,
+static int nildummy_send_message(device_id_t device_id, packet_t packet,
     services_t sender)
 {
-	nildummy_device_t *device;
+	nildummy_device_ref device;
 
 	fibril_rwlock_read_lock(&nildummy_globals.devices_lock);
@@ -377,6 +377,6 @@
     ipc_call_t *call, ipc_call_t *answer, int *answer_count)
 {
-	measured_string_t *address;
-	packet_t *packet;
+	measured_string_ref address;
+	packet_t packet;
 	size_t addrlen;
 	size_t prefix;
Index: uspace/srv/net/nil/nildummy/nildummy.h
===================================================================
--- uspace/srv/net/nil/nildummy/nildummy.h	(revision 32eceb4ff0c0ddeba47997beaa5d0677aee84d3a)
+++ uspace/srv/net/nil/nildummy/nildummy.h	(revision 1b22bd45ebc7f42217757e90fa6e5b57f6ed5d1d)
@@ -54,8 +54,18 @@
 typedef struct nildummy_device nildummy_device_t;
 
+/** Type definition of the dummy nil device specific data pointer.
+ * @see nildummy_device
+ */
+typedef nildummy_device_t *nildummy_device_ref;
+
 /** Type definition of the dummy nil protocol specific data.
  * @see nildummy_proto
  */
 typedef struct nildummy_proto nildummy_proto_t;
+
+/** Type definition of the dummy nil protocol specific data pointer.
+ * @see nildummy_proto
+ */
+typedef nildummy_proto_t *nildummy_proto_ref;
 
 /** Dummy nil device map.
@@ -76,5 +86,5 @@
 	size_t mtu;
 	/** Actual device hardware address. */
-	measured_string_t *addr;
+	measured_string_ref addr;
 	/** Actual device hardware address data. */
 	char *addr_data;
Index: uspace/srv/net/tl/icmp/icmp.c
===================================================================
--- uspace/srv/net/tl/icmp/icmp.c	(revision 32eceb4ff0c0ddeba47997beaa5d0677aee84d3a)
+++ uspace/srv/net/tl/icmp/icmp.c	(revision 1b22bd45ebc7f42217757e90fa6e5b57f6ed5d1d)
@@ -100,5 +100,5 @@
  * @param[in,out] header The ICMP datagram header.
  * @param[in] length	The total datagram length.
- * @return		The computed checksum.
+ * @returns		The computed checksum.
  */
 #define ICMP_CHECKSUM(header, length) \
@@ -112,5 +112,5 @@
  * @param[in] id	The message identifier.
  * @param[in] sequence	The message sequence number.
- * @return		The computed ICMP reply data key.
+ * @returns		The computed ICMP reply data key.
  */
 #define ICMP_GET_REPLY_KEY(id, sequence) \
@@ -128,7 +128,7 @@
  * @param[in] packet	The packet queue to be released.
  * @param[in] result	The result to be returned.
- * @return		The result parameter.
- */
-static int icmp_release_and_return(packet_t *packet, int result)
+ * @returns		The result parameter.
+ */
+static int icmp_release_and_return(packet_t packet, int result)
 {
 	pq_release_remote(icmp_globals.net_phone, packet_get_id(packet));
@@ -152,9 +152,9 @@
  * @param[in] dont_fragment The value indicating whether the datagram must not
  *			be fragmented. Is used as a MTU discovery.
- * @return		EOK on success.
- * @return		EPERM if the error message is not allowed.
- */
-static int icmp_send_packet(icmp_type_t type, icmp_code_t code, packet_t *packet,
-    icmp_header_t *header, services_t error, ip_ttl_t ttl, ip_tos_t tos,
+ * @returns		EOK on success.
+ * @returns		EPERM if the error message is not allowed.
+ */
+static int icmp_send_packet(icmp_type_t type, icmp_code_t code, packet_t packet,
+    icmp_header_ref header, services_t error, ip_ttl_t ttl, ip_tos_t tos,
     int dont_fragment)
 {
@@ -186,10 +186,10 @@
  *
  * @param[in,out] packet The original packet.
- * @return The prefixed ICMP header.
- * @return NULL on errors.
- */
-static icmp_header_t *icmp_prepare_packet(packet_t *packet)
-{
-	icmp_header_t *header;
+ * @returns The prefixed ICMP header.
+ * @returns NULL on errors.
+ */
+static icmp_header_ref icmp_prepare_packet(packet_t packet)
+{
+	icmp_header_ref header;
 	size_t header_length;
 	size_t total_length;
@@ -234,12 +234,12 @@
  * @param[in] addr	The target host address.
  * @param[in] addrlen	The torget host address length.
- * @return		ICMP_ECHO on success.
- * @return		ETIMEOUT if the reply has not arrived before the
+ * @returns		ICMP_ECHO on success.
+ * @returns		ETIMEOUT if the reply has not arrived before the
  *			timeout.
- * @return		ICMP type of the received error notification.
- * @return		EINVAL if the addrlen parameter is less or equal to
+ * @returns		ICMP type of the received error notification.
+ * @returns		EINVAL if the addrlen parameter is less or equal to
  *			zero.
- * @return		ENOMEM if there is not enough memory left.
- * @return		EPARTY if there was an internal error.
+ * @returns		ENOMEM if there is not enough memory left.
+ * @returns		EPARTY if there was an internal error.
  */
 static int icmp_echo(icmp_param_t id, icmp_param_t sequence, size_t size,
@@ -247,9 +247,9 @@
     const struct sockaddr * addr, socklen_t addrlen)
 {
-	icmp_header_t *header;
-	packet_t *packet;
+	icmp_header_ref header;
+	packet_t packet;
 	size_t length;
 	uint8_t *data;
-	icmp_reply_t *reply;
+	icmp_reply_ref reply;
 	int reply_key;
 	int index;
@@ -340,7 +340,7 @@
 
 static int icmp_destination_unreachable_msg_local(int icmp_phone,
-    icmp_code_t code, icmp_param_t mtu, packet_t *packet)
-{
-	icmp_header_t *header;
+    icmp_code_t code, icmp_param_t mtu, packet_t packet)
+{
+	icmp_header_ref header;
 
 	header = icmp_prepare_packet(packet);
@@ -355,7 +355,7 @@
 }
 
-static int icmp_source_quench_msg_local(int icmp_phone, packet_t *packet)
-{
-	icmp_header_t *header;
+static int icmp_source_quench_msg_local(int icmp_phone, packet_t packet)
+{
+	icmp_header_ref header;
 
 	header = icmp_prepare_packet(packet);
@@ -368,7 +368,7 @@
 
 static int icmp_time_exceeded_msg_local(int icmp_phone, icmp_code_t code,
-    packet_t *packet)
-{
-	icmp_header_t *header;
+    packet_t packet)
+{
+	icmp_header_ref header;
 
 	header = icmp_prepare_packet(packet);
@@ -381,7 +381,7 @@
 
 static int icmp_parameter_problem_msg_local(int icmp_phone, icmp_code_t code,
-    icmp_param_t pointer, packet_t *packet)
-{
-	icmp_header_t *header;
+    icmp_param_t pointer, packet_t packet)
+{
+	icmp_header_ref header;
 
 	header = icmp_prepare_packet(packet);
@@ -398,6 +398,6 @@
  * @param[in] client_connection The client connection processing function. The
  *			module skeleton propagates its own one.
- * @return		EOK on success.
- * @return		ENOMEM if there is not enough memory left.
+ * @returns		EOK on success.
+ * @returns		ENOMEM if there is not enough memory left.
  */
 int icmp_initialize(async_client_conn_t client_connection)
@@ -413,5 +413,5 @@
 		}
 	};
-	measured_string_t *configuration;
+	measured_string_ref configuration;
 	size_t count = sizeof(names) / sizeof(measured_string_t);
 	char *data;
@@ -479,9 +479,9 @@
  * @param[in] code	The received reply message code.
  */
-static void  icmp_process_echo_reply(packet_t *packet, icmp_header_t *header,
+static void  icmp_process_echo_reply(packet_t packet, icmp_header_ref header,
     icmp_type_t type, icmp_code_t code)
 {
 	int reply_key;
-	icmp_reply_t *reply;
+	icmp_reply_ref reply;
 
 	/* Compute the reply key */
@@ -507,16 +507,16 @@
  * @param[in] error	The packet error reporting service. Prefixes the
  *			received packet.
- * @return		EOK on success.
- * @return		EINVAL if the packet is not valid.
- * @return		EINVAL if the stored packet address is not the an_addr_t.
- * @return		EINVAL if the packet does not contain any data.
- * @return		NO_DATA if the packet content is shorter than the user
+ * @returns		EOK on success.
+ * @returns		EINVAL if the packet is not valid.
+ * @returns		EINVAL if the stored packet address is not the an_addr_t.
+ * @returns		EINVAL if the packet does not contain any data.
+ * @returns		NO_DATA if the packet content is shorter than the user
  *			datagram header.
- * @return		ENOMEM if there is not enough memory left.
- * @return		EADDRNOTAVAIL if the destination socket does not exist.
- * @return		Other error codes as defined for the
+ * @returns		ENOMEM if there is not enough memory left.
+ * @returns		EADDRNOTAVAIL if the destination socket does not exist.
+ * @returns		Other error codes as defined for the
  *			ip_client_process_packet() function.
  */
-static int icmp_process_packet(packet_t *packet, services_t error)
+static int icmp_process_packet(packet_t packet, services_t error)
 {
 	size_t length;
@@ -525,5 +525,5 @@
 	int result;
 	void *data;
-	icmp_header_t *header;
+	icmp_header_ref header;
 	icmp_type_t type;
 	icmp_code_t code;
@@ -567,5 +567,5 @@
 
 	/* Get ICMP header */
-	header = (icmp_header_t *) data;
+	header = (icmp_header_ref) data;
 
 	if (header->checksum) {
@@ -654,9 +654,9 @@
  * @param[in] error	The packet error reporting service. Prefixes the
  *			received packet.
- * @return		EOK on success.
- * @return		Other error codes as defined for the
+ * @returns		EOK on success.
+ * @returns		Other error codes as defined for the
  *			icmp_process_packet() function.
  */
-static int icmp_received_msg_local(device_id_t device_id, packet_t *packet,
+static int icmp_received_msg_local(device_id_t device_id, packet_t packet,
     services_t receiver, services_t error)
 {
@@ -673,15 +673,15 @@
  *
  * @param[in] call	The message parameters.
- * @return		EOK on success.
- * @return		ENOTSUP if the message is not known.
- * @return		Other error codes as defined for the packet_translate()
+ * @returns		EOK on success.
+ * @returns		ENOTSUP if the message is not known.
+ * @returns		Other error codes as defined for the packet_translate()
  *			function.
- * @return		Other error codes as defined for the
+ * @returns		Other error codes as defined for the
  *			icmp_destination_unreachable_msg_local() function.
- * @return		Other error codes as defined for the
+ * @returns		Other error codes as defined for the
  *			icmp_source_quench_msg_local() function.
- * @return		Other error codes as defined for the
+ * @returns		Other error codes as defined for the
  *			icmp_time_exceeded_msg_local() function.
- * @return		Other error codes as defined for the
+ * @returns		Other error codes as defined for the
  *			icmp_parameter_problem_msg_local() function.
  *
@@ -690,5 +690,5 @@
 static int icmp_process_message(ipc_call_t *call)
 {
-	packet_t *packet;
+	packet_t packet;
 	int rc;
 
@@ -731,9 +731,9 @@
  *
  * @param[in,out] echo_data The echo data to be bound.
- * @return		Index of the inserted echo data.
- * @return		EBADMEM if the echo_data parameter is NULL.
- * @return		ENOTCONN if no free identifier have been found.
- */
-static int icmp_bind_free_id(icmp_echo_t *echo_data)
+ * @returns		Index of the inserted echo data.
+ * @returns		EBADMEM if the echo_data parameter is NULL.
+ * @returns		ENOTCONN if no free identifier have been found.
+ */
+static int icmp_bind_free_id(icmp_echo_ref echo_data)
 {
 	icmp_param_t index;
@@ -778,5 +778,5 @@
  * @param[in] callid	The message identifier.
  * @param[in] call	The message parameters.
- * @return EOK.
+ * @returns EOK.
  *
  * @see icmp_interface.h
@@ -791,5 +791,5 @@
 	struct sockaddr *addr;
 	ipc_callid_t data_callid;
-	icmp_echo_t *echo_data;
+	icmp_echo_ref echo_data;
 	int rc = EOK;
 
@@ -800,5 +800,5 @@
 	answer_count = 0;
 
-	echo_data = (icmp_echo_t *) malloc(sizeof(*echo_data));
+	echo_data = (icmp_echo_ref) malloc(sizeof(*echo_data));
 	if (!echo_data)
 		return ENOMEM;
@@ -887,6 +887,6 @@
  * @param[out] answer_count The last parameter for the actual answer in the
  *			answer parameter.
- * @return		EOK on success.
- * @return		ENOTSUP if the message is not known.
+ * @returns		EOK on success.
+ * @returns		ENOTSUP if the message is not known.
  *
  * @see icmp_interface.h
@@ -896,5 +896,5 @@
     ipc_call_t *answer, int *answer_count)
 {
-	packet_t *packet;
+	packet_t packet;
 	int rc;
 
@@ -964,6 +964,6 @@
 /** Starts the module.
  *
- * @return		EOK on success.
- * @return		Other error codes as defined for each specific module
+ * @returns		EOK on success.
+ * @returns		Other error codes as defined for each specific module
  *			start function.
  */
Index: uspace/srv/net/tl/icmp/icmp.h
===================================================================
--- uspace/srv/net/tl/icmp/icmp.h	(revision 32eceb4ff0c0ddeba47997beaa5d0677aee84d3a)
+++ uspace/srv/net/tl/icmp/icmp.h	(revision 1b22bd45ebc7f42217757e90fa6e5b57f6ed5d1d)
@@ -49,4 +49,9 @@
  */
 typedef struct icmp_reply icmp_reply_t;
+
+/** Type definition of the ICMP reply data pointer.
+ * @see icmp_reply
+ */
+typedef icmp_reply_t *icmp_reply_ref;
 
 /** Type definition of the ICMP global data.
Index: uspace/srv/net/tl/tcp/tcp.c
===================================================================
--- uspace/srv/net/tl/tcp/tcp.c	(revision 32eceb4ff0c0ddeba47997beaa5d0677aee84d3a)
+++ uspace/srv/net/tl/tcp/tcp.c	(revision 1b22bd45ebc7f42217757e90fa6e5b57f6ed5d1d)
@@ -127,4 +127,9 @@
 typedef struct tcp_timeout tcp_timeout_t;
 
+/** Type definition of the TCP timeout pointer.
+ *  @see tcp_timeout
+ */
+typedef tcp_timeout_t *tcp_timeout_ref;
+
 /** TCP reply timeout data.
  *  Used as a timeouting fibril argument.
@@ -139,5 +144,5 @@
 
 	/** Local sockets. */
-	socket_cores_t *local_sockets;
+	socket_cores_ref local_sockets;
 
 	/** Socket identifier. */
@@ -160,10 +165,10 @@
 };
 
-static int tcp_release_and_return(packet_t *, int);
-static void tcp_prepare_operation_header(socket_core_t *, tcp_socket_data_t *,
-    tcp_header_t *, int synchronize, int);
-static int tcp_prepare_timeout(int (*)(void *), socket_core_t *,
-    tcp_socket_data_t *, size_t, tcp_socket_state_t, suseconds_t, int);
-static void tcp_free_socket_data(socket_core_t *);
+static int tcp_release_and_return(packet_t, int);
+static void tcp_prepare_operation_header(socket_core_ref, tcp_socket_data_ref,
+    tcp_header_ref, int synchronize, int);
+static int tcp_prepare_timeout(int (*)(void *), socket_core_ref,
+    tcp_socket_data_ref, size_t, tcp_socket_state_t, suseconds_t, int);
+static void tcp_free_socket_data(socket_core_ref);
 
 static int tcp_timeout(void *);
@@ -171,49 +176,49 @@
 static int tcp_release_after_timeout(void *);
 
-static int tcp_process_packet(device_id_t, packet_t *, services_t);
-static int tcp_connect_core(socket_core_t *, socket_cores_t *,
+static int tcp_process_packet(device_id_t, packet_t, services_t);
+static int tcp_connect_core(socket_core_ref, socket_cores_ref,
     struct sockaddr *, socklen_t);
-static int tcp_queue_prepare_packet(socket_core_t *, tcp_socket_data_t *,
-    packet_t *, size_t);
-static int tcp_queue_packet(socket_core_t *, tcp_socket_data_t *, packet_t *,
+static int tcp_queue_prepare_packet(socket_core_ref, tcp_socket_data_ref,
+    packet_t, size_t);
+static int tcp_queue_packet(socket_core_ref, tcp_socket_data_ref, packet_t,
     size_t);
-static packet_t *tcp_get_packets_to_send(socket_core_t *, tcp_socket_data_t *);
-static void tcp_send_packets(device_id_t, packet_t *);
-
-static void tcp_process_acknowledgement(socket_core_t *, tcp_socket_data_t *,
-    tcp_header_t *);
-static packet_t *tcp_send_prepare_packet(socket_core_t *, tcp_socket_data_t *,
-    packet_t *, size_t, size_t);
-static packet_t *tcp_prepare_copy(socket_core_t *, tcp_socket_data_t *,
-    packet_t *, size_t, size_t);
-/* static */ void tcp_retransmit_packet(socket_core_t *, tcp_socket_data_t *,
+static packet_t tcp_get_packets_to_send(socket_core_ref, tcp_socket_data_ref);
+static void tcp_send_packets(device_id_t, packet_t);
+
+static void tcp_process_acknowledgement(socket_core_ref, tcp_socket_data_ref,
+    tcp_header_ref);
+static packet_t tcp_send_prepare_packet(socket_core_ref, tcp_socket_data_ref,
+    packet_t, size_t, size_t);
+static packet_t tcp_prepare_copy(socket_core_ref, tcp_socket_data_ref, packet_t,
+    size_t, size_t);
+/* static */ void tcp_retransmit_packet(socket_core_ref, tcp_socket_data_ref,
     size_t);
-static int tcp_create_notification_packet(packet_t **, socket_core_t *,
-    tcp_socket_data_t *, int, int);
-static void tcp_refresh_socket_data(tcp_socket_data_t *);
-
-static void tcp_initialize_socket_data(tcp_socket_data_t *);
-
-static int tcp_process_listen(socket_core_t *, tcp_socket_data_t *,
-    tcp_header_t *, packet_t *, struct sockaddr *, struct sockaddr *, size_t);
-static int tcp_process_syn_sent(socket_core_t *, tcp_socket_data_t *,
-    tcp_header_t *, packet_t *);
-static int tcp_process_syn_received(socket_core_t *, tcp_socket_data_t *,
-    tcp_header_t *, packet_t *);
-static int tcp_process_established(socket_core_t *, tcp_socket_data_t *,
-    tcp_header_t *, packet_t *, int, size_t);
-static int tcp_queue_received_packet(socket_core_t *, tcp_socket_data_t *,
-    packet_t *, int, size_t);
-
-static int tcp_received_msg(device_id_t, packet_t *, services_t, services_t);
+static int tcp_create_notification_packet(packet_t *, socket_core_ref,
+    tcp_socket_data_ref, int, int);
+static void tcp_refresh_socket_data(tcp_socket_data_ref);
+
+static void tcp_initialize_socket_data(tcp_socket_data_ref);
+
+static int tcp_process_listen(socket_core_ref, tcp_socket_data_ref,
+    tcp_header_ref, packet_t, struct sockaddr *, struct sockaddr *, size_t);
+static int tcp_process_syn_sent(socket_core_ref, tcp_socket_data_ref,
+    tcp_header_ref, packet_t);
+static int tcp_process_syn_received(socket_core_ref, tcp_socket_data_ref,
+    tcp_header_ref, packet_t);
+static int tcp_process_established(socket_core_ref, tcp_socket_data_ref,
+    tcp_header_ref, packet_t, int, size_t);
+static int tcp_queue_received_packet(socket_core_ref, tcp_socket_data_ref,
+    packet_t, int, size_t);
+
+static int tcp_received_msg(device_id_t, packet_t, services_t, services_t);
 static int tcp_process_client_messages(ipc_callid_t, ipc_call_t);
 
-static int tcp_listen_message(socket_cores_t *, int, int);
-static int tcp_connect_message(socket_cores_t *, int, struct sockaddr *,
+static int tcp_listen_message(socket_cores_ref, int, int);
+static int tcp_connect_message(socket_cores_ref, int, struct sockaddr *,
     socklen_t);
-static int tcp_recvfrom_message(socket_cores_t *, int, int, size_t *);
-static int tcp_send_message(socket_cores_t *, int, int, size_t *, int);
-static int tcp_accept_message(socket_cores_t *, int, int, size_t *, size_t *);
-static int tcp_close_message(socket_cores_t *, int);
+static int tcp_recvfrom_message(socket_cores_ref, int, int, size_t *);
+static int tcp_send_message(socket_cores_ref, int, int, size_t *, int);
+static int tcp_accept_message(socket_cores_ref, int, int, size_t *, size_t *);
+static int tcp_close_message(socket_cores_ref, int);
 
 /** TCP global data. */
@@ -224,6 +229,6 @@
  * @param[in] client_connection The client connection processing function. The
  *			module skeleton propagates its own one.
- * @return		EOK on success.
- * @return		ENOMEM if there is not enough memory left.
+ * @returns		EOK on success.
+ * @returns		ENOMEM if there is not enough memory left.
  */
 int tcp_initialize(async_client_conn_t client_connection)
@@ -262,5 +267,5 @@
 }
 
-int tcp_received_msg(device_id_t device_id, packet_t *packet,
+int tcp_received_msg(device_id_t device_id, packet_t packet,
     services_t receiver, services_t error)
 {
@@ -280,13 +285,13 @@
 }
 
-int tcp_process_packet(device_id_t device_id, packet_t *packet, services_t error)
+int tcp_process_packet(device_id_t device_id, packet_t packet, services_t error)
 {
 	size_t length;
 	size_t offset;
 	int result;
-	tcp_header_t *header;
-	socket_core_t *socket;
-	tcp_socket_data_t *socket_data;
-	packet_t *next_packet;
+	tcp_header_ref header;
+	socket_core_ref socket;
+	tcp_socket_data_ref socket_data;
+	packet_t next_packet;
 	size_t total_length;
 	uint32_t checksum;
@@ -338,5 +343,5 @@
 
 	/* Get tcp header */
-	header = (tcp_header_t *) packet_get_data(packet);
+	header = (tcp_header_ref) packet_get_data(packet);
 	if (!header)
 		return tcp_release_and_return(packet, NO_DATA);
@@ -375,5 +380,5 @@
 
 	printf("socket id %d\n", socket->socket_id);
-	socket_data = (tcp_socket_data_t *) socket->specific_data;
+	socket_data = (tcp_socket_data_ref) socket->specific_data;
 	assert(socket_data);
 
@@ -492,10 +497,10 @@
 }
 
-int tcp_process_established(socket_core_t *socket, tcp_socket_data_t *
-    socket_data, tcp_header_t *header, packet_t *packet, int fragments,
+int tcp_process_established(socket_core_ref socket, tcp_socket_data_ref
+    socket_data, tcp_header_ref header, packet_t packet, int fragments,
     size_t total_length)
 {
-	packet_t *next_packet;
-	packet_t *tmp_packet;
+	packet_t next_packet;
+	packet_t tmp_packet;
 	uint32_t old_incoming;
 	size_t order;
@@ -800,9 +805,9 @@
 }
 
-int tcp_queue_received_packet(socket_core_t *socket,
-    tcp_socket_data_t *socket_data, packet_t *packet, int fragments,
+int tcp_queue_received_packet(socket_core_ref socket,
+    tcp_socket_data_ref socket_data, packet_t packet, int fragments,
     size_t total_length)
 {
-	packet_dimension_t *packet_dimension;
+	packet_dimension_ref packet_dimension;
 	int rc;
 
@@ -837,8 +842,8 @@
 }
 
-int tcp_process_syn_sent(socket_core_t *socket, tcp_socket_data_t *
-    socket_data, tcp_header_t *header, packet_t *packet)
-{
-	packet_t *next_packet;
+int tcp_process_syn_sent(socket_core_ref socket, tcp_socket_data_ref
+    socket_data, tcp_header_ref header, packet_t packet)
+{
+	packet_t next_packet;
 	int rc;
 
@@ -895,12 +900,12 @@
 }
 
-int tcp_process_listen(socket_core_t *listening_socket,
-    tcp_socket_data_t *listening_socket_data, tcp_header_t *header,
-    packet_t *packet, struct sockaddr *src, struct sockaddr *dest,
+int tcp_process_listen(socket_core_ref listening_socket,
+    tcp_socket_data_ref listening_socket_data, tcp_header_ref header,
+    packet_t packet, struct sockaddr *src, struct sockaddr *dest,
     size_t addrlen)
 {
-	packet_t *next_packet;
-	socket_core_t *socket;
-	tcp_socket_data_t *socket_data;
+	packet_t next_packet;
+	socket_core_ref socket;
+	tcp_socket_data_ref socket_data;
 	int socket_id;
 	int listening_socket_id = listening_socket->socket_id;
@@ -917,5 +922,5 @@
 		return tcp_release_and_return(packet, EINVAL);
 
-	socket_data = (tcp_socket_data_t *) malloc(sizeof(*socket_data));
+	socket_data = (tcp_socket_data_ref) malloc(sizeof(*socket_data));
 	if (!socket_data)
 		return tcp_release_and_return(packet, ENOMEM);
@@ -974,5 +979,5 @@
 	}
 	listening_socket_data =
-	    (tcp_socket_data_t *) listening_socket->specific_data;
+	    (tcp_socket_data_ref) listening_socket->specific_data;
 	assert(listening_socket_data);
 
@@ -986,5 +991,5 @@
 		return ENOTSOCK;
 	}
-	socket_data = (tcp_socket_data_t *) socket->specific_data;
+	socket_data = (tcp_socket_data_ref) socket->specific_data;
 	assert(socket_data);
 
@@ -1055,9 +1060,9 @@
 }
 
-int tcp_process_syn_received(socket_core_t *socket,
-    tcp_socket_data_t *socket_data, tcp_header_t *header, packet_t *packet)
-{
-	socket_core_t *listening_socket;
-	tcp_socket_data_t *listening_socket_data;
+int tcp_process_syn_received(socket_core_ref socket,
+    tcp_socket_data_ref socket_data, tcp_header_ref header, packet_t packet)
+{
+	socket_core_ref listening_socket;
+	tcp_socket_data_ref listening_socket_data;
 	int rc;
 
@@ -1081,5 +1086,5 @@
 	if (listening_socket) {
 		listening_socket_data =
-		    (tcp_socket_data_t *) listening_socket->specific_data;
+		    (tcp_socket_data_ref) listening_socket->specific_data;
 		assert(listening_socket_data);
 
@@ -1122,12 +1127,12 @@
 }
 
-void tcp_process_acknowledgement(socket_core_t *socket,
-    tcp_socket_data_t *socket_data, tcp_header_t *header)
+void tcp_process_acknowledgement(socket_core_ref socket,
+    tcp_socket_data_ref socket_data, tcp_header_ref header)
 {
 	size_t number;
 	size_t length;
-	packet_t *packet;
-	packet_t *next;
-	packet_t *acknowledged = NULL;
+	packet_t packet;
+	packet_t next;
+	packet_t acknowledged = NULL;
 	uint32_t old;
 
@@ -1222,6 +1227,6 @@
  * @param[out] answer_count The last parameter for the actual answer in the
  *			answer parameter.
- * @return		EOK on success.
- * @return		ENOTSUP if the message is not known.
+ * @returns		EOK on success.
+ * @returns		ENOTSUP if the message is not known.
  *
  * @see tcp_interface.h
@@ -1232,5 +1237,5 @@
     ipc_call_t *answer, int *answer_count)
 {
-	packet_t *packet;
+	packet_t packet;
 	int rc;
 
@@ -1260,5 +1265,5 @@
 }
 
-void tcp_refresh_socket_data(tcp_socket_data_t *socket_data)
+void tcp_refresh_socket_data(tcp_socket_data_ref socket_data)
 {
 	assert(socket_data);
@@ -1276,5 +1281,5 @@
 }
 
-void tcp_initialize_socket_data(tcp_socket_data_t *socket_data)
+void tcp_initialize_socket_data(tcp_socket_data_ref socket_data)
 {
 	assert(socket_data);
@@ -1299,7 +1304,7 @@
 	ipc_call_t answer;
 	int answer_count;
-	tcp_socket_data_t *socket_data;
-	socket_core_t *socket;
-	packet_dimension_t *packet_dimension;
+	tcp_socket_data_ref socket_data;
+	socket_core_ref socket;
+	packet_dimension_ref packet_dimension;
 
 	/*
@@ -1331,5 +1336,5 @@
 		case NET_SOCKET:
 			socket_data =
-			    (tcp_socket_data_t *) malloc(sizeof(*socket_data));
+			    (tcp_socket_data_ref) malloc(sizeof(*socket_data));
 			if (!socket_data) {
 				res = ENOMEM;
@@ -1378,5 +1383,5 @@
 				    SOCKET_GET_SOCKET_ID(call));
 				if (socket) {
-					socket_data = (tcp_socket_data_t *)
+					socket_data = (tcp_socket_data_ref)
 					    socket->specific_data;
 					assert(socket_data);
@@ -1535,8 +1540,8 @@
 int tcp_timeout(void *data)
 {
-	tcp_timeout_t *timeout = data;
+	tcp_timeout_ref timeout = data;
 	int keep_write_lock = false;
-	socket_core_t *socket;
-	tcp_socket_data_t *socket_data;
+	socket_core_ref socket;
+	tcp_socket_data_ref socket_data;
 
 	assert(timeout);
@@ -1556,5 +1561,5 @@
 		goto out;
 	
-	socket_data = (tcp_socket_data_t *) socket->specific_data;
+	socket_data = (tcp_socket_data_ref) socket->specific_data;
 	assert(socket_data);
 	if (socket_data->local_sockets != timeout->local_sockets)
@@ -1612,7 +1617,7 @@
 int tcp_release_after_timeout(void *data)
 {
-	tcp_timeout_t *timeout = data;
-	socket_core_t *socket;
-	tcp_socket_data_t *socket_data;
+	tcp_timeout_ref timeout = data;
+	socket_core_ref socket;
+	tcp_socket_data_ref socket_data;
 	fibril_rwlock_t *local_lock;
 
@@ -1630,5 +1635,5 @@
 
 	if (socket && (socket->socket_id == timeout->socket_id)) {
-		socket_data = (tcp_socket_data_t *) socket->specific_data;
+		socket_data = (tcp_socket_data_ref) socket->specific_data;
 		assert(socket_data);
 		if (socket_data->local_sockets == timeout->local_sockets) {
@@ -1651,9 +1656,9 @@
 }
 
-void tcp_retransmit_packet(socket_core_t *socket, tcp_socket_data_t *
+void tcp_retransmit_packet(socket_core_ref socket, tcp_socket_data_ref
     socket_data, size_t sequence_number)
 {
-	packet_t *packet;
-	packet_t *copy;
+	packet_t packet;
+	packet_t copy;
 	size_t data_length;
 
@@ -1678,9 +1683,9 @@
 }
 
-int tcp_listen_message(socket_cores_t *local_sockets, int socket_id,
+int tcp_listen_message(socket_cores_ref local_sockets, int socket_id,
     int backlog)
 {
-	socket_core_t *socket;
-	tcp_socket_data_t *socket_data;
+	socket_core_ref socket;
+	tcp_socket_data_ref socket_data;
 
 	assert(local_sockets);
@@ -1695,5 +1700,5 @@
 	
 	/* Get the socket specific data */
-	socket_data = (tcp_socket_data_t *) socket->specific_data;
+	socket_data = (tcp_socket_data_ref) socket->specific_data;
 	assert(socket_data);
 
@@ -1704,8 +1709,8 @@
 }
 
-int tcp_connect_message(socket_cores_t *local_sockets, int socket_id,
+int tcp_connect_message(socket_cores_ref local_sockets, int socket_id,
     struct sockaddr *addr, socklen_t addrlen)
 {
-	socket_core_t *socket;
+	socket_core_ref socket;
 	int rc;
 
@@ -1732,9 +1737,9 @@
 }
 
-int tcp_connect_core(socket_core_t *socket, socket_cores_t *local_sockets,
+int tcp_connect_core(socket_core_ref socket, socket_cores_ref local_sockets,
     struct sockaddr *addr, socklen_t addrlen)
 {
-	tcp_socket_data_t *socket_data;
-	packet_t *packet;
+	tcp_socket_data_ref socket_data;
+	packet_t packet;
 	int rc;
 
@@ -1744,5 +1749,5 @@
 
 	/* Get the socket specific data */
-	socket_data = (tcp_socket_data_t *) socket->specific_data;
+	socket_data = (tcp_socket_data_ref) socket->specific_data;
 	assert(socket_data);
 	assert(socket->specific_data == socket_data);
@@ -1823,8 +1828,8 @@
 }
 
-int tcp_queue_prepare_packet(socket_core_t *socket,
-    tcp_socket_data_t *socket_data, packet_t *packet, size_t data_length)
-{
-	tcp_header_t *header;
+int tcp_queue_prepare_packet(socket_core_ref socket,
+    tcp_socket_data_ref socket_data, packet_t packet, size_t data_length)
+{
+	tcp_header_ref header;
 	int rc;
 
@@ -1834,5 +1839,5 @@
 
 	/* Get TCP header */
-	header = (tcp_header_t *) packet_get_data(packet);
+	header = (tcp_header_ref) packet_get_data(packet);
 	if (!header)
 		return NO_DATA;
@@ -1854,6 +1859,6 @@
 }
 
-int tcp_queue_packet(socket_core_t *socket, tcp_socket_data_t *socket_data,
-    packet_t *packet, size_t data_length)
+int tcp_queue_packet(socket_core_ref socket, tcp_socket_data_ref socket_data,
+    packet_t packet, size_t data_length)
 {
 	int rc;
@@ -1876,11 +1881,11 @@
 }
 
-packet_t *tcp_get_packets_to_send(socket_core_t *socket, tcp_socket_data_t *
+packet_t tcp_get_packets_to_send(socket_core_ref socket, tcp_socket_data_ref
     socket_data)
 {
-	packet_t *packet;
-	packet_t *copy;
-	packet_t *sending = NULL;
-	packet_t *previous = NULL;
+	packet_t packet;
+	packet_t copy;
+	packet_t sending = NULL;
+	packet_t previous = NULL;
 	size_t data_length;
 	int rc;
@@ -1936,8 +1941,8 @@
 }
 
-packet_t *tcp_send_prepare_packet(socket_core_t *socket, tcp_socket_data_t *
-    socket_data, packet_t *packet, size_t data_length, size_t sequence_number)
-{
-	tcp_header_t *header;
+packet_t tcp_send_prepare_packet(socket_core_ref socket, tcp_socket_data_ref
+    socket_data, packet_t packet, size_t data_length, size_t sequence_number)
+{
+	tcp_header_ref header;
 	uint32_t checksum;
 	int rc;
@@ -1956,5 +1961,5 @@
 
 	/* Get the header */
-	header = (tcp_header_t *) packet_get_data(packet);
+	header = (tcp_header_ref) packet_get_data(packet);
 	if (!header) {
 		pq_release_remote(tcp_globals.net_phone, packet_get_id(packet));
@@ -1997,8 +2002,8 @@
 }
 
-packet_t *tcp_prepare_copy(socket_core_t *socket, tcp_socket_data_t *
-    socket_data, packet_t *packet, size_t data_length, size_t sequence_number)
-{
-	packet_t *copy;
+packet_t tcp_prepare_copy(socket_core_ref socket, tcp_socket_data_ref
+    socket_data, packet_t packet, size_t data_length, size_t sequence_number)
+{
+	packet_t copy;
 
 	assert(socket);
@@ -2015,7 +2020,7 @@
 }
 
-void tcp_send_packets(device_id_t device_id, packet_t *packet)
-{
-	packet_t *next;
+void tcp_send_packets(device_id_t device_id, packet_t packet)
+{
+	packet_t next;
 
 	while (packet) {
@@ -2027,6 +2032,6 @@
 }
 
-void tcp_prepare_operation_header(socket_core_t *socket,
-    tcp_socket_data_t *socket_data, tcp_header_t *header, int synchronize,
+void tcp_prepare_operation_header(socket_core_ref socket,
+    tcp_socket_data_ref socket_data, tcp_header_ref header, int synchronize,
     int finalize)
 {
@@ -2045,9 +2050,9 @@
 
 int tcp_prepare_timeout(int (*timeout_function)(void *tcp_timeout_t),
-    socket_core_t *socket, tcp_socket_data_t *socket_data,
+    socket_core_ref socket, tcp_socket_data_ref socket_data,
     size_t sequence_number, tcp_socket_state_t state, suseconds_t timeout,
     int globals_read_only)
 {
-	tcp_timeout_t *operation_timeout;
+	tcp_timeout_ref operation_timeout;
 	fid_t fibril;
 
@@ -2091,11 +2096,11 @@
 }
 
-int tcp_recvfrom_message(socket_cores_t *local_sockets, int socket_id,
+int tcp_recvfrom_message(socket_cores_ref local_sockets, int socket_id,
     int flags, size_t *addrlen)
 {
-	socket_core_t *socket;
-	tcp_socket_data_t *socket_data;
+	socket_core_ref socket;
+	tcp_socket_data_ref socket_data;
 	int packet_id;
-	packet_t *packet;
+	packet_t packet;
 	size_t length;
 	int rc;
@@ -2112,5 +2117,5 @@
 		return NO_DATA;
 
-	socket_data = (tcp_socket_data_t *) socket->specific_data;
+	socket_data = (tcp_socket_data_ref) socket->specific_data;
 
 	/* Check state */
@@ -2149,13 +2154,13 @@
 }
 
-int tcp_send_message(socket_cores_t *local_sockets, int socket_id,
+int tcp_send_message(socket_cores_ref local_sockets, int socket_id,
     int fragments, size_t *data_fragment_size, int flags)
 {
-	socket_core_t *socket;
-	tcp_socket_data_t *socket_data;
-	packet_dimension_t *packet_dimension;
-	packet_t *packet;
+	socket_core_ref socket;
+	tcp_socket_data_ref socket_data;
+	packet_dimension_ref packet_dimension;
+	packet_t packet;
 	size_t total_length;
-	tcp_header_t *header;
+	tcp_header_ref header;
 	int index;
 	int result;
@@ -2174,5 +2179,5 @@
 		return NO_DATA;
 
-	socket_data = (tcp_socket_data_t *) socket->specific_data;
+	socket_data = (tcp_socket_data_ref) socket->specific_data;
 
 	/* Check state */
@@ -2225,9 +2230,9 @@
 
 int
-tcp_close_message(socket_cores_t *local_sockets, int socket_id)
-{
-	socket_core_t *socket;
-	tcp_socket_data_t *socket_data;
-	packet_t *packet;
+tcp_close_message(socket_cores_ref local_sockets, int socket_id)
+{
+	socket_core_ref socket;
+	tcp_socket_data_ref socket_data;
+	packet_t packet;
 	int rc;
 
@@ -2238,5 +2243,5 @@
 
 	/* Get the socket specific data */
-	socket_data = (tcp_socket_data_t *) socket->specific_data;
+	socket_data = (tcp_socket_data_ref) socket->specific_data;
 	assert(socket_data);
 
@@ -2293,9 +2298,9 @@
 }
 
-int tcp_create_notification_packet(packet_t **packet, socket_core_t *socket,
-    tcp_socket_data_t *socket_data, int synchronize, int finalize)
-{
-	packet_dimension_t *packet_dimension;
-	tcp_header_t *header;
+int tcp_create_notification_packet(packet_t *packet, socket_core_ref socket,
+    tcp_socket_data_ref socket_data, int synchronize, int finalize)
+{
+	packet_dimension_ref packet_dimension;
+	tcp_header_ref header;
 	int rc;
 
@@ -2327,11 +2332,11 @@
 }
 
-int tcp_accept_message(socket_cores_t *local_sockets, int socket_id,
+int tcp_accept_message(socket_cores_ref local_sockets, int socket_id,
     int new_socket_id, size_t *data_fragment_size, size_t *addrlen)
 {
-	socket_core_t *accepted;
-	socket_core_t *socket;
-	tcp_socket_data_t *socket_data;
-	packet_dimension_t *packet_dimension;
+	socket_core_ref accepted;
+	socket_core_ref socket;
+	tcp_socket_data_ref socket_data;
+	packet_dimension_ref packet_dimension;
 	int rc;
 
@@ -2346,5 +2351,5 @@
 
 	/* Get the socket specific data */
-	socket_data = (tcp_socket_data_t *) socket->specific_data;
+	socket_data = (tcp_socket_data_ref) socket->specific_data;
 	assert(socket_data);
 
@@ -2364,5 +2369,5 @@
 
 		/* Get the socket specific data */
-		socket_data = (tcp_socket_data_t *) accepted->specific_data;
+		socket_data = (tcp_socket_data_ref) accepted->specific_data;
 		assert(socket_data);
 		/* TODO can it be in another state? */
@@ -2400,7 +2405,7 @@
 }
 
-void tcp_free_socket_data(socket_core_t *socket)
-{
-	tcp_socket_data_t *socket_data;
+void tcp_free_socket_data(socket_core_ref socket)
+{
+	tcp_socket_data_ref socket_data;
 
 	assert(socket);
@@ -2409,5 +2414,5 @@
 
 	/* Get the socket specific data */
-	socket_data = (tcp_socket_data_t *) socket->specific_data;
+	socket_data = (tcp_socket_data_ref) socket->specific_data;
 	assert(socket_data);
 
@@ -2442,5 +2447,5 @@
  * @return		The result parameter.
  */
-int tcp_release_and_return(packet_t *packet, int result)
+int tcp_release_and_return(packet_t packet, int result)
 {
 	pq_release_remote(tcp_globals.net_phone, packet_get_id(packet));
@@ -2494,6 +2499,6 @@
 /** Starts the module.
  *
- * @return		EOK on success.
- * @return		Other error codes as defined for each specific module
+ * @returns		EOK on success.
+ * @returns		Other error codes as defined for each specific module
  *			start function.
  */
Index: uspace/srv/net/tl/tcp/tcp.h
===================================================================
--- uspace/srv/net/tl/tcp/tcp.h	(revision 32eceb4ff0c0ddeba47997beaa5d0677aee84d3a)
+++ uspace/srv/net/tl/tcp/tcp.h	(revision 1b22bd45ebc7f42217757e90fa6e5b57f6ed5d1d)
@@ -55,8 +55,18 @@
 typedef struct tcp_socket_data tcp_socket_data_t;
 
+/** Type definition of the TCP socket specific data pointer.
+ * @see tcp_socket_data
+ */
+typedef tcp_socket_data_t *tcp_socket_data_ref;
+
 /** Type definition of the TCP operation data.
  * @see tcp_operation
  */
 typedef struct tcp_operation tcp_operation_t;
+
+/** Type definition of the TCP operation data pointer.
+ * @see tcp_operation
+ */
+typedef tcp_operation_t *tcp_operation_ref;
 
 /** TCP socket state type definition.
@@ -239,5 +249,5 @@
 	 * Packets metric is set as their data length.
 	 */
-	packet_t *incoming;
+	packet_t incoming;
 	
 	/** Outgoing packet queue.
@@ -249,5 +259,5 @@
 	 * Packets metric is set as their data length.
 	 */
-	packet_t *outgoing;
+	packet_t outgoing;
 	
 	/** IP pseudo header. */
@@ -262,5 +272,5 @@
 	uint16_t dest_port;
 	/** Parent local sockets. */
-	socket_cores_t *local_sockets;
+	socket_cores_ref local_sockets;
 	
 	/** Local sockets safety lock.
Index: uspace/srv/net/tl/tcp/tcp_header.h
===================================================================
--- uspace/srv/net/tl/tcp/tcp_header.h	(revision 32eceb4ff0c0ddeba47997beaa5d0677aee84d3a)
+++ uspace/srv/net/tl/tcp/tcp_header.h	(revision 1b22bd45ebc7f42217757e90fa6e5b57f6ed5d1d)
@@ -59,4 +59,9 @@
 typedef struct tcp_header tcp_header_t;
 
+/** Type definition of the transmission datagram header pointer.
+ * @see tcp_header
+ */
+typedef tcp_header_t *tcp_header_ref;
+
 /** Type definition of the transmission datagram header option.
  * @see tcp_option
@@ -64,6 +69,16 @@
 typedef struct tcp_option tcp_option_t;
 
+/** Type definition of the transmission datagram header option pointer.
+ * @see tcp_option
+ */
+typedef tcp_option_t *tcp_option_ref;
+
 /** Type definition of the Maximum segment size TCP option. */
 typedef struct tcp_max_segment_size_option tcp_max_segment_size_option_t;
+
+/** Type definition of the Maximum segment size TCP option pointer.
+ * @see tcp_max_segment_size_option
+ */
+typedef tcp_max_segment_size_option_t *tcp_max_segment_size_option_ref;
 
 /** Transmission datagram header. */
Index: uspace/srv/net/tl/udp/udp.c
===================================================================
--- uspace/srv/net/tl/udp/udp.c	(revision 32eceb4ff0c0ddeba47997beaa5d0677aee84d3a)
+++ uspace/srv/net/tl/udp/udp.c	(revision 1b22bd45ebc7f42217757e90fa6e5b57f6ed5d1d)
@@ -97,6 +97,6 @@
  * @param[in] client_connection The client connection processing function. The
  *			module skeleton propagates its own one.
- * @return		EOK on success.
- * @return		ENOMEM if there is not enough memory left.
+ * @returns		EOK on success.
+ * @returns		ENOMEM if there is not enough memory left.
  */
 int udp_initialize(async_client_conn_t client_connection)
@@ -112,5 +112,5 @@
 		}
 	};
-	measured_string_t *configuration;
+	measured_string_ref configuration;
 	size_t count = sizeof(names) / sizeof(measured_string_t);
 	char *data;
@@ -190,5 +190,5 @@
  * @return		The result parameter.
  */
-static int udp_release_and_return(packet_t *packet, int result)
+static int udp_release_and_return(packet_t packet, int result)
 {
 	pq_release_remote(udp_globals.net_phone, packet_get_id(packet));
@@ -205,17 +205,17 @@
  * @param[in] error	The packet error reporting service. Prefixes the
  *			received packet.
- * @return		EOK on success.
- * @return		EINVAL if the packet is not valid.
- * @return		EINVAL if the stored packet address is not the
+ * @returns		EOK on success.
+ * @returns		EINVAL if the packet is not valid.
+ * @returns		EINVAL if the stored packet address is not the
  *			an_addr_t.
- * @return		EINVAL if the packet does not contain any data.
- * @return 		NO_DATA if the packet content is shorter than the user
+ * @returns		EINVAL if the packet does not contain any data.
+ * @returns 		NO_DATA if the packet content is shorter than the user
  *			datagram header.
- * @return		ENOMEM if there is not enough memory left.
- * @return		EADDRNOTAVAIL if the destination socket does not exist.
- * @return		Other error codes as defined for the
+ * @returns		ENOMEM if there is not enough memory left.
+ * @returns		EADDRNOTAVAIL if the destination socket does not exist.
+ * @returns		Other error codes as defined for the
  *			ip_client_process_packet() function.
  */
-static int udp_process_packet(device_id_t device_id, packet_t *packet,
+static int udp_process_packet(device_id_t device_id, packet_t packet,
     services_t error)
 {
@@ -223,11 +223,11 @@
 	size_t offset;
 	int result;
-	udp_header_t *header;
-	socket_core_t *socket;
-	packet_t *next_packet;
+	udp_header_ref header;
+	socket_core_ref socket;
+	packet_t next_packet;
 	size_t total_length;
 	uint32_t checksum;
 	int fragments;
-	packet_t *tmp_packet;
+	packet_t tmp_packet;
 	icmp_type_t type;
 	icmp_code_t code;
@@ -235,5 +235,5 @@
 	struct sockaddr *src;
 	struct sockaddr *dest;
-	packet_dimension_t *packet_dimension;
+	packet_dimension_ref packet_dimension;
 	int rc;
 
@@ -277,5 +277,5 @@
 
 	/* Get UDP header */
-	header = (udp_header_t *) packet_get_data(packet);
+	header = (udp_header_ref) packet_get_data(packet);
 	if (!header)
 		return udp_release_and_return(packet, NO_DATA);
@@ -409,9 +409,9 @@
  * @param[in] error	The packet error reporting service. Prefixes the
  *			received packet.
- * @return		EOK on success.
- * @return		Other error codes as defined for the
+ * @returns		EOK on success.
+ * @returns		Other error codes as defined for the
  *			udp_process_packet() function.
  */
-static int udp_received_msg(device_id_t device_id, packet_t *packet,
+static int udp_received_msg(device_id_t device_id, packet_t packet,
     services_t receiver, services_t error)
 {
@@ -439,26 +439,26 @@
  * @param[out] data_fragment_size The data fragment size in bytes.
  * @param[in] flags	Various send flags.
- * @return		EOK on success.
- * @return		EAFNOTSUPPORT if the address family is not supported.
- * @return		ENOTSOCK if the socket is not found.
- * @return		EINVAL if the address is invalid.
- * @return		ENOTCONN if the sending socket is not and cannot be
+ * @returns		EOK on success.
+ * @returns		EAFNOTSUPPORT if the address family is not supported.
+ * @returns		ENOTSOCK if the socket is not found.
+ * @returns		EINVAL if the address is invalid.
+ * @returns		ENOTCONN if the sending socket is not and cannot be
  *			bound.
- * @return		ENOMEM if there is not enough memory left.
- * @return		Other error codes as defined for the
+ * @returns		ENOMEM if there is not enough memory left.
+ * @returns		Other error codes as defined for the
  *			socket_read_packet_data() function.
- * @return		Other error codes as defined for the
+ * @returns		Other error codes as defined for the
  *			ip_client_prepare_packet() function.
- * @return		Other error codes as defined for the ip_send_msg()
+ * @returns		Other error codes as defined for the ip_send_msg()
  *			function.
  */
-static int udp_sendto_message(socket_cores_t *local_sockets, int socket_id,
+static int udp_sendto_message(socket_cores_ref local_sockets, int socket_id,
     const struct sockaddr *addr, socklen_t addrlen, int fragments,
     size_t *data_fragment_size, int flags)
 {
-	socket_core_t *socket;
-	packet_t *packet;
-	packet_t *next_packet;
-	udp_header_t *header;
+	socket_core_ref socket;
+	packet_t packet;
+	packet_t next_packet;
+	udp_header_ref header;
 	int index;
 	size_t total_length;
@@ -469,5 +469,5 @@
 	size_t headerlen;
 	device_id_t device_id;
-	packet_dimension_t *packet_dimension;
+	packet_dimension_ref packet_dimension;
 	int rc;
 	
@@ -599,21 +599,21 @@
  * @param[in] flags	Various receive flags.
  * @param[out] addrlen	The source address length.
- * @return		The number of bytes received.
- * @return		ENOTSOCK if the socket is not found.
- * @return		NO_DATA if there are no received packets or data.
- * @return		ENOMEM if there is not enough memory left.
- * @return		EINVAL if the received address is not an IP address.
- * @return		Other error codes as defined for the packet_translate()
+ * @returns		The number of bytes received.
+ * @returns		ENOTSOCK if the socket is not found.
+ * @returns		NO_DATA if there are no received packets or data.
+ * @returns		ENOMEM if there is not enough memory left.
+ * @returns		EINVAL if the received address is not an IP address.
+ * @returns		Other error codes as defined for the packet_translate()
  *			function.
- * @return		Other error codes as defined for the data_reply()
+ * @returns		Other error codes as defined for the data_reply()
  *			function.
  */
-static int udp_recvfrom_message(socket_cores_t *local_sockets, int socket_id,
+static int udp_recvfrom_message(socket_cores_ref local_sockets, int socket_id,
     int flags, size_t *addrlen)
 {
-	socket_core_t *socket;
+	socket_core_ref socket;
 	int packet_id;
-	packet_t *packet;
-	udp_header_t *header;
+	packet_t packet;
+	udp_header_ref header;
 	struct sockaddr *addr;
 	size_t length;
@@ -644,5 +644,5 @@
 		return udp_release_and_return(packet, NO_DATA);
 	}
-	header = (udp_header_t *) data;
+	header = (udp_header_ref) data;
 
 	/* Set the source address port */
@@ -698,5 +698,5 @@
  * @param[in] callid 	The message identifier.
  * @param[in] call	The message parameters.
- * @return		EOK on success.
+ * @returns		EOK on success.
  *
  * @see	socket.h
@@ -714,5 +714,5 @@
 	ipc_call_t answer;
 	int answer_count;
-	packet_dimension_t *packet_dimension;
+	packet_dimension_ref packet_dimension;
 
 	/*
@@ -852,6 +852,6 @@
  * @param[out] answer_count The last parameter for the actual answer in the
  *			answer parameter.
- * @return		EOK on success.
- * @return		ENOTSUP if the message is not known.
+ * @returns		EOK on success.
+ * @returns		ENOTSUP if the message is not known.
  *
  * @see udp_interface.h
@@ -861,5 +861,5 @@
     ipc_call_t *answer, int *answer_count)
 {
-	packet_t *packet;
+	packet_t packet;
 	int rc;
 
@@ -924,6 +924,6 @@
 /** Starts the module.
  *
- * @return		EOK on success.
- * @return		Other error codes as defined for each specific module
+ * @returns		EOK on success.
+ * @returns		Other error codes as defined for each specific module
  *			start function.
  */
Index: uspace/srv/net/tl/udp/udp_header.h
===================================================================
--- uspace/srv/net/tl/udp/udp_header.h	(revision 32eceb4ff0c0ddeba47997beaa5d0677aee84d3a)
+++ uspace/srv/net/tl/udp/udp_header.h	(revision 1b22bd45ebc7f42217757e90fa6e5b57f6ed5d1d)
@@ -49,4 +49,9 @@
 typedef struct udp_header udp_header_t;
 
+/** Type definition of the user datagram header pointer.
+ * @see udp_header
+ */
+typedef udp_header_t *udp_header_ref;
+
 /** User datagram header. */
 struct udp_header {
