Subversion Repositories HelenOS

Rev

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

Rev 4332 Rev 4350
Line 89... Line 89...
89
    ERROR_PROPAGATE( modules_initialize( & ip_globals.modules ));
89
    ERROR_PROPAGATE( modules_initialize( & ip_globals.modules ));
90
    ERROR_PROPAGATE( add_module( NULL, & ip_globals.modules, ARP_NAME, ARP_FILENAME, SERVICE_ARP, arp_task_get_id(), arp_connect_module ));
90
    ERROR_PROPAGATE( add_module( NULL, & ip_globals.modules, ARP_NAME, ARP_FILENAME, SERVICE_ARP, arp_task_get_id(), arp_connect_module ));
91
    return EOK;
91
    return EOK;
92
}
92
}
93
 
93
 
94
int ip_device_req( int il_phone, device_id_t device_id, services_t service ){
94
int ip_device_req( int il_phone, device_id_t device_id, services_t netif ){
95
    ERROR_DECLARE;
95
    ERROR_DECLARE;
96
 
96
 
97
    ip_netif_ref        ip_netif;
97
    ip_netif_ref        ip_netif;
98
    measured_string_t   names[ 9 ] = {{ "IPV", 3 }, { "IP_CONFIG", 9 }, { "IP_ADDR", 7 }, { "NETMASK", 7 }, { "GATEWAY", 7 }, { "BROADCAST", 9 }, { "DNS1", 4 }, { "DNS2", 4 }, { "ARP", 3 }};
98
    measured_string_t   names[ 9 ] = {{ "IPV", 3 }, { "IP_CONFIG", 9 }, { "IP_ADDR", 7 }, { "NETMASK", 7 }, { "GATEWAY", 7 }, { "BROADCAST", 9 }, { "DNS1", 4 }, { "DNS2", 4 }, { "ARP", 3 }};
99
    measured_string_ref configuration;
99
    measured_string_ref configuration;
Line 147... Line 147...
147
        }else{
147
        }else{
148
            ip_netif->arp = NULL;
148
            ip_netif->arp = NULL;
149
        }
149
        }
150
        net_free_settings( configuration, data );
150
        net_free_settings( configuration, data );
151
    }
151
    }
152
    ip_netif->phone = bind_service( service, ip_netif->device_id, SERVICE_IP, 0, ip_driver_receiver );
152
    ip_netif->phone = bind_service( netif, ip_netif->device_id, SERVICE_IP, 0, ip_driver_receiver );
153
    if( ip_netif->phone < 0 ){
153
    if( ip_netif->phone < 0 ){
154
        printf( "Failed to contact the nil service %d\n", service );
154
        printf( "Failed to contact the nil service %d\n", netif );
155
        free( ip_netif );
155
        free( ip_netif );
156
        return ip_netif->phone;
156
        return ip_netif->phone;
157
    }
157
    }
158
    if( ip_netif->arp ){
158
    if( ip_netif->arp ){
159
        configuration[ 0 ].value = ( char * ) & ip_netif->address;
159
        configuration[ 0 ].value = ( char * ) & ip_netif->address;
160
        configuration[ 0 ].length = CONVERT_SIZE( in_addr_t, char, 1 );
160
        configuration[ 0 ].length = CONVERT_SIZE( in_addr_t, char, 1 );
161
        if( ERROR_OCCURRED( arp_device_req( ip_netif->arp->phone, ip_netif->device_id, SERVICE_IP, service, & configuration[ 0 ] ))){
161
        if( ERROR_OCCURRED( arp_device_req( ip_netif->arp->phone, ip_netif->device_id, SERVICE_IP, netif, & configuration[ 0 ] ))){
162
            free( ip_netif );
162
            free( ip_netif );
163
            return ERROR_CODE;
163
            return ERROR_CODE;
164
        }
164
        }
165
    }
165
    }
166
    index = ip_netifs_add( & ip_globals.netifs, ip_netif->device_id, ip_netif );
166
    index = ip_netifs_add( & ip_globals.netifs, ip_netif->device_id, ip_netif );