Index: uspace/lib/c/generic/inet/endpoint.c
===================================================================
--- uspace/lib/c/generic/inet/endpoint.c	(revision fb4d78843307ab5d3e53b65970b01a47bdb9007b)
+++ uspace/lib/c/generic/inet/endpoint.c	(revision b10460aa6a666f2289836624216d445ff03a7816)
@@ -36,4 +36,10 @@
 #include <mem.h>
 
+/** Initialize endpoint structure.
+ *
+ * Sets any address, any port number.
+ *
+ * @param ep Endpoint
+ */
 void inet_ep_init(inet_ep_t *ep)
 {
@@ -41,4 +47,10 @@
 }
 
+/** Initialize endpoint pair structure.
+ *
+ * Sets any address, any port number for both local and remote sides.
+ *
+ * @param ep2 Endpoint pair
+ */
 void inet_ep2_init(inet_ep2_t *ep2)
 {
Index: uspace/lib/c/generic/inet/tcp.c
===================================================================
--- uspace/lib/c/generic/inet/tcp.c	(revision fb4d78843307ab5d3e53b65970b01a47bdb9007b)
+++ uspace/lib/c/generic/inet/tcp.c	(revision b10460aa6a666f2289836624216d445ff03a7816)
@@ -44,10 +44,21 @@
 static int tcp_conn_fibril(void *);
 
-/** Incoming TCP connection info */
+/** Incoming TCP connection info
+ *
+ * Used to pass information about incoming TCP connection to the connection
+ * fibril
+ */
 typedef struct {
+	/** Listener who received the connection */
 	tcp_listener_t *lst;
+	/** Incoming connection */
 	tcp_conn_t *conn;
 } tcp_in_conn_t;
 
+/** Create callback connection from TCP service.
+ *
+ * @param tcp TCP service
+ * @return EOK on success or negative error code
+ */
 static int tcp_callback_create(tcp_t *tcp)
 {
@@ -67,4 +78,10 @@
 }
 
+/** Create TCP client instance.
+ *
+ * @param  rtcp Place to store pointer to new TCP client
+ * @return EOK on success, ENOMEM if out of memory, EIO if service
+ *         cannot be contacted
+ */
 int tcp_create(tcp_t **rtcp)
 {
@@ -111,4 +128,8 @@
 }
 
+/** Destroy TCP client instance.
+ *
+ * @param tcp TCP client
+ */
 void tcp_destroy(tcp_t *tcp)
 {
@@ -126,4 +147,14 @@
 }
 
+/** Create new TCP connection
+ *
+ * @param tcp   TCP client instance
+ * @param id    Connection ID
+ * @param cb    Callbacks
+ * @param arg   Callback argument
+ * @param rconn Place to store pointer to new connection
+ *
+ * @return EOK on success, ENOMEM if out of memory
+ */
 static int tcp_conn_new(tcp_t *tcp, sysarg_t id, tcp_cb_t *cb, void *arg,
     tcp_conn_t **rconn)
@@ -150,4 +181,26 @@
 }
 
+/** Create new TCP connection.
+ *
+ * Open a connection to the specified destination. This function returns
+ * even before the connection is established (or not). When the connection
+ * is established, @a cb->connected is called. If the connection fails,
+ * @a cb->conn_failed is called. Alternatively, the caller can call
+ * @c tcp_conn_wait_connected() to wait for connection to complete or fail.
+ * Other callbacks are available to monitor the changes in connection state.
+ *
+ * @a epp must specify the remote address and port. Both local address and
+ * port are optional. If local address is not specified, address selection
+ * will take place. If local port number is not specified, a suitable
+ * free dynamic port number will be allocated.
+ *
+ * @param tcp   TCP client
+ * @param epp   Internet endpoint pair
+ * @param cb    Callbacks
+ * @param arg   Argument to callbacks
+ * @param rconn Place to store pointer to new connection
+ *
+ * @return EOK on success or negative error code.
+ */
 int tcp_conn_create(tcp_t *tcp, inet_ep2_t *epp, tcp_cb_t *cb, void *arg,
     tcp_conn_t **rconn)
@@ -186,4 +239,11 @@
 }
 
+/** Destroy TCP connection.
+ *
+ * Destroy TCP connection. The caller should destroy all connections
+ * he created before destroying the TCP client and before terminating.
+ *
+ * @param conn TCP connection
+ */
 void tcp_conn_destroy(tcp_conn_t *conn)
 {
@@ -203,4 +263,12 @@
 }
 
+/** Get connection based on its ID.
+ *
+ * @param tcp   TCP client
+ * @param id    Connection ID
+ * @param rconn Place to store pointer to connection
+ *
+ * @return EOK on success, EINVAL if no connection with the given ID exists
+ */
 static int tcp_conn_get(tcp_t *tcp, sysarg_t id, tcp_conn_t **rconn)
 {
@@ -215,4 +283,9 @@
 }
 
+/** Get the user/callback argument for a connection.
+ *
+ * @param conn TCP connection
+ * @return User argument associated with connection
+ */
 void *tcp_conn_userptr(tcp_conn_t *conn)
 {
@@ -220,4 +293,25 @@
 }
 
+/** Create a TCP connection listener.
+ *
+ * A listener listens for connections on the set of endpoints specified
+ * by @a ep. Each time a new incoming connection is established,
+ * @a lcb->new_conn is called (and passed @a larg). Also, the new connection
+ * will have callbacks set to @a cb and argument to @a arg.
+ *
+ * @a ep must specify a valid port number. @a ep may specify an address
+ * or link to listen on. If it does not, the listener will listen on
+ * all links/addresses.
+ *
+ * @param tcp  TCP client
+ * @param ep   Internet endpoint
+ * @param lcb  Listener callbacks
+ * @param larg Listener callback argument
+ * @param cb   Connection callbacks for every new connection
+ * @param arg  Connection argument for every new connection
+ * @param rlst Place to store pointer to new listener
+ *
+ * @return EOK on success or negative error code
+ */
 int tcp_listener_create(tcp_t *tcp, inet_ep_t *ep, tcp_listen_cb_t *lcb,
     void *larg, tcp_cb_t *cb, void *arg, tcp_listener_t **rlst)
@@ -265,4 +359,8 @@
 }
 
+/** Destroy TCP connection listener.
+ *
+ * @param lst Listener
+ */
 void tcp_listener_destroy(tcp_listener_t *lst)
 {
@@ -282,4 +380,12 @@
 }
 
+/** Get TCP connection listener based on its ID.
+ *
+ * @param tcp TCP client
+ * @param id  Listener ID
+ * @param rlst Place to store pointer to listener
+ *
+ * @return EOK on success, EINVAL if no listener with the given ID is found
+ */
 static int tcp_listener_get(tcp_t *tcp, sysarg_t id, tcp_listener_t **rlst)
 {
@@ -294,4 +400,9 @@
 }
 
+/** Get callback/user argument associated with listener.
+ *
+ * @param lst Listener
+ * @return Callback/user argument
+ */
 void *tcp_listener_userptr(tcp_listener_t *lst)
 {
@@ -299,4 +410,14 @@
 }
 
