Index: uspace/srv/net/nil/eth/eth.c
===================================================================
--- uspace/srv/net/nil/eth/eth.c	(revision 46d4d9f449e7933280b1877c70448602ec0ab0ae)
+++ uspace/srv/net/nil/eth/eth.c	(revision fb04cba8d949f8b13de326b3aefd058316d54046)
@@ -156,4 +156,9 @@
 typedef enum eth_addr_type eth_addr_type_t;
 
+/** Type definition of the ethernet address type pointer.
+ * @see eth_addr_type
+ */
+typedef eth_addr_type_t *eth_addr_type_ref;
+
 /** Ethernet address type. */
 enum eth_addr_type {
@@ -173,5 +178,5 @@
 {
 	int index;
-	eth_proto_t *proto;
+	eth_proto_ref proto;
 
 	fibril_rwlock_read_lock(&eth_globals.protos_lock);
@@ -234,5 +239,5 @@
 static void eth_receiver(ipc_callid_t iid, ipc_call_t *icall)
 {
-	packet_t *packet;
+	packet_t packet;
 	int rc;
 
@@ -268,12 +273,12 @@
  * @param[in] service	The device driver service.
  * @param[in] mtu	The device maximum transmission unit.
- * @return		EOK on success.
- * @return		EEXIST if the device with the different service exists.
- * @return		ENOMEM if there is not enough memory left.
- * @return		Other error codes as defined for the
+ * @returns		EOK on success.
+ * @returns		EEXIST if the device with the different service exists.
+ * @returns		ENOMEM if there is not enough memory left.
+ * @returns		Other error codes as defined for the
  *			net_get_device_conf_req() function.
- * @return		Other error codes as defined for the
+ * @returns		Other error codes as defined for the
  *			netif_bind_service() function.
- * @return		Other error codes as defined for the
+ * @returns		Other error codes as defined for the
  *			netif_get_addr_req() function.
  */
@@ -281,5 +286,5 @@
     size_t mtu)
 {
-	eth_device_t *device;
+	eth_device_ref device;
 	int index;
 	measured_string_t names[2] = {
@@ -293,8 +298,8 @@
 		}
 	};
-	measured_string_t *configuration;
+	measured_string_ref configuration;
 	size_t count = sizeof(names) / sizeof(measured_string_t);
 	char *data;
-	eth_proto_t *proto;
+	eth_proto_ref proto;
 	int rc;
 
@@ -337,5 +342,5 @@
 	
 	/* Create a new device */
-	device = (eth_device_t *) malloc(sizeof(eth_device_t));
+	device = (eth_device_ref) malloc(sizeof(eth_device_t));
 	if (!device)
 		return ENOMEM;
@@ -422,19 +427,19 @@
  * @param[in] flags	The device flags.
  * @param[in] packet	The packet.
- * @return		The target registered module.
- * @return		NULL if the packet is not long enough.
- * @return		NULL if the packet is too long.
- * @return		NULL if the raw ethernet protocol is used.
- * @return		NULL if the dummy device FCS checksum is invalid.
- * @return		NULL if the packet address length is not big enough.
- */
-static eth_proto_t *eth_process_packet(int flags, packet_t *packet)
-{
-	eth_header_snap_t *header;
+ * @returns		The target registered module.
+ * @returns		NULL if the packet is not long enough.
+ * @returns		NULL if the packet is too long.
+ * @returns		NULL if the raw ethernet protocol is used.
+ * @returns		NULL if the dummy device FCS checksum is invalid.
+ * @returns		NULL if the packet address length is not big enough.
+ */
+static eth_proto_ref eth_process_packet(int flags, packet_t packet)
+{
+	eth_header_snap_ref header;
 	size_t length;
 	eth_type_t type;
 	size_t prefix;
 	size_t suffix;
-	eth_fcs_t *fcs;
+	eth_fcs_ref fcs;
 	uint8_t *data;
 	int rc;
@@ -449,5 +454,5 @@
 	
 	data = packet_get_data(packet);
-	header = (eth_header_snap_t *) data;
+	header = (eth_header_snap_ref) data;
 	type = ntohs(header->header.ethertype);
 	
@@ -456,5 +461,5 @@
 		prefix = sizeof(eth_header_t);
 		suffix = 0;
-		fcs = (eth_fcs_t *) data + length - sizeof(eth_fcs_t);
+		fcs = (eth_fcs_ref) data + length - sizeof(eth_fcs_t);
 		length -= sizeof(eth_fcs_t);
 	} else if(type <= ETH_MAX_CONTENT) {
@@ -482,5 +487,5 @@
 
 		suffix = (type < ETH_MIN_CONTENT) ? ETH_MIN_CONTENT - type : 0U;
-		fcs = (eth_fcs_t *) data + prefix + type + suffix;
+		fcs = (eth_fcs_ref) data + prefix + type + suffix;
 		suffix += length - prefix - type;
 		length = prefix + type + suffix;
@@ -509,9 +514,9 @@
 
 int nil_received_msg_local(int nil_phone, device_id_t device_id,
-    packet_t *packet, services_t target)
-{
-	eth_proto_t *proto;
-	packet_t *next;
-	eth_device_t *device;
+    packet_t packet, services_t target)
+{
+	eth_proto_ref proto;
+	packet_t next;
+	eth_device_ref device;
 	int flags;
 
@@ -552,12 +557,12 @@
  * @param[out] content	The maximum content size.
  * @param[out] suffix	The minimum reserved suffix size.
- * @return		EOK on success.
- * @return		EBADMEM if either one of the parameters is NULL.
- * @return		ENOENT if there is no such device.
+ * @returns		EOK on success.
+ * @returns		EBADMEM if either one of the parameters is NULL.
+ * @returns		ENOENT if there is no such device.
  */
 static int eth_packet_space_message(device_id_t device_id, size_t *addr_len,
     size_t *prefix, size_t *content, size_t *suffix)
 {
-	eth_device_t *device;
+	eth_device_ref device;
 
 	if (!addr_len || !prefix || !content || !suffix)
@@ -586,12 +591,12 @@
  * @param[in] type	Type of the desired address.
  * @param[out] address	The device hardware address.
- * @return		EOK on success.
- * @return		EBADMEM if the address parameter is NULL.
- * @return		ENOENT if there no such device.
+ * @returns		EOK on success.
+ * @returns		EBADMEM if the address parameter is NULL.
+ * @returns		ENOENT if there no such device.
  */
 static int eth_addr_message(device_id_t device_id, eth_addr_type_t type,
-    measured_string_t **address)
-{
-	eth_device_t *device;
+    measured_string_ref *address)
+{
+	eth_device_ref device;
 
 	if (!address)
@@ -620,11 +625,11 @@
  * @param[in] service	The module service.
  * @param[in] phone	The service phone.
- * @return		EOK on success.
- * @return		ENOENT if the service is not known.
- * @return		ENOMEM if there is not enough memory left.
+ * @returns		EOK on success.
+ * @returns		ENOENT if the service is not known.
+ * @returns		ENOMEM if there is not enough memory left.
  */
 static int eth_register_message(services_t service, int phone)
 {
-	eth_proto_t *proto;
+	eth_proto_ref proto;
 	int protocol;
 	int index;
@@ -641,5 +646,5 @@
 		return EOK;
 	} else {
-		proto = (eth_proto_t *) malloc(sizeof(eth_proto_t));
+		proto = (eth_proto_ref) malloc(sizeof(eth_proto_t));
 		if (!proto) {
 			fibril_rwlock_write_unlock(&eth_globals.protos_lock);
@@ -673,18 +678,18 @@
  * @param[in] ethertype	The ethernet protocol type.
  * @param[in] mtu	The device maximum transmission unit.
- * @return		EOK on success.
- * @return		EINVAL if the packet addresses length is not long
+ * @returns		EOK on success.
+ * @returns		EINVAL if the packet addresses length is not long
  *			enough.
- * @return		EINVAL if the packet is bigger than the device MTU.
- * @return		ENOMEM if there is not enough memory in the packet.
+ * @returns		EINVAL if the packet is bigger than the device MTU.
+ * @returns		ENOMEM if there is not enough memory in the packet.
  */
 static int
-eth_prepare_packet(int flags, packet_t *packet, uint8_t *src_addr, int ethertype,
+eth_prepare_packet(int flags, packet_t packet, uint8_t *src_addr, int ethertype,
     size_t mtu)
 {
-	eth_header_snap_t *header;
-	eth_header_lsap_t *header_lsap;
-	eth_header_t *header_dix;
-	eth_fcs_t *fcs;
+	eth_header_snap_ref header;
+	eth_header_lsap_ref header_lsap;
+	eth_header_ref header_dix;
+	eth_fcs_ref fcs;
 	uint8_t *src;
 	uint8_t *dest;
@@ -692,5 +697,5 @@
 	int i;
 	void *padding;
-	eth_preamble_t *preamble;
+	eth_preamble_ref preamble;
 
 	i = packet_get_addr(packet, &src, &dest);
@@ -783,14 +788,14 @@
  * @param[in] packet	The packet queue.
  * @param[in] sender	The sending module service.
- * @return		EOK on success.
- * @return		ENOENT if there no such device.
- * @return		EINVAL if the service parameter is not known.
- */
-static int eth_send_message(device_id_t device_id, packet_t *packet,
+ * @returns		EOK on success.
+ * @returns		ENOENT if there no such device.
+ * @returns		EINVAL if the service parameter is not known.
+ */
+static int eth_send_message(device_id_t device_id, packet_t packet,
     services_t sender)
 {
-	eth_device_t *device;
-	packet_t *next;
-	packet_t *tmp;
+	eth_device_ref device;
+	packet_t next;
+	packet_t tmp;
 	int ethertype;
 	int rc;
@@ -840,6 +845,6 @@
     ipc_call_t *call, ipc_call_t *answer, int *answer_count)
 {
-	measured_string_t *address;
-	packet_t *packet;
+	measured_string_ref address;
+	packet_t packet;
 	size_t addrlen;
 	size_t prefix;
