Subversion Repositories HelenOS

Compare Revisions

Ignore whitespace Rev 4755 → Rev 4756

/branches/network/uspace/srv/net/il/arp/arp.c
74,9 → 74,9
 
/** Creates new protocol specific data.
* Allocates and returns the needed memory block as the proto parameter.
* @param proto The allocated protocol specific data. Output parameter.
* @param service The protocol module service. Input parameter.
* @param address The actual protocol device address. Input 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.
*/
83,9 → 83,9
int arp_proto_create( arp_proto_ref * proto, services_t service, measured_string_ref address );
 
/** Clears the device specific data.
* @param device The device specific data.
* @param[in] device The device specific data.
*/
void clear_device( arp_device_ref device );
void arp_clear_device( arp_device_ref device );
 
/** @name Message processing functions
*/
93,10 → 93,10
 
/** 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 device_id The device identifier. Input parameter.
* @param service The device driver service. Input parameter.
* @param protocol The protocol service. Input parameter.
* @param address The actual device protocol address.
* @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.
106,9 → 106,9
 
/** 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 device_id The device identifier. Input parameter.
* @param protocol The protocol service. Input parameter.
* @param target The target protocol address. Input parameter.
* @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.
120,8 → 120,8
/** 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 device_id The source device identifier. Input parameter.
* @param packet The received packet. Input/output parameter.
* @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.
133,8 → 133,8
int arp_receive_message( device_id_t device_id, packet_t packet );
 
/** Updates the device content length according to the new MTU value.
* @param device_id The device identifier. Input parameter.
* @param mtu The new mtu value. Input parameter.
* @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.
*/
161,7 → 161,7
fibril_rwlock_write_unlock( & arp_globals.lock );
return ENOENT;
}
clear_device( device );
arp_clear_device( device );
printf( "Device %d cleared\n", device_id );
fibril_rwlock_write_unlock( & arp_globals.lock );
return EOK;
195,7 → 195,7
for( count = arp_cache_count( & arp_globals.cache ) - 1; count >= 0; -- count ){
device = arp_cache_get_index( & arp_globals.cache, count );
if( device ){
clear_device( device );
arp_clear_device( device );
if( device->addr_data ) free( device->addr_data );
if( device->broadcast_data ) free( device->broadcast_data );
}
481,7 → 481,7
return EOK;
}
 
void clear_device( arp_device_ref device ){
void arp_clear_device( arp_device_ref device ){
int count;
arp_proto_ref proto;