+/** Wait until connection is either established or connection fails.
+ *
+ * Can be called after calling tcp_conn_create() to block until connection
+ * either completes or fails. If the connection fails, EIO is returned.
+ * In this case the connection still exists, but is in a failed
+ * state.
+ *
+ * @param conn Connection
+ * @return EOK if connection is established, EIO otherwise
+ */
 int tcp_conn_wait_connected(tcp_conn_t *conn)
 {
@@ -315,4 +436,12 @@
 }
 
+/** Send data over TCP connection.
+ *
+ * @param conn  Connection
+ * @param data  Data
+ * @param bytes Data size in bytes
+ *
+ * @return EOK on success or negative error code
+ */
 int tcp_conn_send(tcp_conn_t *conn, const void *data, size_t bytes)
 {
@@ -340,5 +469,11 @@
 }
 
-
+/** Send FIN.
+ *
+ * Send FIN, indicating no more data will be send over the connection.
+ *
+ * @param conn Connection
+ * @return EOK on success or negative error code
+ */
 int tcp_conn_send_fin(tcp_conn_t *conn)
 {
@@ -352,4 +487,9 @@
 }
 
+/** Push connection.
+ *
+ * @param conn Connection
+ * @return EOK on success or negative error code
+ */
 int tcp_conn_push(tcp_conn_t *conn)
 {
@@ -363,4 +503,9 @@
 }
 
+/** Reset connection.
+ *
+ * @param conn Connection
+ * @return EOK on success or negative error code
+ */
 int tcp_conn_reset(tcp_conn_t *conn)
 {
@@ -374,4 +519,21 @@
 }
 
+/** Read received data from connection without blocking.
+ *
+ * If any received data is pending on the connection, up to @a bsize bytes
+ * are copied to @a buf and the acutal number is stored in @a *nrecv.
+ * The entire buffer of @a bsize bytes is filled except when less data
+ * is currently available or FIN is received. EOK is returned.
+ *
+ * If no received data is pending, returns EAGAIN.
+ *
+ * @param conn Connection
+ * @param buf  Buffer
+ * @param bsize Buffer size
+ * @param nrecv Place to store actual number of received bytes
+ *
+ * @return EOK on success, EAGAIN if no received data is pending, or other
+ *         negative error code in case of other error
+ */
 int tcp_conn_recv(tcp_conn_t *conn, void *buf, size_t bsize, size_t *nrecv)
 {
@@ -408,5 +570,20 @@
 }
 
-int tcp_conn_recv_wait(tcp_conn_t *conn, void *buf, size_t bsize, size_t *nrecv)
+/** Read received data from connection with blocking.
+ *
+ * Wait for @a bsize bytes of data to be received and copy them to
+ * @a buf. Less data may be returned if FIN is received on the connection.
+ * The actual If any received data is written to @a *nrecv and EOK
+ * is returned on success.
+ *
+ * @param conn Connection
+ * @param buf  Buffer
+ * @param bsize Buffer size
+ * @param nrecv Place to store actual number of received bytes
+ *
+ * @return EOK on success or negative error code
+ */
+int tcp_conn_recv_wait(tcp_conn_t *conn, void *buf, size_t bsize,
+    size_t *nrecv)
 {
 	async_exch_t *exch;
@@ -450,4 +627,10 @@
 }
 
+/** Connection established event.
+ *
+ * @param tcp TCP client
+ * @param iid Call ID
+ * @param icall Call data
+ */
 static void tcp_ev_connected(tcp_t *tcp, ipc_callid_t iid, ipc_call_t *icall)
 {
@@ -472,4 +655,10 @@
 }
 
+/** Connection failed event.
+ *
+ * @param tcp TCP client
+ * @param iid Call ID
+ * @param icall Call data
+ */
 static void tcp_ev_conn_failed(tcp_t *tcp, ipc_callid_t iid, ipc_call_t *icall)
 {
@@ -494,4 +683,10 @@
 }
 
+/** Connection reset event.
+ *
+ * @param tcp TCP client
+ * @param iid Call ID
+ * @param icall Call data
+ */
 static void tcp_ev_conn_reset(tcp_t *tcp, ipc_callid_t iid, ipc_call_t *icall)
 {
@@ -516,4 +711,10 @@
 }
 
+/** Data available event.
+ *
+ * @param tcp TCP client
+ * @param iid Call ID
+ * @param icall Call data
+ */
 static void tcp_ev_data(tcp_t *tcp, ipc_callid_t iid, ipc_call_t *icall)
 {
@@ -539,4 +740,10 @@
 }
 
+/** Urgent data event.
+ *
+ * @param tcp TCP client
+ * @param iid Call ID
+ * @param icall Call data
+ */
 static void tcp_ev_urg_data(tcp_t *tcp, ipc_callid_t iid, ipc_call_t *icall)
 {
@@ -544,4 +751,10 @@
 }
 
+/** New connection event.
+ *
+ * @param tcp TCP client
+ * @param iid Call ID
+ * @param icall Call data
+ */
 static void tcp_ev_new_conn(tcp_t *tcp, ipc_callid_t iid, ipc_call_t *icall)
 {
@@ -590,4 +803,10 @@
 }
 
+/** Callback connection handler.
+ *
+ * @param iid Connect call ID
+ * @param icall Connect call data
+ * @param arg Argument, TCP client
+ */
 static void tcp_cb_conn(ipc_callid_t iid, ipc_call_t *icall, void *arg)
 {
@@ -636,5 +855,8 @@
 }
 
