Subversion Repositories HelenOS

Compare Revisions

Ignore whitespace Rev 4162 → Rev 4163

/branches/network/uspace/srv/net/il/arp/arp.c
198,6 → 198,7
device = arp_cache_find( & arp_globals.cache, device_id );
if( device ){
if( device->service != service ){
printf( "\nDevice %d already exists", device->device_id );
rwlock_write_unlock( & arp_globals.lock );
return EEXIST;
}
218,7 → 219,7
return ERROR_CODE;
}
}
return EOK;
printf( "\nCache of the existing device %d cleaned", device->device_id );
}else{
// create a new device
device = ( arp_device_ref ) malloc( sizeof( arp_device_t ));
291,6 → 292,7
free( device );
return ERROR_CODE;
}
printf( "\nNew device registered:\n\tid\t= %d\n\ttype\t= %x\n\tservice\t= %d", device->device_id, device->hardware, device->service );
}
rwlock_write_unlock( & arp_globals.lock );
return EOK;
442,6 → 444,7
return ENOENT;
}
clear_device( device );
printf( "\nDevice %d cleared", device_id );
rwlock_write_unlock( & arp_globals.lock );
return EOK;
}
476,7 → 479,8
}
}
arp_cache_clear( & arp_globals.cache );
rwlock_write_lock( & arp_globals.lock );
rwlock_write_unlock( & arp_globals.lock );
printf( "\nCache cleaned" );
return EOK;
}
 
/branches/network/uspace/srv/net/il/ip/ip.c
142,6 → 142,7
// TODO ARP module
}
// TODO arp module
// TODO register
free( settings );
free( data );
// end request
148,23 → 149,23
// TODO mapping
async_wait_for( message, NULL );
// print the settings
printf( "\n -IPV =\t%d", ip_netif->ipv );
printf( "\n -configuration =\t%s", ip_netif->dhcp ? "dhcp" : "static" );
printf( "\nNew device registered:\n\tid\t= %d\n\tphone\t= %d\n\tIPV\t= %d", ip_netif->device_id, ip_netif->phone, ip_netif->ipv );
printf( "\n\tconfiguration\t= %s", ip_netif->dhcp ? "dhcp" : "static" );
// TODO ipv6
data = malloc( INET_ADDRSTRLEN );
if( data ){
inet_ntop( AF_INET, ( uint8_t * ) & ip_netif->address, data, INET_ADDRSTRLEN );
printf( "\n -address =\t%s", data );
printf( "\n\taddress\t= %s", data );
inet_ntop( AF_INET, ( uint8_t * ) & ip_netif->netmask, data, INET_ADDRSTRLEN );
printf( "\n -netmask =\t%s", data );
printf( "\n\tnetmask\t= %s", data );
inet_ntop( AF_INET, ( uint8_t * ) & ip_netif->gateway, data, INET_ADDRSTRLEN );
printf( "\n -gateway =\t%s", data );
printf( "\n\tgateway\t= %s", data );
inet_ntop( AF_INET, ( uint8_t * ) & ip_netif->broadcast, data, INET_ADDRSTRLEN );
printf( "\n -broadcast =\t%s", data );
printf( "\n\tbroadcast\t= %s", data );
inet_ntop( AF_INET, ( uint8_t * ) & ip_netif->dns1, data, INET_ADDRSTRLEN );
printf( "\n -dns1 =\t%s", data );
printf( "\n\tdns1\t= %s", data );
inet_ntop( AF_INET, ( uint8_t * ) & ip_netif->dns2, data, INET_ADDRSTRLEN );
printf( "\n -dns2 =\t%s", data );
printf( "\n\tdns2\t= %s", data );
free( data );
}
// TODO mapping
240,6 → 241,7
free( proto );
return ERROR_CODE;
}
printf( "\nNew protocol registered:\n\tprotocol\t= %d\n\tphone\t= %d", proto->protocol, proto->phone );
return EOK;
}