Index: uspace/lib/net/tl/icmp_client.c
===================================================================
--- uspace/lib/net/tl/icmp_client.c	(revision 9b6be516d442c9c4c3b156744fcab3a83a605c7b)
+++ 	(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 9b6be516d442c9c4c3b156744fcab3a83a605c7b)
+++ 	(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 9b6be516d442c9c4c3b156744fcab3a83a605c7b)
+++ uspace/lib/net/tl/socket_core.c	(revision ecff3d9a17c6c882ad241671cff1a314da4c4f16)
@@ -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 9b6be516d442c9c4c3b156744fcab3a83a605c7b)
+++ 	(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 9b6be516d442c9c4c3b156744fcab3a83a605c7b)
+++ 	(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 9b6be516d442c9c4c3b156744fcab3a83a605c7b)
+++ 	(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;
-}
-
-/** @}
- */