-/** Fibril for handling incoming TCP connection in background */
+/** Fibril for handling incoming TCP connection in background.
+ *
+ * @param arg Argument, incoming connection information (@c tcp_in_conn_t)
+ */
 static int tcp_conn_fibril(void *arg)
 {
Index: uspace/lib/c/generic/inet/udp.c
===================================================================
--- uspace/lib/c/generic/inet/udp.c	(revision fb4d78843307ab5d3e53b65970b01a47bdb9007b)
+++ uspace/lib/c/generic/inet/udp.c	(revision b10460aa6a666f2289836624216d445ff03a7816)
@@ -43,4 +43,9 @@
 static void udp_cb_conn(ipc_callid_t, ipc_call_t *, void *);
 
+/** Create callback connection from UDP service.
+ *
+ * @param udp UDP service
+ * @return EOK on success or negative error code
+ */
 static int udp_callback_create(udp_t *udp)
 {
@@ -60,4 +65,10 @@
 }
 
+/** Create UDP client instance.
+ *
+ * @param  rudp Place to store pointer to new UDP client
+ * @return EOK on success, ENOMEM if out of memory, EIO if service
+ *         cannot be contacted
+ */
 int udp_create(udp_t **rudp)
 {
@@ -103,4 +114,8 @@
 }
 
+/** Destroy UDP client instance.
+ *
+ * @param udp UDP client
+ */
 void udp_destroy(udp_t *udp)
 {
@@ -118,5 +133,28 @@
 }
 
-int udp_assoc_create(udp_t *udp, inet_ep2_t *ep2, udp_cb_t *cb, void *arg,
+/** Create new UDP association.
+ *
+ * Create a UDP association that allows sending and receiving messages.
+ *
+ * @a epp may specify remote address and port, in which case only messages
+ * from that remote endpoint will be received. Also, that remote endpoint
+ * is used as default when @c NULL is passed as destination to
+ * udp_assoc_send_msg.
+ *
+ * @a epp may specify a local link or address. If it does not, the association
+ * will listen on all local links/addresses. If @a epp does not specify
+ * a local port number, a free dynamic port number will be allocated.
+ *
+ * The caller is informed about incoming data by invoking @a cb->recv_msg
+ *
+ * @param udp    UDP client
+ * @param epp    Internet endpoint pair
+ * @param cb     Callbacks
+ * @param arg    Argument to callbacks
+ * @param rassoc Place to store pointer to new association
+ *
+ * @return EOK on success or negative error code.
+ */
+int udp_assoc_create(udp_t *udp, inet_ep2_t *epp, udp_cb_t *cb, void *arg,
     udp_assoc_t **rassoc)
 {
@@ -131,5 +169,5 @@
 	exch = async_exchange_begin(udp->sess);
 	aid_t req = async_send_0(exch, UDP_ASSOC_CREATE, &answer);
-	sysarg_t rc = async_data_write_start(exch, (void *)ep2,
+	sysarg_t rc = async_data_write_start(exch, (void *)epp,
 	    sizeof(inet_ep2_t));
 	async_exchange_end(exch);
@@ -161,4 +199,11 @@
 }
 
+/** Destroy UDP association.
+ *
+ * Destroy UDP association. The caller should destroy all associations
+ * he created before destroying the UDP client and before terminating.
+ *
+ * @param assoc UDP association
+ */
 void udp_assoc_destroy(udp_assoc_t *assoc)
 {
@@ -178,4 +223,13 @@
 }
 
+/** Send message via UDP association.
+ *
+ * @param assoc Association
+ * @param dest	Destination endpoint or @c NULL to use association's remote ep.
+ * @param data	Message data
+ * @param bytes Message size in bytes
+ *
+ * @return EOK on success or negative error code
+ */
 int udp_assoc_send_msg(udp_assoc_t *assoc, inet_ep_t *dest, void *data,
     size_t bytes)
@@ -211,4 +265,9 @@
 }
 
+/** Get the user/callback argument for an association.
+ *
+ * @param assoc UDP association
+ * @return User argument associated with association
+ */
 void *udp_assoc_userptr(udp_assoc_t *assoc)
 {
@@ -216,4 +275,13 @@
 }
 
+/** Get size of received message in bytes.
+ *
+ * Assuming jumbo messages can be received, the caller first needs to determine
+ * the size of the received message by calling this function, then they can
+ * read the message piece-wise using udp_rmsg_read().
+ *
+ * @param rmsg Received message
+ * @return Size of received message in bytes
+ */
 size_t udp_rmsg_size(udp_rmsg_t *rmsg)
 {
@@ -221,4 +289,13 @@
 }
 
+/** Read part of received message.
+ *
+ * @param rmsg  Received message
+ * @param off   Start offset
+ * @param buf   Buffer for storing data
+ * @param bsize Buffer size
+ *
+ * @return EOK on success or negative error code.
+ */
 int udp_rmsg_read(udp_rmsg_t *rmsg, size_t off, void *buf, size_t bsize)
 {
@@ -245,4 +322,12 @@
 }
 
+/** Get remote endpoint of received message.
+ *
+ * Place the remote endpoint (the one from which the message was supposedly
+ * sent) to @a ep.
+ *
+ * @param rmsg Received message
+ * @param ep   Place to store remote endpoint
+ */
 void udp_rmsg_remote_ep(udp_rmsg_t *rmsg, inet_ep_t *ep)
 {
@@ -250,4 +335,9 @@
 }
 
+/** Get type of received ICMP error message.
+ *
+ * @param rerr Received error message
+ * @return Error message type
+ */
 uint8_t udp_rerr_type(udp_rerr_t *rerr)
 {
@@ -255,4 +345,9 @@
 }
 
+/** Get code of received ICMP error message.
+ *
+ * @param rerr Received error message
+ * @return Error message code
+ */
 uint8_t udp_rerr_code(udp_rerr_t *rerr)
 {
@@ -260,4 +355,11 @@
 }
 
+/** Get information about the next received message from UDP service.
+ *
+ * @param udp  UDP client
+ * @param rmsg Place to store message information
+ *
+ * @return EOK on success or negative error code
+ */
 static int udp_rmsg_info(udp_t *udp, udp_rmsg_t *rmsg)
 {
@@ -288,4 +390,9 @@
 }
 
+/** Discard next received message in UDP service.
+ *
+ * @param udp UDP client
+ * @return EOK on success or negative error code
+ */
 static int udp_rmsg_discard(udp_t *udp)
 {
@@ -299,4 +406,12 @@
 }
 
+/** Get association based on its ID.
+ *
+ * @param udp    UDP client
+ * @param id     Association ID
+ * @param rassoc Place to store pointer to association
+ *
+ * @return EOK on success, EINVAL if no association with the given ID exists
+ */
 static int udp_assoc_get(udp_t *udp, sysarg_t id, udp_assoc_t **rassoc)
 {
@@ -311,4 +426,13 @@
 }
 
+/** Handle 'data' event, i.e. some message(s) arrived.
+ *
+ * For each received message, get information about it, call @c recv_msg
+ * callback and discard it.
+ *
+ * @param udp UDP client
+ * @param iid IPC message ID
+ * @param icall IPC message
+ */
 static void udp_ev_data(udp_t *udp, ipc_callid_t iid, ipc_call_t *icall)
 {
@@ -340,4 +464,10 @@
 }
 
+/** UDP service callback connection.
+ *
+ * @param iid Connect message ID
+ * @param icall Connect message
+ * @param arg Argument, UDP client
+ */
 static void udp_cb_conn(ipc_callid_t iid, ipc_call_t *icall, void *arg)
 {
Index: uspace/lib/nettl/src/amap.c
===================================================================
--- uspace/lib/nettl/src/amap.c	(revision fb4d78843307ab5d3e53b65970b01a47bdb9007b)
+++ uspace/lib/nettl/src/amap.c	(revision b10460aa6a666f2289836624216d445ff03a7816)
@@ -36,4 +36,16 @@
  * Manages allocations of endpoints / endpoint pairs (corresponding to
  * UDP associations, TCP listeners and TCP connections)
+ *
+ * An association map contains different types of entries, based on which
+ * set of attributes (key) they specify. In order from most specific to the
+ * least specific one:
+ *
+ *  - repla (remote endpoint, local address)
+ *  - laddr (local address)
+ *  - llink (local link)
+ *  - unspec (unspecified)
+ *
+ * In the unspecified case only the local port is known and the entry matches
+ * all remote and local addresses.
  */
 
@@ -47,4 +59,9 @@
 #include <stdlib.h>
 
+/** Create association map.
+ *
+ * @param rmap Place to store pointer to new association map
+ * @return EOk on success, ENOMEM if out of memory
+ */
 int amap_create(amap_t **rmap)
 {
@@ -73,4 +90,8 @@
 }
 
+/** Destroy association map.
+ *
+ * @param map Association map
+ */
 void amap_destroy(amap_t *map)
 {
@@ -79,5 +100,15 @@
 }
 
-/** Find exact repla */
+/** Find exact repla.
+ *
+ * Find repla (remote endpoint, local address) entry by exact match.
+ *
+ * @param map Association map
+ * @param rep Remote endpoint
+ * @param la  Local address
+ * @param rrepla Place to store pointer to repla
+ *
+ * @return EOK on success, ENOENT if not found
+ */
 static int amap_repla_find(amap_t *map, inet_ep_t *rep, inet_addr_t *la,
     amap_repla_t **rrepla)
@@ -113,4 +144,15 @@
 }
 
+/** Insert repla.
+ *
+ * Insert new repla (remote endpoint, local address) entry to association map.
+ *
+ * @param amap   Association map
+ * @param rep    Remote endpoint
+ * @param la     Local address
+ * @param rrepla Place to store pointer to new repla
+ *
+ * @return EOK on success, ENOMEM if out of memory
+ */
 static int amap_repla_insert(amap_t *map, inet_ep_t *rep, inet_addr_t *la,
     amap_repla_t **rrepla)
@@ -139,4 +181,11 @@
 }
 
+/** Remove repla from association map.
+ *
+ * Remove repla (remote endpoint, local address) from association map.
+ *
+ * @param map   Association map
+ * @param repla Repla
+ */
 static void amap_repla_remove(amap_t *map, amap_repla_t *repla)
 {
@@ -146,5 +195,14 @@
 }
 
-/** Find exact laddr */
+/** Find exact laddr.
+ *
+ * Find laddr (local address) entry by exact match.
+ *
+ * @param map    Association map
+ * @param addr   Address
+ * @param rladdr Place to store pointer to laddr entry
+ *
+ * @return EOK on success, ENOENT if not found.
+ */
 static int amap_laddr_find(amap_t *map, inet_addr_t *addr,
     amap_laddr_t **rladdr)
@@ -161,4 +219,13 @@
 }
 
