Subversion Repositories HelenOS

Compare Revisions

Ignore whitespace Rev 4260 → Rev 4261

/branches/network/uspace/srv/net/networking/networking.c
58,7 → 58,8
#include "../il/ip/ip_messages.h"
#include "../include/device.h"
#include "../include/netif_messages.h"
 
#include "../include/nil_messages.h"
/*
#if IP_BUNDLE
 
#include "../ip/ip_module.h"
70,7 → 71,7
#include "../tcp/tcp_module.h"
 
#endif
 
*/
#define NAME "Networking"
 
#define LO_NAME "lo"
167,11 → 168,11
}
 
int networking_message( ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count ){
#ifdef NETWORKING_module
/*#ifdef NETWORKING_module
//TODO map to *_message
if( IS_NET_IL_MESSAGE( call ) || IS_NET_IP_MESSAGE( call )){
return ip_message( callid, call, answer, answer_count );
/* }else if( IS_NET_ARP_MESSAGE( call )){
*//* }else if( IS_NET_ARP_MESSAGE( call )){
return arp_message( callid, call, answer, answer_count );
*//* }else if( IS_NET_RARP_MESSAGE( call )){
return rarp_message( callid, call, answer, answer_count );
179,22 → 180,23
return icmp_message( callid, call, answer, answer_count );
*//* }else if( IS_NET_UDP_MESSAGE( call )){
return udp_message( callid, call, answer, answer_count );
*/ }else if( IS_NET_TCP_MESSAGE( call )){
*//* }else if( IS_NET_TCP_MESSAGE( call )){
return tcp_message( callid, call, answer, answer_count );
/* }else if( IS_NET_SOCKET_MESSAGE( call )){
*//* }else if( IS_NET_SOCKET_MESSAGE( call )){
return socket_message( callid, call, answer, answer_count );
*//* }else if( IS_NET_NIL_MESSAGE( call ) || IS_NET_ETHERNET_MESSAGE( call )){
return ethernet_message( callid, call, answer, answer_count );
*/ }else{
*//* }else{
#endif
if( IS_NET_PACKET_MESSAGE( call )){
*/ if( IS_NET_PACKET_MESSAGE( call )){
return packet_server_message( callid, call, answer, answer_count );
}else{
return net_message( callid, call, answer, answer_count );
}
#ifdef NETWORKING_module
/*#ifdef NETWORKING_module
}
#endif
*/
}
 
int networking_start_module( async_client_conn_t client_connection ){
233,7 → 235,7
ERROR_PROPAGATE( add_module( NULL, & networking_globals.modules, DP8390_NAME, DP8390_FILENAME, SERVICE_DP8390, 0 ));
ERROR_PROPAGATE( add_module( NULL, & networking_globals.modules, ETHERNET_NAME, ETHERNET_FILENAME, SERVICE_ETHERNET, 0 ));
 
#ifdef NETWORKING_modular
//#ifdef NETWORKING_modular
task_id = spawn( "/srv/ip" );
if( ! task_id ) return EINVAL;
ERROR_PROPAGATE( add_module( NULL, & networking_globals.modules, IP_NAME, IP_FILENAME, SERVICE_IP, task_id ));
244,7 → 246,7
// if( ! spawn( "/srv/arp" )) return EINVAL;
// if( ! spawn( "/srv/rarp" )) return EINVAL;
// if( ! spawn( "/srv/icmp" )) return EINVAL;
 
/*
#else
#ifdef NETWORKING_module
ipcarg_t phonehash;
268,7 → 270,7
// ERROR_PROPAGATE( ethernet_initialize());
#endif
#endif
 
*/
return EOK;
}
 
429,7 → 431,13
}else if( strncmp( name, "ne2k", 4 ) == 0 ){
ERROR_PROPAGATE( add_configuration( & netif->configuration, "NAME", "eth0" ));
ERROR_PROPAGATE( add_configuration( & netif->configuration, "NETIF", DP8390_NAME ));
#ifdef NETWORKING_module
// ethernet bundled in dp8390
ERROR_PROPAGATE( add_configuration( & netif->configuration, "NIL", DP8390_NAME ));
#else
// standalone ethernet
ERROR_PROPAGATE( add_configuration( & netif->configuration, "NIL", ETHERNET_NAME ));
#endif
ERROR_PROPAGATE( add_configuration( & netif->configuration, "IL", IP_NAME ));
ERROR_PROPAGATE( add_configuration( & netif->configuration, "IRQ", "9" ));
ERROR_PROPAGATE( add_configuration( & netif->configuration, "IO", "300" ));
493,13 → 501,13
setting = measured_strings_find( & networking_globals.configuration, CONF_MTU, 0 );
}
mtu = setting ? strtol( setting->value, NULL, 10 ) : 0;
ERROR_PROPAGATE( async_req_3_0( netif->nil->phone, NET_NIL_DEVICE, netif->id, mtu, netif->driver->service ));
ERROR_PROPAGATE( nil_device_req( netif->nil->phone, netif->id, mtu, netif->driver->service ));
internet_service = netif->nil->service;
}else{
internet_service = netif->driver->service;
}
// TODO IL_BUNDLE
ERROR_PROPAGATE( async_req_2_0( netif->il->phone, NET_IL_DEVICE, netif->id, internet_service ));
ERROR_PROPAGATE( async_req_3_0( netif->il->phone, NET_IL_DEVICE, netif->id, 0, internet_service ));
ERROR_PROPAGATE( netif_start_req( netif->driver->phone, netif->id ));
return EOK;
}
/branches/network/uspace/srv/net/networking/Makefile
31,7 → 31,7
NET_BASE = ../
STRUCTURES = $(NET_BASE)structures/
 
include ../../../../Makefile.config
include $(NET_BASE)../../../Makefile.config
 
## Sources
#