Subversion Repositories HelenOS

Rev

Rev 4307 | Rev 4332 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 4307 Rev 4327
Line 34... Line 34...
34
 */
34
 */
35
 
35
 
36
#include <async.h>
36
#include <async.h>
37
#include <errno.h>
37
#include <errno.h>
38
#include <stdio.h>
38
#include <stdio.h>
-
 
39
#include <string.h>
39
 
40
 
40
#include <ipc/ipc.h>
41
#include <ipc/ipc.h>
41
#include <ipc/services.h>
42
#include <ipc/services.h>
42
 
43
 
43
#include "../../err.h"
44
#include "../../err.h"
Line 110... Line 111...
110
        if( configuration[ 0 ].value ){
111
        if( configuration[ 0 ].value ){
111
            ip_netif->ipv = strtol( configuration[ 0 ].value, NULL, 0 );
112
            ip_netif->ipv = strtol( configuration[ 0 ].value, NULL, 0 );
112
        }else{
113
        }else{
113
            ip_netif->ipv = DEFAULT_IPV;
114
            ip_netif->ipv = DEFAULT_IPV;
114
        }
115
        }
115
        ip_netif->dhcp = ! strncmp( configuration[ 1 ].value, "dhcp", 4 );
116
        ip_netif->dhcp = ! str_lcmp( configuration[ 1 ].value, "dhcp", 4 );
116
        if( ip_netif->dhcp ){
117
        if( ip_netif->dhcp ){
117
            // TODO dhcp
118
            // TODO dhcp
118
            net_free_settings( configuration, data );
119
            net_free_settings( configuration, data );
119
            free( ip_netif );
120
            free( ip_netif );
120
            return ENOTSUP;
121
            return ENOTSUP;
Line 252... Line 253...
252
    // TODO state
253
    // TODO state
253
    printf( "ip - device %d changed state to %d\n\n", device_id, state );
254
    printf( "ip - device %d changed state to %d\n\n", device_id, state );
254
    if( netif->arp ){
255
    if( netif->arp ){
255
        address.value = ( char * ) & netif->gateway;
256
        address.value = ( char * ) & netif->gateway;
256
        address.length = CONVERT_SIZE( in_addr_t, char, 1 );
257
        address.length = CONVERT_SIZE( in_addr_t, char, 1 );
-
 
258
        if( ERROR_OCCURRED( arp_translate_req( netif->arp->phone, netif->device_id, SERVICE_IP, & address, & translation, & data ))){
-
 
259
            sleep( 2 );
257
        ERROR_PROPAGATE( arp_translate_req( netif->arp->phone, netif->device_id, SERVICE_IP, & address, & translation, & data ));
260
            ERROR_PROPAGATE( arp_translate_req( netif->arp->phone, netif->device_id, SERVICE_IP, & address, & translation, & data ));
-
 
261
        }
258
        printf( "\tgateway translated to\t= %X:%X:%X:%X:%X:%X\n", data[ 0 ], data[ 1 ], data[ 2 ], data[ 3 ], data[ 4 ], data[ 5 ] );
262
        printf( "\tgateway translated to\t= %X:%X:%X:%X:%X:%X\n", data[ 0 ], data[ 1 ], data[ 2 ], data[ 3 ], data[ 4 ], data[ 5 ] );
259
        free( translation );
263
        free( translation );
260
        free( data );
264
        free( data );
261
    }
265
    }
262
    return EOK;
266
    return EOK;