+/** Insert laddr.
+ *
+ * Insert new laddr (local address) entry to association map.
+ *
+ * @param addr   Local address
+ * @param rladdr Place to store pointer to new laddr
+ *
+ * @return EOK on success, ENOMEM if out of memory
+ */
 static int amap_laddr_insert(amap_t *map, inet_addr_t *addr,
     amap_laddr_t **rladdr)
@@ -186,4 +253,11 @@
 }
 
+/** Remove laddr from association map.
+ *
+ * Remove laddr (local address) entry from association map.
+ *
+ * @param map   Association map
+ * @param laddr Laddr entry
+ */
 static void amap_laddr_remove(amap_t *map, amap_laddr_t *laddr)
 {
@@ -193,5 +267,14 @@
 }
 
-/** Find exact llink */
+/** Find exact llink.
+ *
+ * Find llink (local link) entry by exact match.
+ *
+ * @param map     Association map
+ * @param link_id Local link ID
+ * @param rllink  Place to store pointer to llink entry
+ *
+ * @return EOK on success, ENOENT if not found.
+ */
 static int amap_llink_find(amap_t *map, sysarg_t link_id,
     amap_llink_t **rllink)
@@ -208,4 +291,13 @@
 }
 
+/** Insert llink.
+ *
+ * Insert new llink (local link) entry to association map.
+ *
+ * @param link_id Local link
+ * @param rllink  Place to store pointer to new llink
+ *
+ * @return EOK on success, ENOMEM if out of memory
+ */
 static int amap_llink_insert(amap_t *map, sysarg_t link_id,
     amap_llink_t **rllink)
@@ -233,4 +325,11 @@
 }
 
+/** Remove llink from association map.
+ *
+ * Remove llink (local link) entry from association map.
+ *
+ * @param map   Association map
+ * @param llink Llink entry
+ */
 static void amap_llink_remove(amap_t *map, amap_llink_t *llink)
 {
@@ -240,4 +339,17 @@
 }
 
+/** Insert endpoint pair into map with repla as key.
+ *
+ * If local port number is not specified, it is allocated.
+ *
+ * @param map Association map
+ * @param epp Endpoint pair, possibly with local port inet_port_any
+ * @param arg arg User value
+ * @param flags Flags
+ * @param aepp Place to store actual endpoint pair, possibly with allocated port
+ *
+ * @return EOK on success, EEXISTS if conflicting epp exists,
+ *         ENOMEM if out of memory
+ */
 static int amap_insert_repla(amap_t *map, inet_ep2_t *epp, void *arg,
     amap_flags_t flags, inet_ep2_t *aepp)
@@ -272,4 +384,17 @@
 }
 
+/** Insert endpoint pair into map with laddr as key.
+ *
+ * If local port number is not specified, it is allocated.
+ *
+ * @param map Association map
+ * @param epp Endpoint pair, possibly with local port inet_port_any
+ * @param arg arg User value
+ * @param flags Flags
+ * @param aepp Place to store actual endpoint pair, possibly with allocated port
+ *
+ * @return EOK on success, EEXISTS if conflicting epp exists,
+ *         ENOMEM if out of memory
+ */
 static int amap_insert_laddr(amap_t *map, inet_ep2_t *epp, void *arg,
     amap_flags_t flags, inet_ep2_t *aepp)
@@ -303,4 +428,17 @@
 }
 
+/** Insert endpoint pair into map with llink as key.
+ *
+ * If local port number is not specified, it is allocated.
+ *
+ * @param map Association map
+ * @param epp Endpoint pair, possibly with local port inet_port_any
+ * @param arg arg User value
+ * @param flags Flags
+ * @param aepp Place to store actual endpoint pair, possibly with allocated port
+ *
+ * @return EOK on success, EEXISTS if conflicting epp exists,
+ *         ENOMEM if out of memory
+ */
 static int amap_insert_llink(amap_t *map, inet_ep2_t *epp, void *arg,
     amap_flags_t flags, inet_ep2_t *aepp)
@@ -334,4 +472,17 @@
 }
 
+/** Insert endpoint pair into map with unspec as key.
+ *
+ * If local port number is not specified, it is allocated.
+ *
+ * @param map Association map
+ * @param epp Endpoint pair, possibly with local port inet_port_any
+ * @param arg arg User value
+ * @param flags Flags
+ * @param aepp Place to store actual endpoint pair, possibly with allocated port
+ *
+ * @return EOK on success, EEXISTS if conflicting epp exists,
+ *         ENOMEM if out of memory
+ */
 static int amap_insert_unspec(amap_t *map, inet_ep2_t *epp, void *arg,
     amap_flags_t flags, inet_ep2_t *aepp)
@@ -417,4 +568,12 @@
 }
 
+/** Remove endpoint pair using repla as key from map.
+ *
+ * The endpoint pair must be present in the map, otherwise behavior
+ * is unspecified.
+ *
+ * @param map Association map
+ * @param epp Endpoint pair
+ */
 static void amap_remove_repla(amap_t *map, inet_ep2_t *epp)
 {
@@ -434,4 +593,12 @@
 }
 
+/** Remove endpoint pair using laddr as key from map.
+ *
+ * The endpoint pair must be present in the map, otherwise behavior
+ * is unspecified.
+ *
+ * @param map Association map
+ * @param epp Endpoint pair
+ */
 static void amap_remove_laddr(amap_t *map, inet_ep2_t *epp)
 {
@@ -451,4 +618,12 @@
 }
 
+/** Remove endpoint pair using llink as key from map.
+ *
+ * The endpoint pair must be present in the map, otherwise behavior
+ * is unspecified.
+ *
+ * @param map Association map
+ * @param epp Endpoint pair
+ */
 static void amap_remove_llink(amap_t *map, inet_ep2_t *epp)
 {
@@ -468,4 +643,12 @@
 }
 
