/branches/network/uspace/srv/net/net/net_standalone.c |
---|
80,8 → 80,8 |
task_id = spawn( "/srv/ip" ); |
if( ! task_id ) return EINVAL; |
ERROR_PROPAGATE( add_module( NULL, & net_globals.modules, IP_NAME, IP_FILENAME, SERVICE_IP, task_id, ip_connect_module )); |
// if( ! spawn( "/srv/udp" )) return EINVAL; |
// if( ! spawn( "/srv/tcp" )) return EINVAL; |
if( ! spawn( "/srv/udp" )) return EINVAL; |
if( ! spawn( "/srv/tcp" )) return EINVAL; |
// if( ! spawn( "/srv/socket" )) return EINVAL; |
// not always necesssary |
// if( ! spawn( "/srv/arp" )) return EINVAL; |
100,6 → 100,7 |
ERROR_PROPAGATE( add_configuration( & netif->configuration, "IP_CONFIG", "static" )); |
ERROR_PROPAGATE( add_configuration( & netif->configuration, "IP_ADDR", "127.0.0.1" )); |
ERROR_PROPAGATE( add_configuration( & netif->configuration, "NETMASK", "255.0.0.0" )); |
ERROR_PROPAGATE( add_configuration( & netif->configuration, "MTU", "15535" )); |
}else if( str_lcmp( name, "ne2k", 4 ) == 0 ){ |
ERROR_PROPAGATE( add_configuration( & netif->configuration, "NAME", "eth0" )); |
ERROR_PROPAGATE( add_configuration( & netif->configuration, "NETIF", DP8390_NAME )); |
110,10 → 111,10 |
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" )); |
ERROR_PROPAGATE( add_configuration( & netif->configuration, "MTU", "1492" )); |
ERROR_PROPAGATE( add_configuration( & netif->configuration, "MTU", "576" )); |
ERROR_PROPAGATE( add_configuration( & netif->configuration, "IP_CONFIG", "static" )); |
ERROR_PROPAGATE( add_configuration( & netif->configuration, "IP_ADDR", "10.0.2.15" )); |
ERROR_PROPAGATE( add_configuration( & netif->configuration, "NETMASK", "255.255.255.0" )); |
ERROR_PROPAGATE( add_configuration( & netif->configuration, "NETMASK", "255.255.255.240" )); |
ERROR_PROPAGATE( add_configuration( & netif->configuration, "BROADCAST", "10.0.2.255" )); |
ERROR_PROPAGATE( add_configuration( & netif->configuration, "GATEWAY", "10.0.2.2" )); |
ERROR_PROPAGATE( add_configuration( & netif->configuration, "DNS1", "10.0.2.2" )); |
/branches/network/uspace/srv/net/net/net_bundle.c |
---|
49,6 → 49,8 |
#include "../il/arp/arp_module.h" |
#include "../il/ip/ip_module.h" |
#include "../tl/udp/udp_module.h" |
#include "../tl/tcp/tcp_module.h" |
#include "net.h" |
57,7 → 59,8 |
extern net_globals_t net_globals; |
int module_message( ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count ){ |
if( IS_NET_IL_MESSAGE( call )){ |
if(( IPC_GET_METHOD( * call ) == IPC_M_CONNECT_TO_ME ) |
|| IS_NET_IL_MESSAGE( call )){ |
switch( IPC_GET_TARGET( call )){ |
case SERVICE_IP: |
return ip_message( callid, call, answer, answer_count ); |
66,6 → 69,15 |
default: |
return EINVAL; |
} |
}else if( IS_NET_TL_MESSAGE( call )){ |
switch( IPC_GET_TARGET( call )){ |
case SERVICE_UDP: |
return udp_message( callid, call, answer, answer_count ); |
case SERVICE_TCP: |
return tcp_message( callid, call, answer, answer_count ); |
default: |
return EINVAL; |
} |
}else if( IS_NET_IP_MESSAGE( call ) || IS_NET_NIL_MESSAGE( call )){ |
return ip_message( callid, call, answer, answer_count ); |
}else if( IS_NET_ARP_MESSAGE( call )){ |
74,11 → 86,11 |
return rarp_message( callid, call, answer, answer_count ); |
}else if( IS_NET_ICMP_MESSAGE( call )){ |
return icmp_message( callid, call, answer, answer_count ); |
}else if( IS_NET_UDP_MESSAGE( call )){ |
*/ }else if( IS_NET_UDP_MESSAGE( call )){ |
return udp_message( callid, call, answer, answer_count ); |
}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_PACKET_MESSAGE( call )){ |
114,10 → 126,10 |
// ERROR_PROPAGATE( rarp_initialize( client_connection )); |
// ERROR_PROPAGATE( REGISTER_ME( SERVICE_ICMP, & phonehash )); |
// ERROR_PROPAGATE( icmp_initialize( client_connection )); |
// ERROR_PROPAGATE( REGISTER_ME( SERVICE_UDP, & phonehash )); |
// ERROR_PROPAGATE( udp_initialize( client_connection )); |
// ERROR_PROPAGATE( REGISTER_ME( SERVICE_TCP, & phonehash )); |
// ERROR_PROPAGATE( tcp_initialize( client_connection )); |
ERROR_PROPAGATE( REGISTER_ME( SERVICE_UDP, & phonehash )); |
ERROR_PROPAGATE( udp_initialize( client_connection )); |
ERROR_PROPAGATE( REGISTER_ME( SERVICE_TCP, & phonehash )); |
ERROR_PROPAGATE( tcp_initialize( client_connection )); |
// ERROR_PROPAGATE( REGISTER_ME( SERVICE_SOCKET, & phonehash )); |
// ERROR_PROPAGATE( socket_initialize( client_connection )); |
// ERROR_PROPAGATE( REGISTER_ME( SERVICE_ETHERNET, & phonehash )); |
135,6 → 147,7 |
ERROR_PROPAGATE( add_configuration( & netif->configuration, "IP_CONFIG", "static" )); |
ERROR_PROPAGATE( add_configuration( & netif->configuration, "IP_ADDR", "127.0.0.1" )); |
ERROR_PROPAGATE( add_configuration( & netif->configuration, "NETMASK", "255.0.0.0" )); |
ERROR_PROPAGATE( add_configuration( & netif->configuration, "MTU", "15535" )); |
}else if( str_lcmp( name, "ne2k", 4 ) == 0 ){ |
ERROR_PROPAGATE( add_configuration( & netif->configuration, "NAME", "eth0" )); |
ERROR_PROPAGATE( add_configuration( & netif->configuration, "NETIF", DP8390_NAME )); |
147,7 → 160,7 |
ERROR_PROPAGATE( add_configuration( & netif->configuration, "MTU", "1492" )); |
ERROR_PROPAGATE( add_configuration( & netif->configuration, "IP_CONFIG", "static" )); |
ERROR_PROPAGATE( add_configuration( & netif->configuration, "IP_ADDR", "10.0.2.15" )); |
ERROR_PROPAGATE( add_configuration( & netif->configuration, "NETMASK", "255.255.255.0" )); |
ERROR_PROPAGATE( add_configuration( & netif->configuration, "NETMASK", "255.255.255.240" )); |
ERROR_PROPAGATE( add_configuration( & netif->configuration, "BROADCAST", "10.0.2.255" )); |
ERROR_PROPAGATE( add_configuration( & netif->configuration, "GATEWAY", "10.0.2.2" )); |
ERROR_PROPAGATE( add_configuration( & netif->configuration, "DNS1", "10.0.2.2" )); |
/branches/network/uspace/srv/net/net/net_remote.c |
---|
49,11 → 49,11 |
//#include "net_messages.h" |
int net_get_device_conf_req( int net_phone, device_id_t device_id, measured_string_ref * configuration, int count, char ** data ){ |
int net_get_device_conf_req( int net_phone, device_id_t device_id, measured_string_ref * configuration, size_t count, char ** data ){ |
return generic_translate_req( net_phone, NET_NET_GET_DEVICE_CONF, device_id, 0, * configuration, count, configuration, data ); |
} |
int net_get_conf_req( int net_phone, measured_string_ref * configuration, int count, char ** data ){ |
int net_get_conf_req( int net_phone, measured_string_ref * configuration, size_t count, char ** data ){ |
return generic_translate_req( net_phone, NET_NET_GET_DEVICE_CONF, 0, 0, * configuration, count, configuration, data ); |
} |
/branches/network/uspace/srv/net/net/net.c |
---|
127,7 → 127,7 |
* @param data The found configuration settings data. Output parameter. |
* @returns EOK. |
*/ |
int net_get_conf( measured_strings_ref netif_conf, measured_string_ref configuration, int count, char ** data ); |
int net_get_conf( measured_strings_ref netif_conf, measured_string_ref configuration, size_t count, char ** data ); |
/** Networking module global data. |
*/ |
160,7 → 160,7 |
return EOK; |
} |
int net_get_device_conf_req( int net_phone, device_id_t device_id, measured_string_ref * configuration, int count, char ** data ){ |
int net_get_device_conf_req( int net_phone, device_id_t device_id, measured_string_ref * configuration, size_t count, char ** data ){ |
netif_ref netif; |
if( !( configuration && ( count > 0 ))) return EINVAL; |
172,14 → 172,14 |
} |
} |
int net_get_conf_req( int net_phone, measured_string_ref * configuration, int count, char ** data ){ |
int net_get_conf_req( int net_phone, measured_string_ref * configuration, size_t count, char ** data ){ |
if( !( configuration && ( count > 0 ))) return EINVAL; |
return net_get_conf( NULL, * configuration, count, data ); |
} |
int net_get_conf( measured_strings_ref netif_conf, measured_string_ref configuration, int count, char ** data ){ |
int net_get_conf( measured_strings_ref netif_conf, measured_string_ref configuration, size_t count, char ** data ){ |
measured_string_ref setting; |
int index; |
size_t index; |
if( data ) * data = NULL; |
for( index = 0; index < count; ++ index ){ |
/branches/network/uspace/srv/net/net/Makefile |
---|
53,10 → 53,13 |
ifeq ($(NETWORKING), module) |
SOURCES += $(NAME)_bundle.c \ |
$(NET_BASE)crc.c \ |
$(NET_BASE)il/arp/arp.c \ |
$(NET_BASE)il/ip/ip.c \ |
$(NET_BASE)sockaddr.c |
# $(NET_BASE)tl/tcp/tcp.c |
$(NET_BASE)il/ip/ip_client.c \ |
$(NET_BASE)sockaddr.c \ |
$(NET_BASE)tl/tcp/tcp.c \ |
$(NET_BASE)tl/udp/udp.c |
else |