Index: uspace/lib/net/generic/packet_client.c
===================================================================
--- uspace/lib/net/generic/packet_client.c	(revision b934e433af417095337c05b68b53bd2859a734e6)
+++ uspace/lib/net/generic/packet_client.c	(revision b69ceea4b067fb9d220925ff712d816ed799d12b)
@@ -27,10 +27,10 @@
  */
 
-/** @addtogroup packet
- *  @{
+/** @addtogroup libnet
+ * @{
  */
 
 /** @file
- *  Packet client implementation.
+ * Packet client implementation.
  */
 
@@ -38,13 +38,24 @@
 #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>
 
-int packet_copy_data(packet_t packet, const void * data, size_t length)
+/** 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.
+ * @returns		EOK on success.
+ * @returns		EINVAL if the packet is not valid.
+ * @returns		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))
@@ -61,4 +72,13 @@
 }
 
+/** 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.
+ * @returns		The pointer to the allocated memory.
+ * @returns		NULL if there is not enough memory left.
+ */
 void *packet_prefix(packet_t packet, size_t length)
 {
@@ -73,4 +93,13 @@
 }
 
+/** 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.
+ * @returns		The pointer to the allocated memory.
+ * @returns		NULL if there is not enough memory left.
+ */
 void *packet_suffix(packet_t packet, size_t length)
 {
@@ -84,4 +113,15 @@
 }
 
+/** 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.
+ * @returns		EOK on success.
+ * @returns		EINVAL if the packet is not valid.
+ * @returns		ENOMEM if there is not enough memory left.
+ */
 int packet_trim(packet_t packet, size_t prefix, size_t suffix)
 {
@@ -97,4 +137,10 @@
 }
 
+/** Returns the packet identifier.
+ *
+ * @param[in] packet	The packet.
+ * @returns		The packet identifier.
+ * @returns		Zero if the packet is not valid.
+ */
 packet_id_t packet_get_id(const packet_t packet)
 {
@@ -102,5 +148,14 @@
 }
 
-int packet_get_addr(const packet_t packet, uint8_t ** src, uint8_t ** dest)
+/** 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.
+ * @returns		The stored addresses length.
+ * @returns		Zero if the addresses are not present.
+ * @returns		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))
@@ -116,4 +171,10 @@
 }
 
+/** Returns the packet content length.
+ *
+ * @param[in] packet	The packet.
+ * @returns		The packet content length in bytes.
+ * @returns		Zero if the packet is not valid.
+ */
 size_t packet_get_data_length(const packet_t packet)
 {
@@ -124,4 +185,10 @@
 }
 
+/** Returns the pointer to the beginning of the packet content.
+ *
+ * @param[in] packet	The packet.
+ * @returns		The pointer to the beginning of the packet content.
+ * @returns		NULL if the packet is not valid.
+ */
 void *packet_get_data(const packet_t packet)
 {
@@ -132,6 +199,16 @@
 }
 
+/** 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.
+ * @returns		EOK on success.
+ * @returns		EINVAL if the packet is not valid.
+ * @returns		ENOMEM if there is not enough memory left.
+ */
 int
-packet_set_addr(packet_t packet, const uint8_t * src, const uint8_t * dest,
+packet_set_addr(packet_t packet, const uint8_t *src, const uint8_t *dest,
     size_t addr_len)
 {
@@ -170,4 +247,14 @@
 }
 
+/** Returns the packet copy.
+ *
+ * Copies the addresses, data, order and metric values.
+ * Does not copy the queue placement.
+ *
+ * @param[in] phone	The packet server module phone.
+ * @param[in] packet	The original packet.
+ * @returns		The packet copy.
+ * @returns		NULL on error.
+ */
 packet_t packet_get_copy(int phone, packet_t packet)
 {
Index: uspace/lib/net/generic/packet_remote.c
===================================================================
--- uspace/lib/net/generic/packet_remote.c	(revision b934e433af417095337c05b68b53bd2859a734e6)
+++ uspace/lib/net/generic/packet_remote.c	(revision b69ceea4b067fb9d220925ff712d816ed799d12b)
@@ -27,11 +27,11 @@
  */
 
-/** @addtogroup packet
- *  @{
+/** @addtogroup libnet
+ * @{
  */
 
 /** @file
- *  Packet client interface implementation for remote modules.
- *  @see packet_client.h
+ * Packet client interface implementation for remote modules.
+ * @see packet_client.h
  */
 
@@ -86,4 +86,19 @@
 }
 
+/** Translates the packet identifier to the packet reference.
+ *
+ * Tries to find mapping first.
+ * Contacts the packet server to share the packet if the mapping is not present.
+ *
+ * @param[in] phone	The packet server module phone.
+ * @param[out] packet	The packet reference.
+ * @param[in] packet_id	The packet identifier.
+ * @returns		EOK on success.
+ * @returns		EINVAL if the packet parameter is NULL.
+ * @returns		Other error codes as defined for the NET_PACKET_GET_SIZE
+ *			message.
+ * @returns		Other error codes as defined for the packet_return()
+ *			function.
+ */
 int packet_translate_remote(int phone, packet_ref packet, packet_id_t packet_id)
 {
@@ -110,4 +125,17 @@
 }
 
+/** Obtains the packet of the given dimensions.
+ *
+ * Contacts the packet server to return the appropriate packet.
+ *
+ * @param[in] phone	The packet server module phone.
+ * @param[in] addr_len	The source and destination addresses maximal length in
+ *			bytes.
+ * @param[in] max_prefix The maximal prefix length in bytes.
+ * @param[in] max_content The maximal content length in bytes.
+ * @param[in] max_suffix The maximal suffix length in bytes.
+ * @returns		The packet reference.
+ * @returns		NULL on error.
+ */
 packet_t packet_get_4_remote(int phone, size_t max_content, size_t addr_len,
     size_t max_prefix, size_t max_suffix)
@@ -133,4 +161,13 @@
 }
 
