Rev 4711 | Rev 4720 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 4711 | Rev 4717 | ||
---|---|---|---|
Line 292... | Line 292... | ||
292 | 292 | ||
293 | measured_string_t names[] = {{ "IPV", 3 }, { "IP_CONFIG", 9 }, { "IP_ADDR", 7 }, { "NETMASK", 7 }, { "GATEWAY", 7 }, { "BROADCAST", 9 }, { "DNS1", 4 }, { "DNS2", 4 }, { "ARP", 3 }, { "IP_ROUTING", 10 }}; |
293 | measured_string_t names[] = {{ "IPV", 3 }, { "IP_CONFIG", 9 }, { "IP_ADDR", 7 }, { "NETMASK", 7 }, { "GATEWAY", 7 }, { "BROADCAST", 9 }, { "DNS1", 4 }, { "DNS2", 4 }, { "ARP", 3 }, { "IP_ROUTING", 10 }}; |
294 | measured_string_ref configuration; |
294 | measured_string_ref configuration; |
295 | size_t count = sizeof( names ) / sizeof( measured_string_t ); |
295 | size_t count = sizeof( names ) / sizeof( measured_string_t ); |
296 | char * data; |
296 | char * data; |
- | 297 | measured_string_t address; |
|
297 | int index; |
298 | int index; |
298 | ip_route_ref route; |
299 | ip_route_ref route; |
299 | in_addr_t gateway; |
300 | in_addr_t gateway; |
300 | 301 | ||
301 | ip_netif->arp = NULL; |
302 | ip_netif->arp = NULL; |
Line 355... | Line 356... | ||
355 | ip_netif->arp = NULL; |
356 | ip_netif->arp = NULL; |
356 | } |
357 | } |
357 | ip_netif->routing = configuration[ 9 ].value && ( configuration[ 9 ].value[ 0 ] == 'y' ); |
358 | ip_netif->routing = configuration[ 9 ].value && ( configuration[ 9 ].value[ 0 ] == 'y' ); |
358 | net_free_settings( configuration, data ); |
359 | net_free_settings( configuration, data ); |
359 | } |
360 | } |
- | 361 | // binds the netif service which also initializes the device |
|
360 | ip_netif->phone = bind_service( ip_netif->service, ( ipcarg_t ) ip_netif->device_id, SERVICE_IP, 0, ip_globals.client_connection ); |
362 | ip_netif->phone = bind_service( ip_netif->service, ( ipcarg_t ) ip_netif->device_id, SERVICE_IP, 0, ip_globals.client_connection ); |
361 | if( ip_netif->phone < 0 ){ |
363 | if( ip_netif->phone < 0 ){ |
362 | printf( "Failed to contact the nil service %d\n", ip_netif->service ); |
364 | printf( "Failed to contact the nil service %d\n", ip_netif->service ); |
363 | return ip_netif->phone; |
365 | return ip_netif->phone; |
364 | } |
366 | } |
365 | // MUST BE AFTER the bind_service up there! |
367 | // has to be after the device netif module initialization |
366 | if( ip_netif->arp ){ |
368 | if( ip_netif->arp ){ |
367 | if( route ){ |
369 | if( route ){ |
368 | configuration[ 0 ].value = ( char * ) & route->address.s_addr; |
370 | address.value = ( char * ) & route->address.s_addr; |
369 | configuration[ 0 ].length = CONVERT_SIZE( in_addr_t, char, 1 ); |
371 | address.length = CONVERT_SIZE( in_addr_t, char, 1 ); |
370 | ERROR_PROPAGATE( arp_device_req( ip_netif->arp->phone, ip_netif->device_id, SERVICE_IP, ip_netif->service, & configuration[ 0 ] )); |
372 | ERROR_PROPAGATE( arp_device_req( ip_netif->arp->phone, ip_netif->device_id, SERVICE_IP, ip_netif->service, & address )); |
371 | }else{ |
373 | }else{ |
372 | ip_netif->arp = 0; |
374 | ip_netif->arp = 0; |
373 | } |
375 | } |
374 | } |
376 | } |
375 | // get packet dimensions |
377 | // get packet dimensions |