Index: uspace/lib/c/Makefile
===================================================================
--- uspace/lib/c/Makefile	(revision f76696fc11f7c97060cb5bfd3e184a0f78e483f9)
+++ uspace/lib/c/Makefile	(revision 96c0b7b7eaa75789aba2cbca8b2292d2986ea995)
@@ -87,4 +87,7 @@
 	generic/task.c \
 	generic/futex.c \
+	generic/inet.c \
+	generic/inetcfg.c \
+	generic/inetping.c \
 	generic/io/asprintf.c \
 	generic/io/io.c \
@@ -97,4 +100,6 @@
 	generic/io/printf_core.c \
 	generic/io/console.c \
+	generic/iplink.c \
+	generic/iplink_srv.c \
 	generic/malloc.c \
 	generic/sysinfo.c \
@@ -108,5 +113,4 @@
 	generic/adt/hash_set.c \
 	generic/adt/dynamic_fifo.c \
-	generic/adt/measured_strings.c \
 	generic/adt/char_map.c \
 	generic/adt/prodcons.c \
@@ -118,8 +122,5 @@
 	generic/vfs/canonify.c \
 	generic/net/inet.c \
-	generic/net/icmp_common.c \
-	generic/net/icmp_api.c \
 	generic/net/modules.c \
-	generic/net/packet.c \
 	generic/net/socket_client.c \
 	generic/net/socket_parse.c \
