Subversion Repositories HelenOS

Compare Revisions

Ignore whitespace Rev 3911 → Rev 3912

/branches/network/uspace/srv/net/networking/startup/networking_startup.c
1,5 → 1,5
/*
* Copyright (c) 2008 Lukas Mejdrech
* Copyright (c) 2009 Lukas Mejdrech
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
27,10 → 27,13
*/
 
/** @addtogroup net
* @{
* @{
*/
 
/** @file
* Starts the networking subsystem.
* Performs self test if configured so.
* @see configuration.h
*/
 
#include <async.h>
45,9 → 48,25
#include "../../modules.h"
#include "../../self_test.h"
 
/** Networking startup module name.
*/
#define NAME "Networking startup"
 
/** Module entry point.
* @param argc The number of command line parameters. Input parameter.
* @param argv The command line parameters. Input parameter.
* @returns EOK on success.
* @returns EINVAL if the networking module cannot be started.
* @returns Other error codes as defined for the self_test() function.
* @returns Other error codes as defined for the NET_NET_STARTUP message.
*/
int main( int argc, char * argv[] );
 
/** Starts the module.
* @param fname The module absolute name. Input parameter.
* @returns The started module task identifier.
* @returns Other error codes as defined for the task_spawn() function.
*/
task_id_t spawn( const char * fname );
 
int main( int argc, char * argv[] ){
65,7 → 84,7
}
// start networking
networking_phone = connect_to_service( SERVICE_NETWORKING );
if( ERROR_OCCURED( ipc_call_sync_0_0( networking_phone, NET_NET_STARTUP ))){
if( ERROR_OCCURRED( ipc_call_sync_0_0( networking_phone, NET_NET_STARTUP ))){
printf( "\n" NAME " - ERROR %d\n", ERROR_CODE );
return ERROR_CODE;
}
/branches/network/uspace/srv/net/networking/networking.c
1,5 → 1,5
/*
* Copyright (c) 2008 Lukas Mejdrech
* Copyright (c) 2009 Lukas Mejdrech
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
27,7 → 27,7
*/
 
/** @addtogroup net
* @{
* @{
*/
 
/** @file
187,7 → 187,7
tmp_module->name = name;
tmp_module->filename = filename;
tmp_module->service = service;
if( ERROR_OCCURED( modules_add( modules, tmp_module->name, 0, tmp_module ))){
if( ERROR_OCCURRED( modules_add( modules, tmp_module->name, 0, tmp_module ))){
free( tmp_module );
return ERROR_CODE;
}
404,7 → 404,7
setting = measured_string_create_bulk( value, -1 );
if( ! setting ) return ENOMEM;
// add the configuration setting
if( ERROR_OCCURED( measured_strings_add( configuration, name, 0, setting ))){
if( ERROR_OCCURRED( measured_strings_add( configuration, name, 0, setting ))){
free( setting );
return ERROR_CODE;
}
420,7 → 420,7
setting = measured_string_create_bulk( value, 0 );
if( ! setting ) return ENOMEM;
// add the configuration setting
if( ERROR_OCCURED( measured_strings_add( configuration, name, 0, setting ))){
if( ERROR_OCCURRED( measured_strings_add( configuration, name, 0, setting ))){
free( setting );
return ERROR_CODE;
}
450,13 → 450,13
if( ! netif ) return ENOMEM;
netif->id = generate_new_device_id();
ERROR_PROPAGATE( measured_strings_initialize( & netif->configuration ));
if( ERROR_OCCURED( add_configuration( & netif->configuration, "NAME", LO_NAME ))
|| ERROR_OCCURED( add_configuration( & netif->configuration, "NETIF", LO_NAME ))
|| ERROR_OCCURED( add_configuration( & netif->configuration, "IL", IP_NAME ))
|| ERROR_OCCURED( add_configuration( & netif->configuration, "MTU", "1500" ))
|| ERROR_OCCURED( add_configuration( & netif->configuration, "IP_CONFIG", "STATIC" ))
|| ERROR_OCCURED( add_configuration( & netif->configuration, "IP_ADDR", "127.0.0.1" ))
|| ERROR_OCCURED( add_configuration( & netif->configuration, "NETMASK", "255.0.0.0" ))){
if( ERROR_OCCURRED( add_configuration( & netif->configuration, "NAME", LO_NAME ))
|| ERROR_OCCURRED( add_configuration( & netif->configuration, "NETIF", LO_NAME ))
|| ERROR_OCCURRED( add_configuration( & netif->configuration, "IL", IP_NAME ))
|| ERROR_OCCURRED( add_configuration( & netif->configuration, "MTU", "1500" ))
|| ERROR_OCCURRED( add_configuration( & netif->configuration, "IP_CONFIG", "STATIC" ))
|| ERROR_OCCURRED( add_configuration( & netif->configuration, "IP_ADDR", "127.0.0.1" ))
|| ERROR_OCCURRED( add_configuration( & netif->configuration, "NETMASK", "255.0.0.0" ))){
measured_strings_destroy( & netif->configuration );
free( netif );
return ERROR_CODE;
559,7 → 559,7
free( netif );
return ERROR_CODE;
}
if( ERROR_OCCURED( char_map_add( & networking_globals.netif_names, netif->name, 0, index ))){
if( ERROR_OCCURRED( char_map_add( & networking_globals.netif_names, netif->name, 0, index ))){
netifs_exclude_index( & networking_globals.netifs, index );
return ERROR_CODE;
}
618,7 → 618,7
ERROR_DECLARE;
 
// read configuration files
if( ERROR_OCCURED( read_configuration())) return ERROR_CODE;
if( ERROR_OCCURRED( read_configuration())) return ERROR_CODE;
 
// start network interfaces and needed modules
// start_device( "/sbin/lo", "/sbin/dummy_link_layer" );