+/** Remove endpoint pair using unspec as key from map.
+ *
+ * The endpoint pair must be present in the map, otherwise behavior
+ * is unspecified.
+ *
+ * @param map Association map
+ * @param epp Endpoint pair
+ */
 static void amap_remove_unspec(amap_t *map, inet_ep2_t *epp)
 {
@@ -473,4 +656,12 @@
 }
 
+/** Remove endpoint pair from map.
+ *
+ * The endpoint pair must be present in the map, otherwise behavior
+ * is unspecified.
+ *
+ * @param map Association map
+ * @param epp Endpoint pair
+ */
 void amap_remove(amap_t *map, inet_ep2_t *epp)
 {
Index: uspace/lib/nettl/src/portrng.c
===================================================================
--- uspace/lib/nettl/src/portrng.c	(revision fb4d78843307ab5d3e53b65970b01a47bdb9007b)
+++ uspace/lib/nettl/src/portrng.c	(revision b10460aa6a666f2289836624216d445ff03a7816)
@@ -46,4 +46,9 @@
 #include <io/log.h>
 
+/** Create port range.
+ *
+ * @param rpr Place to store pointer to new port range
+ * @return EOK on success, ENOMEM if out of memory
+ */
 int portrng_create(portrng_t **rpr)
 {
@@ -62,4 +67,8 @@
 }
 
+/** Destroy port range.
+ *
+ * @param pr Port range
+ */
 void portrng_destroy(portrng_t *pr)
 {
@@ -69,4 +78,19 @@
 }
 
+/** Allocate port number from port range.
+ *
+ * @param pr    Port range
+ * @param pnum  Port number to allocate specific port, or zero to allocate
+ *              any valid port from range
+ * @param arg   User argument to set for port
+ * @param flags Flags, @c pf_allow_system to allow ports from system range
+ *              to be specified by @a pnum.
+ * @param apnum Place to store allocated port number
+ *
+ * @return EOK on success, ENOENT if no free port number found, EEXISTS
+ *         if @a pnum is specified but it is already allocated,
+ *         EINVAL if @a pnum is specified from the system range, but
+ *         @c pf_allow_system was not set.
+ */
 int portrng_alloc(portrng_t *pr, uint16_t pnum, void *arg,
     portrng_flags_t flags, uint16_t *apnum)
@@ -131,4 +155,12 @@
 }
 
+/** Find allocated port number and return its argument.
+ *
+ * @param pr   Port range
+ * @param pnum Port number
+ * @param rarg Place to store user argument
+ *
+ * @return EOK on success, ENOENT if specified port number is not allocated
+ */
 int portrng_find_port(portrng_t *pr, uint16_t pnum, void **rarg)
 {
@@ -143,4 +175,9 @@
 }
 
+/** Free port in port range.
+ *
+ * @param pr   Port range
+ * @param pnum Port number
+ */
 void portrng_free_port(portrng_t *pr, uint16_t pnum)
 {
@@ -158,4 +195,9 @@
 }
 
+/** Determine if port range is empty.
+ *
+ * @param pr Port range
+ * @return @c true if no ports are allocated from @a pr, @c false otherwise
+ */
 bool portrng_empty(portrng_t *pr)
 {
Index: uspace/srv/net/tcp/service.c
===================================================================
--- uspace/srv/net/tcp/service.c	(revision fb4d78843307ab5d3e53b65970b01a47bdb9007b)
+++ uspace/srv/net/tcp/service.c	(revision b10460aa6a666f2289836624216d445ff03a7816)
@@ -27,5 +27,5 @@
  */
 
-/** @addtogroup udp
+/** @addtogroup tcp
  * @{
  */
@@ -44,4 +44,5 @@
 #include <loc.h>
 #include <macros.h>
+#include <mem.h>
 #include <stdlib.h>
 
@@ -53,4 +54,5 @@
 #define NAME "tcp"
 
+/** Maximum amount of data transferred in one send call */
 #define MAX_MSG_SIZE DATA_XFER_LIMIT
 
@@ -67,4 +69,5 @@
 static int tcp_cconn_create(tcp_client_t *, tcp_conn_t *, tcp_cconn_t **);
 
+/** Connection callbacks to tie us to lower layer */
 static tcp_cb_t tcp_service_cb = {
 	.cstate_change = tcp_service_cstate_change,
@@ -72,4 +75,5 @@
 };
 
+/** Sentinel connection callbacks to tie us to lower layer */
 static tcp_cb_t tcp_service_lst_cb = {
 	.cstate_change = tcp_service_lst_cstate_change,
@@ -77,4 +81,10 @@
 };
 
+/** Connection state has changed.
+ *
+ * @param conn      Connection
+ * @param arg       Argument (not used)
+ * @param old_state Previous connection state
+ */
 static void tcp_service_cstate_change(tcp_conn_t *conn, void *arg,
     tcp_cstate_t old_state)
@@ -108,4 +118,10 @@
 }
 
+/** Sentinel connection state has changed.
+ *
+ * @param conn      Connection
+ * @param arg       Argument (not used)
+ * @param old_state Previous connection state
+ */
 static void tcp_service_lst_cstate_change(tcp_conn_t *conn, void *arg,
     tcp_cstate_t old_state)
@@ -169,4 +185,9 @@
 }
 
+/** Received data became available on connection.
+ *
+ * @param conn Connection
+ * @param arg  Client connection
+ */
 static void tcp_service_recv_data(tcp_conn_t *conn, void *arg)
 {
@@ -176,4 +197,8 @@
 }
 
+/** Send 'data' event to client.
+ *
+ * @param cconn Client connection
+ */
 static void tcp_ev_data(tcp_cconn_t *cconn)
 {
@@ -192,4 +217,8 @@
 }
 
+/** Send 'connected' event to client.
+ *
+ * @param cconn Client connection
+ */
 static void tcp_ev_connected(tcp_cconn_t *cconn)
 {
@@ -205,4 +234,8 @@
 }
 
+/** Send 'conn_failed' event to client.
+ *
+ * @param cconn Client connection
+ */
 static void tcp_ev_conn_failed(tcp_cconn_t *cconn)
 {
@@ -218,4 +251,8 @@
 }
 
+/** Send 'conn_reset' event to client.
+ *
+ * @param cconn Client connection
+ */
 static void tcp_ev_conn_reset(tcp_cconn_t *cconn)
 {
@@ -231,5 +268,9 @@
 }
 
-/** New incoming connection */
+/** Send 'new_conn' event to client.
+ *
+ * @param clst Client listener that received the connection
+ * @param cconn New client connection
+ */
 static void tcp_ev_new_conn(tcp_clst_t *clst, tcp_cconn_t *cconn)
 {
@@ -246,4 +287,14 @@
 }
 
+/** Create client connection.
+ *
+ * This effectively adds a connection into a client's namespace.
+ *
+ * @param client TCP client
+ * @param conn   Connection
+ * @param rcconn Place to store pointer to new client connection
+ *
+ * @return EOK on success or ENOMEM if out of memory
+ */
 static int tcp_cconn_create(tcp_client_t *client, tcp_conn_t *conn,
     tcp_cconn_t **rcconn)
