Changes in / [aa85487:137691a] in mainline
- Files:
-
- 14 deleted
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
boot/Makefile.common
raa85487 r137691a 91 91 $(USPACEDIR)/srv/net/net/net \ 92 92 $(USPACEDIR)/srv/net/netif/lo/lo \ 93 $(USPACEDIR)/srv/net/netif/dp8390/dp8390 \ 93 94 $(USPACEDIR)/srv/net/nil/eth/eth \ 94 95 $(USPACEDIR)/srv/net/nil/nildummy/nildummy \ … … 104 105 NET_CFG = \ 105 106 $(USPACEDIR)/srv/net/cfg/$(NETWORKING)/general \ 106 $(USPACEDIR)/srv/net/cfg/$(NETWORKING)/lo 107 108 ifeq ($(CONFIG_NETIF_DP8390),y) 109 NET_SRVS += $(USPACEDIR)/srv/net/netif/dp8390/dp8390 110 111 NET_CFG += $(USPACEDIR)/srv/net/cfg/$(NETWORKING)/ne2k 107 $(USPACEDIR)/srv/net/cfg/$(NETWORKING)/lo \ 108 $(USPACEDIR)/srv/net/cfg/$(NETWORKING)/ne2k 112 109 endif 113 110 … … 133 130 endif 134 131 endif 135 endif 132 -
uspace/srv/net/Makefile
raa85487 r137691a 31 31 DIRS = \ 32 32 netif/lo \ 33 netif/dp8390 \ 33 34 nil/eth \ 34 35 nil/nildummy \ … … 47 48 tl/udp \ 48 49 tl/tcp \ 49 50 ifeq ($(CONFIG_NETIF_DP8390),y)51 DIRS += netif/dp839052 endif53 50 54 51 DIRS_ALL = $(DIRS) $(DIRS_MODULAR) -
uspace/srv/net/include/socket.h
raa85487 r137691a 61 61 * @returns EPROTONOSUPPORT if the protocol is not supported. 62 62 * @returns ENOMEM if there is not enough memory left. 63 * @returns ELIMIT if there was not a free socket identifier found this time.64 63 * @returns Other error codes as defined for the NET_SOCKET message. 65 64 * @returns Other error codes as defined for the bind_service_timeout() function. -
uspace/srv/net/module.c
raa85487 r137691a 110 110 res = module_message( callid, & call, & answer, & answer_count ); 111 111 112 if(( IPC_GET_METHOD( call ) == IPC_M_PHONE_HUNGUP ) || ( res == EHANGUP )){ 113 return; 114 } 112 if( IPC_GET_METHOD( call ) == IPC_M_PHONE_HUNGUP ) return; 115 113 116 114 answer_call( callid, res, & answer, answer_count ); -
uspace/srv/net/tl/icmp/icmp.c
raa85487 r137691a 658 658 ipc_callid_t data_callid; 659 659 icmp_echo_ref echo_data; 660 int res;661 660 662 661 /* … … 664 663 * - Answer the first NET_ICMP_INIT call. 665 664 */ 666 res = EOK; 667 answer_count = 0; 665 ipc_answer_0( callid, EOK ); 668 666 669 667 // fibril_rwlock_initialize( & lock ); … … 671 669 echo_data = ( icmp_echo_ref ) malloc( sizeof( * echo_data )); 672 670 if( ! echo_data ) return ENOMEM; 673 674 671 // assign a new identifier 675 672 fibril_rwlock_write_lock( & icmp_globals.lock ); 676 res= icmp_bind_free_id( echo_data );673 ERROR_CODE = icmp_bind_free_id( echo_data ); 677 674 fibril_rwlock_write_unlock( & icmp_globals.lock ); 678 if( res< 0 ){675 if( ERROR_CODE < 0 ){ 679 676 free( echo_data ); 680 return res;677 return ERROR_CODE; 681 678 } 682 679 683 680 while( keep_on_going ){ 684 685 // answer the call686 answer_call( callid, res, & answer, answer_count );687 688 // refresh data689 681 refresh_answer( & answer, & answer_count ); 690 682 691 // get the next call692 683 callid = async_get_call( & call ); 693 684 694 // process the call695 685 switch( IPC_GET_METHOD( call )){ 696 686 case IPC_M_PHONE_HUNGUP: 697 687 keep_on_going = false; 698 res = EHANGUP;688 ERROR_CODE = EOK; 699 689 break; 700 690 case NET_ICMP_ECHO: 701 691 // fibril_rwlock_write_lock( & lock ); 702 692 if( ! async_data_write_receive( & data_callid, & length )){ 703 res= EINVAL;693 ERROR_CODE = EINVAL; 704 694 }else{ 705 695 addr = malloc( length ); 706 696 if( ! addr ){ 707 res= ENOMEM;697 ERROR_CODE = ENOMEM; 708 698 }else{ 709 699 if( ! ERROR_OCCURRED( async_data_write_finalize( data_callid, addr, length ))){ 710 700 fibril_rwlock_write_lock( & icmp_globals.lock ); 711 res= icmp_echo( echo_data->identifier, echo_data->sequence_number, ICMP_GET_SIZE( call ), ICMP_GET_TIMEOUT( call ), ICMP_GET_TTL( call ), ICMP_GET_TOS( call ), ICMP_GET_DONT_FRAGMENT( call ), addr, ( socklen_t ) length );701 ERROR_CODE = icmp_echo( echo_data->identifier, echo_data->sequence_number, ICMP_GET_SIZE( call ), ICMP_GET_TIMEOUT( call ), ICMP_GET_TTL( call ), ICMP_GET_TOS( call ), ICMP_GET_DONT_FRAGMENT( call ), addr, ( socklen_t ) length ); 712 702 fibril_rwlock_write_unlock( & icmp_globals.lock ); 713 703 free( addr ); … … 717 707 echo_data->sequence_number = 0; 718 708 } 719 }else{720 res = ERROR_CODE;721 709 } 722 710 } … … 725 713 break; 726 714 default: 727 res= icmp_process_message( & call );715 ERROR_CODE = icmp_process_message( & call ); 728 716 } 717 718 answer_call( callid, ERROR_CODE, & answer, answer_count ); 729 719 } 730 720 … … 733 723 icmp_echo_data_exclude( & icmp_globals.echo_data, echo_data->identifier ); 734 724 fibril_rwlock_write_unlock( & icmp_globals.lock ); 735 return res;725 return EOK; 736 726 } 737 727 -
uspace/srv/net/tl/tcp/tcp.c
raa85487 r137691a 1070 1070 * - Answer the first IPC_M_CONNECT_ME_TO call. 1071 1071 */ 1072 res = EOK; 1073 answer_count = 0; 1072 ipc_answer_0( callid, EOK ); 1074 1073 1075 1074 socket_cores_initialize( & local_sockets ); … … 1077 1076 1078 1077 while( keep_on_going ){ 1079 1080 // answer the call1081 answer_call( callid, res, & answer, answer_count );1082 1083 1078 // refresh data 1084 1079 refresh_answer( & answer, & answer_count ); 1085 1080 1086 // get the next call1087 1081 callid = async_get_call( & call ); 1088 1089 // process the call 1082 // printf( "message %d\n", IPC_GET_METHOD( * call )); 1083 1090 1084 switch( IPC_GET_METHOD( call )){ 1091 1085 case IPC_M_PHONE_HUNGUP: 1092 1086 keep_on_going = false; 1093 res = E HANGUP;1087 res = EOK; 1094 1088 break; 1095 1089 case NET_SOCKET: … … 1237 1231 break; 1238 1232 } 1233 1234 // printf( "res = %d\n", res ); 1235 1236 answer_call( callid, res, & answer, answer_count ); 1239 1237 } 1240 1238 … … 1275 1273 // TODO release as connection lost 1276 1274 //tcp_refresh_socket_data( socket_data ); 1277 } else{1278 1279 tcp_retransmit_packet( socket, socket_data, timeout->sequence_number );1280 }1275 } 1276 // retransmit 1277 // TODO enable retransmit 1278 //tcp_retransmit_packet( socket, socket_data, timeout->sequence_number ); 1281 1279 fibril_rwlock_write_unlock( socket_data->local_lock ); 1282 1280 }else{ -
uspace/srv/net/tl/udp/udp.c
raa85487 r137691a 390 390 fibril_rwlock_write_unlock( & udp_globals.lock ); 391 391 async_msg_5( socket->phone, NET_SOCKET_RECEIVED, ( ipcarg_t ) socket->socket_id, packet_dimension->content, 0, 0, ( ipcarg_t ) fragments ); 392 return EOK; 392 /* fibril_rwlock_write_unlock( & udp_globals.lock ); 393 async_msg_5( socket->phone, NET_SOCKET_RECEIVED, ( ipcarg_t ) socket->socket_id, 0, 0, 0, ( ipcarg_t ) fragments ); 394 */ return EOK; 393 395 } 394 396 … … 427 429 * - Answer the first IPC_M_CONNECT_TO_ME call. 428 430 */ 429 res = EOK; 430 answer_count = 0; 431 ipc_answer_0( callid, EOK ); 431 432 432 433 // The client connection is only in one fibril and therefore no additional locks are needed. … … 436 437 437 438 while( keep_on_going ){ 438 439 // answer the call440 answer_call( callid, res, & answer, answer_count );441 442 439 // refresh data 443 440 refresh_answer( & answer, & answer_count ); 444 441 445 // get the next call446 442 callid = async_get_call( & call ); 447 448 // process the call 443 // printf( "message %d\n", IPC_GET_METHOD( * call )); 444 449 445 switch( IPC_GET_METHOD( call )){ 450 446 case IPC_M_PHONE_HUNGUP: 451 447 keep_on_going = false; 452 res = E HANGUP;448 res = EOK; 453 449 break; 454 450 case NET_SOCKET: … … 518 514 break; 519 515 } 516 517 // printf( "res = %d\n", res ); 518 519 answer_call( callid, res, & answer, answer_count ); 520 520 } 521 521 … … 523 523 socket_cores_release( udp_globals.net_phone, & local_sockets, & udp_globals.sockets, NULL ); 524 524 525 return res;525 return EOK; 526 526 } 527 527 … … 618 618 header->checksum = 0; 619 619 if( udp_globals.checksum_computing ){ 620 // update the pseudo header 621 if( ERROR_OCCURRED( ip_client_set_pseudo_header_data_length( ip_header, headerlen, total_length + UDP_HEADER_SIZE ))){ 620 // if( ERROR_OCCURRED( ip_get_route_req( udp_globals.ip_phone, IPPROTO_UDP, addr, addrlen, & device_id, & ip_header, & headerlen ))){ 621 // return udp_release_and_return( packet, ERROR_CODE ); 622 // } 623 if( ERROR_OCCURRED( ip_client_set_pseudo_header_data_length( ip_header, headerlen, total_length + UDP_HEADER_SIZE))){ 622 624 free( ip_header ); 623 625 return udp_release_and_return( packet, ERROR_CODE ); 624 626 } 625 // finish the checksum computation626 627 checksum = compute_checksum( checksum, ip_header, headerlen ); 627 628 checksum = compute_checksum( checksum, ( uint8_t * ) header, sizeof( * header ));
Note:
See TracChangeset
for help on using the changeset viewer.