Index: uspace/lib/c/generic/adt/measured_strings.c
===================================================================
--- uspace/lib/c/generic/adt/measured_strings.c	(revision f76696fc11f7c97060cb5bfd3e184a0f78e483f9)
+++ 	(revision )
@@ -1,421 +1,0 @@
-/*
- * Copyright (c) 2009 Lukas Mejdrech
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup libc
- *  @{
- */
-
-/** @file
- * Character string with measured length implementation.
- * @see measured_strings.h
- */
-
-#include <adt/measured_strings.h>
-#include <malloc.h>
-#include <mem.h>
-#include <unistd.h>
-#include <errno.h>
-#include <async.h>
-
-/** Creates a new measured string bundled with a copy of the given string
- * itself as one memory block.
- *
- * If the measured string is being freed, whole memory block is freed.
- * The measured string should be used only as a constant.
- *
- * @param[in] string	The initial character string to be stored.
- * @param[in] length	The length of the given string without the terminating
- *			zero ('\0') character. If the length is zero, the actual
- *			length is computed. The given length is used and
- *			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 *
-measured_string_create_bulk(const uint8_t *string, size_t length)
-{
-	measured_string_t *new;
-
-	if (length == 0) {
-		while (string[length])
-			length++;
-	}
-	new = (measured_string_t *) malloc(sizeof(measured_string_t) +
-	    (sizeof(uint8_t) * (length + 1)));
-	if (!new)
-		return NULL;
-
-	new->length = length;
-	new->value = ((uint8_t *) new) + sizeof(measured_string_t);
-	/* Append terminating zero explicitly - to be safe */
-	memcpy(new->value, string, new->length);
-	new->value[new->length] = '\0';
-
-	return new;
-}
-
-/** Copies the given measured string with separated header and data parts.
- *
- * @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;
-
-	if (!source)
-		return NULL;
-
-	new = (measured_string_t *) malloc(sizeof(measured_string_t));
-	if (new) {
-		new->value = (uint8_t *) malloc(source->length + 1);
-		if (new->value) {
-			new->length = source->length;
-			memcpy(new->value, source->value, new->length);
-			new->value[new->length] = '\0';
-			return new;
-		}
-		free(new);
-	}
-
-	return NULL;
-}
-
-/** Receives a measured strings array from a calling module.
- *
- * Creates the array and the data memory blocks.
- * This method should be used only while processing IPC messages as the array
- * size has to be negotiated in advance.
- *
- *  @param[out] strings	The received measured strings array.
- *  @param[out] data	The measured strings data. This memory block stores the
- *			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
- *			strings' lengths (should not occur).
- *  @return		ENOMEM if there is not enough memory left.
- *  @return		Other error codes as defined for the
- *			async_data_write_finalize() function.
- */
-int
-measured_strings_receive(measured_string_t **strings, uint8_t **data,
-    size_t count)
-{
-	size_t *lengths;
-	size_t index;
-	size_t length;
-	uint8_t *next;
-	ipc_callid_t callid;
-	int rc;
-
-	if ((!strings) || (!data) || (count <= 0))
-		return EINVAL;
-
-	lengths = (size_t *) malloc(sizeof(size_t) * (count + 1));
-	if (!lengths)
-		return ENOMEM;
-
-	if ((!async_data_write_receive(&callid, &length)) ||
-	    (length != sizeof(size_t) * (count + 1))) {
-		free(lengths);
-		return EINVAL;
-	}
-	rc = async_data_write_finalize(callid, lengths, length);
-	if (rc != EOK) {
-		free(lengths);
-		return rc;
-	}
-
-	*data = malloc(lengths[count]);
-	if (!*data) {
-		free(lengths);
-		return ENOMEM;
-	}
-	(*data)[lengths[count] - 1] = '\0';
-
-	*strings = (measured_string_t *) malloc(sizeof(measured_string_t) *
-	    count);
-	if (!*strings) {
-		free(lengths);
-		free(*data);
-		return ENOMEM;
-	}
-
-	next = *data;
-	for (index = 0; index < count; index++) {
-		(*strings)[index].length = lengths[index];
-		if (lengths[index] > 0) {
-			if (!async_data_write_receive(&callid, &length) ||
-			    (length != lengths[index])) {
-				free(*data);
-				free(*strings);
-				free(lengths);
-				return EINVAL;
-			}
-			rc = async_data_write_finalize(callid, next,
-			    lengths[index]);
-			if (rc != EOK) {
-				free(*data);
-				free(*strings);
-				free(lengths);
-				return rc;
-			}
-			(*strings)[index].value = next;
-			next += lengths[index];
-			*next++ = '\0';
-		} else {
-			(*strings)[index].value = NULL;
-		}
-	}
-
-	free(lengths);
-	return EOK;
-}
-
-/** Computes the lengths of the measured strings in the given array.
- *
- * @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)
-{
-	size_t *lengths;
-	size_t index;
-	size_t length;
-
-	lengths = (size_t *) malloc(sizeof(size_t) * (count + 1));
-	if (!lengths)
-		return NULL;
-
-	length = 0;
-	for (index = 0; index < count; index++) {
-		lengths[index] = strings[index].length;
-		length += lengths[index] + 1;
-	}
-	lengths[count] = length;
-	return lengths;
-}
-
-/** Replies the given measured strings array to a calling module.
- *
- * This method should be used only while processing IPC messages as the array
- * size has to be negotiated in advance.
- *
- * @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
- *			array size.
- * @return		EINVAL if there is inconsistency in sent measured
- *			strings' lengths (should not occur).
- * @return		Other error codes as defined for the
- *			async_data_read_finalize() function.
- */
-int measured_strings_reply(const measured_string_t *strings, size_t count)
-{
-	size_t *lengths;
-	size_t index;
-	size_t length;
-	ipc_callid_t callid;
-	int rc;
-
-	if ((!strings) || (count <= 0))
-		return EINVAL;
-
-	lengths = prepare_lengths(strings, count);
-	if (!lengths)
-		return ENOMEM;
-
-	if (!async_data_read_receive(&callid, &length) ||
-	    (length != sizeof(size_t) * (count + 1))) {
-		free(lengths);
-		return EINVAL;
-	}
-	rc = async_data_read_finalize(callid, lengths, length);
-	if (rc != EOK) {
-		free(lengths);
-		return rc;
-	}
-	free(lengths);
-
-	for (index = 0; index < count; index++) {
-		if (strings[index].length > 0) {
-			if (!async_data_read_receive(&callid, &length) ||
-			    (length != strings[index].length)) {
-				return EINVAL;
-			}
-			rc = async_data_read_finalize(callid,
-			    strings[index].value, strings[index].length);
-			if (rc != EOK)
-				return rc;
-		}
-	}
-
-	return EOK;
-}
-
-/** Receives a measured strings array from another module.
- *
- * Creates the array and the data memory blocks.
- * This method should be used only following other IPC messages as the array
- * size has to be negotiated in advance.
- *
- * @param[in] exch	Exchange.
- * @param[out] strings	The returned measured strings array.
- * @param[out] data	The measured strings data. This memory block stores the
- *			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 exch or count parameter is invalid.
- * @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
- *			async_data_read_start() function.
- */
-int measured_strings_return(async_exch_t *exch, measured_string_t **strings,
-    uint8_t **data, size_t count)
-{
-	size_t *lengths;
-	size_t index;
-	uint8_t *next;
-	int rc;
-
-	if ((exch == NULL) || (!strings) || (!data) || (count <= 0))
-		return EINVAL;
-
-	lengths = (size_t *) malloc(sizeof(size_t) * (count + 1));
-	if (!lengths)
-		return ENOMEM;
-
-	rc = async_data_read_start(exch, lengths,
-	    sizeof(size_t) * (count + 1));
-	if (rc != EOK) {
-		free(lengths);
-		return rc;
-	}
-
-	*data = malloc(lengths[count]);
-	if (!*data) {
-		free(lengths);
-		return ENOMEM;
-	}
-
-	*strings = (measured_string_t *) malloc(sizeof(measured_string_t) *
-	    count);
-	if (!*strings) {
-		free(lengths);
-		free(*data);
-		return ENOMEM;
-	}
-
-	next = *data;
-	for (index = 0; index < count; index++) {
-		(*strings)[index].length = lengths[index];
-		if (lengths[index] > 0) {
-			rc = async_data_read_start(exch, next, lengths[index]);
-			if (rc != EOK) {
-			    	free(lengths);
-				free(data);
-				free(strings);
-				return rc;
-			}
-			(*strings)[index].value = next;
-			next += lengths[index];
-			*next++ = '\0';
-		} else {
-			(*strings)[index].value = NULL;
-		}
-	}
-
-	free(lengths);
-	return EOK;
-}
-
-/** Sends the given measured strings array to another module.
- *
- * This method should be used only following other IPC messages as the array
- * size has to be negotiated in advance.
- *
- * @param[in] exch	Exchange.
- * @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 exch or count parameter is invalid.
- * @return		Other error codes as defined for the
- *			async_data_write_start() function.
- */
-int measured_strings_send(async_exch_t *exch, const measured_string_t *strings,
-    size_t count)
-{
-	size_t *lengths;
-	size_t index;
-	int rc;
-
-	if ((exch == NULL) || (!strings) || (count <= 0))
-		return EINVAL;
-
-	lengths = prepare_lengths(strings, count);
-	if (!lengths)
-		return ENOMEM;
-
-	rc = async_data_write_start(exch, lengths,
-	    sizeof(size_t) * (count + 1));
-	if (rc != EOK) {
-		free(lengths);
-		return rc;
-	}
-
-	free(lengths);
-
-	for (index = 0; index < count; index++) {
-		if (strings[index].length > 0) {
-			rc = async_data_write_start(exch, strings[index].value,
-			    strings[index].length);
-			if (rc != EOK)
-				return rc;
-		}
-	}
-
-	return EOK;
-}
-
-/** @}
- */
Index: uspace/lib/c/generic/inet.c
===================================================================
--- uspace/lib/c/generic/inet.c	(revision 96c0b7b7eaa75789aba2cbca8b2292d2986ea995)
+++ uspace/lib/c/generic/inet.c	(revision 96c0b7b7eaa75789aba2cbca8b2292d2986ea995)
@@ -0,0 +1,191 @@
+/*
+ * Copyright (c) 2012 Jiri Svoboda
+ * 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.
+ */
+
+#include <async.h>
+#include <assert.h>
+#include <errno.h>
+#include <inet/inet.h>
+#include <ipc/inet.h>
+#include <ipc/services.h>
+#include <loc.h>
+
+static void inet_cb_conn(ipc_callid_t iid, ipc_call_t *icall, void *arg);
+
+static async_sess_t *inet_sess = NULL;
+static inet_ev_ops_t *inet_ev_ops = NULL;
+static uint8_t inet_protocol = 0;
+
+static int inet_callback_create(void)
+{
+	async_exch_t *exch = async_exchange_begin(inet_sess);
+
+	ipc_call_t answer;
+	aid_t req = async_send_0(exch, INET_CALLBACK_CREATE, &answer);
+	int rc = async_connect_to_me(exch, 0, 0, 0, inet_cb_conn, NULL);
+	async_exchange_end(exch);
+
+	if (rc != EOK)
+		return rc;
+
+	sysarg_t retval;
+	async_wait_for(req, &retval);
+	if (retval != EOK)
+		return retval;
+
+	return EOK;
+}
+
+static int inet_set_proto(uint8_t protocol)
+{
+	int rc;
+
+	async_exch_t *exch = async_exchange_begin(inet_sess);
+	rc = async_req_1_0(exch, INET_SET_PROTO, protocol);
+	async_exchange_end(exch);
+
+	return rc;
+}
+
+int inet_init(uint8_t protocol, inet_ev_ops_t *ev_ops)
+{
+	service_id_t inet_svc;
+	int rc;
+
+	assert(inet_sess == NULL);
+	assert(inet_ev_ops == NULL);
+	assert(inet_protocol == 0);
+
+	rc = loc_service_get_id(SERVICE_NAME_INET, &inet_svc,
+	    IPC_FLAG_BLOCKING);
+	if (rc != EOK)
+		return ENOENT;
+
+	inet_sess = loc_service_connect(EXCHANGE_SERIALIZE, inet_svc,
+	    IPC_FLAG_BLOCKING);
+	if (inet_sess == NULL)
+		return ENOENT;
+
+	if (inet_set_proto(protocol) != EOK) {
+		async_hangup(inet_sess);
+		inet_sess = NULL;
+		return EIO;
+	}
+
+	if (inet_callback_create() != EOK) {
+		async_hangup(inet_sess);
+		inet_sess = NULL;
+		return EIO;
+	}
+
+	inet_protocol = protocol;
+	inet_ev_ops = ev_ops;
+
+	return EOK;
+}
+
+int inet_send(inet_dgram_t *dgram, uint8_t ttl, inet_df_t df)
+{
+	async_exch_t *exch = async_exchange_begin(inet_sess);
+
+	ipc_call_t answer;
+	aid_t req = async_send_5(exch, INET_SEND, dgram->src.ipv4,
+	    dgram->dest.ipv4, dgram->tos, ttl, df, &answer);
+	int rc = async_data_write_start(exch, dgram->data, dgram->size);
+	async_exchange_end(exch);
+
+	if (rc != EOK) {
+		async_wait_for(req, NULL);
+		return rc;
+	}
+
+	sysarg_t retval;
+	async_wait_for(req, &retval);
+	if (retval != EOK)
+		return retval;
+
+	return EOK;
+}
+
+int inet_get_srcaddr(inet_addr_t *remote, uint8_t tos, inet_addr_t *local)
+{
+	sysarg_t local_addr;
+	async_exch_t *exch = async_exchange_begin(inet_sess);
+
+	int rc = async_req_2_1(exch, INET_GET_SRCADDR, remote->ipv4,
+	    tos, &local_addr);
+	async_exchange_end(exch);
+
+	if (rc != EOK)
+		return rc;
+
+	local->ipv4 = local_addr;
+	return EOK;
+}
+
+static void inet_ev_recv(ipc_callid_t callid, ipc_call_t *call)
+{
+	int rc;
+	inet_dgram_t dgram;
+
+	dgram.src.ipv4 = IPC_GET_ARG1(*call);
+	dgram.dest.ipv4 = IPC_GET_ARG2(*call);
+	dgram.tos = IPC_GET_ARG3(*call);
+
+	rc = async_data_write_accept(&dgram.data, false, 0, 0, 0, &dgram.size);
+	if (rc != EOK) {
+		async_answer_0(callid, rc);
+		return;
+	}
+
+	rc = inet_ev_ops->recv(&dgram);
+	async_answer_0(callid, rc);
+}
+
+static void inet_cb_conn(ipc_callid_t iid, ipc_call_t *icall, void *arg)
+{
+	while (true) {
+		ipc_call_t call;
+		ipc_callid_t callid = async_get_call(&call);
+
+		if (!IPC_GET_IMETHOD(call)) {
+			/* TODO: Handle hangup */
+			return;
+		}
+
+		switch (IPC_GET_IMETHOD(call)) {
+		case INET_EV_RECV:
+			inet_ev_recv(callid, &call);
+			break;
+		default:
+			async_answer_0(callid, ENOTSUP);
+		}
+	}
+}
+
+/** @}
+ */
Index: uspace/lib/c/generic/inetcfg.c
===================================================================
--- uspace/lib/c/generic/inetcfg.c	(revision 96c0b7b7eaa75789aba2cbca8b2292d2986ea995)
+++ uspace/lib/c/generic/inetcfg.c	(revision 96c0b7b7eaa75789aba2cbca8b2292d2986ea995)
@@ -0,0 +1,377 @@
+/*
+ * Copyright (c) 2012 Jiri Svoboda
+ * 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.
+ */
+
+#include <async.h>
+#include <assert.h>
+#include <errno.h>
+#include <inet/inetcfg.h>
+#include <ipc/inet.h>
+#include <ipc/services.h>
+#include <loc.h>
+#include <stdlib.h>
+#include <str.h>
+
+static async_sess_t *inetcfg_sess = NULL;
+
+static int inetcfg_get_ids_once(sysarg_t method, sysarg_t arg1,
+    sysarg_t *id_buf, size_t buf_size, size_t *act_size)
+{
+	async_exch_t *exch = async_exchange_begin(inetcfg_sess);
+
+	ipc_call_t answer;
+	aid_t req = async_send_1(exch, method, arg1, &answer);
+	int rc = async_data_read_start(exch, id_buf, buf_size);
+
+	async_exchange_end(exch);
+
+	if (rc != EOK) {
+		async_wait_for(req, NULL);
+		return rc;
+	}
+
+	sysarg_t retval;
+	async_wait_for(req, &retval);
+
+	if (retval != EOK) {
+		return retval;
+	}
+
+	*act_size = IPC_GET_ARG1(answer);
+	return EOK;
+}
+
+/** Get list of IDs.
+ *
+ * Returns an allocated array of service IDs.
+ *
+ * @param method	IPC method
+ * @param arg1		IPC argument 1
+ * @param data		Place to store pointer to array of IDs
+ * @param count		Place to store number of IDs
+ * @return 		EOK on success or negative error code
+ */
+static int inetcfg_get_ids_internal(sysarg_t method, sysarg_t arg1,
+    sysarg_t **data, size_t *count)
+{
+	*data = NULL;
+	*count = 0;
+
+	size_t act_size = 0;
+	int rc = inetcfg_get_ids_once(method, arg1, NULL, 0,
+	    &act_size);
+	if (rc != EOK)
+		return rc;
+
+	size_t alloc_size = act_size;
+	service_id_t *ids = malloc(alloc_size);
+	if (ids == NULL)
+		return ENOMEM;
+
+	while (true) {
+		rc = inetcfg_get_ids_once(method, arg1, ids, alloc_size,
+		    &act_size);
+		if (rc != EOK)
+			return rc;
+
+		if (act_size <= alloc_size)
+			break;
+
+		alloc_size = act_size;
+		ids = realloc(ids, alloc_size);
+		if (ids == NULL)
+			return ENOMEM;
+	}
+
+	*count = act_size / sizeof(sysarg_t);
+	*data = ids;
+	return EOK;
+}
+
+int inetcfg_init(void)
+{
+	service_id_t inet_svc;
+	int rc;
+
+	assert(inetcfg_sess == NULL);
+
+	rc = loc_service_get_id(SERVICE_NAME_INETCFG, &inet_svc,
+	    IPC_FLAG_BLOCKING);
+	if (rc != EOK)
+		return ENOENT;
+
+	inetcfg_sess = loc_service_connect(EXCHANGE_SERIALIZE, inet_svc,
+	    IPC_FLAG_BLOCKING);
+	if (inetcfg_sess == NULL)
+		return ENOENT;
+
+	return EOK;
+}
+
+int inetcfg_addr_create_static(const char *name, inet_naddr_t *naddr,
+    sysarg_t link_id, sysarg_t *addr_id)
+{
+	async_exch_t *exch = async_exchange_begin(inetcfg_sess);
+
+	ipc_call_t answer;
+	aid_t req = async_send_3(exch, INETCFG_ADDR_CREATE_STATIC, naddr->ipv4,
+	    naddr->bits, link_id, &answer);
+	sysarg_t retval = async_data_write_start(exch, name, str_size(name));
+
+	async_exchange_end(exch);
+
+	if (retval != EOK) {
+		async_wait_for(req, NULL);
+		return retval;
+	}
+
+	async_wait_for(req, &retval);
+	*addr_id = IPC_GET_ARG1(answer);
+
+	return retval;
+}
+
+int inetcfg_addr_delete(sysarg_t addr_id)
+{
+	async_exch_t *exch = async_exchange_begin(inetcfg_sess);
+
+	int rc = async_req_1_0(exch, INETCFG_ADDR_DELETE, addr_id);
+	async_exchange_end(exch);
+
+	return rc;
+}
+
+int inetcfg_addr_get(sysarg_t addr_id, inet_addr_info_t *ainfo)
+{
+	ipc_call_t dreply;
+	sysarg_t dretval;
+	size_t act_size;
+	char name_buf[LOC_NAME_MAXLEN + 1];
+
+	async_exch_t *exch = async_exchange_begin(inetcfg_sess);
+
+	ipc_call_t answer;
+	aid_t req = async_send_1(exch, INETCFG_ADDR_GET, addr_id, &answer);
+	aid_t dreq = async_data_read(exch, name_buf, LOC_NAME_MAXLEN, &dreply);
+	async_wait_for(dreq, &dretval);
+
+	async_exchange_end(exch);
+
+	if (dretval != EOK) {
+		async_wait_for(req, NULL);
+		return dretval;
+	}
+
+	sysarg_t retval;
+	async_wait_for(req, &retval);
+
+	if (retval != EOK)
+		return retval;
+
+	act_size = IPC_GET_ARG2(dreply);
+	assert(act_size <= LOC_NAME_MAXLEN);
+	name_buf[act_size] = '\0';
+
+	ainfo->naddr.ipv4 = IPC_GET_ARG1(answer);
+	ainfo->naddr.bits = IPC_GET_ARG2(answer);
+	ainfo->ilink = IPC_GET_ARG3(answer);
+	ainfo->name = str_dup(name_buf);
+
+	return EOK;
+}
+
+int inetcfg_addr_get_id(const char *name, sysarg_t link_id, sysarg_t *addr_id)
+{
+	async_exch_t *exch = async_exchange_begin(inetcfg_sess);
+
+	ipc_call_t answer;
+	aid_t req = async_send_1(exch, INETCFG_ADDR_GET_ID, link_id, &answer);
+	sysarg_t retval = async_data_write_start(exch, name, str_size(name));
+
+	async_exchange_end(exch);
+
+	if (retval != EOK) {
+		async_wait_for(req, NULL);
+		return retval;
+	}
+
+	async_wait_for(req, &retval);
+	*addr_id = IPC_GET_ARG1(answer);
+
+	return retval;
+}
+
+int inetcfg_get_addr_list(sysarg_t **addrs, size_t *count)
+{
+	return inetcfg_get_ids_internal(INETCFG_GET_ADDR_LIST,
+	    0, addrs, count);
+}
+
+int inetcfg_get_link_list(sysarg_t **links, size_t *count)
+{
+	return inetcfg_get_ids_internal(INETCFG_GET_LINK_LIST,
+	    0, links, count);
+}
+
+int inetcfg_get_sroute_list(sysarg_t **sroutes, size_t *count)
+{
+	return inetcfg_get_ids_internal(INETCFG_GET_SROUTE_LIST,
+	    0, sroutes, count);
+}
+
+int inetcfg_link_get(sysarg_t link_id, inet_link_info_t *linfo)
+{
+	ipc_call_t dreply;
+	sysarg_t dretval;
+	size_t act_size;
+	char name_buf[LOC_NAME_MAXLEN + 1];
+
+	async_exch_t *exch = async_exchange_begin(inetcfg_sess);
+
+	ipc_call_t answer;
+	aid_t req = async_send_1(exch, INETCFG_LINK_GET, link_id, &answer);
+	aid_t dreq = async_data_read(exch, name_buf, LOC_NAME_MAXLEN, &dreply);
+	async_wait_for(dreq, &dretval);
+
+	async_exchange_end(exch);
+
+	if (dretval != EOK) {
+		async_wait_for(req, NULL);
+		return dretval;
+	}
+
+	sysarg_t retval;
+	async_wait_for(req, &retval);
+
+	if (retval != EOK)
+		return retval;
+
+	act_size = IPC_GET_ARG2(dreply);
+	assert(act_size <= LOC_NAME_MAXLEN);
+	name_buf[act_size] = '\0';
+
+	linfo->name = str_dup(name_buf);
+	linfo->def_mtu = IPC_GET_ARG1(answer);
+
+	return EOK;
+}
+
+int inetcfg_sroute_create(const char *name, inet_naddr_t *dest,
+    inet_addr_t *router, sysarg_t *sroute_id)
+{
+	async_exch_t *exch = async_exchange_begin(inetcfg_sess);
+
+	ipc_call_t answer;
+	aid_t req = async_send_3(exch, INETCFG_SROUTE_CREATE,
+	    dest->ipv4, dest->bits, router->ipv4, &answer);
+	sysarg_t retval = async_data_write_start(exch, name, str_size(name));
+
+	async_exchange_end(exch);
+
+	if (retval != EOK) {
+		async_wait_for(req, NULL);
+		return retval;
+	}
+
+	async_wait_for(req, &retval);
+	*sroute_id = IPC_GET_ARG1(answer);
+
+	return retval;
+}
+
+int inetcfg_sroute_delete(sysarg_t sroute_id)
+{
+	async_exch_t *exch = async_exchange_begin(inetcfg_sess);
+
+	int rc = async_req_1_0(exch, INETCFG_SROUTE_DELETE, sroute_id);
+	async_exchange_end(exch);
+
+	return rc;
+}
+
+int inetcfg_sroute_get(sysarg_t sroute_id, inet_sroute_info_t *srinfo)
+{
+	ipc_call_t dreply;
+	sysarg_t dretval;
+	size_t act_size;
+	char name_buf[LOC_NAME_MAXLEN + 1];
+
+	async_exch_t *exch = async_exchange_begin(inetcfg_sess);
+
+	ipc_call_t answer;
+	aid_t req = async_send_1(exch, INETCFG_SROUTE_GET, sroute_id, &answer);
+	aid_t dreq = async_data_read(exch, name_buf, LOC_NAME_MAXLEN, &dreply);
+	async_wait_for(dreq, &dretval);
+
+	async_exchange_end(exch);
+
+	if (dretval != EOK) {
+		async_wait_for(req, NULL);
+		return dretval;
+	}
+
+	sysarg_t retval;
+	async_wait_for(req, &retval);
+
+	if (retval != EOK)
+		return retval;
+
+	act_size = IPC_GET_ARG2(dreply);
+	assert(act_size <= LOC_NAME_MAXLEN);
+	name_buf[act_size] = '\0';
+
+	srinfo->dest.ipv4 = IPC_GET_ARG1(answer);
+	srinfo->dest.bits = IPC_GET_ARG2(answer);
+	srinfo->router.ipv4 = IPC_GET_ARG3(answer);
+	srinfo->name = str_dup(name_buf);
+
+	return EOK;
+}
+
+int inetcfg_sroute_get_id(const char *name, sysarg_t *sroute_id)
+{
+	async_exch_t *exch = async_exchange_begin(inetcfg_sess);
+
+	ipc_call_t answer;
+	aid_t req = async_send_0(exch, INETCFG_SROUTE_GET_ID, &answer);
+	sysarg_t retval = async_data_write_start(exch, name, str_size(name));
+
+	async_exchange_end(exch);
+
+	if (retval != EOK) {
+		async_wait_for(req, NULL);
+		return retval;
+	}
+
+	async_wait_for(req, &retval);
+	*sroute_id = IPC_GET_ARG1(answer);
+
+	return retval;
+}
+
+/** @}
+ */
Index: uspace/lib/c/generic/inetping.c
===================================================================
--- uspace/lib/c/generic/inetping.c	(revision 96c0b7b7eaa75789aba2cbca8b2292d2986ea995)
+++ uspace/lib/c/generic/inetping.c	(revision 96c0b7b7eaa75789aba2cbca8b2292d2986ea995)
@@ -0,0 +1,156 @@
+/*
+ * Copyright (c) 2012 Jiri Svoboda
+ * 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.
+ */
+
+#include <async.h>
+#include <assert.h>
+#include <errno.h>
+#include <inet/inetping.h>
+#include <ipc/inet.h>
+#include <ipc/services.h>
+#include <loc.h>
+#include <stdlib.h>
+#include <str.h>
+
+static void inetping_cb_conn(ipc_callid_t, ipc_call_t *, void *);
+static void inetping_ev_recv(ipc_callid_t, ipc_call_t *);
+
+static async_sess_t *inetping_sess = NULL;
+static inetping_ev_ops_t *inetping_ev_ops;
+
+int inetping_init(inetping_ev_ops_t *ev_ops)
+{
+	service_id_t inetping_svc;
+	int rc;
+
+	assert(inetping_sess == NULL);
+
+	inetping_ev_ops = ev_ops;
+
+	rc = loc_service_get_id(SERVICE_NAME_INETPING, &inetping_svc,
+	    IPC_FLAG_BLOCKING);
+	if (rc != EOK)
+		return ENOENT;
+
+	inetping_sess = loc_service_connect(EXCHANGE_SERIALIZE, inetping_svc,
+	    IPC_FLAG_BLOCKING);
+	if (inetping_sess == NULL)
+		return ENOENT;
+
+	async_exch_t *exch = async_exchange_begin(inetping_sess);
+
+	rc = async_connect_to_me(exch, 0, 0, 0, inetping_cb_conn, NULL);
+	async_exchange_end(exch);
+
+	if (rc != EOK) {
+		async_hangup(inetping_sess);
+		inetping_sess = NULL;
+		return rc;
+	}
+
+	return EOK;
+}
+
+int inetping_send(inetping_sdu_t *sdu)
+{
+	async_exch_t *exch = async_exchange_begin(inetping_sess);
+
+	ipc_call_t answer;
+	aid_t req = async_send_3(exch, INETPING_SEND, sdu->src.ipv4,
+	    sdu->dest.ipv4, sdu->seq_no, &answer);
+	sysarg_t retval = async_data_write_start(exch, sdu->data, sdu->size);
+
+	async_exchange_end(exch);
+
+	if (retval != EOK) {
+		async_wait_for(req, NULL);
+		return retval;
+	}
+
+	async_wait_for(req, &retval);
+	return retval;
+}
+
+int inetping_get_srcaddr(inet_addr_t *remote, inet_addr_t *local)
+{
+	sysarg_t local_addr;
+	async_exch_t *exch = async_exchange_begin(inetping_sess);
+
+	int rc = async_req_1_1(exch, INETPING_GET_SRCADDR, remote->ipv4,
+	    &local_addr);
+	async_exchange_end(exch);
+
+	if (rc != EOK)
+		return rc;
+
+	local->ipv4 = local_addr;
+	return EOK;
+}
+
+static void inetping_ev_recv(ipc_callid_t callid, ipc_call_t *call)
+{
+	int rc;
+	inetping_sdu_t sdu;
+
+	sdu.src.ipv4 = IPC_GET_ARG1(*call);
+	sdu.dest.ipv4 = IPC_GET_ARG2(*call);
+	sdu.seq_no = IPC_GET_ARG3(*call);
+
+	rc = async_data_write_accept(&sdu.data, false, 0, 0, 0, &sdu.size);
+	if (rc != EOK) {
+		async_answer_0(callid, rc);
+		return;
+	}
+
+	rc = inetping_ev_ops->recv(&sdu);
+	free(sdu.data);
+	async_answer_0(callid, rc);
+}
+
+static void inetping_cb_conn(ipc_callid_t iid, ipc_call_t *icall, void *arg)
+{
+	while (true) {
+		ipc_call_t call;
+		ipc_callid_t callid = async_get_call(&call);
+
+		if (!IPC_GET_IMETHOD(call)) {
+			/* TODO: Handle hangup */
+			return;
+		}
+
+		switch (IPC_GET_IMETHOD(call)) {
+		case INETPING_EV_RECV:
+			inetping_ev_recv(callid, &call);
+			break;
+		default:
+			async_answer_0(callid, ENOTSUP);
+		}
+	}
+}
+
+/** @}
+ */
Index: uspace/lib/c/generic/iplink.c
===================================================================
--- uspace/lib/c/generic/iplink.c	(revision 96c0b7b7eaa75789aba2cbca8b2292d2986ea995)
+++ uspace/lib/c/generic/iplink.c	(revision 96c0b7b7eaa75789aba2cbca8b2292d2986ea995)
@@ -0,0 +1,187 @@
+/*
+ * Copyright (c) 2012 Jiri Svoboda
+ * 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 libc
+ * @{
+ */
+/**
+ * @file
+ * @brief IP link client stub
+ */
+
+#include <async.h>
+#include <assert.h>
+#include <errno.h>
+#include <inet/iplink.h>
+#include <ipc/iplink.h>
+#include <ipc/services.h>
+#include <loc.h>
+#include <stdlib.h>
+
+static void iplink_cb_conn(ipc_callid_t iid, ipc_call_t *icall, void *arg);
+
+int iplink_open(async_sess_t *sess, iplink_ev_ops_t *ev_ops,
+    iplink_t **riplink)
+{
+	iplink_t *iplink = NULL;
+	int rc;
+
+	iplink = calloc(1, sizeof(iplink_t));
+	if (iplink == NULL)
+		return ENOMEM;
+
+	iplink->sess = sess;
+	iplink->ev_ops = ev_ops;
+
+	async_exch_t *exch = async_exchange_begin(sess);
+
+	rc = async_connect_to_me(exch, 0, 0, 0, iplink_cb_conn, iplink);
+	async_exchange_end(exch);
+
+	if (rc != EOK)
+		goto error;
+
+	*riplink = iplink;
+	return EOK;
+
+error:
+	if (iplink != NULL)
+		free(iplink);
+
+	return rc;
+}
+
+void iplink_close(iplink_t *iplink)
+{
+	/* XXX Synchronize with iplink_cb_conn */
+	free(iplink);
+}
+
+int iplink_send(iplink_t *iplink, iplink_sdu_t *sdu)
+{
+	async_exch_t *exch = async_exchange_begin(iplink->sess);
+
+	ipc_call_t answer;
+	aid_t req = async_send_2(exch, IPLINK_SEND, sdu->lsrc.ipv4,
+	    sdu->ldest.ipv4, &answer);
+	int rc = async_data_write_start(exch, sdu->data, sdu->size);
+	async_exchange_end(exch);
+
+	if (rc != EOK) {
+		async_wait_for(req, NULL);
+		return rc;
+	}
+
+	sysarg_t retval;
+	async_wait_for(req, &retval);
+	if (retval != EOK)
+		return retval;
+
+	return EOK;
+}
+
+int iplink_get_mtu(iplink_t *iplink, size_t *rmtu)
+{
+	sysarg_t mtu;
+	async_exch_t *exch = async_exchange_begin(iplink->sess);
+
+	int rc = async_req_0_1(exch, IPLINK_GET_MTU, &mtu);
+	async_exchange_end(exch);
+
+	if (rc != EOK)
+		return rc;
+
+	*rmtu = mtu;
+	return EOK;
+}
+
+int iplink_addr_add(iplink_t *iplink, iplink_addr_t *addr)
+{
+	async_exch_t *exch = async_exchange_begin(iplink->sess);
+
+	int rc = async_req_1_0(exch, IPLINK_ADDR_ADD, (sysarg_t)addr->ipv4);
+	async_exchange_end(exch);
+
+	return rc;
+}
+
+int iplink_addr_remove(iplink_t *iplink, iplink_addr_t *addr)
+{
+	async_exch_t *exch = async_exchange_begin(iplink->sess);
+
+	int rc = async_req_1_0(exch, IPLINK_ADDR_REMOVE, (sysarg_t)addr->ipv4);
+	async_exchange_end(exch);
+
+	return rc;
+}
+
+static void iplink_ev_recv(iplink_t *iplink, ipc_callid_t callid,
+    ipc_call_t *call)
+{
+	int rc;
+	iplink_sdu_t sdu;
+
+	sdu.lsrc.ipv4 = IPC_GET_ARG1(*call);
+	sdu.ldest.ipv4 = IPC_GET_ARG2(*call);
+
+	rc = async_data_write_accept(&sdu.data, false, 0, 0, 0, &sdu.size);
+	if (rc != EOK) {
+		async_answer_0(callid, rc);
+		return;
+	}
+
+	rc = iplink->ev_ops->recv(iplink, &sdu);
+	free(sdu.data);
+	async_answer_0(callid, rc);
+}
+
+static void iplink_cb_conn(ipc_callid_t iid, ipc_call_t *icall, void *arg)
+{
+	iplink_t *iplink = (iplink_t *)arg;
+
+	while (true) {
+		ipc_call_t call;
+		ipc_callid_t callid = async_get_call(&call);
+
+		if (!IPC_GET_IMETHOD(call)) {
+			/* TODO: Handle hangup */
+			return;
+		}
+
+		switch (IPC_GET_IMETHOD(call)) {
+		case IPLINK_EV_RECV:
+			iplink_ev_recv(iplink, callid, &call);
+			break;
+		default:
+			async_answer_0(callid, ENOTSUP);
+		}
+	}
+}
+
+/** @}
+ */
Index: uspace/lib/c/generic/iplink_srv.c
===================================================================
--- uspace/lib/c/generic/iplink_srv.c	(revision 96c0b7b7eaa75789aba2cbca8b2292d2986ea995)
+++ uspace/lib/c/generic/iplink_srv.c	(revision 96c0b7b7eaa75789aba2cbca8b2292d2986ea995)
@@ -0,0 +1,193 @@
+/*
+ * Copyright (c) 2012 Jiri Svoboda
+ * 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 libc
+ * @{
+ */
+/**
+ * @file
+ * @brief IP link server stub
+ */
+#include <errno.h>
+#include <ipc/iplink.h>
+#include <stdlib.h>
+#include <sys/types.h>
+
+#include <inet/iplink_srv.h>
+
+static void iplink_get_mtu_srv(iplink_srv_t *srv, ipc_callid_t callid,
+    ipc_call_t *call)
+{
+	int rc;
+	size_t mtu;
+
+	rc = srv->ops->get_mtu(srv, &mtu);
+	async_answer_1(callid, rc, mtu);
+}
+
+static void iplink_addr_add_srv(iplink_srv_t *srv, ipc_callid_t callid,
+    ipc_call_t *call)
+{
+	int rc;
+	iplink_srv_addr_t addr;
+
+	addr.ipv4 = IPC_GET_ARG1(*call);
+
+	rc = srv->ops->addr_add(srv, &addr);
+	async_answer_0(callid, rc);
+}
+
+static void iplink_addr_remove_srv(iplink_srv_t *srv, ipc_callid_t callid,
+    ipc_call_t *call)
+{
+	int rc;
+	iplink_srv_addr_t addr;
+
+	addr.ipv4 = IPC_GET_ARG1(*call);
+
+	rc = srv->ops->addr_remove(srv, &addr);
+	async_answer_0(callid, rc);
+}
+
+static void iplink_send_srv(iplink_srv_t *srv, ipc_callid_t callid,
+    ipc_call_t *call)
+{
+	iplink_srv_sdu_t sdu;
+	int rc;
+
+	sdu.lsrc.ipv4 = IPC_GET_ARG1(*call);
+	sdu.ldest.ipv4 = IPC_GET_ARG2(*call);
+
+	rc = async_data_write_accept(&sdu.data, false, 0, 0, 0, &sdu.size);
+	if (rc != EOK) {
+		async_answer_0(callid, rc);
+		return;
+	}
+
+	rc = srv->ops->send(srv, &sdu);
+	free(sdu.data);
+	async_answer_0(callid, rc);
+}
+
+void iplink_srv_init(iplink_srv_t *srv)
+{
+	fibril_mutex_initialize(&srv->lock);
+	srv->connected = false;
+	srv->ops = NULL;
+	srv->arg = NULL;
+	srv->client_sess = NULL;
+}
+
+int iplink_conn(ipc_callid_t iid, ipc_call_t *icall, void *arg)
+{
+	iplink_srv_t *srv = (iplink_srv_t *)arg;
+	int rc;
+
+	fibril_mutex_lock(&srv->lock);
+	if (srv->connected) {
+		fibril_mutex_unlock(&srv->lock);
+		async_answer_0(iid, EBUSY);
+		return EBUSY;
+	}
+
+	srv->connected = true;
+	fibril_mutex_unlock(&srv->lock);
+
+	/* Accept the connection */
+	async_answer_0(iid, EOK);
+
+	async_sess_t *sess = async_callback_receive(EXCHANGE_SERIALIZE);
+	if (sess == NULL)
+		return ENOMEM;
+
+	srv->client_sess = sess;
+
+	rc = srv->ops->open(srv);
+	if (rc != EOK)
+		return rc;
+
+	while (true) {
+		ipc_call_t call;
+		ipc_callid_t callid = async_get_call(&call);
+		sysarg_t method = IPC_GET_IMETHOD(call);
+
+		if (!method) {
+			/* The other side has hung up */
+			async_answer_0(callid, EOK);
+			break;
+		}
+
+		switch (method) {
+		case IPLINK_GET_MTU:
+			iplink_get_mtu_srv(srv, callid, &call);
+			break;
+		case IPLINK_SEND:
+			iplink_send_srv(srv, callid, &call);
+			break;
+		case IPLINK_ADDR_ADD:
+			iplink_addr_add_srv(srv, callid, &call);
+			break;
+		case IPLINK_ADDR_REMOVE:
+			iplink_addr_remove_srv(srv, callid, &call);
+			break;
+		default:
+			async_answer_0(callid, EINVAL);
+		}
+	}
+
+	return srv->ops->close(srv);
+}
+
+int iplink_ev_recv(iplink_srv_t *srv, iplink_srv_sdu_t *sdu)
+{
+	if (srv->client_sess == NULL)
+		return EIO;
+
+	async_exch_t *exch = async_exchange_begin(srv->client_sess);
+
+	ipc_call_t answer;
+	aid_t req = async_send_2(exch, IPLINK_EV_RECV, sdu->lsrc.ipv4,
+	    sdu->ldest.ipv4, &answer);
+	int rc = async_data_write_start(exch, sdu->data, sdu->size);
+	async_exchange_end(exch);
+
+	if (rc != EOK) {
+		async_wait_for(req, NULL);
+		return rc;
+	}
+
+	sysarg_t retval;
+	async_wait_for(req, &retval);
+	if (retval != EOK)
+		return retval;
+
+	return EOK;
+}
+
+/** @}
+ */
Index: uspace/lib/c/generic/net/icmp_api.c
===================================================================
--- uspace/lib/c/generic/net/icmp_api.c	(revision f76696fc11f7c97060cb5bfd3e184a0f78e483f9)
+++ 	(revision )
@@ -1,100 +1,0 @@
-/*
- * Copyright (c) 2009 Lukas Mejdrech
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup libc
- *  @{
- */
-
-/** @file
- * ICMP application interface implementation.
- * @see icmp_api.h
- */
-
-#include <net/icmp_api.h>
-#include <net/socket_codes.h>
-#include <net/inet.h>
-#include <net/modules.h>
-#include <net/ip_codes.h>
-#include <async.h>
-#include <sys/types.h>
-#include <sys/time.h>
-#include <errno.h>
-#include <ipc/services.h>
-#include <ipc/icmp.h>
-
-/** Requests an echo message.
- *
- * Sends a packet with specified parameters to the target host and waits for the
- * reply upto the given timeout. Blocks the caller until the reply or the
- * timeout occurs.
- *
- * @param[in] sess The ICMP session.
- * @param[in] size	The message data length in bytes.
- * @param[in] timeout	The timeout in milliseconds.
- * @param[in] ttl	The time to live.
- * @param[in] tos	The type of service.
- * @param[in] dont_fragment The value indicating whether the datagram must not
- *			be fragmented. Is used as a MTU discovery.
- * @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
- *			timeout.
- * @return		ICMP type of the received error notification.
- * @return		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.
- */
-int
-icmp_echo_msg(async_sess_t *sess, size_t size, mseconds_t timeout, ip_ttl_t ttl,
-    ip_tos_t tos, int dont_fragment, const struct sockaddr *addr,
-    socklen_t addrlen)
-{
-	aid_t message_id;
-	sysarg_t result;
-
-	if (addrlen <= 0)
-		return EINVAL;
-	
-	async_exch_t *exch = async_exchange_begin(sess);
-	
-	message_id = async_send_5(exch, NET_ICMP_ECHO, size, timeout, ttl,
-	    tos, (sysarg_t) dont_fragment, NULL);
-	
-	/* Send the address */
-	async_data_write_start(exch, addr, (size_t) addrlen);
-	
-	async_exchange_end(exch);
-
-	async_wait_for(message_id, &result);
-	return (int) result;
-}
-
-/** @}
- */
Index: uspace/lib/c/generic/net/icmp_common.c
===================================================================
--- uspace/lib/c/generic/net/icmp_common.c	(revision f76696fc11f7c97060cb5bfd3e184a0f78e483f9)
+++ 	(revision )
@@ -1,56 +1,0 @@
-/*
- * Copyright (c) 2009 Lukas Mejdrech
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup libc
- *  @{
- */
-
-/** @file
- * ICMP common interface implementation.
- * @see icmp_common.h
- */
-
-#include <net/modules.h>
-#include <net/icmp_common.h>
-#include <ipc/services.h>
-#include <ipc/icmp.h>
-#include <sys/time.h>
-#include <async.h>
-
-/** Connect to the ICMP module.
- *
- * @return ICMP module session.
- *
- */
-async_sess_t *icmp_connect_module(void)
-{
-	return connect_to_service(SERVICE_ICMP);
-}
-
-/** @}
- */
Index: uspace/lib/c/generic/net/packet.c
===================================================================
--- uspace/lib/c/generic/net/packet.c	(revision f76696fc11f7c97060cb5bfd3e184a0f78e483f9)
+++ 	(revision )
@@ -1,451 +1,0 @@
-/*
- * Copyright (c) 2009 Lukas Mejdrech
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup libc
- *  @{
- */
-
-/** @file
- *  Packet map and queue implementation.
- *  This file has to be compiled with both the packet server and the client.
- */
-
-#include <assert.h>
-#include <malloc.h>
-#include <mem.h>
-#include <fibril_synch.h>
-#include <unistd.h>
-#include <errno.h>
-
-#include <sys/mman.h>
-
-#include <adt/hash_table.h>
-#include <net/packet.h>
-#include <net/packet_header.h>
-
-/** Packet hash table size. */
-#define PACKET_HASH_TABLE_SIZE  128
-
-/** Packet map global data. */
-static struct {
-	/** Safety lock. */
-	fibril_rwlock_t lock;
-	/** Packet map. */
-	hash_table_t packet_map;
-	/** Packet map operations */
-	hash_table_operations_t operations;
-} pm_globals;
-
-typedef struct {
-	link_t link;
-	packet_t *packet;
-} pm_entry_t;
-
-/**
- * Hash function for the packet mapping hash table
- */
-static hash_index_t pm_hash(unsigned long key[])
-{
-	return (hash_index_t) key[0] % PACKET_HASH_TABLE_SIZE;
-}
-
-/**
- * Key compare function for the packet mapping hash table
- */
-static int pm_compare(unsigned long key[], hash_count_t keys, link_t *link)
-{
-	pm_entry_t *entry = list_get_instance(link, pm_entry_t, link);
-	return entry->packet->packet_id == key[0];
-}
-
-/**
- * Remove callback for the packet mapping hash table
- */
-static void pm_remove_callback(link_t *link)
-{
-	pm_entry_t *entry = list_get_instance(link, pm_entry_t, link);
-	free(entry);
-}
-
-/**
- * Wrapper used when destroying the whole table
- */
-static void pm_free_wrapper(link_t *link, void *ignored)
-{
-	pm_entry_t *entry = list_get_instance(link, pm_entry_t, link);
-	free(entry);
-}
-
-
-/** Initializes the packet map.
- *
- * @return		EOK on success.
- * @return		ENOMEM if there is not enough memory left.
- */
-int pm_init(void)
-{
-	int rc = EOK;
-
-	fibril_rwlock_initialize(&pm_globals.lock);
-	
-	fibril_rwlock_write_lock(&pm_globals.lock);
-	
-	pm_globals.operations.hash = pm_hash;
-	pm_globals.operations.compare = pm_compare;
-	pm_globals.operations.remove_callback = pm_remove_callback;
-
-	if (!hash_table_create(&pm_globals.packet_map, PACKET_HASH_TABLE_SIZE, 1,
-	    &pm_globals.operations))
-		rc = ENOMEM;
-	
-	fibril_rwlock_write_unlock(&pm_globals.lock);
-	
-	return rc;
-}
-
-/** Finds the packet mapping.
- *
- * @param[in] packet_id 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)
-{
-	if (!packet_id)
-		return NULL;
-	
-	fibril_rwlock_read_lock(&pm_globals.lock);
-	
-	unsigned long key = packet_id;
-	link_t *link = hash_table_find(&pm_globals.packet_map, &key);
-	
-	packet_t *packet;
-	if (link != NULL) {
-		pm_entry_t *entry =
-		    hash_table_get_instance(link, pm_entry_t, link);
-		packet = entry->packet;
-	} else
-		packet = NULL;
-	
-	fibril_rwlock_read_unlock(&pm_globals.lock);
-	return packet;
-}
-
-/** Adds the packet mapping.
- *
- * @param[in] packet Packet to be remembered.
- *
- * @return EOK on success.
- * @return EINVAL if the packet is not valid.
- * @return ENOMEM if there is not enough memory left.
- *
- */
-int pm_add(packet_t *packet)
-{
-	if (!packet_is_valid(packet))
-		return EINVAL;
-	
-	fibril_rwlock_write_lock(&pm_globals.lock);
-	
-	pm_entry_t *entry = malloc(sizeof(pm_entry_t));
-	if (entry == NULL) {
-		fibril_rwlock_write_unlock(&pm_globals.lock);
-		return ENOMEM;
-	}
-	
-	entry->packet = packet;
-	
-	unsigned long key = packet->packet_id;
-	hash_table_insert(&pm_globals.packet_map, &key, &entry->link);
-	
-	fibril_rwlock_write_unlock(&pm_globals.lock);
-	
-	return EOK;
-}
-
-/** Remove the packet mapping
- *
- * @param[in] packet The packet to be removed
- *
- */
-void pm_remove(packet_t *packet)
-{
-	assert(packet_is_valid(packet));
-	
-	fibril_rwlock_write_lock(&pm_globals.lock);
-	
-	unsigned long key = packet->packet_id;
-	hash_table_remove(&pm_globals.packet_map, &key, 1);
-	
-	fibril_rwlock_write_unlock(&pm_globals.lock);
-}
-
-/** Release the packet map. */
-void pm_destroy(void)
-{
-	fibril_rwlock_write_lock(&pm_globals.lock);
-	hash_table_apply(&pm_globals.packet_map, pm_free_wrapper, NULL);
-	hash_table_destroy(&pm_globals.packet_map);
-	/* Leave locked */
-}
-
-/** Add packet to the sorted queue.
- *
- * The queue is sorted in the ascending order.
- * The packet is inserted right before the packets of the same order value.
- *
- * @param[in,out] first First packet of the queue. Sets the first
- *                      packet of the queue. The original first packet
- *                      may be shifted by the new packet.
- * @param[in] packet    Packet to be added.
- * @param[in] order     Packet order value.
- * @param[in] metric    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)
-{
-	if ((!first) || (!packet_is_valid(packet)))
-		return EINVAL;
-	
-	pq_set_order(packet, order, metric);
-	if (packet_is_valid(*first)) {
-		packet_t *cur = *first;
-		
-		do {
-			if (cur->order < order) {
-				if (cur->next)
-					cur = pm_find(cur->next);
-				else {
-					cur->next = packet->packet_id;
-					packet->previous = cur->packet_id;
-					
-					return EOK;
-				}
-			} else {
-				packet->previous = cur->previous;
-				packet->next = cur->packet_id;
-				
-				cur->previous = packet->packet_id;
-				cur = pm_find(packet->previous);
-				
-				if (cur)
-					cur->next = packet->packet_id;
-				else
-					*first = packet;
-				
-				return EOK;
-			}
-		} while (packet_is_valid(cur));
-	}
-	
-	*first = packet;
-	return EOK;
-}
-
-/** Finds the packet with the given order.
- *
- * @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;
-
-	if (!packet_is_valid(packet))
-		return NULL;
-
-	item = packet;
-	do {
-		if (item->order == order)
-			return item;
-
-		item = pm_find(item->next);
-	} while (item && (item != packet) && packet_is_valid(item));
-
-	return NULL;
-}
-
-/** Inserts packet after the given one.
- *
- * @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;
-
-	if (!packet_is_valid(packet) || !packet_is_valid(new_packet))
-		return EINVAL;
-
-	new_packet->previous = packet->packet_id;
-	new_packet->next = packet->next;
-	item = pm_find(packet->next);
-	if (item)
-		item->previous = new_packet->packet_id;
-	packet->next = new_packet->packet_id;
-
-	return EOK;
-}
-
-/** Detach the packet from the queue.
- *
- * @param[in] packet	The packet to be detached.
- * @return		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;
-
-	if (!packet_is_valid(packet))
-		return NULL;
-
-	next = pm_find(packet->next);
-	if (next)
-		next->previous = packet->previous;
-	
-	previous = pm_find(packet->previous);
-	if (previous)
-		previous->next = packet->next ;
-	
-	packet->previous = 0;
-	packet->next = 0;
-	return next;
-}
-
-/** Sets the packet order and metric attributes.
- *
- * @param[in] packeti	The packet to be set.
- * @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)
-{
-	if (!packet_is_valid(packet))
-		return EINVAL;
-
-	packet->order = order;
-	packet->metric = metric;
-	return EOK;
-}
-
-/** Sets the packet order and metric attributes.
- *
- * @param[in] packet	The packet to be set.
- * @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)
-{
-	if (!packet_is_valid(packet))
-		return EINVAL;
-
-	if (order)
-		*order = packet->order;
-
-	if (metric)
-		*metric = packet->metric;
-
-	return EOK;
-}
-
-/** Releases the whole queue.
- *
- * Detaches all packets of the queue and calls the packet_release() for each of
- * them.
- *
- * @param[in] first	The first packet of the queue.
- * @param[in] packet_release The releasing function called for each of the
- *			packets after its detachment.
- */
-void pq_destroy(packet_t *first, void (*packet_release)(packet_t *packet))
-{
-	packet_t *actual;
-	packet_t *next;
-
-	actual = first;
-	while (packet_is_valid(actual)) {
-		next = pm_find(actual->next);
-		actual->next = 0;
-		actual->previous = 0;
-		if(packet_release)
-			packet_release(actual);
-		actual = next;
-	}
-}
-
-/** Returns the next packet in the queue.
- *
- * @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)
-{
-	if (!packet_is_valid(packet))
-		return NULL;
-
-	return pm_find(packet->next);
-}
-
-/** Returns the previous packet in the queue.
- *
- * @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)
-{
-	if (!packet_is_valid(packet))
-		return NULL;
-
-	return pm_find(packet->previous);
-}
-
-/** @}
- */
Index: uspace/lib/c/include/adt/measured_strings.h
===================================================================
--- uspace/lib/c/include/adt/measured_strings.h	(revision f76696fc11f7c97060cb5bfd3e184a0f78e483f9)
+++ 	(revision )
@@ -1,76 +1,0 @@
-/*
- * Copyright (c) 2009 Lukas Mejdrech
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup libc
- *  @{
- */
-
-/** @file
- * Character string with measured length.
- * The structure has been designed for serialization of character strings
- * between modules.
- */
-
-#ifndef LIBC_MEASURED_STRINGS_H_
-#define LIBC_MEASURED_STRINGS_H_
-
-#include <sys/types.h>
-#include <async.h>
-
-/** Type definition of the character string with measured length.
- * @see measured_string
- */
-typedef struct measured_string measured_string_t;
-
-/** Character string with measured length.
- *
- * This structure has been designed for serialization of character strings
- * between modules.
- */
-struct measured_string {
-	/** Character string data. */
-	uint8_t *value;
-	/** Character string length. */
-	size_t length;
-};
-
-extern measured_string_t *measured_string_create_bulk(const uint8_t *, size_t);
-extern measured_string_t *measured_string_copy(measured_string_t *);
-
-extern int measured_strings_receive(measured_string_t **, uint8_t **, size_t);
-extern int measured_strings_reply(const measured_string_t *, size_t);
-
-extern int measured_strings_return(async_exch_t *, measured_string_t **,
-    uint8_t **, size_t);
-extern int measured_strings_send(async_exch_t *, const measured_string_t *,
-    size_t);
-
-#endif
-
-/** @}
- */
Index: uspace/lib/c/include/inet/inet.h
===================================================================
--- uspace/lib/c/include/inet/inet.h	(revision 96c0b7b7eaa75789aba2cbca8b2292d2986ea995)
+++ uspace/lib/c/include/inet/inet.h	(revision 96c0b7b7eaa75789aba2cbca8b2292d2986ea995)
@@ -0,0 +1,69 @@
+/*
+ * Copyright (c) 2012 Jiri Svoboda
+ * 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 libc
+ * @{
+ */
+/** @file
+ */
+
+#ifndef LIBC_INET_INET_H_
+#define LIBC_INET_INET_H_
+
+#include <sys/types.h>
+
+#define INET_TTL_MAX 255
+
+typedef struct {
+	uint32_t ipv4;
+} inet_addr_t;
+
+typedef struct {
+	inet_addr_t src;
+	inet_addr_t dest;
+	uint8_t tos;
+	void *data;
+	size_t size;
+} inet_dgram_t;
+
+typedef struct {
+	int (*recv)(inet_dgram_t *);
+} inet_ev_ops_t;
+
+typedef enum {
+	INET_DF = 1
+} inet_df_t;
+
+extern int inet_init(uint8_t, inet_ev_ops_t *);
+extern int inet_send(inet_dgram_t *, uint8_t, inet_df_t);
+extern int inet_get_srcaddr(inet_addr_t *, uint8_t, inet_addr_t *);
+
+#endif
+
+/** @}
+ */
Index: uspace/lib/c/include/inet/inetcfg.h
===================================================================
--- uspace/lib/c/include/inet/inetcfg.h	(revision 96c0b7b7eaa75789aba2cbca8b2292d2986ea995)
+++ uspace/lib/c/include/inet/inetcfg.h	(revision 96c0b7b7eaa75789aba2cbca8b2292d2986ea995)
@@ -0,0 +1,95 @@
+/*
+ * Copyright (c) 2012 Jiri Svoboda
+ * 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 libc
+ * @{
+ */
+/** @file
+ */
+
+#ifndef LIBC_INET_INETCFG_H_
+#define LIBC_INET_INETCFG_H_
+
+#include <inet/inet.h>
+#include <sys/types.h>
+
+/** Network address */
+typedef struct {
+	/** Address */
+	uint32_t ipv4;
+	/** Number of valid bits in @c ipv4 */
+	int bits;
+} inet_naddr_t;
+
+/** Address object info */
+typedef struct {
+	/** Network address */
+	inet_naddr_t naddr;
+	/** Link service ID */
+	sysarg_t ilink;
+	/** Address object name */
+	char *name;
+} inet_addr_info_t;
+
+/** IP link info */
+typedef struct {
+	/** Link service name */
+	char *name;
+	/** Default MTU */
+	size_t def_mtu;
+} inet_link_info_t;
+
+/** Static route info */
+typedef struct {
+	/** Destination network address */
+	inet_naddr_t dest;
+	/** Router address */
+	inet_addr_t router;
+	/** Static route name */
+	char *name;
+} inet_sroute_info_t;
+
+extern int inetcfg_init(void);
+extern int inetcfg_addr_create_static(const char *, inet_naddr_t *, sysarg_t, sysarg_t *);
+extern int inetcfg_addr_delete(sysarg_t);
+extern int inetcfg_addr_get(sysarg_t, inet_addr_info_t *);
+extern int inetcfg_addr_get_id(const char *, sysarg_t, sysarg_t *);
+extern int inetcfg_get_addr_list(sysarg_t **, size_t *);
+extern int inetcfg_get_link_list(sysarg_t **, size_t *);
+extern int inetcfg_get_sroute_list(sysarg_t **, size_t *);
+extern int inetcfg_link_get(sysarg_t, inet_link_info_t *);
+extern int inetcfg_sroute_get(sysarg_t, inet_sroute_info_t *);
+extern int inetcfg_sroute_get_id(const char *, sysarg_t *);
+extern int inetcfg_sroute_create(const char *, inet_naddr_t *, inet_addr_t *,
+    sysarg_t *);
+extern int inetcfg_sroute_delete(sysarg_t);
+
+#endif
+
+/** @}
+ */
Index: uspace/lib/c/include/inet/inetping.h
===================================================================
--- uspace/lib/c/include/inet/inetping.h	(revision 96c0b7b7eaa75789aba2cbca8b2292d2986ea995)
+++ uspace/lib/c/include/inet/inetping.h	(revision 96c0b7b7eaa75789aba2cbca8b2292d2986ea995)
@@ -0,0 +1,61 @@
+/*
+ * Copyright (c) 2012 Jiri Svoboda
+ * 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 libc
+ * @{
+ */
+/** @file
+ */
+
+#ifndef LIBC_INET_INETPING_H_
+#define LIBC_INET_INETPING_H_
+
+#include <inet/inet.h>
+#include <sys/types.h>
+
+typedef struct {
+	inet_addr_t src;
+	inet_addr_t dest;
+	uint16_t seq_no;
+	void *data;
+	size_t size;
+} inetping_sdu_t;
+
+typedef struct inetping_ev_ops {
+	int (*recv)(inetping_sdu_t *);
+} inetping_ev_ops_t;
+
+extern int inetping_init(inetping_ev_ops_t *);
+extern int inetping_send(inetping_sdu_t *);
+extern int inetping_get_srcaddr(inet_addr_t *, inet_addr_t *);
+
+
+#endif
+
+/** @}
+ */
Index: uspace/lib/c/include/inet/iplink.h
===================================================================
--- uspace/lib/c/include/inet/iplink.h	(revision 96c0b7b7eaa75789aba2cbca8b2292d2986ea995)
+++ uspace/lib/c/include/inet/iplink.h	(revision 96c0b7b7eaa75789aba2cbca8b2292d2986ea995)
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2012 Jiri Svoboda
+ * 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 libc
+ * @{
+ */
+/** @file
+ */
+
+#ifndef LIBC_INET_IPLINK_H_
+#define LIBC_INET_IPLINK_H_
+
+#include <async.h>
+#include <sys/types.h>
+
+struct iplink_ev_ops;
+
+typedef struct {
+	async_sess_t *sess;
+	struct iplink_ev_ops *ev_ops;
+} iplink_t;
+
+typedef struct {
+	uint32_t ipv4;
+} iplink_addr_t;
+
+/** IP link Service Data Unit */
+typedef struct {
+	/** Local source address */
+	iplink_addr_t lsrc;
+	/** Local destination address */
+	iplink_addr_t ldest;
+	/** Serialized IP packet */
+	void *data;
+	/** Size of @c data in bytes */
+	size_t size;
+} iplink_sdu_t;
+
+typedef struct iplink_ev_ops {
+	int (*recv)(iplink_t *, iplink_sdu_t *);
+} iplink_ev_ops_t;
+
+extern int iplink_open(async_sess_t *, iplink_ev_ops_t *, iplink_t **);
+extern void iplink_close(iplink_t *);
+extern int iplink_send(iplink_t *, iplink_sdu_t *);
+extern int iplink_addr_add(iplink_t *, iplink_addr_t *);
+extern int iplink_addr_remove(iplink_t *, iplink_addr_t *);
+extern int iplink_get_mtu(iplink_t *, size_t *);
+
+#endif
+
+/** @}
+ */
Index: uspace/lib/c/include/inet/iplink_srv.h
===================================================================
--- uspace/lib/c/include/inet/iplink_srv.h	(revision 96c0b7b7eaa75789aba2cbca8b2292d2986ea995)
+++ uspace/lib/c/include/inet/iplink_srv.h	(revision 96c0b7b7eaa75789aba2cbca8b2292d2986ea995)
@@ -0,0 +1,86 @@
+/*
+ * Copyright (c) 2012 Jiri Svoboda
+ * 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 libc
+ * @{
+ */
+/** @file
+ */
+
+#ifndef LIBC_INET_IPLINK_SRV_H_
+#define LIBC_INET_IPLINK_SRV_H_
+
+#include <async.h>
+#include <fibril_synch.h>
+#include <bool.h>
+#include <sys/types.h>
+
+struct iplink_ops;
+
+typedef struct {
+	fibril_mutex_t lock;
+	bool connected;
+	struct iplink_ops *ops;
+	void *arg;
+	async_sess_t *client_sess;
+} iplink_srv_t;
+
+typedef struct {
+	uint32_t ipv4;
+} iplink_srv_addr_t;
+
+/** IP link Service Data Unit */
+typedef struct {
+	/** Local source address */
+	iplink_srv_addr_t lsrc;
+	/** Local destination address */
+	iplink_srv_addr_t ldest;
+	/** Serialized IP packet */
+	void *data;
+	/** Size of @c data in bytes */
+	size_t size;
+} iplink_srv_sdu_t;
+
+typedef struct iplink_ops {
+	int (*open)(iplink_srv_t *);
+	int (*close)(iplink_srv_t *);
+	int (*send)(iplink_srv_t *, iplink_srv_sdu_t *);
+	int (*get_mtu)(iplink_srv_t *, size_t *);
+	int (*addr_add)(iplink_srv_t *, iplink_srv_addr_t *);
+	int (*addr_remove)(iplink_srv_t *, iplink_srv_addr_t *);
+} iplink_ops_t;
+
+extern void iplink_srv_init(iplink_srv_t *);
+
+extern int iplink_conn(ipc_callid_t, ipc_call_t *, void *);
+extern int iplink_ev_recv(iplink_srv_t *, iplink_srv_sdu_t *);
+
+#endif
+
+/** @}
+ */
Index: uspace/lib/c/include/ipc/arp.h
===================================================================
--- uspace/lib/c/include/ipc/arp.h	(revision f76696fc11f7c97060cb5bfd3e184a0f78e483f9)
+++ 	(revision )
@@ -1,82 +1,0 @@
-/*
- * Copyright (c) 2009 Lukas Mejdrech
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup libc
- * @{
- */
-
-/** @file
- * ARP module messages.
- * @see arp_interface.h
- */
-
-#ifndef LIBC_ARP_MESSAGES_
-#define LIBC_ARP_MESSAGES_
-
-#include <ipc/net.h>
-
-/** ARP module messages. */
-typedef enum {
-	/** Clean cache message.
-	 * @see arp_clean_cache()
-	 */
-	NET_ARP_CLEAN_CACHE = NET_ARP_FIRST,
-	/** Clear address cache message.
-	 * @see arp_clear_address_msg()
-	 */
-	NET_ARP_CLEAR_ADDRESS,
-	/** Clear device cache message.
-	 * @see arp_clear_device_req()
-	 */
-	NET_ARP_CLEAR_DEVICE,
-	/** New device message.
-	 * @see arp_device_req()
-	 */
-	NET_ARP_DEVICE,
-	/** Address translation message.
-	 * @see arp_translate_req()
-	 */
-	NET_ARP_TRANSLATE
-} arp_messages;
-
-/** @name ARP specific message parameters definitions */
-/*@{*/
-
-/** Return the protocol service message parameter.
- *
- * @param[in] call Message call structure.
- *
- */
-#define ARP_GET_NETIF(call) ((services_t) IPC_GET_ARG2(call))
-
-/*@}*/
-
-#endif
-
-/** @}
- */
Index: uspace/lib/c/include/ipc/icmp.h
===================================================================
--- uspace/lib/c/include/ipc/icmp.h	(revision f76696fc11f7c97060cb5bfd3e184a0f78e483f9)
+++ 	(revision )
@@ -1,139 +1,0 @@
-/*
- * Copyright (c) 2009 Lukas Mejdrech
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup libc
- * @{
- */
-
-/** @file
- * ICMP module messages.
- * @see icmp_remote.h
- */
-
-#ifndef LIBC_ICMP_MESSAGES_
-#define LIBC_ICMP_MESSAGES_
-
-#include <ipc/net.h>
-#include <sys/types.h>
-#include <sys/time.h>
-#include <net/icmp_codes.h>
-
-/** ICMP module messages. */
-typedef enum {
-	/** Send echo request. @see icmp_echo() */
-	NET_ICMP_ECHO = NET_ICMP_FIRST,
-	
-	/**
-	 * Send destination unreachable error message.
-	 * @see icmp_destination_unreachable_msg()
-	 */
-	NET_ICMP_DEST_UNREACH,
-	
-	/**
-	 * Send source quench error message.
-	 * @see icmp_source_quench_msg()
-	 */
-	NET_ICMP_SOURCE_QUENCH,
-	
-	/**
-	 * Send time exceeded error message.
-	 * @see icmp_time_exceeded_msg()
-	 */
-	NET_ICMP_TIME_EXCEEDED,
-	
-	/**
-	 * Send parameter problem error message.
-	 * @see icmp_parameter_problem_msg()
-	 */
-	NET_ICMP_PARAMETERPROB
-} icmp_messages_t;
-
-/** @name ICMP specific message parameters definitions */
-/*@{*/
-
-/** Return the ICMP code message parameter.
- *
- * @param[in] call Message call structure.
- *
- */
-#define ICMP_GET_CODE(call)  ((icmp_code_t) IPC_GET_ARG1(call))
-
-/** Return the ICMP link MTU message parameter.
- *
- * @param[in] call Message call structure.
- *
- */
-#define ICMP_GET_MTU(call)  ((icmp_param_t) IPC_GET_ARG3(call))
-
-/** Return the pointer message parameter.
- *
- * @param[in] call Message call structure.
- *
- */
-#define ICMP_GET_POINTER(call)  ((icmp_param_t) IPC_GET_ARG3(call))
-
-/** Return the size message parameter.
- *
- * @param[in] call Message call structure.
- *
- */
-#define ICMP_GET_SIZE(call)  ((size_t) IPC_GET_ARG1(call))
-
-/** Return the timeout message parameter.
- *
- * @param[in] call Message call structure.
- *
- */
-#define ICMP_GET_TIMEOUT(call)  ((suseconds_t) IPC_GET_ARG2(call))
-
-/** Return the time to live message parameter.
- *
- * @param[in] call Message call structure.
- *
- */
-#define ICMP_GET_TTL(call)  ((ip_ttl_t) IPC_GET_ARG3(call))
-
-/** Return the type of service message parameter.
- *
- * @param[in] call Message call structure.
- *
- */
-#define ICMP_GET_TOS(call)  ((ip_tos_t) IPC_GET_ARG4(call))
-
-/** Return the dont fragment message parameter.
- *
- * @param[in] call Message call structure.
- */
-#define ICMP_GET_DONT_FRAGMENT(call)  ((int) IPC_GET_ARG5(call))
-
-/*@}*/
-
-#endif
-
-/** @}
- */
Index: uspace/lib/c/include/ipc/il.h
===================================================================
--- uspace/lib/c/include/ipc/il.h	(revision f76696fc11f7c97060cb5bfd3e184a0f78e483f9)
+++ 	(revision )
@@ -1,90 +1,0 @@
-/*
- * Copyright (c) 2009 Lukas Mejdrech
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup libc
- * @{
- */
-
-/** @file
- * Internetwork layer modules messages.
- * @see il_remote.h
- * @see ip_interface.h
- */
-
-#ifndef LIBC_IL_MESSAGES_H_
-#define LIBC_IL_MESSAGES_H_
-
-#include <ipc/net.h>
-
-/** Internet layer modules messages. */
-typedef enum {
-	/** Device state changed message.
-	 * @see il_device_state_msg()
-	 */
-	NET_IL_DEVICE_STATE = NET_IL_FIRST,
-	
-	/** Device MTU changed message.
-	 * @see il_mtu_changed_msg()
-	 */
-	NET_IL_MTU_CHANGED,
-	
-	/**
-	 * Device address changed message
-	 * @see il_addr_changed_msg()
-	 */
-	NET_IL_ADDR_CHANGED,
-
-	/** Packet received message.
-	 * @see il_received_msg()
-	 */
-	NET_IL_RECEIVED
-} il_messages;
-
-/** @name Internetwork layer specific message parameters definitions */
-/*@{*/
-
-/** Return the protocol number message parameter.
- *
- * @param[in] call Message call structure.
- *
- */
-#define IL_GET_PROTO(call)  ((int) IPC_GET_ARG1(call))
-
-/** Return the registering service message parameter.
- *
- * @param[in] call Message call structure.
- *
- */
-#define IL_GET_SERVICE(call)  ((services_t) IPC_GET_ARG2(call))
-
-/*@}*/
-
-#endif
-
-/** @}
- */
Index: uspace/lib/c/include/ipc/inet.h
===================================================================
--- uspace/lib/c/include/ipc/inet.h	(revision 96c0b7b7eaa75789aba2cbca8b2292d2986ea995)
+++ uspace/lib/c/include/ipc/inet.h	(revision 96c0b7b7eaa75789aba2cbca8b2292d2986ea995)
@@ -0,0 +1,94 @@
+/*
+ * Copyright (c) 2012 Jiri Svoboda
+ * 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 libcipc
+ * @{
+ */
+/** @file
+ */
+
+#ifndef LIBC_IPC_INET_H_
+#define LIBC_IPC_INET_H_
+
+#include <ipc/common.h>
+
+/** Inet ports */
+typedef enum {
+	/** Default port */
+	INET_PORT_DEFAULT = 1,
+	/** Configuration port */
+	INET_PORT_CFG,
+	/** Ping service port */
+	INET_PORT_PING
+} inet_port_t;
+
+/** Requests on Inet default port */
+typedef enum {
+	INET_CALLBACK_CREATE = IPC_FIRST_USER_METHOD,
+	INET_GET_SRCADDR,
+	INET_SEND,
+	INET_SET_PROTO
+} inet_request_t;
+
+/** Events on Inet default port */
+typedef enum {
+	INET_EV_RECV = IPC_FIRST_USER_METHOD
+} inet_event_t;
+
+/** Requests on Inet configuration port */
+typedef enum {
+	INETCFG_ADDR_CREATE_STATIC = IPC_FIRST_USER_METHOD,
+	INETCFG_ADDR_DELETE,
+	INETCFG_ADDR_GET,
+	INETCFG_ADDR_GET_ID,
+	INETCFG_GET_ADDR_LIST,
+	INETCFG_GET_LINK_LIST,
+	INETCFG_GET_SROUTE_LIST,
+	INETCFG_LINK_GET,
+	INETCFG_SROUTE_CREATE,
+	INETCFG_SROUTE_DELETE,
+	INETCFG_SROUTE_GET,
+	INETCFG_SROUTE_GET_ID
+} inetcfg_request_t;
+
+/** Events on Inet ping port */
+typedef enum {
+	INETPING_EV_RECV = IPC_FIRST_USER_METHOD
+} inetping_event_t;
+
+/** Requests on Inet ping port */
+typedef enum {
+	INETPING_SEND = IPC_FIRST_USER_METHOD,
+	INETPING_GET_SRCADDR
+} inetping_request_t;
+
+#endif
+
+/**
+ * @}
+ */
Index: uspace/lib/c/include/ipc/ip.h
===================================================================
--- uspace/lib/c/include/ipc/ip.h	(revision f76696fc11f7c97060cb5bfd3e184a0f78e483f9)
+++ 	(revision )
@@ -1,141 +1,0 @@
-/*
- * Copyright (c) 2009 Lukas Mejdrech
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup libc
- * @{
- */
-
-/** @file
- * IP module messages.
- * @see ip_interface.h
- */
-
-#ifndef LIBC_IP_MESSAGES_H_
-#define LIBC_IP_MESSAGES_H_
-
-#include <ipc/net.h>
-#include <net/in.h>
-#include <net/ip_codes.h>
-
-/** IP module messages. */
-typedef enum {
-	/** New device message.
-	 * @see ip_device_req()
-	 */
-	NET_IP_DEVICE = NET_IP_FIRST,
-	
-	/** Adds the routing entry.
-	 * @see ip_add_route()
-	 */
-	NET_IP_ADD_ROUTE,
-	
-	/** Gets the actual route information.
-	 * @see ip_get_route()
-	 */
-	NET_IP_GET_ROUTE,
-	
-	/** Processes the received error notification.
-	 * @see ip_received_error_msg()
-	 */
-	NET_IP_RECEIVED_ERROR,
-	
-	/** Sets the default gateway.
-	 * @see ip_set_default_gateway()
-	 */
-	NET_IP_SET_GATEWAY,
-	
-	/** Packet size message.
-	 * @see ip_packet_size_req()
-	 */
-	NET_IP_PACKET_SPACE,
-	
-	/** Packet send message.
-	 * @see ip_send_msg()
-	 */
-	NET_IP_SEND
-} ip_messages;
-
-/** @name IP specific message parameters definitions */
-/*@{*/
-
-/** Return the address message parameter.
- *
- * @param[in] call Message call structure.
- *
- */
-#define IP_GET_ADDRESS(call) \
-	({ \
-		in_addr_t addr; \
-		addr.s_addr = IPC_GET_ARG3(call); \
-		addr; \
-	})
-
-/** Return the gateway message parameter.
- *
- * @param[in] call Message call structure.
- *
- */
-#define IP_GET_GATEWAY(call) \
-	({ \
-		in_addr_t addr; \
-		addr.s_addr = IPC_GET_ARG2(call); \
-		addr; \
-	})
-
-/** Set the header length in the message answer.
- *
- * @param[out] answer Message answer structure.
- *
- */
-#define IP_SET_HEADERLEN(answer, value)  IPC_SET_ARG2(answer, (sysarg_t) (value))
-
-/** Return the network mask message parameter.
- *
- * @param[in] call Message call structure.
- *
- */
-#define IP_GET_NETMASK(call) \
-	({ \
-		in_addr_t addr; \
-		addr.s_addr = IPC_GET_ARG4(call); \
-		addr; \
-	})
-
-/** Return the protocol message parameter.
- *
- * @param[in] call Message call structure.
- *
- */
-#define IP_GET_PROTOCOL(call)  ((ip_protocol_t) IPC_GET_ARG1(call))
-
-/*@}*/
-
-#endif
-
-/** @}
- */
Index: uspace/lib/c/include/ipc/iplink.h
===================================================================
--- uspace/lib/c/include/ipc/iplink.h	(revision 96c0b7b7eaa75789aba2cbca8b2292d2986ea995)
+++ uspace/lib/c/include/ipc/iplink.h	(revision 96c0b7b7eaa75789aba2cbca8b2292d2986ea995)
@@ -0,0 +1,55 @@
+/*
+ * Copyright (c) 2012 Jiri Svoboda
+ * 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 libcipc
+ * @{
+ */
+/** @file
+ */
+
+#ifndef LIBC_IPC_IPLINK_H_
+#define LIBC_IPC_IPLINK_H_
+
+#include <ipc/common.h>
+
+typedef enum {
+	IPLINK_GET_MTU = IPC_FIRST_USER_METHOD,
+	IPLINK_SEND,
+	IPLINK_ADDR_ADD,
+	IPLINK_ADDR_REMOVE
+} iplink_request_t;
+
+typedef enum {
+	IPLINK_EV_RECV = IPC_FIRST_USER_METHOD
+} iplink_event_t;
+
+#endif
+
+/**
+ * @}
+ */
Index: uspace/lib/c/include/ipc/net.h
===================================================================
--- uspace/lib/c/include/ipc/net.h	(revision f76696fc11f7c97060cb5bfd3e184a0f78e483f9)
+++ 	(revision )
@@ -1,389 +1,0 @@
-/*
- * Copyright (c) 2009 Lukas Mejdrech
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup libcipc
- *  @{
- */
-
-/** @file
- *  Networking common message definitions.
- */
-
-#ifndef LIBC_NET_MESSAGES_H_
-#define LIBC_NET_MESSAGES_H_
-
-#include <ipc/services.h>
-#include <net/device.h>
-#include <net/packet.h>
-
-/** Return a value indicating whether the value is in the interval.
- *
- * @param[in] item            Value to be checked.
- * @param[in] first_inclusive First value in the interval inclusive.
- * @param[in] last_exclusive  First value after the interval.
- *
- */
-#define IS_IN_INTERVAL(item, first_inclusive, last_exclusive) \
-	(((item) >= (first_inclusive)) && ((item) < (last_exclusive)))
-
-/** @name Networking message counts */
-/*@{*/
-
-#define NET_ARP_COUNT     5   /**< Number of ARP messages. */
-#define NET_ETH_COUNT     0   /**< Number of Ethernet messages. */
-#define NET_ICMP_COUNT    6   /**< Number of ICMP messages. */
-#define NET_IL_COUNT      6   /**< Number of inter-network messages. */
-#define NET_IP_COUNT      4   /**< Number of IP messages. */
-#define NET_NET_COUNT     3   /**< Number of general networking messages. */
-#define NET_NETIF_COUNT   6   /**< Number of network interface driver messages. */
-#define NET_NIL_COUNT     7   /**< Number of network interface layer messages. */
-#define NET_PACKET_COUNT  5   /**< Number of packet management system messages. */
-#define NET_SOCKET_COUNT  14  /**< Number of socket messages. */
-#define NET_TCP_COUNT     0   /**< Number of TCP messages. */
-#define NET_TL_COUNT      1   /**< Number of transport layer messages. */
-#define NET_UDP_COUNT     0   /**< Number of UDP messages. */
-
-/*@}*/
-
-/** @name Networking message intervals
- */
-/*@{*/
-
-
-/** First networking message. */
-#define NET_FIRST  2000
-
-/** First network interface layer message. */
-#define NET_NETIF_FIRST  NET_FIRST
-
-/** Last network interface layer message. */
-#define NET_NETIF_LAST  (NET_NETIF_FIRST + NET_NETIF_COUNT)
-
-/** First general networking message. */
-#define NET_NET_FIRST  (NET_NETIF_LAST + 0)
-
-/** Last general networking message. */
-#define NET_NET_LAST  (NET_NET_FIRST + NET_NET_COUNT)
-
-/** First network interface layer message. */
-#define NET_NIL_FIRST  (NET_NET_LAST + 0)
-
-/** Last network interface layer message. */
-#define NET_NIL_LAST  (NET_NIL_FIRST + NET_NIL_COUNT)
-
-/** First Ethernet message. */
-#define NET_ETH_FIRST  (NET_NIL_LAST + 0)
-
-/** Last Ethernet message. */
-#define NET_ETH_LAST  (NET_ETH_FIRST + NET_ETH_COUNT)
-
-/** First inter-network message. */
-#define NET_IL_FIRST  (NET_ETH_LAST + 0)
-
-/** Last inter-network message. */
-#define NET_IL_LAST  (NET_IL_FIRST + NET_IL_COUNT)
-
-/** First IP message. */
-#define NET_IP_FIRST  (NET_IL_LAST + 0)
-
-/** Last IP message. */
-#define NET_IP_LAST  (NET_IP_FIRST + NET_IP_COUNT)
-
-/** First ARP message. */
-#define NET_ARP_FIRST  (NET_IP_LAST + 0)
-
-/** Last ARP message. */
-#define NET_ARP_LAST  (NET_ARP_FIRST + NET_ARP_COUNT)
-
-/** First ICMP message. */
-#define NET_ICMP_FIRST  (NET_ARP_LAST + 0)
-
-/** Last ICMP message. */
-#define NET_ICMP_LAST  (NET_ICMP_FIRST + NET_ICMP_COUNT)
-
-/** First ICMP message. */
-#define NET_TL_FIRST  (NET_ICMP_LAST + 0)
-
-/** Last ICMP message. */
-#define NET_TL_LAST  (NET_TL_FIRST + NET_TL_COUNT)
-
-/** First UDP message. */
-#define NET_UDP_FIRST  (NET_TL_LAST + 0)
-
-/** Last UDP message. */
-#define NET_UDP_LAST  (NET_UDP_FIRST + NET_UDP_COUNT)
-
-/** First TCP message. */
-#define NET_TCP_FIRST  (NET_UDP_LAST + 0)
-
-/** Last TCP message. */
-#define NET_TCP_LAST  (NET_TCP_FIRST + NET_TCP_COUNT)
-
-/** First socket message. */
-#define NET_SOCKET_FIRST  (NET_TCP_LAST + 0)
-
-/** Last socket message. */
-#define NET_SOCKET_LAST  (NET_SOCKET_FIRST + NET_SOCKET_COUNT)
-
-/** First packet management system message. */
-#define NET_PACKET_FIRST  (NET_SOCKET_LAST + 0)
-
-/** Last packet management system message. */
-#define NET_PACKET_LAST  (NET_PACKET_FIRST + NET_PACKET_COUNT)
-
-/** Last networking message. */
-#define NET_LAST  NET_PACKET_LAST
-
-/** Number of networking messages. */
-#define NET_COUNT  (NET_LAST - NET_FIRST)
-
-/** Check if the IPC call is a generic networking message.
- *
- * @param[in] call IPC call to be checked.
- *
- */
-#define IS_NET_MESSAGE(call) \
-	IS_IN_INTERVAL(IPC_GET_IMETHOD(call), NET_FIRST, NET_LAST)
-
-/** Check if the IPC call is an ARP message.
- *
- * @param[in] call IPC call to be checked.
- *
- */
-#define IS_NET_ARP_MESSAGE(call) \
-	IS_IN_INTERVAL(IPC_GET_IMETHOD(call), NET_ARP_FIRST, NET_ARP_LAST)
-
-/** Check if the IPC call is an Ethernet message.
- *
- * @param[in] call IPC call to be checked.
- *
- */
-#define IS_NET_ETH_MESSAGE(call) \
-	IS_IN_INTERVAL(IPC_GET_IMETHOD(call), NET_ETH_FIRST, NET_ETH_LAST)
-
-/** Check if the IPC call is an ICMP message.
- *
- * @param[in] call IPC call to be checked.
- *
- */
-#define IS_NET_ICMP_MESSAGE(call) \
-	IS_IN_INTERVAL(IPC_GET_IMETHOD(call), NET_ICMP_FIRST, NET_ICMP_LAST)
-
-/** Check if the IPC call is an inter-network layer message.
- *
- * @param[in] call IPC call to be checked.
- *
- */
-#define IS_NET_IL_MESSAGE(call) \
-	IS_IN_INTERVAL(IPC_GET_IMETHOD(call), NET_IL_FIRST, NET_IL_LAST)
-
-/** Check if the IPC call is an IP message.
- *
- * @param[in] call IPC call to be checked.
- *
- */
-#define IS_NET_IP_MESSAGE(call) \
-	IS_IN_INTERVAL(IPC_GET_IMETHOD(call), NET_IP_FIRST, NET_IP_LAST)
-
-/** Check if the IPC call is a generic networking message.
- *
- * @param[in] call IPC call to be checked.
- *
- */
-#define IS_NET_NET_MESSAGE(call) \
-	IS_IN_INTERVAL(IPC_GET_IMETHOD(call), NET_NET_FIRST, NET_NET_LAST)
-
-/** Check if the IPC call is a network interface layer message.
- *
- * @param[in] call IPC call to be checked.
- *
- */
-#define IS_NET_NIL_MESSAGE(call) \
-	IS_IN_INTERVAL(IPC_GET_IMETHOD(call), NET_NIL_FIRST, NET_NIL_LAST)
-
-/** Check if the IPC call is a packet manaagement system message.
- *
- * @param[in] call IPC call to be checked.
- *
- */
-#define IS_NET_PACKET_MESSAGE(call) \
-	IS_IN_INTERVAL(IPC_GET_IMETHOD(call), NET_PACKET_FIRST, NET_PACKET_LAST)
-
-/** Check if the IPC call is a socket message.
- *
- * @param[in] call IPC call to be checked.
- *
- */
-#define IS_NET_SOCKET_MESSAGE(call) \
-	IS_IN_INTERVAL(IPC_GET_IMETHOD(call), NET_SOCKET_FIRST, NET_SOCKET_LAST)
-
-/** Check if the IPC call is a TCP message.
- *
- * @param[in] call IPC call to be checked.
- *
- */
-#define IS_NET_TCP_MESSAGE(call) \
-	IS_IN_INTERVAL(IPC_GET_IMETHOD(call), NET_TCP_FIRST, NET_TCP_LAST)
-
-/** Check if the IPC call is a transport layer message.
- *
- * @param[in] call IPC call to be checked.
- *
- */
-#define IS_NET_TL_MESSAGE(call) \
-	IS_IN_INTERVAL(IPC_GET_IMETHOD(call), NET_TL_FIRST, NET_TL_LAST)
-
-/** Check if the IPC call is a UDP message.
- *
- * @param[in] call IPC call to be checked.
- *
- */
-#define IS_NET_UDP_MESSAGE(call) \
-	IS_IN_INTERVAL(IPC_GET_IMETHOD(call), NET_UDP_FIRST, NET_UDP_LAST)
-
-/*@}*/
-
-/** @name Networking specific message arguments definitions */
-/*@{*/
-
-/** Return the device identifier message argument.
- *
- * @param[in] call Message call structure.
- *
- */
-#define IPC_GET_DEVICE(call)  ((nic_device_id_t) IPC_GET_ARG1(call))
-
-/** Return the packet identifier message argument.
- *
- * @param[in] call Message call structure.
- *
- */
-#define IPC_GET_PACKET(call)  ((packet_id_t) IPC_GET_ARG2(call))
-
-/** Return the count message argument.
- *
- * @param[in] call Message call structure.
- *
- */
-#define IPC_GET_COUNT(call)  ((size_t) IPC_GET_ARG2(call))
-
-/** Return the device state message argument.
- *
- * @param[in] call Message call structure.
- *
- */
-#define IPC_GET_STATE(call)  ((nic_device_state_t) IPC_GET_ARG2(call))
-
-/** Return the device handle argument
- *
- * @param[in] call Message call structure
- *
- */
-#define IPC_GET_DEVICE_HANDLE(call)  ((service_id_t) IPC_GET_ARG2(call))
-
-/** Return the device driver service message argument.
- *
- * @param[in] call Message call structure.
- *
- */
-#define IPC_GET_SERVICE(call)  ((services_t) IPC_GET_ARG3(call))
-
-/** Return the target service message argument.
- *
- * @param[in] call Message call structure.
- *
- */
-#define IPC_GET_TARGET(call)  ((services_t) IPC_GET_ARG3(call))
-
-/** Return the sender service message argument.
- *
- * @param[in] call Message call structure.
- *
- */
-#define IPC_GET_SENDER(call)  ((services_t) IPC_GET_ARG3(call))
-
-/** Return the maximum transmission unit message argument.
- *
- * @param[in] call Message call structure.
- *
- */
-#define IPC_GET_MTU(call)  ((size_t) IPC_GET_ARG3(call))
-
-/** Return the error service message argument.
- &
- * @param[in] call Message call structure.
- *
- */
-#define IPC_GET_ERROR(call)  ((services_t) IPC_GET_ARG4(call))
-
-/** Set the device identifier in the message answer.
- *
- * @param[out] answer Message answer structure.
- * @param[in]  value  Value to set.
- *
- */
-#define IPC_SET_DEVICE(answer, value)  IPC_SET_ARG1(answer, (sysarg_t) (value))
-
-/** Set the minimum address length in the message answer.
- *
- * @param[out] answer Message answer structure.
- * @param[in]  value  Value to set.
- *
- */
-#define IPC_SET_ADDR(answer, value)  IPC_SET_ARG1(answer, (sysarg_t) (value))
-
-/** Set the minimum prefix size in the message answer.
- *
- * @param[out] answer Message answer structure.
- * @param[in]  value  Value to set.
- *
- */
-#define IPC_SET_PREFIX(answer, value)  IPC_SET_ARG2(answer, (sysarg_t) (value))
-
-/** Set the maximum content size in the message answer.
- *
- * @param[out] answer Message answer structure.
- * @param[in]  value  Value to set.
- *
- */
-#define IPC_SET_CONTENT(answer, value)  IPC_SET_ARG3(answer, (sysarg_t) (value))
-
-/** Set the minimum suffix size in the message answer.
- *
- * @param[out] answer Message answer structure.
- * @param[in]  value  Value to set.
- *
- */
-#define IPC_SET_SUFFIX(answer, value)  IPC_SET_ARG4(answer, (sysarg_t) (value))
-
-/*@}*/
-
-#endif
-
-/** @}
- */
Index: uspace/lib/c/include/ipc/net_net.h
===================================================================
--- uspace/lib/c/include/ipc/net_net.h	(revision f76696fc11f7c97060cb5bfd3e184a0f78e483f9)
+++ 	(revision )
@@ -1,62 +1,0 @@
-/*
- * Copyright (c) 2009 Lukas Mejdrech
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup libc
- * @{
- */
-
-/** @file
- * Networking subsystem central module messages.
- * @see net_interface.h
- */
-
-#ifndef LIBC_NET_NET_MESSAGES_H_
-#define LIBC_NET_NET_MESSAGES_H_
-
-#include <ipc/net.h>
-
-/** Networking subsystem central module messages. */
-typedef enum {
-	/** Return general configuration
-	 * @see net_get_conf_req()
-	 */
-	NET_NET_GET_CONF = NET_FIRST,
-	/** Return device specific configuration
-	 * @see net_get_device_conf_req()
-	 */
-	NET_NET_GET_DEVICE_CONF,
-	/** Return number of mastered devices */
-	NET_NET_GET_DEVICES_COUNT,
-	/** Return names and device IDs of all devices */
-	NET_NET_GET_DEVICES
-} net_messages;
-
-#endif
-
-/** @}
- */
Index: uspace/lib/c/include/ipc/netif.h
===================================================================
--- uspace/lib/c/include/ipc/netif.h	(revision f76696fc11f7c97060cb5bfd3e184a0f78e483f9)
+++ 	(revision )
@@ -1,97 +1,0 @@
-/*
- * Copyright (c) 2009 Lukas Mejdrech
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup libc
- * @{
- */
-
-/** @file
- * Network interface common module messages.
- */
-
-#ifndef LIBC_NETIF_MESSAGES_H_
-#define LIBC_NETIF_MESSAGES_H_
-
-#include <ipc/net.h>
-
-/** Network interface common module messages. */
-typedef enum {
-	/** Probe device message.
-	 * @see netif_probe_req()
-	 */
-	NET_NETIF_PROBE = NET_NETIF_FIRST,
-	
-	/** Send packet message.
-	 * @see netif_send_msg()
-	 */
-	NET_NETIF_SEND,
-	
-	/** Start device message.
-	 * @see netif_start_req()
-	 */
-	NET_NETIF_START,
-	
-	/** Get device usage statistics message.
-	 * @see netif_stats_req()
-	 */
-	NET_NETIF_STATS,
-	
-	/** Stop device message.
-	 * @see netif_stop_req()
-	 */
-	NET_NETIF_STOP,
-	
-	/** Get device address message.
-	 * @see netif_get_addr_req()
-	 */
-	NET_NETIF_GET_ADDR,
-} netif_messages;
-
-/** @name Network interface specific message parameters definitions */
-/*@{*/
-
-/** Return the interrupt number message parameter.
- *
- * @param[in] call Mmessage call structure.
- *
- */
-#define NETIF_GET_IRQ(call) ((int) IPC_GET_ARG2(call))
-
-/** Return the input/output address message parameter.
- *
- * @param[in] call Message call structure.
- *
- */
-#define NETIF_GET_IO(call) ((void *) IPC_GET_ARG3(call))
-
-/*@}*/
-
-#endif
-
-/** @}
- */
Index: uspace/lib/c/include/ipc/nil.h
===================================================================
--- uspace/lib/c/include/ipc/nil.h	(revision f76696fc11f7c97060cb5bfd3e184a0f78e483f9)
+++ 	(revision )
@@ -1,77 +1,0 @@
-/*
- * Copyright (c) 2009 Lukas Mejdrech
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup libc
- * @{
- */
-
-/** @file
- * Network interface layer module messages.
- */
-
-#ifndef LIBC_NIL_MESSAGES_H_
-#define LIBC_NIL_MESSAGES_H_
-
-#include <ipc/net.h>
-
-/** Network interface layer module messages. */
-typedef enum {
-	/** New device or update MTU message.
-	 * @see nil_device_req()
-	 */
-	NET_NIL_DEVICE = NET_NIL_FIRST,
-	/** Send packet queue message.
-	 * @see nil_send_msg()
-	 */
-	NET_NIL_SEND,
-	/** Packet size message.
-	 * @see nil_packet_size_req()
-	 */
-	NET_NIL_PACKET_SPACE,
-	/** Device local hardware address message.
-	 * @see nil_get_addr()
-	 */
-	NET_NIL_ADDR,
-	/** Device broadcast hardware address message.
-	 * @see nil_get_broadcast_addr()
-	 */
-	NET_NIL_BROADCAST_ADDR
-} nil_messages;
-
-/** @name Network interface layer specific message parameters definitions */
-/*@{*/
-
-/** Return the protocol service message parameter. */
-#define NIL_GET_PROTO(call)  ((services_t) IPC_GET_ARG2(call))
-
-/*@}*/
-
-#endif
-
-/** @}
- */
Index: uspace/lib/c/include/ipc/packet.h
===================================================================
--- uspace/lib/c/include/ipc/packet.h	(revision f76696fc11f7c97060cb5bfd3e184a0f78e483f9)
+++ 	(revision )
@@ -1,92 +1,0 @@
-/*
- * Copyright (c) 2009 Lukas Mejdrech
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup libc
- *  @{
- */
-
-/** @file
- *  Packet server module messages.
- */
-
-#ifndef LIBC_PACKET_MESSAGES_
-#define LIBC_PACKET_MESSAGES_
-
-#include <ipc/net.h>
-
-/** Packet server module messages. */
-typedef enum {
-	/** Create packet message with specified content length.
-	 * @see packet_get_1()
-	 */
-	NET_PACKET_CREATE_1 = NET_PACKET_FIRST,
-	
-	/**
-	 * Create packet message with specified address length, prefix, content
-	 * and suffix.
-	 * @see packet_get_4()
-	 */
-	NET_PACKET_CREATE_4,
-	
-	/** Get packet message.
-	 * @see packet_return() */
-	NET_PACKET_GET,
-	
-	/** Get packet size message.
-	 * @see packet_translate()
-	 */
-	NET_PACKET_GET_SIZE,
-	
-	/** Release packet message.
-	 * @see pq_release()
-	 */
-	NET_PACKET_RELEASE
-} packet_messages;
-
-/** Return the protocol service message parameter. */
-#define ARP_GET_PROTO(call)  ((services_t) IPC_GET_ARG2(call))
-
-/** Return the packet identifier message parameter. */
-#define IPC_GET_ID(call)  ((packet_id_t) IPC_GET_ARG1(call))
-
-/** Return the maximal content length message parameter. */
-#define IPC_GET_CONTENT(call)  ((size_t) IPC_GET_ARG1(call))
-
-/** Return the maximal address length message parameter. */
-#define IPC_GET_ADDR_LEN(call)  ((size_t) IPC_GET_ARG2(call))
-
-/** Return the maximal prefix length message parameter. */
-#define IPC_GET_PREFIX(call)  ((size_t) IPC_GET_ARG3(call))
-
-/** Return the maximal suffix length message parameter. */
-#define IPC_GET_SUFFIX(call)  ((size_t) IPC_GET_ARG4(call))
-
-#endif
-
-/** @}
- */
Index: uspace/lib/c/include/ipc/services.h
===================================================================
--- uspace/lib/c/include/ipc/services.h	(revision f76696fc11f7c97060cb5bfd3e184a0f78e483f9)
+++ uspace/lib/c/include/ipc/services.h	(revision 96c0b7b7eaa75789aba2cbca8b2292d2986ea995)
@@ -48,13 +48,11 @@
 	SERVICE_IRC        = FOURCC('i', 'r', 'c', ' '),
 	SERVICE_CLIPBOARD  = FOURCC('c', 'l', 'i', 'p'),
-	SERVICE_NETWORKING = FOURCC('n', 'e', 't', ' '),
-	SERVICE_ETHERNET   = FOURCC('e', 't', 'h', ' '),
-	SERVICE_NILDUMMY   = FOURCC('n', 'i', 'l', 'd'),
-	SERVICE_IP         = FOURCC('i', 'p', 'v', '4'),
-	SERVICE_ARP        = FOURCC('a', 'r', 'p', ' '),
-	SERVICE_ICMP       = FOURCC('i', 'c', 'm', 'p'),
 	SERVICE_UDP        = FOURCC('u', 'd', 'p', ' '),
 	SERVICE_TCP        = FOURCC('t', 'c', 'p', ' ')
 } services_t;