@@ -272,4 +323,8 @@
 }
 
+/** Destroy client connection.
+ *
+ * @param cconn Client connection
+ */
 static void tcp_cconn_destroy(tcp_cconn_t *cconn)
 {
@@ -278,4 +333,15 @@
 }
 
+/** Create client listener.
+ *
+ * Create client listener based on sentinel connection.
+ * XXX Implement actual listener in protocol core
+ *
+ * @param client TCP client
+ * @param conn   Sentinel connection
+ * @param rclst  Place to store pointer to new client listener
+ *
+ * @return EOK on success or ENOMEM if out of memory
+ */
 static int tcp_clistener_create(tcp_client_t *client, tcp_conn_t *conn,
     tcp_clst_t **rclst)
@@ -304,4 +370,8 @@
 }
 
+/** Destroy client listener.
+ *
+ * @param clst Client listener
+ */
 static void tcp_clistener_destroy(tcp_clst_t *clst)
 {
@@ -310,4 +380,13 @@
 }
 
+/** Get client connection by ID.
+ *
+ * @param client Client
+ * @param id     Client connection ID
+ * @param rcconn Place to store pointer to client connection
+ *
+ * @return EOK on success, ENOENT if no client connection with the given ID
+ *         is found.
+ */
 static int tcp_cconn_get(tcp_client_t *client, sysarg_t id,
     tcp_cconn_t **rcconn)
@@ -323,4 +402,13 @@
 }
 
+/** Get client listener by ID.
+ *
+ * @param client Client
+ * @param id     Client connection ID
+ * @param rclst  Place to store pointer to client listener
+ *
+ * @return EOK on success, ENOENT if no client listener with the given ID
+ *         is found.
+ */
 static int tcp_clistener_get(tcp_client_t *client, sysarg_t id,
     tcp_clst_t **rclst)
@@ -336,5 +424,14 @@
 }
 
-
+/** Create connection.
+ *
+ * Handle client request to create connection (with parameters unmarshalled).
+ *
+ * @param client   TCP client
+ * @param epp      Endpoint pair
+ * @param rconn_id Place to store ID of new connection
+ *
+ * @return EOK on success or negative error code
+ */
 static int tcp_conn_create_impl(tcp_client_t *client, inet_ep2_t *epp,
     sysarg_t *rconn_id)
@@ -376,4 +473,12 @@
 }
 
+/** Destroy connection.
+ *
+ * Handle client request to destroy connection (with parameters unmarshalled).
+ *
+ * @param client  TCP client
+ * @param conn_id Connection ID
+ * @return EOK on success, ENOENT if no such connection is found
+ */
 static int tcp_conn_destroy_impl(tcp_client_t *client, sysarg_t conn_id)
 {
@@ -393,4 +498,14 @@
 }
 
+/** Create listener.
+ *
+ * Handle client request to create listener (with parameters unmarshalled).
+ *
+ * @param client  TCP client
+ * @param ep      Endpoint
+ * @param rlst_id Place to store ID of new listener
+ *
+ * @return EOK on success or negative error code
+*/
 static int tcp_listener_create_impl(tcp_client_t *client, inet_ep_t *ep,
     sysarg_t *rlst_id)
@@ -430,4 +545,13 @@
 }
 
+/** Destroy listener.
+ *
+ * Handle client request to destroy listener (with parameters unmarshalled).
+ *
+ * @param client TCP client
+ * @param lst_id Listener ID
+ *
+ * @return EOK on success, ENOENT if no such listener is found
+ */
 static int tcp_listener_destroy_impl(tcp_client_t *client, sysarg_t lst_id)
 {
@@ -446,4 +570,13 @@
 }
 
+/** Send FIN.
+ *
+ * Handle client request to send FIN (with parameters unmarshalled).
+ *
+ * @param client  TCP client
+ * @param conn_id Connection ID
+ *
+ * @return EOK on success or negative error code
+ */
 static int tcp_conn_send_fin_impl(tcp_client_t *client, sysarg_t conn_id)
 {
@@ -462,4 +595,13 @@
 }
 
+/** Push connection.
+ *
+ * Handle client request to push connection (with parameters unmarshalled).
+ *
+ * @param client  TCP client
+ * @param conn_id Connection ID
+ *
+ * @return EOK on success or negative error code
+ */
 static int tcp_conn_push_impl(tcp_client_t *client, sysarg_t conn_id)
 {
@@ -478,4 +620,13 @@
 }
 
+/** Reset connection.
+ *
+ * Handle client request to reset connection (with parameters unmarshalled).
+ *
+ * @param client  TCP client
+ * @param conn_id Connection ID
+ *
+ * @return EOK on success or negative error code
+ */
 static int tcp_conn_reset_impl(tcp_client_t *client, sysarg_t conn_id)
 {
@@ -493,4 +644,15 @@
 }
 
+/** Send data over connection..
+ *
+ * Handle client request to send data (with parameters unmarshalled).
+ *
+ * @param client  TCP client
+ * @param conn_id Connection ID
+ * @param data    Data buffer
+ * @param size    Data size in bytes
+ *
+ * @return EOK on success or negative error code
+ */
 static int tcp_conn_send_impl(tcp_client_t *client, sysarg_t conn_id,
     void *data, size_t size)
@@ -510,4 +672,16 @@
 }
 
+/** Receive data from connection.
+ *
+ * Handle client request to receive data (with parameters unmarshalled).
+ *
+ * @param client  TCP client
+ * @param conn_id Connection ID
+ * @param data    Data buffer
+ * @param size    Buffer size in bytes
+ * @param nrecv   Place to store actual number of bytes received
+ *
+ * @return EOK on success or negative error code
+ */
 static int tcp_conn_recv_impl(tcp_client_t *client, sysarg_t conn_id,
     void *data, size_t size, size_t *nrecv)
@@ -540,4 +714,12 @@
 }
 
+/** Create client callback session.
+ *
+ * Handle client request to create callback session.
+ *
+ * @param client  TCP client
+ * @param iid     Async request ID
+ * @param icall   Async request data
+ */
 static void tcp_callback_create_srv(tcp_client_t *client, ipc_callid_t iid,
     ipc_call_t *icall)
@@ -555,4 +737,12 @@
 }
 
+/** Create connection.
+ *
+ * Handle client request to create connection.
+ *
+ * @param client   TCP client
+ * @param iid      Async request ID
+ * @param icall    Async request data
+ */
 static void tcp_conn_create_srv(tcp_client_t *client, ipc_callid_t iid,
     ipc_call_t *icall)
@@ -594,4 +784,12 @@
 }
 
+/** Destroy connection.
+ *
+ * Handle client request to destroy connection.
+ *
+ * @param client   TCP client
+ * @param iid      Async request ID
+ * @param icall    Async request data
+ */
 static void tcp_conn_destroy_srv(tcp_client_t *client, ipc_callid_t iid,
     ipc_call_t *icall)
@@ -607,4 +805,12 @@
 }
 
+/** Create listener.
+ *
+ * Handle client request to create listener.
+ *
+ * @param client   TCP client
+ * @param iid      Async request ID
+ * @param icall    Async request data
+ */
 static void tcp_listener_create_srv(tcp_client_t *client, ipc_callid_t iid,
     ipc_call_t *icall)
