Index: uspace/app/netstart/Makefile
===================================================================
--- uspace/app/netstart/Makefile	(revision 3da12d74b4d2797764c5757240230987b35a5b7f)
+++ uspace/app/netstart/Makefile	(revision 9fd39d673bc4186b3b529c4847750f207764ede4)
@@ -29,6 +29,6 @@
 
 USPACE_PREFIX = ../..
-LIBS = $(LIBNET_PREFIX)/libnet.a
-EXTRA_CFLAGS = -I$(LIBNET_PREFIX)/include
+LIBS = 
+EXTRA_CFLAGS = 
 
 BINARY = netstart
Index: pace/app/netstart/self_test.c
===================================================================
--- uspace/app/netstart/self_test.c	(revision 3da12d74b4d2797764c5757240230987b35a5b7f)
+++ 	(revision )
@@ -1,334 +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 net
- * @{
- */
-
-/** @file
- * Networking self-tests implementation.
- *
- */
-
-#include <errno.h>
-#include <malloc.h>
-#include <stdio.h>
-
-#include <net_checksum.h>
-#include <adt/int_map.h>
-#include <adt/char_map.h>
-#include <adt/generic_char_map.h>
-#include <adt/measured_strings.h>
-#include <adt/dynamic_fifo.h>
-
-#include "self_test.h"
-
-/** Test the statement, compare the result and evaluate.
- *
- * @param[in] statement The statement to test.
- * @param[in] result    The expected result.
- *
- */
-#define TEST(statement, result) \
-	do { \
-		printf("\n\t%s == %s", #statement, #result); \
-		if ((statement) != (result)) { \
-			printf("\tfailed\n"); \
-			fprintf(stderr, "\nNetwork self-test failed\n"); \
-			return EINVAL; \
-		} else \
-			printf("\tOK"); \
-	} while (0)
-
-#define XMALLOC(var, type) \
-	do { \
-		(var) = (type *) malloc(sizeof(type)); \
-		if ((var) == NULL) { \
-			fprintf(stderr, "\nMemory allocation error\n"); \
-			return ENOMEM; \
-		} \
-	} while (0)
-
-GENERIC_CHAR_MAP_DECLARE(int_char_map, int);
-GENERIC_CHAR_MAP_IMPLEMENT(int_char_map, int);
-
-GENERIC_FIELD_DECLARE(int_field, int);
-GENERIC_FIELD_IMPLEMENT(int_field, int);
-
-INT_MAP_DECLARE(int_map, int);
-INT_MAP_IMPLEMENT(int_map, int);
-
-/** Self-test start function.
- *
- * Run all self-tests.
- *
- * @returns EOK on success.
- * @returns The first error occurred.
- *
- */
-int self_test(void)
-{
-	printf("Running networking self-tests\n");
-	
-	printf("\nChar map test");
-	char_map_t cm;
-	
-	TEST(char_map_update(&cm, "ucho", 0, 3), EINVAL);
-	TEST(char_map_initialize(&cm), EOK);
-	TEST(char_map_exclude(&cm, "bla", 0), CHAR_MAP_NULL);
-	TEST(char_map_find(&cm, "bla", 0), CHAR_MAP_NULL);
-	TEST(char_map_add(&cm, "bla", 0, 1), EOK);
-	TEST(char_map_find(&cm, "bla", 0), 1);
-	TEST(char_map_add(&cm, "bla", 0, 10), EEXISTS);
-	TEST(char_map_update(&cm, "bla", 0, 2), EOK);
-	TEST(char_map_find(&cm, "bla", 0), 2);
-	TEST(char_map_update(&cm, "ucho", 0, 2), EOK);
-	TEST(char_map_exclude(&cm, "bla", 0), 2);
-	TEST(char_map_exclude(&cm, "bla", 0), CHAR_MAP_NULL);
-	TEST(char_map_find(&cm, "ucho", 0), 2);
-	TEST(char_map_update(&cm, "ucho", 0, 3), EOK);
-	TEST(char_map_find(&cm, "ucho", 0), 3);
-	TEST(char_map_add(&cm, "blabla", 0, 5), EOK);
-	TEST(char_map_find(&cm, "blabla", 0), 5);
-	TEST(char_map_add(&cm, "bla", 0, 6), EOK);
-	TEST(char_map_find(&cm, "bla", 0), 6);
-	TEST(char_map_exclude(&cm, "bla", 0), 6);
-	TEST(char_map_find(&cm, "bla", 0), CHAR_MAP_NULL);
-	TEST(char_map_find(&cm, "blabla", 0), 5);
-	TEST(char_map_add(&cm, "auto", 0, 7), EOK);
-	TEST(char_map_find(&cm, "auto", 0), 7);
-	TEST(char_map_add(&cm, "kara", 0, 8), EOK);
-	TEST(char_map_find(&cm, "kara", 0), 8);
-	TEST(char_map_add(&cm, "nic", 0, 9), EOK);
-	TEST(char_map_find(&cm, "nic", 0), 9);
-	TEST(char_map_find(&cm, "blabla", 0), 5);
-	TEST(char_map_add(&cm, "micnicnic", 5, 9), EOK);
-	TEST(char_map_find(&cm, "micni", 0), 9);
-	TEST(char_map_find(&cm, "micnicn", 5), 9);
-	TEST(char_map_add(&cm, "\x10\x0\x2\x2", 4, 15), EOK);
-	TEST(char_map_find(&cm, "\x10\x0\x2\x2", 4), 15);
-	
-	TEST((char_map_destroy(&cm), EOK), EOK);
-	TEST(char_map_update(&cm, "ucho", 0, 3), EINVAL);
-	
-	printf("\nCRC computation test");
-	uint32_t value;
-	
-	TEST(value = ~compute_crc32(~0, "123456789", 8 * 9), 0xcbf43926);
-	TEST(value = ~compute_crc32(~0, "1", 8), 0x83dcefb7);
-	TEST(value = ~compute_crc32(~0, "12", 8 * 2), 0x4f5344cd);
-	TEST(value = ~compute_crc32(~0, "123", 8 * 3), 0x884863d2);
-	TEST(value = ~compute_crc32(~0, "1234", 8 * 4), 0x9be3e0a3);
-	TEST(value = ~compute_crc32(~0, "12345678", 8 * 8), 0x9ae0daaf);
-	TEST(value = ~compute_crc32(~0, "ahoj pane", 8 * 9), 0x5fc3d706);
-	
-	printf("\nDynamic fifo test");
-	dyn_fifo_t fifo;
-	
-	TEST(dyn_fifo_push(&fifo, 1, 0), EINVAL);
-	TEST(dyn_fifo_initialize(&fifo, 1), EOK);
-	TEST(dyn_fifo_push(&fifo, 1, 0), EOK);
-	TEST(dyn_fifo_pop(&fifo), 1);
-	TEST(dyn_fifo_pop(&fifo), ENOENT);
-	TEST(dyn_fifo_push(&fifo, 2, 1), EOK);
-	TEST(dyn_fifo_push(&fifo, 3, 1), ENOMEM);
-	TEST(dyn_fifo_push(&fifo, 3, 0), EOK);
-	TEST(dyn_fifo_pop(&fifo), 2);
-	TEST(dyn_fifo_pop(&fifo), 3);
-	TEST(dyn_fifo_push(&fifo, 4, 2), EOK);
-	TEST(dyn_fifo_push(&fifo, 5, 2), EOK);
-	TEST(dyn_fifo_push(&fifo, 6, 2), ENOMEM);
-	TEST(dyn_fifo_push(&fifo, 6, 5), EOK);
-	TEST(dyn_fifo_push(&fifo, 7, 5), EOK);
-	TEST(dyn_fifo_pop(&fifo), 4);
-	TEST(dyn_fifo_pop(&fifo), 5);
-	TEST(dyn_fifo_push(&fifo, 8, 5), EOK);
-	TEST(dyn_fifo_push(&fifo, 9, 5), EOK);
-	TEST(dyn_fifo_push(&fifo, 10, 6), EOK);
-	TEST(dyn_fifo_push(&fifo, 11, 6), EOK);
-	TEST(dyn_fifo_pop(&fifo), 6);
-	TEST(dyn_fifo_pop(&fifo), 7);
-	TEST(dyn_fifo_push(&fifo, 12, 6), EOK);
-	TEST(dyn_fifo_push(&fifo, 13, 6), EOK);
-	TEST(dyn_fifo_push(&fifo, 14, 6), ENOMEM);
-	TEST(dyn_fifo_push(&fifo, 14, 8), EOK);
-	TEST(dyn_fifo_pop(&fifo), 8);
-	TEST(dyn_fifo_pop(&fifo), 9);
-	TEST(dyn_fifo_pop(&fifo), 10);
-	TEST(dyn_fifo_pop(&fifo), 11);
-	TEST(dyn_fifo_pop(&fifo), 12);
-	TEST(dyn_fifo_pop(&fifo), 13);
-	TEST(dyn_fifo_pop(&fifo), 14);
-	TEST(dyn_fifo_destroy(&fifo), EOK);
-	TEST(dyn_fifo_push(&fifo, 1, 0), EINVAL);
-	
-	printf("\nGeneric char map test");
-	
-	int *x;
-	int *y;
-	int *z;
-	int *u;
-	int *v;
-	int *w;
-	
-	XMALLOC(x, int);
-	XMALLOC(y, int);
-	XMALLOC(z, int);
-	XMALLOC(u, int);
-	XMALLOC(v, int);
-	XMALLOC(w, int);
-	
-	int_char_map_t icm;
-	icm.magic = 0;
-	
-	TEST(int_char_map_add(&icm, "ucho", 0, z), EINVAL);
-	TEST(int_char_map_initialize(&icm), EOK);
-	TEST((int_char_map_exclude(&icm, "bla", 0), EOK), EOK);
-	TEST(int_char_map_find(&icm, "bla", 0), NULL);
-	TEST(int_char_map_add(&icm, "bla", 0, x), EOK);
-	TEST(int_char_map_find(&icm, "bla", 0), x);
-	TEST(int_char_map_add(&icm, "bla", 0, y), EEXISTS);
-	TEST((int_char_map_exclude(&icm, "bla", 0), EOK), EOK);
-	TEST((int_char_map_exclude(&icm, "bla", 0), EOK), EOK);
-	TEST(int_char_map_add(&icm, "blabla", 0, v), EOK);
-	TEST(int_char_map_find(&icm, "blabla", 0), v);
-	TEST(int_char_map_add(&icm, "bla", 0, w), EOK);
-	TEST(int_char_map_find(&icm, "bla", 0), w);
-	TEST((int_char_map_exclude(&icm, "bla", 0), EOK), EOK);
-	TEST(int_char_map_find(&icm, "bla", 0), NULL);
-	TEST(int_char_map_find(&icm, "blabla", 0), v);
-	TEST(int_char_map_add(&icm, "auto", 0, u), EOK);
-	TEST(int_char_map_find(&icm, "auto", 0), u);
-	TEST((int_char_map_destroy(&icm), EOK), EOK);
-	TEST(int_char_map_add(&icm, "ucho", 0, z), EINVAL);
-	
-	printf("\nGeneric field test");
-	
-	XMALLOC(x, int);
-	XMALLOC(y, int);
-	XMALLOC(z, int);
-	XMALLOC(u, int);
-	XMALLOC(v, int);
-	XMALLOC(w, int);
-	
-	int_field_t gf;
-	gf.magic = 0;
-	
-	TEST(int_field_add(&gf, x), EINVAL);
-	TEST(int_field_count(&gf), -1);
-	TEST(int_field_initialize(&gf), EOK);
-	TEST(int_field_count(&gf), 0);
-	TEST(int_field_get_index(&gf, 1), NULL);
-	TEST(int_field_add(&gf, x), 0);
-	TEST(int_field_get_index(&gf, 0), x);
-	TEST((int_field_exclude_index(&gf, 0), EOK), EOK);
-	TEST(int_field_get_index(&gf, 0), NULL);
-	TEST(int_field_add(&gf, y), 1);
-	TEST(int_field_get_index(&gf, 1), y);
-	TEST(int_field_add(&gf, z), 2);
-	TEST(int_field_get_index(&gf, 2), z);
-	TEST(int_field_get_index(&gf, 1), y);
-	TEST(int_field_count(&gf), 3);
-	TEST(int_field_add(&gf, u), 3);
-	TEST(int_field_get_index(&gf, 3), u);
-	TEST(int_field_add(&gf, v), 4);
-	TEST(int_field_get_index(&gf, 4), v);
-	TEST(int_field_add(&gf, w), 5);
-	TEST(int_field_get_index(&gf, 5), w);
-	TEST(int_field_count(&gf), 6);
-	TEST((int_field_exclude_index(&gf, 1), EOK), EOK);
-	TEST(int_field_get_index(&gf, 1), NULL);
-	TEST(int_field_get_index(&gf, 3), u);
-	TEST((int_field_exclude_index(&gf, 7), EOK), EOK);
-	TEST(int_field_get_index(&gf, 3), u);
-	TEST(int_field_get_index(&gf, 5), w);
-	TEST((int_field_exclude_index(&gf, 4), EOK), EOK);
-	TEST(int_field_get_index(&gf, 4), NULL);
-	TEST((int_field_destroy(&gf), EOK), EOK);
-	TEST(int_field_count(&gf), -1);
-	
-	printf("\nInt map test");
-	
-	XMALLOC(x, int);
-	XMALLOC(y, int);
-	XMALLOC(z, int);
-	XMALLOC(u, int);
-	XMALLOC(v, int);
-	XMALLOC(w, int);
-	
-	int_map_t im;
-	im.magic = 0;
-	
-	TEST(int_map_add(&im, 1, x), EINVAL);
-	TEST(int_map_count(&im), -1);
-	TEST(int_map_initialize(&im), EOK);
-	TEST(int_map_count(&im), 0);
-	TEST(int_map_find(&im, 1), NULL);
-	TEST(int_map_add(&im, 1, x), 0);
-	TEST(int_map_find(&im, 1), x);
-	TEST((int_map_exclude(&im, 1), EOK), EOK);
-	TEST(int_map_find(&im, 1), NULL);
-	TEST(int_map_add(&im, 1, y), 1);
-	TEST(int_map_find(&im, 1), y);
-	TEST(int_map_add(&im, 4, z), 2);
-	TEST(int_map_get_index(&im, 2), z);
-	TEST(int_map_find(&im, 4), z);
-	TEST(int_map_find(&im, 1), y);
-	TEST(int_map_count(&im), 3);
-	TEST(int_map_add(&im, 2, u), 3);
-	TEST(int_map_find(&im, 2), u);
-	TEST(int_map_add(&im, 3, v), 4);
-	TEST(int_map_find(&im, 3), v);
-	TEST(int_map_get_index(&im, 4), v);
-	TEST(int_map_add(&im, 6, w), 5);
-	TEST(int_map_find(&im, 6), w);
-	TEST(int_map_count(&im), 6);
-	TEST((int_map_exclude(&im, 1), EOK), EOK);
-	TEST(int_map_find(&im, 1), NULL);
-	TEST(int_map_find(&im, 2), u);
-	TEST((int_map_exclude(&im, 7), EOK), EOK);
-	TEST(int_map_find(&im, 2), u);
-	TEST(int_map_find(&im, 6), w);
-	TEST((int_map_exclude_index(&im, 4), EOK), EOK);
-	TEST(int_map_get_index(&im, 4), NULL);
-	TEST(int_map_find(&im, 3), NULL);
-	TEST((int_map_destroy(&im), EOK), EOK);
-	TEST(int_map_count(&im), -1);
-	
-	printf("\nMeasured strings test");
-	
-	measured_string_ref string =
-	    measured_string_create_bulk("I am a measured string!", 0);
-	printf("\n%x, %s at %x of %d\n", string, string->value, string->value,
-	    string->length);
-	
-	return EOK;
-}
-
-/** @}
- */
Index: pace/app/netstart/self_test.h
===================================================================
--- uspace/app/netstart/self_test.h	(revision 3da12d74b4d2797764c5757240230987b35a5b7f)
+++ 	(revision )
@@ -1,41 +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 net
- * @{
- */
-
-#ifndef __SELF_TEST_H__
-#define __SELF_TEST_H__
-
-extern int self_test(void);
-
-#endif
-
-/** @}
- */
Index: pace/lib/packet/include/netdb.h
===================================================================
--- uspace/lib/packet/include/netdb.h	(revision 3da12d74b4d2797764c5757240230987b35a5b7f)
+++ 	(revision )
@@ -1,109 +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 netdb
- *  @{
- */
-
-/** @file
- *  Structures and interfaces according to the BSD netdb.h file.
- */
-
-#ifndef __NET_NETDB_H__
-#define __NET_NETDB_H__
-
-#include <sys/types.h>
-
-/** Structure returned by network data base library.
- *  All addresses are supplied in host order, and returned in network order (suitable for use in system calls).
- */
-struct	hostent {
-	/** Official host name.
-	 */
-	char * h_name;
-	/** Alias list.
-	 */
-	char **	h_aliases;
-	/** Host address type.
-	 */
-	int h_addrtype;
-	/** Address length.
-	 */
-	int h_length;
-	/** List of addresses from name server.
-	 */
-	char **	h_addr_list;
-	/** Address, for backward compatiblity.
-	 */
-#define	h_addr	h_addr_list[0]
-};
-
-/** @name Host entry address types definitions.
- */
-/*@{*/
-
-/** Authoritative Answer Host not found address type.
- */
-#define	HOST_NOT_FOUND	1
-
-/** Non-Authoritive Host not found, or SERVERFAIL address type.
- */
-#define	TRY_AGAIN	2
-
-/** Non recoverable errors, FORMERR, REFUSED, NOTIMP address type.
- */
-#define	NO_RECOVERY	3
-
-/** Valid name, no data record of requested type address type.
- */
-#define	NO_DATA		4
-
-/** No address, look for MX record address type.
- */
-#define	NO_ADDRESS	NO_DATA
-
-/*@}*/
-
-/** Returns host entry by the host address.
- *  @param[in] address The host address.
- *  @param[in] len The address length.
- *  @param[in] type The address type.
- *  @returns Host entry information.
- */
-//struct hostent *	gethostbyaddr(const void * address, int len, int type);
-
-/** Returns host entry by the host name.
- *  @param[in] name The host name.
- *  @returns Host entry information.
- */
-//struct hostent *	gethostbyname(const char * name);
-
-#endif
-
-/** @}
- */
Index: pace/lib/packet/include/tcp_codes.h
===================================================================
--- uspace/lib/packet/include/tcp_codes.h	(revision 3da12d74b4d2797764c5757240230987b35a5b7f)
+++ 	(revision )
@@ -1,88 +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 tcp
- *  @{
- */
-
-/** @file
- *  TCP options definitions.
- */
-
-#ifndef __NET_TCP_CODES_H__
-#define __NET_TCP_CODES_H__
-
-/** End of list TCP option.
- */
-#define TCPOPT_END_OF_LIST				0x0
-
-/** No operation TCP option.
- */
-#define TCPOPT_NO_OPERATION				0x1
-
-/** Maximum segment size TCP option.
- */
-#define TCPOPT_MAX_SEGMENT_SIZE			0x2
-
-/** Maximum segment size TCP option length.
- */
-#define TCPOPT_MAX_SEGMENT_SIZE_LENGTH	4
-
-/** Window scale TCP option.
- */
-#define TCPOPT_WINDOW_SCALE				0x3
-
-/** Window scale TCP option length.
- */
-#define TCPOPT_WINDOW_SCALE_LENGTH		3
-
-/** Selective acknowledgement permitted TCP option.
- */
-#define TCPOPT_SACK_PERMITTED			0x4
-
-/** Selective acknowledgement permitted TCP option length.
- */
-#define TCPOPT_SACK_PERMITTED_LENGTH	2
-
-/** Selective acknowledgement TCP option.
- *  Has variable length.
- */
-#define TCPOPT_SACK						0x5
-
-/** Timestamp TCP option.
- */
-#define TCPOPT_TIMESTAMP				0x8
-
-/** Timestamp TCP option length.
- */
-#define TCPOPT_TIMESTAMP_LENGTH			10
-
-#endif
-
-/** @}
- */
Index: uspace/srv/net/net/net.c
===================================================================
--- uspace/srv/net/net/net.c	(revision 3da12d74b4d2797764c5757240230987b35a5b7f)
+++ uspace/srv/net/net/net.c	(revision 9fd39d673bc4186b3b529c4847750f207764ede4)
@@ -42,5 +42,4 @@
 #include <ddi.h>
 #include <errno.h>
-#include <err.h>
 #include <malloc.h>
 #include <stdio.h>
@@ -92,5 +91,5 @@
     const char *value)
 {
-	ERROR_DECLARE;
+	int rc;
 	
 	measured_string_ref setting =
@@ -100,7 +99,8 @@
 	
 	/* Add the configuration setting */
-	if (ERROR_OCCURRED(measured_strings_add(configuration, name, 0, setting))) {
+	rc = measured_strings_add(configuration, name, 0, setting);
+	if (rc != EOK) {
 		free(setting);
-		return ERROR_CODE;
+		return rc;
 	}
 	
@@ -110,6 +110,5 @@
 /** Generate new system-unique device identifier.
  *
- * @returns The system-unique devic identifier.
- *
+ * @returns		The system-unique devic identifier.
  */
 static device_id_t generate_new_device_id(void)
@@ -120,5 +119,5 @@
 static int parse_line(measured_strings_ref configuration, char *line)
 {
-	ERROR_DECLARE;
+	int rc;
 	
 	/* From the beginning */
@@ -170,7 +169,8 @@
 	
 	/* Add the configuration setting */
-	if (ERROR_OCCURRED(measured_strings_add(configuration, name, 0, setting))) {
+	rc = measured_strings_add(configuration, name, 0, setting);
+	if (rc != EOK) {
 		free(setting);
-		return ERROR_CODE;
+		return rc;
 	}
 	
@@ -181,6 +181,4 @@
     measured_strings_ref configuration)
 {
-	ERROR_DECLARE;
-	
 	printf("%s: Reading configuration file %s/%s\n", NAME, directory, filename);
 	
@@ -206,21 +204,21 @@
 			if (index >= BUFFER_SIZE) {
 				line[BUFFER_SIZE - 1] = '\0';
-				fprintf(stderr, "%s: Configuration line %u too long: %s\n",
-				    NAME, line_number, line);
+				fprintf(stderr, "%s: Configuration line %u too "
+				    "long: %s\n", NAME, line_number, line);
 				
 				/* No space left in the line buffer */
 				return EOVERFLOW;
-			} else {
-				/* Append the character */
-				line[index] = (char) read;
-				index++;
 			}
+			/* Append the character */
+			line[index] = (char) read;
+			index++;
 		} else {
 			/* On error or new line */
 			line[index] = '\0';
 			line_number++;
-			if (ERROR_OCCURRED(parse_line(configuration, line)))
-				fprintf(stderr, "%s: Configuration error on line %u: %s\n",
-				    NAME, line_number, line);
+			if (parse_line(configuration, line) != EOK) {
+				fprintf(stderr, "%s: Configuration error on "
+				    "line %u: %s\n", NAME, line_number, line);
+			}
 			
 			index = 0;
@@ -270,5 +268,5 @@
 static int net_initialize(async_client_conn_t client_connection)
 {
-	ERROR_DECLARE;
+	int rc;
 	
 	netifs_initialize(&net_globals.netifs);
@@ -278,16 +276,24 @@
 	
 	// TODO: dynamic configuration
-	ERROR_PROPAGATE(read_configuration());
-	
-	ERROR_PROPAGATE(add_module(NULL, &net_globals.modules,
-	    LO_NAME, LO_FILENAME, SERVICE_LO, 0, connect_to_service));
-	ERROR_PROPAGATE(add_module(NULL, &net_globals.modules,
-	    DP8390_NAME, DP8390_FILENAME, SERVICE_DP8390, 0, connect_to_service));
-	ERROR_PROPAGATE(add_module(NULL, &net_globals.modules,
-	    ETHERNET_NAME, ETHERNET_FILENAME, SERVICE_ETHERNET, 0,
-	    connect_to_service));
-	ERROR_PROPAGATE(add_module(NULL, &net_globals.modules,
-	    NILDUMMY_NAME, NILDUMMY_FILENAME, SERVICE_NILDUMMY, 0,
-	    connect_to_service));
+	rc = read_configuration();
+	if (rc != EOK)
+		return rc;
+	
+	rc = add_module(NULL, &net_globals.modules, LO_NAME, LO_FILENAME,
+	    SERVICE_LO, 0, connect_to_service);
+	if (rc != EOK)
+		return rc;
+	rc = add_module(NULL, &net_globals.modules, DP8390_NAME,
+	    DP8390_FILENAME, SERVICE_DP8390, 0, connect_to_service);
+	if (rc != EOK)
+		return rc;
+	rc = add_module(NULL, &net_globals.modules, ETHERNET_NAME,
+	    ETHERNET_FILENAME, SERVICE_ETHERNET, 0, connect_to_service);
+	if (rc != EOK)
+		return rc;
+	rc = add_module(NULL, &net_globals.modules, NILDUMMY_NAME,
+	    NILDUMMY_FILENAME, SERVICE_NILDUMMY, 0, connect_to_service);
+	if (rc != EOK)
+		return rc;
 	
 	/* Build specific initialization */
@@ -314,21 +320,26 @@
 static int net_module_start(async_client_conn_t client_connection)
 {
-	ERROR_DECLARE;
+	ipcarg_t phonehash;
+	int rc;
 	
 	async_set_client_connection(client_connection);
-	ERROR_PROPAGATE(pm_init());
-	
-	ipcarg_t phonehash;
-	
-	if (ERROR_OCCURRED(net_initialize(client_connection)) ||
-	    ERROR_OCCURRED(REGISTER_ME(SERVICE_NETWORKING, &phonehash))) {
-		pm_destroy();
-		return ERROR_CODE;
-	}
+	rc = pm_init();
+	if (rc != EOK)
+		return rc;
+	
+	
+	rc = net_initialize(client_connection);
+	if (rc != EOK)
+		goto out;
+	
+	rc = REGISTER_ME(SERVICE_NETWORKING, &phonehash);
+	if (rc != EOK)
+		goto out;
 	
 	async_manager();
-	
+
+out:
 	pm_destroy();
-	return EOK;
+	return rc;
 }
 
@@ -415,5 +426,5 @@
 static int start_device(netif_t *netif)
 {
-	ERROR_DECLARE;
+	int rc;
 	
 	/* Mandatory netif */
@@ -456,5 +467,7 @@
 	int io = setting ? strtol(setting->value, NULL, 16) : 0;
 	
-	ERROR_PROPAGATE(netif_probe_req_remote(netif->driver->phone, netif->id, irq, io));
+	rc = netif_probe_req_remote(netif->driver->phone, netif->id, irq, io);
+	if (rc != EOK)
+		return rc;
 	
 	/* Network interface layer startup */
@@ -468,6 +481,8 @@
 		int mtu = setting ? strtol(setting->value, NULL, 10) : 0;
 		
-		ERROR_PROPAGATE(nil_device_req(netif->nil->phone, netif->id, mtu,
-		    netif->driver->service));
+		rc = nil_device_req(netif->nil->phone, netif->id, mtu,
+		    netif->driver->service);
+		if (rc != EOK)
+			return rc;
 		
 		internet_service = netif->nil->service;
@@ -478,6 +493,8 @@
 	switch (netif->il->service) {
 	case SERVICE_IP:
-		ERROR_PROPAGATE(ip_device_req(netif->il->phone, netif->id,
-		    internet_service));
+		rc = ip_device_req(netif->il->phone, netif->id,
+		    internet_service);
+		if (rc != EOK)
+			return rc;
 		break;
 	default:
@@ -485,6 +502,5 @@
 	}
 	
-	ERROR_PROPAGATE(netif_start_req_remote(netif->driver->phone, netif->id));
-	return EOK;
+	return netif_start_req_remote(netif->driver->phone, netif->id);
 }
 
@@ -504,6 +520,4 @@
 static int startup(void)
 {
-	ERROR_DECLARE;
-	
 	const char *conf_files[] = {
 		"lo",
@@ -511,4 +525,5 @@
 	};
 	size_t count = sizeof(conf_files) / sizeof(char *);
+	int rc;
 	
 	size_t i;
@@ -522,11 +537,14 @@
 			return EXDEV;
 		
-		ERROR_PROPAGATE(measured_strings_initialize(&netif->configuration));
+		rc = measured_strings_initialize(&netif->configuration);
+		if (rc != EOK)
+			return rc;
 		
 		/* Read configuration files */
-		if (ERROR_OCCURRED(read_netif_configuration(conf_files[i], netif))) {
+		rc = read_netif_configuration(conf_files[i], netif);
+		if (rc != EOK) {
 			measured_strings_destroy(&netif->configuration);
 			free(netif);
-			return ERROR_CODE;
+			return rc;
 		}
 		
@@ -554,9 +572,17 @@
 		 * and needed modules.
 		 */
-		if ((ERROR_OCCURRED(char_map_add(&net_globals.netif_names,
-		    netif->name, 0, index))) || (ERROR_OCCURRED(start_device(netif)))) {
+		rc = char_map_add(&net_globals.netif_names, netif->name, 0,
+		    index);
+		if (rc != EOK) {
 			measured_strings_destroy(&netif->configuration);
 			netifs_exclude_index(&net_globals.netifs, index);
-			return ERROR_CODE;
+			return rc;
+		}
+		
+		rc = start_device(netif);
+		if (rc != EOK) {
+			measured_strings_destroy(&netif->configuration);
+			netifs_exclude_index(&net_globals.netifs, index);
+			return rc;
 		}
 		
@@ -594,8 +620,7 @@
     int *answer_count)
 {
-	ERROR_DECLARE;
-	
 	measured_string_ref strings;
 	char *data;
+	int rc;
 	
 	*answer_count = 0;
@@ -604,6 +629,8 @@
 		return EOK;
 	case NET_NET_GET_DEVICE_CONF:
-		ERROR_PROPAGATE(measured_strings_receive(&strings, &data,
-		    IPC_GET_COUNT(call)));
+		rc = measured_strings_receive(&strings, &data,
+		    IPC_GET_COUNT(call));
+		if (rc != EOK)
+			return rc;
 		net_get_device_conf_req(0, IPC_GET_DEVICE(call), &strings,
 		    IPC_GET_COUNT(call), NULL);
@@ -612,10 +639,12 @@
 		free(data);
 		
-		ERROR_CODE = measured_strings_reply(strings, IPC_GET_COUNT(call));
+		rc = measured_strings_reply(strings, IPC_GET_COUNT(call));
 		free(strings);
-		return ERROR_CODE;
+		return rc;
 	case NET_NET_GET_CONF:
-		ERROR_PROPAGATE(measured_strings_receive(&strings, &data,
-		    IPC_GET_COUNT(call)));
+		rc = measured_strings_receive(&strings, &data,
+		    IPC_GET_COUNT(call));
+		if (rc != EOK)
+			return rc;
 		net_get_conf_req(0, &strings, IPC_GET_COUNT(call), NULL);
 		
@@ -623,10 +652,11 @@
 		free(data);
 		
-		ERROR_CODE = measured_strings_reply(strings, IPC_GET_COUNT(call));
+		rc = measured_strings_reply(strings, IPC_GET_COUNT(call));
 		free(strings);
-		return ERROR_CODE;
+		return rc;
 	case NET_NET_STARTUP:
 		return startup();
 	}
+	
 	return ENOTSUP;
 }
@@ -670,9 +700,10 @@
 int main(int argc, char *argv[])
 {
-	ERROR_DECLARE;
-	
-	if (ERROR_OCCURRED(net_module_start(net_client_connection))) {
-		fprintf(stderr, "%s: net_module_start error %i\n", NAME, ERROR_CODE);
-		return ERROR_CODE;
+	int rc;
+	
+	rc = net_module_start(net_client_connection);
+	if (rc != EOK) {
+		fprintf(stderr, "%s: net_module_start error %i\n", NAME, rc);
+		return rc;
 	}
 	
Index: uspace/srv/net/net/net_standalone.c
===================================================================
--- uspace/srv/net/net/net_standalone.c	(revision 3da12d74b4d2797764c5757240230987b35a5b7f)
+++ uspace/srv/net/net/net_standalone.c	(revision 9fd39d673bc4186b3b529c4847750f207764ede4)
@@ -42,4 +42,5 @@
 #include <ipc/ipc.h>
 #include <ipc/net.h>
+#include <errno.h>
 
 #include <ip_interface.h>
@@ -60,5 +61,5 @@
 int net_initialize_build(async_client_conn_t client_connection)
 {
-	ERROR_DECLARE;
+	int rc;
 	
 	task_id_t task_id = spawn("/srv/ip");
@@ -66,6 +67,8 @@
 		return EINVAL;
 	
-	ERROR_PROPAGATE(add_module(NULL, &net_globals.modules, IP_NAME,
-	    IP_FILENAME, SERVICE_IP, task_id, ip_connect_module));
+	rc = add_module(NULL, &net_globals.modules, IP_NAME,
+	    IP_FILENAME, SERVICE_IP, task_id, ip_connect_module);
+	if (rc != EOK)
+		return rc;
 	
 	if (!spawn("/srv/icmp"))
