Index: uspace/lib/c/Makefile
===================================================================
--- uspace/lib/c/Makefile	(revision 3d93289a3fb27c21c02091d32881655305a4ee9e)
+++ uspace/lib/c/Makefile	(revision 0c37135e2c247d5596135d0f642dda1783ef2043)
@@ -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 3d93289a3fb27c21c02091d32881655305a4ee9e)
+++ 	(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 0c37135e2c247d5596135d0f642dda1783ef2043)
+++ uspace/lib/c/generic/inet.c	(revision 0c37135e2c247d5596135d0f642dda1783ef2043)
@@ -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 0c37135e2c247d5596135d0f642dda1783ef2043)
+++ uspace/lib/c/generic/inetcfg.c	(revision 0c37135e2c247d5596135d0f642dda1783ef2043)
@@ -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 0c37135e2c247d5596135d0f642dda1783ef2043)
+++ uspace/lib/c/generic/inetping.c	(revision 0c37135e2c247d5596135d0f642dda1783ef2043)
@@ -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/io/printf_core.c
===================================================================
--- uspace/lib/c/generic/io/printf_core.c	(revision 3d93289a3fb27c21c02091d32881655305a4ee9e)
+++ uspace/lib/c/generic/io/printf_core.c	(revision 0c37135e2c247d5596135d0f642dda1783ef2043)
@@ -283,5 +283,5 @@
 	/* Print leading spaces. */
 	size_t strw = str_length(str);
-	if (precision == 0)
+	if ((precision == 0) || (precision > strw))
 		precision = strw;
 	
@@ -331,5 +331,5 @@
 	/* Print leading spaces. */
 	size_t strw = wstr_length(str);
-	if (precision == 0)
+	if ((precision == 0) || (precision > strw))
 		precision = strw;
 	