@@ -646,4 +852,12 @@
 }
 
+/** Destroy listener.
+ *
+ * Handle client request to destroy listener.
+ *
+ * @param client   TCP client
+ * @param iid      Async request ID
+ * @param icall    Async request data
+ */
 static void tcp_listener_destroy_srv(tcp_client_t *client, ipc_callid_t iid,
     ipc_call_t *icall)
@@ -659,4 +873,12 @@
 }
 
+/** Send FIN.
+ *
+ * Handle client request to send FIN.
+ *
+ * @param client   TCP client
+ * @param iid      Async request ID
+ * @param icall    Async request data
+ */
 static void tcp_conn_send_fin_srv(tcp_client_t *client, ipc_callid_t iid,
     ipc_call_t *icall)
@@ -672,4 +894,12 @@
 }
 
+/** Push connection.
+ *
+ * Handle client request to push connection.
+ *
+ * @param client   TCP client
+ * @param iid      Async request ID
+ * @param icall    Async request data
+ */
 static void tcp_conn_push_srv(tcp_client_t *client, ipc_callid_t iid,
     ipc_call_t *icall)
@@ -685,4 +915,12 @@
 }
 
+/** Reset connection.
+ *
+ * Handle client request to reset connection.
+ *
+ * @param client   TCP client
+ * @param iid      Async request ID
+ * @param icall    Async request data
+ */
 static void tcp_conn_reset_srv(tcp_client_t *client, ipc_callid_t iid,
     ipc_call_t *icall)
@@ -698,4 +936,12 @@
 }
 
+/** Send data via connection..
+ *
+ * Handle client request to send data via connection.
+ *
+ * @param client   TCP client
+ * @param iid      Async request ID
+ * @param icall    Async request data
+ */
 static void tcp_conn_send_srv(tcp_client_t *client, ipc_callid_t iid,
     ipc_call_t *icall)
@@ -750,4 +996,12 @@
 }
 
+/** Read received data from connection without blocking.
+ *
+ * Handle client request to read received data via connection without blocking.
+ *
+ * @param client   TCP client
+ * @param iid      Async request ID
+ * @param icall    Async request data
+ */
 static void tcp_conn_recv_srv(tcp_client_t *client, ipc_callid_t iid,
     ipc_call_t *icall)
@@ -798,4 +1052,12 @@
 }
 
+/** Read received data from connection with blocking.
+ *
+ * Handle client request to read received data via connection with blocking.
+ *
+ * @param client   TCP client
+ * @param iid      Async request ID
+ * @param icall    Async request data
+ */
 static void tcp_conn_recv_wait_srv(tcp_client_t *client, ipc_callid_t iid,
     ipc_call_t *icall)
@@ -851,6 +1113,8 @@
 }
 
-#include <mem.h>
-
+/** Initialize TCP client structure.
+ *
+ * @param client TCP client
+ */
 static void tcp_client_init(tcp_client_t *client)
 {
@@ -861,4 +1125,8 @@
 }
 
+/** Finalize TCP client structure.
+ *
+ * @param client TCP client
+ */
 static void tcp_client_fini(tcp_client_t *client)
 {
@@ -891,4 +1159,10 @@
 }
 
+/** Handle TCP client connection.
+ *
+ * @param iid   Connect call ID
+ * @param icall Connect call data
+ * @param arg   Connection argument
+ */
 static void tcp_client_conn(ipc_callid_t iid, ipc_call_t *icall, void *arg)
 {
@@ -961,4 +1235,8 @@
 }
 
+/** Initialize TCP service.
+ *
+ * @return EOK on success or negative error code.
+ */
 int tcp_service_init(void)
 {
Index: uspace/srv/net/tcp/tcp_type.h
===================================================================
--- uspace/srv/net/tcp/tcp_type.h	(revision fb4d78843307ab5d3e53b65970b01a47bdb9007b)
+++ uspace/srv/net/tcp/tcp_type.h	(revision b10460aa6a666f2289836624216d445ff03a7816)
@@ -47,4 +47,5 @@
 struct tcp_conn;
 
+/** Connection state */
 typedef enum {
 	/** Listen */
@@ -101,4 +102,5 @@
 } tcp_error_t;
 
+/** Transfer flags */
 typedef enum {
 	XF_PUSH		= 0x1,
@@ -106,4 +108,8 @@
 } xflags_t;
 
+/** Control message bits
+ *
+ * Note this is not the actual on-the-wire encoding
+ */
 typedef enum {
 	CTL_SYN		= 0x1,
@@ -128,4 +134,5 @@
 } tcp_tqueue_t;
 
+/** Active or passive connection */
 typedef enum {
 	ap_active,
@@ -133,4 +140,5 @@
 } acpass_t;
 
+/** Flags for TCP open operation */
 typedef enum {
 	tcp_open_nonblock = 1
@@ -264,5 +272,5 @@
 } tcp_segment_t;
 
-
+/** Receive queue entry */
 typedef struct {
 	link_t link;
@@ -279,4 +287,5 @@
 } tcp_squeue_entry_t;
 
+/** Incoming queue entry */
 typedef struct {
 	link_t link;
@@ -291,4 +300,9 @@
 } tcp_tqueue_entry_t;
 
+/** Continuation of processing.
+ *
+ * When processing incoming segment, are we done or should we continue
+ * processing it?
+ */
 typedef enum {
 	cp_continue,
Index: uspace/srv/net/udp/service.c
===================================================================
--- uspace/srv/net/udp/service.c	(revision fb4d78843307ab5d3e53b65970b01a47bdb9007b)
+++ uspace/srv/net/udp/service.c	(revision b10460aa6a666f2289836624216d445ff03a7816)
@@ -52,12 +52,22 @@
 #define NAME "udp"
 
+/** Maximum message size */
 #define MAX_MSG_SIZE DATA_XFER_LIMIT
 
 static void udp_cassoc_recv_msg(void *, inet_ep2_t *, udp_msg_t *);
 
+/** Callbacks to tie us to association layer */
 static udp_assoc_cb_t udp_cassoc_cb = {
 	.recv_msg = udp_cassoc_recv_msg
 };
 
+/** Add message to client receive queue.
+ *
+ * @param cassoc Client association
+ * @param epp    Endpoint pair on which message was received
+ * @param msg    Message
+ *
+ * @return EOK on success, ENOMEM if out of memory
+ */
 static int udp_cassoc_queue_msg(udp_cassoc_t *cassoc, inet_ep2_t *epp,
     udp_msg_t *msg)
@@ -86,4 +96,8 @@
 }
 
+/** Send 'data' event to client.
+ *
+ * @param client Client
+ */
 static void udp_ev_data(udp_client_t *client)
 {
@@ -99,4 +113,14 @@
 }
 
+/** Create client association.
+ *
+ * This effectively adds an association into a client's namespace.
+ *
+ * @param client  Client
+ * @param assoc   Association
+ * @param rcassoc Place to store pointer to new client association
+ *
+ * @return EOK on soccess, ENOMEM if out of memory
+ */
 static int udp_cassoc_create(udp_client_t *client, udp_assoc_t *assoc,
     udp_cassoc_t **rcassoc)
@@ -125,4 +149,8 @@
 }
 