+/** Obtains the packet of the given content size.
+ *
+ * Contacts the packet server to return the appropriate packet.
+ *
+ * @param[in] phone	The packet server module phone.
+ * @param[in] content	The maximal content length in bytes.
+ * @returns		The packet reference.
+ * @returns		NULL on error.
+ */
 packet_t packet_get_1_remote(int phone, size_t content)
 {
@@ -154,4 +191,14 @@
 }
 
+/** Releases 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] phone	The packet server module phone.
+ * @param[in] packet_id	The packet identifier.
+ */
 void pq_release_remote(int phone, packet_id_t packet_id)
 {
Index: uspace/lib/net/include/packet_client.h
===================================================================
--- uspace/lib/net/include/packet_client.h	(revision b934e433af417095337c05b68b53bd2859a734e6)
+++ uspace/lib/net/include/packet_client.h	(revision b69ceea4b067fb9d220925ff712d816ed799d12b)
@@ -27,189 +27,85 @@
  */
 
-/** @addtogroup packet
+/** @addtogroup libnet
  *  @{
  */
 
 /** @file
- *  Packet client.
- *  The hosting module has to be compiled with both the packet.c and the packet_client.c source files.
- *  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 -&nbsp;by passing the packets to the next module and stopping using the passed ones.
- *  @see packet.h
+ * 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 __NET_PACKET_CLIENT_H__
-#define __NET_PACKET_CLIENT_H__
+#ifndef LIBNET_PACKET_CLIENT_H_
+#define LIBNET_PACKET_CLIENT_H_
 
 #include <net/packet.h>
 
-/** @name Packet client interface
- */
+/** @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.
- *  @returns The typed pointer to the allocated memory.
- *  @returns NULL if the packet is not valid.
- *  @returns NULL if there is not enough memory left.
+/** 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.
+ * @returns		The typed pointer to the allocated memory.
+ * @returns		NULL if the packet is not valid.
+ * @returns		NULL if there is not enough memory left.
  */
-#define PACKET_PREFIX(packet, type)	(type *) packet_prefix((packet), sizeof(type))
+#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.
- *  @returns The typed pointer to the allocated memory.
- *  @returns NULL if the packet is not valid.
- *  @returns NULL if there is not enough memory left.
+/** 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.
+ * @returns		The typed pointer to the allocated memory.
+ * @returns		NULL if the packet is not valid.
+ * @returns		NULL if there is not enough memory left.
  */
-#define PACKET_SUFFIX(packet, type)	(type *) packet_suffix((packet), sizeof(type))
+#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.
- *  @returns EOK on success.
- *  @returns EINVAL if the packet is not valid.
- *  @returns ENOMEM if there is not enough memory left.
+ *
+ * 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.
+ * @returns		EOK on success.
+ * @returns		EINVAL if the packet is not valid.
+ * @returns		ENOMEM if there is not enough memory left.
  */
-#define PACKET_TRIM(packet, prefix, suffix)	packet_trim((packet), sizeof(prefix), sizeof(suffix))
+#define PACKET_TRIM(packet, prefix, suffix) \
+	packet_trim((packet), sizeof(prefix), sizeof(suffix))
 
-/** 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.
- *  @returns The pointer to the allocated memory.
- *  @returns NULL if there is not enough memory left.
- */
-extern void * packet_prefix(packet_t packet, size_t length);
-
-/** 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.
- *  @returns The pointer to the allocated memory.
- *  @returns NULL if there is not enough memory left.
- */
-extern void * packet_suffix(packet_t packet, size_t 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.
- *  @returns EOK on success.
- *  @returns EINVAL if the packet is not valid.
- *  @returns ENOMEM if there is not enough memory left.
- */
-extern int packet_trim(packet_t packet, size_t prefix, size_t suffix);
-
-/** 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.
- *  @returns EOK on success.
- *  @returns EINVAL if the packet is not valid.
- *  @returns ENOMEM if there is not enough memory left.
- */
-extern int packet_copy_data(packet_t packet, const void * data, size_t length);
-
-/** Returns the packet identifier.
- *  @param[in] packet The packet.
- *  @returns The packet identifier.
- *  @returns Zero (0) if the packet is not valid.
- */
-extern packet_id_t packet_get_id(const packet_t packet);
-
-/** Returns the packet content length.
- *  @param[in] packet The packet.
- *  @returns The packet content length in bytes.
- *  @returns Zero (0) if the packet is not valid.
- */
-extern size_t packet_get_data_length(const packet_t packet);
-
-/** Returns the pointer to the beginning of the packet content.
- *  @param[in] packet The packet.
- *  @returns The pointer to the beginning of the packet content.
- *  @returns NULL if the packet is not valid.
- */
-extern void * packet_get_data(const packet_t packet);
-
-/** 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.
- *  @returns The stored addresses length.
- *  @returns Zero (0) if the addresses are not present.
- *  @returns EINVAL if the packet is not valid.
- */
-extern int packet_get_addr(const packet_t packet, uint8_t ** src, uint8_t ** dest);
-
-/** 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.
- *  @returns EOK on success.
- *  @returns EINVAL if the packet is not valid.
- *  @returns ENOMEM if there is not enough memory left.
- */
-extern int packet_set_addr(packet_t packet, const uint8_t * src, const uint8_t * dest, size_t addr_len);
-
-/** Translates the packet identifier to the packet reference.
- *  Tries to find mapping first.
- *  Contacts the packet server to share the packet if the mapping is not present.
- *  @param[in] phone The packet server module phone.
- *  @param[out] packet The packet reference.
- *  @param[in] packet_id The packet identifier.
- *  @returns EOK on success.
- *  @returns EINVAL if the packet parameter is NULL.
- *  @returns Other error codes as defined for the NET_PACKET_GET_SIZE message.
- *  @returns Other error codes as defined for the packet_return() function.
- */
-extern int packet_translate_remote(int phone, packet_ref packet, packet_id_t packet_id);
-
-/** Obtains the packet of the given dimensions.
- *  Contacts the packet server to return the appropriate packet.
- *  @param[in] phone The packet server module phone.
- *  @param[in] addr_len The source and destination addresses maximal length in bytes.
- *  @param[in] max_prefix The maximal prefix length in bytes.
- *  @param[in] max_content The maximal content length in bytes.
- *  @param[in] max_suffix The maximal suffix length in bytes.
- *  @returns The packet reference.
- *  @returns NULL on error.
- */
-extern packet_t packet_get_4_remote(int phone, size_t max_content, size_t addr_len, size_t max_prefix, size_t max_suffix);
-
-/** Obtains the packet of the given content size.
- *  Contacts the packet server to return the appropriate packet.
- *  @param[in] phone The packet server module phone.
- *  @param[in] content The maximal content length in bytes.
- *  @returns The packet reference.
- *  @returns NULL on error.
- */
-extern packet_t packet_get_1_remote(int phone, size_t content);
-
-/** Releases 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] phone The packet server module phone.
- *  @param[in] packet_id The packet identifier.
- */
-extern void pq_release_remote(int phone, packet_id_t packet_id);
-
-/** Returns the packet copy.
- *  Copies the addresses, data, order and metric values.
- *  Does not copy the queue placement.
- *  @param[in] phone The packet server module phone.
- *  @param[in] packet The original packet.
- *  @returns The packet copy.
- *  @returns NULL on error.
- */
+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(int phone, packet_t packet);
 
Index: uspace/lib/net/include/packet_remote.h
===================================================================
--- uspace/lib/net/include/packet_remote.h	(revision b934e433af417095337c05b68b53bd2859a734e6)
+++ uspace/lib/net/include/packet_remote.h	(revision b69ceea4b067fb9d220925ff712d816ed799d12b)
@@ -27,12 +27,13 @@
  */
 
-/** @addtogroup packet
+/** @addtogroup libnet
  * @{
  */
 
-#ifndef __NET_PACKET_REMOTE_H__
-#define __NET_PACKET_REMOTE_H__
+#ifndef LIBNET_PACKET_REMOTE_H_
+#define LIBNET_PACKET_REMOTE_H_
 
 #include <net/packet.h>
+#include <sys/types.h>
 
 extern int packet_translate_remote(int, packet_ref, packet_id_t);
