Index: uspace/srv/net/il/arp/arp.c
===================================================================
--- uspace/srv/net/il/arp/arp.c	(revision 0a3fbc7aaeecfe45b26ba44ae62268c82c8e623d)
+++ uspace/srv/net/il/arp/arp.c	(revision e9caf4779c4818e0894f8ea2cb6815ec2e723d8f)
@@ -28,11 +28,16 @@
 
 /** @addtogroup arp
- *  @{
+ * @{
  */
 
 /** @file
- *  ARP module implementation.
- *  @see arp.h
- */
+ * ARP module implementation.
+ * @see arp.h
+ */
+
+#include "arp.h"
+#include "arp_header.h"
+#include "arp_oc.h"
+#include "arp_module.h"
 
 #include <async.h>
@@ -43,4 +48,5 @@
 #include <str.h>
 #include <task.h>
+#include <adt/measured_strings.h>
 #include <ipc/ipc.h>
 #include <ipc/services.h>
@@ -53,9 +59,8 @@
 #include <net/modules.h>
 #include <net/device.h>
-#include <arp_interface.h>
+#include <net/packet.h>
+
 #include <nil_interface.h>
 #include <protocol_map.h>
-#include <adt/measured_strings.h>
-#include <net/packet.h>
 #include <packet_client.h>
 #include <packet_remote.h>
@@ -63,109 +68,53 @@
 #include <il_local.h>
 
-#include "arp.h"
-#include "arp_header.h"
-#include "arp_oc.h"
-#include "arp_module.h"
-
-
-/** ARP module name.
- */
+
+/** ARP module name. */
 #define NAME  "arp"
 