+/** Destroy client association.
+ *
+ * @param cassoc Client association
+ */
 static void udp_cassoc_destroy(udp_cassoc_t *cassoc)
 {
@@ -131,4 +159,13 @@
 }
 
+/** Get client association by ID.
+ *
+ * @param client  Client
+ * @param id      Client association ID
+ * @param rcassoc Place to store pointer to client association
+ *
+ * @return EOK on success, ENOENT if no client association with the given ID
+ *         is found.
+ */
 static int udp_cassoc_get(udp_client_t *client, sysarg_t id,
     udp_cassoc_t **rcassoc)
@@ -144,4 +181,12 @@
 }
 
+/** Message received on client association.
+ *
+ * Used as udp_assoc_cb.recv_msg callback.
+ *
+ * @param arg Callback argument, client association
+ * @param epp Endpoint pair where message was received
+ * @param msg Message
+ */
 static void udp_cassoc_recv_msg(void *arg, inet_ep2_t *epp, udp_msg_t *msg)
 {
@@ -152,4 +197,14 @@
 }
 
+/** Create association.
+ *
+ * Handle client request to create association (with parameters unmarshalled).
+ *
+ * @param client    UDP client
+ * @param epp       Endpoint pair
+ * @param rassoc_id Place to store ID of new association
+ *
+ * @return EOK on success or negative error code
+ */
 static int udp_assoc_create_impl(udp_client_t *client, inet_ep2_t *epp,
     sysarg_t *rassoc_id)
@@ -189,4 +244,12 @@
 }
 
+/** Destroy association.
+ *
+ * Handle client request to destroy association (with parameters unmarshalled).
+ *
+ * @param client   UDP client
+ * @param assoc_id Association ID
+ * @return EOK on success, ENOENT if no such association is found
+ */
 static int udp_assoc_destroy_impl(udp_client_t *client, sysarg_t assoc_id)
 {
@@ -207,4 +270,17 @@
 }
 
+/** Send message via association.
+ *
+ * Handle client request to send message (with parameters unmarshalled).
+ *
+ * @param client   UDP client
+ * @param assoc_id Association ID
+ * @param dest     Destination endpoint or @c NULL to use the default from
+ *                 association
+ * @param data     Message data
+ * @param size     Message size
+ *
+ * @return EOK on success or negative error code
+ */
 static int udp_assoc_send_msg_impl(udp_client_t *client, sysarg_t assoc_id,
     inet_ep_t *dest, void *data, size_t size)
@@ -227,4 +303,12 @@
 }
 
+/** Create callback session.
+ *
+ * Handle client request to create callback session.
+ *
+ * @param client   UDP client
+ * @param iid      Async request ID
+ * @param icall    Async request data
+ */
 static void udp_callback_create_srv(udp_client_t *client, ipc_callid_t iid,
     ipc_call_t *icall)
@@ -242,4 +326,12 @@
 }
 
+/** Create association.
+ *
+ * Handle client request to create association.
+ *
+ * @param client   UDP client
+ * @param iid      Async request ID
+ * @param icall    Async request data
+ */
 static void udp_assoc_create_srv(udp_client_t *client, ipc_callid_t iid,
     ipc_call_t *icall)
@@ -281,4 +373,12 @@
 }
 
+/** Destroy association.
+ *
+ * Handle client request to destroy association.
+ *
+ * @param client   UDP client
+ * @param iid      Async request ID
+ * @param icall    Async request data
+ */
 static void udp_assoc_destroy_srv(udp_client_t *client, ipc_callid_t iid,
     ipc_call_t *icall)
@@ -294,4 +394,12 @@
 }
 
+/** Send message via association.
+ *
+ * Handle client request to send message.
+ *
+ * @param client   UDP client
+ * @param iid      Async request ID
+ * @param icall    Async request data
+ */
 static void udp_assoc_send_msg_srv(udp_client_t *client, ipc_callid_t iid,
     ipc_call_t *icall)
@@ -368,4 +476,9 @@
 }
 
+/** Get next received message.
+ *
+ * @param client UDP Client
+ * @return Pointer to queue entry for next received message
+ */
 static udp_crcv_queue_entry_t *udp_rmsg_get_next(udp_client_t *client)
 {
@@ -379,4 +492,12 @@
 }
 
+/** Get info on first received message.
+ *
+ * Handle client request to get information on received message.
+ *
+ * @param client   UDP client
+ * @param iid      Async request ID
+ * @param icall    Async request data
+ */
 static void udp_rmsg_info_srv(udp_client_t *client, ipc_callid_t iid,
     ipc_call_t *icall)
@@ -418,4 +539,12 @@
 }
 
+/** Read data from first received message.
+ *
+ * Handle client request to read data from first received message.
+ *
+ * @param client   UDP client
+ * @param iid      Async request ID
+ * @param icall    Async request data
+ */
 static void udp_rmsg_read_srv(udp_client_t *client, ipc_callid_t iid,
     ipc_call_t *icall)
@@ -460,4 +589,13 @@
 }
 
+/** Discard first received message.
+ *
+ * Handle client request to discard first received message, advancing
+ * to the next one.
+ *
+ * @param client   UDP client
+ * @param iid      Async request ID
+ * @param icall    Async request data
+ */
 static void udp_rmsg_discard_srv(udp_client_t *client, ipc_callid_t iid,
     ipc_call_t *icall)
@@ -480,4 +618,10 @@
 }
 
+/** Handle UDP client connection.
+ *
+ * @param iid   Connect call ID
+ * @param icall Connect call data
+ * @param arg   Connection argument
+ */
 static void udp_client_conn(ipc_callid_t iid, ipc_call_t *icall, void *arg)
 {
@@ -551,4 +695,8 @@
 }
 
+/** Initialize UDP service.
+ *
+ * @return EOK on success or negative error code.
+ */
 int udp_service_init(void)
 {
Index: uspace/srv/net/udp/udp_type.h
===================================================================
--- uspace/srv/net/udp/udp_type.h	(revision fb4d78843307ab5d3e53b65970b01a47bdb9007b)
+++ uspace/srv/net/udp/udp_type.h	(revision b10460aa6a666f2289836624216d445ff03a7816)
@@ -46,4 +46,5 @@
 #define UDP_FRAGMENT_SIZE 65535
 
+/** UDP error codes */
 typedef enum {
 	UDP_EOK,
@@ -84,5 +85,7 @@
 } udp_pdu_t;
 
+/** Association callbacks */
 typedef struct {
+	/** Message received */
 	void (*recv_msg)(void *, inet_ep2_t *, udp_msg_t *);
 } udp_assoc_cb_t;
@@ -124,4 +127,5 @@
 } udp_assoc_status_t;
 
+/** UDP receive queue entry */
 typedef struct {
 	/** Link to receive queue */
@@ -133,4 +137,8 @@
 } udp_rcv_queue_entry_t;
 
+/** UDP client association.
+ *
+ * Ties a UDP association into the namespace of a client
+ */
 typedef struct udp_cassoc {
 	/** Association */
@@ -143,4 +151,5 @@
 } udp_cassoc_t;
 
+/** UDP client receive queue entry */
 typedef struct {
 	/** Link to receive queue */
@@ -154,4 +163,5 @@
 } udp_crcv_queue_entry_t;
 
+/** UDP client */
 typedef struct udp_client {
 	/** Client callback session */