+
+#define SERVICE_NAME_INET     "net/inet"
+#define SERVICE_NAME_INETCFG  "net/inetcfg"
+#define SERVICE_NAME_INETPING "net/inetping"
 
 #endif
Index: uspace/lib/c/include/ipc/socket.h
===================================================================
--- uspace/lib/c/include/ipc/socket.h	(revision f76696fc11f7c97060cb5bfd3e184a0f78e483f9)
+++ uspace/lib/c/include/ipc/socket.h	(revision 96c0b7b7eaa75789aba2cbca8b2292d2986ea995)
@@ -38,10 +38,8 @@
 #define LIBC_SOCKET_MESSAGES_H_
 
-#include <ipc/net.h>
-
 /** Socket client messages. */
 typedef enum {
 	/** Creates a new socket. @see socket() */
-	NET_SOCKET = NET_SOCKET_FIRST,
+	NET_SOCKET = IPC_FIRST_USER_METHOD,
 	/** Binds the socket. @see bind() */
 	NET_SOCKET_BIND,
Index: uspace/lib/c/include/ipc/tl.h
===================================================================
--- uspace/lib/c/include/ipc/tl.h	(revision f76696fc11f7c97060cb5bfd3e184a0f78e483f9)
+++ 	(revision )
@@ -1,54 +1,0 @@
-/*
- * Copyright (c) 2009 Lukas Mejdrech
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup libc
- * @{
- */
-
-/** @file
- * Transport layer modules messages.
- * @see tl_interface.h
- */
-
-#ifndef LIBC_TL_MESSAGES_H_
-#define LIBC_TL_MESSAGES_H_
-
-#include <ipc/net.h>
-
-/** Transport layer modules messages. */
-typedef enum {
-	/** Packet received message.
-	 * @see tl_received_msg()
-	 */
-	NET_TL_RECEIVED = NET_TL_FIRST
-} tl_messages;
-
-#endif
-
-/** @}
- */
Index: uspace/lib/c/include/net/icmp_api.h
===================================================================
--- uspace/lib/c/include/net/icmp_api.h	(revision f76696fc11f7c97060cb5bfd3e184a0f78e483f9)
+++ 	(revision )
@@ -1,63 +1,0 @@
-/*
- * Copyright (c) 2009 Lukas Mejdrech
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup libc
- * @{
- */
-
-/** @file
- * ICMP module application interface.
- */
-
-#ifndef LIBC_ICMP_API_H_
-#define LIBC_ICMP_API_H_
-
-#include <net/socket_codes.h>
-#include <net/inet.h>
-#include <sys/types.h>
-#include <sys/time.h>
-#include <adt/measured_strings.h>
-#include <net/ip_codes.h>
-#include <net/icmp_codes.h>
-#include <net/icmp_common.h>
-#include <async.h>
-
-/** @name ICMP module application interface
- * This interface is used by other application modules.
- */
-/*@{*/
-
-extern int icmp_echo_msg(async_sess_t *, size_t, mseconds_t, ip_ttl_t, ip_tos_t,
-    int, const struct sockaddr *, socklen_t);
-
-/*@}*/
-
-#endif
-
-/** @}
- */
Index: uspace/lib/c/include/net/icmp_codes.h
===================================================================
--- uspace/lib/c/include/net/icmp_codes.h	(revision f76696fc11f7c97060cb5bfd3e184a0f78e483f9)
+++ 	(revision )
@@ -1,282 +1,0 @@
-/*
- * Copyright (c) 2009 Lukas Mejdrech
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup libc
- *  @{
- */
-
-/** @file
- * ICMP types and codes according to the on-line IANA - ICMP Type Numbers
- *
- * http://www.iana.org/assignments/icmp-parameters>
- *
- * cited September 14 2009.
- */
-
-#ifndef LIBC_ICMP_CODES_H_
-#define LIBC_ICMP_CODES_H_
-
-#include <sys/types.h>
-
-/** ICMP type type definition. */
-typedef uint8_t icmp_type_t;
-
-/** ICMP code type definition. */
-typedef uint8_t icmp_code_t;
-
-/** ICMP parameter type definition. */
-typedef uint16_t icmp_param_t;
-
-/** @name ICMP types definitions */
-/*@{*/
-
-/** Echo Reply. */
-#define ICMP_ECHOREPLY		0
-
-/** Destination Unreachable. */
-#define ICMP_DEST_UNREACH	3
-
-/** Source Quench. */
-#define ICMP_SOURCE_QUENCH	4
-
-/** Redirect. */
-#define ICMP_REDIRECT		5
-
-/** Alternate Host Address. */
-#define ICMP_ALTERNATE_ADDR	6
-
-/** Echo Request. */
-#define ICMP_ECHO		8
-
-/** Router Advertisement. */
-#define ICMP_ROUTER_ADV		9
-
-/** Router solicitation. */
-#define ICMP_ROUTER_SOL		10
-
-/** Time Exceeded. */
-#define ICMP_TIME_EXCEEDED	11
-
-/** Parameter Problem. */
-#define ICMP_PARAMETERPROB	12
-
-/** Timestamp Request. */
-#define ICMP_TIMESTAMP		13
-
-/** Timestamp Reply. */
-#define ICMP_TIMESTAMPREPLY	14
-
-/** Information Request. */
-#define ICMP_INFO_REQUEST	15
-
-/** Information Reply. */
-#define ICMP_INFO_REPLY		16
-
-/** Address Mask Request. */
-#define ICMP_ADDRESS		17
-
-/** Address Mask Reply. */
-#define ICMP_ADDRESSREPLY	18
-
-/** Traceroute. */
-#define ICMP_TRACEROUTE		30
-
-/** Datagram Conversion Error. */
-#define ICMP_CONVERSION_ERROR	31
-
-/** Mobile Host Redirect. */
-#define ICMP_REDIRECT_MOBILE	32
-
-/** IPv6 Where-Are-You. */
-#define ICMP_IPV6_WHERE_ARE_YOU	33
-
-/** IPv6 I-Am-Here. */
-#define ICMP_IPV6_I_AM_HERE	34
-
-/** Mobile Registration Request. */
-#define ICMP_MOBILE_REQUEST	35
-
-/** Mobile Registration Reply. */
-#define ICMP_MOBILE_REPLY	36
-
-/** Domain name request. */
-#define ICMP_DN_REQUEST		37
-
-/** Domain name reply. */
-#define ICMP_DN_REPLY		38
-
-/** SKIP. */
-#define ICMP_SKIP		39
-
-/** Photuris. */
-#define ICMP_PHOTURIS		40
-
-/*@}*/
-
-/** @name ICMP_DEST_UNREACH codes definitions
- */
-/*@{*/
-
-/** Network Unreachable. */
-#define ICMP_NET_UNREACH	0
-
-/** Host Unreachable. */
-#define ICMP_HOST_UNREACH	1
-
-/** Protocol Unreachable. */
-#define ICMP_PROT_UNREACH	2
-
-/** Port Unreachable. */
-#define ICMP_PORT_UNREACH	3
-
-/** Fragmentation needed but the Do Not Fragment bit was set. */
-#define ICMP_FRAG_NEEDED	4
-
-/** Source Route failed. */
-#define ICMP_SR_FAILED		5
-
-/** Destination network unknown. */
-#define ICMP_NET_UNKNOWN	6
-
-/** Destination host unknown. */
-#define ICMP_HOST_UNKNOWN	7
-
-/** Source host isolated (obsolete). */
-#define ICMP_HOST_ISOLATED	8
-
-/** Destination network administratively prohibited. */
-#define ICMP_NET_ANO		9
-
-/** Destination host administratively prohibited. */
-#define ICMP_HOST_ANO		10
-
-/** Network unreachable for this type of service. */
-#define ICMP_NET_UNR_TOS	11
-
-/** Host unreachable for this type of service. */
-#define ICMP_HOST_UNR_TOS	12
-
-/** Communication administratively prohibited by filtering. */
-#define ICMP_PKT_FILTERED	13
-
-/** Host precedence violation. */
-#define ICMP_PREC_VIOLATION	14
-
-/** Precedence cutoff in effect. */
-#define ICMP_PREC_CUTOFF	15
-
-/*@}*/
-
-/** @name ICMP_REDIRECT codes definitions */
-/*@{*/
-
-/** Network redirect (or subnet). */
-#define ICMP_REDIR_NET		0
-
-/** Host redirect. */
-#define ICMP_REDIR_HOST		1
-
-/** Network redirect for this type of service. */
-#define ICMP_REDIR_NETTOS	2
-
-/** Host redirect for this type of service. */
-#define ICMP_REDIR_HOSTTOS	3
-
-/*@}*/
-
-/** @name ICMP_ALTERNATE_ADDRESS codes definitions */
-/*@{*/
-
-/** Alternate address for host. */
-#define ICMP_ALTERNATE_HOST	0
-
-/*@}*/
-
-/** @name ICMP_ROUTER_ADV codes definitions */
-/*@{*/
-
-/** Normal router advertisement. */
-#define ICMP_ROUTER_NORMAL	0
-
-/** Does not route common traffic. */
-#define ICMP_ROUTER_NO_NORMAL_TRAFFIC	16
-
-/*@}*/
-
-/** @name ICMP_TIME_EXCEEDED codes definitions */
-/*@{*/
-
-/** Transit TTL exceeded. */
-#define ICMP_EXC_TTL		0
-
-/** Reassembly TTL exceeded. */
-#define ICMP_EXC_FRAGTIME	1
-
-/*@}*/
-
-/** @name ICMP_PARAMETERPROB codes definitions */
-/*@{*/
-
-/** Pointer indicates the error. */
-#define ICMP_PARAM_POINTER	0
-
-/** Missing required option. */
-#define ICMP_PARAM_MISSING	1
-
-/** Bad length. */
-#define ICMP_PARAM_LENGTH	2
-
-/*@}*/
-
-/** @name ICMP_PHOTURIS codes definitions */
-/*@{*/
-
-/** Bad SPI. */
-#define ICMP_PHOTURIS_BAD_SPI			0
-
-/** Authentication failed. */
-#define ICMP_PHOTURIS_AUTHENTICATION		1
-
-/** Decompression failed. */
-#define ICMP_PHOTURIS_DECOMPRESSION		2
-
-/** Decryption failed. */
-#define ICMP_PHOTURIS_DECRYPTION		3
-
-/** Need authentication. */
-#define ICMP_PHOTURIS_NEED_AUTHENTICATION	4
-
-/** Need authorization. */
-#define ICMP_PHOTURIS_NEED_AUTHORIZATION	5
-
-/*@}*/
-
-#endif
-
-/** @}
- */
Index: uspace/lib/c/include/net/icmp_common.h
===================================================================
--- uspace/lib/c/include/net/icmp_common.h	(revision f76696fc11f7c97060cb5bfd3e184a0f78e483f9)
+++ 	(revision )
@@ -1,49 +1,0 @@
-/*
- * Copyright (c) 2009 Lukas Mejdrech
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup libc
- *  @{
- */
-
-/** @file
- * ICMP module common interface.
- */
-
-#ifndef LIBC_ICMP_COMMON_H_
-#define LIBC_ICMP_COMMON_H_
-
-#include <ipc/services.h>
-#include <sys/time.h>
-#include <async.h>
-
-extern async_sess_t *icmp_connect_module(void);
-
-#endif
-
-/** @}
- */
Index: uspace/lib/c/include/net/in.h
===================================================================
--- uspace/lib/c/include/net/in.h	(revision f76696fc11f7c97060cb5bfd3e184a0f78e483f9)
+++ uspace/lib/c/include/net/in.h	(revision 96c0b7b7eaa75789aba2cbca8b2292d2986ea995)
@@ -45,4 +45,6 @@
 #define INET_ADDRSTRLEN  (4 * 3 + 3 + 1)
 
+#define INADDR_ANY 0
+
 /** Type definition of the INET address.
  * @see in_addr
Index: uspace/lib/c/include/net/packet.h
===================================================================
--- uspace/lib/c/include/net/packet.h	(revision f76696fc11f7c97060cb5bfd3e184a0f78e483f9)
+++ 	(revision )
@@ -1,94 +1,0 @@
-/*
- * Copyright (c) 2009 Lukas Mejdrech
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup libc 
- *  @{
- */
-
-/** @file
- *  Packet map and queue.
- */
-
-#ifndef LIBC_PACKET_H_
-#define LIBC_PACKET_H_
-
-#include <sys/types.h>
-
-/** Packet identifier type.
- * Value zero is used as an invalid identifier.
- */
-typedef sysarg_t packet_id_t;
-
-/** Type definition of the packet.
- * @see packet
- */
-typedef struct packet packet_t;
-
-/** Type definition of the packet dimension.
- * @see packet_dimension
- */
-typedef struct packet_dimension packet_dimension_t;
-
-/** Packet dimension. */
-struct packet_dimension {
-	/** Reserved packet prefix length. */
-	size_t prefix;
-	/** Maximal packet content length. */
-	size_t content;
-	/** Reserved packet suffix length. */
-	size_t suffix;
-	/** Maximal packet address length. */
-	size_t addr_len;
-};
-
-/** @name Packet management system interface
- */
-/*@{*/
-
-extern packet_t *pm_find(packet_id_t);
-extern int pm_add(packet_t *);
-extern void pm_remove(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 *);
-
-/*@}*/
-
-#endif
-
-/** @}
- */
Index: uspace/lib/c/include/net/packet_header.h
===================================================================
--- uspace/lib/c/include/net/packet_header.h	(revision f76696fc11f7c97060cb5bfd3e184a0f78e483f9)
+++ 	(revision )
@@ -1,147 +1,0 @@
-/*
- * Copyright (c) 2009 Lukas Mejdrech
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup libc 
- *  @{
- */
-
-/** @file
- * Packet header.
- */
-
-#ifndef LIBC_PACKET_HEADER_H_
-#define LIBC_PACKET_HEADER_H_
-
-#include <net/packet.h>
-
-/** Returns the actual packet data length.
- * @param[in] header	The packet header.
- */
-#define PACKET_DATA_LENGTH(header) \
-	((header)->data_end - (header)->data_start)
-
-/** Returns the maximum packet address length.
- * @param[in] header	The packet header.
- */
-#define PACKET_MAX_ADDRESS_LENGTH(header) \
-	((header)->dest_addr - (header)->src_addr)
-
-/** Returns the minimum packet suffix.
- *  @param[in] header	The packet header.
- */
-#define PACKET_MIN_SUFFIX(header) \
-	((header)->length - (header)->data_start - (header)->max_content)
-
-/** Packet integrity check magic value. */
-#define PACKET_MAGIC_VALUE	0x11227788
-
-/** Maximum total length of the packet */
-#define PACKET_MAX_LENGTH  65536
-
-/** Packet header. */
-struct packet {
-	/** Packet identifier. */
-	packet_id_t packet_id;
-
-	/**
-	 * Packet queue sorting value.
-	 * The packet queue is sorted the ascending order.
-	 */
-	size_t order;
-
-	/** Packet metric. */
-	size_t metric;
-	/** Previous packet in the queue. */
-	packet_id_t previous;
-	/** Next packet in the queue. */
-	packet_id_t next;
-
-	/**
-	 * Total length of the packet.
-	 * Contains the header, the addresses and the data of the packet.
-	 * Corresponds to the mapped sharable memory block.
-	 */
-	size_t length;
-
-	/** Offload info provided by the NIC */
-	uint32_t offload_info;
-
-	/** Mask which bits in offload info are valid */
-	uint32_t offload_mask;
-
-	/** Stored source and destination addresses length. */
-	size_t addr_len;
-
-	/**
-	 * Souce address offset in bytes from the beginning of the packet
-	 * header.
-	 */
-	size_t src_addr;
-
-	/**
-	 * Destination address offset in bytes from the beginning of the packet
-	 * header.
-	 */
-	size_t dest_addr;
-
-	/** Reserved data prefix length in bytes. */
-	size_t max_prefix;
-	/** Reserved content length in bytes. */
-	size_t max_content;
-
-	/**
-	 * Actual data start offset in bytes from the beginning of the packet
-	 * header.
-	 */
-	size_t data_start;
-
-	/**
-	 * Actual data end offset in bytes from the beginning of the packet
-	 * header.
-	 */
-	size_t data_end;
-
-	/** Integrity check magic value. */
-	int magic_value;
-};
-
-/** 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
- *			correct.
- * @return		False otherwise.
- */
-static inline int packet_is_valid(const packet_t *packet)
-{
-	return packet && (packet->magic_value == PACKET_MAGIC_VALUE);
-}
-
-#endif
-
-/** @}
- */