Index: uspace/lib/c/generic/iplink.c
===================================================================
--- uspace/lib/c/generic/iplink.c	(revision 0c37135e2c247d5596135d0f642dda1783ef2043)
+++ uspace/lib/c/generic/iplink.c	(revision 0c37135e2c247d5596135d0f642dda1783ef2043)
@@ -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 0c37135e2c247d5596135d0f642dda1783ef2043)
+++ uspace/lib/c/generic/iplink_srv.c	(revision 0c37135e2c247d5596135d0f642dda1783ef2043)
@@ -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 3d93289a3fb27c21c02091d32881655305a4ee9e)
+++ 	(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 3d93289a3fb27c21c02091d32881655305a4ee9e)
+++ 	(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 3d93289a3fb27c21c02091d32881655305a4ee9e)
+++ 	(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 3d93289a3fb27c21c02091d32881655305a4ee9e)
+++ 	(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 0c37135e2c247d5596135d0f642dda1783ef2043)
+++ uspace/lib/c/include/inet/inet.h	(revision 0c37135e2c247d5596135d0f642dda1783ef2043)
@@ -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 0c37135e2c247d5596135d0f642dda1783ef2043)
+++ uspace/lib/c/include/inet/inetcfg.h	(revision 0c37135e2c247d5596135d0f642dda1783ef2043)
@@ -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 0c37135e2c247d5596135d0f642dda1783ef2043)
+++ uspace/lib/c/include/inet/inetping.h	(revision 0c37135e2c247d5596135d0f642dda1783ef2043)
@@ -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 0c37135e2c247d5596135d0f642dda1783ef2043)
+++ uspace/lib/c/include/inet/iplink.h	(revision 0c37135e2c247d5596135d0f642dda1783ef2043)
@@ -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 0c37135e2c247d5596135d0f642dda1783ef2043)
+++ uspace/lib/c/include/inet/iplink_srv.h	(revision 0c37135e2c247d5596135d0f642dda1783ef2043)
@@ -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 3d93289a3fb27c21c02091d32881655305a4ee9e)
+++ 	(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 3d93289a3fb27c21c02091d32881655305a4ee9e)
+++ 	(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 3d93289a3fb27c21c02091d32881655305a4ee9e)
+++ 	(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 0c37135e2c247d5596135d0f642dda1783ef2043)
+++ uspace/lib/c/include/ipc/inet.h	(revision 0c37135e2c247d5596135d0f642dda1783ef2043)
@@ -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 3d93289a3fb27c21c02091d32881655305a4ee9e)
+++ 	(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 0c37135e2c247d5596135d0f642dda1783ef2043)
+++ uspace/lib/c/include/ipc/iplink.h	(revision 0c37135e2c247d5596135d0f642dda1783ef2043)
@@ -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 3d93289a3fb27c21c02091d32881655305a4ee9e)
+++ 	(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 3d93289a3fb27c21c02091d32881655305a4ee9e)
+++ 	(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 3d93289a3fb27c21c02091d32881655305a4ee9e)
+++ 	(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 3d93289a3fb27c21c02091d32881655305a4ee9e)
+++ 	(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 3d93289a3fb27c21c02091d32881655305a4ee9e)
+++ 	(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 3d93289a3fb27c21c02091d32881655305a4ee9e)
+++ uspace/lib/c/include/ipc/services.h	(revision 0c37135e2c247d5596135d0f642dda1783ef2043)
@@ -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 3d93289a3fb27c21c02091d32881655305a4ee9e)
+++ uspace/lib/c/include/ipc/socket.h	(revision 0c37135e2c247d5596135d0f642dda1783ef2043)
@@ -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 3d93289a3fb27c21c02091d32881655305a4ee9e)
+++ 	(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 3d93289a3fb27c21c02091d32881655305a4ee9e)
+++ 	(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 3d93289a3fb27c21c02091d32881655305a4ee9e)
+++ 	(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 3d93289a3fb27c21c02091d32881655305a4ee9e)
+++ 	(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 3d93289a3fb27c21c02091d32881655305a4ee9e)
+++ uspace/lib/c/include/net/in.h	(revision 0c37135e2c247d5596135d0f642dda1783ef2043)
@@ -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 3d93289a3fb27c21c02091d32881655305a4ee9e)
+++ 	(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 3d93289a3fb27c21c02091d32881655305a4ee9e)
+++ 	(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
-
-/** @}
- */
Index: uspace/lib/net/Makefile
===================================================================
--- uspace/lib/net/Makefile	(revision 3d93289a3fb27c21c02091d32881655305a4ee9e)
+++ uspace/lib/net/Makefile	(revision 0c37135e2c247d5596135d0f642dda1783ef2043)
@@ -33,24 +33,5 @@
 
 SOURCES = \
-	generic/generic.c \
-	generic/net_remote.c \
-	generic/net_checksum.c \
-	generic/packet_client.c \
-	generic/packet_remote.c \
-	generic/protocol_map.c \
-	adt/module_map.c \
-	nil/nil_remote.c \
-	nil/nil_skel.c \
-	il/il_remote.c \
-	il/il_skel.c \
-	il/ip_remote.c \
-	il/ip_client.c \
-	il/arp_remote.c \
-	tl/icmp_remote.c \
-	tl/icmp_client.c \
-	tl/socket_core.c \
-	tl/tl_common.c \
-	tl/tl_remote.c \
-	tl/tl_skel.c
+	tl/socket_core.c
 
 include $(USPACE_PREFIX)/Makefile.common
Index: uspace/lib/net/adt/module_map.c
===================================================================
--- uspace/lib/net/adt/module_map.c	(revision 3d93289a3fb27c21c02091d32881655305a4ee9e)
+++ 	(revision )
@@ -1,145 +1,0 @@
-/*
- * Copyright (c) 2009 Lukas Mejdrech
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup libnet
- * @{
- */
-
-/** @file
- * Character string to module map implementation.
- */
-
-#include <malloc.h>
-#include <task.h>
-#include <unistd.h>
-#include <errno.h>
-#include <net/modules.h>
-#include <adt/generic_char_map.h>
-#include <adt/module_map.h>
-
-GENERIC_CHAR_MAP_IMPLEMENT(modules, module_t)
-
-/** Add module to the module map.
- *
- * @param[out] module         Module structure added.
- * @param[in]  modules        Module map.
- * @param[in]  name           Module name.
- * @param[in]  filename       Full path filename.
- * @param[in]  service        Module service.
- * @param[in]  task_id        Module current task identifier.
- *                            Zero means not running.
- * @param[in]  connect_module Module connecting function.
- *
- * @return EOK on success.
- * @return ENOMEM if there is not enough memory left.
- *
- */
-int add_module(module_t **module, modules_t *modules, const uint8_t *name,
-    const uint8_t *filename, services_t service, task_id_t task_id,
-    connect_module_t connect_module)
-{
-	module_t *tmp_module;
-	int rc;
-	
-	tmp_module = (module_t *) malloc(sizeof(module_t));
-	if (!tmp_module)
-		return ENOMEM;
-	
-	tmp_module->task_id = task_id;
-	tmp_module->sess = NULL;
-	tmp_module->usage = 0;
-	tmp_module->name = name;
-	tmp_module->filename = filename;
-	tmp_module->service = service;
-	tmp_module->connect_module = connect_module;
-	
-	rc = modules_add(modules, tmp_module->name, 0, tmp_module);
-	if (rc != EOK) {
-		free(tmp_module);
-		return rc;
-	}
-	
-	if (module)
-		*module = tmp_module;
-	
-	return EOK;
-}
-
-/** Search and return the specified module.
- *
- * If the module is not running, the module filaname is spawned.
- * If the module is not connected, the connect_function is called.
- *
- * @param[in] modules Module map.
- * @param[in] name    Module name.
- *
- * @return The running module found. It does not have to be
- *         connected.
- * @return NULL if there is no such module.
- *
- */
-module_t *get_running_module(modules_t *modules, uint8_t *name)
-{
-	module_t *module = modules_find(modules, name, 0);
-	if (!module)
-		return NULL;
-	
-	if (!module->task_id) {
-		module->task_id = net_spawn(module->filename);
-		if (!module->task_id)
-			return NULL;
-	}
-	
-	if (!module->sess)
-		module->sess = module->connect_module(module->service);
-	
-	return module;
-}
-
-/** Start the given module.
- *
- * @param[in] fname The module full or relative path filename.
- *
- * @return The new module task identifier on success.
- * @return Zero if there is no such module.
- *
- */
-task_id_t net_spawn(const uint8_t *fname)
-{
-	task_id_t id;
-	int rc;
-	
-	rc = task_spawnl(&id, (const char *) fname, (const char *) fname, NULL);
-	if (rc != EOK)
-		return 0;
-	
-	return id;
-}
-
-/** @}
- */
Index: uspace/lib/net/generic/generic.c
===================================================================
--- uspace/lib/net/generic/generic.c	(revision 3d93289a3fb27c21c02091d32881655305a4ee9e)
+++ 	(revision )
@@ -1,287 +1,0 @@
-/*
- * Copyright (c) 2009 Lukas Mejdrech
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup libnet
- * @{
- */
-
-/** @file
- * Generic communication interfaces for networking.
- */
-
-#include <generic.h>
-#include <async.h>
-#include <ipc/services.h>
-#include <net/device.h>
-#include <adt/measured_strings.h>
-#include <net/packet.h>
-
-/** Notify the module about the device state change.
- *
- * @param[in] sess      Service module session.
- * @param[in] message   Service specific message.
- * @param[in] device_id Device identifier.
- * @param[in] state     New device state.
- * @param[in] target    Target module service.
- *
- * @return EOK on success.
- *
- */
-int generic_device_state_msg_remote(async_sess_t *sess, sysarg_t message,
-    nic_device_id_t device_id, sysarg_t state, services_t target)
-{
-	async_exch_t *exch = async_exchange_begin(sess);
-	async_msg_3(exch, message, (sysarg_t) device_id, state, target);
-	async_exchange_end(exch);
-	
-	return EOK;
-}
-
-/** Notify a module about the device.
- *
- * @param[in] sess      Service module session.
- * @param[in] message   Service specific message.
- * @param[in] device_id Device identifier.
- * @param[in] service   Device module service.
- *
- * @return EOK on success.
- * @return Other error codes as defined for the specific service
- *         message.
- *
- */
-int generic_device_req_remote(async_sess_t *sess, sysarg_t message,
-    nic_device_id_t device_id, services_t service)
-{
-	async_exch_t *exch = async_exchange_begin(sess);
-	int rc = async_req_3_0(exch, message, (sysarg_t) device_id, 0,
-	    (sysarg_t) service);
-	async_exchange_end(exch);
-	
-	return rc;
-}
-
-/** Returns the address.
- *
- * @param[in] sess      Service module session.
- * @param[in] message   Service specific message.
- * @param[in] device_id Device identifier.
- * @param[out] address  Desired address.
- * @param[out] data     Address data container.
- *
- * @return EOK on success.
- * @return EBADMEM if the address parameter and/or the data
- *         parameter is NULL.
- * @return Other error codes as defined for the specific service
- *         message.
- *
- */
-int generic_get_addr_req(async_sess_t *sess, sysarg_t message,
-    nic_device_id_t device_id, uint8_t *address, size_t max_len)
-{
-	aid_t aid;
-	ipc_call_t result;
-	
-	assert(address != NULL);
-	
-	/* Request the address */
-	async_exch_t *exch = async_exchange_begin(sess);
-	aid = async_send_1(exch, message, (sysarg_t) device_id, &result);
-	
-	sysarg_t ipcrc;
-	int rc = async_data_read_start(exch, address, max_len);
-	async_exchange_end(exch);
-	
-	if (rc != EOK) {
-		async_wait_for(aid, &ipcrc);
-		return rc;
-	}
-	
-	async_wait_for(aid, &ipcrc);
-	if (ipcrc == EOK) {
-		return IPC_GET_ARG1(result);
-	} else {
-		return (int) ipcrc;
-	}
-}
-
-/** Return the device packet dimension for sending.
- *
- * @param[in] sess              Service module session.
- * @param[in] message           Service specific message.
- * @param[in] device_id         Device identifier.
- * @param[out] packet_dimension Packet dimension.
- *
- * @return EOK on success.
- * @return EBADMEM if the packet_dimension parameter is NULL.
- * @return Other error codes as defined for the specific service
- *         message.
- *
- */
-int generic_packet_size_req_remote(async_sess_t *sess, sysarg_t message,
-    nic_device_id_t device_id, packet_dimension_t *packet_dimension)
-{
-	if (!packet_dimension)
-		return EBADMEM;
-	
-	sysarg_t addr_len;
-	sysarg_t prefix;
-	sysarg_t content;
-	sysarg_t suffix;
-	
-	async_exch_t *exch = async_exchange_begin(sess);
-	sysarg_t result = async_req_1_4(exch, message, (sysarg_t) device_id,
-	    &addr_len, &prefix, &content, &suffix);
-	async_exchange_end(exch);
-	
-	packet_dimension->prefix = (size_t) prefix;
-	packet_dimension->content = (size_t) content;
-	packet_dimension->suffix = (size_t) suffix;
-	packet_dimension->addr_len = (size_t) addr_len;
-	
-	return (int) result;
-}
-
-/** Pass the packet queue to the module.
- *
- * @param[in] sess      Service module session.
- * @param[in] message   Service specific message.
- * @param[in] device_id Device identifier.
- * @param[in] packet_id Received packet or the received packet queue
- *                      identifier.
- * @param[in] target    Target module service.
- * @param[in] error     Error module service.
- *
- * @return EOK on success.
- *
- */
-int generic_received_msg_remote(async_sess_t *sess, sysarg_t message,
-    nic_device_id_t device_id, packet_id_t packet_id, services_t target,
-    services_t error)
-{
-	async_exch_t *exch = async_exchange_begin(sess);
-	
-	if (error) {
-		async_msg_4(exch, message, (sysarg_t) device_id,
-		    (sysarg_t) packet_id, (sysarg_t) target, (sysarg_t) error);
-	} else {
-		async_msg_3(exch, message, (sysarg_t) device_id,
-		    (sysarg_t) packet_id, (sysarg_t) target);
-	}
-	
-	async_exchange_end(exch);
-	
-	return EOK;
-}
-
-/** Send the packet queue.
- *
- * @param[in] sess      Service module session.
- * @param[in] message   Service specific message.
- * @param[in] device_id Device identifier.
- * @param[in] packet_id Packet or the packet queue identifier.
- * @param[in] sender    Sending module service.
- * @param[in] error     Error module service.
- *
- * @return EOK on success.
- *
- */
-int generic_send_msg_remote(async_sess_t *sess, sysarg_t message,
-    nic_device_id_t device_id, packet_id_t packet_id, services_t sender,
-    services_t error)
-{
-	async_exch_t *exch = async_exchange_begin(sess);
-	
-	if (error) {
-		async_msg_4(exch, message, (sysarg_t) device_id,
-		    (sysarg_t) packet_id, (sysarg_t) sender, (sysarg_t) error);
-	} else {
-		async_msg_3(exch, message, (sysarg_t) device_id,
-		    (sysarg_t) packet_id, (sysarg_t) sender);
-	}
-	
-	async_exchange_end(exch);
-	
-	return EOK;
-}
-
-/** Translates the given strings.
- *
- * Allocates and returns the needed memory block as the data parameter.
- *
- * @param[in] sess          Service module session.
- * @param[in] message       Service specific message.
- * @param[in] device_id     Device identifier.
- * @param[in] service       Module service.
- * @param[in] configuration Key strings.
- * @param[in] count         Number of configuration keys.
- * @param[out] translation  Translated values.
- * @param[out] data         Translation data container.
- *
- * @return EOK on success.
- * @return EINVAL if the configuration parameter is NULL.
- * @return EINVAL if the count parameter is zero.
- * @return EBADMEM if the translation or the data parameters are
- *         NULL.
- * @return Other error codes as defined for the specific service
- *         message.
- *
- */
-int generic_translate_req(async_sess_t *sess, sysarg_t message,
-    nic_device_id_t device_id, services_t service,
-    measured_string_t *configuration, size_t count,
-    measured_string_t **translation, uint8_t **data)
-{
-	if ((!configuration) || (count == 0))
-		return EINVAL;
-	
-	if ((!translation) || (!data))
-		return EBADMEM;
-	
-	/* Request the translation */
-	async_exch_t *exch = async_exchange_begin(sess);
-	aid_t message_id = async_send_3(exch, message, (sysarg_t) device_id,
-	    (sysarg_t) count, (sysarg_t) service, NULL);
-	measured_strings_send(exch, configuration, count);
-	int rc = measured_strings_return(exch, translation, data, count);
-	async_exchange_end(exch);
-	
-	sysarg_t result;
-	async_wait_for(message_id, &result);
-	
-	/* If not successful */
-	if ((rc == EOK) && (result != EOK)) {
-		/* Clear the data */
-		free(*translation);
-		free(*data);
-	}
-	
-	return (int) result;
-}
-
-/** @}
- */
Index: uspace/lib/net/generic/net_checksum.c
===================================================================
--- uspace/lib/net/generic/net_checksum.c	(revision 3d93289a3fb27c21c02091d32881655305a4ee9e)
+++ 	(revision )
@@ -1,224 +1,0 @@
-/*
- * Copyright (c) 2009 Lukas Mejdrech
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup libnet
- * @{
- */
-
-/** @file
- * General CRC and checksum computation implementation.
- */
-
-#include <sys/types.h>
-
-#include <net_checksum.h>
-
-/** Big-endian encoding CRC divider. */
-#define CRC_DIVIDER_BE  0x04c11db7
-
-/** Little-endian encoding CRC divider. */
-#define CRC_DIVIDER_LE  0xedb88320
-
-/** Compacts the computed checksum to the 16 bit number adding the carries.
- *
- * @param[in] sum	Computed checksum.
- * @return		Compacted computed checksum to the 16 bits.
- */
-uint16_t compact_checksum(uint32_t sum)
-{
-	/* Shorten to the 16 bits */
-	while (sum >> 16)
-		sum = (sum & 0xffff) + (sum >> 16);
-
-	return (uint16_t) sum;
-}
-
-/** Computes sum of the 2 byte fields.
- *
- * Padds one zero (0) byte if odd.
- *
- * @param[in] seed	Initial value. Often used as 0 or ~0.
- * @param[in] data	Pointer to the beginning of data to process.
- * @param[in] length	Length of the data in bytes.
- * @return		The computed checksum of the length bytes of the data.
- */
-uint32_t compute_checksum(uint32_t seed, uint8_t *data, size_t length)
-{
-	size_t index;
-
-	/* Sum all the 16 bit fields */
-	for (index = 0; index + 1 < length; index += 2)
-		seed += (data[index] << 8) + data[index + 1];
-
-	/* Last odd byte with zero padding */
-	if (index + 1 == length)
-		seed += data[index] << 8;
-
-	return seed;
-}
-
-/** Computes CRC32 value in the big-endian environment.
- *
- * @param[in] seed	Initial value. Often used as 0 or ~0.
- * @param[in] data	Pointer to the beginning of data to process.
- * @param[in] length	Length of the data in bits.
- * @return		The computed CRC32 of the length bits of the data.
- */
-uint32_t compute_crc32_be(uint32_t seed, uint8_t * data, size_t length)
-{
-	size_t index;
-
-	/* Process full bytes */
-	while (length >= 8) {
-		/* Add the data */
-		seed ^= (*data) << 24;
-		
-		/* For each added bit */
-		for (index = 0; index < 8; ++index) {
-			/* If the first bit is set */
-			if (seed & 0x80000000) {
-				/* Shift and divide the checksum */
-				seed = (seed << 1) ^ ((uint32_t) CRC_DIVIDER_BE);
-			} else {
-				/* Shift otherwise */
-				seed <<= 1;
-			}
-		}
-		
-		/* Move to the next byte */
-		++data;
-		length -= 8;
-	}
-
-	/* Process the odd bits */
-	if (length > 0) {
-		/* Add the data with zero padding */
-		seed ^= ((*data) & (0xff << (8 - length))) << 24;
-		
-		/* For each added bit */
-		for (index = 0; index < length; ++index) {
-			/* If the first bit is set */
-			if (seed & 0x80000000) {
-				/* Shift and divide the checksum */
-				seed = (seed << 1) ^ ((uint32_t) CRC_DIVIDER_BE);
-			} else {
-				/* Shift otherwise */
-				seed <<= 1;
-			}
-		}
-	}
-
-	return seed;
-}
-
-/** Computes CRC32 value in the little-endian environment.
- *
- * @param[in] seed	Initial value. Often used as 0 or ~0.
- * @param[in] data	Pointer to the beginning of data to process.
- * @param[in] length	Length of the data in bits.
- * @return		The computed CRC32 of the length bits of the data.
- */
-uint32_t compute_crc32_le(uint32_t seed, uint8_t * data, size_t length)
-{
-	size_t index;
-
-	/* Process full bytes */
-	while (length >= 8) {
-		/* Add the data */
-		seed ^= (*data);
-		
-		/* For each added bit */
-		for (index = 0; index < 8; ++index) {
-			/* If the last bit is set */
-			if (seed & 1) {
-				/* Shift and divide the checksum */
-				seed = (seed >> 1) ^ ((uint32_t) CRC_DIVIDER_LE);
-			} else {
-				/* Shift otherwise */
-				seed >>= 1;
-			}
-		}
-		
-		/* Move to the next byte */
-		++data;
-		length -= 8;
-	}
-
-	/* Process the odd bits */
-	if (length > 0) {
-		/* Add the data with zero padding */
-		seed ^= (*data) >> (8 - length);
-		
-		for (index = 0; index < length; ++index) {
-			/* If the last bit is set */
-			if (seed & 1) {
-				/* Shift and divide the checksum */
-				seed = (seed >> 1) ^ ((uint32_t) CRC_DIVIDER_LE);
-			} else {
-				/* Shift otherwise */
-				seed >>= 1;
-			}
-		}
-	}
-
-	return seed;
-}
-
-/** Returns or flips the checksum if zero.
- *
- * @param[in] checksum	The computed checksum.
- * @return		The internet protocol header checksum.
- * @return		0xFFFF if the computed checksum is zero.
- */
-uint16_t flip_checksum(uint16_t checksum)
-{
-	/* Flip, zero is returned as 0xFFFF (not flipped) */
-	checksum = ~checksum;
-	return checksum ? checksum : IP_CHECKSUM_ZERO;
-}
-
-/** Compute the IP header checksum.
- *
- * To compute the checksum of a new packet, the checksum header field must be
- * zero. To check the checksum of a received packet, the checksum may be left
- * set. Zero will be returned in this case if valid.
- *
- * @param[in] data	The header data.
- * @param[in] length	The header length in bytes.
- * @return		The internet protocol header checksum.
- * @return		0xFFFF if the computed checksum is zero.
- */
-uint16_t ip_checksum(uint8_t *data, size_t length)
-{
-	/* Compute, compact and flip the data checksum */
-	return flip_checksum(compact_checksum(compute_checksum(0, data,
-	    length)));
-}
-
-/** @}
- */
Index: uspace/lib/net/generic/net_remote.c
===================================================================
--- uspace/lib/net/generic/net_remote.c	(revision 3d93289a3fb27c21c02091d32881655305a4ee9e)
+++ 	(revision )
@@ -1,169 +1,0 @@
-/*
- * Copyright (c) 2009 Lukas Mejdrech
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup libnet
- * @{
- */
-
-/** @file
- * Networking interface implementation for remote modules.
- * @see net_interface.h
- */
-
-#include <ipc/services.h>
-#include <ipc/net_net.h>
-#include <malloc.h>
-#include <async.h>
-#include <generic.h>
-#include <net/modules.h>
-#include <net/device.h>
-#include <net_interface.h>
-#include <adt/measured_strings.h>
-
-/** Connect to the networking module.
- *
- * @return Networking module session on success.
- *
- */
-async_sess_t *net_connect_module(void)
-{
-	return connect_to_service(SERVICE_NETWORKING);
-}
-
-/** Free the received settings.
- *
- * @param[in] settings Received settings.
- * @param[in] data     Received settings data.
- *
- * @see net_get_device_conf_req()
- * @see net_get_conf_req()
- *
- */
-void net_free_settings(measured_string_t *settings, uint8_t *data)
-{
-	if (settings)
-		free(settings);
-	if (data)
-		free(data);
-}
-
-/** Return the global configuration.
- *
- * The configuration names are read and the appropriate settings are set
- * instead. Call net_free_settings() function to release the returned
- * configuration.
- *
- * @param[in]     sess          Networking module session.
- * @param[in,out] configuration Requested configuration. The names are
- *                              read and the appropriate settings are set
- *                              instead.
- *
- * @param[in]     count         Configuration entries count.
- * @param[in,out] data          Configuration and settings data.
- *
- * @return EOK on success.
- * @return EINVAL if the configuration is NULL.
- * @return EINVAL if the count is zero.
- * @return Other error codes as defined for the
- *         generic_translate_req() function.
- *
- */
-int net_get_conf_req(async_sess_t *sess, measured_string_t **configuration,
-    size_t count, uint8_t **data)
-{
-	return generic_translate_req(sess, NET_NET_GET_CONF, 0, 0,
-	    *configuration, count, configuration, data);
-}
-
-/** Return the device specific configuration.
- *
- * Return the global configuration if the device specific is not found.
- * The configuration names are read and the appropriate settings are set
- * instead. Call net_free_settings() function to release the returned
- * configuration.
- *
- * @param[in]     sess          The networking module session.
- * @param[in]     device_id     Device identifier.
- * @param[in,out] configuration Requested device configuration. The names
- *                              are read and the appropriate settings are
- *                              set instead.
- * @param[in]     count         Configuration entries count.
- * @param[in,out] data          Configuration and settings data.
- *
- * @return EOK on success.
- * @return EINVAL if the configuration is NULL.
- * @return EINVAL if the count is zero.
- * @return Other error codes as defined for the
- *         generic_translate_req() function.
- *
- */
-int net_get_device_conf_req(async_sess_t *sess, nic_device_id_t device_id,
-    measured_string_t **configuration, size_t count, uint8_t **data)
-{
-	return generic_translate_req(sess, NET_NET_GET_DEVICE_CONF,
-	    device_id, 0, *configuration, count, configuration, data);
-}
-
-int net_get_devices_req(async_sess_t *sess, measured_string_t **devices,
-    size_t *count, uint8_t **data)
-{
-	if ((!devices) || (!count))
-		return EBADMEM;
-	
-	async_exch_t *exch = async_exchange_begin(sess);
-	
-	int rc = async_req_0_1(exch, NET_NET_GET_DEVICES_COUNT, count);
-	if (rc != EOK) {
-		async_exchange_end(exch);
-		return rc;
-	}
-	
-	if (*count == 0) {
-		async_exchange_end(exch);
-		*data = NULL;
-		return EOK;
-	}
-	
-	aid_t message_id = async_send_0(exch, NET_NET_GET_DEVICES, NULL);
-	rc = measured_strings_return(exch, devices, data, *count);
-	
-	async_exchange_end(exch);
-	
-	sysarg_t result;
-	async_wait_for(message_id, &result);
-	
-	if ((rc == EOK) && (result != EOK)) {
-		free(*devices);
-		free(*data);
-	}
-	
-	return (int) result;
-}
-
-/** @}
- */
Index: uspace/lib/net/generic/packet_client.c
===================================================================
--- uspace/lib/net/generic/packet_client.c	(revision 3d93289a3fb27c21c02091d32881655305a4ee9e)
+++ 	(revision )
@@ -1,294 +1,0 @@
-/*
- * Copyright (c) 2009 Lukas Mejdrech
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup libnet
- * @{
- */
-
-/** @file
- * Packet client implementation.
- */
-
-#include <errno.h>
-#include <mem.h>
-#include <unistd.h>
-#include <sys/mman.h>
-#include <packet_client.h>
-#include <packet_remote.h>
-
-#include <net/packet.h>
-#include <net/packet_header.h>
-
-/** Copies the specified data to the beginning of the actual packet content.
- *
- * Pushes the content end if needed.
- *
- * @param[in] packet	The packet to be filled.
- * @param[in] data	The data to be copied.
- * @param[in] length	The length of the copied data.
- * @return		EOK on success.
- * @return		EINVAL if the packet is not valid.
- * @return		ENOMEM if there is not enough memory left.
- */
-int packet_copy_data(packet_t *packet, const void *data, size_t length)
-{
-	if (!packet_is_valid(packet))
-		return EINVAL;
-
-	if (packet->data_start + length >= packet->length)
-		return ENOMEM;
-
-	memcpy((void *) packet + packet->data_start, data, length);
-	if (packet->data_start + length > packet->data_end) 
-		packet->data_end = packet->data_start + length;
-
-	return EOK;
-}
-
-/** Allocates the specified space right before the actual packet content and
- * returns its pointer.
- *
- * @param[in] packet	The packet to be used.
- * @param[in] length	The space length to be allocated at the beginning of the
- *			packet content.
- * @return		The pointer to the allocated memory.
- * @return		NULL if there is not enough memory left.
- */
-void *packet_prefix(packet_t *packet, size_t length)
-{
-	if ((!packet_is_valid(packet)) ||
-	    (packet->data_start - sizeof(packet_t) -
-	    2 * (packet->dest_addr - packet->src_addr) < length)) {
-		return NULL;
-	}
-
-	packet->data_start -= length;
-	return (void *) packet + packet->data_start;
-}
-
-/** Allocates the specified space right after the actual packet content and
- * returns its pointer.
- *
- * @param[in] packet	The packet to be used.
- * @param[in] length	The space length to be allocated at the end of the
- *			 packet content.
- * @return		The pointer to the allocated memory.
- * @return		NULL if there is not enough memory left.
- */
-void *packet_suffix(packet_t *packet, size_t length)
-{
-	if ((!packet_is_valid(packet)) ||
-	    (packet->data_end + length >= packet->length)) {
-		return NULL;
-	}
-
-	packet->data_end += length;
-	return (void *) packet + packet->data_end - length;
-}
-
-/** Trims the actual packet content by the specified prefix and suffix lengths.
- *
- * @param[in] packet	The packet to be trimmed.
- * @param[in] prefix	The prefix length to be removed from the beginning of
- *			the packet content.
- * @param[in] suffix	The suffix length to be removed from the end of the
- *			packet content.
- * @return		EOK on success.
- * @return		EINVAL if the packet is not valid.
- * @return		ENOMEM if there is not enough memory left.
- */
-int packet_trim(packet_t *packet, size_t prefix, size_t suffix)
-{
-	if (!packet_is_valid(packet))
-		return EINVAL;
-
-	if (prefix + suffix > PACKET_DATA_LENGTH(packet))
-		return ENOMEM;
-
-	packet->data_start += prefix;
-	packet->data_end -= suffix;
-	return EOK;
-}
-
-/** Returns the packet identifier.
- *
- * @param[in] packet	The packet.
- * @return		The packet identifier.
- * @return		Zero if the packet is not valid.
- */
-packet_id_t packet_get_id(const packet_t *packet)
-{
-	return packet_is_valid(packet) ? packet->packet_id : 0;
-}
-
-/** Returns the stored packet addresses and their length.
- *
- * @param[in] packet	The packet.
- * @param[out] src	The source address. May be NULL if not desired.
- * @param[out] dest	The destination address. May be NULL if not desired.
- * @return		The stored addresses length.
- * @return		Zero if the addresses are not present.
- * @return		EINVAL if the packet is not valid.
- */
-int packet_get_addr(const packet_t *packet, uint8_t **src, uint8_t **dest)
-{
-	if (!packet_is_valid(packet))
-		return EINVAL;
-	if (!packet->addr_len)
-		return 0;
-	if (src)
-		*src = (void *) packet + packet->src_addr;
-	if (dest)
-		*dest = (void *) packet + packet->dest_addr;
-
-	return packet->addr_len;
-}
-
-/** Returns the packet content length.
- *
- * @param[in] packet	The packet.
- * @return		The packet content length in bytes.
- * @return		Zero if the packet is not valid.
- */
-size_t packet_get_data_length(const packet_t *packet)
-{
-	if (!packet_is_valid(packet))
-		return 0;
-
-	return PACKET_DATA_LENGTH(packet);
-}
-
-/** Returns the pointer to the beginning of the packet content.
- *
- * @param[in] packet	The packet.
- * @return		The pointer to the beginning of the packet content.
- * @return		NULL if the packet is not valid.
- */
-void *packet_get_data(const packet_t *packet)
-{
-	if (!packet_is_valid(packet))
-		return NULL;
-
-	return (void *) packet + packet->data_start;
-}
-
-/** Sets the packet addresses.
- *
- * @param[in] packet	The packet.
- * @param[in] src	The new source address. May be NULL.
- * @param[in] dest	The new destination address. May be NULL.
- * @param[in] addr_len	The addresses length.
- * @return		EOK on success.
- * @return		EINVAL if the packet is not valid.
- * @return		ENOMEM if there is not enough memory left.
- */
-int
-packet_set_addr(packet_t *packet, const uint8_t *src, const uint8_t *dest,
-    size_t addr_len)
-{
-	size_t padding;
-	size_t allocated;
-
-	if (!packet_is_valid(packet))
-		return EINVAL;
-
-	allocated = PACKET_MAX_ADDRESS_LENGTH(packet);
-	if (allocated < addr_len)
-		return ENOMEM;
-
-	padding = allocated - addr_len;
-	packet->addr_len = addr_len;
-
-	if (src) {
-		memcpy((void *) packet + packet->src_addr, src, addr_len);
-		if (padding)
-			bzero((void *) packet + packet->src_addr + addr_len,
-			    padding);
-	} else {
-		bzero((void *) packet + packet->src_addr, allocated);
-	}
-
-	if (dest) {
-		memcpy((void *) packet + packet->dest_addr, dest, addr_len);
-		if (padding)
-			bzero((void *) packet + packet->dest_addr + addr_len,
-			    padding);
-	} else {
-		bzero((void *) packet + packet->dest_addr, allocated);
-	}
-
-	return EOK;
-}
-
-/** Return the packet copy.
- *
- * Copy the addresses, data, order and metric values.
- * Queue placement is not copied.
- *
- * @param[in] sess   Packet server module session.
- * @param[in] packet Original packet.
- *
- * @return Packet copy.
- * @return NULL on error.
- *
- */
-packet_t *packet_get_copy(async_sess_t *sess, packet_t *packet)
-{
-	if (!packet_is_valid(packet))
-		return NULL;
-	
-	/* Get a new packet */
-	packet_t *copy = packet_get_4_remote(sess, PACKET_DATA_LENGTH(packet),
-	    PACKET_MAX_ADDRESS_LENGTH(packet), packet->max_prefix,
-	    PACKET_MIN_SUFFIX(packet));
-	
-	if (!copy)
-		return NULL;
-	
-	/* Get addresses */
-	uint8_t *src = NULL;
-	uint8_t *dest = NULL;
-	size_t addrlen = packet_get_addr(packet, &src, &dest);
-	
-	/* Copy data */
-	if ((packet_copy_data(copy, packet_get_data(packet),
-	    PACKET_DATA_LENGTH(packet)) == EOK) &&
-	    /* Copy addresses if present */
-	    ((addrlen <= 0) ||
-	    (packet_set_addr(copy, src, dest, addrlen) == EOK))) {
-		copy->order = packet->order;
-		copy->metric = packet->metric;
-		return copy;
-	} else {
-		pq_release_remote(sess, copy->packet_id);
-		return NULL;
-	}
-}
-
-/** @}
- */
Index: uspace/lib/net/generic/packet_remote.c
===================================================================
--- uspace/lib/net/generic/packet_remote.c	(revision 3d93289a3fb27c21c02091d32881655305a4ee9e)
+++ 	(revision )
@@ -1,229 +1,0 @@
-/*
- * Copyright (c) 2009 Lukas Mejdrech
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup libnet
- * @{
- */
-
-/** @file
- * Packet client interface implementation for remote modules.
- * @see packet_client.h
- */
-
-#include <async.h>
-#include <errno.h>
-#include <ipc/packet.h>
-#include <sys/mman.h>
-
-#include <packet_client.h>
-#include <packet_remote.h>
-
-#include <net/packet.h>
-#include <net/packet_header.h>
-
-/** Obtain the packet from the packet server as the shared memory block.
- *
- * Create the local packet mapping as well.
- *
- * @param[in]  sess      Packet server module session.
- * @param[out] packet    Packet reference pointer to store the received
- *                       packet reference.
- * @param[in]  packet_id Packet identifier.
- * @param[in]  size      Packet total size in bytes.
- *
- * @return EOK on success.
- * @return Other error codes as defined for the pm_add() function.
- * @return Other error codes as defined for the async_share_in_start()
- *         function.
- *
- */
-static int packet_return(async_sess_t *sess, packet_t **packet,
-    packet_id_t packet_id, size_t size)
-{
-	async_exch_t *exch = async_exchange_begin(sess);
-	ipc_call_t answer;
-	aid_t message = async_send_1(exch, NET_PACKET_GET, packet_id, &answer);
-	int rc = async_share_in_start_0_0(exch, size, (void *) packet);
-	async_exchange_end(exch);
-	
-	sysarg_t result;
-	async_wait_for(message, &result);
-	
-	if (rc != EOK)
-		return rc;
-	
-	if (packet == (void *) -1)
-		return ENOMEM;
-	
-	rc = pm_add(*packet);
-	if (rc != EOK) {
-		munmap(*packet, size);
-		return rc;
-	}
-	
-	return result;
-}
-
-/** Translate the packet identifier to the packet reference.
- *
- * Try to find mapping first. The packet server is asked to share
- * the packet if the mapping is not present.
- *
- * @param[in]  sess      Packet server module session.
- * @param[out] packet    Packet reference.
- * @param[in]  packet_id Packet identifier.
- *
- * @return EOK on success.
- * @return EINVAL if the packet parameter is NULL.
- * @return Other error codes as defined for the NET_PACKET_GET_SIZE
- *         message.
- * @return Other error codes as defined for the packet_return()
- *         function.
- *
- */
-int packet_translate_remote(async_sess_t *sess, packet_t **packet,
-    packet_id_t packet_id)
-{
-	if (!packet)
-		return EINVAL;
-	
-	*packet = pm_find(packet_id);
-	if (*packet == NULL) {
-		async_exch_t *exch = async_exchange_begin(sess);
-		sysarg_t size;
-		int rc = async_req_1_1(exch, NET_PACKET_GET_SIZE, packet_id,
-		    &size);
-		async_exchange_end(exch);
-		
-		if (rc != EOK)
-			return rc;
-		
-		rc = packet_return(sess, packet, packet_id, size);
-		if (rc != EOK)
-			return rc;
-	}
-	
-	if ((*packet != NULL) && ((*packet)->next)) {
-		packet_t *next;
-		return packet_translate_remote(sess, &next, (*packet)->next);
-	}
-	
-	return EOK;
-}
-
-/** Obtain the packet of given dimensions.
- *
- * Contact the packet server to return the appropriate packet.
- *
- * @param[in] sess        Packet server module session.
- * @param[in] addr_len    Source and destination addresses maximal length
- *                        in bytes.
- * @param[in] max_prefix  Maximal prefix length in bytes.
- * @param[in] max_content Maximal content length in bytes.
- * @param[in] max_suffix  Maximal suffix length in bytes.
- *
- * @return The packet reference.
- * @return NULL on error.
- *
- */
-packet_t *packet_get_4_remote(async_sess_t *sess, size_t max_content,
-    size_t addr_len, size_t max_prefix, size_t max_suffix)
-{
-	async_exch_t *exch = async_exchange_begin(sess);
-	sysarg_t packet_id;
-	sysarg_t size;
-	int rc = async_req_4_2(exch, NET_PACKET_CREATE_4, max_content, addr_len,
-	    max_prefix, max_suffix, &packet_id, &size);
-	async_exchange_end(exch);
-	
-	if (rc != EOK)
-		return NULL;
-	
-	packet_t *packet = pm_find(packet_id);
-	if (!packet) {
-		rc = packet_return(sess, &packet, packet_id, size);
-		if (rc != EOK)
-			return NULL;
-	}
-	
-	return packet;
-}
-
-/** Obtain the packet of given content size.
- *
- * Contact the packet server to return the appropriate packet.
- *
- * @param[in] sess    Packet server module session.
- * @param[in] content Maximal content length in bytes.
- *
- * @return The packet reference.
- * @return NULL on error.
- *
- */
-packet_t *packet_get_1_remote(async_sess_t *sess, size_t content)
-{
-	async_exch_t *exch = async_exchange_begin(sess);
-	sysarg_t packet_id;
-	sysarg_t size;
-	int rc = async_req_1_2(exch, NET_PACKET_CREATE_1, content, &packet_id,
-	    &size);
-	async_exchange_end(exch);
-	
-	if (rc != EOK)
-		return NULL;
-	
-	packet_t *packet = pm_find(packet_id);
-	if (!packet) {
-		rc = packet_return(sess, &packet, packet_id, size);
-		if (rc != EOK)
-			return NULL;
-	}
-	
-	return packet;
-}
-
-/** Release the packet queue.
- *
- * All packets in the queue are marked as free for use.
- * The packet queue may be one packet only.
- * The module should not use the packets after this point until they are
- * received or obtained again.
- *
- * @param[in] sess      Packet server module session.
- * @param[in] packet_id Packet identifier.
- *
- */
-void pq_release_remote(async_sess_t *sess, packet_id_t packet_id)
-{
-	async_exch_t *exch = async_exchange_begin(sess);
-	async_msg_1(exch, NET_PACKET_RELEASE, packet_id);
-	async_exchange_end(exch);
-}
-
-/** @}
- */
Index: uspace/lib/net/generic/protocol_map.c
===================================================================
--- uspace/lib/net/generic/protocol_map.c	(revision 3d93289a3fb27c21c02091d32881655305a4ee9e)
+++ 	(revision )
@@ -1,148 +1,0 @@
-/*
- * Copyright (c) 2009 Lukas Mejdrech
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup libnet
- * @{
- */
-
-#include <protocol_map.h>
-#include <ethernet_lsap.h>
-#include <ethernet_protocols.h>
-#include <net_hardware.h>
-
-#include <ipc/services.h>
-
-/** Maps the internetwork layer service to the network interface layer type.
- *
- * @param[in] nil	Network interface layer service.
- * @param[in] il	Internetwork layer service.
- * @return		Network interface layer type of the internetworking
- *			layer service.
- * @return		Zero if mapping is not found.
- */
-eth_type_t protocol_map(services_t nil, services_t il)
-{
-	switch (nil) {
-	case SERVICE_ETHERNET:
-	case SERVICE_NILDUMMY:
-		switch (il) {
-		case SERVICE_IP:
-			return ETH_P_IP;
-		case SERVICE_ARP:
-			return ETH_P_ARP;
-		default:
-			return 0;
-		}
-	default:
-		return 0;
-	}
-}
-
-/** Maps the network interface layer type to the internetwork layer service.
- *
- * @param[in] nil	Network interface layer service.
- * @param[in] protocol	Network interface layer type.
- * @return		Internetwork layer service of the network interface
- *			layer type.
- * @return		Zero if mapping is not found.
- */
-services_t protocol_unmap(services_t nil, int protocol)
-{
-	switch (nil) {
-	case SERVICE_ETHERNET:
-	case SERVICE_NILDUMMY:
-		switch (protocol) {
-		case ETH_P_IP:
-			return SERVICE_IP;
-		case ETH_P_ARP:
-			return SERVICE_ARP;
-		default:
-			return 0;
-		}
-	default:
-		return 0;
-	}
-}
-
-/** Maps the link service access point identifier to the Ethernet protocol
- * identifier.
- *
- * @param[in] lsap	Link service access point identifier.
- * @return		Ethernet protocol identifier of the link service access
- *			point identifier.
- * @return		ETH_LSAP_NULL if mapping is not found.
- */
-eth_type_t lsap_map(eth_lsap_t lsap)
-{
-	switch (lsap) {
-	case ETH_LSAP_IP:
-		return ETH_P_IP;
-	case ETH_LSAP_ARP:
-		return ETH_P_ARP;
-	default:
-		return ETH_LSAP_NULL;
-	}
-}
-
-/** Maps the Ethernet protocol identifier to the link service access point
- * identifier.
- *
- * @param[in] ethertype	Ethernet protocol identifier.
- * @return		Link service access point identifier.
- * @return		Zero if mapping is not found.
- */
-eth_lsap_t lsap_unmap(eth_type_t ethertype)
-{
-	switch (ethertype) {
-	case ETH_P_IP:
-		return ETH_LSAP_IP;
-	case ETH_P_ARP:
-		return ETH_LSAP_ARP;
-	default:
-		return 0;
-	}
-}
-
-/** Maps the network interface layer services to the hardware types.
- *
- * @param[in] nil	The network interface service.
- * @return		The hardware type of the network interface service.
- * @return		Zero if mapping is not found.
- */
-hw_type_t hardware_map(services_t nil)
-{
-	switch (nil) {
-	case SERVICE_ETHERNET:
-		return HW_ETHER;
-	default:
-		return 0;
-	}
-}
-
-/** @}
- */
Index: uspace/lib/net/il/arp_remote.c
===================================================================
--- uspace/lib/net/il/arp_remote.c	(revision 3d93289a3fb27c21c02091d32881655305a4ee9e)
+++ 	(revision )
@@ -1,188 +1,0 @@
-/*
- * Copyright (c) 2009 Lukas Mejdrech
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup libnet
- * @{
- */
-
-/** @file
- * ARP interface implementation for remote modules.
- * @see arp_interface.h
- */
-
-#include <arp_interface.h>
-#include <generic.h>
-#include <ipc/services.h>
-#include <ipc/arp.h>
-#include <net/modules.h>
-#include <net/device.h>
-#include <adt/measured_strings.h>
-#include <async.h>
-#include <errno.h>
-
-/** Connect to the ARP module.
- *
- * @return ARP module session on success.
- *
- */
-async_sess_t *arp_connect_module(services_t service)
-{
-	// FIXME: Get rid of the useless argument
-	return connect_to_service(SERVICE_ARP);
-}
-
-/** Cleans the cache.
- *
- * @param[in] sess ARP module session.
- *
- * @return EOK on success.
- *
- */
-int arp_clean_cache_req(async_sess_t *sess)
-{
-	async_exch_t *exch = async_exchange_begin(sess);
-	int rc = async_req_0_0(exch, NET_ARP_CLEAN_CACHE);
-	async_exchange_end(exch);
-	
-	return rc;
-}
-
-/** Clear the given protocol address from the cache.
- *
- * @param[in] sess      ARP module session.
- * @param[in] device_id Device identifier.
- * @param[in] protocol  Requesting protocol service.
- * @param[in] address   Protocol address to be cleared.
- *
- * @return EOK on success.
- * @return ENOENT if the mapping is not found.
- *
- */
-int arp_clear_address_req(async_sess_t *sess, nic_device_id_t device_id,
-    services_t protocol, measured_string_t *address)
-{
-	async_exch_t *exch = async_exchange_begin(sess);
-	aid_t message_id = async_send_2(exch, NET_ARP_CLEAR_ADDRESS,
-	    (sysarg_t) device_id, protocol, NULL);
-	measured_strings_send(exch, address, 1);
-	async_exchange_end(exch);
-	
-	sysarg_t result;
-	async_wait_for(message_id, &result);
-	
-	return (int) result;
-}
-
-/** Clear the device cache.
- *
- * @param[in] sess      ARP module session.
- * @param[in] device_id Device identifier.
- *
- * @return EOK on success.
- * @return ENOENT if the device is not found.
- *
- */
-int arp_clear_device_req(async_sess_t *sess, nic_device_id_t device_id)
-{
-	async_exch_t *exch = async_exchange_begin(sess);
-	int rc = async_req_1_0(exch, NET_ARP_CLEAR_DEVICE,
-	    (sysarg_t) device_id);
-	async_exchange_end(exch);
-	
-	return rc;
-}
-
-/** Register new device and the requesting protocol service.
- *
- * Connect to the network interface layer service.
- * Determine the device broadcast address, its address lengths and packet size.
- *
- * @param[in] sess      ARP module session.
- * @param[in] device_id New device identifier.
- * @param[in] protocol  Requesting protocol service.
- * @param[in] netif     Underlying device network interface layer service.
- * @param[in] address   Local requesting protocol address of the device.
- *
- * @return EOK on success.
- * @return EEXIST if the device is already used.
- * @return ENOMEM if there is not enough memory left.
- * @return ENOENT if the network interface service is not known.
- * @return EREFUSED if the network interface service is not
- *         responding.
- * @return Other error codes as defined for the
- *         nil_packet_get_size() function.
- * @return Other error codes as defined for the nil_get_addr()
- *         function.
- * @return Other error codes as defined for the
- *         nil_get_broadcast_addr() function.
- *
- */
-int arp_device_req(async_sess_t *sess, nic_device_id_t device_id,
-    services_t protocol, services_t netif, measured_string_t *address)
-{
-	async_exch_t *exch = async_exchange_begin(sess);
-	aid_t message_id = async_send_3(exch, NET_ARP_DEVICE,
-	    (sysarg_t) device_id, protocol, netif, NULL);
-	measured_strings_send(exch, address, 1);
-	async_exchange_end(exch);
-	
-	sysarg_t result;
-	async_wait_for(message_id, &result);
-
-	return (int) result;
-}
-
-/** Translate the given protocol address to the network interface address.
- *
- * Broadcast the ARP request if the mapping is not found.
- * Allocate and returns the needed memory block as the data parameter.
- *
- * @param[in]  sess        ARP module session.
- * @param[in]  device_id   Device identifier.
- * @param[in]  protocol    Requesting protocol service.
- * @param[in]  address     Local requesting protocol address.
- * @param[out] translation Translation of the local protocol address.
- * @param[out] data        Allocated raw translation data container.
- *
- * @return EOK on success.
- * @return EINVAL if the address parameter is NULL.
- * @return EBADMEM if the translation or the data parameters are
- *         NULL.
- * @return ENOENT if the mapping is not found.
- *
- */
-int arp_translate_req(async_sess_t *sess, nic_device_id_t device_id,
-    services_t protocol, measured_string_t *address,
-    measured_string_t **translation, uint8_t **data)
-{
-	return generic_translate_req(sess, NET_ARP_TRANSLATE, device_id,
-	    protocol, address, 1, translation, data);
-}
-
-/** @}
- */
Index: uspace/lib/net/il/il_remote.c
===================================================================
--- uspace/lib/net/il/il_remote.c	(revision 3d93289a3fb27c21c02091d32881655305a4ee9e)
+++ 	(revision )
@@ -1,123 +1,0 @@
-/*
- * Copyright (c) 2009 Lukas Mejdrech
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup libnet
- * @{
- */
-
-/** @file
- * Internetwork layer module interface for the underlying network interface
- * layer.
- */
-
-#include <il_remote.h>
-#include <generic.h>
-#include <packet_client.h>
-#include <ipc/services.h>
-#include <ipc/il.h>
-#include <net/device.h>
-#include <net/packet.h>
-
-/** Notify the internetwork layer modules about the device state change.
- *
- * @param[in] sess      Internetwork layer module session.
- * @param[in] device_id Device identifier.
- * @param[in] state     New device state.
- * @param[in] target    Target internetwork module service to be
- *                      delivered to.
- *
- * @return EOK on success.
- *
- */
-int il_device_state_msg(async_sess_t *sess, nic_device_id_t device_id,
-    nic_device_state_t state, services_t target)
-{
-	return generic_device_state_msg_remote(sess, NET_IL_DEVICE_STATE,
-	    device_id, state, target);
-}
-
-/** Notify the internetwork layer modules about the received packet/s.
- *
- * @param[in] sess      Internetwork layer module session.
- * @param[in] device_id Device identifier.
- * @param[in] packet    Received packet or the received packet queue.
- * @param[in] target    Target internetwork module service to be
- *                      delivered to.
- *
- * @return EOK on success.
- *
- */
-int il_received_msg(async_sess_t *sess, nic_device_id_t device_id,
-    packet_t *packet, services_t target)
-{
-	return generic_received_msg_remote(sess, NET_IL_RECEIVED, device_id,
-	    packet_get_id(packet), target, 0);
-}
-
-/** Notify the internetwork layer modules about the mtu change.
- *
- * @param[in] sess      Internetwork layer module session.
- * @param[in] device_id Device identifier.
- * @param[in] mtu       New MTU value.
- * @param[in] target    Target internetwork module service to be
- *                      delivered to.
- *
- * @return EOK on success.
- *
- */
-int il_mtu_changed_msg(async_sess_t *sess, nic_device_id_t device_id, size_t mtu,
-    services_t target)
-{
-	return generic_device_state_msg_remote(sess, NET_IL_MTU_CHANGED,
-	    device_id, mtu, target);
-}
-
-/** Notify IL layer modules about address change (implemented by ARP)
- *
- */
-int il_addr_changed_msg(async_sess_t *sess, nic_device_id_t device_id,
-    size_t addr_len, const uint8_t *address)
-{
-	async_exch_t *exch = async_exchange_begin(sess);
-	
-	aid_t message_id = async_send_1(exch, NET_IL_ADDR_CHANGED,
-			(sysarg_t) device_id, NULL);
-	int rc = async_data_write_start(exch, address, addr_len);
-	
-	async_exchange_end(exch);
-	
-	sysarg_t res;
-    async_wait_for(message_id, &res);
-    if (rc != EOK)
-		return rc;
-	
-    return (int) res;
-}
-
-/** @}
- */
Index: uspace/lib/net/il/il_skel.c
===================================================================
--- uspace/lib/net/il/il_skel.c	(revision 3d93289a3fb27c21c02091d32881655305a4ee9e)
+++ 	(revision )
@@ -1,128 +1,0 @@
-/*
- * Copyright (c) 2011 Martin Decky
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup libnet
- * @{
- */
-
-/** @file
- * Internetworking layer module skeleton implementation.
- * @see il_skel.h
- */
-
-#include <bool.h>
-#include <errno.h>
-#include <ns.h>
-#include <il_skel.h>
-#include <net_interface.h>
-#include <net/modules.h>
-
-/** Default thread for new connections.
- *
- * @param[in] iid   The initial message identifier.
- * @param[in] icall The initial message call structure.
- *
- */
-static void il_client_connection(ipc_callid_t iid, ipc_call_t *icall,
-    void *arg)
-{
-	/*
-	 * Accept the connection by answering
-	 * the initial IPC_M_CONNECT_ME_TO call.
-	 */
-	async_answer_0(iid, EOK);
-	
-	while (true) {
-		ipc_call_t answer;
-		size_t count;
-		
-		/* Clear the answer structure */
-		refresh_answer(&answer, &count);
-		
-		/* Fetch the next message */
-		ipc_call_t call;
-		ipc_callid_t callid = async_get_call(&call);
-		
-		/* Process the message */
-		int res = il_module_message(callid, &call, &answer,
-		    &count);
-		
-		/*
-		 * End if told to either by the message or the processing
-		 * result.
-		 */
-		if ((!IPC_GET_IMETHOD(call)) || (res == EHANGUP))
-			return;
-		
-		/* Answer the message */
-		answer_call(callid, res, &answer, count);
-	}
-}
-
-/** Start the internetworking layer module.
- *
- * Initialize the client connection serving function, initialize
- * the module, register the module service and start the async
- * manager, processing IPC messages in an infinite loop.
- *
- * @param[in] service Service identification.
- *
- * @return EOK on success.
- * @return Other error codes as defined for the pm_init() function.
- * @return Other error codes as defined for the il_initialize()
- *         function.
- *
- */
-int il_module_start(sysarg_t service)
-{
-	async_set_client_connection(il_client_connection);
-	async_sess_t *sess = net_connect_module();
-	if (!sess)
-		return ENOENT;
-	
-	int rc = pm_init();
-	if (rc != EOK)
-		return rc;
-	
-	rc = il_initialize(sess);
-	if (rc != EOK)
-		goto out;
-	
-	rc = service_register(service);
-	if (rc != EOK)
-		goto out;
-	
-	async_manager();
-	
-out:
-	pm_destroy();
-	return rc;
-}
-
-/** @}
- */
Index: uspace/lib/net/il/ip_client.c
===================================================================
--- uspace/lib/net/il/ip_client.c	(revision 3d93289a3fb27c21c02091d32881655305a4ee9e)
+++ 	(revision )
@@ -1,268 +1,0 @@
-/*
- * Copyright (c) 2009 Lukas Mejdrech
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup libnet
- * @{
- */
-
-/** @file
- * IP client interface implementation.
- * @see ip_client.h
- */
-
-#include <errno.h>
-#include <sys/types.h>
-
-#include <ip_client.h>
-#include <packet_client.h>
-#include <ip_header.h>
-
-#include <net/packet.h>
-
-/** Returns the IP header length.
- *
- * @param[in] packet	The packet.
- * @return		The IP header length in bytes.
- * @return		Zero if there is no IP header.
- */
-size_t ip_client_header_length(packet_t *packet)
-{
-	ip_header_t *header;
-
-	header = (ip_header_t *) packet_get_data(packet);
-	if (!header || (packet_get_data_length(packet) < sizeof(ip_header_t)))
-		return 0;
-
-	return IP_HEADER_LENGTH(header);
-}
-
-/** Constructs the IPv4 pseudo header.
- *
- * @param[in] protocol	The transport protocol.
- * @param[in] src	The source address.
- * @param[in] srclen	The source address length.
- * @param[in] dest	The destination address.
- * @param[in] destlen	The destination address length.
- * @param[in] data_length The data length to be set.
- * @param[out] header	The constructed IPv4 pseudo header.
- * @param[out] headerlen The length of the IP pseudo header in bytes.
- * @return		EOK on success.
- * @return		EBADMEM if the header and/or the headerlen parameter is
- *			NULL.
- * @return		EINVAL if the source address and/or the destination
- *			address parameter is NULL.
- * @return		EINVAL if the source address length is less than struct
- *			sockaddr length.
- * @return		EINVAL if the source address length differs from the
- *			destination address length.
- * @return		EINVAL if the source address family differs from the
- *			destination family.
- * @return		EAFNOSUPPORT if the address family is not supported.
- * @return		ENOMEM if there is not enough memory left.
- */
-int
-ip_client_get_pseudo_header(ip_protocol_t protocol, struct sockaddr *src,
-    socklen_t srclen, struct sockaddr *dest, socklen_t destlen,
-    size_t data_length, void **header, size_t *headerlen)
-{
-	ipv4_pseudo_header_t *header_in;
-	struct sockaddr_in *address_in;
-
-	if (!header || !headerlen)
-		return EBADMEM;
-
-	if (!src || !dest || srclen <= 0 ||
-	    (((size_t) srclen < sizeof(struct sockaddr))) ||
-	    (srclen != destlen) || (src->sa_family != dest->sa_family)) {
-		return EINVAL;
-	}
-
-	switch (src->sa_family) {
-	case AF_INET:
-		if (srclen != sizeof(struct sockaddr_in))
-			return EINVAL;
-		
-		*headerlen = sizeof(*header_in);
-		header_in = (ipv4_pseudo_header_t *) malloc(*headerlen);
-		if (!header_in)
-			return ENOMEM;
-
-		bzero(header_in, *headerlen);
-		address_in = (struct sockaddr_in *) dest;
-		header_in->destination_address = address_in->sin_addr.s_addr;
-		address_in = (struct sockaddr_in *) src;
-		header_in->source_address = address_in->sin_addr.s_addr;
-		header_in->protocol = protocol;
-		header_in->data_length = htons(data_length);
-		*header = header_in;
-		return EOK;
-
-	// TODO IPv6
-#if 0
-	case AF_INET6:
-		if (addrlen != sizeof(struct sockaddr_in6))
-			return EINVAL;
-
-		address_in6 = (struct sockaddr_in6 *) addr;
-		return EOK;
-#endif
-
-	default:
-		return EAFNOSUPPORT;
-	}
-}
-
-/** Prepares the packet to be transfered via IP.
- *
- * The IP header is prefixed.
- *
- * @param[in,out] packet The packet to be prepared.
- * @param[in] protocol	The transport protocol.
- * @param[in] ttl	The time to live counter. The IPDEFTTL is set if zero.
- * @param[in] tos	The type of service.
- * @param[in] dont_fragment The value indicating whether fragmentation is
- *			disabled.
- * @param[in] ipopt_length The prefixed IP options length in bytes.
- * @return		EOK on success.
- * @return		ENOMEM if there is not enough memory left in the packet.
- */
-int
-ip_client_prepare_packet(packet_t *packet, ip_protocol_t protocol, ip_ttl_t ttl,
-    ip_tos_t tos, int dont_fragment, size_t ipopt_length)
-{
-	ip_header_t *header;
-	uint8_t *data;
-	size_t padding;
-
-	/*
-	 * Compute the padding if IP options are set
-	 * multiple of 4 bytes
-	 */
-	padding =  ipopt_length % 4;
-	if (padding) {
-		padding = 4 - padding;
-		ipopt_length += padding;
-	}
-
-	/* Prefix the header */
-	data = (uint8_t *) packet_prefix(packet, sizeof(ip_header_t) + padding);
-	if (!data)
-		return ENOMEM;
-
-	/* Add the padding */
-	while (padding--)
-		data[sizeof(ip_header_t) + padding] = IPOPT_NOOP;
-
-	/* Set the header */
-	header = (ip_header_t *) data;
-	SET_IP_HEADER_LENGTH(header,
-	    (IP_COMPUTE_HEADER_LENGTH(sizeof(ip_header_t) + ipopt_length)));
-	header->ttl = (ttl ? ttl : IPDEFTTL);
-	header->tos = tos;
-	header->protocol = protocol;
-
-	if (dont_fragment)
-		SET_IP_HEADER_FLAGS(header, IPFLAG_DONT_FRAGMENT);
-
-	return EOK;
-}
-
-/** Processes the received IP packet.
- *
- * Fills set header fields.
- * Returns the prefixed IP header length.
- *
- * @param[in] packet	The received packet.
- * @param[out] protocol	The transport protocol. May be NULL if not desired.
- * @param[out] ttl	The time to live counter. May be NULL if not desired.
- * @param[out] tos	The type of service. May be NULL if not desired.
- * @param[out] dont_fragment The value indicating whether the fragmentation is
- *			disabled. May be NULL if not desired.
- * @param[out] ipopt_length The IP options length in bytes. May be NULL if not
- *			desired.
- * @return		The prefixed IP header length in bytes on success.
- * @return		ENOMEM if the packet is too short to contain the IP
- *			header.
- */
-int
-ip_client_process_packet(packet_t *packet, ip_protocol_t *protocol,
-    ip_ttl_t *ttl, ip_tos_t *tos, int *dont_fragment, size_t *ipopt_length)
-{
-	ip_header_t *header;
-
-	header = (ip_header_t *) packet_get_data(packet);
-	if (!header || (packet_get_data_length(packet) < sizeof(ip_header_t)))
-		return ENOMEM;
-
-	if (protocol)
-		*protocol = header->protocol;
-	if (ttl)
-		*ttl = header->ttl;
-	if (tos)
-		*tos = header->tos;
-	if (dont_fragment)
-		*dont_fragment = GET_IP_HEADER_FLAGS(header) & IPFLAG_DONT_FRAGMENT;
-	if (ipopt_length) {
-		*ipopt_length = IP_HEADER_LENGTH(header) - sizeof(ip_header_t);
-		return sizeof(ip_header_t);
-	} else {
-		return IP_HEADER_LENGTH(header);
-	}
-}
-
-/** Updates the IPv4 pseudo header data length field.
- *
- * @param[in,out] header The IPv4 pseudo header to be updated.
- * @param[in] headerlen	The length of the IP pseudo header in bytes.
- * @param[in] data_length The data length to be set.
- * @return		EOK on success.
- * @return		EBADMEM if the header parameter is NULL.
- * @return		EINVAL if the headerlen parameter is not IPv4 pseudo
- *			header length.
- */
-int
-ip_client_set_pseudo_header_data_length(void *header, size_t headerlen,
-    size_t data_length)
-{
-	ipv4_pseudo_header_t *header_in;
-
-	if (!header)
-		return EBADMEM;
-
-	if (headerlen == sizeof(ipv4_pseudo_header_t)) {
-		header_in = (ipv4_pseudo_header_t *) header;
-		header_in->data_length = htons(data_length);
-		return EOK;
-	// TODO IPv6
-	} else {
-		return EINVAL;
-	}
-}
-
-/** @}
- */
Index: uspace/lib/net/il/ip_remote.c
===================================================================
--- uspace/lib/net/il/ip_remote.c	(revision 3d93289a3fb27c21c02091d32881655305a4ee9e)
+++ 	(revision )
@@ -1,270 +1,0 @@
-/*
- * Copyright (c) 2009 Lukas Mejdrech
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup libnet
- * @{
- */
-
-/** @file
- *
- * IP interface implementation for remote modules.
- *
- * @see ip_interface.h
- * @see il_remote.h
- *
- */
-
-#include <ip_remote.h>
-#include <ip_interface.h>
-#include <packet_client.h>
-#include <generic.h>
-#include <ipc/services.h>
-#include <ipc/il.h>
-#include <ipc/ip.h>
-#include <net/modules.h>
-#include <net/device.h>
-#include <net/inet.h>
-
-/** Add a route to the device routing table.
- *
- * The target network is routed using this device.
- *
- * @param[in] sess      IP module sessions.
- * @param[in] device_id Device identifier.
- * @param[in] address   Target network address.
- * @param[in] netmask   Target network mask.
- * @param[in] gateway   Target network gateway. Not used if zero.
- *
- */
-int ip_add_route_req_remote(async_sess_t *sess, nic_device_id_t device_id,
-    in_addr_t address, in_addr_t netmask, in_addr_t gateway)
-{
-	async_exch_t *exch = async_exchange_begin(sess);
-	int rc = async_req_4_0(exch, NET_IP_ADD_ROUTE,
-	    (sysarg_t) device_id, (sysarg_t) gateway.s_addr,
-	    (sysarg_t) address.s_addr, (sysarg_t) netmask.s_addr);
-	async_exchange_end(exch);
-	
-	return rc;
-}
-
-/** Create bidirectional connection with the ip module service and register
- * the message receiver.
- *
- * @param[in] service  IP module service.
- * @param[in] protocol Transport layer protocol.
- * @param[in] me       Rquesting module service.
- * @param[in] receiver Message receiver. Used for remote connection.
- *
- * @return Session to the needed service.
- * @return NULL on failure.
- *
- */
-async_sess_t *ip_bind_service(services_t service, int protocol, services_t me,
-    async_client_conn_t receiver)
-{
-	return bind_service(service, (sysarg_t) protocol, me, service,
-	    receiver);
-}
-
-/** Connect to the IP module.
- *
- * @return The IP module session.
- *
- */
-async_sess_t *ip_connect_module(services_t service)
-{
-	// FIXME: Get rid of the useless argument
-	return connect_to_service(SERVICE_IP);
-}
-
-/** Register the new device.
- *
- * Register itself as the ip packet receiver.
- * If the device uses ARP registers also the new ARP device.
- *
- * @param[in] sess      IP module session.
- * @param[in] device_id New device identifier.
- *
- * @return EOK on success.
- * @return ENOMEM if there is not enough memory left.
- * @return EINVAL if the device configuration is invalid.
- * @return ENOTSUP if the device uses IPv6.
- * @return ENOTSUP if the device uses DHCP.
- * @return Other error codes as defined for the
- *         net_get_device_conf_req() function.
- * @return Other error codes as defined for the arp_device_req()
- *         function.
- *
- */
-int ip_device_req(async_sess_t *sess, nic_device_id_t device_id,
-    services_t service)
-{
-	return generic_device_req_remote(sess, NET_IP_DEVICE, device_id,
-	    service);
-}
-
-/** Return the device identifier and the IP pseudo header based on the
- * destination address.
- *
- * @param[in] sess        IP module session.
- * @param[in] protocol    Transport protocol.
- * @param[in] destination Destination address.
- * @param[in] addrlen     Destination address length.
- * @param[out] device_id  Device identifier.
- * @param[out] header     Constructed IP pseudo header.
- * @param[out] headerlen  IP pseudo header length.
- *
- */
-int ip_get_route_req_remote(async_sess_t *sess, ip_protocol_t protocol,
-    const struct sockaddr *destination, socklen_t addrlen,
-    nic_device_id_t *device_id, void **header, size_t *headerlen)
-{
-	if ((!destination) || (addrlen == 0))
-		return EINVAL;
-	
-	if ((!device_id) || (!header) || (!headerlen))
-		return EBADMEM;
-	
-	*header = NULL;
-	
-	async_exch_t *exch = async_exchange_begin(sess);
-	
-	ipc_call_t answer;
-	aid_t message_id = async_send_1(exch, NET_IP_GET_ROUTE,
-	    (sysarg_t) protocol, &answer);
-	
-	if ((async_data_write_start(exch, destination, addrlen) == EOK) &&
-	    (async_data_read_start(exch, headerlen, sizeof(*headerlen)) == EOK) &&
-	    (*headerlen > 0)) {
-		*header = malloc(*headerlen);
-		if (*header) {
-			if (async_data_read_start(exch, *header,
-			    *headerlen) != EOK)
-				free(*header);
-		}
-	}
-	
-	async_exchange_end(exch);
-	
-	sysarg_t result;
-	async_wait_for(message_id, &result);
-	
-	if ((result != EOK) && *header)
-		free(*header);
-	else
-		*device_id = IPC_GET_DEVICE(answer);
-	
-	return (int) result;
-}
-
-/** Return the device packet dimension for sending.
- *
- * @param[in] sess              IP module session.
- * @param[in] device_id         Device identifier.
- * @param[out] packet_dimension Packet dimension.
- *
- * @return EOK on success.
- * @return ENOENT if there is no such device.
- * @return Other error codes as defined for the
- *         generic_packet_size_req_remote() function.
- *
- */
-int ip_packet_size_req_remote(async_sess_t *sess, nic_device_id_t device_id,
-    packet_dimension_t *packet_dimension)
-{
-	return generic_packet_size_req_remote(sess, NET_IP_PACKET_SPACE,
-	    device_id, packet_dimension);
-}
-
-/** Notify the IP module about the received error notification packet.
- *
- * @param[in] sess      IP module session.
- * @param[in] device_id Device identifier.
- * @param[in] packet    Received packet or the received packet queue.
- * @param[in] target    Target internetwork module service to be
- *                      delivered to.
- * @param[in] error     Packet error reporting service. Prefixes the
- *                      received packet.
- *
- * @return EOK on success.
- *
- */
-int ip_received_error_msg_remote(async_sess_t *sess, nic_device_id_t device_id,
-    packet_t *packet, services_t target, services_t error)
-{
-	return generic_received_msg_remote(sess, NET_IP_RECEIVED_ERROR,
-	    device_id, packet_get_id(packet), target, error);
-}
-
-/** Send the packet queue.
- *
- * The packets may get fragmented if needed.
- *
- * @param[in] sess      IP module session.
- * @param[in] device_id Device identifier.
- * @param[in] packet    Packet fragments as a packet queue. All the
- *                      packets have to have the same destination address.
- * @param[in] sender    Sending module service.
- * @param[in] error     Packet error reporting service. Prefixes the
- *                      received packet.
- *
- * @return EOK on success.
- * @return Other error codes as defined for the generic_send_msg()
- *         function.
- *
- */
-int ip_send_msg_remote(async_sess_t *sess, nic_device_id_t device_id,
-    packet_t *packet, services_t sender, services_t error)
-{
-	return generic_send_msg_remote(sess, NET_IP_SEND, device_id,
-	    packet_get_id(packet), sender, error);
-}
-
-/** Set the default gateway.
- *
- * This gateway is used if no other route is found.
- *
- * @param[in] sess      IP module session.
- * @param[in] device_id Device identifier.
- * @param[in] gateway   Default gateway.
- *
- */
-int ip_set_gateway_req_remote(async_sess_t *sess, nic_device_id_t device_id,
-    in_addr_t gateway)
-{
-	async_exch_t *exch = async_exchange_begin(sess);
-	int rc = async_req_2_0(exch, NET_IP_SET_GATEWAY,
-	    (sysarg_t) device_id, (sysarg_t) gateway.s_addr);
-	async_exchange_end(exch);
-	
-	return rc;
-}
-
-/** @}
- */
Index: uspace/lib/net/include/adt/module_map.h
===================================================================
--- uspace/lib/net/include/adt/module_map.h	(revision 3d93289a3fb27c21c02091d32881655305a4ee9e)
+++ 	(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 libnet
- * @{
- */
-
-/** @file
- * Character string to module map.
- */
-
-#ifndef LIBNET_MODULES_MAP_H_
-#define LIBNET_MODULES_MAP_H_
-
-#include <task.h>
-#include <async.h>
-#include <net/modules.h>
-#include <adt/generic_char_map.h>
-
-/** Type definition of the module structure.
- * @see module_struct
- */
-typedef struct module_struct module_t;
-
-/** Module map.
- * Sorted by module names.
- * @see generic_char_map.h
- */
-GENERIC_CHAR_MAP_DECLARE(modules, module_t)
-
-/** Module structure. */
-struct module_struct {
-	/** Module task identifier if running. */
-	task_id_t task_id;
-	/** Module service identifier. */
-	services_t service;
-	/** Module session if running and connected. */
-	async_sess_t *sess;
-	/** Usage counter. */
-	int usage;
-	/** Module name. */
-	const uint8_t *name;
-	/** Module full path filename. */
-	const uint8_t *filename;
-	/** Connecting function. */
-	connect_module_t *connect_module;
-};
-
-extern int add_module(module_t **, modules_t *, const uint8_t *,
-    const uint8_t *, services_t, task_id_t, connect_module_t *);
-extern module_t *get_running_module(modules_t *, uint8_t *);
-extern task_id_t net_spawn(const uint8_t *);
-
-#endif
-
-/** @}
- */
Index: uspace/lib/net/include/arp_interface.h
===================================================================
--- uspace/lib/net/include/arp_interface.h	(revision 3d93289a3fb27c21c02091d32881655305a4ee9e)
+++ 	(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 libnet
- * @{
- */
-
-#ifndef LIBNET_ARP_INTERFACE_H_
-#define LIBNET_ARP_INTERFACE_H_
-
-#include <adt/measured_strings.h>
-#include <task.h>
-#include <ipc/services.h>
-#include <net/device.h>
-#include <net/socket.h>
-#include <async.h>
-
-/** @name ARP module interface
- * This interface is used by other modules.
- */
-/*@{*/
-
-extern int arp_device_req(async_sess_t *, nic_device_id_t, services_t, services_t,
-    measured_string_t *);
-extern int arp_translate_req(async_sess_t *, nic_device_id_t, services_t,
-    measured_string_t *, measured_string_t **, uint8_t **);
-extern int arp_clear_device_req(async_sess_t *, nic_device_id_t);
-extern int arp_clear_address_req(async_sess_t *, nic_device_id_t, services_t,
-    measured_string_t *);
-extern int arp_clean_cache_req(async_sess_t *);
-extern async_sess_t *arp_connect_module(services_t);
-
-/*@}*/
-
-#endif
-
-/** @}
- */
Index: uspace/lib/net/include/ethernet_lsap.h
===================================================================
--- uspace/lib/net/include/ethernet_lsap.h	(revision 3d93289a3fb27c21c02091d32881655305a4ee9e)
+++ 	(revision )
@@ -1,64 +1,0 @@
-/*
- * Copyright (c) 2009 Lukas Mejdrech
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup libnet
- * @{
- */
-
-/** @file
- * Link service access point identifiers.
- */
-
-#ifndef LIBNET_ETHERNET_LSAP_H_
-#define LIBNET_ETHERNET_LSAP_H_
-
-#include <sys/types.h>
-
-/** Ethernet LSAP type definition. */
-typedef uint8_t eth_lsap_t;
-
-/** @name Ethernet LSAP values definitions */
-/*@{*/
-
-/** Null LSAP LSAP identifier. */
-#define ETH_LSAP_NULL	0x00
-/** ARPANET Internet Protocol (IP) LSAP identifier. */
-#define ETH_LSAP_IP	0x06
-/** ARPANET Address Resolution Protocol (ARP) LSAP identifier. */
-#define ETH_LSAP_ARP	0x98
-/** SubNetwork Access Protocol (SNAP) LSAP identifier. */
-#define ETH_LSAP_SNAP	0xAA
-/** Global LSAP LSAP identifier. */
-#define ETH_LSAP_GLSAP	0xFF
-
-/*@}*/
-
-#endif
-
-/** @}
- */
Index: uspace/lib/net/include/ethernet_protocols.h
===================================================================
--- uspace/lib/net/include/ethernet_protocols.h	(revision 3d93289a3fb27c21c02091d32881655305a4ee9e)
+++ 	(revision )
@@ -1,66 +1,0 @@
-/*
- * Copyright (c) 2009 Lukas Mejdrech
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup libnet
- * @{
- */
-
-/** @file
- * Ethernet protocol numbers according to the on-line IANA - Ethernet numbers
- * http://www.iana.org/assignments/ethernet-numbers
- * cited January 17 2009.
- */
-
-#ifndef LIBNET_ETHERNET_PROTOCOLS_H_
-#define LIBNET_ETHERNET_PROTOCOLS_H_
-
-#include <sys/types.h>
-
-/** Ethernet protocol type definition. */
-typedef uint16_t eth_type_t;
-
-/** @name Ethernet protocols definitions */
-/*@{*/
-
-/** Ethernet minimal protocol number.
- * According to the IEEE 802.3 specification.
- */
-#define ETH_MIN_PROTO		0x0600 /* 1536 */
-
-/** Internet IP (IPv4) ethernet protocol type. */
-#define ETH_P_IP		0x0800
-
-/** ARP ethernet protocol type. */
-#define ETH_P_ARP		0x0806
-
-/*@}*/
-
-#endif
-
-/** @}
- */
Index: uspace/lib/net/include/generic.h
===================================================================
--- uspace/lib/net/include/generic.h	(revision 3d93289a3fb27c21c02091d32881655305a4ee9e)
+++ 	(revision )
@@ -1,64 +1,0 @@
-/*
- * Copyright (c) 2009 Lukas Mejdrech
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup libnet
- * @{
- */
-
-/** @file
- * Generic communication interfaces for networking.
- */
-
-#ifndef LIBNET_GENERIC_H_
-#define LIBNET_GENERIC_H_
-
-#include <ipc/services.h>
-#include <net/device.h>
-#include <adt/measured_strings.h>
-#include <net/packet.h>
-#include <async.h>
-
-extern int generic_device_state_msg_remote(async_sess_t *, sysarg_t,
-    nic_device_id_t, sysarg_t, services_t);
-extern int generic_device_req_remote(async_sess_t *, sysarg_t, nic_device_id_t,
-    services_t);
-extern int generic_get_addr_req(async_sess_t *, sysarg_t, nic_device_id_t,
-    uint8_t *address, size_t max_length);
-extern int generic_packet_size_req_remote(async_sess_t *, sysarg_t,
-    nic_device_id_t, packet_dimension_t *);
-extern int generic_received_msg_remote(async_sess_t *, sysarg_t,
-    nic_device_id_t, packet_id_t, services_t, services_t);
-extern int generic_send_msg_remote(async_sess_t *, sysarg_t, nic_device_id_t,
-    packet_id_t, services_t, services_t);
-extern int generic_translate_req(async_sess_t *, sysarg_t, nic_device_id_t,
-    services_t, measured_string_t *, size_t, measured_string_t **, uint8_t **);
-
-#endif
-
-/** @}
- */
Index: uspace/lib/net/include/icmp_client.h
===================================================================
--- uspace/lib/net/include/icmp_client.h	(revision 3d93289a3fb27c21c02091d32881655305a4ee9e)
+++ 	(revision )
@@ -1,50 +1,0 @@
-/*
- * Copyright (c) 2009 Lukas Mejdrech
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup libnet
- * @{
- */
-
-/** @file
- * ICMP client interface.
- */
-
-#ifndef LIBNET_ICMP_CLIENT_H_
-#define LIBNET_ICMP_CLIENT_H_
-
-#include <net/icmp_codes.h>
-#include <net/packet.h>
-
-extern int icmp_client_process_packet(packet_t *, icmp_type_t *, icmp_code_t *,
-    icmp_param_t *, icmp_param_t *);
-extern size_t icmp_client_header_length(packet_t *);
-
-#endif
-
-/** @}
- */
Index: uspace/lib/net/include/icmp_header.h
===================================================================
--- uspace/lib/net/include/icmp_header.h	(revision 3d93289a3fb27c21c02091d32881655305a4ee9e)
+++ 	(revision )
@@ -1,104 +1,0 @@
-/*
- * Copyright (c) 2009 Lukas Mejdrech
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup libnet
- *  @{
- */
-
-/** @file
- * ICMP header definition.
- * Based on the RFC 792.
- */
-
-#ifndef LIBNET_ICMP_HEADER_H_
-#define LIBNET_ICMP_HEADER_H_
-
-#include <sys/types.h>
-
-#include <net/in.h>
-#include <net/icmp_codes.h>
-
-/** ICMP header size in bytes. */
-#define ICMP_HEADER_SIZE  sizeof(icmp_header_t)
-
-/** Echo specific data. */
-typedef struct icmp_echo {
-	/** Message idintifier. */
-	icmp_param_t identifier;
-	/** Message sequence number. */
-	icmp_param_t sequence_number;
-} __attribute__((packed)) icmp_echo_t;
-
-/** Internet control message header. */
-typedef struct icmp_header {
-	/** The type of the message. */
-	uint8_t type;
-	
-	/**
-	 * The error code for the datagram reported by the ICMP message.
-	 * The interpretation is dependent on the message type.
-	 */
-	uint8_t code;
-	
-	/**
-	 * The checksum is the 16-bit ones's complement of the one's complement
-	 * sum of the ICMP message starting with the ICMP Type. For computing
-	 * the checksum, the checksum field should be zero. If the checksum does
-	 * not match the contents, the datagram is discarded.
-	 */
-	uint16_t checksum;
-	
-	/** Message specific data. */
-	union {
-		/** Echo specific data. */
-		icmp_echo_t echo;
-		/** Proposed gateway value. */
-		in_addr_t gateway;
-		
-		/** Fragmentation needed specific data. */
-		struct {
-			/** Reserved field. Must be zero. */
-			icmp_param_t reserved;
-			/** Proposed MTU. */
-			icmp_param_t mtu;
-		} frag;
-		
-		/** Parameter problem specific data. */
-		struct {
-			/** Problem pointer. */
-			icmp_param_t pointer;
-			/** Reserved field. Must be zero. */
-			icmp_param_t reserved;
-		} param;
-	} un;
-} __attribute__((packed)) icmp_header_t;
-
-#endif
-
-/** @}
- */
Index: uspace/lib/net/include/icmp_remote.h
===================================================================
--- uspace/lib/net/include/icmp_remote.h	(revision 3d93289a3fb27c21c02091d32881655305a4ee9e)
+++ 	(revision )
@@ -1,64 +1,0 @@
-/*
- * Copyright (c) 2009 Lukas Mejdrech
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup libnet
- *  @{
- */
-
-#ifndef LIBNET_ICMP_REMOTE_H_
-#define LIBNET_ICMP_REMOTE_H_
-
-#include <net/socket_codes.h>
-#include <sys/types.h>
-#include <net/device.h>
-#include <adt/measured_strings.h>
-#include <net/packet.h>
-#include <net/inet.h>
-#include <net/ip_codes.h>
-#include <net/icmp_codes.h>
-#include <net/icmp_common.h>
-#include <async.h>
-
-/** @name ICMP module interface
- * This interface is used by other modules.
- */
-/*@{*/
-
-extern int icmp_destination_unreachable_msg(async_sess_t *, icmp_code_t,
-    icmp_param_t, packet_t *);
-extern int icmp_source_quench_msg(async_sess_t *, packet_t *);
-extern int icmp_time_exceeded_msg(async_sess_t *, icmp_code_t, packet_t *);
-extern int icmp_parameter_problem_msg(async_sess_t *, icmp_code_t, icmp_param_t,
-    packet_t *);
-
-/*@}*/
-
-#endif
-
-/** @}
- */
Index: uspace/lib/net/include/il_remote.h
===================================================================
--- uspace/lib/net/include/il_remote.h	(revision 3d93289a3fb27c21c02091d32881655305a4ee9e)
+++ 	(revision )
@@ -1,66 +1,0 @@
-/*
- * Copyright (c) 2009 Lukas Mejdrech
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup libnet
- * @{
- */
-
-/** @file
- * Internetwork layer module interface for the underlying network interface
- * layer. This interface is always called by the remote modules.
- */
-
-#ifndef LIBNET_IL_REMOTE_H_
-#define LIBNET_IL_REMOTE_H_
-
-#include <ipc/services.h>
-#include <sys/types.h>
-#include <net/device.h>
-#include <net/packet.h>
-#include <async.h>
-
-/** @name Internetwork layer module interface
- * This interface is used by other modules.
- */
-/*@{*/
-
-extern int il_device_state_msg(async_sess_t *, nic_device_id_t,
-    nic_device_state_t, services_t);
-extern int il_received_msg(async_sess_t *, nic_device_id_t, packet_t *,
-    services_t);
-extern int il_mtu_changed_msg(async_sess_t *, nic_device_id_t, size_t,
-    services_t);
-extern int il_addr_changed_msg(async_sess_t *, nic_device_id_t, size_t,
-    const uint8_t *);
-
-/*@}*/
-
-#endif
-
-/** @}
- */
Index: uspace/lib/net/include/il_skel.h
===================================================================
--- uspace/lib/net/include/il_skel.h	(revision 3d93289a3fb27c21c02091d32881655305a4ee9e)
+++ 	(revision )
@@ -1,81 +1,0 @@
-/*
- * Copyright (c) 2010 Martin Decky
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup libnet
- * @{
- */
-
-#ifndef LIBNET_IL_SKEL_H_
-#define LIBNET_IL_SKEL_H_
-
-/** @file
- * Internetwork layer module skeleton.
- * The skeleton has to be part of each internetwork layer module.
- */
-
-#include <ipc/services.h>
-#include <adt/measured_strings.h>
-#include <net/device.h>
-#include <net/packet.h>
-#include <async.h>
-
-/** Module initialization.
- *
- * This has to be implemented in user code.
- *
- * @param[in] sess Networking module session.
- *
- * @return EOK on success.
- * @return Other error codes as defined for each specific module
- *         initialize function.
- *
- */
-extern int il_initialize(async_sess_t *sess);
-
-/** Process the internetwork layer module message.
- *
- * This has to be implemented in user code.
- *
- * @param[in]  callid Message identifier.
- * @param[in]  call   Message parameters.
- * @param[out] answer Answer.
- * @param[out] count  Number of arguments of the answer.
- *
- * @return EOK on success.
- * @return Other error codes as defined for each specific module.
- *
- */
-extern int il_module_message(ipc_callid_t callid, ipc_call_t *call,
-    ipc_call_t *answer, size_t *answer_count);
-
-extern int il_module_start(sysarg_t);
-
-#endif
-
-/** @}
- */
Index: uspace/lib/net/include/ip_client.h
===================================================================
--- uspace/lib/net/include/ip_client.h	(revision 3d93289a3fb27c21c02091d32881655305a4ee9e)
+++ 	(revision )
@@ -1,61 +1,0 @@
-/*
- * Copyright (c) 2009 Lukas Mejdrech
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup libnet
- * @{
- */
-
-/** @file
- * IP client interface.
- */
-
-#ifndef LIBNET_IP_CLIENT_H_
-#define LIBNET_IP_CLIENT_H_
-
-#include <net/socket_codes.h>
-#include <sys/types.h>
-
-#include <net/packet.h>
-#include <net/ip_codes.h>
-#include <ip_interface.h>
-
-extern int ip_client_prepare_packet(packet_t *, ip_protocol_t, ip_ttl_t,
-    ip_tos_t, int, size_t);
-extern int ip_client_process_packet(packet_t *, ip_protocol_t *, ip_ttl_t *,
-    ip_tos_t *, int *, size_t *);
-extern size_t ip_client_header_length(packet_t *);
-extern int ip_client_set_pseudo_header_data_length(void *, size_t, size_t);
-extern int ip_client_get_pseudo_header(ip_protocol_t, struct sockaddr *,
-    socklen_t, struct sockaddr *, socklen_t, size_t, void **, size_t *);
-
-// TODO ipopt manipulation
-
-#endif
-
-/** @}
- */
Index: uspace/lib/net/include/ip_header.h
===================================================================
--- uspace/lib/net/include/ip_header.h	(revision 3d93289a3fb27c21c02091d32881655305a4ee9e)
+++ 	(revision )
@@ -1,223 +1,0 @@
-/*
- * Copyright (c) 2009 Lukas Mejdrech
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup libnet 
- * @{
- */
-
-/** @file
- * IP header and options definitions.
- * Based on the RFC 791.
- */
-
-#ifndef LIBNET_IP_HEADER_H_
-#define LIBNET_IP_HEADER_H_
-
-#include <byteorder.h>
-#include <sys/types.h>
-
-/** Returns the fragment offest high bits.
- * @param[in] length The prefixed data total length.
- */
-#define IP_COMPUTE_FRAGMENT_OFFSET_HIGH(length) \
-	((((length) / 8U) & 0x1f00) >> 8)
-
-/** Returns the fragment offest low bits.
- * @param[in] length The prefixed data total length.
- */
-#define IP_COMPUTE_FRAGMENT_OFFSET_LOW(length) \
-	(((length) / 8U) & 0xff)
-
-/** Returns the IP header length.
- * @param[in] length The IP header length in bytes.
- */
-#define IP_COMPUTE_HEADER_LENGTH(length) \
-	((uint8_t) ((length) / 4U))
-
-/** Returns the fragment offest.
- * @param[in] header The IP packet header.
- */
-#define IP_FRAGMENT_OFFSET(header) \
-	(((GET_IP_HEADER_FRAGMENT_OFFSET_HIGH(header) << 8) + \
-	    (header)->fragment_offset_low) * 8U)
-
-/** Returns the IP packet header checksum.
- *  @param[in] header The IP packet header.
- */
-#define IP_HEADER_CHECKSUM(header) \
-	(htons(ip_checksum((uint8_t *) (header), IP_HEADER_LENGTH(header))))
-
-/** Returns the actual IP packet data length.
- * @param[in] header The IP packet header.
- */
-#define IP_HEADER_DATA_LENGTH(header) \
-	(IP_TOTAL_LENGTH(header) - IP_HEADER_LENGTH(header))
-
-/** Returns the actual IP header length in bytes.
- * @param[in] header The IP packet header.
- */
-#define IP_HEADER_LENGTH(header) \
-	(GET_IP_HEADER_LENGTH(header) * 4U)
-
-/** Returns the actual IP packet total length.
- * @param[in] header The IP packet header.
- */
-#define IP_TOTAL_LENGTH(header) \
-	ntohs((header)->total_length)
-
-/** @name IP flags definitions */
-/*@{*/
-
-/** Fragment flag field shift. */
-#define IPFLAG_FRAGMENT_SHIFT	1
-
-/** Fragmented flag field shift. */
-#define IPFLAG_FRAGMENTED_SHIFT	0
-
-/** Don't fragment flag value.
- * Permits the packet fragmentation.
- */
-#define IPFLAG_DONT_FRAGMENT	(0x1 << IPFLAG_FRAGMENT_SHIFT)
-
-/** Last fragment flag value.
- * Indicates the last packet fragment.
- */
-#define IPFLAG_LAST_FRAGMENT	(0x0 << IPFLAG_FRAGMENTED_SHIFT)
-
-/** May fragment flag value.
- * Allows the packet fragmentation.
- */
-#define IPFLAG_MAY_FRAGMENT	(0x0 << IPFLAG_FRAGMENT_SHIFT)
-
-/** More fragments flag value.
- * Indicates that more packet fragments follow.
- */
-#define IPFLAG_MORE_FRAGMENTS	(0x1 << IPFLAG_FRAGMENTED_SHIFT)
-
-/*@}*/
-
-/** Type definition of the internet header.
- * @see ip_header
- */
-typedef struct ip_header ip_header_t;
-
-/** Type definition of the internet option header.
- * @see ip_header
- */
-typedef struct ip_option ip_option_t;
-
-/** Type definition of the internet version 4 pseudo header.
- * @see ipv4_pseudo_header
- */
-typedef struct ipv4_pseudo_header ipv4_pseudo_header_t;
-
-/** Internet header.
- *
- * The variable options should be included after the header itself and
- * indicated by the increased header length value.
- */
-struct ip_header {
-	uint8_t vhl; /* version, header_length */
-
-#define GET_IP_HEADER_VERSION(header) \
-	(((header)->vhl & 0xf0) >> 4)
-#define SET_IP_HEADER_VERSION(header, version) \
-	((header)->vhl = \
-	 ((version & 0x0f) << 4) | ((header)->vhl & 0x0f))
-
-#define GET_IP_HEADER_LENGTH(header) \
-	((header)->vhl & 0x0f)
-#define SET_IP_HEADER_LENGTH(header, length) \
-	((header)->vhl = \
-	 (length & 0x0f) | ((header)->vhl & 0xf0))
-
-	uint8_t tos;
-	uint16_t total_length;
-	uint16_t identification;
-
-	uint8_t ffoh; /* flags, fragment_offset_high */
-
-#define GET_IP_HEADER_FLAGS(header) \
-	(((header)->ffoh & 0xe0) >> 5)
-#define SET_IP_HEADER_FLAGS(header, flags) \
-	((header)->ffoh = \
-	 ((flags & 0x07) << 5) | ((header)->ffoh & 0x1f))
-
-#define GET_IP_HEADER_FRAGMENT_OFFSET_HIGH(header) \
-	((header)->ffoh & 0x1f)
-#define SET_IP_HEADER_FRAGMENT_OFFSET_HIGH(header, fragment_offset_high) \
-	((header)->ffoh = \
-	 (fragment_offset_high & 0x1f) | ((header)->ffoh & 0xe0))
-
-	uint8_t fragment_offset_low;
-	uint8_t ttl;
-	uint8_t protocol;
-	uint16_t header_checksum;
-	uint32_t source_address;
-	uint32_t destination_address;
-} __attribute__ ((packed));
-
-/** Internet option header.
- *
- * Only type field is always valid.
- * Other fields' validity depends on the option type.
- */
-struct ip_option {
-	uint8_t type;
-	uint8_t length;
-	uint8_t pointer;
-
-	uint8_t of; /* overflow, flags */
-
-#define GET_IP_OPTION_OVERFLOW(option) \
-	(((option)->of & 0xf0) >> 4)
-#define SET_IP_OPTION_OVERFLOW(option, overflow) \
-	((option)->of = \
-	 ((overflow & 0x0f) << 4) | ((option)->of & 0x0f))
-
-#define GET_IP_OPTION_FLAGS(option) \
-	((option)->of & 0x0f)
-#define SET_IP_OPTION_FLAGS(option, flags) \
-	((option)->of = \
-	 (flags & 0x0f) | ((option)->of & 0xf0))
-
-} __attribute__ ((packed));
-
-/** Internet version 4 pseudo header. */
-struct ipv4_pseudo_header {
-	uint32_t source_address;
-	uint32_t destination_address;
-	uint8_t reserved;
-	uint8_t protocol;
-	uint16_t data_length;
-} __attribute__ ((packed));
-
-#endif
-
-/** @}
- */
Index: uspace/lib/net/include/ip_interface.h
===================================================================
--- uspace/lib/net/include/ip_interface.h	(revision 3d93289a3fb27c21c02091d32881655305a4ee9e)
+++ 	(revision )
@@ -1,81 +1,0 @@
-/*
- * Copyright (c) 2009 Lukas Mejdrech
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup libnet 
- * @{
- */
-
-#ifndef LIBNET_IP_INTERFACE_H_
-#define LIBNET_IP_INTERFACE_H_
-
-#include <net/socket_codes.h>
-#include <ipc/services.h>
-#include <net/device.h>
-#include <net/packet.h>
-#include <net/in.h>
-#include <net/ip_codes.h>
-#include <ip_remote.h>
-#include <async.h>
-
-#define ip_received_error_msg  ip_received_error_msg_remote
-#define ip_set_gateway_req     ip_set_gateway_req_remote
-#define ip_packet_size_req     ip_packet_size_req_remote
-#define ip_add_route_req       ip_add_route_req_remote
-#define ip_send_msg            ip_send_msg_remote
-#define ip_get_route_req       ip_get_route_req_remote
-
-/** @name IP module interface
- * This interface is used by other modules.
- */
-/*@{*/
-
-/** The transport layer notification function type definition.
- *
- * Notify the transport layer modules about the received packet/s.
- *
- * @param[in] device_id Device identifier.
- * @param[in] packet    Received packet or the received packet queue.
- * @param[in] receiver  Receiving module service.
- * @param[in] error     Packet error reporting service. Prefixes the
- *                      received packet.
- *
- * @return EOK on success.
- *
- */
-typedef int (*tl_received_msg_t)(nic_device_id_t device_id, packet_t *packet,
-    services_t receiver, services_t error);
-
-extern async_sess_t *ip_bind_service(services_t, int, services_t, async_client_conn_t);
-extern async_sess_t *ip_connect_module(services_t);
-
-/*@}*/
-
-#endif
-
-/** @}
- */
Index: uspace/lib/net/include/ip_remote.h
===================================================================
--- uspace/lib/net/include/ip_remote.h	(revision 3d93289a3fb27c21c02091d32881655305a4ee9e)
+++ 	(revision )
@@ -1,61 +1,0 @@
-/*
- * Copyright (c) 2009 Lukas Mejdrech
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup libnet
- * @{
- */
-
-#ifndef LIBNET_IP_REMOTE_H_
-#define LIBNET_IP_REMOTE_H_
-
-#include <ipc/services.h>
-#include <net/ip_codes.h>
-#include <net/inet.h>
-#include <net/in.h>
-#include <net/packet.h>
-#include <net/device.h>
-#include <net/socket.h>
-#include <async.h>
-
-extern int ip_set_gateway_req_remote(async_sess_t *, nic_device_id_t, in_addr_t);
-extern int ip_packet_size_req_remote(async_sess_t *, nic_device_id_t,
-    packet_dimension_t *);
-extern int ip_received_error_msg_remote(async_sess_t *, nic_device_id_t, packet_t *,
-    services_t, services_t);
-extern int ip_device_req(async_sess_t *, nic_device_id_t, services_t);
-extern int ip_add_route_req_remote(async_sess_t *, nic_device_id_t, in_addr_t,
-    in_addr_t, in_addr_t);
-extern int ip_send_msg_remote(async_sess_t *, nic_device_id_t, packet_t *,
-    services_t, services_t);
-extern int ip_get_route_req_remote(async_sess_t *, ip_protocol_t,
-    const struct sockaddr *, socklen_t, nic_device_id_t *, void **, size_t *);
-
-#endif
-
-/** @}
- */
Index: uspace/lib/net/include/net_checksum.h
===================================================================
--- uspace/lib/net/include/net_checksum.h	(revision 3d93289a3fb27c21c02091d32881655305a4ee9e)
+++ 	(revision )
@@ -1,73 +1,0 @@
-/*
- * Copyright (c) 2009 Lukas Mejdrech
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup libnet
- * @{
- */
-/** @file
- * General CRC and checksum computation.
- */
-
-#ifndef LIBNET_CHECKSUM_H_
-#define LIBNET_CHECKSUM_H_
-
-#include <byteorder.h>
-#include <sys/types.h>
-
-/** IP checksum value for computed zero checksum.
- *
- * Zero is returned as 0xFFFF (not flipped)
- *
- */
-#define IP_CHECKSUM_ZERO  0xffffU
-
-#ifdef __BE__
-
-#define compute_crc32(seed, data, length) \
-	compute_crc32_be(seed, (uint8_t *) data, length)
-
-#endif
-
-#ifdef __LE__
-
-#define compute_crc32(seed, data, length) \
-	compute_crc32_le(seed, (uint8_t *) data, length)
-
-#endif
-
-extern uint32_t compute_crc32_le(uint32_t, uint8_t *, size_t);
-extern uint32_t compute_crc32_be(uint32_t, uint8_t *, size_t);
-extern uint32_t compute_checksum(uint32_t, uint8_t *, size_t);
-extern uint16_t compact_checksum(uint32_t);
-extern uint16_t flip_checksum(uint16_t);
-extern uint16_t ip_checksum(uint8_t *, size_t);
-
-#endif
-
-/** @}
- */
Index: uspace/lib/net/include/net_hardware.h
===================================================================
--- uspace/lib/net/include/net_hardware.h	(revision 3d93289a3fb27c21c02091d32881655305a4ee9e)
+++ 	(revision )
@@ -1,60 +1,0 @@
-/*
- * Copyright (c) 2009 Lukas Mejdrech
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup libnet
- * @{
- */
-
-/** @file
- * Hardware types according to the on-line IANA - Address Resolution Protocol
- * (ARP) Parameters
- * http://www.iana.org/assignments/arp-parameters/arp-parameters.xml,
- * cited January 14 2009.
- */
-
-#ifndef LIBNET_NET_HARDWARE_H_
-#define LIBNET_NET_HARDWARE_H_
-
-#include <sys/types.h>
-
-/** Network interface layer type type definition. */
-typedef uint8_t hw_type_t;
-
-/** @name Network interface layer types definitions */
-/*@{*/
-
-/** Ethernet (10Mb) hardware type. */
-#define HW_ETHER		1
-
-/*@}*/
-
-#endif
-
-/** @}
- */
-
Index: uspace/lib/net/include/net_interface.h
===================================================================
--- uspace/lib/net/include/net_interface.h	(revision 3d93289a3fb27c21c02091d32881655305a4ee9e)
+++ 	(revision )
@@ -1,61 +1,0 @@
-/*
- * Copyright (c) 2009 Lukas Mejdrech
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup libnet
- *  @{
- */
-
-#ifndef LIBNET_NET_INTERFACE_H_
-#define LIBNET_NET_INTERFACE_H_
-
-#include <ipc/services.h>
-#include <net/device.h>
-#include <adt/measured_strings.h>
-#include <async.h>
-#include <devman.h>
-
-/** @name Networking module interface
- * This interface is used by other modules.
- */
-/*@{*/
-
-extern int net_get_device_conf_req(async_sess_t *, nic_device_id_t,
-    measured_string_t **, size_t, uint8_t **);
-extern int net_get_conf_req(async_sess_t *, measured_string_t **, size_t,
-    uint8_t **);
-extern void net_free_settings(measured_string_t *, uint8_t *);
-extern int net_get_devices_req(async_sess_t *, measured_string_t **, size_t *,
-    uint8_t **);
-extern async_sess_t *net_connect_module(void);
-
-/*@}*/
-
-#endif
-
-/** @}
- */
Index: uspace/lib/net/include/nil_remote.h
===================================================================
--- uspace/lib/net/include/nil_remote.h	(revision 3d93289a3fb27c21c02091d32881655305a4ee9e)
+++ 	(revision )
@@ -1,68 +1,0 @@
-/*
- * Copyright (c) 2009 Lukas Mejdrech
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup netif
- * @{
- */
-
-#ifndef __NET_NIL_REMOTE_H__
-#define __NET_NIL_REMOTE_H__
-
-#include <ipc/loc.h>
-#include <net/device.h>
-#include <net/packet.h>
-#include <devman.h>
-#include <generic.h>
-#include <async.h>
-#include <sys/types.h>
-
-#define nil_bind_service(service, device_id, me, receiver) \
-	bind_service(service, device_id, me, 0, receiver)
-
-#define nil_packet_size_req(sess, device_id, packet_dimension) \
-	generic_packet_size_req_remote(sess, NET_NIL_PACKET_SPACE, \
-	    device_id, packet_dimension)
-
-#define nil_get_addr_req(sess, device_id, address, data) \
-	generic_get_addr_req(sess, NET_NIL_ADDR, device_id, address, data)
-
-#define nil_get_broadcast_addr_req(sess, device_id, address, data) \
-	generic_get_addr_req(sess, NET_NIL_BROADCAST_ADDR, device_id, \
-	    address, data)
-
-#define nil_send_msg(sess, device_id, packet, sender) \
-	generic_send_msg_remote(sess, NET_NIL_SEND, device_id, \
-	    packet_get_id(packet), sender, 0)
-
-extern int nil_device_req(async_sess_t *, nic_device_id_t, devman_handle_t,
-    size_t);
-
-#endif
-
-/** @}
- */
Index: uspace/lib/net/include/nil_skel.h
===================================================================
--- uspace/lib/net/include/nil_skel.h	(revision 3d93289a3fb27c21c02091d32881655305a4ee9e)
+++ 	(revision )
@@ -1,116 +1,0 @@
-/*
- * Copyright (c) 2009 Lukas Mejdrech
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup libnet
- * @{
- */
-
-/** @file
- * Network interface layer modules common skeleton.
- * All network interface layer modules have to implement this interface.
- */
-
-#ifndef LIBNET_NIL_SKEL_H_
-#define LIBNET_NIL_SKEL_H_
-
-#include <ipc/services.h>
-#include <adt/measured_strings.h>
-#include <net/device.h>
-#include <net/packet.h>
-#include <async.h>
-
-/** Module initialization.
- *
- * This has to be implemented in user code.
- *
- * @param[in] sess Networking module session.
- *
- * @return EOK on success.
- * @return Other error codes as defined for each specific module
- *         initialize function.
- *
- */
-extern int nil_initialize(async_sess_t *sess);
-
-/** Notify the network interface layer about the device state change.
- *
- * This has to be implemented in user code.
- *
- * @param[in] device_id Device identifier.
- * @param[in] state     New device state.
- *
- * @return EOK on success.
- * @return Other error codes as defined for each specific module
- *         device state function.
- *
- */
-extern int nil_device_state_msg_local(nic_device_id_t device_id, sysarg_t state);
-
-/** Pass the packet queue to the network interface layer.
- *
- * Process and redistribute the received packet queue to the registered
- * upper layers.
- *
- * This has to be implemented in user code.
- *
- * @param[in] device_id Source device identifier.
- * @param[in] packet    Received packet or the received packet queue.
- *
- * @return EOK on success.
- * @return Other error codes as defined for each specific module
- *         received function.
- *
- */
-extern int nil_received_msg_local(nic_device_id_t device_id, packet_t *packet);
-
-/** Message processing function.
- *
- * This has to be implemented in user code.
- *
- * @param[in]  callid Message identifier.
- * @param[in]  call   Message parameters.
- * @param[out] answer Message answer parameters.
- * @param[out] count  Message answer arguments.
- *
- * @return EOK on success.
- * @return ENOTSUP if the message is not known.
- * @return Other error codes as defined for each specific module
- *         message function.
- *
- * @see IS_NET_NIL_MESSAGE()
- *
- */
-extern int nil_module_message(ipc_callid_t callid, ipc_call_t *call,
-    ipc_call_t *answer, size_t *count);
-
-extern int nil_module_start(sysarg_t);
-
-#endif
-
-/** @}
- */
Index: uspace/lib/net/include/packet_client.h
===================================================================
--- uspace/lib/net/include/packet_client.h	(revision 3d93289a3fb27c21c02091d32881655305a4ee9e)
+++ 	(revision )
@@ -1,118 +1,0 @@
-/*
- * Copyright (c) 2009 Lukas Mejdrech
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup libnet
- *  @{
- */
-
-/** @file
- * Packet client.
- *
- * To function correctly, initialization of the packet map by the pm_init()
- * function has to happen at the first place. The module should not send the
- * packet messages to the packet server but use the functions provided. The
- * packet map should be released by the pm_destroy() function during the module
- * termination. The packets and the packet queues can't be locked at all. The
- * processing modules should process them sequentially - by passing the packets
- * to the next module and stopping using the passed ones.
- *
- * @see packet.h
- */
-
-#ifndef LIBNET_PACKET_CLIENT_H_
-#define LIBNET_PACKET_CLIENT_H_
-
-#include <net/packet.h>
-#include <async.h>
-
-/** @name Packet client interface */
-/*@{*/
-
-/** Allocates the specified type right before the actual packet content and
- * returns its pointer.
- *
- * The wrapper of the packet_prepend() function.
- *
- * @param[in] packet	The packet to be used.
- * @param[in] type	The type to be allocated at the beginning of the packet
- *			content.
- * @return		The typed pointer to the allocated memory.
- * @return		NULL if the packet is not valid.
- * @return		NULL if there is not enough memory left.
- */
-#define PACKET_PREFIX(packet, type) \
-	(type *) packet_prefix((packet), sizeof(type))
-
-/** Allocates the specified type right after the actual packet content and
- * returns its pointer.
- *
- * The wrapper of the packet_append() function.
- *
- * @param[in] packet	The packet to be used.
- * @param[in] type	The type to be allocated at the end of the packet
- *			content.
- * @return		The typed pointer to the allocated memory.
- * @return		NULL if the packet is not valid.
- * @return		NULL if there is not enough memory left.
- */
-#define PACKET_SUFFIX(packet, type) \
-	(type *) packet_suffix((packet), sizeof(type))
-
-/** Trims the actual packet content by the specified prefix and suffix types.
- *
- * The wrapper of the packet_trim() function.
- *
- * @param[in] packet	The packet to be trimmed.
- * @param[in] prefix	The type of the prefix to be removed from the beginning
- *			of the packet content.
- * @param[in] suffix	The type of the suffix to be removed from the end of
- *			the packet content.
- * @return		EOK on success.
- * @return		EINVAL if the packet is not valid.
- * @return		ENOMEM if there is not enough memory left.
- */
-#define PACKET_TRIM(packet, prefix, suffix) \
-	packet_trim((packet), sizeof(prefix), sizeof(suffix))
-
-extern void *packet_prefix(packet_t *, size_t);
-extern void *packet_suffix(packet_t *, size_t);
-extern int packet_trim(packet_t *, size_t, size_t);
-extern int packet_copy_data(packet_t *, const void *, size_t);
-extern packet_id_t packet_get_id(const packet_t *);
-extern size_t packet_get_data_length(const packet_t *);
-extern void *packet_get_data(const packet_t *);
-extern int packet_get_addr(const packet_t *, uint8_t **, uint8_t **);
-extern int packet_set_addr(packet_t *, const uint8_t *, const uint8_t *, size_t);
-extern packet_t *packet_get_copy(async_sess_t *, packet_t *);
-
-/*@}*/
-
-#endif
-
-/** @}
- */
Index: uspace/lib/net/include/packet_remote.h
===================================================================
--- uspace/lib/net/include/packet_remote.h	(revision 3d93289a3fb27c21c02091d32881655305a4ee9e)
+++ 	(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 libnet
- * @{
- */
-
-#ifndef LIBNET_PACKET_REMOTE_H_
-#define LIBNET_PACKET_REMOTE_H_
-
-#include <net/packet.h>
-#include <sys/types.h>
-#include <async.h>
-
-extern int packet_translate_remote(async_sess_t *, packet_t **, packet_id_t);
-extern packet_t *packet_get_4_remote(async_sess_t *, size_t, size_t, size_t,
-    size_t);
-extern packet_t *packet_get_1_remote(async_sess_t *, size_t);
-extern void pq_release_remote(async_sess_t *, packet_id_t);
-
-#endif
-
-/** @}
- */
Index: uspace/lib/net/include/protocol_map.h
===================================================================
--- uspace/lib/net/include/protocol_map.h	(revision 3d93289a3fb27c21c02091d32881655305a4ee9e)
+++ 	(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 libnet
- * @{
- */
-
-/** @file
- * Internetwork layer services - network interface layer service type
- * translation.
- */
-
-#ifndef LIBNET_PROTOCOL_MAP_H_
-#define LIBNET_PROTOCOL_MAP_H_
-
-#include <ethernet_lsap.h>
-#include <ethernet_protocols.h>
-#include <net_hardware.h>
-
-#include <ipc/services.h>
-
-extern eth_type_t protocol_map(services_t, services_t);
-extern services_t protocol_unmap(services_t, int);
-extern eth_type_t lsap_map(eth_lsap_t);
-extern eth_lsap_t lsap_unmap(eth_type_t);
-extern hw_type_t hardware_map(services_t);
-
-#endif
-
-/** @}
- */
Index: uspace/lib/net/include/socket_core.h
===================================================================
--- uspace/lib/net/include/socket_core.h	(revision 3d93289a3fb27c21c02091d32881655305a4ee9e)
+++ uspace/lib/net/include/socket_core.h	(revision 0c37135e2c247d5596135d0f642dda1783ef2043)
@@ -44,5 +44,4 @@
 #include <net/in.h>
 #include <net/device.h>
-#include <net/packet.h>
 #include <async.h>
 
@@ -80,6 +79,4 @@
 	/** Bound port. */
 	int port;
-	/** Received packets queue. */
-	dyn_fifo_t received;
 	/** Sockets for acceptance queue. */
 	dyn_fifo_t accepted;
@@ -118,5 +115,4 @@
 extern int socket_destroy(async_sess_t *, int, socket_cores_t *,
     socket_ports_t *, void (*)(socket_core_t *));
-extern int socket_reply_packets(packet_t *, size_t *);
 extern socket_core_t *socket_port_find(socket_ports_t *, int, const uint8_t *,
     size_t);
Index: uspace/lib/net/include/tl_common.h
===================================================================
--- uspace/lib/net/include/tl_common.h	(revision 3d93289a3fb27c21c02091d32881655305a4ee9e)
+++ 	(revision )
@@ -1,67 +1,0 @@
-/*
- * Copyright (c) 2008 Lukas Mejdrech
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup libnet
- * @{
- */
-
-/** @file
- * Transport layer common functions.
- */
-
-#ifndef LIBNET_TL_COMMON_H_
-#define LIBNET_TL_COMMON_H_
-
-#include <ipc/services.h>
-#include <net/socket_codes.h>
-#include <net/packet.h>
-#include <net/device.h>
-#include <net/inet.h>
-#include <async.h>
-
-/** Device packet dimensions.
- * Maps devices to the packet dimensions.
- * @see device.h
- */
-DEVICE_MAP_DECLARE(packet_dimensions, packet_dimension_t);
-
-extern int tl_get_ip_packet_dimension(async_sess_t *, packet_dimensions_t *,
-    nic_device_id_t, packet_dimension_t **);
-extern int tl_get_address_port(const struct sockaddr *, int, uint16_t *);
-extern int tl_update_ip_packet_dimension(packet_dimensions_t *, nic_device_id_t,
-    size_t);
-extern int tl_set_address_port(struct sockaddr *, int, uint16_t);
-extern int tl_prepare_icmp_packet(async_sess_t *, async_sess_t *, packet_t *,
-    services_t);
-extern int tl_socket_read_packet_data(async_sess_t *, packet_t **, size_t,
-    const packet_dimension_t *, const struct sockaddr *, socklen_t);
-
-#endif
-
-/** @}
- */
Index: uspace/lib/net/include/tl_remote.h
===================================================================
--- uspace/lib/net/include/tl_remote.h	(revision 3d93289a3fb27c21c02091d32881655305a4ee9e)
+++ 	(revision )
@@ -1,61 +1,0 @@
-/*
- * Copyright (c) 2009 Lukas Mejdrech
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup libnet
- * @{
- */
-
-/** @file
- * Transport layer module interface for the underlying internetwork layer.
- */
-
-#ifndef LIBNET_TL_REMOTE_H_
-#define LIBNET_TL_REMOTE_H_
-
-#include <ipc/services.h>
-#include <ipc/tl.h>
-#include <generic.h>
-#include <net/device.h>
-#include <net/packet.h>
-#include <packet_client.h>
-#include <async.h>
-
-/** @name Transport layer module interface
- * This interface is used by other modules.
- */
-/*@{*/
-
-extern int tl_received_msg(async_sess_t *, nic_device_id_t, packet_t *,
-    services_t, services_t);
-
-/*@}*/
-
-#endif
-
-/** @}
- */
Index: uspace/lib/net/include/tl_skel.h
===================================================================
--- uspace/lib/net/include/tl_skel.h	(revision 3d93289a3fb27c21c02091d32881655305a4ee9e)
+++ 	(revision )
@@ -1,89 +1,0 @@
-/*
- * Copyright (c) 2010 Martin Decky
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup libnet
- * @{
- */
-
-#ifndef LIBNET_TL_SKEL_H_
-#define LIBNET_TL_SKEL_H_
-
-/** @file
- * Transport layer module skeleton.
- * The skeleton has to be part of each transport layer module.
- */
-
-#include <fibril_synch.h>
-#include <ipc/services.h>
-#include <adt/measured_strings.h>
-#include <net/device.h>
-#include <net/packet.h>
-#include <async.h>
-
-/** Module initialization.
- *
- * This has to be implemented in user code.
- *
- * @param[in] sess Networking module session.
- *
- * @return EOK on success.
- * @return Other error codes as defined for each specific module
- *         initialize function.
- *
- */
-extern int tl_initialize(async_sess_t *sess);
-
-/** Per-connection module initialization.
- *
- * This has to be implemented in user code.
- *
- */
-extern void tl_connection(void);
-
-/** Process the transport layer module message.
- *
- * This has to be implemented in user code.
- *
- * @param[in]  callid Message identifier.
- * @param[in]  call   Message parameters.
- * @param[out] answer Answer.
- * @param[out] count  Number of arguments of the answer.
- *
- * @return EOK on success.
- * @return Other error codes as defined for each specific module.
- *
- */
-extern int tl_message(ipc_callid_t, ipc_call_t *,
-    ipc_call_t *, size_t *);
-
-extern int tl_module_start(sysarg_t);
-
-#endif
-
-/** @}
- */
Index: uspace/lib/net/nil/nil_remote.c
===================================================================
--- uspace/lib/net/nil/nil_remote.c	(revision 3d93289a3fb27c21c02091d32881655305a4ee9e)
+++ 	(revision )
@@ -1,57 +1,0 @@
-/*
- * Copyright (c) 2009 Lukas Mejdrech
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup libnet
- * @{
- */
-
-/** @file
- * Network interface layer interface implementation for remote modules.
- * @see nil_remote.h
- */
-
-#include <ipc/loc.h>
-#include <nil_remote.h>
-#include <generic.h>
-#include <net/device.h>
-#include <net/packet.h>
-#include <packet_client.h>
-#include <ipc/nil.h>
-
-int nil_device_req(async_sess_t *sess, nic_device_id_t device_id,
-    service_id_t sid, size_t mtu)
-{
-	async_exch_t *exch = async_exchange_begin(sess);
-	int rc = async_req_3_0(exch, NET_NIL_DEVICE, (sysarg_t) device_id,
-	    (sysarg_t) sid, (sysarg_t) mtu);
-	async_exchange_end(exch);
-	return rc;
-}
-
-/** @}
- */
Index: uspace/lib/net/nil/nil_skel.c
===================================================================
--- uspace/lib/net/nil/nil_skel.c	(revision 3d93289a3fb27c21c02091d32881655305a4ee9e)
+++ 	(revision )
@@ -1,128 +1,0 @@
-/*
- * Copyright (c) 2011 Martin Decky
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup libnet
- * @{
- */
-
-/** @file
- * Network interface layer module skeleton implementation.
- * @see nil_skel.h
- */
-
-#include <bool.h>
-#include <errno.h>
-#include <ns.h>
-#include <nil_skel.h>
-#include <net_interface.h>
-#include <net/modules.h>
-
-/** Default thread for new connections.
- *
- * @param[in] iid   The initial message identifier.
- * @param[in] icall The initial message call structure.
- *
- */
-static void nil_client_connection(ipc_callid_t iid, ipc_call_t *icall,
-    void *arg)
-{
-	/*
-	 * Accept the connection by answering
-	 * the initial IPC_M_CONNECT_ME_TO call.
-	 */
-	async_answer_0(iid, EOK);
-	
-	while (true) {
-		ipc_call_t answer;
-		size_t count;
-		
-		/* Clear the answer structure */
-		refresh_answer(&answer, &count);
-		
-		/* Fetch the next message */
-		ipc_call_t call;
-		ipc_callid_t callid = async_get_call(&call);
-		
-		/* Process the message */
-		int res = nil_module_message(callid, &call, &answer,
-		    &count);
-		
-		/*
-		 * End if told to either by the message or the processing
-		 * result.
-		 */
-		if ((!IPC_GET_IMETHOD(call)) || (res == EHANGUP))
-			return;
-		
-		/* Answer the message */
-		answer_call(callid, res, &answer, count);
-	}
-}
-
-/** Start the network interface layer module.
- *
- * Initialize the client connection serving function, initialize
- * the module, register the module service and start the async
- * manager, processing IPC messages in an infinite loop.
- *
- * @param[in] service Service identification.
- *
- * @return EOK on success.
- * @return Other error codes as defined for the pm_init() function.
- * @return Other error codes as defined for the nil_initialize()
- *         function.
- *
- */
-int nil_module_start(sysarg_t service)
-{
-	async_set_client_connection(nil_client_connection);
-	async_sess_t *sess = net_connect_module();
-	if (!sess)
-		return ENOENT;
-	
-	int rc = pm_init();
-	if (rc != EOK)
-		return rc;
-	
-	rc = nil_initialize(sess);
-	if (rc != EOK)
-		goto out;
-	
-	rc = service_register(service);
-	if (rc != EOK)
-		goto out;
-	
-	async_manager();
-	
-out:
-	pm_destroy();
-	return rc;
-}
-
-/** @}
- */
Index: uspace/lib/net/tl/icmp_client.c
===================================================================
--- uspace/lib/net/tl/icmp_client.c	(revision 3d93289a3fb27c21c02091d32881655305a4ee9e)
+++ 	(revision )
@@ -1,93 +1,0 @@
-/*
- * Copyright (c) 2009 Lukas Mejdrech
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup libnet
- * @{
- */
-
-/** @file
- * ICMP client interface implementation.
- * @see icmp_client.h
- */
-
-#include <icmp_client.h>
-#include <icmp_header.h>
-#include <packet_client.h>
-#include <errno.h>
-#include <sys/types.h>
-#include <net/icmp_codes.h>
-#include <net/packet.h>
-
-/** Processes the received packet prefixed with an ICMP header.
- *
- * @param[in] packet	The received packet.
- * @param[out] type	The ICMP header type.
- * @param[out] code	The ICMP header code.
- * @param[out] pointer	The ICMP header pointer.
- * @param[out] mtu	The ICMP header MTU.
- * @return		The ICMP header length.
- * @return		Zero if the packet contains no data.
- */
-int icmp_client_process_packet(packet_t *packet, icmp_type_t *type,
-    icmp_code_t *code, icmp_param_t *pointer, icmp_param_t *mtu)
-{
-	icmp_header_t *header;
-
-	header = (icmp_header_t *) packet_get_data(packet);
-	if (!header ||
-	    (packet_get_data_length(packet) < sizeof(icmp_header_t))) {
-		return 0;
-	}
-
-	if (type)
-		*type = header->type;
-	if (code)
-		*code = header->code;
-	if (pointer)
-		*pointer = header->un.param.pointer;
-	if (mtu)
-		*mtu = header->un.frag.mtu;
-
-	return sizeof(icmp_header_t);
-}
-
-/** Returns the ICMP header length.
- *
- * @param[in] packet	The packet.
- * @return		The ICMP header length in bytes.
- */
-size_t icmp_client_header_length(packet_t *packet)
-{
-	if (packet_get_data_length(packet) < sizeof(icmp_header_t))
-		return 0;
-
-	return sizeof(icmp_header_t);
-}
-
-/** @}
- */
Index: uspace/lib/net/tl/icmp_remote.c
===================================================================
--- uspace/lib/net/tl/icmp_remote.c	(revision 3d93289a3fb27c21c02091d32881655305a4ee9e)
+++ 	(revision )
@@ -1,152 +1,0 @@
-/*
- * Copyright (c) 2009 Lukas Mejdrech
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup libnet
- *  @{
- */
-
-/** @file
- * ICMP interface implementation for remote modules.
- * @see icmp_remote.h
- */
-
-#include <icmp_remote.h>
-#include <net/modules.h>
-#include <packet_client.h>
-#include <ipc/services.h>
-#include <ipc/icmp.h>
-#include <sys/types.h>
-#include <async.h>
-#include <errno.h>
-
-/** Send the Destination Unreachable error notification packet.
- *
- * Beginning of the packet is sent as the notification packet data.
- * The source and the destination addresses should be set in the original
- * packet.
- *
- * @param[in] sess   ICMP module session.
- * @param[in] code   Error specific code.
- * @param[in] mtu    Error MTU value.
- * @param[in] packet Original packet.
- *
- * @return EOK on success.
- * @return EPERM if the ICMP error notifications are disabled.
- * @return ENOMEM if there is not enough memory left.
- *
- */
-int icmp_destination_unreachable_msg(async_sess_t *sess, icmp_code_t code,
-    icmp_param_t mtu, packet_t *packet)
-{
-	async_exch_t *exch = async_exchange_begin(sess);
-	async_msg_3(exch, NET_ICMP_DEST_UNREACH, (sysarg_t) code,
-	    (sysarg_t) packet_get_id(packet), (sysarg_t) mtu);
-	async_exchange_end(exch);
-	
-	return EOK;
-}
-
-/** Send the Source Quench error notification packet.
- *
- * Beginning of the packet is sent as the notification packet data.
- * The source and the destination addresses should be set in the original
- * packet.
- *
- * @param[in] sess   ICMP module session.
- * @param[in] packet Original packet.
- *
- * @return EOK on success.
- * @return EPERM if the ICMP error notifications are disabled.
- * @return ENOMEM if there is not enough memory left.
- *
- */
-int icmp_source_quench_msg(async_sess_t *sess, packet_t *packet)
-{
-	async_exch_t *exch = async_exchange_begin(sess);
-	async_msg_2(exch, NET_ICMP_SOURCE_QUENCH, 0,
-	    (sysarg_t) packet_get_id(packet));
-	async_exchange_end(exch);
-	
-	return EOK;
-}
-
-/** Send the Time Exceeded error notification packet.
- *
- * Beginning of the packet is sent as the notification packet data.
- * The source and the destination addresses should be set in the original
- * packet.
- *
- * @param[in] sess   ICMP module session.
- * @param[in] code   Error specific code.
- * @param[in] packet Original packet.
- *
- * @return EOK on success.
- * @return EPERM if the ICMP error notifications are disabled.
- * @return ENOMEM if there is not enough memory left.
- *
- */
-int icmp_time_exceeded_msg(async_sess_t *sess, icmp_code_t code,
-    packet_t *packet)
-{
-	async_exch_t *exch = async_exchange_begin(sess);
-	async_msg_2(exch, NET_ICMP_TIME_EXCEEDED, (sysarg_t) code,
-	    (sysarg_t) packet_get_id(packet));
-	async_exchange_end(exch);
-	
-	return EOK;
-}
-
-/** Send the Parameter Problem error notification packet.
- *
- * Beginning of the packet is sent as the notification packet data.
- * The source and the destination addresses should be set in the original
- * packet.
- *
- * @param[in] sess    ICMP module session.
- * @param[in] code    Error specific code.
- * @param[in] pointer Problematic parameter offset.
- * @param[in] packet  Original packet.
- *
- * @return EOK on success.
- * @return EPERM if the ICMP error notifications are disabled.
- * @return ENOMEM if there is not enough memory left.
- *
- */
-int icmp_parameter_problem_msg(async_sess_t *sess, icmp_code_t code,
-    icmp_param_t pointer, packet_t *packet)
-{
-	async_exch_t *exch = async_exchange_begin(sess);
-	async_msg_3(exch, NET_ICMP_PARAMETERPROB, (sysarg_t) code,
-	    (sysarg_t) packet_get_id(packet), (sysarg_t) pointer);
-	async_exchange_end(exch);
-	
-	return EOK;
-}
-
-/** @}
- */
Index: uspace/lib/net/tl/socket_core.c
===================================================================
--- uspace/lib/net/tl/socket_core.c	(revision 3d93289a3fb27c21c02091d32881655305a4ee9e)
+++ uspace/lib/net/tl/socket_core.c	(revision 0c37135e2c247d5596135d0f642dda1783ef2043)
@@ -36,10 +36,7 @@
 
 #include <socket_core.h>
-#include <packet_client.h>
-#include <packet_remote.h>
 #include <net/socket_codes.h>
 #include <net/in.h>
 #include <net/inet.h>
-#include <net/packet.h>
 #include <net/modules.h>
 #include <stdint.h>
@@ -92,10 +89,4 @@
 	}
 	
-	/* Release all received packets */
-	int packet_id;
-	while ((packet_id = dyn_fifo_pop(&socket->received)) >= 0)
-		pq_release_remote(sess, packet_id);
-	
-	dyn_fifo_destroy(&socket->received);
 	dyn_fifo_destroy(&socket->accepted);
 	
@@ -448,20 +439,13 @@
 	socket->key_length = 0;
 	socket->specific_data = specific_data;
-	rc = dyn_fifo_initialize(&socket->received, SOCKET_INITIAL_RECEIVED_SIZE);
+	
+	rc = dyn_fifo_initialize(&socket->accepted, SOCKET_INITIAL_ACCEPTED_SIZE);
 	if (rc != EOK) {
 		free(socket);
 		return rc;
 	}
-	
-	rc = dyn_fifo_initialize(&socket->accepted, SOCKET_INITIAL_ACCEPTED_SIZE);
-	if (rc != EOK) {
-		dyn_fifo_destroy(&socket->received);
-		free(socket);
-		return rc;
-	}
 	socket->socket_id = *socket_id;
 	rc = socket_cores_add(local_sockets, socket->socket_id, socket);
 	if (rc < 0) {
-		dyn_fifo_destroy(&socket->received);
 		dyn_fifo_destroy(&socket->accepted);
 		free(socket);
@@ -506,87 +490,4 @@
 	socket_destroy_core(sess, socket, local_sockets, global_sockets,
 	    socket_release);
-	
-	return EOK;
-}
-
-/** Replies the packet or the packet queue data to the application via the
- * socket.
- *
- * Uses the current message processing fibril.
- *
- * @param[in] packet	The packet to be transfered.
- * @param[out] length	The total data length.
- * @return		EOK on success.
- * @return		EBADMEM if the length parameter is NULL.
- * @return		ENOMEM if there is not enough memory left.
- * @return		Other error codes as defined for the data_reply()
- *			function.
- */
-int socket_reply_packets(packet_t *packet, size_t *length)
-{
-	packet_t *next_packet;
-	size_t fragments;
-	size_t *lengths;
-	size_t index;
-	int rc;
-
-	if (!length)
-		return EBADMEM;
-
-	next_packet = pq_next(packet);
-	if (!next_packet) {
-		/* Write all if only one fragment */
-		rc = data_reply(packet_get_data(packet),
-		    packet_get_data_length(packet));
-		if (rc != EOK)
-			return rc;
-		/* Store the total length */
-		*length = packet_get_data_length(packet);
-	} else {
-		/* Count the packet fragments */
-		fragments = 1;
-		next_packet = pq_next(packet);
-		while ((next_packet = pq_next(next_packet)))
-			++fragments;
-		
-		/* Compute and store the fragment lengths */
-		lengths = (size_t *) malloc(sizeof(size_t) * fragments +
-		    sizeof(size_t));
-		if (!lengths)
-			return ENOMEM;
-		
-		lengths[0] = packet_get_data_length(packet);
-		lengths[fragments] = lengths[0];
-		next_packet = pq_next(packet);
-		
-		for (index = 1; index < fragments; ++index) {
-			lengths[index] = packet_get_data_length(next_packet);
-			lengths[fragments] += lengths[index];
-			next_packet = pq_next(packet);
-		}
-		
-		/* Write the fragment lengths */
-		rc = data_reply(lengths, sizeof(int) * (fragments + 1));
-		if (rc != EOK) {
-			free(lengths);
-			return rc;
-		}
-		next_packet = packet;
-		
-		/* Write the fragments */
-		for (index = 0; index < fragments; ++index) {
-			rc = data_reply(packet_get_data(next_packet),
-			    lengths[index]);
-			if (rc != EOK) {
-				free(lengths);
-				return rc;
-			}
-			next_packet = pq_next(next_packet);
-		}
-		
-		/* Store the total length */
-		*length = lengths[fragments];
-		free(lengths);
-	}
 	
 	return EOK;
Index: uspace/lib/net/tl/tl_common.c
===================================================================
--- uspace/lib/net/tl/tl_common.c	(revision 3d93289a3fb27c21c02091d32881655305a4ee9e)
+++ 	(revision )
@@ -1,333 +1,0 @@
-/*
- * Copyright (c) 2008 Lukas Mejdrech
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup libnet
- * @{
- */
-
-/** @file
- * Transport layer common functions implementation.
- * @see tl_common.h
- */
-
-#include <tl_common.h>
-#include <packet_client.h>
-#include <packet_remote.h>
-#include <icmp_remote.h>
-#include <ip_remote.h>
-#include <ip_interface.h>
-#include <tl_remote.h>
-#include <net/socket_codes.h>
-#include <net/in.h>
-#include <net/in6.h>
-#include <net/inet.h>
-#include <net/device.h>
-#include <net/packet.h>
-#include <async.h>
-#include <ipc/services.h>
-#include <errno.h>
-
-DEVICE_MAP_IMPLEMENT(packet_dimensions, packet_dimension_t);
-
-/** Gets the address port.
- *
- * Supports AF_INET and AF_INET6 address families.
- *
- * @param[in,out] addr	The address to be updated.
- * @param[in] addrlen	The address length.
- * @param[out] port	The set port.
- * @return		EOK on success.
- * @return		EINVAL if the address length does not match the address
- *			family.
- * @return		EAFNOSUPPORT if the address family is not supported.
- */
-int
-tl_get_address_port(const struct sockaddr *addr, int addrlen, uint16_t *port)
-{
-	const struct sockaddr_in *address_in;
-	const struct sockaddr_in6 *address_in6;
-
-	if ((addrlen <= 0) || ((size_t) addrlen < sizeof(struct sockaddr)))
-		return EINVAL;
-
-	switch (addr->sa_family) {
-	case AF_INET:
-		if (addrlen != sizeof(struct sockaddr_in))
-			return EINVAL;
-
-		address_in = (struct sockaddr_in *) addr;
-		*port = ntohs(address_in->sin_port);
-		break;
-	
-	case AF_INET6:
-		if (addrlen != sizeof(struct sockaddr_in6))
-			return EINVAL;
-
-		address_in6 = (struct sockaddr_in6 *) addr;
-		*port = ntohs(address_in6->sin6_port);
-		break;
-	
-	default:
-		return EAFNOSUPPORT;
-	}
-
-	return EOK;
-}
-
-/** Get IP packet dimensions.
- *
- * Try to search a cache and query the IP module if not found.
- * The reply is cached then.
- *
- * @param[in]  sess              IP module session.
- * @param[in]  packet_dimensions Packet dimensions cache.
- * @param[in]  device_id         Device identifier.
- * @param[out] packet_dimension  IP packet dimensions.
- *
- * @return EOK on success.
- * @return EBADMEM if the packet_dimension parameter is NULL.
- * @return ENOMEM if there is not enough memory left.
- * @return EINVAL if the packet_dimensions cache is not valid.
- * @return Other codes as defined for the ip_packet_size_req()
- *         function.
- *
- */
-int tl_get_ip_packet_dimension(async_sess_t *sess,
-    packet_dimensions_t *packet_dimensions, nic_device_id_t device_id,
-    packet_dimension_t **packet_dimension)
-{
-	if (!packet_dimension)
-		return EBADMEM;
-	
-	*packet_dimension = packet_dimensions_find(packet_dimensions,
-	    device_id);
-	if (!*packet_dimension) {
-		/* Ask for and remember them if not found */
-		*packet_dimension = malloc(sizeof(**packet_dimension));
-		if (!*packet_dimension)
-			return ENOMEM;
-		
-		int rc = ip_packet_size_req(sess, device_id, *packet_dimension);
-		if (rc != EOK) {
-			free(*packet_dimension);
-			return rc;
-		}
-		
-		rc = packet_dimensions_add(packet_dimensions, device_id,
-		    *packet_dimension);
-		if (rc < 0) {
-			free(*packet_dimension);
-			return rc;
-		}
-	}
-	
-	return EOK;
-}
-
-/** Updates IP device packet dimensions cache.
- *
- * @param[in,out] packet_dimensions The packet dimensions cache.
- * @param[in] device_id	The device identifier.
- * @param[in] content	The new maximum content size.
- * @return		EOK on success.
- * @return		ENOENT if the packet dimension is not cached.
- */
-int tl_update_ip_packet_dimension(packet_dimensions_t *packet_dimensions,
-    nic_device_id_t device_id, size_t content)
-{
-	packet_dimension_t *packet_dimension;
-
-	packet_dimension = packet_dimensions_find(packet_dimensions, device_id);
-	if (!packet_dimension)
-		return ENOENT;
-
-	packet_dimension->content = content;
-
-	if (device_id != NIC_DEVICE_INVALID_ID) {
-		packet_dimension = packet_dimensions_find(packet_dimensions,
-		    NIC_DEVICE_INVALID_ID);
-
-		if (packet_dimension) {
-			if (packet_dimension->content >= content)
-				packet_dimension->content = content;
-			else
-				packet_dimensions_exclude(packet_dimensions,
-				    NIC_DEVICE_INVALID_ID, free);
-		}
-	}
-
-	return EOK;
-}
-
-/** Sets the address port.
- *
- * Supports AF_INET and AF_INET6 address families.
- *
- * @param[in,out] addr	The address to be updated.
- * @param[in] addrlen	The address length.
- * @param[in] port	The port to be set.
- * @return		EOK on success.
- * @return		EINVAL if the address length does not match the address
- *			family.
- * @return		EAFNOSUPPORT if the address family is not supported.
- */
-int tl_set_address_port(struct sockaddr * addr, int addrlen, uint16_t port)
-{
-	struct sockaddr_in *address_in;
-	struct sockaddr_in6 *address_in6;
-	size_t length;
-
-	if (addrlen < 0)
-		return EINVAL;
-	
-	length = (size_t) addrlen;
-	if (length < sizeof(struct sockaddr))
-		return EINVAL;
-
-	switch (addr->sa_family) {
-	case AF_INET:
-		if (length != sizeof(struct sockaddr_in))
-			return EINVAL;
-		address_in = (struct sockaddr_in *) addr;
-		address_in->sin_port = htons(port);
-		return EOK;
-	
-	case AF_INET6:
-		if (length != sizeof(struct sockaddr_in6))
-				return EINVAL;
-		address_in6 = (struct sockaddr_in6 *) addr;
-		address_in6->sin6_port = htons(port);
-		return EOK;
-	
-	default:
-		return EAFNOSUPPORT;
-	}
-}
-
-/** Prepares the packet for ICMP error notification.
- *
- * Keep the first packet and release all the others.
- * Release all the packets on error.
- *
- * @param[in] packet_sess Packet server module session.
- * @param[in] icmp_sess   ICMP module phone.
- * @param[in] packet      Packet to be send.
- * @param[in] error       Packet error reporting service. Prefixes the
- *                        received packet.
- *
- * @return EOK on success.
- * @return ENOENT if no packet may be sent.
- *
- */
-int tl_prepare_icmp_packet(async_sess_t *packet_sess, async_sess_t *icmp_sess,
-    packet_t *packet, services_t error)
-{
-	/* Detach the first packet and release the others */
-	packet_t *next = pq_detach(packet);
-	if (next)
-		pq_release_remote(packet_sess, packet_get_id(next));
-	
-	uint8_t *src;
-	int length = packet_get_addr(packet, &src, NULL);
-	if ((length > 0) && (!error) && (icmp_sess) &&
-	    /*
-	     * Set both addresses to the source one (avoids the source address
-	     * deletion before setting the destination one)
-	     */
-	    (packet_set_addr(packet, src, src, (size_t) length) == EOK)) {
-		return EOK;
-	} else
-		pq_release_remote(packet_sess, packet_get_id(packet));
-	
-	return ENOENT;
-}
-
-/** Receives data from the socket into a packet.
- *
- * @param[in]  sess      Packet server module session.
- * @param[out] packet    New created packet.
- * @param[in]  prefix    Reserved packet data prefix length.
- * @param[in]  dimension Packet dimension.
- * @param[in]  addr      Destination address.
- * @param[in]  addrlen   Address length.
- *
- * @return Number of bytes received.
- * @return EINVAL if the client does not send data.
- * @return ENOMEM if there is not enough memory left.
- * @return Other error codes as defined for the
- *         async_data_read_finalize() function.
- *
- */
-int tl_socket_read_packet_data(async_sess_t *sess, packet_t **packet,
-    size_t prefix, const packet_dimension_t *dimension,
-    const struct sockaddr *addr, socklen_t addrlen)
-{
-	ipc_callid_t callid;
-	size_t length;
-	void *data;
-	int rc;
-
-	if (!dimension)
-		return EINVAL;
-
-	/* Get the data length */
-	if (!async_data_write_receive(&callid, &length))
-		return EINVAL;
-
-	/* Get a new packet */
-	*packet = packet_get_4_remote(sess, length, dimension->addr_len,
-	    prefix + dimension->prefix, dimension->suffix);
-	if (!packet)
-		return ENOMEM;
-
-	/* Allocate space in the packet */
-	data = packet_suffix(*packet, length);
-	if (!data) {
-		pq_release_remote(sess, packet_get_id(*packet));
-		return ENOMEM;
-	}
-
-	/* Read the data into the packet */
-	rc = async_data_write_finalize(callid, data, length);
-	if (rc != EOK) {
-		pq_release_remote(sess, packet_get_id(*packet));
-		return rc;
-	}
-	
-	/* Set the packet destination address */
-	rc = packet_set_addr(*packet, NULL, (uint8_t *) addr, addrlen);
-	if (rc != EOK) {
-		pq_release_remote(sess, packet_get_id(*packet));
-		return rc;
-	}
-
-	return (int) length;
-}
-
-/** @}
- */
Index: uspace/lib/net/tl/tl_remote.c
===================================================================
--- uspace/lib/net/tl/tl_remote.c	(revision 3d93289a3fb27c21c02091d32881655305a4ee9e)
+++ 	(revision )
@@ -1,66 +1,0 @@
-/*
- * Copyright (c) 2009 Lukas Mejdrech
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup libnet
- * @{
- */
-
-#include <tl_remote.h>
-#include <generic.h>
-#include <packet_client.h>
-#include <ipc/services.h>
-#include <ipc/tl.h>
-#include <net/device.h>
-#include <net/packet.h>
-#include <async.h>
-
-/** Notify the remote transport layer modules about the received packet/s.
- *
- * @param[in] sess      Transport layer module session.
- * @param[in] device_id Device identifier.
- * @param[in] packet    Received packet or the received packet queue.
- *                      The packet queue is used to carry a fragmented
- *                      datagram. The first packet contains the headers,
- *                      the others contain only data.
- * @param[in] target    Target transport layer module service to be
- *                      delivered to.
- * @param[in] error     Packet error reporting service. Prefixes the
- *                      received packet.
- *
- * @return EOK on success.
- *
- */
-int tl_received_msg(async_sess_t *sess, nic_device_id_t device_id, packet_t *packet,
-    services_t target, services_t error)
-{
-	return generic_received_msg_remote(sess, NET_TL_RECEIVED, device_id,
-	    packet_get_id(packet), target, error);
-}
-
-/** @}
- */
Index: uspace/lib/net/tl/tl_skel.c
===================================================================
--- uspace/lib/net/tl/tl_skel.c	(revision 3d93289a3fb27c21c02091d32881655305a4ee9e)
+++ 	(revision )
@@ -1,134 +1,0 @@
-/*
- * Copyright (c) 2011 Martin Decky
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup libnet
- * @{
- */
-
-/** @file
- * Transport layer module skeleton implementation.
- * @see tl_skel.h
- */
-
-#include <bool.h>
-#include <errno.h>
-#include <ns.h>
-#include <tl_skel.h>
-#include <net_interface.h>
-#include <net/modules.h>
-
-/** Default thread for new connections.
- *
- * @param[in] iid   The initial message identifier.
- * @param[in] icall The initial message call structure.
- * @param[in] arg   Local argument.
- *
- */
-static void tl_client_connection(ipc_callid_t iid, ipc_call_t *icall,
-    void *arg)
-{
-	/*
-	 * Accept the connection by answering
-	 * the initial IPC_M_CONNECT_ME_TO call.
-	 */
-	async_answer_0(iid, EOK);
-	
-	/* Per-connection initialization */
-	tl_connection();
-	
-	while (true) {
-		ipc_call_t answer;
-		size_t count;
-		
-		/* Clear the answer structure */
-		refresh_answer(&answer, &count);
-		
-		/* Fetch the next message */
-		ipc_call_t call;
-		ipc_callid_t callid = async_get_call(&call);
-		
-		/* Process the message */
-		int res = tl_message(callid, &call, &answer, &count);
-		
-		/*
-		 * End if told to either by the message or the processing
-		 * result.
-		 */
-		if ((!IPC_GET_IMETHOD(call)) || (res == EHANGUP))
-			return;
-		
-		/* Answer the message */
-		answer_call(callid, res, &answer, count);
-	}
-}
-
-/** Start the trasport layer module.
- *
- * Initialize the client connection serving function, initialize
- * the module, register the module service and start the async
- * manager, processing IPC messages in an infinite loop.
- *
- * @param[in] service Service identification.
- *
- * @return EOK on success.
- * @return Other error codes as defined for the pm_init() function.
- * @return Other error codes as defined for the il_initialize()
- *         function.
- * @return Other error codes as defined for the REGISTER_ME() macro
- *         function.
- *
- */
-int tl_module_start(sysarg_t service)
-{
-	async_set_client_connection(tl_client_connection);
-	async_sess_t *sess = net_connect_module();
-	if (!sess)
-		return ENOENT;
-	
-	int rc = pm_init();
-	if (rc != EOK)
-		return rc;
-	
-	rc = tl_initialize(sess);
-	if (rc != EOK)
-		goto out;
-	
-	rc = service_register(service);
-	if (rc != EOK)
-		goto out;
-	
-	task_retval(0);
-	async_manager();
-	
-out:
-	pm_destroy();
-	return rc;
-}
-
-/** @}
- */