-/** ARP global data.
- */
-arp_globals_t	arp_globals;
+/** ARP global data. */
+arp_globals_t arp_globals;
+
+DEVICE_MAP_IMPLEMENT(arp_cache, arp_device_t);
+INT_MAP_IMPLEMENT(arp_protos, arp_proto_t);
+GENERIC_CHAR_MAP_IMPLEMENT(arp_addr, measured_string_t);
 
 /** Clears the device specific data.
- *  @param[in] device The device specific data.
- */
-void arp_clear_device(arp_device_ref device);
-
-/** Creates new protocol specific data.
- *  Allocates and returns the needed memory block as the proto parameter.
- *  @param[out] proto The allocated protocol specific data.
- *  @param[in] service The protocol module service.
- *  @param[in] address The actual protocol device address.
- *  @returns EOK on success.
- *  @returns ENOMEM if there is not enough memory left.
- */
-int arp_proto_create(arp_proto_ref * proto, services_t service, measured_string_ref address);
-
-/** @name Message processing functions
- */
-/*@{*/
-
-/** Registers the device.
- *  Creates new device entry in the cache or updates the protocol address if the device with the device identifier and the driver service exists.
- *  @param[in] device_id The device identifier.
- *  @param[in] service The device driver service.
- *  @param[in] protocol The protocol service.
- *  @param[in] address The actual device protocol address.
- *  @returns EOK on success.
- *  @returns EEXIST if another device with the same device identifier and different driver service exists.
- *  @returns ENOMEM if there is not enough memory left.
- *  @returns Other error codes as defined for the measured_strings_return() function.
- */
-int arp_device_message(device_id_t device_id, services_t service, services_t protocol, measured_string_ref address);
-
-/** Updates the device content length according to the new MTU value.
- *  @param[in] device_id The device identifier.
- *  @param[in] mtu The new mtu value.
- *  @returns ENOENT if device is not found.
- *  @returns EOK on success.
- */
-int arp_mtu_changed_message(device_id_t device_id, size_t mtu);
-
-/** Processes the received ARP packet.
- *  Updates the source hardware address if the source entry exists or the packet is targeted to my protocol address.
- *  Responses to the ARP request if the packet is the ARP request and is targeted to my address.
- *  @param[in] device_id The source device identifier.
- *  @param[in,out] packet The received packet.
- *  @returns EOK on success and the packet is no longer needed.
- *  @returns 1 on success and the packet has been reused.
- *  @returns EINVAL if the packet is too small to carry an ARP packet.
- *  @returns EINVAL if the received address lengths differs from the registered values.
- *  @returns ENOENT if the device is not found in the cache.
- *  @returns ENOENT if the protocol for the device is not found in the cache.
- *  @returns ENOMEM if there is not enough memory left.
- */
-int arp_receive_message(device_id_t device_id, packet_t packet);
-
-/** Returns the hardware address for the given protocol address.
- *  Sends the ARP request packet if the hardware address is not found in the cache.
- *  @param[in] device_id The device identifier.
- *  @param[in] protocol The protocol service.
- *  @param[in] target The target protocol address.
- *  @returns The hardware address of the target.
- *  @returns NULL if the target parameter is NULL.
- *  @returns NULL if the device is not found.
- *  @returns NULL if the device packet is too small to send a&nbsp;request.
- *  @returns NULL if the hardware address is not found in the cache.
- */
-measured_string_ref arp_translate_message(device_id_t device_id, services_t protocol, measured_string_ref target);
-
-/*@}*/
-
-DEVICE_MAP_IMPLEMENT(arp_cache, arp_device_t)
-
-INT_MAP_IMPLEMENT(arp_protos, arp_proto_t)
-
-GENERIC_CHAR_MAP_IMPLEMENT(arp_addr, measured_string_t)
-
-int arp_clean_cache_req(int arp_phone){
+ *
+ * @param[in] device	The device specific data.
+ */
+static void arp_clear_device(arp_device_ref device)
+{
+	int count;
+	arp_proto_ref proto;
+
+	for (count = arp_protos_count(&device->protos) - 1; count >= 0;
+	    count--) {
+		proto = arp_protos_get_index(&device->protos, count);
+		if (proto) {
+			if (proto->addr)
+				free(proto->addr);
+			if (proto->addr_data)
+				free(proto->addr_data);
+			arp_addr_destroy(&proto->addresses);
+		}
+	}
+	arp_protos_clear(&device->protos);
+}
+
+static int arp_clean_cache_req(int arp_phone)
+{
 	int count;
 	arp_device_ref device;
 
 	fibril_rwlock_write_lock(&arp_globals.lock);
-	for(count = arp_cache_count(&arp_globals.cache) - 1; count >= 0; -- count){
+	for (count = arp_cache_count(&arp_globals.cache) - 1; count >= 0;
+	    count--) {
 		device = arp_cache_get_index(&arp_globals.cache, count);
-		if(device){
+		if (device) {
 			arp_clear_device(device);
-			if(device->addr_data){
+			if (device->addr_data)
 				free(device->addr_data);
-			}
-			if(device->broadcast_data){
+			if (device->broadcast_data)
 				free(device->broadcast_data);
-			}
 		}
 	}
@@ -176,5 +125,8 @@
 }
 
-int arp_clear_address_req(int arp_phone, device_id_t device_id, services_t protocol, measured_string_ref address){
+static int
+arp_clear_address_req(int arp_phone, device_id_t device_id, services_t protocol,
+    measured_string_ref address)
+{
 	arp_device_ref device;
 	arp_proto_ref proto;
@@ -182,10 +134,10 @@
 	fibril_rwlock_write_lock(&arp_globals.lock);
 	device = arp_cache_find(&arp_globals.cache, device_id);
-	if(! device){
+	if (!device) {
 		fibril_rwlock_write_unlock(&arp_globals.lock);
 		return ENOENT;
 	}
 	proto = arp_protos_find(&device->protos, protocol);
-	if(! proto){
+	if (!proto) {
 		fibril_rwlock_write_unlock(&arp_globals.lock);
 		return ENOENT;
@@ -196,29 +148,12 @@
 }
 
-void arp_clear_device(arp_device_ref device){
-	int count;
-	arp_proto_ref proto;
-
-	for(count = arp_protos_count(&device->protos) - 1; count >= 0; -- count){
-		proto = arp_protos_get_index(&device->protos, count);
-		if(proto){
-			if(proto->addr){
-				free(proto->addr);
-			}
-			if(proto->addr_data){
-				free(proto->addr_data);
-			}
-			arp_addr_destroy(&proto->addresses);
-		}
-	}
-	arp_protos_clear(&device->protos);
-}
-
-int arp_clear_device_req(int arp_phone, device_id_t device_id){
+
+static int arp_clear_device_req(int arp_phone, device_id_t device_id)
+{
 	arp_device_ref device;
 
 	fibril_rwlock_write_lock(&arp_globals.lock);
 	device = arp_cache_find(&arp_globals.cache, device_id);
-	if(! device){
+	if (!device) {
 		fibril_rwlock_write_unlock(&arp_globals.lock);
 		return ENOENT;
@@ -230,5 +165,53 @@
 }
 
-int arp_device_message(device_id_t device_id, services_t service, services_t protocol, measured_string_ref address){
+/** Creates new protocol specific data.
+ *
+ * Allocates and returns the needed memory block as the proto parameter.
+ *
+ * @param[out] proto	The allocated protocol specific data.
+ * @param[in] service	The protocol module service.
+ * @param[in] address	The actual protocol device address.
+ * @returns		EOK on success.
+ * @returns		ENOMEM if there is not enough memory left.
+ */
+static int
+arp_proto_create(arp_proto_ref *proto, services_t service,
+    measured_string_ref address)
+{
+	ERROR_DECLARE;
+
+	*proto = (arp_proto_ref) malloc(sizeof(arp_proto_t));
+	if (!*proto)
+		return ENOMEM;
+	(*proto)->service = service;
+	(*proto)->addr = address;
+	(*proto)->addr_data = address->value;
+	if (ERROR_OCCURRED(arp_addr_initialize(&(*proto)->addresses))) {
+		free(*proto);
+		return ERROR_CODE;
+	}
+	return EOK;
+}
+
+/** Registers the device.
+ *
+ * Creates new device entry in the cache or updates the protocol address if the
+ * device with the device identifier and the driver service exists.
+ *
+ * @param[in] device_id	The device identifier.
+ * @param[in] service	The device driver service.
+ * @param[in] protocol	The protocol service.
+ * @param[in] address	The actual device protocol address.
+ * @returns		EOK on success.
+ * @returns		EEXIST if another device with the same device identifier
+ *			and different driver service exists.
+ * @returns		ENOMEM if there is not enough memory left.
+ * @returns		Other error codes as defined for the
+ *			measured_strings_return() function.
+ */
+static int
+arp_device_message(device_id_t device_id, services_t service,
+    services_t protocol, measured_string_ref address)
+{
 	ERROR_DECLARE;
 
@@ -241,6 +224,6 @@
 	// an existing device?
 	device = arp_cache_find(&arp_globals.cache, device_id);
-	if(device){
-		if(device->service != service){
+	if (device) {
+		if (device->service != service) {
 			printf("Device %d already exists\n", device->device_id);
 			fibril_rwlock_write_unlock(&arp_globals.lock);
@@ -248,30 +231,33 @@
 		}
 		proto = arp_protos_find(&device->protos, protocol);
-		if(proto){
+		if (proto) {
 			free(proto->addr);
 			free(proto->addr_data);
 			proto->addr = address;
 			proto->addr_data = address->value;
-		}else{
-			if(ERROR_OCCURRED(arp_proto_create(&proto, protocol, address))){
+		} else {
+			if (ERROR_OCCURRED(arp_proto_create(&proto, protocol,
+			    address))) {
 				fibril_rwlock_write_unlock(&arp_globals.lock);
 				return ERROR_CODE;
 			}
-			index = arp_protos_add(&device->protos, proto->service, proto);
-			if(index < 0){
+			index = arp_protos_add(&device->protos, proto->service,
+			    proto);
+			if (index < 0) {
 				fibril_rwlock_write_unlock(&arp_globals.lock);
 				free(proto);
 				return index;
 			}
-			printf("New protocol added:\n\tdevice id\t= %d\n\tproto\t= %d", device_id, protocol);
-		}
-	}else{
+			printf("New protocol added:\n\tdevice id\t= "
+			    "%d\n\tproto\t= %d", device_id, protocol);
+		}
+	} else {
 		hardware = hardware_map(service);
-		if(! hardware){
+		if (!hardware)
 			return ENOENT;
-		}
+		
 		// create a new device
 		device = (arp_device_ref) malloc(sizeof(arp_device_t));
-		if(! device){
+		if (!device) {
 			fibril_rwlock_write_unlock(&arp_globals.lock);
 			return ENOMEM;
@@ -279,6 +265,7 @@
 		device->hardware = hardware;
 		device->device_id = device_id;
-		if(ERROR_OCCURRED(arp_protos_initialize(&device->protos))
-			|| ERROR_OCCURRED(arp_proto_create(&proto, protocol, address))){
+		if (ERROR_OCCURRED(arp_protos_initialize(&device->protos)) ||
+		    ERROR_OCCURRED(arp_proto_create(&proto, protocol,
+		    address))) {
 			fibril_rwlock_write_unlock(&arp_globals.lock);
 			free(device);
@@ -286,5 +273,5 @@
 		}
 		index = arp_protos_add(&device->protos, proto->service, proto);
-		if(index < 0){
+		if (index < 0) {
 			fibril_rwlock_write_unlock(&arp_globals.lock);
 			arp_protos_destroy(&device->protos);
@@ -293,7 +280,10 @@
 		}
 		device->service = service;
+		
 		// bind the new one
-		device->phone = nil_bind_service(device->service, (ipcarg_t) device->device_id, SERVICE_ARP, arp_globals.client_connection);
-		if(device->phone < 0){
+		device->phone = nil_bind_service(device->service,
+		    (ipcarg_t) device->device_id, SERVICE_ARP,
+		    arp_globals.client_connection);
+		if (device->phone < 0) {
 			fibril_rwlock_write_unlock(&arp_globals.lock);
 			arp_protos_destroy(&device->protos);
@@ -301,6 +291,8 @@
 			return EREFUSED;
 		}
+		
 		// get packet dimensions
-		if(ERROR_OCCURRED(nil_packet_size_req(device->phone, device_id, &device->packet_dimension))){
+		if (ERROR_OCCURRED(nil_packet_size_req(device->phone, device_id,
+		    &device->packet_dimension))) {
 			fibril_rwlock_write_unlock(&arp_globals.lock);
 			arp_protos_destroy(&device->protos);
@@ -308,6 +300,8 @@
 			return ERROR_CODE;
 		}
+		
 		// get hardware address
-		if(ERROR_OCCURRED(nil_get_addr_req(device->phone, device_id, &device->addr, &device->addr_data))){
+		if (ERROR_OCCURRED(nil_get_addr_req(device->phone, device_id,
+		    &device->addr, &device->addr_data))) {
 			fibril_rwlock_write_unlock(&arp_globals.lock);
 			arp_protos_destroy(&device->protos);
@@ -315,6 +309,9 @@
 			return ERROR_CODE;
 		}
+		
 		// get broadcast address
-		if(ERROR_OCCURRED(nil_get_broadcast_addr_req(device->phone, device_id, &device->broadcast_addr, &device->broadcast_data))){
+		if (ERROR_OCCURRED(nil_get_broadcast_addr_req(device->phone,
+		    device_id, &device->broadcast_addr,
+		    &device->broadcast_data))) {
 			fibril_rwlock_write_unlock(&arp_globals.lock);
 			free(device->addr);
@@ -324,5 +321,7 @@
 			return ERROR_CODE;
 		}
-		if(ERROR_OCCURRED(arp_cache_add(&arp_globals.cache, device->device_id, device))){
+		
+		if (ERROR_OCCURRED(arp_cache_add(&arp_globals.cache,
+		    device->device_id, device))) {
 			fibril_rwlock_write_unlock(&arp_globals.lock);
 			free(device->addr);
@@ -334,26 +333,22 @@
 			return ERROR_CODE;
 		}
-		printf("%s: Device registered (id: %d, type: 0x%x, service: %d, proto: %d)\n",
-		    NAME, device->device_id, device->hardware, device->service, protocol);
+		printf("%s: Device registered (id: %d, type: 0x%x, service: %d,"
+		    " proto: %d)\n", NAME, device->device_id, device->hardware,
+		    device->service, protocol);
 	}
 	fibril_rwlock_write_unlock(&arp_globals.lock);
-	return EOK;
-}
-
-int arp_device_req(int arp_phone, device_id_t device_id, services_t protocol, services_t netif, measured_string_ref address){
-	ERROR_DECLARE;
-
-	measured_string_ref tmp;
-
-	// copy the given address for exclusive use
-	tmp = measured_string_copy(address);
-	if(ERROR_OCCURRED(arp_device_message(device_id, netif, protocol, tmp))){
-		free(tmp->value);
-		free(tmp);
-	}
-	return ERROR_CODE;
-}
-
-int arp_initialize(async_client_conn_t client_connection){
+	
+	return EOK;
+}
+
+/** Initializes the ARP module.
+ *
+ *  @param[in] client_connection The client connection processing function.
+ *			The module skeleton propagates its own one.
+ *  @returns		EOK on success.
+ *  @returns		ENOMEM if there is not enough memory left.
+ */
+int arp_initialize(async_client_conn_t client_connection)
+{
 	ERROR_DECLARE;
 
@@ -366,106 +361,49 @@
 }
 
-int arp_message_standalone(ipc_callid_t callid, ipc_call_t *call,
-    ipc_call_t *answer, int *answer_count)
-{
-	ERROR_DECLARE;
-	
-	measured_string_ref address;
-	measured_string_ref translation;
-	char * data;
-	packet_t packet;
-	packet_t next;
-	
-	*answer_count = 0;
-	switch (IPC_GET_METHOD(*call)) {
-		case IPC_M_PHONE_HUNGUP:
-			return EOK;
-		case NET_ARP_DEVICE:
-			ERROR_PROPAGATE(measured_strings_receive(&address, &data, 1));
-			if(ERROR_OCCURRED(arp_device_message(IPC_GET_DEVICE(call), IPC_GET_SERVICE(call), ARP_GET_NETIF(call), address))){
-				free(address);
-				free(data);
-			}
-			return ERROR_CODE;
-		case NET_ARP_TRANSLATE:
-			ERROR_PROPAGATE(measured_strings_receive(&address, &data, 1));
-			fibril_rwlock_read_lock(&arp_globals.lock);
-			translation = arp_translate_message(IPC_GET_DEVICE(call), IPC_GET_SERVICE(call), address);
-			free(address);
-			free(data);
-			if(! translation){
-				fibril_rwlock_read_unlock(&arp_globals.lock);
-				return ENOENT;
-			}
-			ERROR_CODE = measured_strings_reply(translation, 1);
-			fibril_rwlock_read_unlock(&arp_globals.lock);
-			return ERROR_CODE;
-		case NET_ARP_CLEAR_DEVICE:
-			return arp_clear_device_req(0, IPC_GET_DEVICE(call));
-		case NET_ARP_CLEAR_ADDRESS:
-			ERROR_PROPAGATE(measured_strings_receive(&address, &data, 1));
-			arp_clear_address_req(0, IPC_GET_DEVICE(call), IPC_GET_SERVICE(call), address);
-			free(address);
-			free(data);
-			return EOK;
-		case NET_ARP_CLEAN_CACHE:
-			return arp_clean_cache_req(0);
-		case NET_IL_DEVICE_STATE:
-			// do nothing - keep the cache
-			return EOK;
-		case NET_IL_RECEIVED:
-			if(! ERROR_OCCURRED(packet_translate_remote(arp_globals.net_phone, &packet, IPC_GET_PACKET(call)))){
-				fibril_rwlock_read_lock(&arp_globals.lock);
-				do{
-					next = pq_detach(packet);
-					ERROR_CODE = arp_receive_message(IPC_GET_DEVICE(call), packet);
-					if(ERROR_CODE != 1){
-						pq_release_remote(arp_globals.net_phone, packet_get_id(packet));
-					}
-					packet = next;
-				}while(packet);
-				fibril_rwlock_read_unlock(&arp_globals.lock);
-			}
-			return ERROR_CODE;
-		case NET_IL_MTU_CHANGED:
-			return arp_mtu_changed_message(IPC_GET_DEVICE(call), IPC_GET_MTU(call));
-	}
-	
-	return ENOTSUP;
-}
-
-int arp_mtu_changed_message(device_id_t device_id, size_t mtu){
+/** Updates the device content length according to the new MTU value.
+ *
+ * @param[in] device_id	The device identifier.
+ * @param[in] mtu	The new mtu value.
+ * @returns		ENOENT if device is not found.
+ * @returns		EOK on success.
+ */
+static int arp_mtu_changed_message(device_id_t device_id, size_t mtu)
+{
 	arp_device_ref device;
 
 	fibril_rwlock_write_lock(&arp_globals.lock);
 	device = arp_cache_find(&arp_globals.cache, device_id);
-	if(! device){
+	if (!device) {
 		fibril_rwlock_write_unlock(&arp_globals.lock);
 		return ENOENT;
 	}
 	device->packet_dimension.content = mtu;
+	fibril_rwlock_write_unlock(&arp_globals.lock);
 	printf("arp - device %d changed mtu to %d\n\n", device_id, mtu);
-	fibril_rwlock_write_unlock(&arp_globals.lock);
-	return EOK;
-}
-
-int arp_proto_create(arp_proto_ref * proto, services_t service, measured_string_ref address){
-	ERROR_DECLARE;
-
-	*proto = (arp_proto_ref) malloc(sizeof(arp_proto_t));
-	if(!(*proto)){
-		return ENOMEM;
-	}
-	(** proto).service = service;
-	(** proto).addr = address;
-	(** proto).addr_data = address->value;
-	if(ERROR_OCCURRED(arp_addr_initialize(&(** proto).addresses))){
-		free(*proto);
-		return ERROR_CODE;
-	}
-	return EOK;
-}
-
-int arp_receive_message(device_id_t device_id, packet_t packet){
+	return EOK;
+}
+
+/** Processes the received ARP packet.
+ *
+ * Updates the source hardware address if the source entry exists or the packet
+ * is targeted to my protocol address.
+ * Responses to the ARP request if the packet is the ARP request and is
+ * targeted to my address.
+ *
+ * @param[in] device_id	The source device identifier.
+ * @param[in,out] packet The received packet.
+ * @returns		EOK on success and the packet is no longer needed.
+ * @returns		One on success and the packet has been reused.
+ * @returns		EINVAL if the packet is too small to carry an ARP
+ *			packet.
+ * @returns		EINVAL if the received address lengths differs from
+ *			the registered values.
+ * @returns		ENOENT if the device is not found in the cache.
+ * @returns		ENOENT if the protocol for the device is not found in
+ *			the cache.
+ * @returns		ENOMEM if there is not enough memory left.
+ */
+static int arp_receive_message(device_id_t device_id, packet_t packet)
+{
 	ERROR_DECLARE;
 
@@ -475,34 +413,39 @@
 	arp_proto_ref proto;
 	measured_string_ref hw_source;
-	uint8_t * src_hw;
-	uint8_t * src_proto;
-	uint8_t * des_hw;
-	uint8_t * des_proto;
+	uint8_t *src_hw;
+	uint8_t *src_proto;
+	uint8_t *des_hw;
+	uint8_t *des_proto;
 
 	length = packet_get_data_length(packet);
-	if(length <= sizeof(arp_header_t)){
+	if (length <= sizeof(arp_header_t))
 		return EINVAL;
-	}
+
 	device = arp_cache_find(&arp_globals.cache, device_id);
-	if(! device){
+	if (!device)
 		return ENOENT;
-	}
+
 	header = (arp_header_ref) packet_get_data(packet);
-	if((ntohs(header->hardware) != device->hardware)
-		|| (length < sizeof(arp_header_t) + header->hardware_length * 2u + header->protocol_length * 2u)){
+	if ((ntohs(header->hardware) != device->hardware) ||
+	    (length < sizeof(arp_header_t) + header->hardware_length * 2U +
+	    header->protocol_length * 2U)) {
 		return EINVAL;
 	}
-	proto = arp_protos_find(&device->protos, protocol_unmap(device->service, ntohs(header->protocol)));
-	if(! proto){
+
+	proto = arp_protos_find(&device->protos,
+	    protocol_unmap(device->service, ntohs(header->protocol)));
+	if (!proto)
 		return ENOENT;
-	}
+
 	src_hw = ((uint8_t *) header) + sizeof(arp_header_t);
 	src_proto = src_hw + header->hardware_length;
 	des_hw = src_proto + header->protocol_length;
 	des_proto = des_hw + header->hardware_length;
-	hw_source = arp_addr_find(&proto->addresses, (char *) src_proto, CONVERT_SIZE(uint8_t, char, header->protocol_length));
+	hw_source = arp_addr_find(&proto->addresses, (char *) src_proto,
+	    CONVERT_SIZE(uint8_t, char, header->protocol_length));
 	// exists?
-	if(hw_source){
-		if(hw_source->length != CONVERT_SIZE(uint8_t, char, header->hardware_length)){
+	if (hw_source) {
+		if (hw_source->length != CONVERT_SIZE(uint8_t, char,
+		    header->hardware_length)) {
 			return EINVAL;
 		}
@@ -510,31 +453,62 @@
 	}
 	// is my protocol address?
-	if(proto->addr->length != CONVERT_SIZE(uint8_t, char, header->protocol_length)){
+	if (proto->addr->length != CONVERT_SIZE(uint8_t, char,
+	    header->protocol_length)) {
 		return EINVAL;
 	}
-	if(! str_lcmp(proto->addr->value, (char *) des_proto, proto->addr->length)){
+	if (!str_lcmp(proto->addr->value, (char *) des_proto,
+	    proto->addr->length)) {
 		// not already upadted?
-		if(! hw_source){
-			hw_source = measured_string_create_bulk((char *) src_hw, CONVERT_SIZE(uint8_t, char, header->hardware_length));
-			if(! hw_source){
+		if (!hw_source) {
+			hw_source = measured_string_create_bulk((char *) src_hw,
+			    CONVERT_SIZE(uint8_t, char,
+			    header->hardware_length));
+			if (!hw_source)
 				return ENOMEM;
-			}
-			ERROR_PROPAGATE(arp_addr_add(&proto->addresses, (char *) src_proto, CONVERT_SIZE(uint8_t, char, header->protocol_length), hw_source));
-		}
-		if(ntohs(header->operation) == ARPOP_REQUEST){
+
+			ERROR_PROPAGATE(arp_addr_add(&proto->addresses,
+			    (char *) src_proto, CONVERT_SIZE(uint8_t, char,
+			    header->protocol_length), hw_source));
+		}
+		if (ntohs(header->operation) == ARPOP_REQUEST) {
 			header->operation = htons(ARPOP_REPLY);
 			memcpy(des_proto, src_proto, header->protocol_length);
-			memcpy(src_proto, proto->addr->value, header->protocol_length);
-			memcpy(src_hw, device->addr->value, device->packet_dimension.addr_len);
-			memcpy(des_hw, hw_source->value, header->hardware_length);
-			ERROR_PROPAGATE(packet_set_addr(packet, src_hw, des_hw, header->hardware_length));
-			nil_send_msg(device->phone, device_id, packet, SERVICE_ARP);
+			memcpy(src_proto, proto->addr->value,
+			    header->protocol_length);
+			memcpy(src_hw, device->addr->value,
+			    device->packet_dimension.addr_len);
+			memcpy(des_hw, hw_source->value,
+			    header->hardware_length);
+			ERROR_PROPAGATE(packet_set_addr(packet, src_hw, des_hw,
+			    header->hardware_length));
+			nil_send_msg(device->phone, device_id, packet,
+			    SERVICE_ARP);
 			return 1;
 		}
 	}
-	return EOK;
-}
-
-measured_string_ref arp_translate_message(device_id_t device_id, services_t protocol, measured_string_ref target){
+
+	return EOK;
+}
+
+
+/** Returns the hardware address for the given protocol address.
+ *
+ * Sends the ARP request packet if the hardware address is not found in the
+ * cache.
+ *
+ * @param[in] device_id	The device identifier.
+ * @param[in] protocol	The protocol service.
+ * @param[in] target	The target protocol address.
+ * @returns		The hardware address of the target.
+ * @returns		NULL if the target parameter is NULL.
+ * @returns		NULL if the device is not found.
+ * @returns		NULL if the device packet is too small to send a
+ *			request.
+ * @returns		NULL if the hardware address is not found in the cache.
+ */
+static measured_string_ref
+arp_translate_message(device_id_t device_id, services_t protocol,
+    measured_string_ref target)
+{
 	arp_device_ref device;
 	arp_proto_ref proto;
@@ -544,33 +518,37 @@
 	arp_header_ref header;
 
-	if(! target){
+	if (!target)
 		return NULL;
-	}
+
 	device = arp_cache_find(&arp_globals.cache, device_id);
-	if(! device){
+	if (!device)
 		return NULL;
-	}
+
 	proto = arp_protos_find(&device->protos, protocol);
-	if((! proto) || (proto->addr->length != target->length)){
+	if (!proto || (proto->addr->length != target->length))
 		return NULL;
-	}
+
 	addr = arp_addr_find(&proto->addresses, target->value, target->length);
-	if(addr){
+	if (addr)
 		return addr;
-	}
+
 	// ARP packet content size = header + (address + translation) * 2
-	length = 8 + (CONVERT_SIZE(char, uint8_t, proto->addr->length) + CONVERT_SIZE(char, uint8_t, device->addr->length)) * 2;
-	if(length > device->packet_dimension.content){
+	length = 8 + 2 * (CONVERT_SIZE(char, uint8_t, proto->addr->length) +
+	    CONVERT_SIZE(char, uint8_t, device->addr->length));
+	if (length > device->packet_dimension.content)
 		return NULL;
-	}
-	packet = packet_get_4_remote(arp_globals.net_phone, device->packet_dimension.addr_len, device->packet_dimension.prefix, length, device->packet_dimension.suffix);
-	if(! packet){
+
+	packet = packet_get_4_remote(arp_globals.net_phone,
+	    device->packet_dimension.addr_len, device->packet_dimension.prefix,
+	    length, device->packet_dimension.suffix);
+	if (!packet)
 		return NULL;
-	}
+
 	header = (arp_header_ref) packet_suffix(packet, length);
-	if(! header){
+	if (!header) {
 		pq_release_remote(arp_globals.net_phone, packet_get_id(packet));
 		return NULL;
 	}
+
 	header->hardware = htons(device->hardware);
 	header->hardware_length = (uint8_t) device->addr->length;
@@ -579,26 +557,131 @@
 	header->operation = htons(ARPOP_REQUEST);
 	length = sizeof(arp_header_t);
-	memcpy(((uint8_t *) header) + length, device->addr->value, device->addr->length);
+	memcpy(((uint8_t *) header) + length, device->addr->value,
+	    device->addr->length);
 	length += device->addr->length;
-	memcpy(((uint8_t *) header) + length, proto->addr->value, proto->addr->length);
+	memcpy(((uint8_t *) header) + length, proto->addr->value,
+	    proto->addr->length);
 	length += proto->addr->length;
 	bzero(((uint8_t *) header) + length, device->addr->length);
 	length += device->addr->length;
 	memcpy(((uint8_t *) header) + length, target->value, target->length);
-	if(packet_set_addr(packet, (uint8_t *) device->addr->value, (uint8_t *) device->broadcast_addr->value, CONVERT_SIZE(char, uint8_t, device->addr->length)) != EOK){
+
+	if (packet_set_addr(packet, (uint8_t *) device->addr->value,
+	    (uint8_t *) device->broadcast_addr->value,
+	    CONVERT_SIZE(char, uint8_t, device->addr->length)) != EOK) {
 		pq_release_remote(arp_globals.net_phone, packet_get_id(packet));
 		return NULL;
 	}
+
 	nil_send_msg(device->phone, device_id, packet, SERVICE_ARP);
 	return NULL;
 }
 
+
+/** Processes the ARP message.
+ *
+ * @param[in] callid	The message identifier.
+ * @param[in] call	The message parameters.
+ * @param[out] answer	The message answer parameters.
+ * @param[out] answer_count The last parameter for the actual answer in the
+ *			answer parameter.
+ * @returns		EOK on success.
+ * @returns		ENOTSUP if the message is not known.
+ *
+ * @see arp_interface.h
+ * @see IS_NET_ARP_MESSAGE()
+ */
+int
+arp_message_standalone(ipc_callid_t callid, ipc_call_t *call,
+    ipc_call_t *answer, int *answer_count)
+{
+	ERROR_DECLARE;
+	
+	measured_string_ref address;
+	measured_string_ref translation;
+	char *data;
+	packet_t packet;
+	packet_t next;
+	
+	*answer_count = 0;
+	switch (IPC_GET_METHOD(*call)) {
+	case IPC_M_PHONE_HUNGUP:
+		return EOK;
+	
+	case NET_ARP_DEVICE:
+		ERROR_PROPAGATE(measured_strings_receive(&address, &data, 1));
+		if (ERROR_OCCURRED(arp_device_message(IPC_GET_DEVICE(call),
+		    IPC_GET_SERVICE(call), ARP_GET_NETIF(call), address))) {
+			free(address);
+			free(data);
+		}
+		return ERROR_CODE;
+	
+	case NET_ARP_TRANSLATE:
+		ERROR_PROPAGATE(measured_strings_receive(&address, &data, 1));
+		fibril_rwlock_read_lock(&arp_globals.lock);
+		translation = arp_translate_message(IPC_GET_DEVICE(call),
+		    IPC_GET_SERVICE(call), address);
+		free(address);
+		free(data);
+		if (!translation) {
+			fibril_rwlock_read_unlock(&arp_globals.lock);
+			return ENOENT;
+		}
+		ERROR_CODE = measured_strings_reply(translation, 1);
+		fibril_rwlock_read_unlock(&arp_globals.lock);
+		return ERROR_CODE;
+
+	case NET_ARP_CLEAR_DEVICE:
+		return arp_clear_device_req(0, IPC_GET_DEVICE(call));
+
+	case NET_ARP_CLEAR_ADDRESS:
+		ERROR_PROPAGATE(measured_strings_receive(&address, &data, 1));
+		arp_clear_address_req(0, IPC_GET_DEVICE(call),
+		    IPC_GET_SERVICE(call), address);
+		free(address);
+		free(data);
+		return EOK;
+	
+	case NET_ARP_CLEAN_CACHE:
+		return arp_clean_cache_req(0);
+	
+	case NET_IL_DEVICE_STATE:
+		// do nothing - keep the cache
+		return EOK;
+	
+	case NET_IL_RECEIVED:
+		if (ERROR_NONE(packet_translate_remote(arp_globals.net_phone,
+		    &packet, IPC_GET_PACKET(call)))) {
+			fibril_rwlock_read_lock(&arp_globals.lock);
+			do {
+				next = pq_detach(packet);
+				ERROR_CODE =
+				    arp_receive_message(IPC_GET_DEVICE(call),
+				    packet);
+				if (ERROR_CODE != 1) {
+					pq_release_remote(arp_globals.net_phone,
+					    packet_get_id(packet));
+				}
+				packet = next;
+			} while (packet);
+			fibril_rwlock_read_unlock(&arp_globals.lock);
+		}
+		return ERROR_CODE;
+	
+	case NET_IL_MTU_CHANGED:
+		return arp_mtu_changed_message(IPC_GET_DEVICE(call),
+		    IPC_GET_MTU(call));
+	}
+	
+	return ENOTSUP;
+}
+
 /** Default thread for new connections.
  *
- *  @param[in] iid The initial message identifier.
- *  @param[in] icall The initial message call structure.
- *
- */
-static void il_client_connection(ipc_callid_t iid, ipc_call_t * icall)
+ * @param[in] iid	The initial message identifier.
+ * @param[in] icall	The initial message call structure.
+ */
+static void il_client_connection(ipc_callid_t iid, ipc_call_t *icall)
 {
 	/*
@@ -608,5 +691,5 @@
 	ipc_answer_0(iid, EOK);
 	
-	while(true) {
+	while (true) {
 		ipc_call_t answer;
 		int answer_count;
@@ -623,6 +706,10 @@
 		    &answer_count);
 		
-		/* End if said to either by the message or the processing result */
-		if ((IPC_GET_METHOD(call) == IPC_M_PHONE_HUNGUP) || (res == EHANGUP))
+		/*
+		 * End if told to either by the message or the processing
+		 * result.
+		 */
+		if ((IPC_GET_METHOD(call) == IPC_M_PHONE_HUNGUP) ||
+		    (res == EHANGUP))
 			return;
 		
@@ -634,10 +721,7 @@
 /** Starts the module.
  *
- *  @param argc The count of the command line arguments. Ignored parameter.
- *  @param argv The command line parameters. Ignored parameter.
- *
- *  @returns EOK on success.
- *  @returns Other error codes as defined for each specific module start function.
- *
+ * @returns		EOK on success.
+ * @returns		Other error codes as defined for each specific module
+ *			start function.
  */
 int main(int argc, char *argv[])
@@ -646,7 +730,5 @@
 	
 	/* Start the module */
-	if (ERROR_OCCURRED(il_module_start_standalone(il_client_connection)))
-		return ERROR_CODE;
-	
+	ERROR_PROPAGATE(il_module_start_standalone(il_client_connection));
 	return EOK;
 }
@@ -654,2 +736,3 @@
 /** @}
  */
+
Index: uspace/srv/net/il/arp/arp.h
===================================================================
--- uspace/srv/net/il/arp/arp.h	(revision 0a3fbc7aaeecfe45b26ba44ae62268c82c8e623d)
+++ uspace/srv/net/il/arp/arp.h	(revision e9caf4779c4818e0894f8ea2cb6815ec2e723d8f)
@@ -28,13 +28,13 @@
 
 /** @addtogroup arp
- *  @{
+ * @{
  */
 
 /** @file
- *  ARP module.
+ * ARP module.
  */
 
-#ifndef __NET_ARP_H__
-#define __NET_ARP_H__
+#ifndef NET_ARP_H_
+#define NET_ARP_H_
 
 #include <fibril_synch.h>
@@ -44,4 +44,5 @@
 
 #include <net/device.h>
+#include <net/packet.h>
 #include <net_hardware.h>
 #include <adt/generic_char_map.h>
@@ -49,116 +50,105 @@
 #include <adt/measured_strings.h>
 
-
 /** Type definition of the ARP device specific data.
- *  @see arp_device
+ * @see arp_device
  */
-typedef struct arp_device	arp_device_t;
+typedef struct arp_device arp_device_t;
 
 /** Type definition of the ARP device specific data pointer.
- *  @see arp_device
+ * @see arp_device
  */
-typedef arp_device_t *		arp_device_ref;
+typedef arp_device_t *arp_device_ref;
 
 /** Type definition of the ARP global data.
- *  @see arp_globals
+ * @see arp_globals
  */
-typedef struct arp_globals	arp_globals_t;
+typedef struct arp_globals arp_globals_t;
 
 /** Type definition of the ARP protocol specific data.
- *  @see arp_proto
+ * @see arp_proto
  */
-typedef struct arp_proto	arp_proto_t;
+typedef struct arp_proto arp_proto_t;
 
 /** Type definition of the ARP protocol specific data pointer.
- *  @see arp_proto
+ * @see arp_proto
  */
-typedef arp_proto_t *		arp_proto_ref;
+typedef arp_proto_t *arp_proto_ref;
 
 /** ARP address map.
- *  Translates addresses.
- *  @see generic_char_map.h
+ *
+ * Translates addresses.
+ * @see generic_char_map.h
  */
-GENERIC_CHAR_MAP_DECLARE(arp_addr, measured_string_t)
+GENERIC_CHAR_MAP_DECLARE(arp_addr, measured_string_t);
 
 /** ARP address cache.
- *  Maps devices to the ARP device specific data.
- *  @see device.h
+ *
+ * Maps devices to the ARP device specific data.
+ * @see device.h
  */
-DEVICE_MAP_DECLARE(arp_cache, arp_device_t)
+DEVICE_MAP_DECLARE(arp_cache, arp_device_t);
 
 /** ARP protocol map.
- *  Maps protocol identifiers to the ARP protocol specific data.
- *  @see int_map.h
+ *
+ * Maps protocol identifiers to the ARP protocol specific data.
+ * @see int_map.h
  */
-INT_MAP_DECLARE(arp_protos, arp_proto_t)
+INT_MAP_DECLARE(arp_protos, arp_proto_t);
 
-/** ARP device specific data.
- */
-struct arp_device{
-	/** Actual device hardware address.
-	 */
+/** ARP device specific data. */
+struct arp_device {
+	/** Actual device hardware address. */
 	measured_string_ref addr;
-	/** Actual device hardware address data.
-	 */
-	char * addr_data;
-	/** Broadcast device hardware address.
-	 */
+	/** Actual device hardware address data. */
+	char *addr_data;
+	/** Broadcast device hardware address. */
 	measured_string_ref broadcast_addr;
-	/** Broadcast device hardware address data.
-	 */
-	char * broadcast_data;
-	/** Device identifier.
-	 */
+	/** Broadcast device hardware address data. */
+	char *broadcast_data;
+	/** Device identifier. */
 	device_id_t device_id;
-	/** Hardware type.
-	 */
+	/** Hardware type. */
 	hw_type_t hardware;
-	/** Packet dimension.
-	 */
+	/** Packet dimension. */
 	packet_dimension_t packet_dimension;
-	/** Device module phone.
-	 */
+	/** Device module phone. */
 	int phone;
-	/** Protocol map.
-	 *  Address map for each protocol.
+	
+	/**
+	 * Protocol map.
+	 * Address map for each protocol.
 	 */
 	arp_protos_t protos;
-	/** Device module service.
-	 */
+	
+	/** Device module service. */
 	services_t service;
 };
 
-/** ARP global data.
- */
-struct	arp_globals{
-	/** ARP address cache.
-	 */
+/** ARP global data. */
+struct arp_globals {
+	/** ARP address cache. */
 	arp_cache_t cache;
-	/** The client connection processing function.
-	 *  The module skeleton propagates its own one.
+	
+	/**
+	 * The client connection processing function.
+	 * The module skeleton propagates its own one.
 	 */
 	async_client_conn_t client_connection;
-	/** Networking module phone.
-	 */
+	
+	/** Networking module phone. */
 	int net_phone;
-	/** Safety lock.
-	 */
+	/** Safety lock. */
 	fibril_rwlock_t lock;
 };
 
-/** ARP protocol specific data.
- */
-struct arp_proto{
-	/** Actual device protocol address.
-	 */
+/** ARP protocol specific data. */
+struct arp_proto {
+	/** Actual device protocol address. */
 	measured_string_ref addr;
-	/** Actual device protocol address data.
-	 */
-	char * addr_data;
-	/** Address map.
-	 */
+	/** Actual device protocol address data. */
+	char *addr_data;
+	/** Address map. */
 	arp_addr_t addresses;
-	/** Protocol service.
-	 */
+	/** Protocol service. */
 	services_t service;
 };
Index: uspace/srv/net/il/arp/arp_header.h
===================================================================
--- uspace/srv/net/il/arp/arp_header.h	(revision 0a3fbc7aaeecfe45b26ba44ae62268c82c8e623d)
+++ uspace/srv/net/il/arp/arp_header.h	(revision e9caf4779c4818e0894f8ea2cb6815ec2e723d8f)
@@ -32,41 +32,41 @@
 
 /** @file
- *  ARP protocol header.
- *  Based on the RFC~826.
+ * ARP protocol header.
+ * Based on the RFC 826.
  */
 
-#ifndef __NET_ARP_HEADER_H__
-#define __NET_ARP_HEADER_H__
+#ifndef NET_ARP_HEADER_H_
+#define NET_ARP_HEADER_H_
 
 #include <sys/types.h>
 
 /** Type definition of an ARP protocol header.
- *  @see arp_header
+ * @see arp_header
  */
-typedef struct arp_header	arp_header_t;
+typedef struct arp_header arp_header_t;
 
 /** Type definition of an ARP protocol header pointer.
- *  @see arp_header
+ * @see arp_header
  */
-typedef arp_header_t *		arp_header_ref;
+typedef arp_header_t *arp_header_ref;
 
-/** ARP protocol header.
- */
-struct arp_header{
-	/** Hardware type identifier.
-	 *  @see hardware.h
+/** ARP protocol header. */
+struct arp_header {
+	/**
+	 * Hardware type identifier.
+	 * @see hardware.h
 	 */
 	uint16_t hardware;
-	/** Protocol identifier.
-	 */
+	
+	/** Protocol identifier. */
 	uint16_t protocol;
-	/** Hardware address length in bytes.
-	 */
+	/** Hardware address length in bytes. */
 	uint8_t hardware_length;
-	/** Protocol address length in bytes.
-	 */
+	/** Protocol address length in bytes. */
 	uint8_t protocol_length;
-	/** ARP packet type.
-	 *  @see arp_oc.h
+	
+	/**
+	 * ARP packet type.
+	 * @see arp_oc.h
 	 */
 	uint16_t operation;
Index: uspace/srv/net/il/arp/arp_module.c
===================================================================
--- uspace/srv/net/il/arp/arp_module.c	(revision 0a3fbc7aaeecfe45b26ba44ae62268c82c8e623d)
+++ uspace/srv/net/il/arp/arp_module.c	(revision e9caf4779c4818e0894f8ea2cb6815ec2e723d8f)
@@ -32,8 +32,9 @@
 
 /** @file
- *  ARP standalone module implementation.
- *  Contains skeleton module functions mapping.
- *  The functions are used by the module skeleton as module specific entry points.
- *  @see module.c
+ * ARP standalone module implementation.
+ * Contains skeleton module functions mapping.
+ * The functions are used by the module skeleton as module specific entry
+ * points.
+ * @see module.c
  */
 
@@ -53,13 +54,16 @@
 #include "arp_module.h"
 
-/** ARP module global data.
- */
-extern arp_globals_t	arp_globals;
+/** ARP module global data. */
+extern arp_globals_t arp_globals;
 
-int il_module_message_standalone(ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count){
+int
+il_module_message_standalone(ipc_callid_t callid, ipc_call_t *call,
+    ipc_call_t *answer, int *answer_count)
+{
 	return arp_message_standalone(callid, call, answer, answer_count);
 }
 
-int il_module_start_standalone(async_client_conn_t client_connection){
+int il_module_start_standalone(async_client_conn_t client_connection)
+{
 	ERROR_DECLARE;
 	
@@ -69,6 +73,6 @@
 	
 	ipcarg_t phonehash;
-	if (ERROR_OCCURRED(arp_initialize(client_connection))
-	    || ERROR_OCCURRED(REGISTER_ME(SERVICE_ARP, &phonehash))) {
+	if (ERROR_OCCURRED(arp_initialize(client_connection)) ||
+	    ERROR_OCCURRED(REGISTER_ME(SERVICE_ARP, &phonehash))) {
 		pm_destroy();
 		return ERROR_CODE;
Index: uspace/srv/net/il/arp/arp_module.h
===================================================================
--- uspace/srv/net/il/arp/arp_module.h	(revision 0a3fbc7aaeecfe45b26ba44ae62268c82c8e623d)
+++ uspace/srv/net/il/arp/arp_module.h	(revision e9caf4779c4818e0894f8ea2cb6815ec2e723d8f)
@@ -28,35 +28,21 @@
 
 /** @addtogroup arp
- *  @{
+ * @{
  */
 
 /** @file
- *  ARP module functions.
- *  The functions are used as ARP module entry points.
+ * ARP module functions.
+ * The functions are used as ARP module entry points.
  */
 
-#ifndef __NET_ARP_MODULE_H__
-#define __NET_ARP_MODULE_H__
+#ifndef NET_ARP_MODULE_H_
+#define NET_ARP_MODULE_H_
 
 #include <ipc/ipc.h>
+#include <async.h>
 
-/** Initializes the ARP module.
- *  @param[in] client_connection The client connection processing function. The module skeleton propagates its own one.
- *  @returns EOK on success.
- *  @returns ENOMEM if there is not enough memory left.
- */
-int arp_initialize(async_client_conn_t client_connection);
-
-/** Processes the ARP message.
- *  @param[in] callid The message identifier.
- *  @param[in] call The message parameters.
- *  @param[out] answer The message answer parameters.
- *  @param[out] answer_count The last parameter for the actual answer in the answer parameter.
- *  @returns EOK on success.
- *  @returns ENOTSUP if the message is not known.
- *  @see arp_interface.h
- *  @see IS_NET_ARP_MESSAGE()
- */
-int arp_message_standalone(ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count);
+extern int arp_initialize(async_client_conn_t);
+extern int arp_message_standalone(ipc_callid_t, ipc_call_t *, ipc_call_t *,
+    int *);
 
 #endif
Index: uspace/srv/net/il/arp/arp_oc.h
===================================================================
--- uspace/srv/net/il/arp/arp_oc.h	(revision 0a3fbc7aaeecfe45b26ba44ae62268c82c8e623d)
+++ uspace/srv/net/il/arp/arp_oc.h	(revision e9caf4779c4818e0894f8ea2cb6815ec2e723d8f)
@@ -32,105 +32,21 @@
 
 /** @file
- *  ARP operation codes according to the on-line IANA - Address Resolution Protocol (ARP) Parameters - <http://www.iana.org/assignments/arp-parameters/arp-parameters.xml>, cited January 14 2009.
+ * ARP operation codes according to the on-line IANA - Address Resolution
+ * Protocol (ARP) Parameters
+ * http://www.iana.org/assignments/arp-parameters/arp-parameters.xml
+ * cited January 14 2009.
  */
 
-#ifndef __NET_ARP_ARPOP_H__
-#define __NET_ARP_ARPOP_H__
+#ifndef NET_ARP_ARPOP_H_
+#define NET_ARP_ARPOP_H_
 
-/** @name ARP operation codes definitions
- */
+/** @name ARP operation codes definitions */
 /*@{*/
 
-/** REQUEST operation code.
- */
-#define ARPOP_REQUEST					1
+/** REQUEST operation code. */
+#define ARPOP_REQUEST	1
 
-/** REPLY operation code.
- */
-#define ARPOP_REPLY						2
-
-/** Reverse request operation code.
- */
-#define ARPOP_RREQUEST					3
-
-/** Reverse reply operation code.
- */
-#define ARPOP_RREPLY					4
-
-/** DRARP-Request operation code.
- */
-#define ARPOP_DRARP_Request				5
-
-/** DRARP-Reply operation code.
- */
-#define ARPOP_DRARP_Reply				6
-
-/** DRARP-Error operation code.
- */
-#define ARPOP_DRARP_Error				7
-
-/** InARP-Request operation code.
- */
-#define ARPOP_InREQUEST					8
-
-/** InARP-Reply operation code.
- */
-#define ARPOP_InREPLY					9
-
-/** ARP-NAK operation code.
- */
-#define ARPOP_NAK						10
-
-/** MARS-Request operation code.
- */
-#define ARPOP_MARS_Request				11
-
-/** MARS-Multi operation code.
- */
-#define ARPOP_MARS_Multi				12
-
-/** MARS-MServ operation code.
- */
-#define ARPOP_MARS_MServ				13
-
-/** MARS-Join operation code.
- */
-#define ARPOP_MARS_Join					14
-
-/** MARS-Leave operation code.
- */
-#define ARPOP_MARS_Leave				15
-
-/** MARS-NAK operation code.
- */
-#define ARPOP_MARS_NAK					16
-
-/** MARS-Unserv operation code.
- */
-#define ARPOP_MARS_Unserv				17
-
-/** MARS-SJoin operation code.
- */
-#define ARPOP_MARS_SJoin				18
-
-/** MARS-SLeave operation code.
- */
-#define ARPOP_MARS_SLeave				19
-
-/** MARS-Grouplist-Request operation code.
- */
-#define ARPOP_MARS_Grouplist_Request	20
-
-/** MARS-Grouplist-Reply operation code.
- */
-#define ARPOP_MARS_Grouplist_Reply		21
-
-/** MARS-Redirect-Map operation code.
- */
-#define ARPOP_MARS_Redirect_Map			22
-
-/** MAPOS-UNARP operation code.
- */
-#define ARPOP_MAPOS_UNARP				23
+/** REPLY operation code. */
+#define ARPOP_REPLY	2
 
 /*@}*/
