Index: uspace/app/netecho/netecho.c
===================================================================
--- uspace/app/netecho/netecho.c	(revision ef4b1126207083ec6bb1e9d3284ac63cca74f32c)
+++ uspace/app/netecho/netecho.c	(revision a8e5051a633bec02a8deec21772f6cadc0da9f98)
@@ -28,10 +28,10 @@
 
 /** @addtogroup netecho
- *  @{
+ * @{
  */
 
 /** @file
- *  Network echo application.
- *  Answers received packets.
+ * Network echo application.
+ * Answers received packets.
  */
 
@@ -51,21 +51,9 @@
 #include "print_error.h"
 
-/** Network echo module name.
- */
+/** Network echo module name. */
 #define NAME	"Network Echo"
 
-/** Prints the application help.
- */
-void echo_print_help(void);
-
-/** Module entry point.
- *  Reads command line parameters and starts listenning.
- *  @param[in] argc The number of command line parameters.
- *  @param[in] argv The command line parameters.
- *  @returns EOK on success.
- */
-int main(int argc, char * argv[]);
-
-void echo_print_help(void){
+static void echo_print_help(void)
+{
 	printf(
 		"Network Echo aplication\n" \
@@ -101,27 +89,28 @@
 }
 
-int main(int argc, char * argv[]){
+int main(int argc, char *argv[])
+{
 	ERROR_DECLARE;
 
-	size_t size			= 1024;
-	int verbose			= 0;
-	char * reply		= NULL;
-	sock_type_t type	= SOCK_DGRAM;
-	int count			= -1;
-	int family			= PF_INET;
-	uint16_t port		= 7;
-	int backlog			= 3;
-
-	socklen_t max_length				= sizeof(struct sockaddr_in6);
+	size_t size = 1024;
+	int verbose = 0;
+	char *reply = NULL;
+	sock_type_t type = SOCK_DGRAM;
+	int count = -1;
+	int family = PF_INET;
+	uint16_t port = 7;
+	int backlog = 3;
+
+	socklen_t max_length = sizeof(struct sockaddr_in6);
 	uint8_t address_data[max_length];
-	struct sockaddr * address			= (struct sockaddr *) address_data;
-	struct sockaddr_in * address_in		= (struct sockaddr_in *) address;
-	struct sockaddr_in6 * address_in6	= (struct sockaddr_in6 *) address;
+	struct sockaddr *address = (struct sockaddr *) address_data;
+	struct sockaddr_in *address_in = (struct sockaddr_in *) address;
+	struct sockaddr_in6 *address_in6 = (struct sockaddr_in6 *) address;
 	socklen_t addrlen;
 	char address_string[INET6_ADDRSTRLEN];
-	uint8_t * address_start;
+	uint8_t *address_start;
 	int socket_id;
 	int listening_id;
-	char * data;
+	char *data;
 	size_t length;
 	int index;
@@ -130,72 +119,72 @@
 
 	// parse the command line arguments
-	for(index = 1; index < argc; ++ index){
-		if(argv[index][0] == '-'){
-			switch(argv[index][1]){
-				case 'b':
-					ERROR_PROPAGATE(arg_parse_int(argc, argv, &index, &backlog, 0));
-					break;
-				case 'c':
-					ERROR_PROPAGATE(arg_parse_int(argc, argv, &index, &count, 0));
-					break;
-				case 'f':
-					ERROR_PROPAGATE(arg_parse_name_int(argc, argv, &index, &family, 0, socket_parse_protocol_family));
-					break;
-				case 'h':
+	for (index = 1; index < argc; ++ index) {
+		if (argv[index][0] == '-') {
+			switch (argv[index][1]) {
+			case 'b':
+				ERROR_PROPAGATE(arg_parse_int(argc, argv, &index, &backlog, 0));
+				break;
+			case 'c':
+				ERROR_PROPAGATE(arg_parse_int(argc, argv, &index, &count, 0));
+				break;
+			case 'f':
+				ERROR_PROPAGATE(arg_parse_name_int(argc, argv, &index, &family, 0, socket_parse_protocol_family));
+				break;
+			case 'h':
+				echo_print_help();
+				return EOK;
+				break;
+			case 'p':
+				ERROR_PROPAGATE(arg_parse_int(argc, argv, &index, &value, 0));
+				port = (uint16_t) value;
+				break;
+			case 'r':
+				ERROR_PROPAGATE(arg_parse_string(argc, argv, &index, &reply, 0));
+				break;
+			case 's':
+				ERROR_PROPAGATE(arg_parse_int(argc, argv, &index, &value, 0));
+				size = (value >= 0) ? (size_t) value : 0;
+				break;
+			case 't':
+				ERROR_PROPAGATE(arg_parse_name_int(argc, argv, &index, &value, 0, socket_parse_socket_type));
+				type = (sock_type_t) value;
+				break;
+			case 'v':
+				verbose = 1;
+				break;
+			// long options with the double minus sign ('-')
+			case '-':
+				if (str_lcmp(argv[index] + 2, "backlog=", 6) == 0) {
+					ERROR_PROPAGATE(arg_parse_int(argc, argv, &index, &backlog, 8));
+				} else if (str_lcmp(argv[index] + 2, "count=", 6) == 0) {
+					ERROR_PROPAGATE(arg_parse_int(argc, argv, &index, &count, 8));
+				} else if (str_lcmp(argv[index] + 2, "family=", 7) == 0) {
+						ERROR_PROPAGATE(arg_parse_name_int(argc, argv, &index, &family, 9, socket_parse_protocol_family));
+				} else if (str_lcmp(argv[index] + 2, "help", 5) == 0) {
 					echo_print_help();
 					return EOK;
-					break;
-				case 'p':
-					ERROR_PROPAGATE(arg_parse_int(argc, argv, &index, &value, 0));
+				} else if (str_lcmp(argv[index] + 2, "port=", 5) == 0) {
+					ERROR_PROPAGATE(arg_parse_int(argc, argv, &index, &value, 7));
 					port = (uint16_t) value;
-					break;
-				case 'r':
-					ERROR_PROPAGATE(arg_parse_string(argc, argv, &index, &reply, 0));
-					break;
-				case 's':
-					ERROR_PROPAGATE(arg_parse_int(argc, argv, &index, &value, 0));
+				} else if (str_lcmp(argv[index] + 2, "reply=", 6) == 0) {
+					ERROR_PROPAGATE(arg_parse_string(argc, argv, &index, &reply, 8));
+				} else if (str_lcmp(argv[index] + 2, "size=", 5) == 0) {
+					ERROR_PROPAGATE(arg_parse_int(argc, argv, &index, &value, 7));
 					size = (value >= 0) ? (size_t) value : 0;
-					break;
-				case 't':
-					ERROR_PROPAGATE(arg_parse_name_int(argc, argv, &index, &value, 0, socket_parse_socket_type));
+				} else if (str_lcmp(argv[index] + 2, "type=", 5) == 0) {
+					ERROR_PROPAGATE(arg_parse_name_int(argc, argv, &index, &value, 7, socket_parse_socket_type));
 					type = (sock_type_t) value;
-					break;
-				case 'v':
+				} else if (str_lcmp(argv[index] + 2, "verbose", 8) == 0) {
 					verbose = 1;
-					break;
-				// long options with the double minus sign ('-')
-				case '-':
-					if(str_lcmp(argv[index] + 2, "backlog=", 6) == 0){
-						ERROR_PROPAGATE(arg_parse_int(argc, argv, &index, &backlog, 8));
-					}else if(str_lcmp(argv[index] + 2, "count=", 6) == 0){
-						ERROR_PROPAGATE(arg_parse_int(argc, argv, &index, &count, 8));
-					}else if(str_lcmp(argv[index] + 2, "family=", 7) == 0){
-						ERROR_PROPAGATE(arg_parse_name_int(argc, argv, &index, &family, 9, socket_parse_protocol_family));
-					}else if(str_lcmp(argv[index] + 2, "help", 5) == 0){
-						echo_print_help();
-						return EOK;
-					}else if(str_lcmp(argv[index] + 2, "port=", 5) == 0){
-						ERROR_PROPAGATE(arg_parse_int(argc, argv, &index, &value, 7));
-						port = (uint16_t) value;
-					}else if(str_lcmp(argv[index] + 2, "reply=", 6) == 0){
-						ERROR_PROPAGATE(arg_parse_string(argc, argv, &index, &reply, 8));
-					}else if(str_lcmp(argv[index] + 2, "size=", 5) == 0){
-						ERROR_PROPAGATE(arg_parse_int(argc, argv, &index, &value, 7));
-						size = (value >= 0) ? (size_t) value : 0;
-					}else if(str_lcmp(argv[index] + 2, "type=", 5) == 0){
-						ERROR_PROPAGATE(arg_parse_name_int(argc, argv, &index, &value, 7, socket_parse_socket_type));
-						type = (sock_type_t) value;
-					}else if(str_lcmp(argv[index] + 2, "verbose", 8) == 0){
-						verbose = 1;
-					}else{
-						echo_print_help();
-						return EINVAL;
-					}
-					break;
-				default:
+				} else {
 					echo_print_help();
 					return EINVAL;
+				}
+				break;
+			default:
+				echo_print_help();
+				return EINVAL;
 			}
-		}else{
+		} else {
 			echo_print_help();
 			return EINVAL;
@@ -204,5 +193,5 @@
 
 	// check the buffer size
-	if(size <= 0){
+	if (size <= 0) {
 		fprintf(stderr, "Receive size too small (%d). Using 1024 bytes instead.\n", size);
 		size = 1024;
@@ -210,5 +199,5 @@
 	// size plus the terminating null (\0)
 	data = (char *) malloc(size + 1);
-	if(! data){
+	if (!data) {
 		fprintf(stderr, "Failed to allocate receive buffer.\n");
 		return ENOMEM;
@@ -220,23 +209,23 @@
 	// prepare the address buffer
 	bzero(address_data, max_length);
-	switch(family){
-		case PF_INET:
-			address_in->sin_family = AF_INET;
-			address_in->sin_port = htons(port);
-			addrlen = sizeof(struct sockaddr_in);
-			break;
-		case PF_INET6:
-			address_in6->sin6_family = AF_INET6;
-			address_in6->sin6_port = htons(port);
-			addrlen = sizeof(struct sockaddr_in6);
-			break;
-		default:
-			fprintf(stderr, "Protocol family is not supported\n");
-			return EAFNOSUPPORT;
+	switch (family) {
+	case PF_INET:
+		address_in->sin_family = AF_INET;
+		address_in->sin_port = htons(port);
+		addrlen = sizeof(struct sockaddr_in);
+		break;
+	case PF_INET6:
+		address_in6->sin6_family = AF_INET6;
+		address_in6->sin6_port = htons(port);
+		addrlen = sizeof(struct sockaddr_in6);
+		break;
+	default:
+		fprintf(stderr, "Protocol family is not supported\n");
+		return EAFNOSUPPORT;
 	}
 
 	// get a listening socket
 	listening_id = socket(family, type, 0);
-	if(listening_id < 0){
+	if (listening_id < 0) {
 		socket_print_error(stderr, listening_id, "Socket create: ", "\n");
 		return listening_id;
@@ -244,12 +233,12 @@
 
 	// if the stream socket is used
-	if(type == SOCK_STREAM){
+	if (type == SOCK_STREAM) {
 		// check the backlog
-		if(backlog <= 0){
+		if (backlog <= 0) {
 			fprintf(stderr, "Accepted sockets queue size too small (%d). Using 3 instead.\n", size);
 			backlog = 3;
 		}
 		// set the backlog
-		if(ERROR_OCCURRED(listen(listening_id, backlog))){
+		if (ERROR_OCCURRED(listen(listening_id, backlog))) {
 			socket_print_error(stderr, ERROR_CODE, "Socket listen: ", "\n");
 			return ERROR_CODE;
@@ -258,12 +247,11 @@
 
 	// bind the listenning socket
-	if(ERROR_OCCURRED(bind(listening_id, address, addrlen))){
+	if (ERROR_OCCURRED(bind(listening_id, address, addrlen))) {
 		socket_print_error(stderr, ERROR_CODE, "Socket bind: ", "\n");
 		return ERROR_CODE;
 	}
 
-	if(verbose){
+	if (verbose)
 		printf("Socket %d listenning at %d\n", listening_id, port);
-	}
 
 	socket_id = listening_id;
@@ -271,50 +259,49 @@
 	// do count times
 	// or indefinitely if set to a negative value
-	while(count){
+	while (count) {
 
 		addrlen = max_length;
-		if(type == SOCK_STREAM){
+		if (type == SOCK_STREAM) {
 			// acceept a socket if the stream socket is used
 			socket_id = accept(listening_id, address, &addrlen);
-			if(socket_id <= 0){
+			if (socket_id <= 0) {
 				socket_print_error(stderr, socket_id, "Socket accept: ", "\n");
-			}else{
-				if(verbose){
+			} else {
+				if (verbose)
 					printf("Socket %d accepted\n", socket_id);
-				}
 			}
 		}
 
 		// if the datagram socket is used or the stream socked was accepted
-		if(socket_id > 0){
+		if (socket_id > 0) {
 
 			// receive an echo request
 			value = recvfrom(socket_id, data, size, 0, address, &addrlen);
-			if(value < 0){
+			if (value < 0) {
 				socket_print_error(stderr, value, "Socket receive: ", "\n");
-			}else{
+			} else {
 				length = (size_t) value;
-				if(verbose){
+				if (verbose) {
 					// print the header
 
 					// get the source port and prepare the address buffer
 					address_start = NULL;
-					switch(address->sa_family){
-						case AF_INET:
-							port = ntohs(address_in->sin_port);
-							address_start = (uint8_t *) &address_in->sin_addr.s_addr;
-							break;
-						case AF_INET6:
-							port = ntohs(address_in6->sin6_port);
-							address_start = (uint8_t *) &address_in6->sin6_addr.s6_addr;
-							break;
-						default:
-							fprintf(stderr, "Address family %d (0x%X) is not supported.\n", address->sa_family);
+					switch (address->sa_family) {
+					case AF_INET:
+						port = ntohs(address_in->sin_port);
+						address_start = (uint8_t *) &address_in->sin_addr.s_addr;
+						break;
+					case AF_INET6:
+						port = ntohs(address_in6->sin6_port);
+						address_start = (uint8_t *) &address_in6->sin6_addr.s6_addr;
+						break;
+					default:
+						fprintf(stderr, "Address family %d (0x%X) is not supported.\n", address->sa_family);
 					}
 					// parse the source address
-					if(address_start){
-						if(ERROR_OCCURRED(inet_ntop(address->sa_family, address_start, address_string, sizeof(address_string)))){
+					if (address_start) {
+						if (ERROR_OCCURRED(inet_ntop(address->sa_family, address_start, address_string, sizeof(address_string)))) {
 							fprintf(stderr, "Received address error %d\n", ERROR_CODE);
-						}else{
+						} else {
 							data[length] = '\0';
 							printf("Socket %d received %d bytes from %s:%d\n%s\n", socket_id, length, address_string, port, data);
@@ -324,15 +311,12 @@
 
 				// answer the request either with the static reply or the original data
-				if(ERROR_OCCURRED(sendto(socket_id, reply ? reply : data, reply ? reply_length : length, 0, address, addrlen))){
+				if (ERROR_OCCURRED(sendto(socket_id, reply ? reply : data, reply ? reply_length : length, 0, address, addrlen)))
 					socket_print_error(stderr, ERROR_CODE, "Socket send: ", "\n");
-				}
-
 			}
 
 			// close the accepted stream socket
-			if(type == SOCK_STREAM){
-				if(ERROR_OCCURRED(closesocket(socket_id))){
+			if (type == SOCK_STREAM) {
+				if (ERROR_OCCURRED(closesocket(socket_id)))
 					socket_print_error(stderr, ERROR_CODE, "Close socket: ", "\n");
-				}
 			}
 
@@ -340,25 +324,22 @@
 
 		// decrease the count if positive
-		if(count > 0){
-			-- count;
-			if(verbose){
+		if (count > 0) {
+			count--;
+			if (verbose)
 				printf("Waiting for next %d packet(s)\n", count);
-			}
-		}
-	}
-
-	if(verbose){
+		}
+	}
+
+	if (verbose)
 		printf("Closing the socket\n");
-	}
 
 	// close the listenning socket
-	if(ERROR_OCCURRED(closesocket(listening_id))){
+	if (ERROR_OCCURRED(closesocket(listening_id))) {
 		socket_print_error(stderr, ERROR_CODE, "Close socket: ", "\n");
 		return ERROR_CODE;
 	}
 
-	if(verbose){
+	if (verbose)
 		printf("Exiting\n");
-	}
 
 	return EOK;
Index: uspace/app/netecho/print_error.c
===================================================================
--- uspace/app/netecho/print_error.c	(revision ef4b1126207083ec6bb1e9d3284ac63cca74f32c)
+++ uspace/app/netecho/print_error.c	(revision a8e5051a633bec02a8deec21772f6cadc0da9f98)
@@ -28,10 +28,12 @@
 
 /** @addtogroup net_app
- *  @{
+ * @{
  */
 
 /** @file
- *  Generic application error printing functions implementation.
+ * Generic application error printing functions implementation.
  */
+
+#include "print_error.h"
 
 #include <stdio.h>
@@ -40,111 +42,137 @@
 #include <net/icmp_codes.h>
 
-#include "print_error.h"
+/** Prints the specific ICMP error description.
+ *
+ * @param[in] output The description output stream. May be NULL.
+ * @param[in] error_code The ICMP error code.
+ * @param[in] prefix The error description prefix. May be NULL.
+ * @param[in] suffix The error description suffix. May be NULL.
+ */
+void icmp_print_error(FILE *output, int error_code, const char *prefix, const char *suffix)
+{
+	if (!output)
+		return;
+	
+	if (prefix)
+		fprintf(output, "%s", prefix);
+		
+	switch (error_code) {
+	case ICMP_DEST_UNREACH:
+		fprintf(output, "ICMP Destination Unreachable (%d) error", error_code);
+		break;
+	case ICMP_SOURCE_QUENCH:
+		fprintf(output, "ICMP Source Quench (%d) error", error_code);
+		break;
+	case ICMP_REDIRECT:
+		fprintf(output, "ICMP Redirect (%d) error", error_code);
+		break;
+	case ICMP_ALTERNATE_ADDR:
+		fprintf(output, "ICMP Alternate Host Address (%d) error", error_code);
+		break;
+	case ICMP_ROUTER_ADV:
+		fprintf(output, "ICMP Router Advertisement (%d) error", error_code);
+		break;
+	case ICMP_ROUTER_SOL:
+		fprintf(output, "ICMP Router Solicitation (%d) error", error_code);
+		break;
+	case ICMP_TIME_EXCEEDED:
+		fprintf(output, "ICMP Time Exceeded (%d) error", error_code);
+		break;
+	case ICMP_PARAMETERPROB:
+		fprintf(output, "ICMP Paramenter Problem (%d) error", error_code);
+		break;
+	case ICMP_CONVERSION_ERROR:
+		fprintf(output, "ICMP Datagram Conversion Error (%d) error", error_code);
+		break;
+	case ICMP_REDIRECT_MOBILE:
+		fprintf(output, "ICMP Mobile Host Redirect (%d) error", error_code);
+		break;
+	case ICMP_SKIP:
+		fprintf(output, "ICMP SKIP (%d) error", error_code);
+		break;
+	case ICMP_PHOTURIS:
+		fprintf(output, "ICMP Photuris (%d) error", error_code);
+		break;
+	default:
+		fprintf(output, "Other (%d) error", error_code);
+	}
 
-void icmp_print_error(FILE * output, int error_code, const char * prefix, const char * suffix){
-	if(output){
-		if(prefix){
-			fprintf(output, "%s", prefix);
-		}
-		switch(error_code){
-			case ICMP_DEST_UNREACH:
-				fprintf(output, "ICMP Destination Unreachable (%d) error", error_code);
-				break;
-			case ICMP_SOURCE_QUENCH:
-				fprintf(output, "ICMP Source Quench (%d) error", error_code);
-				break;
-			case ICMP_REDIRECT:
-				fprintf(output, "ICMP Redirect (%d) error", error_code);
-				break;
-			case ICMP_ALTERNATE_ADDR:
-				fprintf(output, "ICMP Alternate Host Address (%d) error", error_code);
-				break;
-			case ICMP_ROUTER_ADV:
-				fprintf(output, "ICMP Router Advertisement (%d) error", error_code);
-				break;
-			case ICMP_ROUTER_SOL:
-				fprintf(output, "ICMP Router Solicitation (%d) error", error_code);
-				break;
-			case ICMP_TIME_EXCEEDED:
-				fprintf(output, "ICMP Time Exceeded (%d) error", error_code);
-				break;
-			case ICMP_PARAMETERPROB:
-				fprintf(output, "ICMP Paramenter Problem (%d) error", error_code);
-				break;
-			case ICMP_CONVERSION_ERROR:
-				fprintf(output, "ICMP Datagram Conversion Error (%d) error", error_code);
-				break;
-			case ICMP_REDIRECT_MOBILE:
-				fprintf(output, "ICMP Mobile Host Redirect (%d) error", error_code);
-				break;
-			case ICMP_SKIP:
-				fprintf(output, "ICMP SKIP (%d) error", error_code);
-				break;
-			case ICMP_PHOTURIS:
-				fprintf(output, "ICMP Photuris (%d) error", error_code);
-				break;
-			default:
-				fprintf(output, "Other (%d) error", error_code);
-		}
-		if(suffix){
-			fprintf(output, "%s", suffix);
-		}
-	}
+	if (suffix)
+		fprintf(output, "%s", suffix);
 }
 
-void print_error(FILE * output, int error_code, const char * prefix, const char * suffix){
-	if(IS_ICMP_ERROR(error_code)){
+/** Prints the error description.
+ *
+ * Supports ICMP and socket error codes.
+ *
+ * @param[in] output The description output stream. May be NULL.
+ * @param[in] error_code The error code.
+ * @param[in] prefix The error description prefix. May be NULL.
+ * @param[in] suffix The error description suffix. May be NULL.
+ */
+void print_error(FILE *output, int error_code, const char *prefix, const char *suffix)
+{
+	if (IS_ICMP_ERROR(error_code))
 		icmp_print_error(output, error_code, prefix, suffix);
-	}else if(IS_SOCKET_ERROR(error_code)){
+	else if(IS_SOCKET_ERROR(error_code))
 		socket_print_error(output, error_code, prefix, suffix);
-	}
 }
 
-void socket_print_error(FILE * output, int error_code, const char * prefix, const char * suffix){
-	if(output){
-		if(prefix){
-			fprintf(output, "%s", prefix);
-		}
-		switch(error_code){
-			case ENOTSOCK:
-				fprintf(output, "Not a socket (%d) error", error_code);
-				break;
-			case EPROTONOSUPPORT:
-				fprintf(output, "Protocol not supported (%d) error", error_code);
-				break;
-			case ESOCKTNOSUPPORT:
-				fprintf(output, "Socket type not supported (%d) error", error_code);
-				break;
-			case EPFNOSUPPORT:
-				fprintf(output, "Protocol family not supported (%d) error", error_code);
-				break;
-			case EAFNOSUPPORT:
-				fprintf(output, "Address family not supported (%d) error", error_code);
-				break;
-			case EADDRINUSE:
-				fprintf(output, "Address already in use (%d) error", error_code);
-				break;
-			case ENOTCONN:
-				fprintf(output, "Socket not connected (%d) error", error_code);
-				break;
-			case NO_DATA:
-				fprintf(output, "No data (%d) error", error_code);
-				break;
-			case EINPROGRESS:
-				fprintf(output, "Another operation in progress (%d) error", error_code);
-				break;
-			case EDESTADDRREQ:
-				fprintf(output, "Destination address required (%d) error", error_code);
-			case TRY_AGAIN:
-				fprintf(output, "Try again (%d) error", error_code);
-			default:
-				fprintf(output, "Other (%d) error", error_code);
-		}
-		if(suffix){
-			fprintf(output, "%s", suffix);
-		}
+/** Prints the specific socket error description.
+ *
+ * @param[in] output The description output stream. May be NULL.
+ * @param[in] error_code The socket error code.
+ * @param[in] prefix The error description prefix. May be NULL.
+ * @param[in] suffix The error description suffix. May be NULL.
+ */
+void socket_print_error(FILE *output, int error_code, const char *prefix, const char *suffix)
+{
+	if (!output)
+		return;
+
+	if (prefix)
+		fprintf(output, "%s", prefix);
+
+	switch (error_code) {
+	case ENOTSOCK:
+		fprintf(output, "Not a socket (%d) error", error_code);
+		break;
+	case EPROTONOSUPPORT:
+		fprintf(output, "Protocol not supported (%d) error", error_code);
+		break;
+	case ESOCKTNOSUPPORT:
+		fprintf(output, "Socket type not supported (%d) error", error_code);
+		break;
+	case EPFNOSUPPORT:
+		fprintf(output, "Protocol family not supported (%d) error", error_code);
+		break;
+	case EAFNOSUPPORT:
+		fprintf(output, "Address family not supported (%d) error", error_code);
+		break;
+	case EADDRINUSE:
+		fprintf(output, "Address already in use (%d) error", error_code);
+		break;
+	case ENOTCONN:
+		fprintf(output, "Socket not connected (%d) error", error_code);
+		break;
+	case NO_DATA:
+		fprintf(output, "No data (%d) error", error_code);
+		break;
+	case EINPROGRESS:
+		fprintf(output, "Another operation in progress (%d) error", error_code);
+		break;
+	case EDESTADDRREQ:
+		fprintf(output, "Destination address required (%d) error", error_code);
+	case TRY_AGAIN:
+		fprintf(output, "Try again (%d) error", error_code);
+	default:
+		fprintf(output, "Other (%d) error", error_code);
 	}
+
+	if (suffix)
+		fprintf(output, "%s", suffix);
 }
 
 /** @}
  */
+
Index: uspace/app/netecho/print_error.h
===================================================================
--- uspace/app/netecho/print_error.h	(revision ef4b1126207083ec6bb1e9d3284ac63cca74f32c)
+++ uspace/app/netecho/print_error.h	(revision a8e5051a633bec02a8deec21772f6cadc0da9f98)
@@ -28,50 +28,33 @@
 
 /** @addtogroup net_app
- *  @{
+ * @{
  */
 
 /** @file
- *  Generic application error printing functions.
+ * Generic application error printing functions.
  */
 
-#ifndef __NET_APP_PRINT__
-#define __NET_APP_PRINT__
+#ifndef NET_APP_PRINT_
+#define NET_APP_PRINT_
+
+#include <stdio.h>
 
 /** Returns whether the error code may be an ICMP error code.
- *  @param[in] error_code The error code.
- *  @returns A value indicating whether the error code may be an ICMP error code.
+ *
+ * @param[in] error_code The error code.
+ * @returns A value indicating whether the error code may be an ICMP error code.
  */
-#define IS_ICMP_ERROR(error_code)		((error_code) > 0)
+#define IS_ICMP_ERROR(error_code)	((error_code) > 0)
 
 /** Returns whether the error code may be socket error code.
- *  @param[in] error_code The error code.
- *  @returns A value indicating whether the error code may be a socket error code.
+ *
+ * @param[in] error_code The error code.
+ * @returns A value indicating whether the error code may be a socket error code.
  */
 #define IS_SOCKET_ERROR(error_code)	((error_code) < 0)
 
-/** Prints the specific ICMP error description.
- *  @param[in] output The description output stream. May be NULL.
- *  @param[in] error_code The ICMP error code.
- *  @param[in] prefix The error description prefix. May be NULL.
- *  @param[in] suffix The error description suffix. May be NULL.
- */
-extern void icmp_print_error(FILE * output, int error_code, const char * prefix, const char * suffix);
-
-/** Prints the error description.
- *  Supports ICMP and socket error codes.
- *  @param[in] output The description output stream. May be NULL.
- *  @param[in] error_code The error code.
- *  @param[in] prefix The error description prefix. May be NULL.
- *  @param[in] suffix The error description suffix. May be NULL.
- */
-extern void print_error(FILE * output, int error_code, const char * prefix, const char * suffix);
-
-/** Prints the specific socket error description.
- *  @param[in] output The description output stream. May be NULL.
- *  @param[in] error_code The socket error code.
- *  @param[in] prefix The error description prefix. May be NULL.
- *  @param[in] suffix The error description suffix. May be NULL.
- */
-extern void socket_print_error(FILE * output, int error_code, const char * prefix, const char * suffix);
+extern void icmp_print_error(FILE *, int, const char *, const char *);
+extern void print_error(FILE *, int, const char *, const char *);
+extern void socket_print_error(FILE *, int, const char *, const char *);
 
 #endif
