Changeset aa85487 in mainline for uspace/srv/net


Ignore:
Timestamp:
2010-03-07T15:11:56Z (16 years ago)
Author:
Lukas Mejdrech <lukasmejdrech@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
aadf01e
Parents:
2e99277 (diff), 137691a (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge mainline changes, revision 308

Location:
uspace/srv/net
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/net/il/ip/ip.c

    r2e99277 raa85487  
    479479        ERROR_DECLARE;
    480480
    481         measured_string_t       names[] = {{ "IPV", 3 }, { "IP_CONFIG", 9 }, { "IP_ADDR", 7 }, { "IP_NETMASK", 10 }, { "IP_GATEWAY", 10 }, { "IP_BROADCAST", 12 }, { "ARP", 3 }, { "IP_ROUTING", 10 }};
     481        measured_string_t       names[] = {{ str_dup("IPV"), 3 }, { str_dup("IP_CONFIG"), 9 }, { str_dup("IP_ADDR"), 7 }, { str_dup("IP_NETMASK"), 10 }, { str_dup("IP_GATEWAY"), 10 }, { str_dup("IP_BROADCAST"), 12 }, { str_dup("ARP"), 3 }, { str_dup("IP_ROUTING"), 10 }};
    482482        measured_string_ref     configuration;
    483483        size_t                          count = sizeof( names ) / sizeof( measured_string_t );
  • uspace/srv/net/modules.c

    r2e99277 raa85487  
    5555
    5656int connect_to_service_timeout( services_t need, suseconds_t timeout ){
    57         ipcarg_t phone;
    58         int res;
     57        if (timeout <= 0)
     58                return async_connect_me_to_blocking( PHONE_NS, need, 0, 0);
     59       
     60        while( true ){
     61                int phone;
    5962
    60         while( true ){
    61                 res = async_req_3_5( PHONE_NS, IPC_M_CONNECT_ME_TO, need, 0, 0, NULL, NULL, NULL, NULL, & phone );
    62                 if( res >= 0 ){
     63                phone = async_connect_me_to( PHONE_NS, need, 0, 0);
     64                if( (phone >= 0) || (phone != ENOENT) )
    6365                        return phone;
    64                 }
    65                 if( timeout > 0 ){
    66                         timeout -= MODULE_WAIT_TIME;
    67                         if( timeout <= 0 ) return ETIMEOUT;
    68                 }
     66       
     67                timeout -= MODULE_WAIT_TIME;
     68                if( timeout <= 0 ) return ETIMEOUT;
     69
    6970                usleep( MODULE_WAIT_TIME );
    7071        }
     
    8485        if( phone >= 0 ){
    8586                if( ERROR_OCCURRED( ipc_connect_to_me( phone, arg1, arg2, arg3, & phonehash ))){
    86                         async_msg_0( phone, IPC_M_PHONE_HUNGUP );
     87                        ipc_hangup( phone );
    8788                        return ERROR_CODE;
    8889                }
  • uspace/srv/net/net/net.c

    r2e99277 raa85487  
    154154 *  @returns Other error codes as defined for the add_configuration() function.
    155155 */
    156 int     read_netif_configuration( char * name, netif_ref netif );
     156int     read_netif_configuration( const char * name, netif_ref netif );
    157157
    158158/** Networking module global data.
     
    413413}
    414414
    415 int read_netif_configuration( char * name, netif_ref netif ){
     415int read_netif_configuration( const char * name, netif_ref netif ){
    416416        // read the netif configuration file
    417417        return read_configuration_file( CONF_DIR, name, & netif->configuration );
     
    485485
    486486#ifdef CONFIG_NETIF_DP8390
    487         char *          conf_files[] = { "lo", "ne2k" };
     487        const char *            conf_files[] = { "lo", "ne2k" };
    488488#else
    489         char *          conf_files[] = { "lo" };
     489        const char *            conf_files[] = { "lo" };
    490490#endif
    491491
  • uspace/srv/net/net/start/netstart.c

    r2e99277 raa85487  
    6969 *  @returns Other error codes as defined for the task_spawn() function.
    7070 */
    71 task_id_t       spawn( char * fname );
     71task_id_t       spawn( const char * fname );
    7272
    7373int main( int argc, char * argv[] ){
     
    9797}
    9898
    99 task_id_t spawn( char * fname ){
    100         char *  argv[ 2 ];
     99task_id_t spawn( const char * fname ){
     100        const char *    argv[ 2 ];
    101101        task_id_t       res;
    102102
    103 //      printf( "Spawning %s\n", fname );
    104103        argv[ 0 ] = fname;
    105104        argv[ 1 ] = NULL;
    106105        res = task_spawn( fname, argv );
    107         if( res != 0 ){
    108                 /* Success */
    109                 usleep( 50000 );
    110         }
     106       
    111107        return res;
    112108}
  • uspace/srv/net/netif/lo/lo.c

    r2e99277 raa85487  
    102102int netif_get_addr_message( device_id_t device_id, measured_string_ref address ){
    103103        if( ! address ) return EBADMEM;
    104         address->value = DEFAULT_ADDR;
     104        address->value = str_dup(DEFAULT_ADDR);
    105105        address->length = DEFAULT_ADDR_LEN;
    106106        return EOK;
  • uspace/srv/net/nil/eth/eth.c

    r2e99277 raa85487  
    308308        eth_device_ref  device;
    309309        int                             index;
    310         measured_string_t       names[ 2 ] = {{ "ETH_MODE", 8 }, { "ETH_DUMMY", 9 }};
     310        measured_string_t       names[ 2 ] = {{ str_dup("ETH_MODE"), 8 }, { str_dup("ETH_DUMMY"), 9 }};
    311311        measured_string_ref     configuration;
    312312        size_t                          count = sizeof( names ) / sizeof( measured_string_t );
  • uspace/srv/net/structures/module_map.c

    r2e99277 raa85487  
    4949GENERIC_CHAR_MAP_IMPLEMENT( modules, module_t )
    5050
    51 int add_module( module_ref * module, modules_ref modules, char * name, char * filename, services_t service, task_id_t task_id, connect_module_t connect_module ){
     51int add_module( module_ref * module, modules_ref modules, const char * name, const char * filename, services_t service, task_id_t task_id, connect_module_t connect_module ){
    5252        ERROR_DECLARE;
    5353
     
    8686}
    8787
    88 task_id_t spawn( char * fname ){
    89         char * argv[ 2 ];
    90 //      char * argv[ 4 ];
     88task_id_t spawn( const char * fname ){
     89        const char * argv[ 2 ];
    9190        task_id_t       res;
    9291
    93 //      printf( "Spawning %s\n", fname );
    9492        argv[ 0 ] = fname;
    9593        argv[ 1 ] = NULL;
    9694        res = task_spawn( fname, argv );
    97 /*      argv[ 0 ] = "/app/trace";
    98         argv[ 1 ] = "+ti";
    99         argv[ 2 ] = fname;
    100         argv[ 3 ] = NULL;
    101         res = task_spawn( "/app/trace", argv );
    102 */
    103         if( res != 0 ){
    104                 /* Success */
    105                 usleep( 10000 );
    106         }
     95
    10796        return res;
    10897}
  • uspace/srv/net/structures/module_map.h

    r2e99277 raa85487  
    7979        /** Module name.
    8080         */
    81         char *          name;
     81        const char *            name;
    8282        /** Module full path filename.
    8383         */
    84         char *          filename;
     84        const char *            filename;
    8585        /** Connecting function.
    8686         */
     
    9999 *  @returns ENOMEM if there is not enough memory left.
    100100 */
    101 int     add_module( module_ref * module, modules_ref modules, char * name, char * filename, services_t service, task_id_t task_id, connect_module_t * connect_module );
     101int     add_module( module_ref * module, modules_ref modules, const char * name, const char * filename, services_t service, task_id_t task_id, connect_module_t * connect_module );
    102102
    103103/** Searches and returns the specified module.
     
    116116 *  @returns 0 if there is no such module.
    117117 */
    118 task_id_t       spawn( char * fname );
     118task_id_t       spawn( const char * fname );
    119119
    120120#endif
  • uspace/srv/net/tl/icmp/icmp.c

    r2e99277 raa85487  
    464464        ERROR_DECLARE;
    465465
    466         measured_string_t       names[] = {{ "ICMP_ERROR_REPORTING", 20 }, { "ICMP_ECHO_REPLYING", 18 }};
     466        measured_string_t       names[] = {{ str_dup("ICMP_ERROR_REPORTING"), 20 }, { str_dup("ICMP_ECHO_REPLYING"), 18 }};
    467467        measured_string_ref     configuration;
    468468        size_t                          count = sizeof( names ) / sizeof( measured_string_t );
  • uspace/srv/net/tl/udp/udp.c

    r2e99277 raa85487  
    192192        ERROR_DECLARE;
    193193
    194         measured_string_t       names[] = {{ "UDP_CHECKSUM_COMPUTING", 22 }, { "UDP_AUTOBINDING", 15 }};
     194        measured_string_t       names[] = {{ str_dup("UDP_CHECKSUM_COMPUTING"), 22 }, { str_dup("UDP_AUTOBINDING"), 15 }};
    195195        measured_string_ref     configuration;
    196196        size_t                          count = sizeof( names ) / sizeof( measured_string_t );
Note: See TracChangeset for help on using the changeset viewer.